diff options
author | rvelices <rv-github@modusoptimus.com> | 2013-05-26 19:56:31 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2013-05-26 19:56:31 +0000 |
commit | c121640b6d64bb4f1bb4b7ca2b96c70635db1c21 (patch) | |
tree | 67245e38f950ca593db80e684c2a370def345481 /include/category_cats.inc.php | |
parent | d3ebc321b7ac7f2ba0d6a45a1a7928dadc63ebe3 (diff) |
bug 2097: wrong number of sub-albums
bug 2098: make number of direct sub-albums available for each user
git-svn-id: http://piwigo.org/svn/trunk@22879 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/category_cats.inc.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php index cbdbe47b7..d96903700 100644 --- a/include/category_cats.inc.php +++ b/include/category_cats.inc.php @@ -37,6 +37,7 @@ SELECT date_last, max_date_last, count_images, + nb_categories, count_categories FROM '.CATEGORIES_TABLE.' c INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc @@ -119,7 +120,7 @@ SELECT representative_picture_id { if ($conf['representative_cache_on_subcats'] and $row['user_representative_picture_id'] != $image_id) { - $user_representative_updates_for[ $user['id'].'#'.$row['id'] ] = $image_id; + $user_representative_updates_for[ $row['id'] ] = $image_id; } $row['representative_picture_id'] = $image_id; @@ -211,7 +212,7 @@ SELECT * if ($conf['representative_cache_on_level']) { - $user_representative_updates_for[ $user['id'].'#'.$category['id'] ] = $image_id; + $user_representative_updates_for[ $category['id'] ] = $image_id; } $category['representative_picture_id'] = $image_id; @@ -246,18 +247,14 @@ if (count($user_representative_updates_for)) { $updates = array(); - foreach ($user_representative_updates_for as $user_cat => $image_id) + foreach ($user_representative_updates_for as $cat_id => $image_id) { - list($user_id, $cat_id) = explode('#', $user_cat); - - array_push( - $updates, + $updates[] = array( - 'user_id' => $user_id, + 'user_id' => $user['id'], 'cat_id' => $cat_id, 'user_representative_picture_id' => $image_id, - ) - ); + ); } mass_updates( |