Anti-Bot Question

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
User avatar
Eelke
Registered User
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: Anti-Bot Question

Post by Eelke »

phpaaa wrote:THANK ... i missed the step "PURGED the cache :D
This is a common oversight with any changes made to the template files, not just this MOD.
scousser
Registered User
Posts: 8
Joined: Sun Nov 30, 2008 9:18 pm

Re: Anti-Bot Question

Post by scousser »

Hi,

I installed successfully the mod on the prosilver template and the antibot question appears well when someone tries to register.

I would like to open my forum to guest users (therefore having not registered) and would like the antibot question to appear each time someone tries to post a message (instead or eventually with the captcha).

What code should I add and where ? on which file ?

Thanks for your help !

sc
User avatar
Jaymie1989
Registered User
Posts: 1991
Joined: Thu Aug 02, 2007 5:21 pm
Name: Jaymie

Re: Anti-Bot Question

Post by Jaymie1989 »

This would require a whole new MOD.
Dear creators of Sesame Street,
Kids are still fat. Can I come back now?
Sincerely, Cookie Monster.

View my MODs - Need phpBB help with MODs and Styles? Take a look at my phpBB3 services
kiran_n444
Registered User
Posts: 115
Joined: Mon May 21, 2007 9:42 pm

Re: Anti-Bot Question

Post by kiran_n444 »

thanks great mod xD

installed and Working perfectly
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21328
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Anti-Bot Question

Post by RMcGirr83 »

scousser wrote:I would like to open my forum to guest users (therefore having not registered) and would like the antibot question to appear each time someone tries to post a message (instead or eventually with the captcha).

What code should I add and where ? on which file ?

Thanks for your help !

sc
OPEN

posting.php

FIND

Code: Select all

$solved_captcha
IN-LINE, AFTER ADD

Code: Select all

 = $solved_abq

FIND

Code: Select all

			$solved_captcha = true;
		}
	}

AFTER, ADD

Code: Select all

	// 	BEGIN ABD question addon
	if ($config['enable_abquestion'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
	{
		$user->add_lang('ucp');
		$ab_question = strtolower(utf8_normalize_nfc(request_var('ab_question', '', true)));
		
		if ($ab_question == '')
		{
			$error[] = $user->lang['AB_NO_ANSWER'];
		}
		elseif ($ab_question != strtolower($config['abanswer']) && $ab_question != strtolower($config['abanswer2']))
		{
			$error[] = $user->lang['AB_QUESTION_ERROR'];
		}
		else
		{
			$solved_abq = true;
		}
	}
	// END ABD question addon

FIND

Code: Select all

		'L_POST_CONFIRM_EXPLAIN'	=> sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
	));
}
AFTER ADD

Code: Select all

// 	BEGIN ABD question addon
if ($config['enable_abquestion'] && !$user->data['is_registered'] && $solved_abq === false && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
{
	$ab_question = '';
	$template->assign_vars(array(
		'S_AB_QUESTION'				=> true,
		'L_AB_QUESTION'				=> $config['abquestion'],
		'L_AB_QUESTION_EXPLAIN'		=> $user->lang['AB_QUESTION_EXPLAIN'],
		'AB_QUESTION'				=> $ab_question,
		));
}
// END ABD question addon
FIND

Code: Select all

		'confirm_code'		=> request_var('confirm_code', ''))
	);
}
AFTER ADD

Code: Select all

// Add the ab question to the hidden fields, else an error is displayed on next submit/preview
if ($solved_abq !== false)
{
	$s_hidden_fields .= build_hidden_fields(array(
		'ab_question'		=> strtolower(utf8_normalize_nfc(request_var('ab_question', '', true))),
	));
}
OPEN

styles/prosilver/template/posting_editor.html

FIND

Code: Select all

		<dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="3" class="inputbox narrow" title="{L_CONFIRM_CODE}" /></dd>
		</dl>
		<!-- ENDIF -->
AFTER ADD

