Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DisplayIndex()
- {
- global $files;
- $image = intval($id);
- $vars = array();
- $vars['TITLE'] = $image;
- $vars['COUNT'] = '/' . count($files);
- if ($image > 1)
- $vars['PREV'] = '<a href="index.php?id=' . ($image - 1) . '"><B>PREV</B></a>';
- else
- $vars['PREV'] = '<span class="disabled">PREV</span>';
- if ($image < count($files)-0)
- $vars['NEXT'] = '<a href="index.php?id=' . ($image + 1) . '"><B>NEXT</B></a>';
- else
- $vars['NEXT'] = '<span class="disabled">NEXT</span>';
- if ($image > 1)
- $vars['FIRST'] = '<a href="index.php?id=' . ($image > 1) . '"><B>FIRST</B></A>';
- else
- $vars['FIRST'] = '<span class="disabled">FIRST</span>';
- if ($image > 1)
- $vars['LAST'] = '<a href="index.php?id=' . count($files) . '"><b>LAST</b></a>';
- $vars['IMAGE'] = '<a href="index.php"></a> ' . $image;
- $vars['IMAGESRC'] = $files[$image];
- echo '<title>' . $vars['TITLE'] . '</title>' . "\n";
- echo "</head>\n<body>";
- echo '<p>';
- echo $vars['FIRST'] . ' ' . $vars['PREV'] . ' ' . $vars['NEXT'] . ' ' . $vars['LAST'] . ' ' . $vars['IMAGE'] . $vars['COUNT'];
- echo '</p>';
- echo '<p><img src="' . $vars['IMAGESRC'] . '"></p>';
- }
- $files = GetFileList('.');
- if (isset($_GET['id']) && is_numeric($_GET['id']))
- {
- // single image mode
- $id = $_GET['id'];
- DisplayImage($id);
- } else {
- // index list mode
- DisplayIndex();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement