Jeremy,
On Wed, 25 Feb 2004 11:13:28 -0600, Jeremy Newman wrote:
I also think the idea of having screenshot descriptions is a good idea. I also agree with Dimi here (say it's not so!), having a simple text file for each shot. I would use my simple xml parser thing to do it (since it already exists). You create a file for each shot, 'wine_xx.xml', then get the description with the get_xml_tags() func.
Ha!, it seems like I just wrote it all now. I'll add the code, you can create the XML description files if you desire.
Everything except the template. But yeah, using an already existing function is better. Anyway, here is my version. With .desc files. Just to test sending patches inline without ruining the patch. Not tested, only checked on syntax.
Regards,
Paul
=================================================================== RCS file: /home/wine/lostwages/site,v retrieving revision 1.3 diff -u -r1.3 site --- site 16 Dec 2003 17:09:26 -0000 1.3 +++ site 25 Feb 2004 17:38:00 -0000 @@ -211,6 +211,21 @@
// Grab list of images from screenshot dir $shots = get_files($file_root."/images/shots","png"); + + // Get description files (*.desc) + $descrip_files = array(); + $descrip_files = get_files($file_root."/images/shots","desc"); + + // Get an array of description in this form: + // $descriptions[file name] = description + foreach($descrip_files as $value) + { + @$descrip_file = file("/images/shots/$value"); + + $description = implode('',$descrip_file); + + $descriptions[$value] = $value[1]; + }
// setup vars $total = count($shots) + 1; @@ -229,6 +244,9 @@
// display image $vars['im_'.$num] = $html->ahref($html->img($file_root.'/images/shots/wine_'.$c.'.png'), $file_root.'/images/shots/full/wine_'.$c.'.png'); + + // Description (if available) + $vars['des_' . $num] = $descriptions["wine_$c.desc"];
// end at 9 if ($num == 9 or $num == $total)