'
. '';
}
// Look at $currDir from a security angle. Don't let folks go outside
// the album directory base
// if (ereg('\.\.', $currDir)) {
if (strstr($currDir, '..')) {
print "SECURITY VIOLATION";
exit;
}
// strip URL encoding here too
$image = rawurldecode($image);
// Fetch mig.cf information
list($hidden, $presort_dir, $presort_img, $desc, $bulletin, $ficons,
$folderTemplate, $folderPageTitle, $folderFolderCols, $folderThumbCols)
= parseMigCf("$albumDir/$currDir", $useThumbSubdir, $thumbSubdir);
// if $pageType is null, or "folder") generate a folder view
if ($pageType == 'folder' or $pageType == '') {
// Determine which template to use
if ($folderTemplate) {
$templateFile = $folderTemplate;
} elseif ($phpNukeCompatible) {
$templateFile = $templateDir . '/mig_folder.php3';
} else {
$templateFile = $templateDir . '/folder.html';
}
// Determine page title to use
if ($folderPageTitle) {
$pageTitle = $folderPageTitle;
}
// Determine columns to use
if ($folderFolderCols) {
$maxFolderColumns = $folderFolderCols;
}
if ($folderThumbCols) {
$maxThumbColumns = $folderThumbCols;
}
// Generate some HTML to pass to the template printer
// list of available folders
$folderList = buildDirList($baseURL, $albumDir, $currDir, $imageDir,
$useThumbSubdir, $thumbSubdir,
$maxFolderColumns, $hidden, $presort_dir,
$viewFolderCount, $markerType, $markerLabel,
$ficons);
// list of available images
$imageList = buildImageList($baseURL, $baseDir, $albumDir, $currDir,
$albumURLroot, $maxThumbColumns, $folderList,
$markerType, $markerLabel, $suppressImageInfo,
$useThumbSubdir, $thumbSubdir, $noThumbs,
$thumbExt, $suppressAltTags, $mig_language,
$mig_messages, $sortType, $hidden,
$presort_img, $desc, $imagePopup,
$imagePopType);
// Only frame the lists in table code when appropriate
// no folders or images - print the "no contents" line
if ($folderList == 'NULL' and $imageList == 'NULL') {
$folderList = $mig_messages[$mig_language]['no_contents'];
$folderList = folderFrame($folderList);
$imageList = '';
// images, no folders. Frame the imagelist in a table
} elseif ($folderList == 'NULL' and $imageList != 'NULL') {
$folderList = '';
$imageList = imageFrame($imageList);
// folders but no images. Frame the folderlist in a table
} elseif ($imageList == 'NULL' and $folderList != 'NULL') {
$imageList = '';
$folderList = folderFrame($folderList);
// We have folders and we have images, so frame both in tables.
} else {
$folderList = folderFrame($folderList);
$imageList = imageFrame($imageList);
}
// We have a bulletin
if ($bulletin != '') {
$bulletin = descriptionFrame($bulletin);
}
// build the "back" link
$backLink = buildBackLink($baseURL, $currDir, 'back', $homeLink,
$homeLabel, $noThumbs, $mig_language,
$mig_messages);
// build the "you are here" line
$youAreHere = buildYouAreHere($baseURL, $currDir, '', $mig_language,
$mig_messages);
// newcurrdir is currdir without the leading './'
$newCurrDir = getNewCurrDir($currDir);
// parse the template file and print to stdout
printTemplate($baseURL, $templateDir, $templateFile, $version, $maintAddr,
$folderList, $imageList, $backLink, '', '', '', $newCurrDir,
$pageTitle, '', '', '', $bulletin, $youAreHere, $distURL,
$albumDir, $server, $useVirtual);
// If $pageType is "image", show an image
} elseif ($pageType == 'image') {
if ($folderPageTitle) {
$pageTitle = $folderPageTitle;
}
// Trick the back link into going to the right place by adding
// a bogus directory at the end
$backLink = buildBackLink($baseURL, "$currDir/blah", 'up', '', '',
$noThumbs, $mig_language, $mig_messages);
// Get the "next image" and "previous image" links, and the current
// position (#x of y)
$Links = array ();
$Links = buildNextPrevLinks($baseURL, $albumDir, $currDir, $image,
$markerType, $markerLabel, $mig_language,
$mig_messages, $hidden, $presort_img);
list($nextLink, $prevLink, $currPos) = $Links;
// Get image description
$description = getImageDescription($image, $desc);
$exifDescription = getExifDescription($albumDir, $currDir, $image,
$viewCamInfo, $mig_messages,
$mig_language);
// If there's a description but no exifDescription, just make the
// exifDescription the description
if ($exifDescription and ! $description) {
$description = $exifDescription;
unset($exifDescription);
}
// If both descriptions are non-NULL, separate them with an
if ($description and $exifDescription) {
$description .= ' ';
$description .= $exifDescription;
}
// If there's a description at all, frame it in a table.
if ($description != '') {
$description = descriptionFrame($description);
}
// Build the "you are here" line
// Strip the extension off the file name ($image) and show only the
// prefix only ($fname2) - cosmetics only
$fname2 = getFileName($image);
$youAreHere = buildYouAreHere($baseURL, $currDir, $fname2, $mig_language,
$mig_messages);
// line was --> $youAreHere = buildYouAreHere($baseURL, $currDir, $image, $mig_language, $mig_messages);
// Determine what template to use, based on what mode we are in
if ($phpNukeCompatible) {
$templateFile = $templateDir . '/mig_image.php3';
} else {
$templateFile = $templateDir . '/image.html';
}
// newcurrdir is currdir without the leading './'
$newCurrDir = getNewCurrDir($currDir);
// Send it all to the template printer to dump to stdout
printTemplate($baseURL, $templateDir, $templateFile, $version, $maintAddr,
'', '', $backLink, $albumURLroot, $image, $currDir,
$newCurrDir, $pageTitle, $prevLink, $nextLink, $currPos,
$description, $youAreHere, $distURL, $albumDir, '', '',
$server, $useVirtual);
}
// If in PHPNuke mode, finish up the tables and such needed for PHPNuke
if ($phpNukeCompatible) {
print ' |
|