Ignore:
Timestamp:
Feb 5, 2009, 4:03:30 AM (15 years ago)
Author:
rvelices
Message:
  • embellish_url compacts now ..
  • some trigger improvements (render_category_description)
  • improved perf of duplicate_xxx_url ( rewrote func params_for_duplication and remove some vars from $page )
File:
1 edited

Legend:

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

    r3049 r3126  
    2424function get_icon($date, $is_child_date = false)
    2525{
    26   global $page, $user;
     26  global $cache, $user;
    2727
    2828  if (empty($date))
     
    3131  }
    3232
    33   if (isset($page['get_icon_cache'][$date]))
    34   {
    35     if (! $page['get_icon_cache'][$date] )
     33  if (isset($cache['get_icon'][$date]))
     34  {
     35    if (! $cache['get_icon'][$date] )
    3636      return '';
    37     return $page['get_icon_cache']['_icons_'][$is_child_date];
    38   }
    39 
    40   if (!isset($page['get_icon_cache']['sql_recent_date']))
     37    return $cache['get_icon']['_icons_'][$is_child_date];
     38  }
     39
     40  if (!isset($cache['get_icon']['sql_recent_date']))
    4141  {
    4242    // Use MySql date in order to standardize all recent "actions/queries"
    43     list($page['get_icon_cache']['sql_recent_date']) =
     43    list($cache['get_icon']['sql_recent_date']) =
    4444      mysql_fetch_array(pwg_query('select SUBDATE(
    4545      CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)'));
    4646  }
    4747
    48   $page['get_icon_cache'][$date] = false;
    49   if ( $date > $page['get_icon_cache']['sql_recent_date'] )
    50   {
    51     if ( !isset($page['get_icon_cache']['_icons_'] ) )
     48  $cache['get_icon'][$date] = false;
     49  if ( $date > $cache['get_icon']['sql_recent_date'] )
     50  {
     51    if ( !isset($cache['get_icon']['_icons_'] ) )
    5252    {
    5353      $icons = array(false => 'recent', true => 'recent_by_child' );
     
    6363        $output = '<img title="'.$title.'" src="'.$icon_url.'" class="icon" style="border:0;';
    6464        $output.= 'height:'.$size[1].'px;width:'.$size[0].'px" alt="(!)" />';
    65         $page['get_icon_cache']['_icons_'][$key] = $output;
     65        $cache['get_icon']['_icons_'][$key] = $output;
    6666      }
    6767    }
    68     $page['get_icon_cache'][$date] = true;
    69   }
    70 
    71   if (! $page['get_icon_cache'][$date] )
     68    $cache['get_icon'][$date] = true;
     69  }
     70
     71  if (! $cache['get_icon'][$date] )
    7272    return '';
    73   return $page['get_icon_cache']['_icons_'][$is_child_date];
     73  return $cache['get_icon']['_icons_'][$is_child_date];
    7474}
    7575
     
    777777}
    778778
    779 /** returns the category comment for rendering in html.
    780  * this is an event handler. don't call directly
    781  */
    782 function render_category_description($desc)
    783 {
    784   global $conf;
    785   if ( !$conf['allow_html_descriptions'] )
    786   {
    787     $desc = nl2br($desc);
    788   }
    789   return $desc;
    790 }
    791 
    792779/** returns the category comment for rendering in html textual mode (subcatify)
    793780 * this is an event handler. don't call directly
Note: See TracChangeset for help on using the changeset viewer.