$indexSet = 'index.tpl'; } // // phpMyFAQ installtion is in maintenance mode // if ($faqConfig->get('main.maintenanceMode')) { $indexSet = 'indexMaintenance.tpl'; } // // Load template files and set template variables // $tpl = new PMF_Template(array('index' => $indexSet, 'rightBox' => $rightSidebarTemplate, 'writeContent' => $includeTemplate), $faqConfig->get('main.templateSet')); if ($faqConfig->get('main.enableUserTracking')) { $users = $faqsession->getUsersOnline(); $totUsers = $users[0] + $users[1]; $usersOnline = $plr->getMsg('plmsgUserOnline', $totUsers) . ' | ' . $plr->getMsg('plmsgGuestOnline', $users[0]) . $plr->getMsg('plmsgRegisteredOnline', $users[1]); } else { $usersOnline = ''; } $faqSystem = new PMF_System(); $categoryHelper = new PMF_Helper_Category(); $categoryHelper->setCategory($category); $categoryHelper->setConfiguration($faqConfig); $keywordsArray = array_merge(explode(',', $keywords), explode(',', $faqConfig->get('main.metaKeywords'))); $keywordsArray = array_filter($keywordsArray, 'strlen'); shuffle($keywordsArray); $keywords = implode(',', $keywordsArray); $faqLink = new PMF_Link($faqSystem->getSystemUri($faqConfig), $faqConfig); $currentPageUrl = $faqLink->getCurrentUrl(); if (is_null($error)) { $loginMessage = '<p>' . $PMF_LANG['ad_auth_insert'] . '</p>';
$hasTags = $oTag->existTagRelations(); if ($hasTags && ($action == 'artikel' || $action == 'show')) { $right_tpl = $action == 'artikel' ? 'catandtag.tpl' : 'tagcloud.tpl'; } else { $right_tpl = 'startpage.tpl'; } // // Load template files and set template variables // $tpl = new PMF_Template(array('index' => 'index.tpl', 'loginBox' => $login_tpl, 'rightBox' => $right_tpl, 'writeContent' => $inc_tpl), $faqconfig->get('main.templateSet')); $usersOnLine = getUsersOnline(); $totUsersOnLine = $usersOnLine[0] + $usersOnLine[1]; $systemUri = PMF_Link::getSystemUri('index.php'); $helper = PMF_Helper_Category::getInstance(); $helper->setCategory($category); $main_template_vars = array('title' => $faqconfig->get('main.titleFAQ') . $title, 'baseHref' => $systemUri, 'version' => $faqconfig->get('main.currentVersion'), 'header' => str_replace('"', '', $faqconfig->get('main.titleFAQ')), 'metaTitle' => str_replace('"', '', $faqconfig->get('main.titleFAQ')), 'metaDescription' => $faqconfig->get('main.metaDescription'), 'metaKeywords' => $faqconfig->get('main.metaKeywords') . $keywords, 'metaPublisher' => $faqconfig->get('main.metaPublisher'), 'metaLanguage' => $PMF_LANG['metaLanguage'], 'metaCharset' => $PMF_LANG['metaCharset'], 'phpmyfaqversion' => $faqconfig->get('main.currentVersion'), 'stylesheet' => $PMF_LANG['dir'] == 'rtl' ? 'style.rtl' : 'style', 'action' => $action, 'dir' => $PMF_LANG['dir'], 'msgCategory' => $PMF_LANG['msgCategory'], 'showCategories' => $helper->renderCategoryNavigation($cat), 'searchBox' => $PMF_LANG['msgSearch'], 'languageBox' => $PMF_LANG['msgLangaugeSubmit'], 'writeLangAdress' => $writeLangAdress, 'switchLanguages' => PMF_Language::selectLanguages($LANGCODE, true), 'userOnline' => $plr->getMsg('plmsgUserOnline', $totUsersOnLine) . $plr->getMsg('plmsgGuestOnline', $usersOnLine[0]) . $plr->getMsg('plmsgRegisteredOnline', $usersOnLine[1]), 'stickyRecordsHeader' => $PMF_LANG['stickyRecordsHeader'], 'copyright' => 'powered by <a href="http://www.phpmyfaq.de" target="_blank">phpMyFAQ</a> ' . $faqconfig->get('main.currentVersion')); $stickyRecordsParams = $faq->getStickyRecords(); if (!isset($stickyRecordsParams['error'])) { $tpl->processBlock('index', 'stickyRecordsList', array('stickyRecordsUrl' => $stickyRecordsParams['url'], 'stickyRecordsTitle' => $stickyRecordsParams['title'])); } if ($faqconfig->get('main.enableRewriteRules')) { $links_template_vars = array("faqHome" => $_SERVER['PHP_SELF'], "msgSearch" => '<a href="' . $systemUri . 'search.html">' . $PMF_LANG["msgAdvancedSearch"] . '</a>', 'msgAddContent' => '<a href="' . $systemUri . 'addcontent.html">' . $PMF_LANG["msgAddContent"] . '</a>', "msgQuestion" => '<a href="' . $systemUri . 'ask.html">' . $PMF_LANG["msgQuestion"] . '</a>', "msgOpenQuestions" => '<a href="' . $systemUri . 'open.html">' . $PMF_LANG["msgOpenQuestions"] . '</a>', 'msgHelp' => '<a href="' . $systemUri . 'help.html">' . $PMF_LANG["msgHelp"] . '</a>', "msgContact" => '<a href="' . $systemUri . 'contact.html">' . $PMF_LANG["msgContact"] . '</a>', "backToHome" => '<a href="' . $systemUri . 'index.html">' . $PMF_LANG["msgHome"] . '</a>', "allCategories" => '<a href="' . $systemUri . 'showcat.html">' . $PMF_LANG["msgShowAllCategories"] . '</a>', "writeSendAdress" => $systemUri . 'search.html', 'showInstantResponse' => '<a href="' . $systemUri . 'instantresponse.html">' . $PMF_LANG['msgInstantResponse'] . '</a>', 'showSitemap' => getLinkHtmlAnchor($_SERVER['PHP_SELF'] . '?' . $sids . 'action=sitemap&lang=' . $LANGCODE, $PMF_LANG['msgSitemap']), 'opensearch' => $systemUri . 'search.html'); } else { $links_template_vars = array("faqHome" => $_SERVER['PHP_SELF'], "msgSearch" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=search">' . $PMF_LANG["msgAdvancedSearch"] . '</a>', "msgAddContent" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=add">' . $PMF_LANG["msgAddContent"] . '</a>', "msgQuestion" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=ask">' . $PMF_LANG["msgQuestion"] . '</a>', "msgOpenQuestions" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=open">' . $PMF_LANG["msgOpenQuestions"] . '</a>', "msgHelp" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=help">' . $PMF_LANG["msgHelp"] . '</a>', "msgContact" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=contact">' . $PMF_LANG["msgContact"] . '</a>', "allCategories" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=show">' . $PMF_LANG["msgShowAllCategories"] . '</a>', "backToHome" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . '">' . $PMF_LANG["msgHome"] . '</a>', "writeSendAdress" => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=search', 'showInstantResponse' => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=instantresponse">' . $PMF_LANG['msgInstantResponse'] . '</a>', 'showSitemap' => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=sitemap&lang=' . $LANGCODE . '">' . $PMF_LANG['msgSitemap'] . '</a>', 'opensearch' => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=search'); } // // Send headers and print template // header("Expires: Thu, 07 Apr 1977 14:47:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate");
$tpl = new PMF_Template(array('index' => $indexSet, 'loginBox' => $loginTemplate, 'rightBox' => $rightSidebarTemplate, 'writeContent' => $includeTemplate), $faqconfig->get('main.templateSet')); $usersOnLine = $faqsession->getUsersOnline(); $totUsersOnLine = $usersOnLine[0] + $usersOnLine[1]; $systemUri = PMF_Link::getSystemUri('index.php'); $helper = PMF_Helper_Category::getInstance(); $helper->setCategory($category); $keywordsArray = array_merge(explode(',', $keywords), explode(',', $faqconfig->get('main.metaKeywords'))); $keywordsArray = array_filter($keywordsArray, 'strlen'); shuffle($keywordsArray); $keywords = implode(',', $keywordsArray); if (is_null($error)) { $loginMessage = '<p>' . $PMF_LANG['ad_auth_insert'] . '</p>'; } else { $loginMessage = '<p class="error">' . $error . '</p>'; } $main_template_vars = array('msgRegisterUser' => '<a href="?' . $sids . 'action=register">' . $PMF_LANG['msgRegisterUser'] . '</a>', 'msgLoginUser' => $PMF_LANG['msgLoginUser'], 'title' => $faqconfig->get('main.titleFAQ') . $title, 'baseHref' => $systemUri, 'version' => $faqconfig->get('main.currentVersion'), 'header' => str_replace('"', '', $faqconfig->get('main.titleFAQ')), 'metaTitle' => str_replace('"', '', $faqconfig->get('main.titleFAQ')), 'metaDescription' => $metaDescription, 'metaKeywords' => $keywords, 'metaPublisher' => $faqconfig->get('main.metaPublisher'), 'metaLanguage' => $PMF_LANG['metaLanguage'], 'metaCharset' => 'utf-8', 'phpmyfaqversion' => $faqconfig->get('main.currentVersion'), 'stylesheet' => $PMF_LANG['dir'] == 'rtl' ? 'style.rtl' : 'style', 'action' => $action, 'dir' => $PMF_LANG['dir'], 'msgCategory' => $PMF_LANG['msgCategory'], 'showCategories' => $helper->renderCategoryNavigation($cat), 'msgExportAllFaqs' => $PMF_LANG['msgExportAllFaqs'], 'languageBox' => $PMF_LANG['msgLangaugeSubmit'], 'writeLangAdress' => $writeLangAdress, 'switchLanguages' => PMF_Language::selectLanguages($LANGCODE, true), 'userOnline' => $plr->getMsg('plmsgUserOnline', $totUsersOnLine) . ' | ' . $plr->getMsg('plmsgGuestOnline', $usersOnLine[0]) . $plr->getMsg('plmsgRegisteredOnline', $usersOnLine[1]), 'stickyRecordsHeader' => $PMF_LANG['stickyRecordsHeader'], 'copyright' => 'powered by <a href="http://www.phpmyfaq.de" target="_blank">phpMyFAQ</a> ' . $faqconfig->get('main.currentVersion'), 'registerUser' => '<a href="?action=register">' . $PMF_LANG['msgRegistration'] . '</a>', 'sendPassword' => '<a href="./admin/password.php">' . $PMF_LANG['lostPassword'] . '</a>', 'loginHeader' => $PMF_LANG['msgLoginUser'], 'loginMessage' => $loginMessage, 'writeLoginPath' => $systemUri . '?' . PMF_Filter::getFilteredQueryString(), 'faqloginaction' => $action, 'login' => $PMF_LANG['ad_auth_ok'], 'username' => $PMF_LANG['ad_auth_user'], 'password' => $PMF_LANG['ad_auth_passwd']); if ('main' == $action || 'show' == $action) { if ('main' == $action && PMF_Configuration::getInstance()->get('search.useAjaxSearchOnStartpage')) { $tpl->processBlock('index', 'globalSuggestBox', array('ajaxlanguage' => $LANGCODE, 'msgDescriptionInstantResponse' => $PMF_LANG['msgDescriptionInstantResponse'], 'msgSearch' => sprintf('<a class="help" href="%sindex.php?action=search">%s</a>', $systemUri, $PMF_LANG["msgAdvancedSearch"]))); } else { $tpl->processBlock('index', 'globalSearchBox', array('writeSendAdress' => '?' . $sids . 'action=search', 'searchBox' => $PMF_LANG['msgSearch'], 'categoryId' => $cat === 0 ? '%' : (int) $cat, 'msgSearch' => sprintf('<a class="help" href="%sindex.php?action=search">%s</a>', $systemUri, $PMF_LANG["msgAdvancedSearch"]))); } } $stickyRecordsParams = $faq->getStickyRecords(); if (!isset($stickyRecordsParams['error'])) { $tpl->processBlock('index', 'stickyRecordsList', array('stickyRecordsUrl' => $stickyRecordsParams['url'], 'stickyRecordsTitle' => $stickyRecordsParams['title'])); } if ($faqconfig->get('main.enableRewriteRules')) { $links_template_vars = array("faqHome" => $faqconfig->get('main.referenceURL'), "msgSearch" => '<a href="' . $systemUri . 'search.html">' . $PMF_LANG["msgAdvancedSearch"] . '</a>', 'msgAddContent' => '<a href="' . $systemUri . 'addcontent.html">' . $PMF_LANG["msgAddContent"] . '</a>', "msgQuestion" => '<a href="' . $systemUri . 'ask.html">' . $PMF_LANG["msgQuestion"] . '</a>', "msgOpenQuestions" => '<a href="' . $systemUri . 'open.html">' . $PMF_LANG["msgOpenQuestions"] . '</a>', 'msgHelp' => '<a href="' . $systemUri . 'help.html">' . $PMF_LANG["msgHelp"] . '</a>', "msgContact" => '<a href="' . $systemUri . 'contact.html">' . $PMF_LANG["msgContact"] . '</a>', "backToHome" => '<a href="' . $systemUri . 'index.html">' . $PMF_LANG["msgHome"] . '</a>', "allCategories" => '<a href="' . $systemUri . 'showcat.html">' . $PMF_LANG["msgShowAllCategories"] . '</a>', 'showInstantResponse' => '<a href="' . $systemUri . 'instantresponse.html">' . $PMF_LANG['msgInstantResponse'] . '</a>', 'showSitemap' => '<a href="' . $systemUri . 'sitemap/A/' . $LANGCODE . '.html">' . $PMF_LANG['msgSitemap'] . '</a>', 'opensearch' => $systemUri . 'opensearch.html'); } else { $links_template_vars = array("faqHome" => $faqconfig->get('main.referenceURL'), "msgSearch" => '<a href="index.php?' . $sids . 'action=search">' . $PMF_LANG["msgAdvancedSearch"] . '</a>', "msgAddContent" => '<a href="index.php?' . $sids . 'action=add&cat=' . $cat . '">' . $PMF_LANG["msgAddContent"] . '</a>', "msgQuestion" => '<a href="index.php?' . $sids . 'action=ask&category_id=' . $cat . '">' . $PMF_LANG["msgQuestion"] . '</a>', "msgOpenQuestions" => '<a href="index.php?' . $sids . 'action=open">' . $PMF_LANG["msgOpenQuestions"] . '</a>', "msgHelp" => '<a href="index.php?' . $sids . 'action=help">' . $PMF_LANG["msgHelp"] . '</a>', "msgContact" => '<a href="index.php?' . $sids . 'action=contact">' . $PMF_LANG["msgContact"] . '</a>', "allCategories" => '<a href="index.php?' . $sids . 'action=show">' . $PMF_LANG["msgShowAllCategories"] . '</a>', "backToHome" => '<a href="index.php?' . $sids . '">' . $PMF_LANG["msgHome"] . '</a>', 'showInstantResponse' => '<a href="index.php?' . $sids . 'action=instantresponse">' . $PMF_LANG['msgInstantResponse'] . '</a>', 'showSitemap' => '<a href="index.php?' . $sids . 'action=sitemap&lang=' . $LANGCODE . '">' . $PMF_LANG['msgSitemap'] . '</a>', 'opensearch' => $systemUri . 'opensearch.php');