Skip to content

Commit

Permalink
merge r7504 from branch 2.1 to trunk
Browse files Browse the repository at this point in the history
bug 1906 fixed: during batch management, for a given category, use the category
defined sort order for photos, not the generic order_by.



git-svn-id: http://piwigo.org/svn/trunk@7505 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Oct 30, 2010
1 parent 462e8aa commit 6fc4ec3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
18 changes: 17 additions & 1 deletion admin/element_set_global.php
Expand Up @@ -434,7 +434,23 @@

$query = '
SELECT id,path,tn_ext,file,filesize,level
FROM '.IMAGES_TABLE.'
FROM '.IMAGES_TABLE;

if (is_numeric($_GET['cat']))
{
$category_info = get_cat_info($_GET['cat']);

$conf['order_by'] = $conf['order_by_inside_category'];
if (!empty($category_info['image_order']))
{
$conf['order_by'] = ' ORDER BY '.$category_info['image_order'];
}

$query.= '
JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id';
}

$query.= '
WHERE id IN ('.implode(',', $page['cat_elements_id']).')
'.$conf['order_by'].'
LIMIT '.$page['nb_images'].' OFFSET '.$page['start'].'
Expand Down
18 changes: 17 additions & 1 deletion admin/element_set_unit.php
Expand Up @@ -194,7 +194,23 @@

$query = '
SELECT id,path,tn_ext,name,date_creation,comment,author,level,file
FROM '.IMAGES_TABLE.'
FROM '.IMAGES_TABLE;

if (is_numeric($_GET['cat']))
{
$category_info = get_cat_info($_GET['cat']);

$conf['order_by'] = $conf['order_by_inside_category'];
if (!empty($category_info['image_order']))
{
$conf['order_by'] = ' ORDER BY '.$category_info['image_order'];
}

$query.= '
JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id';
}

$query.= '
WHERE id IN ('.implode(',', $page['cat_elements_id']).')
'.$conf['order_by'].'
LIMIT '.$page['nb_images'].' OFFSET '.$page['start'].'
Expand Down

0 comments on commit 6fc4ec3

Please sign in to comment.