Primark Online Shopping

A Flexible Automatic Jquery gallery.

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 '
  • '; }
    This entry was posted in Web Design and tagged , , , , , , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

    2 Comments

    1. Matt Burton
      Posted July 20, 2009 at 8:51 am | Permalink

      Tis lovely,

      Shame about the pokemon rubbish on the site.
      Oh how I hate pokemon.

    2. Posted July 20, 2009 at 8:54 am | Permalink

      Yes, it does slightly take away from the fact its a great bit of work.

    Post a Comment

    Your email is never published nor shared. Required fields are marked *

    *
    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Anti-Spam Protection by WP-SpamFree

    Switch to our mobile site