body { font-family: arial; font-size: medium; color: ".$site['font_color']."; background: ".$site['background_color']." url('".$site['background_image']."'); } table { white-space: normal; border-width: 0px; border-style: solid; border-color: #000; border-collapse: collapse; } tr { white-space: normal; border: 0px solid #000; } td { white-space: normal; border: 0px solid #000; } table.thumbs, table.thumbs tr, table.thumbs td { border-width: ".$thumb_table['border_width']."px; border-color: ".$thumb_table['border_color']."; } table.nav, table.nav tr, table.nav td { color : #".$nav['font-color']."; font-size : ".$nav['font-size']."; border-width: ".$nav['border_width']."px; border-color: ".$nav['border_color']."; margin: 3px; } table.nav a { text-decoration: ".$nav['link_decoration']."; } img.thumb { border-width: ".$thumb['border_width']."px; border-color: ".$thumb['border_color']."; border-style: solid; } img.main { border-width: ".$image['border_width']."px; border-color: ".$image['border_color']."; border-style: solid; } div.caption { font-size: x-small; margin-bottom: 2px; } table.bodyTable, table.bodyTable tr, table.bodyTable td { border: 0; } td.imageName { font-weight: ".$image_disp['filename_fontweight']."; color: ".$image_disp['filename_color']."; font-size: ".$image_disp['filename_fontsize']."; text-align: center; height: ".$image['textheight']."px; } td.imageCaption { font-weight: ".$image_disp['filename_fontweight']."; color: ".$image_disp['filename_color']."; font-size: ".$image_disp['filename_fontsize']."; text-align: center; } td.imageGal { font-weight: ".$image_disp['galname_fontweight']."; color: ".$image_disp['galname_color']."; font-size: ".$image_disp['galname_fontsize']."; text-align: center; height: ".$image['textheight']."px; } td.imageDisp { text-align: center; } a:link { color : #FFFFFF; } a:visited { color : #F5A005; } a:hover { color : #F5A005 } a:active { color : f00 } "; $site['javascript'] = " "; //-----DO NOT EDIT AFTER THIS LINE -------------------------------------------------------------- /* If you edit some thing something after this line, I hope you know what you are doing, because sometimes I'm not sure what I did in this scripts too *g* ;) - That's all folks - Don't panik *g* */ $ppp = $rows * $cols; //Securecheck if(!$thumb['width'] && !$thumb['height']) { die("You must set the thumbnail width in the configuration"); } if(!$image['width'] && !$image['height']) { die("You must set the image width in the configuration"); } if(!$rows || !$cols) { die("You must set the rows and columns in the configuration"); } class image_proc { var $type; function open($file) { global $type; $file = str_replace("+"," ",$file); if(function_exists(exif_imagetype) == true && exif_imagetype($file) != false) { $type = exif_imagetype($file); //get the imagetype with exif-support } else { if(strrchr(strtolower($file),".") == ".jpg") $type = 2; elseif(strrchr(strtolower($file),".") == ".jpeg") $type = 2; elseif(strrchr(strtolower($file),".") == ".png") $type = 3; elseif(strrchr(strtolower($file),".") == ".gif") $type = 1; else $type = "not supported"; } // echo "TYPE: \"".$type."\""; switch($type) { case 1: $im = @ImageCreateFromGIF ($file); //open the file to editmode if(!$im){DIE("Image creation failed!");} break; case 2: $im = @ImageCreateFromJPEG ($file); //open the file to editmode if(!$im){DIE("Image creation failed!");} break; case 3: $im = @ImageCreateFromPNG ($file); if(!$im){DIE("Image creation failed!");} break; default: $im = ImageCreate (150, 30); $bgc = ImageColorAllocate ($im, 255, 255, 255); $tc = ImageColorAllocate ($im, 0, 0, 0); ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc); ImageString($im, 1, 5, 5, "Can't open image: $file", $tc); break; } return $im; } function resize($file, $tnx="", $tny="", $img_qual="resample") { global $img_quality; $im = $this->open($file); // get some infos about the original $origwidth = imagesx($im); $origheight = imagesy($im); // calculation for the new data if($tny == "") { $tny = $origheight/($origwidth/$tnx); } if($tnx == "") { $tnx = $origwidth/($origheight/$tny); } // lets make a thumb and resize $im_new = imageCreateTrueColor($tnx, $tny); if ($img_quality == "resample") imageCopyResampled($im_new,$im,"0","0","0","0",$tnx,$tny,$origwidth,$origheight); else imageCopyResized($im_new,$im,"0","0","0","0",$tnx,$tny,$origwidth,$origheight); header("Content-type: image/jpg"); Imagejpeg($im_new); } function output($file, $tnx="", $tny="") { $im = $this->open($file); // get some infos about the original $origwidth = imagesx($im); $origheight = imagesy($im); // calculation for the new data if($tny == "") { $tny = $origheight/($origwidth/$tnx); } if($tnx == "") { $tnx = $origwidth/($origheight/$tny); } // lets make a thumb and resize $im_new = imageCreateTrueColor($tnx, $tny); imagecopyresized($im_new,$im,"0","0","0","0",$tnx,$tny,$origwidth,$origheight); // header("Content-type: image/jpg"); Imagejpeg($im_new); } function getHeight($file,$image_width,$image_height) { if($image_width > 0 && $image_height > 0) { $new['height'] = $image_height; $new['width'] = $image_width; return $new; } $im = $this->open($file); $oheight = imagesy($im); $owidth = imagesx($im); if ($image_width > $owidth) { $image_width = $owidth; } if ($image_height > $oheight) { $image_height = $oheight; } if($image_width > 0) { $new['width'] = $image_width; $new['height'] = ceil($oheight/($owidth/$image_width)); return $new; } if($image_height > 0) { $new['width'] = $owidth/($oheight/$image_height); $new['height'] = $image_height; return $new; } return $new; } } // collect all images in this directory function read_dir() { $path = dirname(_PATH_TRANSLATED); $cdir = dir($path); while($entry = $cdir->read()) { if((!is_dir($entry)) AND ((strrchr(strtolower($entry),".") == ".jpg") OR (strrchr(strtolower($entry),".") == ".jpeg") OR (strrchr(strtolower($entry),".") == ".png"))) { $images[] = urlencode($entry); } } sort($images); return $images; } function get_caption ($filename) { $cap = file('captions.txt'); foreach($cap as $val) { if (strstr($val,$filename)) { $capLen = strlen($val); $filLen = strlen($filename) + 1; $tehCap = substr($val, $filLen, $capLen); return $tehCap; } } return NULL; } if($text_display == "caption") { $captions = file('captions.txt'); foreach($captions as $captiona) { list($key,$val) = explode("|",$captiona); $caption[$key] = $val; } } else { $caption = NULL; } //OPERATEMODES switch($_GET[mode]) { case download: $filename = $_GET['selected']; header ("Content-type: octet/stream"); if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) header("Content-Disposition: filename=" . $filename); // For IE else header("Content-Disposition: attachment; filename=" . $filename); // For Other browsers readfile($filename); break; case thumb: $image_cl = new image_proc; $image_cl->resize(urldecode($_GET[selected]), $thumb['width'], $thumb['height'],$img_quality); break; case image: if(isset($_GET['selected'])) { if(!isset($_GET['inframe'])) { $image_cl = new image_proc; $dimensions = $image_cl->getHeight($_GET['selected'],$image['width'],$image['height']); $image_cl->resize(urldecode($_GET[selected]), $dimensions['width'], $dimensions['height'], $img_quality); } else { list($w,$h) = explode("x",$_GET["windowDim"]); echo "\n"; echo " \n"; echo $site['style']; echo $site['javascript']; echo "\n \n"; echo " \n"; echo " \n"; if ($show_gal_title == "1") { echo " \n"; } if ($show_image_name == "1" || $show_download_button == "1") { echo " \n"; } if ($show_image_caption == "1" && $image_caption_pos == "top") { if (get_caption($_GET['selected']) != NULL) { echo "\n"; } } echo " \n"; if ($show_image_caption == "1" && $image_caption_pos == "bottom") { if (get_caption($_GET['selected']) != NULL) { echo "\n"; } } echo "
".ucfirst($_GET['galname'])."
"; if ($show_image_name == "1") echo ucfirst($_GET['selected']); if ($show_download_button == "1") echo " [ Download ]"; echo "
"; echo get_caption($_GET['selected']); echo "
"; echo get_caption($_GET['selected']); echo "
\n"; echo " \n"; echo "\n"; } } break; default: $page = isset($_GET['page']) ? $_GET['page'] : 1; @$i = ($page - 1) * $ppp; if ($iframe_width > 0) { $frame_width = $iframe_width; } else { $frame_width = $image['width'] + 40; } if ($iframe_height > 0) { $frame_height = $iframe_height; } else { if ($image['height'] > 0) $frame_height = $image['height']; else $frame_height = $frame_width; } $popup_width = $image['width'] + 20; $popup_height = $popup_width; $images = read_dir(); $current_image = $images[$i]; $image_c2 = new image_proc(); $num_images = count($images); $num_pages = ceil($num_images / $ppp); $col_width = 100/$cols . "%"; $zcol = 0; $xhtml_thumbs = "\n\n"; while(($i < $num_images) && $i < ($page * $ppp)) { // $images[$i] = urlencode($images[$i]); if($text_display == "filename") { $caption[$images[$i]] = $images[$i]; } $galName = str_replace("/", "", dirname($_SERVER["PHP_SELF"])); $dimensions = $image_c2->getHeight($images[$i],$image['width'],$image['height']); $orig_width = $dimensions['width']; $orig_height = $dimensions['height']; $popup_width = ceil($orig_width + 20); $popup_height = ceil($orig_height + 45); if ($iframe_height == 0) { $frame_height = $orig_height; $new_width = ceil($orig_width + 40); if($new_width > $frame_width) { $frame_width = $new_width; } if($new_height > $frame_height) { $frame_height = $new_height; } $new_width = ceil($orig_width + 40); $new_height = ceil($orig_height + 40); if($new_height > $frame_height) { $frame_height = $new_height; } } if ($show_gal_title == "1") { $popup_height += $image['textheight']; } if ($show_image_name == "1") { $popup_height += $image['textheight']; } $xhtml_thumbs .= "\n"; $i++; $zcol++; if(($zcol >= $cols) && ($i < ($page * $ppp))) { $xhtml_thumbs .= "\n\n"; $zcol = 0; } } $xhtml_thumbs .= "\n
\n"; if($display == "popup") { $xhtml_thumbs .= "\n"; if(is_array($caption)) { $xhtml_thumbs .= "
" . $caption[$images[$i]] . "
\n"; } $xhtml_thumbs .= "
\n"; // Pagination $next = $page + 1; $prev = $page - 1; $nav_string = "\n\n\n\n\n
"; // Page $page of $num_pages :: "; if($page == 1) $nav_string .= "<<Previous | "; else $nav_string .= "<<Previous | "; for($pnav = 1; $pnav <= $num_pages; $pnav++) { if($pnav == 1 && $pnav == $page) $nav_string .= $pnav; elseif ($pnav == 1 && $pnav != $page) $nav_string .= " $pnav "; elseif ($pnav == $num_pages && $pnav == $page) $nav_string .= $pnav; elseif ($pnav == $num_pages && $pnav != $page) $nav_string .= " $pnav "; elseif($pnav == $page) { if ($nav_disp == "dots") $nav_string .= " . "; else $nav_string .= " $pnav "; } else { if ($nav_disp == "dots") $nav_string .= " . "; else $nav_string .= " $pnav "; } } if($page == $num_pages) $nav_string .= " | Next>>"; else $nav_string .= " | Next>>"; $nav_string .= "
\n"; // Build the page $thumbs_cell = "$xhtml_thumbs\n"; if($display == "popup") $iframe_cell = ""; else $iframe_cell = "\n"; $body_table = "\n\n"; switch($thumb_location) { case "top": $body_table .= $thumbs_cell . "\n\n" . $iframe_cell; break; case "bottom": $body_table .= $iframe_cell . "\n\n" . $thumbs_cell; break; case "left": $body_table .= $thumbs_cell . $iframe_cell; break; case "right": $body_table .= $iframe_cell . $thumbs_cell; break; } $body_table .= "\n
\n"; echo $site['style']; echo "".$site['javascript']; if($show_nav == "above" || $show_nav == "both") echo $nav_string; echo $body_table; if($show_nav == "below" || $show_nav == "both") echo $nav_string; break; } ?>