fabi0

images

Sep 29th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. function _loadImages() {
  4.     if (isset($_SESSION['_userID'])) {
  5.         $images = glob("upload" . DIRECTORY_SEPARATOR . $_SESSION['_userID'] . DIRECTORY_SEPARATOR . "*");
  6.         if ($images) {
  7.             shuffle($images);
  8.             return $images;
  9.         } else {
  10.             return (bool) 0;
  11.         }
  12.     }
  13. }
  14. ?>
  15. <?php foreach (_loadImages() as $img) : ?>
  16.     <a href="<?= $img ?>" target='_blank' title="">
  17.         <img src="<?= $img ?>" alt="" />
  18.     </a>
  19. <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment