Jump to content

Just a little help with a gallery


felipeebs

Recommended Posts

Hi again ;)

I have a simple script and want to improve it

but i don't know how to do all I want :x

here is the script:

<?php
//parameter $dirlist holds the directory where images are.
$dirlist = "gallery";  // leave it alone if it's the same directory
// image preview sizes
$width = 80;
$height = 60;
// border settings (0 for off)
$border = 0;
/* the code */
if ($alreadydone != 1) {
if (is_dir($dirlist)==true ) {
chdir( $dirlist );
$handle=opendir( ".");
}
$x=0;
$images=array();
while (($file = readdir($handle))!==false) {
$pieces = explode (".", $file);
if ($pieces[0] && $pieces[1]) {
if (($pieces[1]=="gif") || ($pieces[1]=="jpg") || ($pieces[1]=="GIF") || ($pieces[1]=="JPG") || ($pieces[1]=="bmp") || ($pieces[1]=="BMP") || ($pieces[1]=="png") || ($pieces[1]=="PNG")) {
$images[$x]=$file;
$x++;
}
}
}
closedir($handle); 
}
else
{
$images = unserialize(base64_decode($myArrayS));
}
for ($i=0; $i<sizeof($images); $i++)
{
			echo "<a href=$dirlist/$images[$i] target=_blank><img src=$dirlist/$images[$i] border=$border height=$height width=$width hspace=10 vspace=10></a>";
			if (($i+1) % 6 == 0) //6 images per line
				echo"<br>";
}
?>

 

alright...

I want to put pagination with "X" (i.e.: 30) images per page

just it

 

anyone can help?

thanks!  ;)

Link to comment
https://forums.phpfreaks.com/topic/39540-just-a-little-help-with-a-gallery/
Share on other sites

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.