Exemple #1
0
$displaylastfaqs = $xoopsModuleConfig['displaylastfaqs'];
if ($displaylastfaqs) {
    // Creating the last FAQs
    $faqsObj = $faq_handler->getFaqs($xoopsModuleConfig['indexperpage'], $start, _SF_STATUS_OPENED);
    $totalQnasOnPage = count($faqsObj);
    if ($faqsObj) {
        $userids = array();
        foreach ($faqsObj as $key => $thisfaq) {
            $faqids[] = $thisfaq->getVar('faqid');
            $userids[$thisfaq->uid()] = 1;
        }
        $member_handler =& xoops_gethandler('member');
        $users = $member_handler->getUsers(new Criteria('uid', "(" . implode(',', array_keys($userids)) . ")", "IN"), true);
        for ($i = 0; $i < $totalQnasOnPage; $i++) {
            $faq = $faqsObj[$i]->toArray(null, $allcategories);
            $faq['adminlink'] = sf_getAdminLinks($faqsObj[$i]->faqid(), true);
            $faq['who_when'] = $faqsObj[$i]->getWhoAndWhen(null, $users);
            $xoopsTpl->append('faqs', $faq);
        }
    }
}
// Language constants
$moduleName = $myts->displayTarea($xoopsModule->getVar('name'));
$xoopsTpl->assign(array('lang_on' => _MD_SF_ON, 'lang_postedby' => _MD_SF_POSTEDBY, 'lang_total' => $totalQnasOnPage, 'lang_faq' => _MD_SF_FAQ, 'lang_datesub' => _MD_SF_DATESUB, 'lang_hits' => _MD_SF_HITS));
$moduleName = $myts->displayTarea($xoopsModule->getVar('name'));
$xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename']));
$xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['openquestionintromsg'], 1));
$xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS);
$xoopsTpl->assign('lang_home', _MD_SF_HOME);
$xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION);
$xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
Exemple #2
0
$faq['categoryid'] = $categoryObj->categoryid();
$faq['categoryname'] = $categoryObj->name();

$faq['categorydescription'] = $categoryObj->description();
$faq['counter'] = $faqObj->counter();
$faq['comments'] = $faqObj->comments();
$faq['cancomment'] = $faqObj->cancomment();
*/
$faq['categoryPath'] = $categoryObj->getCategoryPath(true);
$faq['answer'] = $answerObj->answer();
// Check to see if we need to display partial answer. This should probably be in a the FAQ class...
if ($faqAccessGrantedResult == 0) {
    $faq['answer'] = xoops_substr($faq['answer'], 0, 150);
}
$faq['who_when'] = $faqObj->getWhoAndWhen();
$faq['adminlink'] = sf_getAdminLinks($faqObj->faqid());
$faq['comments'] = $faqObj->comments();
// Language constants
$xoopsTpl->assign('faq', $faq);
$xoopsTpl->assign('display_categoryname', false);
$xoopsTpl->assign('xcodes', $faqObj->getVar('xcodes'));
$xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $faqObj->getVar('faqid'));
$xoopsTpl->assign('lang_printerpage', _MD_SF_PRINTERFRIENDLY);
$xoopsTpl->assign('lang_sendstory', _MD_SF_SENDSTORY);
$xoopsTpl->assign('faqid', $faqObj->getVar('faqid'));
$xoopsTpl->assign('lang_reads', _MD_SF_READS);
$xoopsTpl->assign('lang_home', _MD_SF_HOME);
$xoopsTpl->assign('lang_faq', _MD_SF_FAQ);
$xoopsTpl->assign('lang_postedby', _MD_SF_POSTEDBY);
$xoopsTpl->assign('lang_on', _MD_SF_ON);
$xoopsTpl->assign('lang_datesub', _MD_SF_DATESUB);