Photo Gallery
=stripslashes($thumbArray[$i]->name)?>
if ((sizeOf($thumbArray) - $i - 1) % 5 == 4) { ?>include_once 'inc/declare.php'; include_once 'inc/contentutil.php'; class Thumb { public $url; public $name; } // Load thumbnail file names into an array from the ./photo/thumbs/ folder. if ($thumbFolder = opendir("photos/thumbs")) { $thumbArray = array(); // Until all files are read. while ($thumb = readdir($thumbFolder)) { // If the last 6 characters are '_t.jpg' if (strripos($thumb, "_t.jpg", 1) == strlen($thumb) - 6) { $thumbObj = new Thumb(); // Put (relative) file path into a variable. Escape characters later after this // path is used within the php to retrieve the image info. $thumbURL = "photos/thumbs/".$thumb; // Strip the file extension and number off the filename. Then insert into thumb object. $thumbTitle = substr($thumb, 0, strlen($thumb)-6); $thumbTitle = substr($thumbTitle, 3, strlen($thumbTitle)+1); $thumbTitle = str_replace("'", "\'", $thumbTitle); $thumbObj->name = $thumbTitle; // Format url to send to Javascript (after it's been used within the PHP). // Apparently the magic quotes aren't applied because of the way it was loaded. // Then insert into thumb object. $thumbURL = str_replace("'", "\'", $thumbURL); $thumbObj->url = $thumbURL; // Insert thumb object into array at the index prescibed by the filename number. $thumbNumber = substr($thumb, 0, 2); $thumbArray[$thumbNumber-1] = $thumbObj; } } } $title = "Concert Photos"; include_once 'inc/head.php'; ?>
=stripslashes($thumbArray[$i]->name)?>
if ((sizeOf($thumbArray) - $i - 1) % 5 == 4) { ?>