I’ve been working on site recently which features a number of galleries in lightboxes. Using the fancybox lightbox plugin it launches an iframe with the gallery.
I highly recomend the Pikachoose gallery simple for its amazing simplicity and ease of use. Easy to style and adapt to my own needs, including a inbuilt carousel feature utilizing slider.js. I’ll post a link to an example lightbox gallery soon.
List images from a folder automatically via PHP
Heres a little code snippet I used to list all the images in a folder.
// the directory, where your images are stored
$imgdir = '/images/';
// list of filetypes you
$allowed_types = array('png','jpg','jpeg','gif'); want to show
$dimg = opendir($imgdir);
while($imgfile = readdir($dimg))
{
if(in_array(strtolower(substr($imgfile,-3)),$allowed_types))
{
$a_img[] = $imgfile;
sort($a_img);
reset ($a_img);
}
}
// total image number
$totimg = count($a_img);
for($x=0; $x < $totimg; $x++)
{
$size = getimagesize($imgdir.'/'.$a_img[$x]);
// do whatever
$halfwidth = ceil($size[0]/2);
$halfheight = ceil($size[1]/2);
echo '
2 Comments
Tis lovely,
Shame about the pokemon rubbish on the site.
Oh how I hate pokemon.
Yes, it does slightly take away from the fact its a great bit of work.