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
This commit is contained in:
chrisaga 2006-12-02 16:46:15 +00:00
parent 9ce5c07734
commit 782a75bb8f
5 changed files with 39 additions and 4 deletions

View file

@ -55,6 +55,11 @@ $template->assign_vars(
((is_adviser()) ? 'disabled onclick="return false;"' : '') ((is_adviser()) ? 'disabled onclick="return false;"' : '')
)); ));
// picture header infos
if (isset($header_infos))
{
$template->assign_block_vars( 'header_meta', $header_infos);
}
// refresh // refresh
if ( isset( $refresh ) and intval($refresh) >= 0 if ( isset( $refresh ) and intval($refresh) >= 0
and isset( $url_link ) and isset( $redirect_msg ) ) and isset( $url_link ) and isset( $redirect_msg ) )

View file

@ -97,7 +97,6 @@ if (isset($_GET['caddie']))
// //
$title = $page['title']; $title = $page['title'];
$page['body_id'] = 'theCategoryPage'; $page['body_id'] = 'theCategoryPage';
include(PHPWG_ROOT_PATH.'include/page_header.php');
$template->set_filenames( array('index'=>'index.tpl') ); $template->set_filenames( array('index'=>'index.tpl') );
//-------------------------------------------------------------- category title //-------------------------------------------------------------- category title
@ -286,11 +285,13 @@ if (isset($page['comment']) and $page['comment'] != '')
'COMMENTS' => $page['comment'] 'COMMENTS' => $page['comment']
) )
); );
$header_infos['COMMENT'] = strip_tags($page['comment']);
} }
//------------------------------------------------------------ log informations //------------------------------------------------------------ log informations
pwg_log('category', $page['title']); pwg_log('category', $page['title']);
trigger_action('loc_end_index'); trigger_action('loc_end_index');
include(PHPWG_ROOT_PATH.'include/page_header.php');
$template->parse('index'); $template->parse('index');
include(PHPWG_ROOT_PATH.'include/page_tail.php'); include(PHPWG_ROOT_PATH.'include/page_tail.php');
?> ?>

View file

@ -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')); $template->set_filenames(array('picture'=>'picture.tpl'));
//------------------------------------------------------- navigation management //------------------------------------------------------- navigation management
@ -590,6 +589,7 @@ if ( is_admin() )
} }
//--------------------------------------------------------- picture information //--------------------------------------------------------- picture information
$header_infos = array(); //for html header use
// legend // legend
if (isset($picture['current']['comment']) if (isset($picture['current']['comment'])
and !empty($picture['current']['comment'])) and !empty($picture['current']['comment']))
@ -599,6 +599,7 @@ if (isset($picture['current']['comment'])
array( array(
'COMMENT_IMG' => nl2br($picture['current']['comment']) 'COMMENT_IMG' => nl2br($picture['current']['comment'])
)); ));
$header_infos['COMMENT'] = strip_tags($picture['current']['comment']);
} }
$infos = array(); $infos = array();
@ -615,6 +616,7 @@ if (!empty($picture['current']['author']))
// '&search=author:'.$picture['current']['author'] // '&search=author:'.$picture['current']['author']
// .'">'.$picture['current']['author'].'</a>'; // .'">'.$picture['current']['author'].'</a>';
$picture['current']['author']; $picture['current']['author'];
$header_infos['INFO_AUTHOR'] = $picture['current']['author'];
} }
else else
{ {
@ -702,6 +704,7 @@ $result = pwg_query($query);
if (mysql_num_rows($result) > 0) if (mysql_num_rows($result) > 0)
{ {
$tags = array(); $tags = array();
$tag_names = array();
while ($row = mysql_fetch_array($result)) while ($row = mysql_fetch_array($result))
{ {
@ -720,9 +723,11 @@ if (mysql_num_rows($result) > 0)
) )
.'">'.$row['name'].'</a>' .'">'.$row['name'].'</a>'
); );
array_push( $tag_names, $row['name'] );
} }
$infos['INFO_TAGS'] = implode(', ', $tags); $infos['INFO_TAGS'] = implode(', ', $tags);
$header_infos['INFO_TAGS'] = implode(', ', $tag_names);
} }
else else
{ {
@ -773,6 +778,7 @@ if ($metadata_showable and isset($_GET['metadata']))
//------------------------------------------------------------ log informations //------------------------------------------------------------ log informations
pwg_log('picture', $page['title'], $picture['current']['file']); pwg_log('picture', $page['title'], $picture['current']['file']);
include(PHPWG_ROOT_PATH.'include/page_header.php');
$template->parse('picture'); $template->parse('picture');
include(PHPWG_ROOT_PATH.'include/page_tail.php'); include(PHPWG_ROOT_PATH.'include/page_tail.php');
?> ?>

View file

@ -173,7 +173,6 @@ get_month_list('end_month', @$_POST['end_month']);
// //
$title= $lang['search_title']; $title= $lang['search_title'];
$page['body_id'] = 'theSearchPage'; $page['body_id'] = 'theSearchPage';
include(PHPWG_ROOT_PATH.'include/page_header.php');
$template->set_filenames( array('search'=>'search.tpl') ); $template->set_filenames( array('search'=>'search.tpl') );
@ -237,6 +236,7 @@ if (sizeof($errors) != 0)
} }
//------------------------------------------------------------ log informations //------------------------------------------------------------ log informations
pwg_log( 'search', $title ); pwg_log( 'search', $title );
include(PHPWG_ROOT_PATH.'include/page_header.php');
$template->parse('search'); $template->parse('search');
include(PHPWG_ROOT_PATH.'include/page_tail.php'); include(PHPWG_ROOT_PATH.'include/page_tail.php');
?> ?>

