?, 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 = ''.l10n('Home').''; $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 render_comment_content($content) { $content = htmlspecialchars($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); return $content; } function get_cat_display_name_from_id($cat_id, $url = '', $replace_space = true) { $cat_info = get_cat_info($cat_id); return get_cat_display_name($cat_info['upper_names'], $url, $replace_space); } /** * Returns an HTML list of tags. It can be a multi select field or a list of * checkboxes. * * @param string HTML field name * @param array selected tag ids * @return array */ function get_html_tag_selection( $tags, $fieldname, $selecteds = array(), $forbidden_categories = null ) { global $conf; if (count ($tags) == 0 ) { return ''; } $output = '
$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('Tag') : l10n('Tag'); $title.= ' '; for ($i=0; $i