From 63638b9b6dcdcef8baf5363419f0f6c5130c62df Mon Sep 17 00:00:00 2001 From: rub Date: Fri, 1 Dec 2006 23:31:19 +0000 Subject: Resolved Issue ID 0000299: o Add (new) icon of parent category with children categories including new images o Improved display text for images count o Improved (a little) mass_* functions More explications on the forum. You must call directly upgrade_feep.php (http://127.0.0.1/BSF/upgrade_feed.php for example) git-svn-id: http://piwigo.org/svn/trunk@1624 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/category_cats.inc.php | 33 +++++++++++++++++++++++---------- 1 file changed, 23 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 9a3cccceb..86e47cc09 100644 --- a/include/category_cats.inc.php +++ b/include/category_cats.inc.php @@ -33,22 +33,28 @@ if ($page['section']=='recent_cats') { + // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE $query = ' -SELECT id,name,date_last,representative_picture_id,comment,nb_images,uppercats - FROM '.CATEGORIES_TABLE.' +SELECT + id,name, representative_picture_id, comment, nb_images, uppercats, + max_date_last, is_child_date_last, count_images, count_categories + FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' + ON id = cat_id and user_id = '.$user['id'].' WHERE date_last > SUBDATE( CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY - ) - AND id NOT IN ('.$user['forbidden_categories'].')'; + );'; } else { + // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE $query = ' -SELECT id,name,date_last,representative_picture_id,comment,nb_images - FROM '.CATEGORIES_TABLE.' +SELECT + id,name, representative_picture_id, comment, nb_images, + max_date_last, is_child_date_last, count_images, count_categories + FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' + ON id = cat_id and user_id = '.$user['id'].' WHERE id_uppercat '. (!isset($page['category']) ? 'is NULL' : '= '.$page['category']).' - AND id NOT IN ('.$user['forbidden_categories'].') ORDER BY rank ;'; } @@ -59,6 +65,8 @@ $image_ids = array(); while ($row = mysql_fetch_assoc($result)) { + $row['is_child_date_last'] = get_boolean($row['is_child_date_last']); + if (isset($row['representative_picture_id']) and is_numeric($row['representative_picture_id'])) { // if a representative picture is set, it has priority @@ -145,7 +153,7 @@ if (count($categories) > 0) else { $name = $category['name']; - $icon_ts = get_icon(@$category['date_last']); + $icon_ts = get_icon($category['max_date_last'], $category['is_child_date_last']); } $template->assign_block_vars( @@ -162,7 +170,12 @@ if (count($categories) > 0) 'cat_name' => $category['name'], ) ), - 'CAPTION_NB_IMAGES' => (($category['nb_images'] == 0) ? '' : sprintf("%d ".l10n('pictures'), $category['nb_images'])), + 'CAPTION_NB_IMAGES' => get_display_images_count + ( + $category['nb_images'], + $category['count_images'], + $category['count_categories'] + ), 'DESCRIPTION' => @$comment, 'NAME' => $name, ) @@ -213,7 +226,7 @@ if (count($categories) > 0) $template->merge_block_vars( 'thumbnails.line.thumbnail', array( - 'IMAGE_TS' => get_icon(@$category['date_last']), + 'IMAGE_TS' => get_icon($category['max_date_last'], $category['is_child_date_last']), ) ); } -- cgit v1.2.3