Changeset 1624 for trunk/include/category_cats.inc.php
- Timestamp:
- Dec 2, 2006, 12:31:19 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_cats.inc.php
r1597 r1624 34 34 if ($page['section']=='recent_cats') 35 35 { 36 // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE 36 37 $query = ' 37 SELECT id,name,date_last,representative_picture_id,comment,nb_images,uppercats 38 FROM '.CATEGORIES_TABLE.' 38 SELECT 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'].' 39 43 WHERE date_last > SUBDATE( 40 44 CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY 41 ) 42 AND id NOT IN ('.$user['forbidden_categories'].')'; 45 );'; 43 46 } 44 47 else 45 48 { 49 // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE 46 50 $query = ' 47 SELECT id,name,date_last,representative_picture_id,comment,nb_images 48 FROM '.CATEGORIES_TABLE.' 51 SELECT 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'].' 49 56 WHERE id_uppercat '. 50 57 (!isset($page['category']) ? 'is NULL' : '= '.$page['category']).' 51 AND id NOT IN ('.$user['forbidden_categories'].')52 58 ORDER BY rank 53 59 ;'; … … 60 66 while ($row = mysql_fetch_assoc($result)) 61 67 { 68 $row['is_child_date_last'] = get_boolean($row['is_child_date_last']); 69 62 70 if (isset($row['representative_picture_id']) 63 71 and is_numeric($row['representative_picture_id'])) … … 146 154 { 147 155 $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']); 149 157 } 150 158 … … 163 171 ) 164 172 ), 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 ), 166 179 'DESCRIPTION' => @$comment, 167 180 'NAME' => $name, … … 214 227 'thumbnails.line.thumbnail', 215 228 array( 216 'IMAGE_TS' => get_icon( @$category['date_last']),229 'IMAGE_TS' => get_icon($category['max_date_last'], $category['is_child_date_last']), 217 230 ) 218 231 );
Note: See TracChangeset
for help on using the changeset viewer.