Example #1
0
function KBa()
{
    global $txt, $context;
    loadTemplate('KBAdmin');
    allowedTo('admin_forum');
    $context['page_title'] = $txt['knowledgebase'];
    KB_file_include('KBSubs');
    $context[$context['admin_menu_name']]['tab_data']['title'] = $txt['knowledgebase'];
    $context[$context['admin_menu_name']]['tab_data']['description'] = $txt['knowledgebase'];
    $subActions = array('kb' => 'KBadmin', 'kbstand' => 'KB_standalone', 'kbactionlog' => 'KB_actionlog', 'import' => 'KB_Import', 'showlog' => 'KB_show_logs', 'importsmfa' => 'KB_ImportSMFarticle', 'importtpa' => 'KB_ImportTParticle', 'importfaq' => 'KB_Importfaq', 'attach' => 'KBAttachment');
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'kb';
    $subActions[$_REQUEST['sa']]();
}
Example #2
0
function KB()
{
    global $txt, $sourcedir, $scripturl, $modSettings, $context;
    if (empty($modSettings['kb_enabled'])) {
        redirectexit();
    }
    isAllowedTo('view_knowledge');
    KB_file_include(array('KBEditer', 'KBPerm', 'KBReport', 'KBApprove', 'KBSearch', 'KBEdit_Add', 'KBView_All', 'KBView', 'KBCats', 'KBMisc', 'KBMenu', 'KBSubs', 'KBRSS'));
    loadTemplate('KB');
    $context['linktree'][] = array('url' => $scripturl . '?action=kb', 'name' => $txt['knowledgebase']);
    //fix wysig
    KB_wysig_descript();
    //Are we jumping?
    KB_dojump();
    //Any headers?
    KB_doheaders();
    //Menu anyone?
    KB_Menu();
    if (isset($_REQUEST['comment_recount']) && allowedTo('manage_kb')) {
        KBrecountcomments();
    }
    if (isset($_REQUEST['article_recount']) && allowedTo('manage_kb')) {
        KBrecountItems();
    }
    if (isset($_REQUEST['cache_clean']) && allowedTo('manage_kb')) {
        KB_cleanCache();
    }
    //I am a robot
    if (empty($modSettings['kb_search_engines'])) {
        $context['robot_no_index'] = true;
    }
    $context['canonical_url'] = $scripturl . '?action=kb';
    //Put all the subactions into an array
    $subActions = array('main' => 'KB_main', 'cats' => 'KB_know', 'article' => 'KB_knowcont', 'catadd' => 'KB_catadd', 'listcat' => 'KB_catlist', 'addknow' => 'KB_addknow', 'del' => 'KB_del', 'permcat' => 'KB_perm', 'search' => 'KB_search', 'searchmain' => 'KB_searchmain', 'rate' => 'KB_rate', 'edit' => 'KB_edit', 'reporta' => 'KB_reporta', 'manage' => 'KB_manage', 'rss' => 'KB_rss', 'catup' => 'KB_movecat', 'catdown' => 'KB_movecat');
    // Default the sub-action'.
    $_REQUEST['area'] = isset($_REQUEST['area']) && isset($subActions[$_REQUEST['area']]) ? $_REQUEST['area'] : 'main';
    // Set title and default sub-action.
    $context['page_title'] = $txt['knowledgebase'];
    $context['sub_action'] = $_REQUEST['area'];
    // Call the right function for this sub-acton.
    $subActions[$_REQUEST['area']]();
}
Example #3
0
function KB_profile_main()
{
    global $txt, $context;
    loadTemplate('KB');
    KB_file_include('KBSubs');
    $context[$context['profile_menu_name']]['tab_data']['description'] = $txt['knowledgebase'];
    $context[$context['profile_menu_name']]['tab_data']['title'] = $txt['knowledgebase'];
    $context['page_title'] = $txt['knowledgebase'];
    if (isset($_REQUEST['sa'])) {
        if ($_REQUEST['sa'] == 'main') {
            KB_profile_articles_main();
        }
        if ($_REQUEST['sa'] == 'articles') {
            KB_profile_articles();
        }
        if ($_REQUEST['sa'] == 'unapproved') {
            KB_profile_notapproved();
        }
    } else {
        KB_profile_articles_main();
    }
}