Changeset 1020 for trunk/include/functions_category.inc.php
- Timestamp:
- Feb 1, 2006, 3:46:26 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r1008 r1020 319 319 } 320 320 321 // returns an array of image orders available for users/visitors 322 function get_category_preferred_image_orders() 323 { 324 global $lang, $conf; 325 return array( 326 array('Default', '', true), 327 array($lang['best_rated_cat'], 'average_rate DESC', $conf['rate']), 328 array($lang['most_visited_cat'], 'hit DESC', true), 329 array($lang['Creation date'], 'date_creation DESC', true), 330 array($lang['Availability date'], 'date_available DESC', true) 331 ); 332 } 333 334 321 335 // initialize_category initializes ;-) the variables in relation 322 336 // with category : … … 604 618 $user['nb_image_page'], 'back' ); 605 619 } 620 621 if ($page['cat'] != 'most_visited' and $page['cat'] != 'best_rated') 622 { 623 $available_image_orders = get_category_preferred_image_orders(); 624 625 $order_idx=0; 626 if ( isset($_GET['image_order']) ) 627 { 628 $order_idx = $_GET['image_order']; 629 setcookie( 'pwg_image_order', $order_idx, 0 ); 630 } 631 else if ( isset($_COOKIE['pwg_image_order']) ) 632 { 633 $order_idx = $_COOKIE['pwg_image_order']; 634 } 635 636 if ( $order_idx > 0 ) 637 { 638 $order = $available_image_orders[$order_idx][1]; 639 $conf['order_by'] = str_replace('ORDER BY ', 'ORDER BY '.$order.',', 640 $conf['order_by'] ); 641 } 642 } 606 643 } 607 644 else
Note: See TracChangeset
for help on using the changeset viewer.