### PHP Image Posting Code for BLUR 02 ### ## Functions to provide thumbnail and page display functionality. ################################################################# ## Function to read photo information from the data file and return an array. ## Data files exist for EACH directory (aka category) of image and are ## called 'photos.data' ## function getAllPhotoInfo($theDirectory) { if (file_exists($theDirectory."/photos.data")) { ## read each line of data file into array $photosData = file($theDirectory."/photos.data"); while (list($key,$val) = each($photosData)) { if ($key == "0") { ## first line of the data file is the category, not an image file $photos[$key]["category"] = chop($val); } else { ## split data line into it's parts and create image array entry. list($prefix,$title,$description) = split("\t",$val); $photos[$key]["small"] = $theDirectory."/".$prefix."_sm.jpg"; $photos[$key]["large"] = $theDirectory."/".$prefix."_lrg.jpg"; $photos[$key]["title"] = $title; $photos[$key]["description"] = $description; $photos[$key]["URL"] = "pop_win.php?dir=".urlencode($theDirectory)."&img=".urlencode($prefix); } } return $photos; } else { return 0; } } ## Function to display photo thumbnail grid ## function displayPhotoGrid($photoArray,$cols) { if ($photoArray) { $x = 0; print "
ERROR: No Photos
"; } } ?>
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
All rights reserved © New School University // 2002 |