$pic_dir = "lans/atllan3"; $title = "ragingangels.lans.atlanta#3"; $lan_desc = "These pictures were taken at the Third Semi-Annual SouthEast Tribes LAN Party hosted by (-RA-)Narcist on 13, 14, & 15 July 2001."; /////////////////////////////////////////////////////////////////////////////// function RemoveNewLines (&$item, $key) { $item = chop($item); } function GetFileList ( $dirname ) { $files = array(); $dir = opendir ($dirname); while ($file = readdir ($dir)) { /* if (eregi("\.jpe?g$", $file) || eregi("\.gif$", $file) || eregi("\.png$", $file)) */ if (eregi("\.gif$", $file)) { $files[] = $file; } } closedir ($dir); sort ($files); return $files; } function ReadImageFromFile ( $filename, $type ) { $imagetypes = ImageTypes(); switch ($type) { case 1 : if ($imagetypes & IMG_GIF) return ImageCreateFromGIF ($filename); break; case 2 : if ($imagetypes & IMG_JPEG) return ImageCreateFromJPEG ($filename); break; case 3 : if ($imagetypes & IMG_PNG) return ImageCreateFromPNG ($filename); break; default: return 0; } } function build_table ( ) { global $pic_dir, $thumb_dir, $start; global $back, $next, $pageno; global $PHP_SELF; // Build complete file list $imagelist = GetFileList ($pic_dir); $lastimage = count($imagelist) - 1; // Build our range of six pics if (!$start) $start = 0; if (($start < 0) || ($start > $lastimage)) $start = 0; $end = $start + 5; if ($end > $lastimage) $end = $lastimage; // Build up back and next link text and page number if ($start < 6) $back_start = 0; else $back_start = $start - 6; if ($start == 0) $back = "back"; else $back = sprintf ("back", $PHP_SELF, $back_start); if ($end < $lastimage) $next = sprintf ("next", $PHP_SELF, $end + 1); else $next = "next"; $pageno = floor($start / 6) + 1; // Output gallery table echo "