News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Anti-Spam Verification Questions for SMF 1.1.x

Started by Deprecated, November 23, 2008, 01:37:46 PM

Previous topic - Next topic

Sabre™

@ ddrager
You will need to manually add the code required for your  Register.template.php.
If you require any assistance, then attach that template here please :)


@ Magicjax
In your  Register.template.php, search for this line

<b>', $modSettings['anti_spam_ver_ques_1'], ':</b>

and directly beneath it, place this
<div class="smalltext" style="text-align: center; color: rgb(255, 0, 0);">', $txt['reason1'], '</div>

so now it looks like this
<b>', $modSettings['anti_spam_ver_ques_1'], ':</b>
<div class="smalltext" style="text-align: center; color: rgb(255, 0, 0);">', $txt['reason1'], '</div>


Then in your languages folder, find the  index.english.php  and add this to the bottom before this  ?>
$txt['reason1'] = 'We are asking these simple questions not to keep anyone out — except the spammers and forum bots. If you need help with these questions, please contact the Administrator here.';


You can change that text to anything you'd like, I just used what you added here.
That should accomplish what you've requested. :)

I did something similar awhile ago on one of my sites, it looks like this

Right click on the image, and select 'view image' to enlarge the image.

Hope that helps you :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Sabre™

Sorry folks for the double post, I've just now played with this, and didn't want it to get mixed up with the previous.
I will combine both posts if deemed inappropriate :)

Now this is regarding those that have a problem with the bbc function of this mod.
This is a rough hack, and is only what I'm using.
Someone with better/more knowledge than I may provide a better solution.

Find this in your Register.template.php
// Are there any verification questions to answer?
if (!empty($modSettings['anti_spam_ver_enable']))
{
if (!empty($modSettings['anti_spam_ver_ques_1']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_1'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_1" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_2']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_2'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_2" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_3']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_3'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_3" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_4']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_4'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_4" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_5']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_5'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_5" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
}


and replace with
// Are there any verification questions to answer?
if (!empty($modSettings['anti_spam_ver_enable']))
{
if (!empty($modSettings['anti_spam_ver_ques_1']))
echo '
<tr valign="top">
<td width="40%">
<b>', parse_bbc($modSettings['anti_spam_ver_ques_1']), ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_1" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_2']))
echo '
<tr valign="top">
<td width="40%">
<b>', parse_bbc($modSettings['anti_spam_ver_ques_2']), ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_2" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_3']))
echo '
<tr valign="top">
<td width="40%">
<b>', parse_bbc($modSettings['anti_spam_ver_ques_3']), ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_3" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_4']))
echo '
<tr valign="top">
<td width="40%">
<b>', parse_bbc($modSettings['anti_spam_ver_ques_4']), ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_4" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_5']))
echo '
<tr valign="top">
<td width="40%">
<b>', parse_bbc($modSettings['anti_spam_ver_ques_5']), ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_5" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
}


Works for me ;)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


coledavis


jamz

Yes...I had a sucessful install and tested the registration for 1.1.9

Jamz

destalk

#184
Quote from: jamz on May 23, 2009, 10:15:55 PM
Yes...I had a sucessful install and tested the registration for 1.1.9

Just to confirm, did you simply upgrade via the Package Manager and it all worked fine? Or did you do a manual upgrade?

It does appear to update the ./Themes/default/languages/index.english.php file, which the mod affects.

Anyone else update to 1.1.9? Any issues with this mod?

Thanks.

Theuser

I did a manual upgrade and it doesn't work for me with 1.1.9. I use the swedish language.
I can see my verification question in the admin controlpanel, but when I go to the
registerpage I can't see the verificationquestion.

I have done the manual upgrade twice now, so I don't think I have done anything wrong...

destalk

Hi
Quote from: Theuser on June 02, 2009, 06:43:56 AM
I did a manual upgrade and it doesn't work for me with 1.1.9. I use the swedish language.
I can see my verification question in the admin controlpanel, but when I go to the
registerpage I can't see the verificationquestion.

I have done the manual upgrade twice now, so I don't think I have done anything wrong...

Hi Theuser

Hmmmm. If you can't see the question in the register page, perhaps the  index.english.php (or rather index.swedish.php) page has been overwritten? I'm guessing that's where the questions are drawn from I think.

I wonder if the best option might be to do an auto-update for SMF and then apply the mod manually from scratch? Or at least the index.language.php part of it? At this appears to be the only page that is affected by the update (as far as I can tell).

Just a thought.

That's what I might try anyway.

destalk

OK, for what it's worth, I ran the auto update to 1.1.9 (from 1.1.8 ) in the Admin section and all appears to be working perfectly. So far, I haven't had to touch the Mod installation.

Edit LOL, I tried posting (from 1.1.8 ) above without the space after the 8 and got this (from 1.1.8)

destalk

Actually, I don't know what I was talking about up-thread. :-[

I don't think that the index.language.php file is used by this Mod, so it makes sense that the auto admin update would work without a problem.

Theuser

#189
Thank you for your answers!

