From c121640b6d64bb4f1bb4b7ca2b96c70635db1c21 Mon Sep 17 00:00:00 2001 From: rvelices Date: Sun, 26 May 2013 19:56:31 +0000 Subject: 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 --- include/category_cats.inc.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'include/category_cats.inc.php') 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( -- cgit v1.2.3