3 $quickPath = isset($_SERVER["PATH_INFO"])?$_SERVER["PATH_INFO"]:"";
4 $scriptPath = $_SERVER["SCRIPT_NAME"];
6 $quickDir = dirname($quickPath);
7 $realDir = "images$quickDir";
9 $files = scandir($realDir);
10 $size = count($files);
12 $pos = array_search(basename($quickPath),$files);
15 for ($next=$pos+1; $nextImage === '' and $next<$size ; $next++) {
16 $mime = mime_content_type("$realDir/$files[$next]");
17 if ($mime == "image/jpeg")
18 $nextImage = $files[$next];
22 for ($prev=$pos-1; $prevImage === '' and $prev>=0 ; $prev--) {
23 $mime = mime_content_type("$realDir/$files[$prev]");
24 if ($mime == "image/jpeg")
25 $prevImage = $files[$prev];
28 $imageUrl = dirname($scriptPath)."/images$quickPath";
30 if ($nextImage === '') {
34 $nextImageUrl = dirname($scriptPath)."/images".dirname($quickPath)."/$nextImage";
35 $nextPageUrl = dirname($_SERVER["REQUEST_URI"])."/$nextImage";
37 if ($prevImage === '') $prevPageUrl = '';
38 else $prevPageUrl = dirname($_SERVER["REQUEST_URI"])."/$prevImage";
40 $directoryUrl = dirname($_SERVER["SCRIPT_NAME"])."/index".dirname($quickPath);
42 header('Content-Type: text/html; charset=utf-8');
43 header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
47 <style type="text/css">
63 text-decoration: none;
65 #next, #previous, #up {
90 <?php if ($nextImageUrl !== '') { ?>
91 <link rel="prefetch" href="<?php echo $nextImageUrl ?>" />
92 <link rel="prefetch" href="<?php echo $nextPageUrl ?>" />
98 <a href="<?php echo $imageUrl ?>"><img src="<?php echo $imageUrl ?>" id="theimage" /></a>
101 <a href="<?php echo $directoryUrl ?>" title="Back to directory">^</a>
104 <?php if ($nextPageUrl !== '') { ?>
106 <a href="<?php echo $nextPageUrl ?>" title="Next image">></a>
110 <?php if ($prevPageUrl !== '') { ?>
112 <a href="<?php echo $nextPageUrl ?>" title="Previous image"><</a>