I have now solved my problem. The problem was when I copy and paste the  new php-code in my
document. For example, this code doesn't work:

         'anti_spam_ver_enable' => isset($_POST['anti_spam_ver_enable']) ? 1 : 0,         'anti_spam_ver_ques_1' => !empty($_POST['anti_spam_ver_ques_1']) ? $_POST['anti_spam_ver_ques_1'] : '',         'anti_spam_ver_ans_1' => !empty($_POST['anti_spam_ver_ans_1']) ? $_POST['anti_spam_ver_ans_1'] : '',         'anti_spam_ver_ques_2' => !empty($_POST['anti_spam_ver_ques_2']) ? $_POST['anti_spam_ver_ques_2'] : '',         'anti_spam_ver_ans_2' => !empty($_POST['anti_spam_ver_ans_2']) ? $_POST['anti_spam_ver_ans_2'] : '',         'anti_spam_ver_ques_3' => !empty($_POST['anti_spam_ver_ques_3']) ? $_POST['anti_spam_ver_ques_3'] : '',         'anti_spam_ver_ans_3' => !empty($_POST['anti_spam_ver_ans_3']) ? $_POST['anti_spam_ver_ans_3'] : '',         'anti_spam_ver_ques_4' => !empty($_POST['anti_spam_ver_ques_4']) ? $_POST['anti_spam_ver_ques_4'] : '',         'anti_spam_ver_ans_4' => !empty($_POST['anti_spam_ver_ans_4']) ? $_POST['anti_spam_ver_ans_4'] : '',         'anti_spam_ver_ques_5' => !empty($_POST['anti_spam_ver_ques_5']) ? $_POST['anti_spam_ver_ques_5'] : '',         'anti_spam_ver_ans_5' => !empty($_POST['anti_spam_ver_ans_5']) ? $_POST['anti_spam_ver_ans_5'] : '',

The same code, but with breaks works:


'anti_spam_ver_enable' => isset($_POST['anti_spam_ver_enable']) ? 1 : 0,
'anti_spam_ver_ques_1' => !empty($_POST['anti_spam_ver_ques_1']) ? $_POST['anti_spam_ver_ques_1'] : '',
'anti_spam_ver_ans_1' => !empty($_POST['anti_spam_ver_ans_1']) ? $_POST['anti_spam_ver_ans_1'] : '',
'anti_spam_ver_ques_2' => !empty($_POST['anti_spam_ver_ques_2']) ? $_POST['anti_spam_ver_ques_2'] : '',
'anti_spam_ver_ans_2' => !empty($_POST['anti_spam_ver_ans_2']) ? $_POST['anti_spam_ver_ans_2'] : '',
'anti_spam_ver_ques_3' => !empty($_POST['anti_spam_ver_ques_3']) ? $_POST['anti_spam_ver_ques_3'] : '',
'anti_spam_ver_ans_3' => !empty($_POST['anti_spam_ver_ans_3']) ? $_POST['anti_spam_ver_ans_3'] : '',
'anti_spam_ver_ques_4' => !empty($_POST['anti_spam_ver_ques_4']) ? $_POST['anti_spam_ver_ques_4'] : '',
'anti_spam_ver_ans_4' => !empty($_POST['anti_spam_ver_ans_4']) ? $_POST['anti_spam_ver_ans_4'] : '',
'anti_spam_ver_ques_5' => !empty($_POST['anti_spam_ver_ques_5']) ? $_POST['anti_spam_ver_ques_5'] : '',
'anti_spam_ver_ans_5' => !empty($_POST['anti_spam_ver_ans_5']) ? $_POST['anti_spam_ver_ans_5'] : '',

In my "old" document the code was in a long row, but now with breaks, it works. Strange?


itsthedog

I'm simply amazed at how easy it is to use SMF. I installed the Mod with such ease! Thank you thank you thank you.

Phat^Trance

does anyone have any tip of good verification question that i can use? :)
Daily Mobile Blog:  http://dailymobile.se/
Daily iPhone Blog: http://dailyiphoneblog.com/
Daily Mobile forum: http://forum.dailymobile.se/

Sabre™

Simple and obvious is always good ;)
You could have questions like
1.) What colour is this text?
2.) Type the name of this site
3.) How many questions have you just answered?

Asking questions that anyone could answer would work.
Hope this helps a little :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


lilone2k9

Quote from: Sabre™ on July 08, 2009, 06:40:47 AM
Simple and obvious is always good ;)
You could have questions like
1.) What colour is this text?
2.) Type the name of this site
3.) How many questions have you just answered?

Asking questions that anyone could answer would work.
Hope this helps a little :)

Thanks a lot all, this is a very helpful post and software  ;D
Got God? http://thinkonjesus.org [nofollow]

destalk

#195
The update to SMF 1.1.10 appears to affect a few files that this mod deals with. Has anyone had any problems doing an auto update in package manager from 1.1.9 to 1.1.10?

Or do we need to update SMF and then re-apply the mod manually?

Files affected that I can spot are;

/Sources/Register.php
/Sources/ManageRegistration.php

Themes/default/Register.template.php


Any others?

Mr. Jinx

No problems upgrading to 1.1.10 with this mod installed!


Sabre™

Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


SulevFan

I just came across an interesting issue with this mod.

My question was:

Quote
What does the "L" in LISD stand for?

After saving the updates, the question was truncated at the first double quote.

Quote
What does the

I reentered the question to remove the quotes and it works fine. Just thought you should know. 

Advertisement: