Exemplo n.º 1
0
 case 'form':
 default:
     global $xoopsUser, $xoopsModule, $HTTP_SERVER_VARS;
     // Creating the FAQ object for the selected FAQ
     $faqObj = new sfFaq($faqid);
     // If the selected FAQ was not found, exit
     if ($faqObj->notLoaded()) {
         redirect_header("javascript:history.go(-1)", 1, _MD_SF_NOFAQSELECTED);
         exit;
     }
     // Creating the category object that holds the selected FAQ
     $categoryObj =& $faqObj->category();
     // Creating the answer object
     $answerObj =& $faqObj->answer();
     // Check user permissions to access that category of the selected FAQ
     if (faqAccessGranted($faqObj) < 0) {
         redirect_header("javascript:history.go(-1)", 1, _NOPERM);
         exit;
     }
     $xoopsOption['template_main'] = 'smartfaq_submit.html';
     include_once XOOPS_ROOT_PATH . "/header.php";
     include_once "footer.php";
     $name = $xoopsUser ? ucwords($xoopsUser->getVar("uname")) : 'Anonymous';
     $moduleName = $myts->displayTarea($xoopsModule->getVar('name'));
     $xoopsTpl->assign('whereInSection', $moduleName);
     $xoopsTpl->assign('lang_submit', _MD_SF_SUBMITANSWER);
     $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUBMITANSWERTO, ucwords($xoopsModule->name())));
     $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>{$name}</b>, " . _MD_SF_SUBMITANSWER_INTRO);
     include_once 'include/answer.inc.php';
     include_once XOOPS_ROOT_PATH . '/footer.php';
     break;
Exemplo n.º 2
0
}
// Creating the FAQ handler object
$faq_handler =& sf_gethandler('faq');
// Creating the FAQ object for the selected FAQ
$faqObj = new sfFaq($faqid);
// If the selected FAQ was not found, exit
if ($faqObj->notLoaded()) {
    redirect_header("javascript:history.go(-1)", 1, _MD_SF_NOFAQSELECTED);
    exit;
}
// Creating the category object that holds the selected FAQ
$categoryObj = $faqObj->category();
// Creating the answer object
$answerObj = $faqObj->answer();
// Check user permissions to access that category of the selected FAQ
$faqAccessGrantedResult = faqAccessGranted($faqObj);
if ($faqAccessGrantedResult < 0) {
    redirect_header("javascript:history.go(-1)", 1, _NOPERM);
    exit;
}
// Update the read counter of the selected FAQ
if (!$xoopsUser || $xoopsUser->isAdmin($xoopsModule->mid()) && $xoopsModuleConfig['adminhits'] == 1 || $xoopsUser && !$xoopsUser->isAdmin($xoopsModule->mid())) {
    $faqObj->updateCounter();
}
$xoopsOption['template_main'] = 'smartfaq_faq.html';
include_once XOOPS_ROOT_PATH . "/header.php";
include_once "footer.php";
$faq = $faqObj->toArray(null, $categoryObj, false);
// Populating the smarty variables with informations related to the selected FAQ
/*$faq['questionlink'] = $faqObj->question($xoopsModuleConfig['questionsize']);
$faq['question'] = $faqObj->question();