Advertisement
Guest User

PHP Scan directory for images - carousel

a guest
Jun 25th, 2013
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php $thumbs = glob("{$_SERVER['DOCUMENT_ROOT']}/img/gallery/africa/thumb/*.jpg"); ?>
  2.     <?php
  3.     if(count($thumbs)) {
  4.     natcasesort($thumbs);
  5.     foreach($thumbs as $thumb) {
  6.     ?>
  7.     <li class="item">
  8.         <a class="fancybox" rel="gallery1" href="/img/gallery/africa/large/<?php echo basename($thumb) ?>">
  9.             <img src="<?php echo $thumb ?>" alt="" />
  10.         </a>
  11.     </li>
  12.                                    
  13.     <?php
  14.     } else {
  15.     echo "No images!";
  16.     }}
  17.     ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement