diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-02-15 00:10:41 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-02-15 00:10:41 +0000 |
commit | 11714951b33d340f13400aa8fc9a2b971f8d8e8b (patch) | |
tree | 4baaeddd0b5b697b99fea5b45c99ac098a69dee2 /include/ws_functions.inc.php | |
parent | b39e05fd5a1c9ea95aab7ee35902dfbc5c3d924a (diff) |
- feature 642: display both subcategory thumbnails and element thumbnails (if a
category has both) in the index page
- get rid of $page['cat_nb_images'] and $page['thumbnails_include'] (superfluous)
- changed sql queries in section_init.inc.php for better performance with
flat category view
- web service fixes for categories.getList
git-svn-id: http://piwigo.org/svn/trunk@1820 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/ws_functions.inc.php')
-rw-r--r-- | include/ws_functions.inc.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index dca9740d1..1c71a6900 100644 --- a/include/ws_functions.inc.php +++ b/include/ws_functions.inc.php @@ -405,33 +405,35 @@ LIMIT '.$params['per_page']*$params['page'].','.$params['per_page']; */ function ws_categories_getList($params, &$service) { - global $user; + global $user,$conf; $where = array(); - $where[]= 'user_id='.$user['id']; - if ($params['cat_id']>0) - { - $where[] = 'uppercats REGEXP \'(^|,)'. - (int)($params['cat_id']) - .'(,|$)\''; - } if (!$params['recursive']) { if ($params['cat_id']>0) - $where[] = 'id_uppercat='.(int)($params['cat_id']); + $where[] = '(id_uppercat='.(int)($params['cat_id']).' + OR id='.(int)($params['cat_id']).')'; else $where[] = 'id_uppercat IS NULL'; } + else if ($params['cat_id']>0) + { + $where[] = 'uppercats REGEXP \'(^|,)'. + (int)($params['cat_id']) + .'(,|$)\''; + } if ($params['public']) { $where[] = 'status = "public"'; $where[] = 'visible = "true"'; + $where[]= 'user_id='.$conf['guest_id']; } else { $where[] = 'id NOT IN ('.$user['forbidden_categories'].')'; + $where[]= 'user_id='.$user['id']; } $query = ' |