diff options
author | plegall <plg@piwigo.org> | 2004-12-27 14:30:49 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2004-12-27 14:30:49 +0000 |
commit | 7ba15740434b476e8aef0253919f19ba37e07dc7 (patch) | |
tree | 4bba6d6d3e5490189fdc79dee1a51ba6c2e4cb31 /include/category_subcats.inc.php | |
parent | 4c8d18de5b904eddaa900deca20c7d6f7ac928d1 (diff) |
- admin/update : filesystem synchronization process completely
rewritten. How to speed up sync ? by avoiding recursivity !
- admin/update : option to display verbose information details
- admin/update : option to simulate only. No database insert, delete or
update will be made
- bug fixed : in admin/cat_list, if you delete a virtual category, you may
create a gap in the rank list. This gap will generate errors when trying
to move a category on this gap. Fixed by calling ordering and
update_global_rank at category deletion.
- admin/cat_list, only one query to insert a new virtual category (no need
of a second query to update uppercats and global_rank)
- for a given category, even if empty, the representing element must not be
the one of a forbidden category for the current user
- generation time optionnaly displayed on the bottom of each page becomes
more price : number of SQL queries and SQL time added.
git-svn-id: http://piwigo.org/svn/trunk@659 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/category_subcats.inc.php')
-rw-r--r-- | include/category_subcats.inc.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/category_subcats.inc.php b/include/category_subcats.inc.php index 7e6d080d8..4ee5929ea 100644 --- a/include/category_subcats.inc.php +++ b/include/category_subcats.inc.php @@ -69,7 +69,14 @@ while ($row = mysql_fetch_array($result)) SELECT path, tn_ext FROM '.CATEGORIES_TABLE.' AS c INNER JOIN '.IMAGES_TABLE.' AS i ON i.id = c.representative_picture_id - WHERE uppercats REGEXP \'(^|,)'.$row['id'].'(,|$)\' + WHERE uppercats REGEXP \'(^|,)'.$row['id'].'(,|$)\''; + // we must not show pictures of a forbidden category + if ($user['forbidden_categories'] != '') + { + $query.= ' + AND c.id NOT IN ('.$user['forbidden_categories'].')'; + } + $query.= ' ORDER BY RAND() LIMIT 0,1 ;'; |