" . htmlspecialchars($d) . "
" . htmlspecialchars($m) . "
" . htmlspecialchars("$f, $e, $b") . "
"; } $SORTEXPR = '/^(?:img|mvi|st[a-i])_(\d+)(?:[ _.].*)?\.(?:jpg|avi)$/i'; function ai0s($a, $b) { global $SORTEXPR; if (preg_match($SORTEXPR, $a[0], $ma) && preg_match($SORTEXPR, $b[0], $mb)) return strcasecmp($ma[1], $mb[1]); return strcasecmp($a[0], $b[0]); } function txy($vmx, $vmy, $x, $y) { $dr = $vmx / $vmy; $fx = $vmx; $fy = $vmy; $r = $x / $y; if ($r > $dr) $fy = floor($fx / $r); else $fx = floor($fy * $r); return array($fx, $fy); } $dx = 140; $dy = 140; $bdx = 200; $bdy = 200; $vmx = 700; $vmy = 550; $numcols = 5; $maxrows = 20; @include_once("thumber_sizes.php"); $dir = array_key_exists("dir", $_GET) ? $_GET["dir"] : null; if (preg_match(',(^|/)\.\.(/|$)|^/,', $dir)) die(); $dirmtime = filemtime($dir); header("Last-Modified: " . date("r", $dirmtime)); $root = dirname($_SERVER["PHP_SELF"]); if (array_key_exists("vhtml", $_GET) && $_GET["vhtml"]) { header("Pragma: no-cache"); preg_match(',^(.*)/([^/]+)$,', $dir, $m); $xdir = $m[1]; list($dirs, $pics) = mkdirlist($xdir); $idx = -1; for ($i = 0; $i < count($pics); $i++) { if ($pics[$i][1] == $dir) { $idx = $i; break; } } $link = preg_replace(array(',/+,s', ',/\./,s'), array("/", "/"), "$root/" . $dir); unset($prev); unset($next); if ($idx >= 0) { for ($i = $idx - 1; $i >= 0; $i--) { if ($pics[$i][3] == "pic") { $prev = $pics[$i]; break; } } for ($i = $idx + 1; $i < count($pics); $i++) { if ($pics[$i][3] == "pic") { $next = $pics[$i]; break; } } } unset($exif); $fx = $fy = 0; exec("/usr/bin/jhead '$dir'", $exif, $ret); if ($ret) unset($exif); else { if (preg_match('/Resolution\s*:\s*(\d+)\s*x\s*(\d+)/si', join("\n", $exif), $m)) list($fx, $fy) = txy($vmx, $vmy, $m[1], $m[2]); if (preg_match('/^File name /', $exif[0])) $exif = array_slice($exif, 1); } ?> Thumber - bgcolor="" text="" link="" vlink="" alink="" >