diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-02-01 22:56:17 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-02-01 22:56:17 +0000 |
commit | ea572da6884fdb711da084bcdcc931c4744af2a0 (patch) | |
tree | 67a89dc429f95b2dcb633f50e2ca70bb6c1bfdaf /category.php | |
parent | 864acc9f954e4f5b7c21d2aaeab13ae2a2d5d0db (diff) |
- feature 280: code simplification
git-svn-id: http://piwigo.org/svn/trunk@1022 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | category.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/category.php b/category.php index 323a1975c..7b141d70a 100644 --- a/category.php +++ b/category.php @@ -51,6 +51,14 @@ if (isset($page['cat']) and is_numeric($page['cat'])) { check_restrictions($page['cat']); } +//----------------------------------------------- change of image dispaly order +if ( isset($_GET['image_order']) ) +{ + setcookie( 'pwg_image_order', + $_GET['image_order']>0 ? $_GET['image_order'] : '', 0 ); + redirect( PHPWG_ROOT_PATH.'category.php'. + get_query_string_diff(array('image_order')) ); +} //-------------------------------------------------------------- initialization // detection of the start picture to display if ( !isset( $_GET['start'] ) @@ -412,16 +420,9 @@ if ( isset ( $page['cat'] ) ) // image order $template->assign_block_vars( 'preferred_image_order', array() ); - if ( isset($_GET['image_order']) ) - { - $order_idx = $_GET['image_order']; - } - else - { - $order_idx = isset($_COOKIE['pwg_image_order']) ? + $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++) { |