Ignore:
Timestamp:
Dec 2, 2006, 12:31:19 AM (17 years ago)
Author:
rub
Message:

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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/category_cats.inc.php

    r1597 r1624  
    3434if ($page['section']=='recent_cats')
    3535{
     36  // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE
    3637  $query = '
    37 SELECT id,name,date_last,representative_picture_id,comment,nb_images,uppercats
    38   FROM '.CATEGORIES_TABLE.'
     38SELECT
     39  id,name, representative_picture_id, comment, nb_images, uppercats,
     40  max_date_last, is_child_date_last, count_images, count_categories
     41  FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
     42  ON id = cat_id and user_id = '.$user['id'].'
    3943  WHERE date_last > SUBDATE(
    4044    CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY
    41   )
    42   AND id NOT IN ('.$user['forbidden_categories'].')';
     45  );';
    4346}
    4447else
    4548{
     49  // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE
    4650  $query = '
    47 SELECT id,name,date_last,representative_picture_id,comment,nb_images
    48   FROM '.CATEGORIES_TABLE.'
     51SELECT
     52  id,name, representative_picture_id, comment, nb_images,
     53  max_date_last, is_child_date_last, count_images, count_categories
     54  FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
     55  ON id = cat_id and user_id = '.$user['id'].'
    4956  WHERE id_uppercat '.
    5057  (!isset($page['category']) ? 'is NULL' : '= '.$page['category']).'
    51     AND id NOT IN ('.$user['forbidden_categories'].')
    5258  ORDER BY rank
    5359;';
     
    6066while ($row = mysql_fetch_assoc($result))
    6167{
     68  $row['is_child_date_last'] = get_boolean($row['is_child_date_last']);
     69
    6270  if (isset($row['representative_picture_id'])
    6371      and is_numeric($row['representative_picture_id']))
     
    146154      {
    147155        $name = $category['name'];
    148         $icon_ts = get_icon(@$category['date_last']);
     156        $icon_ts = get_icon($category['max_date_last'], $category['is_child_date_last']);
    149157      }
    150158
     
    163171              )
    164172            ),
    165           'CAPTION_NB_IMAGES' => (($category['nb_images'] == 0) ? '' : sprintf("%d ".l10n('pictures'), $category['nb_images'])),
     173          'CAPTION_NB_IMAGES' => get_display_images_count
     174                                  (
     175                                    $category['nb_images'],
     176                                    $category['count_images'],
     177                                    $category['count_categories']
     178                                  ),
    166179          'DESCRIPTION' => @$comment,
    167180          'NAME'  => $name,
     
    214227          'thumbnails.line.thumbnail',
    215228          array(
    216             'IMAGE_TS'    => get_icon(@$category['date_last']),
     229            'IMAGE_TS'    => get_icon($category['max_date_last'], $category['is_child_date_last']),
    217230           )
    218231         );
Note: See TracChangeset for help on using the changeset viewer.