haku87 Posted March 15, 2007 Share Posted March 15, 2007 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 Link to comment https://forums.phpfreaks.com/topic/42852-image-gallery-problem-splitting-into-pages/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.