The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
How to use vbulletin's built-in captcha in custom forms
I used 'form hack' to build a custom form for my forum. Its been working great except that recently i started getting a lot of spam. So i want to add a image verification system to it to block spam. The two add-ons (for image verification) on form hack's main post aren't being supported anymore. I tried 'no spam'. No luck with that either. I'd like to use vb's default captcha system with this custom form. How do i do it? Can someone help please?
--------------- Added [DATE]1226885487[/DATE] at [TIME]1226885487[/TIME] --------------- I came half way through with this. Still not working fully. I added $imagereg to my custom form template Next, in the validation section i added the following: require_once(DIR . '/includes/functions_regimage.php'); if (!verify_regimage_hash($vbulletin->GPC['imagehash'], $vbulletin->GPC['imagestamp'])) { $errors[] = "some err msg"; } Although doesn't throw any errors, the validation doesn't get passed even if i enter the correct numbers from the image because the hidden 'imagehash' value in the form is empty. What am i missing here? Please help someone. --------------- Added [DATE]1226889098[/DATE] at [TIME]1226889098[/TIME] --------------- I'm disappointed i received no help from VB community on this. After hours of breaking my head, i figured it out myself. Would like to share it so it might help somebody else save some time. I had use it with my 'form hack' custom form. Here is what you'll have to do. 1) open imagereg template (styles -> style manager -> edit templates -> imagereg 2) Copy everything. 3) paste to your 'form' template at the desired place (where you want the image verification to appear on your custom form. Actually you should be able to just paste $imagereg in the desired place but for some reason it didn't work for me.) 4) Next edit your form hack plugin 5) Look for $vbulletin->input->clean_array_gpc('p', array( 6) Add these two in there: 'imagestamp' => TYPE_STR, 'imagehash' => TYPE_STR 7) Add this require_once(DIR . '/includes/functions_regimage.php'); $imagehash = fetch_regimage_hash(); Somewhere before the form validation part starts 8) Add this in the validation part ///check image hash require_once(DIR . '/includes/functions_regimage.php'); if (!verify_regimage_hash($vbulletin->GPC['imagehash'], $vbulletin->GPC['imagestamp'])) { $errors[] = "Security Image Verification is incorrect"; } 9) Save the plugin It should be good to go. I hope this helps someone. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|