Advertisement
cyberairman2013

Twitter Bootstrap Photo Gallery

Jul 13th, 2013
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ssgallery_function.php
  2. function image_from_database() {
  3.     $result = mysql_query("SELECT * FROM screenshots ORDER BY date_sub DESC");
  4.     $count = mysql_num_rows($result);
  5.     while($count < 4 && $row = mysql_fetch_array($result))
  6.     if ($count > 4) {
  7.        
  8.             while($row = mysql_fetch_array($result)) {
  9.                
  10.                     echo '<div class="span3">';
  11.                     echo '<img src="'.$row['thumbnail_link'].'" />';
  12.                     echo '<h4>'.$row['header'].'</h4>';
  13.                     echo '<p>'.$row['description'].'</p>';
  14.                     echo '<p><a class="btn" href="view_image.php?image_id='. $row['photo_id'] .'">View details &raquo;</a></p>';
  15.                     echo '</div>';
  16.                    
  17.             }
  18.        
  19.         }
  20. }
  21. ssgallery.php
  22. <div class="container">
  23.     <h1 class="text-center">The American Pacific Group ScreenShot Gallery</h1>
  24.     <hr>
  25.     <div class="row-fluid">
  26.         <?php
  27.             echo image_from_database();
  28.         ?>
  29.     </div>
  30. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement