aboutsummaryrefslogtreecommitdiffstats
path: root/admin/site_manager.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-05-01 01:12:34 +0000
committerrvelices <rv-github@modusoptimus.com>2008-05-01 01:12:34 +0000
commit7942dccf9b682d359a89636528e96af5b38327da (patch)
tree1e40fcfa3300a570899fa280b494943cb76a7f16 /admin/site_manager.php
parent6c0a51806f74eec1bf85842a558976a2e430c15f (diff)
- move #categories.date_last and nb_images to #user_cache_categories
git-svn-id: http://piwigo.org/svn/trunk@2324 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/site_manager.php')
-rw-r--r--admin/site_manager.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/admin/site_manager.php b/admin/site_manager.php
index abe9f811d..def9fe579 100644
--- a/admin/site_manager.php
+++ b/admin/site_manager.php
@@ -220,11 +220,18 @@ if ( is_file(PHPWG_ROOT_PATH.'listing.xml') )
}
$query = '
-SELECT s.*, COUNT(c.id) AS nb_categories, SUM(c.nb_images) AS nb_images
- FROM '.SITES_TABLE.' AS s LEFT JOIN '.CATEGORIES_TABLE.' AS c
- ON s.id=c.site_id
- GROUP BY s.id'.
-';';
+SELECT c.site_id, COUNT(DISTINCT c.id) AS nb_categories, COUNT(i.id) AS nb_images
+ FROM '.CATEGORIES_TABLE.' AS c LEFT JOIN '.IMAGES_TABLE.' AS i
+ ON c.id=i.storage_category_id
+ WHERE c.site_id IS NOT NULL
+ GROUP BY c.site_id
+;';
+$sites_detail = hash_from_query($query, 'site_id');
+
+$query = '
+SELECT *
+ FROM '.SITES_TABLE.'
+;';
$result = pwg_query($query);
while ($row = mysql_fetch_array($result))
@@ -243,8 +250,8 @@ while ($row = mysql_fetch_array($result))
array(
'NAME' => $row['galleries_url'],
'TYPE' => l10n( $is_remote ? 'site_remote' : 'site_local' ),
- 'CATEGORIES' => $row['nb_categories'],
- 'IMAGES' => isset($row['nb_images']) ? $row['nb_images'] : 0,
+ 'CATEGORIES' => (int)@$sites_detail[$row['id']]['nb_categories'],
+ 'IMAGES' => (int)@$sites_detail[$row['id']]['nb_images'],
'U_SYNCHRONIZE' => $update_url
);