I implemented your solution for integrating CoC's Anti-Bot Question mod into the guest reply of phpBB3 (phpbb.com/community/viewtopic.php?f=69&t=645075&start=435#p7915645), and it worked wonderfully, but in trying to port that solution to another mod, I ran into a small problem.
I am attempting to add the question to dyn's Mini Quick Reply mod, and was thinking about also adding it to Evil <3's Contact Board Administration mod. The problem is that instead of the set anti-bot question showing, only { AB_QUESTION } shows, and I can't track down the issue.
Here are the changes I have made to the Mini Quick Reply files:
In functions_quick_reply.php find:
- Code: Select all
// set subject
$subject = ((strpos($topic_data['topic_title'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($topic_data['topic_title']);
list($s_hidden_fields['subject'], $subject) = array($subject, '');
After Add:
- Code: Select all
// BEGIN Anti-Bot question addon
if ($config['enable_abquestion'] && !$user->data['is_registered'])
{
$user->add_lang('ucp');
$ab_question = strtolower(request_var('ab_question', ''));
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;
}
$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 Anti-Bot question addon
Add in posting_qr_body.html:
- Code: Select all
<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>
It seems the 'L_AB_QUESTION' => $config['abquestion'], is not being passed for some reason, but I'll be damned if I can figure out why. Other than that, it functions normally - if I enter the correct answer, it processes normally, and if I give a wrong answer, or no answer, it throws the correct error.
Thanks for the help. This one has me stumped.
-Spider




