Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2. function MakeGallery( $albumname ){
  3.  
  4. $files = scandir( "images/gallery/$albumname" );
  5. if($files === FALSE){
  6. echo "Gallery $albumname not found!";
  7. }else{
  8. echo '<div id="content">
  9. <div id="'.$albumname.'">
  10. <div class="tn3 album">
  11. <ol>';
  12.  
  13. foreach( $files as $file ){
  14. if($file != "." && $file != ".."){
  15. echo '<li>';
  16. echo '<h4>'.basename($file).'</h4>';
  17. echo '<div class="tn3 description">'.basename($file).'</h4>';
  18. echo '<a href="images/gallery/'.$albumname.'/'.$file.'" alt="'.$file.'">';
  19. echo '<img src="images/gallery/'.$albumname.'" />';
  20. echo '</a>';
  21. echo '</li>';
  22. }
  23. }
  24.  
  25. echo '</ol>
  26. </div>
  27. </div>
  28. <div id="desc">
  29. <p>derp</p>
  30. </div>
  31. </div>';
  32.  
  33. echo '<script type="text/javascript">
  34. var GALLERYNAME = "'.$albumname.'";
  35. </script>';
  36. }
  37. }
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement