homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $core->url->type == 'default')) { return; } $value = isset($GLOBALS['_search']) ? html::escapeHTML($GLOBALS['_search']) : ''; return ($w->content_only ? '' : ''); } public static function navigation($w) { global $core; if (($w->homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $core->url->type == 'default')) { return; } $res = ($w->content_only ? '' : '
class ? ' class="'.html::escapeHTML($w->class).'"' : '').'>'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). ''. ($w->content_only ? '' : '
'); return $res; } public static function bestof($w) { global $core; if (($w->homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $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 = ($w->content_only ? '' : '
'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). ''.($w->content_only ? '' : '
'); return $res; } public static function langs($w) { global $core, $_ctx; if (($w->homeonly == 1 && $core->url->type != 'default' && $core->url->type != 'lang') || ($w->homeonly == 2 && ($core->url->type == 'default' || $core->url->type == 'lang'))) { return; } $rs = $core->blog->getLangs(); if ($rs->count() <= 1) { return; } $langs = l10n::getISOcodes(); $res = ($w->content_only ? '' : '
'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). ''.($w->content_only ? '' : '
'); return $res; } public static function subscribe($w) { global $core; if (($w->homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $core->url->type == 'default')) { return; } $type = ($w->type == 'atom' || $w->type == 'rss2') ? $w->type : 'rss2'; $mime = $type == 'rss2' ? 'application/rss+xml' : 'application/atom+xml'; $p_title = __('This blog\'s entries %s feed'); $res = ($w->content_only ? '' : '
'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). ''.($w->content_only ? '' : '
'); return $res; } public static function feed($w) { if (!$w->url) { return; } global $core; if (($w->homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $core->url->type == 'default')) { return; } $limit = abs((integer) $w->limit); try { $feed = feedReader::quickParse($w->url,DC_TPL_CACHE); if ($feed == false || count($feed->items) == 0) { return; } } catch (Exception $e) { return; } $res = ($w->content_only ? '' : '
'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). ''.($w->content_only ? '' : '
'); return $res; } public static function text($w) { global $core; if (($w->homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $core->url->type == 'default')) { return; } $res = ($w->content_only ? '' : '
'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). $w->text. ($w->content_only ? '' : '
'); return $res; } public static function lastposts($w) { global $core; if (($w->homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $core->url->type == 'default')) { return; } $params['limit'] = abs((integer) $w->limit); $params['order'] = 'post_dt desc'; $params['no_content'] = true; if ($w->tag) { $params['meta_id'] = $w->tag; $rs = $core->meta->getPostsByMeta($params); } else { $rs = $core->blog->getPosts($params); } if ($rs->isEmpty()) { return; } $res = ($w->content_only ? '' : '
'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). ''.($w->content_only ? '' : '
'); return $res; } public static function lastcomments($w) { global $core; if (($w->homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $core->url->type == 'default')) { return; } $params['limit'] = abs((integer) $w->limit); $params['order'] = 'comment_dt desc'; $rs = $core->blog->getComments($params); if ($rs->isEmpty()) { return; } $res = ($w->content_only ? '' : '
'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). ''.($w->content_only ? '' : '
'); return $res; } } ?>