diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-12-01 01:46:32 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-12-01 01:46:32 +0000 |
commit | b2de3c32ee635788f2f34c98d529fdc167ca6a51 (patch) | |
tree | 8ab638b5c8d705a012686fadd9fca492029bb661 /index.php | |
parent | 7111d867b9e85b8656563f3febafae1d8d365435 (diff) |
- sessions are always started (even for visitors)
- thumbnail order saved in the session instead of cookie
git-svn-id: http://piwigo.org/svn/trunk@1623 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -40,12 +40,14 @@ check_status(ACCESS_GUEST); //---------------------------------------------- change of image display order if (isset($_GET['image_order'])) { - setcookie( - 'pwg_image_order', - $_GET['image_order'] > 0 ? $_GET['image_order'] : '', - 0, cookie_path() - ); - + if ( (int)$_GET['image_order'] > 0) + { + pwg_set_session_var('image_order', (int)$_GET['image_order']); + } + else + { + pwg_unset_session_var('image_order'); + } redirect( duplicate_index_url( array(), // nothing to redefine @@ -260,10 +262,7 @@ if (isset($page['cat_nb_images']) and $page['cat_nb_images'] > 0 // image order $template->assign_block_vars( 'preferred_image_order', array() ); - $order_idx = isset($_COOKIE['pwg_image_order']) - ? $_COOKIE['pwg_image_order'] - : 0 - ; + $order_idx = pwg_get_session_var( 'image_order', 0 ); $orders = get_category_preferred_image_orders(); for ($i = 0; $i < count($orders); $i++) |