mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-18 07:16:11 +02:00
feature 169 added: ability to manually sort images inside a category. A
dedicated screen let the administrator sort the images (pur HTML, no JavaScript yet). The "rank" sort order is available only for a category without flat mode. New database column image_category.rank. git-svn-id: http://piwigo.org/svn/trunk@2517 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -172,16 +172,40 @@ if ( script_basename()=='picture' and 'categories'==$page['section'] and
|
||||
// By default, it is the same as the $user['nb_image_page']
|
||||
$page['nb_image_page'] = $user['nb_image_page'];
|
||||
|
||||
// if flat mode is active, we must consider the image set as a standard set
|
||||
// and not as a category set because we can't use the #image_category.rank :
|
||||
// displayed images are not directly linked to the displayed category
|
||||
if ('categories' == $page['section'] and !isset($page['flat']))
|
||||
{
|
||||
$conf['order_by'] = $conf['order_by_inside_category'];
|
||||
}
|
||||
|
||||
if (pwg_get_session_var('image_order',0) > 0)
|
||||
{
|
||||
$image_order_id = pwg_get_session_var('image_order');
|
||||
|
||||
$orders = get_category_preferred_image_orders();
|
||||
|
||||
$conf['order_by'] = str_replace(
|
||||
'ORDER BY ',
|
||||
'ORDER BY '.$orders[ pwg_get_session_var('image_order',0) ][1].',',
|
||||
$conf['order_by']
|
||||
// the current session stored image_order might be not compatible with
|
||||
// current image set, for example if the current image_order is the rank
|
||||
// and that we are displaying images related to a tag.
|
||||
//
|
||||
// In case of incompatibility, the session stored image_order is removed.
|
||||
if ($orders[$image_order_id][2])
|
||||
{
|
||||
$conf['order_by'] = str_replace(
|
||||
'ORDER BY ',
|
||||
'ORDER BY '.$orders[$image_order_id][1].',',
|
||||
$conf['order_by']
|
||||
);
|
||||
$page['super_order_by'] = true;
|
||||
$page['super_order_by'] = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pwg_unset_session_var('image_order');
|
||||
$page['super_order_by'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
$forbidden = get_sql_condition_FandF(
|
||||
|
||||
Reference in New Issue
Block a user