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”>’

<tr>
<td>
<{$xhelp_captcha_caption}>
</td>
<td>
<{$xhelp_captcha_render}>
</td>
</tr>

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,

xoops_load('XoopsFormCaptcha');
$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,

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

Unresolved: Show the confirmation code validate error message.

  13 Responses to “Add captcha to XOOPS xHelp module”

  1. This posting is marvelous and what a fantastic research that you have done. It has helped me a lot. thank you very much. Feel free to visit my buy portfolio lighting site.
    curt
    Nike Zoom Lebron 6 shoes

  2. 2012 Fashion ideas5…

    Coming home from very lonely places, all of us go a little mad: whether from great personal success, or just an all-night drive, we are the sole survivors of a world no one else has ever seen….

  3. 2012 Fashion ideas k…

    I guess what I’m trying to say is, I don’t think you can measure life in terms of years. I think longevity doesn’t necessarily have anything to do with happiness. I mean happiness comes from facing challenges and going out on a limb and taking risks…

  4. Yeast Infection Treatment…

    […]these are a few url links to internet sites I always connect to since we think these are worthy of checking out[…]…

  5. Websites worth visiting…

    […]here are some links to sites that we link to because we think they are worth visiting[…]……

  6. I like your writing style .Your post is really informative. Thanks for sharing its really helpful for me.
    plagiarism Checker

  7. Angry Birds Online…

    […]in the following are a couple of web page links to websites online which we link to since we think they will be well worth browsing[…]…

  8. … [Trackback]…

    […] Informations on that Topic: bluesunray.com/2010/07/06/add-captcha-to-xoops-xhelp-module/ […]…

  9. TheReview…

    Hello!, I have gone ahead and bookmarked your page on Friendfeed so my friends can see it too. I just used your blog title as the title in my bookmark, as I figured if it’s good enough for you to title your blog post that, then you probably would like…

Sorry, the comment form is closed at this time.