Jul 062010

I install xHelp module in my XOOPS site and allow anonymous users ticket submission, in order to avoid spam, I add the XOOPS User Register Form captcha function to xHelp module.

My System Overview:
XOOPS 2.4.5 RC3
xHelp 0.78b
php Version 5.2.13

Step 1, Edit the template file, the template for anonymous users add ticket page is xhelp_ anon_addTicket.html. You can find it here, XOOPS Control Panel Home -> Template Set Manager -> xHelp[list].

Edit this template file, add the below lines to after ‘<{* End custom field code *}>’ and before ‘<tr id=”addButtons”>’


Step 2, Edit the anon_addTicket.php file, you can find it here, ‘xoops\modules\xhelp\’, add the below lines to after ‘$xoopsTpl->assign(‘xhelp_mimetypes’, $mimes);’, about lines 82 of source file,

$xhelpCaptcha = new XoopsFormCaptcha();
$xhelpCaptchaCaption = $xhelpCaptcha->getCaption();
$xhelpCaptchaRender = $xhelpCaptcha->render();
$xoopsTpl->assign('xhelp_captcha_caption', $xhelpCaptchaCaption);
$xoopsTpl->assign('xhelp_captcha_render', $xhelpCaptchaRender);

add the below lines to before ‘if(!empty($errors)){‘, about lines 283 of source file,

$xoopsCaptcha = XoopsCaptcha::getInstance();
if (!$xoopsCaptcha->verify()) {
$xhelpCaptchaErrorMessage = $xoopsCaptcha->getMessage();
$message = $xhelpCaptchaErrorMessage;
header("Location: ".XHELP_BASE_URL."/anon_addTicket.php");

Unresolved: Show the confirmation code validate error message.

Jun 202010

The default title of  xhelp form, action and button are ‘Log Ticket’, if you will change it, open the file, /modules/xhelp/language/english/main.php, and position to these lines,

161: define('_XHELP_TITLE_ADDTICKET', 'Log Ticket');

340: define('_XHELP_MENU_LOG_TICKET', 'Log Ticket');

350:define('_XHELP_BUTTON_ADDTICKET', 'Log Ticket');

XOOPS Version: 2.4.5 RC3
PHP Version: 5.2.13
xhelp Version: 0.78(Beta)

Jun 202010
  • Open ‘/modules/smartfaq/class/faq.php’,
  • Position to line 1311,
    $grantedFaq->add(new Criteria('faqid', "(".implode(',', $faqsGranted).")", 'IN'), 'OR');


  • Change these line to
    $grantedFaq->add(new Criteria('faq.faqid', "(".implode(',',  $faqsGranted).")", 'IN'), 'OR');


  • Position to line 1408,
    $sql .= ' AND faqid IN ('.implode(',', $items).')';
  • Change these line to
    $sql .= ' AND faq.faqid IN ('.implode(',', $items).')';

My System Overview:

XOOPS Version: 2.4.5 RC3
PHP Version: 5.2.13
SmartFAQ Version: 1.0.8

Taken from: http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=64655