|LateNightHacking Projects 2002||Auth|
2002-01-07: I have been helping Tiffany Ross with the web site scripts for her web comic Alien Dice.
The calendar, drop down list, and daily/archived stip framework were written by me. The page layout and the content are all her. :) I learned basic PHP while writing these scripts.
/strips/- all images and text files go in this folder, in
YYYYMMDD.fffformat. Supported extensions are
/toc.xml- the TOC (table of contents) data file. The scripts are rather picky about the data in
groupbegins on the start date and ends when the next group begins. Inner groups span the time-period of the parent group and the first child must have the same start date as the parent. You'll get an error message if the data is not consistent.
/ad.css- common style sheet
/getfilelist.php- reads the contents of the strips directory into an array. Also has some date routines.
/gettoc.php- parses the XML TOC file into the internal array format.
/comictemplate.php- contains functions for writing parts of the web page, so that identical widgets appear on all the pages. Contains templates for writing the comic picture and text, the calendar, and the TOC widget.
/archive.php- archive display page - displays any arbitrary strip
/toc.php- displays every entry in the entire TOC on one page.
/index.php- main page, always shows the strip for the date closes to today
How to configure:
getfilelist.phphas a constant
STRIPDIRthat says where the strips are. (Probably doesn't need to be changed.)
gettoc.phphas a constant
TOCFILENAMEthat says where the TOC data file is. (Probably doesn't need to be changed.)
comictemplate.phphas a constant
ALTBASEwhich says the URL of the main page. (Note that this constant should not end in a slash.)
index.phpall have a
<Base>tag specifying the URL of the main page.
You can get the source via anonymous CVS at
cvs -d :pserver:firstname.lastname@example.org:/code-cvsroot co 2002/AlienDice
2002-09-10 : I have been doing some more work, addressing the latest requests from Tiffany. I have rewritten the TOC parser to use a new TOC format. The TOC now does not require a strict date ordering, but allows interleaved story lines. Plus this fixes the bug where you can't put anything in the TOC that happens in the future. :) I also added the concept of going to the next comic in TOC order rather than chronological order. This way you can step through the interleaved stories. I want to add support for a generic jump table before I give Tiffany the next release.
Oh, and I learned about PHP references and objects this time. I find it interesting that PHP is basically a home-grown interpreter following in Perl's footsteps. The language has a certian "amateur" flavor to it. It hasn't yet reached the "professional" level of Java or even Perl. Even though the underlying engine uses references extensively, it is not well exposed to the programmer. Lots of times I wanted to use a reference, I just didn't have the option. The whole "inability" to assign a reference to a global is pretty counter-intuitive.
2002-09-16 : Finished the changes. Added code for a jump box. The tag is
The descriptions above are out of date. I passed the code to Tiffany. She'll probably need
revisions, so I'll wait before doing more updates.
|Louis K. Thomas <loui sth@hotm ail.co m>||Auth||2002-09-16 (5336 days ago)|