aboutsummaryrefslogtreecommitdiffstats
path: root/category.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-02-01 02:46:26 +0000
committerrvelices <rv-github@modusoptimus.com>2006-02-01 02:46:26 +0000
commitbb181b04cf3e4984cb1dfbe95e5521ad917fab76 (patch)
tree10199843cd8c12ff06ea1f2e0fb6977d6fa1c46f /category.php
parentac5fd23412f64b5b8647574a431e3cc13518538e (diff)
feature 280: Allow visitors/users to choose image ordering inside a category
improvement 82: Viewing pictures from remote galleries does not check anymore for the high pictures (existence flag added to create_listing_file and db) correction: link element in picture is in the head instead of body (w3c spec) correction: in profile.php the current template was not selected by default git-svn-id: http://piwigo.org/svn/trunk@1020 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'category.php')
-rw-r--r--category.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/category.php b/category.php
index 5889f505c..323a1975c 100644
--- a/category.php
+++ b/category.php
@@ -406,6 +406,38 @@ 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() );
+
+ if ( isset($_GET['image_order']) )
+ {
+ $order_idx = $_GET['image_order'];
+ }
+ else
+ {
+ $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 .= '&amp;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'] );