Changeset 2117 for trunk/include
- Timestamp:
- Oct 2, 2007, 7:38:54 AM (17 years ago)
- Location:
- trunk/include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_cats.inc.php
r2095 r2117 216 216 } 217 217 218 // add default event handler for rendering category literal description219 add_event_handler('render_category_literal_description',220 create_function('$d',221 'return strip_tags($d, \'<a><br><p><b><i><small><strong><font>\');'));222 223 218 trigger_action('loc_begin_index_category_thumbnails', $categories); 224 219 if ($conf['subcatify']) -
trunk/include/common.inc.php
r2111 r2117 172 172 173 173 // template instance 174 if 174 if 175 175 ( 176 defined('IN_ADMIN') and IN_ADMIN and 176 defined('IN_ADMIN') and IN_ADMIN and 177 177 isset($user['admin_template']) and 178 178 isset($user['admin_theme']) … … 263 263 264 264 // default event handlers 265 add_event_handler('render_category_literal_description', 'render_category_literal_description'); 266 add_event_handler('render_category_description', 'render_category_description'); 265 267 add_event_handler('render_comment_content', 'htmlspecialchars'); 266 268 add_event_handler('render_comment_content', 'parse_comment_content'); -
trunk/include/functions_category.inc.php
r2070 r2117 157 157 } 158 158 } 159 global $conf;160 if ( !( $conf['allow_html_descriptions'] and161 preg_match('/<(div|br|img|script).*>/i', $cat['comment']) ) )162 {163 $cat['comment'] = nl2br(@$cat['comment']);164 }165 159 166 160 $upper_ids = explode(',', $cat['uppercats']); … … 449 443 $cat_nb_images = 0; 450 444 } 451 445 452 446 //at least one image direct or indirect 453 447 $display_text.= l10n_dec('image_available', 'images_available', $cat_count_images); -
trunk/include/functions_html.inc.php
r2070 r2117 59 59 { 60 60 // Use MySql date in order to standardize all recent "actions/queries" 61 list($page['get_icon_cache']['unix_timestamp']) = 61 list($page['get_icon_cache']['unix_timestamp']) = 62 62 mysql_fetch_array(pwg_query('select UNIX_TIMESTAMP(CURRENT_DATE)')); 63 63 } … … 456 456 $menu.= "\n".'<span class="'; 457 457 // at least one image in this category -> class menuInfoCat 458 $menu.= ($category['nb_images'] > 0 ? "menuInfoCat" 458 $menu.= ($category['nb_images'] > 0 ? "menuInfoCat" 459 459 : "menuInfoCatByChild").'"'; 460 460 $menu.= ' title=" '.$title.'">'; … … 736 736 function set_span_class($count) 737 737 { 738 if ($count > 1) 739 { 738 if ($count > 1) 739 { 740 740 return 'plural'; 741 741 } 742 return ( $count == 0 ) ? 'zero':'one'; 742 return ( $count == 0 ) ? 'zero':'one'; 743 } 744 745 /** returns the category comment for rendering in html. 746 * this is an event handler. don't call directly 747 */ 748 function render_category_description($desc) 749 { 750 global $conf; 751 if ( !( $conf['allow_html_descriptions'] and 752 preg_match('/<(div|br|img|script).*>/i', $desc) ) ) 753 { 754 $desc = nl2br($desc); 755 } 756 return $desc; 757 } 758 759 /** returns the category comment for rendering in html textual mode (subcatify) 760 * this is an event handler. don't call directly 761 */ 762 function render_category_literal_description($desc) 763 { 764 return strip_tags($desc, '<span><p><a><br><b><i><small><big><strong><em>'); 743 765 } 744 766 ?> -
trunk/include/section_init.inc.php
r1996 r2117 204 204 $page, 205 205 array( 206 'comment' => $page['category']['comment'], 206 'comment' => 207 trigger_event( 208 'render_category_description', 209 $page['category']['comment'] 210 ), 207 211 'title' => 208 212 get_cat_display_name($page['category']['upper_names'], '', false), … … 331 335 $page, 332 336 array( 333 'title' => $lang['search_result'], 337 'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">' 338 .$lang['search_result'].'</a>', 334 339 ) 335 340 ); … … 385 390 $page, 386 391 array( 387 'title' => '<a href="'.duplicate_index_url( ).'">'392 'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">' 388 393 .$lang['recent_pics_cat'].'</a>', 389 394 'items' => array_from_query($query, 'id'), … … 423 428 $page, 424 429 array( 425 'title' => '<a href="'.duplicate_index_url( ).'">'430 'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">' 426 431 .$conf['top_number'].' '.$lang['most_visited_cat'].'</a>', 427 432 'items' => array_from_query($query, 'id'), … … 449 454 $page, 450 455 array( 451 'title' => '<a href="'.duplicate_index_url( ).'">'456 'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">' 452 457 .$conf['top_number'].' '.$lang['best_rated_cat'].'</a>', 453 458 'items' => array_from_query($query, 'id'), … … 472 477 $page, 473 478 array( 474 'title' => '<a href="'.duplicate_index_url( ).'">'479 'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">' 475 480 .$lang['random_cat'].'</a>', 476 481 'items' => array_from_query($query, 'id'),
Note: See TracChangeset
for help on using the changeset viewer.