tag
function webImage($images, $img, $src) {
global $webImageTypes,
$maxImageWidth, $maxImageHeight, $resizeLarge;
$dim = array("width" => $images[$img]["width"], "height" => $images[$img]["height"]);
//echo '
'; if ($resizeLarge) { $dim = calcResizedImgSize($images[$img]["width"], $images[$img]["height"], $maxImageWidth, $maxImageHeight); } if ($dim["resized"]) { // let's see if the image is resized echo '
'; } $descFile = $images[$img]["name"] . '.if2'; if (file_exists($descFile)) { // add 6 px for border... echo '';
die('Not a valid directory. Please don\'t attempt to edit the querystring manually.');
}
$scriptDirRelTEMP = ($scriptDirRel) ? ('/' . $scriptDirRel) : ('/'); // check for slashes
$dirAddedTEMP = ($dir != '.') ? ($dir . '/') : ('');
$scriptURI = $URI . $scriptFile;
$workURI = $URI . ($dir != '.' ? $dir . '/': '');
$img = $_GET["img"];
$ofile = $_GET["ofile"];
if ($ofile and $img) {
die('Invalid querystring. Please don\'t attempt to edit the querystring manually.');
}
/* Config.if2 outside configuration file
If there is a file called config.if2 in any dir accessible by Isaac, php in that file will be used instead
of the variables specified above.
Please refer to the website, http://www.tosviol.net/isaac/ for more information on this.
*/
if (file_exists("$dir/config.if2")) {
include("$dir/config.if2");
}
// end config.if2
// Read dir
$dirHandle = opendir($dir);
// Loop over dir and assign to array
$dirs = array();
$images = array();
$others = array(); // non-image files
$i = 0;
chdir($dir);
while (false !== ($file = readdir($dirHandle))) {
$i++;
if (isImage($file) and !is_dir($file)) { // if is image
list(
$images[$i]["name"],
$images[$i]["width"],
$images[$i]["height"],
$images[$i]["type"],
$images[$i]["size"],
$images[$i]["time"]
) = imageInfo($file);
//echo $images[$i]["name"] . '
';
} // end if image
elseif ($file != '.' and $file != '..' and is_dir($file)) { // if is dir
$dirs[$i]["name"] = $file;
} // end if is dir
elseif ($file != '.' and $file != '..' and $file != $scriptFile and !in_array(getExtension($file), $hiddenFiles)) { // if is other file and not hidden
$ext = getExtension($file);
list(
$others[$i]["name"],
$others[$i]["size"],
$others[$i]["type"],
$others[$i]["time"]
) = array($file, filesize($file), $ext, filemtime($file));
} // end if is other file
} // end loop over dir
// Sort all by name
///////////////////////////////////// Line # 600 ///////////////////////////////////
if (count($dirs)) {
usort($dirs, 'cmpByName');
}
if (count($images)) {
usort($images, 'cmpByName');
}
if (count($others)) {
usort($others, 'cmpByName');
}
//
// Output
//
//
// HTML headers
//
?>
| mirookibrowser |
« ' . $backToText . ' ' : '');
// Top of page
echo '' . $scriptURI . '';
if ($IE) {
echo ' « copy to clipboard '; // EDIT ::
// VERY dirty; put url in textarea for copying. No other way though
echo '';
}
///////////////////////////////////// Line # 807 ///////////////////////////////////
echo ' |
| '; if ($dir != '.') { echo "/$dir "; } readfile('this.if2'); echo ' | |
Images of type "' . $images[$img]["type"] . '" may depend on plug-ins and may not display properly in your browser.
'; // EDIT::
echo 'Right-click and Save-as to download the file';
}
// file description from .if2 - for IMAGES ONLY
}
elseif ($ofile or $ofile == '0') {
$src = $workURI . space220($others[$ofile]["name"]);
echo '' . $others[$ofile]["name"] . "\n \n" .
// info
formatFileInfo('other', '', '', '', formatFileSize($others[$ofile]["size"]), $others[$ofile]["time"]). "
\n";
// forward to current ofile
$prevNext = genPrevNext($others, $ofile);
$prevI = $prevNext["prevI"];
$nextI = $prevNext["nextI"];
$prevK = $prevNext["prevK"];
$nextK = $prevNext["nextK"];
// previous link
if ($prevI) {
echo '
' . $src . "\n"; } if ($IE and count($images) and ($img or $img == '0' or $ofile or $ofile == '0')) { echo ' « copy to clipboard
'; // EDIT:: // VERY dirty; put src in textarea for copying. No other way though echo '
'; } echo '| ';
$countDirs = 0;
foreach ($dirs as $dirx) {
$countDirs++;
$safeListDir = urlencode(substr($dirx["name"], 0, strlen($dirx["name"]))); // safe to put in url
if ($dir != '.') {
$safeListDir = "$dir/$safeListDir";
}
$strTitle = (strlen($dirx["name"]) > $maxThumbTitleLen) ? ('title="' . $dirx["name"] . '"') : ('');
echo ' /' . shortenString($dirx["name"], $maxThumbTitleLen) . '' . " \n\n"; if ($countDirs % $dirsPerColumn == 0) { echo ' | '; } } echo ' |
| ';
$countImages = 0;
foreach ($images as $image) {
//while (list($qKey, $image) = each($images)) {
$orderImage = each($images);
$countImages++;
//echo $orderImage[key];
if ($orderImage["key"] == $img and ($img != '' or $img == '0')) { // we have to differentiate between 0 and '0'
echo '' . shortenString($image["name"], $maxThumbTitleLen) . " \n\n"; } else { $strTitle = (strlen($image["name"]) > $maxThumbTitleLen) ? ('title="' . $image["name"] . '"') : (''); echo // link '' . // name shortenString($image["name"], $maxThumbTitleLen) . ''; // info echo ' ' . formatFileInfo('short', $image["width"], $image["height"], $image["type"], formatFileSize($image["size"]), $image["time"]) . ' '; // warn about unembeddable filetype if (!in_array($image["type"], $webImageTypes)) { echo '? '; } // warn about large file if (ceil($image["size"] / 1024) > $warnOnLargeFiles) { echo '!'; } echo " \n"; //echo $imagesPerColumn . ' ' . $numImages . ' ' . $countImages . ' ' . $minFilesToBreak . ' ' . ($numImages - $countImages) . ' ' . ($countImages % $imagesPerColumn) . ' * '; } // end if not current image if ($countImages % $imagesPerColumn == 0) { echo ' | '; } } // end foreach images echo ' |
| ';
foreach ($others as $other) {
$orderOther = each($others);
$countOthers++;
if ($orderOther[key] == $ofile and $ofile != '') {
echo '' . shortenString($other["name"], $maxThumbTitleLen) . " \n\n"; } else { $strTitle = (strlen($other["name"]) > $maxThumbTitleLen) ? ('title="' . $other["name"] . '"') : (''); echo ///////////////////////////////////// Line # 1201 /////////////////////////////////// // link '' . // name shortenString($other["name"], $maxThumbTitleLen) . ''; // info echo ($showInfo) ? (' ' . formatFileInfo('short', '', '', '', formatFileSize($other["size"]), $other["time"]) . "\n") : ("\n"); // formatFileSize($other["size"]) if (ceil($other["size"] / 1024) > $warnOnLargeFiles) { echo '!'; } echo " \n"; } if ($countOthers % $othersPerColumn == 0) { echo ' | '; } } } echo ' |