
Mam problem z konfiguracj± pomózcie mi co mama wpisac w zmiennych konfiguracyjnych. Jak uruchamiam ten skrypt to nic mi nie wy¶wietla... z³e ustawienia katalogów??
Za³ó¿my ¿e chce uruchomiæ to na stronie
www.domena.pl/galeria
link do skryptu... http://www.rossp.org/stuff/photodir-1.1.tar.gz
<? /* * PHOTODIR * photodir.php - Main program * Version 1.1, 20-Jan-04 * Copyright 2004 Ross W. Poulton * ross@rossp.org * <a href=\"http://www.rossp.org/\" target=\"_blank\">http://www.rossp.org/</a> * * This file is part of PhotoDir. * * PhotoDir is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * PhotoDir is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PhotoDir; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Define some basic variables: /* Directory where photos are stored */ $photo_dir = "/var/httpd/rossp.org/photos"; /* Directory for cached thumbnails */ $cache_dir = "/var/httpd/rossp.org/photos-cache"; /* URI to where photos are stored */ $photo_url = "/photos"; /* 'Frame' picture - thumbnails will be centred on top of this image */ $frame_pic = "outline.jpg"; /* 'Folder' picture */ $folder_pic = "folder.jpg"; /* 'Parent' picture */ $parent_pic = "folder.jpg"; /* Maximum dimensions for a thumbnail will be $thumb_max * $thumb_max. Thumbs are made proportionatly, eg a 200x100 image with thumb_max of 100 will be resized to 100x50. */ $thumb_max = 100; /* *********************************************** */ /* END CONFIGURATION */ /* *********************************************** */ if ($_GET['photofile']) { /* If we're just displaying a photo, send it out to the user. */ /* Use realpath to find out if someone has tried spoofing us with ../../../../etc/passwd or similar. */ exit; } exit; } elseif ($_GET['thumbfile']) { /* Display a thumbnail. This will be a resized version of the full file, but superimposed on your outline image. */ exit; } $cache_file = $cache_dir . "/$md5sum"; $outline_img = imagecreatefromjpeg($photo_dir . "/" . $frame_pic); $outline_width = imagesx($outline_img); $outline_height = imagesy($outline_img); $src_img = imagecreatefromjpeg($photo); $origw = $size[0]; $origh = $size[1]; if ($origw > $origh) { $neww = $thumb_max; $diff = $origw / $neww; $newh = $origh / $diff; } else { $newh = $thumb_max; $diff = $origh / $newh; $neww = $origw / $diff; } $dst_img = imagecreatetruecolor($neww, $newh); if (function_exists('imagecopyresampled')) { imagecopyresampled($dst_img,$src_img,0,0,0,0,$neww,$newh, $origw,$origh); } else { imagecopyresized($dst_img, $src_img,0,0,0,0,$neww,$newh,$origw, $origh); } imagealphablending($outline_img, true); /* The following block makes up our co-ordinates for placing the thumbnail on the frame. We always start at least 2 pixels from each edge, and from there the image is centered both horizontally and vertically. */ if ($neww > $newh) { $startx = 2; $starty = ((100 - $newh) / 2) + 2; } else { $startx = ((100 - $neww) / 2) + 2; $starty = 2; } imagecopy($outline_img, $dst_img, $startx, $starty, 0, 0, $neww, $newh); imagejpeg($outline_img, $cache_file); } exit; } include "header.html"; /* $dir is the full filesystem directory that we're looking at, eg /var/httpd/photos/Holidays/NewYork2003 $path is everything AFTER the 'standard' photo directory, eg Holidays/NewYork2003 */ if ($_GET['dir'] != "") { $path = $_GET['dir']; } else { $dir = $photo_dir; $path = ""; } /* Remove the trailing slash if there is one */ } /* Remove the trailing slash if there is one */ } /* Quick check to make sure our path hasn't been poisened, eg ../../../../etc/passwd or similar. */ exit; } /* Initialise basic variables */ $i = 1; $first = "y"; if (($file != ".") && ($file != "..") && !(($file == $folder_pic) && ($path != "/")) && !(($file == $frame_pic) && ($path != "/"))) { if (($first == "y") && ($path != "")) { /* If this is the first entry to be displayed on this page, then put in a 'Parent' link to back up a level. */ $first = "n"; $parent = ""; } else { for ($j=0; $j<count($parts)-1; $j++) { $parent .= $parts[$j] . "/"; } } } /* This is a directory, display our folder icon */ if ($path == "") { } else { } $i++; /* This is an image, display its thumbnail and a link to the full image. */ $i++; } if ($i == 4) { $i = 0; } } } } else { } } else { /* Display large photo and information */ $origw = $size[0]; $origh = $size[1]; $parent = ""; } else { for ($j=0; $j<count($parts)-1; $j++) { $parent .= $parts[$j] . "/"; } } } include "footer.html"; function format_file_size($size) { if ($size <= 1024) { return $size . "Mb"; } elseif (($size > 1024) && ($size <= 1024000)) { $size = $size / 1024; return $size . "Kb"; } elseif (($size > 1024000) && ($size <= 1024000000)) { $size = $size / 1024000; return $size . "Mb"; } else { $size = $size / 1024000000; return $size . "Gb"; } } ?>