$cache['get_icon']['sql_recent_date'] )
{
if ( !isset($cache['get_icon']['_icons_'] ) )
{
$icons = array(false => 'recent', true => 'recent_by_child' );
$title = sprintf(
l10n('elements posted during the last %d days'),
$user['recent_period']
);
foreach ($icons as $key => $icon)
{
$icon_url = get_themeconf('icon_dir').'/'.$icon.'.png';
$size = getimagesize( PHPWG_ROOT_PATH.$icon_url );
$icon_url = get_root_url().$icon_url;
$output = '';
$cache['get_icon']['_icons_'][$key] = $output;
}
}
$cache['get_icon'][$date] = true;
}
if (! $cache['get_icon'][$date] )
return '';
return $cache['get_icon']['_icons_'][$is_child_date];
}
/**
* returns the list of categories as a HTML string
*
* categories string returned contains categories as given in the input
* array $cat_informations. $cat_informations array must be an array
* of array( id=>?, name=>?, permalink=>?). If url input parameter is null,
* returns only the categories name without links.
*
* @param array cat_informations
* @param string url
* @param boolean replace_space
* @return string
*/
function get_cat_display_name($cat_informations,
$url = '',
$replace_space = true)
{
global $conf;
$output = '';
$is_first = true;
foreach ($cat_informations as $cat)
{
is_array($cat) or trigger_error(
'get_cat_display_name wrong type for category ', E_USER_WARNING
);
$cat['name'] = trigger_event(
'render_category_name',
$cat['name'],
'get_cat_display_name'
);
if ($is_first)
{
$is_first = false;
}
else
{
$output.= $conf['level_separator'];
}
if ( !isset($url) )
{
$output.= $cat['name'];
}
elseif ($url == '')
{
$output.= '';
$output.= $cat['name'].'';
}
else
{
$output.= '';
$output.= $cat['name'].'';
}
}
if ($replace_space)
{
return replace_space($output);
}
else
{
return $output;
}
}
/**
* returns the list of categories as a HTML string, with cache of names
*
* categories string returned contains categories as given in the input
* array $cat_informations. $uppercats is the list of category ids to
* display in the right order. If url input parameter is empty, returns only
* the categories name without links.
*
* @param string uppercats
* @param string url
* @param boolean replace_space
* @return string
*/
function get_cat_display_name_cache($uppercats,
$url = '',
$replace_space = true)
{
global $cache, $conf;
if (!isset($cache['cat_names']))
{
$query = '
SELECT id, name, permalink
FROM '.CATEGORIES_TABLE.'
;';
$cache['cat_names'] = hash_from_query($query, 'id');
}
$output = '';
$is_first = true;
foreach (explode(',', $uppercats) as $category_id)
{
$cat = $cache['cat_names'][$category_id];
$cat['name'] = trigger_event(
'render_category_name',
$cat['name'],
'get_cat_display_name_cache'
);
if ($is_first)
{
$is_first = false;
}
else
{
$output.= $conf['level_separator'];
}
if ( !isset($url) )
{
$output.= $cat['name'];
}
elseif ($url == '')
{
$output.= '
'.$cat['name'].'';
}
else
{
$output.= '
'.$cat['name'].'';
}
}
if ($replace_space)
{
return replace_space($output);
}
else
{
return $output;
}
}
/**
* returns HTMLized comment contents retrieved from database
*
* newlines becomes br tags, _word_ becomes underline, /word/ becomes
* italic, *word* becomes bolded
*
* @param string content
* @return string
*/
function parse_comment_content($content)
{
$pattern = '/(https?:\/\/\S*)/';
$replacement = '$1';
$content = preg_replace($pattern, $replacement, $content);
$content = nl2br($content);
// replace _word_ by an underlined word
$pattern = '/\b_(\S*)_\b/';
$replacement = '$1';
$content = preg_replace($pattern, $replacement, $content);
// replace *word* by a bolded word
$pattern = '/\b\*(\S*)\*\b/';
$replacement = '$1';
$content = preg_replace($pattern, $replacement, $content);
// replace /word/ by an italic word
$pattern = "/\/(\S*)\/(\s)/";
$replacement = '$1$2';
$content = preg_replace($pattern, $replacement, $content);
$content = '
$msg $btrace_msg\n"; @set_status_header(500); echo $display.str_repeat( ' ', 300); //IE6 doesn't error output if below a size if ( function_exists('ini_set') ) {// if possible turn off error display (we display it) ini_set('display_errors', false); } error_reporting( E_ALL ); trigger_error( strip_tags($msg).$btrace_msg, E_USER_ERROR ); die(0); // just in case } /* returns the title to be displayed above thumbnails on tag page */ function get_tags_content_title() { global $page; $title = count($page['tags']) > 1 ? l10n('Tags') : l10n('Tag'); $title.= ' '; for ($i=0; $i