4, "thumbsize" => "25%", "imagedir" => ".", "thumbdir" => "tiny", "altdir" => "alt", "indexpage_title" => "Gargoyles", "imageregexp" => "(\.)(jpg|gif|png)($)" ); function image_dir(){ global $config; // Open the image directory for listing $dir = opendir ("./".$config['imagedir']."/"); // Read the directory into an array do { $filename = readdir($dir); if (ereg(".*".$config['imageregexp'], $filename)) $images[]=$filename; } while ($filename); closedir($dir); // Sort the files by name sort($images); return $images; } function altfile($filename){ global $config; $basefilename = ereg_replace("\.[a-zA-Z]*$", "", $filename); if (!file_exists($config['altdir']."/".$basefilename)) return false; return fopen($config['altdir']."/".$basefilename, "r"); } function view_image($image){ global $config; if (!file_exists($config['imagedir']."/".$image)) {print "Sorry, that image doesn't exist"; return false;} $altfile = altfile($image); if ($altfile){ $title = chop(fgets($altfile, 255)); while (!feof($altfile)) $body .= fgets($altfile, 65535); } $image_array = image_dir(); for ($x = 0; $x < sizeof($image_array); $x++){ if ($image_array[$x] == $image) {$imagenum = $x; break;} } // *************** This is the bit most people want to change ************** print (" $title
$title

$body

\"Previous\" \"home\" \"next\"

©2000 C.S. McDonald
"); // ************************************************************************* return 0; } function make_thumb($image){ global $config; copy ($config['imagedir']."/".$image, $config['thumbdir']."/".$image); print system ("/usr/bin/mogrify -geometry ".$config['thumbsize']." ".$config['thumbdir']."/".$image); return 0; } function view_index(){ global $config; ?> <?print $config['indexpage_title']?>

 


Hedgegoth's Sketchbook
Click on a thumbnail for the full sized image
$config['number_of_columns']-1) { print ("\n"); flush(); $y = 0; } $y++; unset($alt); $altfile = altfile($images[$x]); if ($altfile){ $alt = chop(fgets($altfile, 255)); } // ****************************** Might also want to change this ******************************** print ("
\"$alt\"\n"); // ********************************************************************************************** } ?>


©2000 C.S. McDonald
All Rights Reserved.