diff options
author | plegall <plg@piwigo.org> | 2010-10-30 20:03:05 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2010-10-30 20:03:05 +0000 |
commit | f048a74b087f2dc17416316f3d01ba38d60f4c43 (patch) | |
tree | 078c34123ebd63aafa21d2598b5f2357abe52e88 /admin/element_set_global.php | |
parent | 356151aa45d4f98ef264d310ca3cf44790d38746 (diff) |
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/branches/2.1@7504 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/element_set_global.php')
-rw-r--r-- | admin/element_set_global.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php index f2c708022..8377bdd41 100644 --- a/admin/element_set_global.php +++ b/admin/element_set_global.php @@ -449,7 +449,23 @@ if (count($page['cat_elements_id']) > 0) $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'].' |