|
From: Joseph F. R. <rya...@os...> - 2001-11-16 05:48:13
|
I was working on guestbook.pl tonight, and I noticed that we were still using Matt's antiquated way of rewriting the html file using heardocs. Why can't we simply let the user define their own design? It should be relatively trivial to use some basic html parsing so that the guestbook is read in, the header information remains intact, and the guestbook entries are inserted when the begin statement is encountered, before the footer gets spit back out. For instance: <html> <head> </head> <body> *BLAH* <!--BEGIN--> *BLAH* </body> </html> The algorithm would work something like this: first, the guestbook page is read in. It is gone through line by line, printing each line if it does not contain <!--BEGIN-->, until the first line where <!--BEGIN--> is encountered, at which point the loop exits. The entries are then printed. Then the rest of the page is printed. This way, entries are still sorted by newest first, and the integrity of the page remains intact. Better yet, since users of MWS already have his formatting, they won't even notice a difference. However, newer users will be able to design their page any way they choose, and yet their guestbook will still work. On an unrelated note, I am still having problems with CVS. I downloaded WinCVS and installed it successfully, but I couldn't figure out how to use it. CVS's super-massive manual wasn't much help either. I guess I'll just keep posting to my perlmonk site until I can figure this monster out... |