News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

reCAPTCHA for SMF

Started by 青山 素子, December 28, 2007, 12:16:40 PM

Previous topic - Next topic

青山 素子

Text description for the Register.template.php changes.

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

Find:

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


REPLACE with:

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



Find:

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


REPLACE with:

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



Find:

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


Add this BEFORE:

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:

}

// Are there age restrictions in place?


Add this BEFORE:

}



Find:

</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:

<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

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


myaicons

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...

deadpoeticstar

file is coming back as corrupted or invalid for this release

青山 素子

Versions 0.9 and 0.9.5 both worked fine here. Can you try re-downloading?
Motoko-chan
Director, Simple Machines

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


res6cue

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!

青山 素子

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

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


cgoodwin73

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

Nick.123

Anyway to fix text colour on input box so the text will show up on black backgrounds

[nofollow]

青山 素子

Quote from: Nick.123 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

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:

/* 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

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


Mo786

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?

青山 素子

Are you using a custom template for the registration? What version of SMF?
Motoko-chan
Director, Simple Machines

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


Mo786

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.

青山 素子

Any other mods that might affect the template?
Motoko-chan
Director, Simple Machines

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


Mo786

Well the only other mod that probably edited the register.template.php before was the referral mod and thats about it. Nothing else.

青山 素子

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

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


Mo786


vhs

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]

青山 素子

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.

Quote from: vhs 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.

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

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


EdwinK

#38
Quote from: Motoko-chan 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.

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.
|| foto-site ||

青山 素子

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

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


Advertisement: