";
$breadcrumb_navigation .= "
" . $label_home . " $breadcrumb_separator ";
$navitems = explode("/", htmlspecialchars($_REQUEST['dir']));
for ($i = 0; $i < count($navitems); $i++) {
if ($i == count($navitems) - 1) {
$breadcrumb_navigation .= $navitems[$i];
} else {
$breadcrumb_navigation .= "
" . $navitems[$i] . " $breadcrumb_separator ";
}
}
$breadcrumb_navigation .= "
";
}
//Include hidden links for all images BEFORE current page so lightbox is able to browse images on different pages
for ($y = 0; $y < $offset_start - $nbDir; $y++) {
$breadcrumb_navigation .= "";
}
// Read folder comment.
$comment_filepath = $current_dir . $file . "/comment.html";
if (file_exists($comment_filepath)) {
$fd = fopen($comment_filepath, "r");
$comment = "";
fclose($fd);
}
//PROCESS TEMPLATE FILE
if (GALLERY_ROOT != "") {
$templatefile = GALLERY_ROOT . "templates/integrate.html";
} else {
$templatefile = "templates/" . $templatefile . ".html";
}
if (!$fd = fopen($templatefile, "r")) {
echo "Template " . htmlspecialchars(stripslashes($templatefile)) . " not found!";
exit();
} else {
$template = fread($fd, filesize($templatefile));
fclose($fd);
$template = stripslashes($template);
$template = preg_replace("/<% title %>/", $title, $template);
$template = preg_replace("/<% messages %>/", $messages, $template);
$template = preg_replace("/<% author %>/", $author, $template);
$template = preg_replace("/<% gallery_root %>/", GALLERY_ROOT, $template);
$template = preg_replace("/<% images %>/", "$images", $template);
$template = preg_replace("/<% thumbnails %>/", "$thumbnails", $template);
$template = preg_replace("/<% breadcrumb_navigation %>/", "$breadcrumb_navigation", $template);
$template = preg_replace("/<% page_navigation %>/", "$page_navigation", $template);
$template = preg_replace("/<% folder_comment %>/", "$comment", $template);
$template = preg_replace("/<% bgcolor %>/", "$backgroundcolor", $template);
$template = preg_replace("/<% gallery_width %>/", "$gallery_width", $template);
$template = preg_replace("/<% version %>/", "$version", $template);
echo "$template";
}