/** * Vypis kodu uzivatelskeho menu * @param bool $return navratit namisto vypsani 1/0 */ function _templateUserMenu($return = false) { global $_lang; $output = ""; if (_template_usermenu_parent != "") { $output .= "<" . _template_usermenu_parent . ">\n"; } $extend_args = _extendArgs($output); _extend('call', 'tpl.usermenu.first', $extend_args); if (!_loginindicator) { /*prihlaseni*/ $output .= _template_usermenu_item_start . "<a href='" . _indexroot . "index.php?m=login&login_form_return=" . urlencode($_SERVER['REQUEST_URI']) . "' class='usermenu-item-login'>" . $_lang['usermenu.login'] . "</a>" . _template_usermenu_item_end . "\n"; if (_registration) { /*registrace*/ $output .= _template_usermenu_item_start . "<a href='" . _indexroot . "index.php?m=reg' class='usermenu-item-reg'>" . $_lang['usermenu.registration'] . "</a>" . _template_usermenu_item_end . "\n"; } } else { /*vzkazy*/ if (_messages) { $messages_count = DB::result(DB::query("SELECT COUNT(id) FROM `" . _mysql_prefix . "-pm` WHERE (receiver=" . _loginid . " AND receiver_deleted=0 AND receiver_readtime<update_time) OR (sender=" . _loginid . " AND sender_deleted=0 AND sender_readtime<update_time)"), 0); if ($messages_count != 0) { $messages_count = " [" . $messages_count . "]"; } else { $messages_count = ""; } $output .= _template_usermenu_item_start . "<a href='" . _indexroot . "index.php?m=messages' class='usermenu-item-messages'>" . $_lang['usermenu.messages'] . $messages_count . "</a>" . _template_usermenu_item_end . "\n"; } /*nastaveni*/ $output .= _template_usermenu_item_start . "<a href='" . _indexroot . "index.php?m=settings' class='usermenu-item-settings'>" . $_lang['usermenu.settings'] . "</a>" . _template_usermenu_item_end . "\n"; _extend('call', 'tpl.usermenu.beforelogout', $extend_args); /*odhlaseni*/ $output .= _template_usermenu_item_start . "<a href='" . _xsrfLink(_indexroot . "remote/logout.php?_return=" . urlencode($_SERVER['REQUEST_URI'])) . "' class='usermenu-item-logout'>" . $_lang['usermenu.logout'] . (_template_usermenu_showusername ? " [" . _loginname . "]" : '') . "</a>" . _template_usermenu_item_end . "\n"; } if (_ulist and (!_notpublicsite or _loginindicator)) { /*uziv. menu*/ $output .= _template_usermenu_item_start . "<a href='" . _indexroot . "index.php?m=ulist' class='usermenu-item-ulist'>" . $_lang['usermenu.ulist'] . "</a>" . _template_usermenu_item_end . "\n"; } _extend('call', 'tpl.usermenu.last', $extend_args); if (_template_usermenu_parent != "") { $output .= "</" . _template_usermenu_parent . ">\n"; } if (_template_usermenu_trim == 1) { $output = trim($output); $output = trim($output, _template_usermenu_item_start); $output = trim($output, _template_usermenu_item_end); } // vratit nebo vypsat if ($return) { return $output; } echo $output; }
define('_indexOutput_url', _indexroot); } if (!defined('_path')) { define('_path', $base_path); } /* -- nenalezeno nebo pozadovani prihlaseni pro neverejny obsah -- */ if (!defined('_indexOutput_content')) { if (!$notpublic_form) { $content_404 = (_template_autoheadings ? "<h1>" . $_lang['global.error404.title'] . "</h1>" : '') . _formMessage(2, $_lang['global.error404']); _extend('call', 'index.notfound', _extendArgs($content_404)); define('_indexOutput_content', $content_404); define('_indexOutput_title', $_lang['global.error404.title']); $found = false; } else { $form = _uniForm("notpublic", array($notpublic_form_wholesite)); _extend('call', 'index.notpublic', _extendArgs($form[0])); define('_indexOutput_content', $form[0]); define('_indexOutput_title', $form[1]); } } /* -- vlozeni sablony motivu nebo presmerovani -- */ if (!defined('_redirect_to')) { if (!$found) { header('HTTP/1.1 404 Not Found'); } $template_path = _extend('fetch', 'index.template'); if (null === $template_path) { $template_path = _indexroot . 'plugins/templates/' . _template . '/template.php'; } require $template_path; } else {
if (!(isset($modules[$getp][4]) and $modules[$getp][4] == true)) { $output .= "<h1>" . $modules[$getp][0] . "</h1>"; } /*soubor*/ if (!isset($modules[$getp][5])) { $file = "require/" . $getp . ".php"; } else { $file = _indexroot . 'plugins/admin/' . $getp . '/script.php'; } /*vlozeni*/ $extend_args = _extendArgs($output, array('name' => $getp, 'file' => &$file)); _extend('call', 'admin.mod.init', $extend_args); _extend('call', 'admin.mod.' . $getp . '.pre', $extend_args); if (@file_exists($file)) { require $file; $extend_args = _extendArgs($output); _extend('call', 'admin.mod.' . $getp . '.post', $extend_args); _extend('call', 'admin.mod.post', $extend_args); } else { $output .= _formMessage(2, $_lang['admin.moduleunavailable']); } } else { $output .= "<h1>" . $_lang['global.error'] . "</h1>" . _formMessage(3, $_lang['global.accessdenied']); } } else { $output .= "<h1>" . $_lang['global.error404.title'] . "</h1>" . _formMessage(2, $_lang['global.error404']); } } } else { // prihlasovaci formular if (empty($_POST)) {
$title = $query['title']; if (_template_autoheadings && $query['autotitle']) { $content .= "<h1>" . $query['title'] . _linkRSS($id, 4) . "</h1>\n"; } _extend('call', 'page.category.aftertitle', $extend_args); // obsah _extend('call', 'page.category.content.before', $extend_args); if ($query['content'] != "") { $content .= _parseHCM($query['content']) . "\n\n<div class='hr'><hr /></div>\n\n"; } _extend('call', 'page.category.content.after', $extend_args); // vypis clanku $arts_cond = "(art.home1=" . $id . " OR art.home2=" . $id . " OR art.home3=" . $id . ") AND " . _sqlArticleFilter() . " ORDER BY " . $artorder; $paging = _resultPaging(_indexOutput_url, $artsperpage, "articles:art", $arts_cond); $arts = DB::query("SELECT art.id,art.title,art.title_seo,art.author,art.perex," . ($query['var4'] ? 'art.picture_uid,' : '') . "art.time,art.comments,art.readed,cat.title_seo AS cat_title_seo,(SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` AS post WHERE home=art.id AND post.type=2) AS comment_count FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1) WHERE " . $arts_cond . " " . $paging[1]); if (DB::size($arts) != 0) { if (_pagingmode == 1 or _pagingmode == 2) { $content .= $paging[0]; } while ($art = DB::row($arts)) { $extend_item_args = _extendArgs($content, array('query' => $query, 'item-query' => &$art)); _extend('call', 'page.category.item.before', $extend_item_args); $content .= _articlePreview($art, $query['var3'] == 1, true, $art['comment_count']); _extend('call', 'page.category.item.after', $extend_item_args); } if (_pagingmode == 2 or _pagingmode == 3) { $content .= '<br />' . $paging[0]; } } else { $content .= '<p>' . $_lang['misc.category.noarts'] . '</p>'; }