From bbc2dc24191681c863badea1e04b08cf44e46dc5 Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 15 Feb 2007 21:20:52 +0000 Subject: [PATCH] Code refactoring. git-svn-id: http://piwigo.org/svn/trunk@1825 68402e56-0260-453c-a942-63ccdbb3a9ee --- picture.php | 56 +++++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/picture.php b/picture.php index 2abb4bc5d..7df5113b3 100644 --- a/picture.php +++ b/picture.php @@ -605,13 +605,14 @@ SELECT COUNT(*) AS nb_fav $template->assign_block_vars( 'favorite', array( - 'FAVORITE_IMG' => get_root_url().get_themeconf('icon_dir').'/favorite.png', + 'FAVORITE_IMG' => + get_root_url().get_themeconf('icon_dir').'/favorite.png', 'FAVORITE_HINT' => $lang['add_favorites_hint'], 'FAVORITE_ALT' => $lang['add_favorites_alt'], 'U_FAVORITE' => add_url_params( - $url_self, - array('action'=>'add_to_favorites') - ), + $url_self, + array('action'=>'add_to_favorites') + ), ) ); } @@ -620,13 +621,14 @@ SELECT COUNT(*) AS nb_fav $template->assign_block_vars( 'favorite', array( - 'FAVORITE_IMG' => get_root_url().get_themeconf('icon_dir').'/del_favorite.png', + 'FAVORITE_IMG' => + get_root_url().get_themeconf('icon_dir').'/del_favorite.png', 'FAVORITE_HINT' => $lang['del_favorites_hint'], 'FAVORITE_ALT' => $lang['del_favorites_alt'], 'U_FAVORITE' => add_url_params( - $url_self, - array('action'=>'remove_from_favorites') - ) + $url_self, + array('action'=>'remove_from_favorites') + ), ) ); } @@ -657,9 +659,9 @@ $infos = array(); if (!empty($picture['current']['author'])) { $infos['INFO_AUTHOR'] = - // FIXME because of search engine partial rewrite, giving the author - // name threw GET is not supported anymore. This feature should come - // back later, with a better design +// FIXME because of search engine partial rewrite, giving the author +// name threw GET is not supported anymore. This feature should come +// back later, with a better design // ''.$val.''; + array( + 'chronology_field'=>'created', + 'chronology_style'=>'monthly', + 'chronology_view'=>'list', + 'chronology_date' => explode('-', $picture['current']['date_creation']) + ) + ); + $infos['INFO_CREATION_DATE'] = + ''.$val.''; } else { @@ -694,13 +697,16 @@ else // date of availability $val = format_date($picture['current']['date_available'], 'mysql_datetime'); $url = make_index_url( - array( - 'chronology_field'=>'posted', - 'chronology_style'=>'monthly', - 'chronology_view'=>'list', - 'chronology_date'=>explode('-', substr($picture['current']['date_available'],0,10)) + array( + 'chronology_field'=>'posted', + 'chronology_style'=>'monthly', + 'chronology_view'=>'list', + 'chronology_date' => explode( + '-', + substr($picture['current']['date_available'], 0, 10) ) - ); + ) + ); $infos['INFO_POSTED_DATE'] = ''.$val.''; // size in pixels