ciao , sto facendo una galleria fotografica ma ho un problema nel visualizzare i thumb e i big..
i thumb sono public/images/wallpaper/thumb
i big sono public/images/wallpaper/
vi posto il codice:
mi da problema qua:
mi potete aiutarmi ?
le immagini le resizo con the gimp e poi le uplodo.
ma non mi funziona bene la galleria..
vi ringrazio molto. e buona settimana.
vi prego.
i thumb sono public/images/wallpaper/thumb
i big sono public/images/wallpaper/
vi posto il codice:
PHP:
<?php
$url = (isset($_GET["dir"])) ? trim ((string)$_GET["dir"]): '';
if(empty($url))
{
echo '404 not found';
}else{
//Set the extensions you want to load, seperate by a comma.
$extensions = "jpeg,jpg";
//Set the number of images you want to display per page
$imagesPerPage = 1;
//Set the $page variable
if(!isset($_GET['page'])){
$page = 1;
}else{
$page = $_GET['page'];
}
//Load all images into an array
$images = glob("*.{".$extensions."}", GLOB_BRACE);
//Count the number of images
$totalImages = count($images);
//Get the total pages
$totalPages = ceil($totalImages / $imagesPerPage);
//Make sure the page you are on is not greater then the total pages available.
if($page > $totalPages){
//Set the currnet page to the total pages.
$page = $totalPages;
}
//Now find where to start the loading from
$from = ($page * $imagesPerPage) - $imagesPerPage;
//Now start looping
for($i = $from; $i < ($from + $imagesPerPage); $i++){
//We need to make sure that its within the range of totalImages.
if($i < $totalImages){
//Now we can display the image!
?>
<a href="public/images/<?php echo $url; ?>/<?php echo $images[$i]; ?>"><img src="public/images/<?php echo $url; ?>/thumb/<?php echo $images[$i]; ?>"></a>
<?php
}
}
//Now to display the page numbers!
for($p = 1; $p <= $totalPages; $p++){
if($p == $page){
$tmp_pages[] = "<strong>{$p}</strong>";
}else{
$tmp_pages[] = "<a href='?page={$p}'>{$p}</a>";
}
}
//Now display pages, seperated by a hyphon.
echo "<br />" . implode(" - ", $tmp_pages);
}
?>
mi da problema qua:
PHP:
//Now start looping
for($i = $from; $i < ($from + $imagesPerPage); $i++){
//We need to make sure that its within the range of totalImages.
if($i < $totalImages){
//Now we can display the image!
?>
<a href="public/images/<?php echo $url; ?>/<?php echo $images[$i]; ?>"><img src="public/images/<?php echo $url; ?>/thumb/<?php echo $images[$i]; ?>"></a>
<?php
}
}
mi potete aiutarmi ?
le immagini le resizo con the gimp e poi le uplodo.
ma non mi funziona bene la galleria..
vi ringrazio molto. e buona settimana.
vi prego.