mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-12 11:43:01 +02:00
related to #1609 added number of photos in badges
This commit is contained in:
+10
-2
@@ -170,8 +170,16 @@ function assocToOrderedTree($assocT)
|
||||
{
|
||||
$orderedTree = array();
|
||||
|
||||
$query = '
|
||||
SELECT
|
||||
category_id,
|
||||
COUNT(*) AS nb_photos
|
||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||
GROUP BY category_id
|
||||
;';
|
||||
|
||||
$nb_photos_in = query2array($query, 'category_id', 'nb_photos');
|
||||
|
||||
// echo '<pre>'; print_r($assocT); echo '</pre>';
|
||||
foreach($assocT as $cat)
|
||||
{
|
||||
$orderedCat = array();
|
||||
@@ -179,7 +187,7 @@ function assocToOrderedTree($assocT)
|
||||
$orderedCat['name'] = $cat['cat']['name'];
|
||||
$orderedCat['status'] = $cat['cat']['status'];
|
||||
$orderedCat['id'] = $cat['cat']['id'];
|
||||
$orderedCat['nb_images'] = 'test2';
|
||||
$orderedCat['nb_images'] = isset($nb_photos_in[$cat['cat']['id']]) ? $nb_photos_in[$cat['cat']['id']] : 0;
|
||||
$orderedCat['last_updates'] = $cat['cat']['lastmodified'];
|
||||
if (isset($cat['children']))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user