Advertisement:

Author Topic: reCAPTCHA for SMF  (Read 351693 times)

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #20 on: February 03, 2008, 02:45:04 PM »
Text description for the Register.template.php changes.

Please note that other mods that change the image verification system can cause issues.

Find:
Code: [Select]
if ($context['visual_verification'])
{
echo '
<tr valign="top">

REPLACE with:
Code: [Select]
if ($context['visual_verification'] || $context['use_recaptcha'])
{
echo '
<tr valign="top">


Find:
Code: [Select]
<b>', $txt['visual_verification_label'], ':</b>
<div class="smalltext">', $txt['visual_verification_description'], '</div>

REPLACE with:
Code: [Select]
<b>', $txt['visual_verification_label'], ':</b>';
if ($context['visual_verification'])
echo '<div class="smalltext">', $txt['visual_verification_description'], '</div>';
echo '


Find:
Code: [Select]
if ($context['use_graphic_library'])
echo '
<img src="', $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />';

Add this BEFORE:
Code: [Select]
if ($context['use_recaptcha'])
{
echo '
<script>
var RecaptchaOptions = {
   theme : \'', empty($modSettings['recaptcha_theme']) ? 'clean' : $modSettings['recaptcha_theme'] , '\',
};
</script>
<script type="text/javascript"
src="http://api.recaptcha.net/challenge?k=', $modSettings['recaptcha_public_key'], '">
</script>

<noscript>
<iframe src="http://api.recaptcha.net/noscript?k=<your_public_key>"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>';
}
else
{


Find:
Code: [Select]
}

// Are there age restrictions in place?

Add this BEFORE:
Code: [Select]
}


Find:
Code: [Select]
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaAge_input">', $txt['admin_setting_coppaAge'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaAge" onclick="return reqWin(this.href);">?</a>)</span>:

Add this BEFORE:
Code: [Select]
<tr class="windowbg2">
<th width="50%" align="right">
<label for="recaptchaEnable_check">', $txt['recaptcha_enable'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="recaptchaEnable" id="recaptchaEnable_check" ', !empty($modSettings['recaptcha_enabled']) ? 'checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="recaptchaTheme">', $txt['recaptcha_theme'], '</label>:
</th>
<td width="50%" align="left">
<select name="recaptchaTheme" id="recaptcha_theme_select">
<option value="clean"', empty($modSettings['recaptcha_theme']) ? ' selected="selected"' : '', '>', $txt['recaptcha_theme_clean'], '</option>
<option value="blackglass"', !empty($modSettings['recaptcha_theme']) && $modSettings['recaptcha_theme'] == "blackglass" ? ' selected="selected"' : '', '>', $txt['recaptcha_theme_blackglass'], '</option>
<option value="red"', !empty($modSettings['recaptcha_theme']) && $modSettings['recaptcha_theme'] == "red" ? ' selected="selected"' : '', '>', $txt['recaptcha_theme_red'], '</option>
<option value="white"', !empty($modSettings['recaptcha_theme']) && $modSettings['recaptcha_theme'] == "white" ? ' selected="selected"' : '', '>', $txt['recaptcha_theme_white'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="recaptchaPublicKey_input">', $txt['recaptcha_public_key'], '</label>:
</th>
<td width="50%" align="left">
<input type="text" name="recaptchaPublicKey" id="recaptchaPublicKey_input" value="', !empty($modSettings['recaptcha_public_key']) ? $modSettings['recaptcha_public_key'] : '', '" size="40" maxlength="40" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="recaptchaPrivateKey_input">', $txt['recaptcha_private_key'], '</label>:
</th>
<td width="50%" align="left">
<input type="text" name="recaptchaPrivateKey" id="recaptchaPrivateKey_input" value="', !empty($modSettings['recaptcha_private_key']) ? $modSettings['recaptcha_private_key'] : '', '" size="40" maxlength="40" />
</td>
</tr><tr class="windowbg2" valign="top">
<td colspan = "2" align="center">',
$txt['recaptcha_no_key_question'],' <a href="http://recaptcha.net/api/getkey?app=recaptcha_for_smf&amp;domain=', $_SERVER['SERVER_NAME'], '">', $txt['recaptcha_get_key'], '</a>
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="2" align="center">
<hr />
</td>
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline myaicons

  • Jr. Member
  • **
  • Posts: 228
  • Gender: Female
Re: reCAPTCHA for SMF
« Reply #21 on: February 05, 2008, 10:55:05 AM »
great Mod! it installed perfectly for me...

but is anyone else having the "done but with errors on page" ? (java)

i also get this on my error log:

8: Undefined index: recaptcha_enabled
File: /home/content/html/sforum/Sources/Register.php
Line: 137



i scratch your back you scratch my back...
funny thing about my back is its located on my...

Offline deadpoeticstar

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
    • My Blog
Re: reCAPTCHA for SMF
« Reply #22 on: February 12, 2008, 01:01:34 PM »
file is coming back as corrupted or invalid for this release

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #23 on: February 12, 2008, 10:45:23 PM »
Versions 0.9 and 0.9.5 both worked fine here. Can you try re-downloading?
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline res6cue

  • Semi-Newbie
  • *
  • Posts: 25
