Hello,
Since the release of Clip-Bucket v2, users have been looking for ways to effectively stop fake users from signing up, reCaptcha (click to read how to use it in CB) being the most popular. This time I was asked for a way of creating a simple “type the following word to verify you’re human” kind of verification system that would be an addition to the captcha modules we all know. The system will ask you to type any word you specify and if they don’t match, an error message will be thrown to the user not letting them move forward; it’s really simple. Written for v2.
Let’s say the anti-spam word is “arvixerocks”.
1. Open ./styles/cbv2new/layout/signup.html
2. Find
<!-- Loading Captcha if anny --> {assign var=captcha value=func->get_captcha()} {if $captcha} {if $captcha.show_field} <label class="label" for="verification_code">Verification Code</label> {load_captcha captcha=$captcha load=field field_params = ' id="verification_code" '} <div class="clearfix"></div> {/if} <div align="center">{load_captcha captcha=$captcha load=function}</div> {/if}
and after that last {/if}, add:
<div class="clearfix"></div> <div align="center"> <label class='label' for='spamfield'>Please enter 'arvixerocks'to verify you're human</label> <input name="spamfield" type="text" id="spamfield"> </div>
3. Open ./signup.php
4. Find
if(isset($_POST['signup'])){ if(!config('allow_registeration')) e(lang('usr_reg_err')); else { $signup = $userquery->signup_user($_POST); if($signup) { $udetails = $userquery->get_user_details($signup); $eh->flush(); assign('udetails',$udetails); assign('mode','signup_success'); } } }
and replace all that with:
if(isset($_POST['signup'])){ if(!config('allow_registeration')) { e(lang('usr_reg_err')); } elseif ($_POST['spamfield'] != "arvixerocks") { $spamfieldErr = e("Couldn't verify you are human. Please try again."); } else { $signup = $userquery->signup_user($_POST); if($signup) { $udetails = $userquery->get_user_details($signup); $eh->flush(); assign('udetails',$udetails); assign('mode','signup_success'); } } }
To use a different word than arvixerocks, edit both
<label class='label' for='spamfield'>Please enter 'arvixerocks'to verify you're human</label>
and
} elseif ($_POST['spamfield'] != "arvixerocks") {
lines to change it.
5. Save & Upload.
There you go! If for some reason you get stuck at any step, let me know as soon as possible so I can assist you with your specific situation. Comments, questions & upcoming article suggestions are welcome!
Best Regards,
Richi
Richi! You are the man!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I’ve been looking for a fix for my clip-bucket registration for a YEAR!!!!!!!!!!!!!!!1
FINALLY!
Hello,
I am glad you’ve found it useful. Should you want me to write about anything in specific, just let me know and I’ll do my best to get that published as soon as possible.
Regards,
Richi
I just used this fix and I’ve already stopped the flow of “fakes” on my site. I’m still in the dev stage, so no one has even been given my url to join yet. I also used the fix for the spam groups, but would like to be able to still allow the admin to create groups. I know I can do this by taking out that code, making the groups, and putting the code back in, but was hoping for a simpler solution , if possible.
Thanks for the hard work and providing these fixes!