コード例 #1
0
ファイル: index.php プロジェクト: jr-ewing/phpMyFAQ
// Show login box or logged-in user information
//
if (isset($auth)) {
    $tpl->processTemplate('loginBox', array('loggedinas' => $PMF_LANG['ad_user_loggedin'], 'currentuser' => $user->getUserData('display_name'), 'printAdminPath' => in_array(true, $permission) ? 'admin/index.php' : '#', 'adminSection' => $PMF_LANG['adminSection'], 'printLogoutPath' => '?action=logout', 'logout' => $PMF_LANG['ad_menu_logout']));
} else {
    if (isset($_SERVER['HTTPS']) || !$faqconfig->get('main.useSslForLogins')) {
        $tpl->processTemplate('loginBox', array('writeLoginPath' => '?action=login', 'login' => $PMF_LANG['ad_auth_ok'], 'username' => $PMF_LANG['ad_auth_user'], 'password' => $PMF_LANG['ad_auth_passwd'], 'msgRegisterUser' => '<a href="?' . $sids . 'action=register">' . $PMF_LANG['msgRegisterUser'] . '</a>', 'msgLoginFailed' => $error));
    } else {
        $tpl->processTemplate('loginBox', array('secureloginurl' => sprintf('https://%s%s', $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']), 'securelogintext' => $PMF_LANG['msgSecureSwitch']));
    }
}
$tpl->includeTemplate('loginBox', 'index');
// generate top ten list
if ($faqconfig->get('main.orderingPopularFaqs') == 'visits') {
    // top ten list for most viewed entries
    $toptenParams = $faq->getTopTen('visits');
    if (!isset($toptenParams['error'])) {
        $tpl->processBlock('rightBox', 'toptenList', array('toptenUrl' => $toptenParams['url'], 'toptenTitle' => $toptenParams['title'], 'toptenVisits' => $toptenParams['visits']));
    } else {
        $tpl->processBlock('rightBox', 'toptenListError', array('errorMsgTopTen' => $toptenParams['error']));
    }
} else {
    // top ten list for most voted entries
    $toptenParams = $faq->getTopTen('voted');
    if (!isset($toptenParams['error'])) {
        $tpl->processBlock('rightBox', 'toptenList', array('toptenUrl' => $toptenParams['url'], 'toptenTitle' => $toptenParams['title'], 'toptenVisits' => $toptenParams['voted']));
    } else {
        $tpl->processBlock('rightBox', 'toptenListError', array('errorMsgTopTen' => $toptenParams['error']));
    }
}
$latestEntriesParams = $faq->getLatest();
コード例 #2
0
ファイル: index.php プロジェクト: noon/phpMyFAQ
//
$tpl->processTemplate('index', array_merge($main_template_vars, $links_template_vars, $debug_template_vars));
//
// Show login box or logged-in user information
//
if (isset($auth)) {
    $tpl->processTemplate('loginBox', array('loggedinas' => $PMF_LANG['ad_user_loggedin'], 'currentuser' => $user->getUserData('display_name'), 'printAdminPath' => in_array(true, $permission) ? 'admin/index.php' : '#', 'adminSection' => $PMF_LANG['adminSection'], 'printLogoutPath' => '?action=logout', 'logout' => $PMF_LANG['ad_menu_logout']));
} else {
    if (isset($_SERVER['HTTPS']) || !$faqconfig->get('main.useSslForLogins')) {
        $tpl->processTemplate('loginBox', array('writeLoginPath' => $_SERVER['PHP_SELF'] . '?action=login', 'login' => $PMF_LANG['ad_auth_ok'], 'username' => $PMF_LANG['ad_auth_user'], 'password' => $PMF_LANG['ad_auth_passwd'], 'msgRegisterUser' => $faqconfig->get('main.enableRewriteRules') ? '<a href="' . $systemUri . 'register.html">' . $PMF_LANG['msgRegisterUser'] . '</a>' : '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=register">' . $PMF_LANG['msgRegisterUser'] . '</a>', 'msgLoginFailed' => $error));
    } else {
        $tpl->processTemplate('loginBox', array('secureloginurl' => sprintf('https://%s%s', $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']), 'securelogintext' => $PMF_LANG['msgSecureSwitch']));
    }
}
$tpl->includeTemplate('loginBox', 'index');
$toptenParams = $faq->getTopTen();
if (!isset($toptenParams['error'])) {
    $tpl->processBlock('rightBox', 'toptenList', array('toptenUrl' => $toptenParams['url'], 'toptenTitle' => $toptenParams['title'], 'toptenVisits' => $toptenParams['visits']));
} else {
    $tpl->processBlock('rightBox', 'toptenListError', array('errorMsgTopTen' => $toptenParams['error']));
}
$latestEntriesParams = $faq->getLatest();
if (!isset($latestEntriesParams['error'])) {
    $tpl->processBlock('rightBox', 'latestEntriesList', array('latestEntriesUrl' => $latestEntriesParams['url'], 'latestEntriesTitle' => $latestEntriesParams['title'], 'latestEntriesDate' => $latestEntriesParams['date']));
} else {
    $tpl->processBlock('rightBox', 'latestEntriesListError', array('errorMsgLatest' => $latestEntriesParams['error']));
}
$tpl->processTemplate('rightBox', array('writeTopTenHeader' => $PMF_LANG['msgTopTen'], 'writeNewestHeader' => $PMF_LANG['msgLatestArticles'], 'writeTagCloudHeader' => $PMF_LANG['msg_tags'], 'writeTags' => $oTag->printHTMLTagsCloud(), 'msgAllCatArticles' => $PMF_LANG['msgAllCatArticles'], 'allCatArticles' => $faq->showAllRecordsWoPaging($cat)));
$tpl->includeTemplate('rightBox', 'index');
//
// Include requested PHP file
コード例 #3
0
ファイル: index.php プロジェクト: rybal06/phpMyFAQ
    $tpl->processTemplate('loginBox', array('loggedinas' => $PMF_LANG['ad_user_loggedin'], 'currentuser' => $user->getUserData('display_name'), 'printAdminPath' => in_array(true, $permission) ? 'admin/index.php' : '#', 'adminSection' => $PMF_LANG['adminSection'], 'printLogoutPath' => '?action=logout', 'logout' => $PMF_LANG['ad_menu_logout']));
} else {
    if (isset($_SERVER['HTTPS']) || !$faqconfig->get('main.useSslForLogins')) {
        $tpl->processTemplate('loginBox', array('msgLoginUser' => $PMF_LANG['msgLoginUser'], 'writeLoginPath' => '?action=login', 'login' => $PMF_LANG['ad_auth_ok'], 'username' => $PMF_LANG['ad_auth_user'], 'password' => $PMF_LANG['ad_auth_passwd'], 'msgRegisterUser' => '<a href="?' . $sids . 'action=register">' . $PMF_LANG['msgRegisterUser'] . '</a>', 'msgLoginFailed' => $error));
    } else {
        $tpl->processTemplate('loginBox', array('secureloginurl' => sprintf('https://%s%s', $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']), 'securelogintext' => $PMF_LANG['msgSecureSwitch']));
    }
}
$tpl->includeTemplate('loginBox', 'index');
// generate top ten list
if ($faqconfig->get('main.orderingPopularFaqs') == 'visits') {
    $param = 'visits';
} else {
    $param = 'voted';
}
$toptenParams = $faq->getTopTen($param);
if (!isset($toptenParams['error'])) {
    $tpl->processBlock('rightBox', 'toptenList', array('toptenUrl' => $toptenParams['url'], 'toptenTitle' => $toptenParams['title'], 'toptenVisits' => $toptenParams[$param]));
} else {
    $tpl->processBlock('rightBox', 'toptenListError', array('errorMsgTopTen' => $toptenParams['error']));
}
$latestEntriesParams = $faq->getLatest();
if (!isset($latestEntriesParams['error'])) {
    $tpl->processBlock('rightBox', 'latestEntriesList', array('latestEntriesUrl' => $latestEntriesParams['url'], 'latestEntriesTitle' => $latestEntriesParams['title'], 'latestEntriesDate' => $latestEntriesParams['date']));
} else {
    $tpl->processBlock('rightBox', 'latestEntriesListError', array('errorMsgLatest' => $latestEntriesParams['error']));
}
$tpl->processTemplate('rightBox', array('writeTopTenHeader' => $PMF_LANG['msgTopTen'], 'writeNewestHeader' => $PMF_LANG['msgLatestArticles'], 'writeTagCloudHeader' => $PMF_LANG['msg_tags'], 'writeTags' => $oTag->printHTMLTagsCloud(), 'msgAllCatArticles' => $PMF_LANG['msgAllCatArticles'], 'allCatArticles' => $faq->showAllRecordsWoPaging($cat)));
$tpl->includeTemplate('rightBox', 'index');
//
// Include requested PHP file