bloor

gallery

Aug 9th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1.             <div id="galleries">
  2.                 <?php
  3.  
  4.                     $galleries = scandir("gallery");
  5.                     foreach($galleries as $gallery){
  6.                                 if (strlen($gallery) > 2):
  7.                                     $files = glob("gallery/$gallery/*.{jpg,png,gif,bmp}", GLOB_BRACE);
  8.                                 ?>
  9.  
  10.                                 <li >
  11.  
  12.                                     <div style="position: absolute; top: 10px; left: 10px; width: 345px; height: 185px; background: url('gallery/<? echo $gallery ?>/thumb.jpg') no-repeat center; background-size: 100%; border-radius: 2px;"></div>
  13.                                     <span><? echo $gallery ?></span>
  14.                                    
  15.                                     <a rel="<? echo $gallery; ?>" href="<? echo "gallery/".$gallery."/thumb.jpg" ?>">
  16.                                         <div class="album-info"> <? echo (count($files)); ?> PHOTOS</div>
  17.                                     </a>
  18.                                    
  19.                                     <?foreach($files as $img): ?>
  20.                                             <a rel="<? echo $gallery ?>" href="<? echo $img ?>"></a>
  21.                                         <? endforeach; ?>
  22.                                    
  23.                                 </li>
  24.                             <? endif;
  25.                             }
  26.  
  27.                 ?>
  28.                 </div>
Advertisement
Add Comment
Please, Sign In to add comment