Jump to content

Image Gallery Problem.. Splitting into pages..


haku87

Recommended Posts

How do I split an image gallery into different pages as displaying everything in one page will be laggy.

There is my code :

<?php

$gallery = scandir("./thumbnail/",0);

echo "<div align='center'>| ";

foreach($gallery as $name){

if(!is_dir($name)){

echo "<a href = 'pastevent.php?galleryname=" .$name . "'>". ucfirst($name)."</a></span> | ";

}

}

echo "</div><br>";

if(empty($_GET['galleryname'])){

$thumbnail = scandir("./thumbnail/openhouse/",0);

$folder = "openhouse";

}

else{

$folder = $_GET['galleryname'];

$thumbnail = scandir("./thumbnail/".$folder,0);

}

$i=1;

$y=0;

echo "<table class='mytable4' align='center' cellspacing = '5'><tr>";

foreach($thumbnail as $index){

$tmp = explode(".",$index);

if(!strcmp($tmp[1],"jpg")){

echo "<td class='mytable4'>";

echo "<img src='./thumbnail/".$folder."/". $index ."'> \n";

echo "<div align = 'center'> <a href='./pastevent/" . $folder . "/" .$index. "'>" . "Download </a></div>";

echo "</td>";

if(($i%3 == 0)){

echo "</tr><tr>";

}

$i++;

}

}

echo "</tr></table>";?>

 

Can anyone helps

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.