Changeset 1130 for trunk/include/category_recent_cats.inc.php
- Timestamp:
- Apr 6, 2006, 1:08:37 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_recent_cats.inc.php
r1092 r1130 32 32 */ 33 33 34 // FIXME: categories having no representant 35 // ($conf['allow_random_representative'] = true) are not displayed :-/ 36 34 37 // retrieving categories recently update, ie containing pictures added 35 38 // recently. The calculated table field categories.date_last will be 36 39 // easier to use 37 40 $query = ' 38 SELECT c.id AS category_id,uppercats,representative_picture_id,path,file,tn_ext 39 FROM '.CATEGORIES_TABLE.' AS c INNER JOIN '.IMAGES_TABLE.' AS i 40 ON i.id = c.representative_picture_id 41 WHERE date_last > SUBDATE(CURRENT_DATE 42 ,INTERVAL '.$user['recent_period'].' DAY)'; 41 SELECT c.id AS category_id 42 , uppercats 43 , representative_picture_id 44 , path 45 , file 46 , c.comment 47 , tn_ext 48 , nb_images 49 FROM '.CATEGORIES_TABLE.' AS c 50 INNER JOIN '.IMAGES_TABLE.' AS i ON i.id = c.representative_picture_id 51 WHERE date_last > SUBDATE( 52 CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY 53 )'; 43 54 if ( $user['forbidden_categories'] != '' ) 44 55 { … … 53 64 if (mysql_num_rows($result) > 0) 54 65 { 55 $template->assign_block_vars('thumbnails', array()); 56 // first line 57 $template->assign_block_vars('thumbnails.line', array()); 58 // current row displayed 59 $row_number = 0; 66 $template->assign_block_vars('categories', array()); 60 67 } 61 68 62 $old_level_separator = $conf['level_separator'];63 $conf['level_separator'] = '<br />';64 69 // for each category, we have to search a recent picture to display and 65 70 // the name to display … … 67 72 { 68 73 $template->assign_block_vars( 69 ' thumbnails.line.thumbnail',74 'categories.category', 70 75 array( 71 ' IMAGE' => get_thumbnail_src($row['path'], @$row['tn_ext']),72 ' IMAGE_ALT' => $row['file'],73 ' IMAGE_TITLE' => $lang['hint_category'],76 'SRC' => get_thumbnail_src($row['path'], @$row['tn_ext']), 77 'ALT' => $row['file'], 78 'TITLE' => $lang['hint_category'], 74 79 75 'U _IMG_LINK' => make_index_url(80 'URL' => make_index_url( 76 81 array( 77 82 'category' => $row['category_id'], 78 83 ) 79 84 ), 85 'NAME' => get_cat_display_name_cache($row['uppercats'], null, false), 86 'NB_IMAGES' => $row['nb_images'], 87 'DESCRIPTION' => @$row['comment'], 80 88 ) 81 89 ); 82 83 $template->assign_block_vars(84 'thumbnails.line.thumbnail.category_name',85 array(86 'NAME' => get_cat_display_name_cache($row['uppercats'], null, false),87 )88 );89 90 // create a new line ?91 if (++$row_number == $user['nb_image_line'])92 {93 $template->assign_block_vars('thumbnails.line', array());94 $row_number = 0;95 }96 90 } 97 $conf['level_separator'] = $old_level_separator;98 91 ?>
Note: See TracChangeset
for help on using the changeset viewer.