Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.44 KB | None | 0 0
  1. function DisplayIndex()
  2. {
  3.     global $files;
  4.  
  5.     $image = intval($id);
  6.  
  7.     $vars = array();
  8.     $vars['TITLE'] = $image;
  9.     $vars['COUNT'] = '/' . count($files);
  10.  
  11.     if ($image > 1)
  12.         $vars['PREV'] = '<a href="index.php?id=' . ($image - 1) . '"><B>PREV</B></a>';
  13.     else
  14.         $vars['PREV'] = '<span class="disabled">PREV</span>';
  15.        
  16.     if ($image < count($files)-0)
  17.         $vars['NEXT'] = '<a href="index.php?id=' . ($image + 1) . '"><B>NEXT</B></a>';
  18.     else
  19.         $vars['NEXT'] = '<span class="disabled">NEXT</span>';
  20.    
  21.     if ($image > 1)
  22.         $vars['FIRST'] = '<a href="index.php?id=' . ($image > 1) . '"><B>FIRST</B></A>';
  23.     else
  24.         $vars['FIRST'] = '<span class="disabled">FIRST</span>';
  25.     if ($image > 1)
  26.         $vars['LAST'] = '<a href="index.php?id=' . count($files) . '"><b>LAST</b></a>';
  27.        
  28.  
  29.     $vars['IMAGE'] = '<a href="index.php"></a>&nbsp;&nbsp;&nbsp;' . $image;
  30.     $vars['IMAGESRC'] = $files[$image];
  31.    
  32.  
  33.     echo '<title>' . $vars['TITLE'] . '</title>' . "\n";
  34.     echo "</head>\n<body>";
  35.     echo '<p>';
  36.     echo $vars['FIRST'] . '&nbsp;&nbsp;&nbsp;' . $vars['PREV'] . '&nbsp;&nbsp;&nbsp;' . $vars['NEXT'] . '&nbsp;&nbsp;&nbsp;' . $vars['LAST'] . '&nbsp;&nbsp;&nbsp;' . $vars['IMAGE'] . $vars['COUNT'];
  37.     echo '</p>';
  38.     echo '<p><img src="' . $vars['IMAGESRC'] . '"></p>';   
  39. }
  40.  
  41. $files = GetFileList('.');
  42.  
  43. if (isset($_GET['id']) && is_numeric($_GET['id']))
  44. {
  45.     // single image mode
  46.       $id = $_GET['id'];
  47.     DisplayImage($id);
  48. } else {
  49.     // index list mode
  50.     DisplayIndex();
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement