Changeset 1130
- Timestamp:
- Apr 6, 2006, 1:08:37 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 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 ?> -
trunk/include/category_subcats.inc.php
r1098 r1130 33 33 34 34 $query = ' 35 SELECT id, name, date_last, representative_picture_id 35 SELECT id, name, date_last, representative_picture_id, comment, nb_images 36 36 FROM '.CATEGORIES_TABLE.' 37 37 WHERE id_uppercat '. … … 99 99 'picture' => $image_id, 100 100 'name' => $row['name'], 101 'date_last' => @$row['date_last'] 101 'date_last' => @$row['date_last'], 102 'comment' => @$row['comment'], 103 'nb_images' => $row['nb_images'], 102 104 ) 103 105 ); … … 127 129 } 128 130 129 $template->assign_block_vars('thumbnails', array()); 130 // first line 131 $template->assign_block_vars('thumbnails.line', array()); 132 // current row displayed 133 $row_number = 0; 131 $template->assign_block_vars('categories', array()); 134 132 135 133 foreach ($cat_thumbnails as $item) 136 134 { 137 135 $template->assign_block_vars( 138 ' thumbnails.line.thumbnail',136 'categories.category', 139 137 array( 140 ' IMAGE'=> $images[$item['picture']],141 ' IMAGE_ALT' => $item['name'],142 ' IMAGE_TITLE' => $lang['hint_category'],143 'I MAGE_TS'=> get_icon(@$item['date_last']),138 'SRC' => $images[$item['picture']], 139 'ALT' => $item['name'], 140 'TITLE' => $lang['hint_category'], 141 'ICON' => get_icon(@$item['date_last']), 144 142 145 'U _IMG_LINK'=> make_index_url(143 'URL' => make_index_url( 146 144 array( 147 145 'category' => $item['category'], 148 146 ) 149 147 ), 150 'CLASS' => 'thumbCat', 148 'NAME' => $item['name'], 149 'NB_IMAGES' => $item['nb_images'], 150 'DESCRIPTION' => @$item['comment'], 151 151 ) 152 152 ); 153 154 $template->assign_block_vars(155 'thumbnails.line.thumbnail.category_name',156 array(157 'NAME' => $item['name']158 )159 );160 161 // create a new line ?162 if (++$row_number == $user['nb_image_line'])163 {164 $template->assign_block_vars('thumbnails.line', array());165 $row_number = 0;166 }167 153 } 168 154 } -
trunk/template/yoga/content.css
r1119 r1130 260 260 vertical-align: top; 261 261 } 262 263 /* Category thumbnails on main page, CSS code inspired from MOD subcatify */ 264 #content UL.thumbnailCategories { 265 margin: 0; 266 padding: 0; 267 list-style: none; 268 text-align: center; 269 } 270 271 #content UL.thumbnailCategories LI { 272 width: 49.9%; /* 49.9% for 2 per line, 33.3% for 3 per line*/ 273 margin:0; 274 padding:0; 275 float:left; 276 } 277 278 #content DIV.thumbnailCategory { 279 display:block; 280 border: 1px solid #aaa; 281 padding: 5px 0px 0px 4px; 282 margin: 5px; 283 } 284 285 #content DIV.thumbnailCategory DIV.description { 286 font-size: 90%; 287 } 288 289 #content DIV.thumbnailCategory DIV.description H3 { 290 text-align: left; 291 background: #eee; 292 margin: 0; 293 padding: 0.1em; 294 font-size: 120%; 295 } 296 297 #content DIV.thumbnailCategory DIV.description P { 298 margin: 0; 299 } 300 301 #content DIV.thumbnailCategory DIV.illustration { 302 text-align: left; 303 padding: 2px; 304 float: left; 305 width: 110px; /* sorry, this is a very personal value :-( */ 306 height: 110px; 307 } -
trunk/template/yoga/index.tpl
r1119 r1130 177 177 <!-- END calendar --> 178 178 179 </div> <!-- content-->179 </div> <!-- titrePage --> 180 180 181 181 <!-- BEGIN calendar --> … … 232 232 <!-- END thumbnails --> 233 233 234 <!-- BEGIN categories --> 235 <ul class="thumbnailCategories"> 236 <!-- BEGIN category --> 237 <li> 238 <div class="thumbnailCategory"> 239 <div class="illustration"> 240 <a href="{categories.category.URL}"> 241 <img src="{categories.category.SRC}" 242 alt="{categories.category.ALT}" 243 title="{categories.category.TITLE}"> 244 </a> 245 </div> 246 <div class="description"> 247 <h3> 248 {categories.category.ICON} 249 <a href="{categories.category.URL}">{categories.category.NAME}</a> 250 </h3> 251 <p>{categories.category.NB_IMAGES} {lang:pictures}</p> 252 <p>{categories.category.DESCRIPTION}</p> 253 </div> 254 <hr class="separation" /> 255 </div> 256 </li> 257 <!-- END category --> 258 </ul> 259 <hr class="separation" /> 260 <!-- END categories --> 261 234 262 <!-- BEGIN cat_infos --> 235 263 <!-- BEGIN navigation -->
Note: See TracChangeset
for help on using the changeset viewer.