[Link to the mod](https://custom.simplemachines.org/index.php?mod=4255)
hCaptcha for SMF
=================
About
-----
hCaptcha is degined to keep out bots, protects user privacy and rewards website owners.
This modification allows you to use [hCaptcha](https://www.hcaptcha.com/)
instead of the built-in Visual Verification system. It supports the SMF
2.0.x and 2.1.x series.
Features
--------
- Use hCaptcha on your forum in place of or in combination with the
built-in verification options.
- Support for built-in hCaptcha themes
How to Use
----------
You can enable hCaptcha by going to:
Admin -> Configuration -> Security and Moderation -> Anti-Spam
A set of keys are required for operation of hCaptcha A link is
provided in the settings to register for a key pair.
Known Issues
------------
- The error messages are the built-in ones, so they will talk about
letters not being filled in or matching.
License
-------
This code is licensed under the terms of the BSD 3-Clause License. SMF
code used in this mod is copyright Simple Machines.
Portions code is copyright Michael Johnson (motokochan) based on reCAPTCHA for SMF https://custom.simplemachines.org/mods/index.php?mod=1044
Acknowledgements
----------------
"SMF" and "Simple Machines" are trademarks of Simple Machines.
Version History
---------------
See CHANGELOG
Hmm... not sure I like the sound of this.
QuoteWhen you use hCaptcha, companies bid on the work your users do as they prove their humanity.
Sounds like you'll be helping to train bots ??? Change my mind.
It's the same thing reCaptcha. The ocr technology,photos people are the labor for free.
It seems interesting it would be a matter of proving that works, great job @vbgamer45!
Regards!
well....
I was going to try this, as I can not use smf's built in captcha, nor recapthca
(I don't have a clue what messed those up...too many mods)
but.....
when I go to try and sign up for keys....
it seems it's not working on their site :o
everytime I click submit get error of please complete the form
oopssss
Strange. Do you have a different email than normal? If not I would contact them on contact us.
nope, was using yahoo....
i sent them an email to their support...
hopefully they fix it
Yahoo is a truly horrible provider to get email to.
Quote from: Arantor on April 27, 2020, 11:17:34 AM
Yahoo is a truly horrible provider to get email to.
:laugh: yeah well....been using it for 20 some odd years....stuck with it til it dies :laugh:
Thank you for this mod, this should be added to SMF in general these days, built in captcha is useless against today's A.I.
Update!
Version 2.0
+Adds support for SMF 2.1!
!Fixed bug in SMF 2.0.x with questions and answers.
Just installed on 2.0.18 and cant get the built in image verification to work with this. All that shows is ":" under the hcaptcha.
Image below shows the contact page mod but it does the same on the registration page too.
Do you have any questions and answers? for verification?
What do you have on the settings for registration
Quote from: vbgamer45 on December 10, 2021, 10:26:03 AMDo you have any questions and answers? for verification?
What do you have on the settings for registration
No questions & answers was just trying to use the built in image verification with hcaptcha too.
Here is my registration settings and Anti-Spam settings:
Try changing the visual verifaction option to none and see if it helps
Yes I have done that and the ":" disappears but my question is, why won't they work together (with both checked as on)? Or was it intended to work with both on or just one or the other? ??? O:)
Just asking cause it says "hCaptcha settings are below. If you don't want the built-in image verification, you must set it to none." So that's telling me I can use both at same time optionally. ;)
Also I just now tested and it works with the questions but not with the verification image. ;)
This mod should be one or the other basically hcaptcha replaces image verification option
I just installed a fresh copy of 2.0.18 with no mods except this one and still not working properly. I see the following errors in admin:
QuoteGuest
Type of error: Undefined
https://*****.com/index.php?action=registerApply
8: Undefined offset: 1
File: /home2/*****/public_html/*****/Themes/default/GenericControls.template.php (registration_form sub template - eval?)
Line: 353
Also Line 352 same error message
On the registration page it shows the hcaptcha, the question & answer box, and a ":" with a box under it but no image verification.
And image verification is set to none?
No all are turned on...it works with the image verification off but I thought its all supposed to work on together?
It is either one or the other. basiclly the same as the recaptcha mod i used that as the base
Quote from: Shades. on December 10, 2021, 10:50:24 AMJust asking cause it says "hCaptcha settings are below. If you don't want the built-in image verification, you must set it to none." So that's telling me I can use both at same time optionally. ;)
Ok sorry about that, I misunderstood lol! ;D
But as a suggestion this part here might need to be changed to "hCaptcha settings are below. You
Must turn off the built-in image verification by setting it to "None" in order to use hCaptcha."
Or something like that lol! ;) ;D
Just my two senses worth :laugh: O:)
Update
Version 2.1
!Updated to new javascript url for the api
Quote from: vbgamer45 on April 14, 2020, 11:12:56 AM[url="https://custom.simplemachines.org/index.php?mod=4255"]Link to the mod[/url]
hCaptcha for SMF
Your link to the mod is messed up on first page https://www.simplemachines.org/community/index.php?topic=572713.msg4051935#msg4051935 ;)
Strange fixed just reedited the mod page.
It's a known bug, it's logged internally :)
Great mod!
Thanks vbgamer45
Please add the necessary functions of the captcha, enable it so that it can be optionally on separate pages:
../index.php?action=login (authorization popup window too)
../index.php?action=reminder - restore account access
../index.php?action=admin - adminpanel
../index.php?action=signup - registration
../index.php?action=search - standard search
../index.php?action=search2 - search from the top search form
../index.php?action=mlist - list of users
../index.php?action=post; - creating a topic on the forum and sending posts in topics
/index.php?action=pm;sa=send - page for sending private message
It should on any page that the standard SMF captcha is used.
I installed this mod but the recaptcha looks the same, it didn't change and I got the error message shown below.
C:/..../Themes/default/GenericControls.template.php (Line 221)
Backtrace information
Type of error: Undefined
Error message Select
2: Undefined array key "can_hcaptcha"
What can i do?
Disable recaptcha or remove that mod it's either one or the other.
To get rid of that "undefined array key" error without completely uninstalling the hCaptcha mod it should be sufficient to add in Subs-Editor.php
'can_hcaptcha' => !empty($modSettings['hcaptcha_enabled']) && !empty($modSettings['hcaptcha_site_key']) && !empty($modSettings['hcaptcha_secret_key']),
after
'can_recaptcha' => !empty($modSettings['recaptcha_enabled']) && !empty($modSettings['recaptcha_site_key']) && !empty($modSettings['recaptcha_secret_key']),
Or am I wrong?
Close but there are somethings that need to be changed
We use hcaptcha_private_key and hcaptcha_public_key.
Will push in a mod update for SMF 2.1.x
Update 2.1.1
!Fixed undefined array for SMF 2.1.x
Noticed that this mod doesn't seem to play well with the Questions and Answers required (it wasn't showing the proper count), playing with it, it seems the can_hcaptcha was missed from this line?
GenericControls.template
$qIndex = $verify_context['show_visual'] || $verify_context['can_recaptcha'] ? $i - 1 : $i;
Changing it to
$qIndex = $verify_context['show_visual'] || $verify_context['can_recaptcha'] || $verify_context['can_hcaptcha'] ? $i - 1 : $i;
Seems to have gotten the Questions working
This is on SMF 2.1.4
Thanks have updated the mod!
2.2
!Fixed some bugs if questions and answers is enabled as well.
Version 3.0
!Fix some language strings on verification failure to be better thanks to
@MobileCS
Not sure if this is a bug or something wrong with my installation.
Installed, got many errors and could not see the captcha divider:
QuoteUndefined index: use_hcaptcha
Then manually changed those to "can_hcaptcha"
Now it works!?
Quote from: 4LP3RUZ1 on April 27, 2025, 04:14:45 AMNot sure if this is a bug or something wrong with my installation.
Installed, got many errors and could not see the captcha divider:
QuoteUndefined index: use_hcaptcha
Then manually changed those to "can_hcaptcha"
Now it works!?
Thanks for the report have fixed! And post new version