Code: Select all

		<!-- IF S_AB_QUESTION -->
		<dl>
			<dt><label for="ab_question">{L_AB_QUESTION}:</label><br /><span>{L_AB_QUESTION_EXPLAIN}</span></dt>
			<dd><input type="hidden" name="ab_question" value="{AB_QUESTION}" /></dd>
			<dd><input type="text" name="ab_question" id="ab_question" size="25" maxlength="255" tabindex="3" class="inputbox narrow" /></dd>
		</dl>
		<!-- ENDIF -->

...and that should do it. :)
Last edited by RMcGirr83 on Sun Mar 29, 2009 9:56 pm, edited 2 times in total.
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
scousser
Registered User
Posts: 8
Joined: Sun Nov 30, 2008 9:18 pm

Re: Anti-Bot Question

Post by scousser »

Hi,

I added the changes, refreshed the template, cleared the cache but the question does not appear.

Do you agreed in the code of the posting.php I should have :

$solved_captcha = $solved_abq


Otherwise Any idea ?

Many thanks for your support !!
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21328
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Anti-Bot Question

Post by RMcGirr83 »

scousser wrote: $solved_captcha = $solved_abq
Should be

Code: Select all

$solved_captcha = $solved_abq = false;
You must first have this mod installed before this add-on will work. Other than that, it seems to work fine. Double check your edits to posting.php and if you are still having issues you can PM me your php file. Also don't forget that the edits to the HTML files have to occur on whatever style you use. I gave the code for prosilver based styles.
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
scousser
Registered User
Posts: 8
Joined: Sun Nov 30, 2008 9:18 pm

Re: Anti-Bot Question

Post by scousser »

Hi,

I typied this wrong : $solved_captcha = $solved_abq = false;

Will try it and let you know !

Thanks.
User avatar
Hippie459MN
Registered User
Posts: 948
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: Anti-Bot Question

Post by Hippie459MN »

Installed and works like a champ! Just what I have been looking for. Thank you for the great mod. :D
scousser
Registered User
Posts: 8
Joined: Sun Nov 30, 2008 9:18 pm

Re: Anti-Bot Question

Post by scousser »

Thanks, the mod works great
HitByLife
Registered User
Posts: 17
Joined: Sun Dec 30, 2007 9:04 pm

Re: Anti-Bot Question

Post by HitByLife »

Strange, this is not working for me. No problems during installation, found the configuration section in the admin panel (General -> Board Configuration -> User registration settings: Anti-Bot Question) and added my question and my answer.

However, when I try to register a new user, and adding the answer I configured in the admin panel, the registration halts with the message "No Anti-Bot Question Answer Entered."

I really can't figure this out. I have looked through the installation instructions a few times and the files I have modified, but I cannot see any problems.

Anyone?
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21328
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Anti-Bot Question

Post by RMcGirr83 »

You need to install the mod into whichever style you are using. If you did and still don't see the question in the registration, then ensure you also refreshed the template/purged the cache.
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
HitByLife
Registered User
Posts: 17
Joined: Sun Dec 30, 2007 9:04 pm

Re: Anti-Bot Question

Post by HitByLife »

RMcGirr83 wrote:You need to install the mod into whichever style you are using. If you did and still don't see the question in the registration, then ensure you also refreshed the template/purged the cache.
Oh, but I did install the mod into the style I'm using. I can see the anti-bot question during registration, no problems there, the problem starts when I hit submit to complete the registration. Even if I have entered the anti-bot question correctly, I get the message "No Anti-Bot Question Answer Entered."
User avatar
Hippie459MN
Registered User
Posts: 948
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: Anti-Bot Question

Post by Hippie459MN »

Make sure you have the answer entered in your ACP. ;)
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21328
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Anti-Bot Question

Post by RMcGirr83 »

HitByLife wrote:Oh, but I did install the mod into the style I'm using. I can see the anti-bot question during registration, no problems there, the problem starts when I hit submit to complete the registration. Even if I have entered the anti-bot question correctly, I get the message "No Anti-Bot Question Answer Entered."
Double check the edits to includes/ucp/ucp_register.php.
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Locked

Return to “[3.0.x] MOD Database Releases”