Re: reCAPTCHA for SMF
« Reply #24 on: March 20, 2008, 10:18:40 AM »
Please update this mod to work with 2.0 Beta 3 and beyond!  I would hate to have to go back to the horrible native SMF image verification!  Thanks!

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #25 on: March 20, 2008, 10:49:49 AM »
It will be done as soon as I can find time.

It was quietly updated for 2.0 beta 2, so you could try using the latest posted version and see if it installs with the version_emulate trick.
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline cgoodwin73

  • Newbie
  • *
  • Posts: 2
Re: reCAPTCHA for SMF
« Reply #26 on: May 29, 2008, 02:47:57 PM »
Just upgraded my boss' SMF from 1.1 RC2 to 1.1.5, then applied reCAPTCHA - everything looks good!

Thanks for the effort, Motoko-chan - the plain-language challenge words, plus audio challenge option, will make a big difference to the elderly visitors we serve.

Chris

Offline Nick.123

  • Semi-Newbie
  • *
  • Posts: 24
Re: reCAPTCHA for SMF
« Reply #27 on: June 04, 2008, 09:44:14 PM »
Anyway to fix text colour on input box so the text will show up on black backgrounds

  [nofollow]

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #28 on: June 14, 2008, 02:25:50 PM »
Anyway to fix text colour on input box so the text will show up on black backgrounds

The Black Glass reCAPTCHA theme is made for display on dark pages, but if you want to use the default red theme, style the recaptcha_response_field id.

Examples:
Code: [Select]
/* White text on black background */
#recaptcha_response_field
{
  background-color: #000000;
  color: #ffffff
}

/* Black text on white background */
#recaptcha_response_field
{
  background-color: #ffffff;
  color: #000000
}
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline Mo786

  • Semi-Newbie
  • *
  • Posts: 80
Re: reCAPTCHA for SMF
« Reply #29 on: June 29, 2008, 09:03:38 PM »
I couldn't get this to work. My register.template.php failed the test and when I followed your directions of doing it manually and installed the mod, it gave me some error on the registration page. Anyway on fixing this?

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #30 on: June 29, 2008, 10:06:42 PM »
Are you using a custom template for the registration? What version of SMF?
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline Mo786

  • Semi-Newbie
  • *
  • Posts: 80
Re: reCAPTCHA for SMF
« Reply #31 on: June 29, 2008, 11:25:43 PM »
SMF 1.1.5. I'm using a custom theme but it doesn't have its own register.template.php so it uses the default themes.

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #32 on: June 30, 2008, 12:13:16 AM »
Any other mods that might affect the template?
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline Mo786

  • Semi-Newbie
  • *
  • Posts: 80
Re: reCAPTCHA for SMF
« Reply #33 on: June 30, 2008, 02:07:32 AM »
Well the only other mod that probably edited the register.template.php before was the referral mod and thats about it. Nothing else.

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #34 on: July 01, 2008, 01:49:18 AM »
Attach a copy of the file please and I'll see what I can do to get the code in there. I'm a bit busy with work, but I'll try to fit it in.
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline Mo786

  • Semi-Newbie
  • *
  • Posts: 80
Re: reCAPTCHA for SMF
« Reply #35 on: July 01, 2008, 09:56:03 AM »
Here it is.

Offline vhs

  • Semi-Newbie
  • *
  • Posts: 12
    • Dating online
Re: reCAPTCHA for SMF
« Reply #36 on: July 11, 2008, 09:55:21 AM »
Hello, is there any chance to add reCaptcha to guest posting and guest searching ?
I think it will be very usefull on forums where guest writing is allowed.

Best regards.
Dating online [nofollow]

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #37 on: July 16, 2008, 05:26:38 PM »
786Fighter, here is the file. It applied just fine manually, and there weren't changes from the search that I could see. The only possible thing I can think of is a change in line endings or spacing.

Remember to make a backup of the old file before putting this up.

Hello, is there any chance to add reCaptcha to guest posting and guest searching ?
I think it will be very usefull on forums where guest writing is allowed.

It's a great thought, but I haven't had a chance to extend it yet. If so, it would depend on Visual Verification Options to be installed (for support on guest posts and searches in 1.1). If you don't mind a weaker test, use Visual Verification Options directly.
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline EdwinK

  • Jr. Member
  • **
  • Posts: 370
  • Gender: Male
  • Free is always better
Re: reCAPTCHA for SMF
« Reply #38 on: July 25, 2008, 05:08:01 AM »
786Fighter, here is the file. It applied just fine manually, and there weren't changes from the search that I could see. The only possible thing I can think of is a change in line endings or spacing.

Remember to make a backup of the old file before putting this up.

Since I'm haveing the same problems as 786Fighter, thought I would try the same attachment, but no luck :( Using a theme without its own Register template. It is using the defaults one.
« Last Edit: July 25, 2008, 05:11:24 AM by EdwinK »

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,025
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #39 on: July 25, 2008, 05:50:04 PM »
Before I do another manual edit, a few questions:

Did the mod install cleanly, or did you get an error?
If it installed cleanly, have you properly configured the reCAPTCHA settings? (Public and Private keys, enabled it, etc)
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.