From 782a75bb8f5b36b3a4d462945cd0bdac353ba1f0 Mon Sep 17 00:00:00 2001 From: chrisaga Date: Sat, 2 Dec 2006 16:46:15 +0000 Subject: improve page header : slightly prettier title and first implementation of meta tags and rel links (see the wiki specs) some code improvements are still need. git-svn-id: http://piwigo.org/svn/trunk@1627 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/page_header.php | 5 +++++ index.php | 3 ++- picture.php | 8 +++++++- search.php | 2 +- template/yoga/header.tpl | 25 ++++++++++++++++++++++++- 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/include/page_header.php b/include/page_header.php index 1535eb896..a6d4619a3 100644 --- a/include/page_header.php +++ b/include/page_header.php @@ -55,6 +55,11 @@ $template->assign_vars( ((is_adviser()) ? 'disabled onclick="return false;"' : '') )); +// picture header infos +if (isset($header_infos)) +{ + $template->assign_block_vars( 'header_meta', $header_infos); +} // refresh if ( isset( $refresh ) and intval($refresh) >= 0 and isset( $url_link ) and isset( $redirect_msg ) ) diff --git a/index.php b/index.php index 30e8be9d9..050fdf40e 100644 --- a/index.php +++ b/index.php @@ -97,7 +97,6 @@ if (isset($_GET['caddie'])) // $title = $page['title']; $page['body_id'] = 'theCategoryPage'; -include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames( array('index'=>'index.tpl') ); //-------------------------------------------------------------- category title @@ -286,11 +285,13 @@ if (isset($page['comment']) and $page['comment'] != '') 'COMMENTS' => $page['comment'] ) ); + $header_infos['COMMENT'] = strip_tags($page['comment']); } //------------------------------------------------------------ log informations pwg_log('category', $page['title']); trigger_action('loc_end_index'); +include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->parse('index'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); ?> diff --git a/picture.php b/picture.php index be5971a6a..4faf57f40 100644 --- a/picture.php +++ b/picture.php @@ -457,7 +457,6 @@ if ( isset($picture['next']['image_url']) ) ); } -include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames(array('picture'=>'picture.tpl')); //------------------------------------------------------- navigation management @@ -590,6 +589,7 @@ if ( is_admin() ) } //--------------------------------------------------------- picture information +$header_infos = array(); //for html header use // legend if (isset($picture['current']['comment']) and !empty($picture['current']['comment'])) @@ -599,6 +599,7 @@ if (isset($picture['current']['comment']) array( 'COMMENT_IMG' => nl2br($picture['current']['comment']) )); + $header_infos['COMMENT'] = strip_tags($picture['current']['comment']); } $infos = array(); @@ -615,6 +616,7 @@ if (!empty($picture['current']['author'])) // '&search=author:'.$picture['current']['author'] // .'">'.$picture['current']['author'].''; $picture['current']['author']; + $header_infos['INFO_AUTHOR'] = $picture['current']['author']; } else { @@ -702,6 +704,7 @@ $result = pwg_query($query); if (mysql_num_rows($result) > 0) { $tags = array(); + $tag_names = array(); while ($row = mysql_fetch_array($result)) { @@ -720,9 +723,11 @@ if (mysql_num_rows($result) > 0) ) .'">'.$row['name'].'' ); + array_push( $tag_names, $row['name'] ); } $infos['INFO_TAGS'] = implode(', ', $tags); + $header_infos['INFO_TAGS'] = implode(', ', $tag_names); } else { @@ -773,6 +778,7 @@ if ($metadata_showable and isset($_GET['metadata'])) //------------------------------------------------------------ log informations pwg_log('picture', $page['title'], $picture['current']['file']); +include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->parse('picture'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); ?> diff --git a/search.php b/search.php index 5131680d6..1a482ec77 100644 --- a/search.php +++ b/search.php @@ -173,7 +173,6 @@ get_month_list('end_month', @$_POST['end_month']); // $title= $lang['search_title']; $page['body_id'] = 'theSearchPage'; -include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames( array('search'=>'search.tpl') ); @@ -237,6 +236,7 @@ if (sizeof($errors) != 0) } //------------------------------------------------------------ log informations pwg_log( 'search', $title ); +include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->parse('search'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); ?> diff --git a/template/yoga/header.tpl b/template/yoga/header.tpl index 04f2c248a..1f62adba1 100644 --- a/template/yoga/header.tpl +++ b/template/yoga/header.tpl @@ -3,7 +3,31 @@ + + + + + + + +{GALLERY_TITLE} :: {PAGE_TITLE} + + + + + + + + + + + + + + + + @@ -21,7 +45,6 @@ the "text/nonsense" prevents gecko based browsers to load it --> -{GALLERY_TITLE}:{PAGE_TITLE}