'.
($w->title ? '
'.html::escapeHTML($w->title).'
' : '');
$ref_level = $level = $rs->level-1;
while ($rs->fetch())
{
$class = '';
if (($core->url->type == 'category' && $_ctx->categories instanceof record && $_ctx->categories->cat_id == $rs->cat_id)
|| ($core->url->type == 'post' && $_ctx->posts instanceof record && $_ctx->posts->cat_id == $rs->cat_id)) {
$class = ' class="category-current"';
}
if ($rs->level > $level) {
$res .= str_repeat('
- ',$rs->level - $level);
} elseif ($rs->level < $level) {
$res .= str_repeat('
',-($rs->level - $level));
}
if ($rs->level <= $level) {
$res .= '
';
}
$res .=
''.
html::escapeHTML($rs->cat_title).''.
($w->postcount ? ' ('.$rs->nb_post.')' : '');
$level = $rs->level;
}
if ($ref_level - $level < 0) {
$res .= str_repeat('',-($ref_level - $level));
}
$res .= '
';
return $res;
}
public static function bestof($w)
{
global $core;
if ($w->homeonly && $core->url->type != 'default') {
return;
}
$params = array(
'post_selected' => true,
'no_content' => true,
'order' => 'post_dt '.strtoupper($w->orderby)
);
$rs = $core->blog->getPosts($params);
if ($rs->isEmpty()) {
return;
}
$res =
'
'.html::escapeHTML($w->title).'
' : ''). ''; while ($rs->fetch()) { $res .= '- '.
html::escapeHTML($rs->post_title).' - '.
html::escapeHTML($rs->comment_author).
'
';
}
$res .= '