}
            }
        }
    }
    /*
        if ($is_deny && in_array(AREA_TYPE, array('P', 'G', 'A'))) {
            $top_message = array('content' => cw_get_langvar_by_name('txt_access_denied'), 'type' => 'E');
            cw_header_location('index.php', true, true);
        }
    */
    $smarty->assign('accl', $accl);
    $smarty->assign('acc', true);
    #acc - use access levels
    #on modify
    #    cw_auth_perm($target, $arr_auth_m, $ma);
    #on delete
    #    cw_auth_perm($target, $arr_auth_d, $ma);
    if (in_array(AREA_TYPE, array('A'))) {
        $user_account['additional_info'] = cw_query_first("select can_change_company_id, company_id from {$tables['customers_customer_info']} where customer_id='{$customer_id}' ");
    }
} elseif (AREA_TYPE == 'C') {
    cw_include('include/check_usercart.php');
} elseif (AREA_TYPE == 'B') {
    // TODO: move to addon
    if ($addons['faq']) {
        cw_load('faq');
        $membership_faq = cw_faq_get_salesman_faq();
        $smarty->assign('membership_faq', $membership_faq);
    }
}
$smarty->assign('user_account', $user_account);
예제 #2
0
$path = cw_faq_parent_rubriks($cat_id);
if (is_array($path)) {
    foreach ($path as $result) {
        $location[] = array($result['title'], "index.php?target={$target}&mode=category&cat_id=" . $result['rubrik']);
    }
}
if ($cat_id) {
    $__tmp = array();
    $__tmp['main_category'] = cw_faq_get_main($cat_id);
    $smarty->assign('faq', $__tmp);
}
if ($mode == 'membership') {
    $smarty->assign('faq', cw_faq_get_membership_faq($user_account['membership_id']));
    $smarty->assign('main', 'product');
} elseif ($mode == 'salesman') {
    $smarty->assign('faq', cw_faq_get_salesman_faq());
    $smarty->assign('mode', 'membership');
} elseif ($mode == 'category') {
    $smarty->assign('faq_category', cw_faq_get_rubrik($cat_id));
    $smarty->assign('faq_subcategories', cw_faq_get_subcategories($cat_id));
    $smarty->assign('faq_articles', cw_faq_get_articles($cat_id));
    $smarty->assign('main', 'category');
} elseif ($mode == 'article') {
    if ($action == "rate" && $vote) {
        if (cw_faq_voting_check($id, $_SERVER['REMOTE_ADDR'])) {
            $user = cw_query_first_cell("select user from {$tables['faq_voting']} WHERE question_id='{$id}'");
            if (!$user) {
                db_query("INSERT INTO {$tables['faq_voting']} (question_id, vote, user, date, ip) VALUES ('{$id}', '{$vote}', '1', '" . time() . "', '" . $_SERVER['REMOTE_ADDR'] . "');");
            } else {
                db_query("UPDATE {$tables['faq_voting']} SET vote = vote+'" . $vote . "', user = user+'1', date = '" . time() . "', ip = '" . $_SERVER['REMOTE_ADDR'] . "' where question_id='{$id}'");
            }