diff options
author | rub <rub@piwigo.org> | 2006-12-01 23:31:19 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2006-12-01 23:31:19 +0000 |
commit | 63638b9b6dcdcef8baf5363419f0f6c5130c62df (patch) | |
tree | cf53c156032a7565dc7db3842cbd10952a920812 /include/category_cats.inc.php | |
parent | b2de3c32ee635788f2f34c98d529fdc167ca6a51 (diff) |
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
Diffstat (limited to 'include/category_cats.inc.php')
-rw-r--r-- | include/category_cats.inc.php | 33 |
1 files changed, 23 insertions, 10 deletions
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']), ) ); } |