From 34538a62f4ac8bc6db41580058fdd040abaa3183 Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 23 Feb 2006 02:30:19 +0000 Subject: new calendar completely integrated git-svn-id: http://piwigo.org/svn/trunk@1051 68402e56-0260-453c-a942-63ccdbb3a9ee --- category.php | 56 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 26 deletions(-) (limited to 'category.php') diff --git a/category.php b/category.php index 4150a97c6..07d15a95c 100644 --- a/category.php +++ b/category.php @@ -300,7 +300,7 @@ $template->assign_block_vars( $template->assign_block_vars( 'special_cat', array( - 'URL' => PHPWG_ROOT_PATH.'category.php?cat=calendar', + 'URL' => PHPWG_ROOT_PATH.'category.php?calendar=m-c', 'TITLE' => $lang['calendar_hint'], 'NAME' => $lang['calendar'] )); @@ -400,6 +400,35 @@ if ( $page['navigation_bar'] != '' ) array('NAV_BAR' => $page['navigation_bar']) ); } + +if ($page['cat_nb_images']>0 and + ( !isset($page['cat']) + or ($page['cat'] != 'most_visited' and $page['cat'] != 'best_rated') ) + ) +{ + // image order + $template->assign_block_vars( 'preferred_image_order', array() ); + + $order_idx = isset($_COOKIE['pwg_image_order']) ? + $_COOKIE['pwg_image_order'] : 0; + + $orders = get_category_preferred_image_orders(); + for ( $i = 0; $i < count($orders); $i++) + { + if ($orders[$i][2]) + { + $url = PHPWG_ROOT_PATH.'category.php' + .get_query_string_diff(array('image_order')); + $url .= '&image_order='.$i; + $template->assign_block_vars( 'preferred_image_order.order', array( + 'DISPLAY' => $orders[$i][0], + 'URL' => $url, + 'SELECTED_OPTION' => ($order_idx==$i ? 'SELECTED' : '' ), + ) ); + } + } +} + if ( isset ( $page['cat'] ) ) { // upload a picture in the category @@ -422,31 +451,6 @@ if ( isset ( $page['cat'] ) ) array('COMMENTS' => $page['comment']) ); } - if ($page['cat_nb_images']>0 and - $page['cat'] != 'most_visited' and $page['cat'] != 'best_rated') - { - // image order - $template->assign_block_vars( 'preferred_image_order', array() ); - - $order_idx = isset($_COOKIE['pwg_image_order']) ? - $_COOKIE['pwg_image_order'] : 0; - - $orders = get_category_preferred_image_orders(); - for ( $i = 0; $i < count($orders); $i++) - { - if ($orders[$i][2]) - { - $url = PHPWG_ROOT_PATH.'category.php' - .get_query_string_diff(array('image_order')); - $url .= '&image_order='.$i; - $template->assign_block_vars( 'preferred_image_order.order', array( - 'DISPLAY' => $orders[$i][0], - 'URL' => $url, - 'SELECTED_OPTION' => ($order_idx==$i ? 'SELECTED' : '' ), - ) ); - } - } - } } //------------------------------------------------------------ log informations pwg_log( 'category', $page['title'] ); -- cgit v1.2.3