podam jeszcze trsc plików bo mo¿e kto¶ z "lotu" potrafi mi odpowiedzieæ na pytanie.
Plik galeri->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Image Galleria</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <style type="text/css"> </style> <!--link rel="stylesheet" href="../style.css" type="text/css"--> </head> <body> <div align="center"> <h2>Image Gallery</h2> <p>My most favorite pictures ever.</p> <? /********** editable variables **********/ // thumbnails title $thumb_title = 1; // set to 1 if you want the image filename below the thumb, 0 otherwise // full size images title $full_title = 1; // set to 1 if you want the image filename below the the full size image, 0 otherw
ise // how many thumbnails should appear per row? $cols = 3; // 3 looks the best, but you may want more or less, depending on the size of your
thumbnails // how many thumbnails per page? $max_thumbs = 0; // a multiple of $cols looks the best, or 0 for all thumbnails on one page // thumbnail directory name $thumbs_dir = "thumbs"; // just make sure your directory name is inside double quotes // full size image directory name $full_dir = "images"; // just make sure your directory name is inside double quotes // captions directory name $captions_dir = "captions"; // if you don't want captions at all, don't worry about this // extension name $ext = "php"; // just incase you are using a different extension name for your script; if your s
erver is not set for "index.$ext to be the index page, put "0". // captions extension $cext = "inc"; // use whatever you're comfortable with // show random option for single page view $showrand = 0; // to turn it off, switch 1 to 0 // print footer options $print_footer = "print_footer"; // put in the name of the function you use to print the footer of your page. if you don't use one, just leave it as it is. /********** end editable variables **********/ // figure out this script's name $self = $HTTP_SERVER_VARS['PHP_SELF']; } // do you have an existing function to close your page? if not, use this default... if (!function_exists($print_footer)) { function print_gallery_footer() { ?> </body> </html> <? } $print_footer = 'print_gallery_footer'; } // our error function, cleanly exits the script on user errors function imgerror($error) { $print_footer(); } // get image size function function gallery_imgsize($image) { return "width=$size[0] height=$size[1]"; } // check for directories imgerror('Directory "'.$thumbs_dir.'" does not exist.'); } imgerror('Directory "'.$full_dir.'" does not exist.'); } // get contents of $thumbs_dir $thumbs = array(); while($thumb = readdir($dir)) { if(preg_match('/(jpg$|jpeg$|gif$|tif$|bmp$|png$)/', $thumb)) array_push($thumbs, $thumb); } sort($thumbs); // lowest displayed image in the array // use http_get_vars incase register_globals is off in php.ini if (!isset($HTTP_GET_VARS['i'])) { $i = 0; } else { $i = $HTTP_GET_VARS['i']; } // check to see if all thumbs are meant to be displayed on one page if ($max_thumbs == 0) { $max_thumbs = sizeof($thumbs); $mt_check = 1; } else { $mt_check = 0; } // thumbnail view if (is_numeric($i)) { // check to see which thumbnail to start with if (!$mt_check && $i > 0) { $start = $max_thumbs * ($i - 1); } else { $start = 0; } // are they looking for thumbs pages that don't exist? imgerror('Sorry, there are no images to display on this page'); } ?> <table width="80%" cellspacing=0 cellpadding=10 border=0> <tr> <? // loop through $thumbs and display $max_thumbs per page for($count = 1; $count <= $max_thumbs; $start++) { // break if past max_thumbs break; } // print new row after predefined number of thumbnails if(($count % $cols == 1) && $count != 1 && $cols > 1) { } else if ($cols == 1) { } // open cell // insert thumb print '<a href="' . $self . '?i=' . rawurlencode("$thumbs[$start]") . '"><img src="' . $thumbs_dir . '/' . rawurlencode("$thumbs[$start]") . '" '; // alt information // image title if($thumb_title) { } // close cell // supress line break for screen readers, but force a line break for lynx $count++; } ?> </tr> </table> <? // thumbs page nav if (!$mt_check) { // how many total thumbs pages, including a "remainder" page if needed for ($count = 1; $count <= $pages; $count++) { if ($count == 1) { if ($count == $i || $i == 0) { } else { } } else { if ($count == $i) { } else { } } } } } // single image view // find where it is in the array $key = -1; } // navigation // previous if($key >= 1) { } else { } // index // random if ($showrand != 0) { } // next } else { } // image // alt information if(!$full_title) { } if($full_title) { $title = explode(".", str_replace("_", " ", ucfirst($i))); print "<div class="fulltitle">$title[0]</div>nn"; } // numerically show what image it is in the series; hide this if image isn't in the series if ($key >= 0) { // add 1 so that the first image is image 1 in the series, not 0 print '<div class="series">' . ($key + 1) . ' of ' . sizeof($thumbs) . "</div>nn"; } // caption (optional) if (file_exists("$captions_dir/$i.$cext")) { print '<div class="caption">'; require("$captions_dir/$i.$cext"); print '</div>'; } } // no image found else { ?><p><a href="<?=$self?>">index</a></p> <? imgerror('Sorry, that image does not exist...'); } ?> <p><a href="../">Back to main image gallery</a></p> </div> </body> </html> </body> </html>
Tre¶c szablonu ->
<?php // zmienna $go przekazana metoda GET $go = $_GET['go']; // sprawdzamy czy zmienna $go nie jest pusta // sprawdzamy czy plik o danej nazwie istnieje // jezeli plik nie istnieje wyswietla siê komunikat } // jezeli zmienna $go jest pusta wyswietla siê strona glowna else include "start.php"; ?>
i pytanie to samo dlaczego po nacisniêciu na miniaturke skrypt nie znajduje pe³nej fotki chocia¿ fizycznie ona jest, gdy do galeri odwo³am sie bezpo¶rednio bez szblonu strony wszystko jest ok.