View file

@ -3,7 +3,31 @@
<html lang="{LANG}" dir="{DIR}"> <html lang="{LANG}" dir="{DIR}">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset={CONTENT_ENCODING}"> <meta http-equiv="Content-Type" content="text/html; charset={CONTENT_ENCODING}">
<meta name="robots" content="index, follow">
<meta name="generator" content="PhpWebGallery (aka PWG), see www.phpwebgallery.net" />
<!-- BEGIN header_meta -->
<meta name="author" content="{header_meta.INFO_AUTHOR}">
<meta name="keywords" content="{header_meta.INFO_TAGS}">
<meta name="description" content="{header_meta.COMMENT}">
<!-- END header_meta -->
<title>{GALLERY_TITLE} :: {PAGE_TITLE}</title>
<link rel="shortcut icon" type="image/x-icon" href="{pwg_root}template-common/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="{pwg_root}template-common/favicon.ico">
<link rel="start" title="{lang:home}" href="{U_HOME}" >
<link rel="search" title="{lang:search}" href="{pwg_root}search.php" >
<!-- BEGIN first -->
<link rel="first" title="{lang:first_page}" href="{first.U_IMG}" >
<link rel="up" title="{lang:thumbails}" href="{U_UP}" >
<!-- END first -->
<!-- BEGIN previous -->
<link rel="prev" title="{lang:previous_page}" href="{previous.U_IMG}" >
<!-- END previous -->
<!-- BEGIN next -->
<link rel="next" title="{lang:next_page}" href="{next.U_IMG}" >
<!-- END next -->
<!-- BEGIN last -->
<link rel="last" title="{lang:last_page}" href="{last.U_IMG}" >
<link rel="up" title="{lang:thumbails}" href="{U_UP}" >
<!-- END last -->
<link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/layout.css"> <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/layout.css">
<!-- the next css is used to fix khtml (Konqueror/Safari) issue <!-- the next css is used to fix khtml (Konqueror/Safari) issue
the "text/nonsense" prevents gecko based browsers to load it --> the "text/nonsense" prevents gecko based browsers to load it -->
@ -21,7 +45,6 @@ the "text/nonsense" prevents gecko based browsers to load it -->
<!-- BEGIN refresh --> <!-- BEGIN refresh -->
<meta http-equiv="refresh" content="{REFRESH_TIME};url={U_REFRESH}"> <meta http-equiv="refresh" content="{REFRESH_TIME};url={U_REFRESH}">
<!-- END refresh --> <!-- END refresh -->
<title>{GALLERY_TITLE}:{PAGE_TITLE}</title>
<script type="text/javascript" src="{pwg_root}template-common/scripts.js"></script> <script type="text/javascript" src="{pwg_root}template-common/scripts.js"></script>
<!--[if lt IE 7]> <!--[if lt IE 7]>
<style> <style>