bd on 24 Oct 2002 19:01:06 -0000 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [spoon-discuss] A Rant. |
On Wednesday 23 October 2002 08:19 pm, David E. Smith wrote: > On Wed, 23 Oct 2002, bd wrote: > > sub htmlize { > > my $message = shift @_; > > $message ~= s/</</; > > $message ~= s/>/>/; > > return "<pre>\n$message\n</pre>"; > > } > > ah, perl. You may have noticed that most scripts have a .php extension. ;) I'm a bit rusty with PHP. It should be simple to convert, as it's virtually all regexes. > Anyway, it's a bit more complicated than that, because surrouding > everything in PRE tags makes the text look goofy on most browsers > (monospace font, usually). Then use <BR>s at the end of each line. Like this: $message ~= s/$/<BR>/; > I had something like that for a very brief period, back around nweek 2 or > 3; everything looked bad, so I ritually purged the PRE tags and I don't > think anyone else ever saw my shame. http://www.archive.org might have saw(seen?) it. > I may go with some variant of BBtags, but that leads to its own sets of > problems (more or less the same problems, actually). Usually, they're > turned into HTML before getting stored away in the inevitable database. > The auto-generated HTML tends to be rather ugly... > > Either I have to store that fairly ugly auto-generated HTML (which means > that, later on, when someone wants to edit something, they have to clean > it all up), or I have to store text with BBtags, and then parse it every > time a page is generated or loaded (which would put a lot of extra load on > Joel's poor server). Yeah, the most frequent pages are pre-generated and > cached anyway, but this would make digging through revision histories > (which AREN'T pre-cached) painful for everyone involved. Do both. Store BBCode, and HTML. When BBCode is updated, regenerate HTML. > (I've already run into a cousin of this problem: The reason the > rules page is no longer created on-the-fly is that the Web server kills > the request before it's actually done. Between several hundred database > queries, text formatting, and having to feed all that data to some user > who's probably still on a 56K modem, the 30-second process limit built > into PHP comes up fairly often.) It dosen't need to be autogenerated. Just run a generator in cron. > ...dave > > _______________________________________________ > spoon-discuss mailing list > spoon-discuss@xxxxxxxxx > http://lists.ellipsis.cx/mailman/listinfo/spoon-discuss -- bd Immature poets imitate, mature poets steal. -- T.S. Eliot, "Philip Massinger" _______________________________________________ spoon-discuss mailing list spoon-discuss@xxxxxxxxx http://lists.ellipsis.cx/mailman/listinfo/spoon-discuss