From 7f75c131ed12fe830a13cc77ae677aa0d68740a4 Mon Sep 17 00:00:00 2001 From: rvelices Date: Sat, 13 Oct 2012 15:55:35 +0000 Subject: bug 2772: remove "Home" from html title pages on index pages git-svn-id: http://piwigo.org/svn/trunk@18637 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/config_default.inc.php | 4 ---- include/page_header.php | 4 ---- include/section_init.inc.php | 17 +++++++++++++++-- index.php | 2 +- picture.php | 2 +- themes/default/template/header.tpl | 5 +---- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/include/config_default.inc.php b/include/config_default.inc.php index 073b97cc3..121221c2d 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -182,10 +182,6 @@ $conf['links'] = array(); // ); $conf['random_index_redirect'] = array(); -// reverse_home_title: if Piwigo is your home page for a better robot index -// we recommend to set it true (Only index page will reverse its title) -$conf['reverse_home_title'] = false; - // List of notes to display on all header page // example $conf['header_notes'] = array('Test', 'Hello'); $conf['header_notes'] = array(); diff --git a/include/page_header.php b/include/page_header.php index 69e17e771..1decff0f0 100644 --- a/include/page_header.php +++ b/include/page_header.php @@ -48,10 +48,6 @@ $template->assign( isset($page['body_id']) ? $page['body_id'] : '', - 'REVERSE' => - (isset($conf['reverse_home_title']) and $conf['reverse_home_title']) ? - true : false, - 'CONTENT_ENCODING' => get_pwg_charset(), 'PAGE_TITLE' => strip_tags($title), diff --git a/include/section_init.inc.php b/include/section_init.inc.php index 138b16cec..4a55cf732 100644 --- a/include/section_init.inc.php +++ b/include/section_init.inc.php @@ -561,9 +561,22 @@ if (isset($page['title'])) { if (!empty($page['title'])) { - $page['title'] = $conf['level_separator'].$page['title']; + $page['section_title'] = ''.l10n('Home').''.$conf['level_separator'].$page['title']; } - $page['title'] = ''.l10n('Home').''.$page['title']; + else + { + if ('picture'==script_basename()) + { + $used_title = l10n('Home'); + $used_link = duplicate_index_url(array('start'=>0)); + } + else + { + $used_title = @$page['is_homepage'] ? $conf['gallery_title'] :l10n('Home'); + $used_link = get_gallery_home_url(); + } + $page['section_title'] = $page['title'] = ''.$used_title.''; + } } // add meta robots noindex, nofollow to avoid unnecesary robot crawls diff --git a/index.php b/index.php index cf90451bc..6e3f3f6d9 100644 --- a/index.php +++ b/index.php @@ -111,7 +111,7 @@ $page['body_id'] = 'theCategoryPage'; $template->set_filenames( array('index'=>'index.tpl') ); //-------------------------------------------------------------- category title -$template_title = $page['title']; +$template_title = $page['section_title']; if (count($page['items']) > 0) { $template_title.= ' ['.count($page['items']).']'; diff --git a/picture.php b/picture.php index 2b75493de..d291de151 100644 --- a/picture.php +++ b/picture.php @@ -736,7 +736,7 @@ elseif ($conf['picture_slideshow_icon']) $template->assign( array( - 'SECTION_TITLE' => $page['title'], + 'SECTION_TITLE' => $page['section_title'], 'PHOTO' => $title_nb, 'IS_HOME' => ('categories'==$page['section'] and !isset($page['category']) ), diff --git a/themes/default/template/header.tpl b/themes/default/template/header.tpl index 465c16d96..c375192aa 100644 --- a/themes/default/template/header.tpl +++ b/themes/default/template/header.tpl @@ -16,10 +16,7 @@ {/if} {/if} - -{if (isset($REVERSE) and $REVERSE and $PAGE_TITLE == l10n('Home'))} -{$GALLERY_TITLE} | {$PAGE_TITLE}{else} -{$PAGE_TITLE} | {$GALLERY_TITLE}{/if} +{$PAGE_TITLE}{if $PAGE_TITLE!=$GALLERY_TITLE} | {$GALLERY_TITLE}{/if} -- cgit v1.2.3