Deutsch
Diese Mod gibt einen dynamischen (ständig wechselnden) Seitentitel für deine Web-Seite aus.
Es erweitert das HTMl Markup
{clickstream}, dadurch muss kein weiterer Code verwendet werden!
Wenn deine Seite "Meine Seite" heisst und du schaust dir eine Detailsseite an wo das Bild den Name "Alte Brücke" in der Subkategorie "Brücken" beinhaltet, dann wird das ganze im
Seitentitel so ausgegeben:Meine Seite / Brücken / Alte Brücke
Die Originale Modifikatiion stammt von: Chris
Link:
http://www.4homepages.de/forum/index.php?topic=6613.msg29010#msg29010Ich habe diese Modifikation an die Version 1.7.7 angepasst und mit deutscher und englischer Anleitung versehen!
English
This mod outputs a dynamic (ever changing) page title for your web pages. Essentially this adds the clickstream to your page title but without the added HTML markup.
If your site name is defined as "Smith Family Pictures" and you were viewing a details.php page for an image named "Old Bridge" in a subcategory named "Road Trip" which was a subcategory of a top-level "2005 Events" category and your admin control panel setting for "Category delimiter (in category paths)" was defined as "/",
your page title would look like this: Smith Family Pictures /2005 Events/Road Trip/Old Bridge
The originals Modifikatiion comes from: Chris
Link:
http://www.4homepages.de/forum/index.php?topic=6613.msg29010#msg29010I did this modification to the adapted version 1.7.7 and with German and English instructions!
Installation - Step by Step
Step 1Open
includes/functions.php, locate:
Öffne
includes/functions.php, suche:
function get_category_path($cat_id = 0, $detail_path = 0) {
global $site_sess, $config, $cat_cache, $url;
$parent_id = 1;
while ($parent_id) {
if (!isset($cat_cache[$cat_id]['cat_parent_id'])) {
return false;
}
$parent_id = $cat_cache[$cat_id]['cat_parent_id'];
if (empty($path)) {
if ($detail_path) {
$cat_url = ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id;
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
if (!empty($regs[1]) && $regs[1] != 1) {
$cat_url .= "&".URL_PAGE."=".$regs[1];
}
}
$path = "<a href=\"".$site_sess->url($cat_url)."\" class=\"clickstream\">".format_text($cat_cache[$cat_id]['cat_name'], 2)."</a>";
}
else {
$path = format_text($cat_cache[$cat_id]['cat_name'], 2);
}
}
else {
$path = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\" class=\"clickstream\">".format_text($cat_cache[$cat_id]['cat_name'], 2)."</a>".$config['category_separator'].$path;
}
$cat_id = $parent_id;
} // end while
return $path;
}Add after:
Darunter einfügenr:
function get_category_path_nohtml($cat_id = 0) { // MOD: Dynamic page title 1.7.7
global $config, $cat_cache;
$parent_id = 1;
while ($parent_id) {
if (!isset($cat_cache[$cat_id]['cat_parent_id'])) {
return false;
}
$parent_id = $cat_cache[$cat_id]['cat_parent_id'];
if (empty($path)) {
$path = $cat_cache[$cat_id]['cat_name'];
}
else {
$path = $cat_cache[$cat_id]['cat_name'].$config['category_separator'].$path;
}
$cat_id = $parent_id;
} // end while
return $path;
}Locate:
Suche:
function show_error_page($error_msg, $clickstream = "") {
global $site_template, $site_sess, $lang, $config;
if (empty($clickstream)) {
$clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].$lang['error'];
}
$site_template->register_vars(array(
"error_msg" => $error_msg,
"lang_error" => $lang['error'],
"clickstream" => $clickstream,
"random_image" => ""
));
$site_template->print_template($site_template->parse_template("error"));
exit;
}Change this to:
Ändere das in:
function show_error_page($error_msg, $clickstream = "") {
global $site_template, $site_sess, $lang, $config;
if (empty($clickstream)) {
$clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].$lang['error'];
}
$site_template->register_vars(array(
"error_msg" => $error_msg,
"lang_error" => $lang['error'],
"clickstream" => $clickstream,
"random_image" => ""
));
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
// MOD: Dynamic page title 1.7.7 BLOCK END
$site_template->print_template($site_template->parse_template("error"));
exit;
}Step 2Open
categories.php, locate:
Öffne
categories.php, suche:
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].get_category_path($cat_id)."</span>";Add after:
Füge darunter ein:
$page_title = $config['category_separator'].get_category_path_nohtml($cat_id); // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream
));Change to:
Ändere in:
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title // MOD: Dynamic page title 1.7.7
));Locate:
Suche:
$site_template->print_template($site_template->parse_template($main_template));On a new Line Add above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 3Open
details.php, locate:
Öffne
details.php, suche:
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];Add after:
Füge darunter:
$page_title = $config['category_separator'].$lang['home'].$config['category_separator']; // MOD: Dynamic page title 1.7.7Locate:
Suche
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator'];Add after:
Füge darunter:
$page_title = $config['category_separator'].$lang['lightbox'].$config['category_separator']; // MOD: Dynamic page title 1.7.7Locate:
Suche:
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?show_result=1".$page_url)."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'];Add after:
Füge darunter:
$page_title = $config['category_separator'].$lang['search'].$config['category_separator']; // MOD: Dynamic page title 1.7.7Locate:
Suche:
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];Add after:
Füge darunter:
$page_title = $config['category_separator'].get_category_path_nohtml($cat_id).$config['category_separator']; // MOD: Dynamic page title 1.7.7Locate:
Suche:
$clickstream .= $image_name."</span>";Add after:
Füge darunter:
$page_title .= $image_name; // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,CHANGE to:
Ändere in:
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title, // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->print_template($site_template->parse_template($main_template));Add on a new Line above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 4Open
index.php, locate:
Öffne
index.php, suche:
if (!empty($template)) {
$clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_", " ", ucfirst($template));Add after:
Füge darunter:
$page_title = $config['category_separator'].str_replace("_", " ", ucfirst($template)); // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->register_vars("clickstream", $clickstream);CHANGE to:
Ändere in:
$site_template->register_vars(array(
"clickstream" => $clickstream,
"page_title" => $page_title // MOD: Dynamic page title 1.7.7
));On the next line down, locate:
Direkt danach kommen zwei weitere Zeilen, suche:
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
}CHANGE this to:
Ändere das in:
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
} else { // MOD: Dynamic page title 1.7.7
$page_title = $config['category_separator'].$lang['home'];
$site_template->register_vars("page_title", $page_title);
}Locate:
Suche:
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream
));CHANGE this to:
Ändere das in:
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title // MOD: Dynamic page title 1.7.7
));Locate:
Suche:
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');Add on a new Line above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 5Open
lightbox.php, locate:
Öffne
lightbox.php, suche
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['lightbox']."</span>";Add after:
Füge darunter:
$page_title = $config['category_separator'].$lang['lightbox']; // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,CHANGE this to:
Ändere das in:
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title, // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->print_template($site_template->parse_template($main_template));Add on a new Line above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 6Open
member.php, locate:
Öffne
member.php, suche:
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$txt_clickstream."</span>";Add after:
Füge darunter:
$page_title = $config['category_separator'].$txt_clickstream; // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->register_vars(array(
"content" => $content,
"msg" => $msg,
"clickstream" => $clickstream,CHANGE this to:
Ändere das in:
$site_template->register_vars(array(
"content" => $content,
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title, // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->print_template($site_template->parse_template($main_template));Add on a new Line above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 7Open
register.php, locate:
Öffne
register.php, suche:
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['register']."</span>";Add after:
Füge darunter:
$page_title = $config['category_separator'].$lang['register']; // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->register_vars(array(
"content" => $content,
"msg" => $msg,
"clickstream" => $clickstream,CHANGE this to:
Ändere das in:
$site_template->register_vars(array(
"content" => $content,
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title, // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->print_template($site_template->parse_template($main_template));Add on a new Line above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 8Open
search.php, locate:
Öffne
search.php, suche:
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['search']."</span>";CHANGE this to:
Ändere das in:
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
// $clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['search']."</span>"; // Original code
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
if (!empty($search_id['search_new_images'])) {
if( $search_id['search_new_images'] == 1 )
$txt_clickstream = $lang['new_images'];
else
$txt_clickstream = $lang['new_images_since'];
}
else {
$txt_clickstream = $lang['search'];
}
$clickstream = "<span class=\"clickstream\"><a title=\"".$lang['home']."\" href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].(($search_keywords) ? "<a href=\"".$site_sess->url(ROOT_PATH."search.php")."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'].$search_keywords : $txt_clickstream)."</span>"; // Show search keywords
$page_title = $config['category_separator'].$txt_clickstream;
// MOD: Dynamic page title 1.7.7 BLOCK ENDLocate:
Suche:
$site_template->register_vars(array(
"content" => $content,
"msg" => $msg,
"clickstream" => $clickstream,CHANGE this to:
Ändere das in:
$site_template->register_vars(array(
"content" => $content,
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title, // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->print_template($site_template->parse_template($main_template));Add on a new Line above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 9Open
top.php, locate:
Öffne
top.php, suche:
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($cat_id && isset($cat_cache[$cat_id])) {
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $lang['top_images']."</span>";CHANGE this to:
Ändere das in:
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a title=\"".$lang['home']."\" href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
$page_title = $config['category_separator']; // MOD: Dynamic page title 1.7.7
if ($cat_id && isset($cat_cache[$cat_id])) {
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
$page_title .= get_category_path_nohtml($cat_id).$config['category_separator']; // MOD: Dynamic page title 1.7.7
}
$clickstream .= $lang['top_images']."</span>";
$page_title .= $lang['top_images']; // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,CHANGE this to:
Ändere das in:
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title, // MOD: Dynamic page title 1.7.7Locate:
Suche:
$site_template->print_template($site_template->parse_template($main_template));Add on a new Line above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 10Open
postcard.php, locate:
Öffne
postcard.php, suche
$site_template->print_template($site_template->parse_template($main_template));Add on a new Line above:
Füge in einer neuen Zeile darüber:
// MOD: Dynamic page title 1.7.7 BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title 1.7.7 BLOCK ENDStep 11Open
templates/default/header.html, locate:
Öffne
templates/default/header.html, suche:
<title>{prepend_head_title}{site_name}</title>CHANGE this to:
Ändere das in:
<title>{prepend_head_title}{site_name}{page_title}</title>