Code: Select all
#-----[ FIND ]------------------------------------------------
#
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
}
$db->sql_freeresult($result);
}
}
Code: Select all
#-----[ FIND ]------------------------------------------------
#
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
}
$db->sql_freeresult($result);
}
}
#
#-----[ AFTER, ADD ]------------------------------------------------
#
// Anti Bot Question Mod - Start
if (($mode == 'register') && ($board_config['anti_bot_quest']))
{
$abq_aw = htmlspecialchars(stripslashes($abq_aw));
$abq_id = intval(htmlspecialchars(stripslashes($idabq)));
$sql = 'SELECT answer1, answer2, answer3, answer4, answer5
FROM ' . ANTI_BOT_QUEST_TABLE . '
WHERE id = ' . $abq_id;
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not obtain anti-bot-question information', '', __LINE__, __FILE__, $sql);
}
if( $db->sql_numrows($result) == 0 )
{
$sql = 'SELECT answer
FROM ' . ANTI_BOT_QUEST_TABLE . '
WHERE lang = \'' . $board_config['default_lang'] . '\'
LIMIT 1';
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not obtain anti-bot-question information', '', __LINE__, __FILE__, $sql);
}
if( $db->sql_numrows($result) == 0 )
{
// Keine Frage vorhanden > Anti-Bot-Question übergehen
}
else
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['ABQ_Incorrect'];
}
}
else
{
$abqrow = $db->sql_fetchrow($result);
if ($board_config['anti_bot_quest_casesen'])
{
if (($abq_aw == $abqrow['answer1']) || (($abqrow['answer2'] != '') && ($abq_aw == $abqrow['answer2'])) || (($abqrow['answer3'] != '') && ($abq_aw == $abqrow['answer3'])) || (($abqrow['answer4'] != '') && ($abq_aw == $abqrow['answer4'])) || (($abqrow['answer5'] != '') && ($abq_aw == $abqrow['answer5'])))
{}
else
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['ABQ_Incorrect'];
}
}
else
{
$abq_aw = strtolower($abq_aw);
if (($abq_aw == strtolower($abqrow['answer1'])) || (($abqrow['answer2'] != '') && ($abq_aw == strtolower($abqrow['answer2']))) || (($abqrow['answer3'] != '') && ($abq_aw == strtolower($abqrow['answer3']))) || (($abqrow['answer4'] != '') && ($abq_aw == strtolower($abqrow['answer4']))) || (($abqrow['answer5'] != '') && ($abq_aw == strtolower($abqrow['answer5']))))
{}
else
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['ABQ_Incorrect'];
}
}
}
}
// Anti Bot Question Mod - End
Code: Select all
if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
{
$sql = "SELECT user_email, user_lang
FROM " . USERS_TABLE . "
WHERE user_level = " . ADMIN;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->email_address(trim($row['user_email']));
$emailer->use_template("admin_activate", $row['user_lang']);
$emailer->set_subject($lang['New_account_subject']);
$emailer->assign_vars(array(
'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),
'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
);
$emailer->send();
$emailer->reset();
}
$db->sql_freeresult($result);
}
$message = $message . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
} // if mode == register
}
} // End of submit
Could not obtain anti-bot-question information
DEBUG MODE
SQL Error : 1054 Unknown column 'answer' in 'field list'
SELECT answer FROM phpbb_anti_bot_quest WHERE lang = 'english' LIMIT 1
Line : 284
File : .../public_html/phpBB2/includes/usercp_register.php
Code: Select all
if( $db->sql_numrows($result) == 0 )
{
$sql = 'SELECT answer
FROM ' . ANTI_BOT_QUEST_TABLE . '
WHERE lang = \'' . $board_config['default_lang'] . '\'
LIMIT 1';
For many reasons you should update your phpbb.VorowneTSG wrote: I'm still running phpBB 2.0.6...
Could you please link your "usercp_register.php" as a textfile for download?VorowneTSG wrote: Everything looks like it will work, except for the following part of the instructions:This text does not exist as such in the usercp_register.php file for 2.0.6.Code: Select all
#-----[ FIND ]------------------------------------------------ # $error = TRUE; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong']; } $db->sql_freeresult($result); } }
'SELECT answer' is wrong, therefore the mod is updated (version 1.0.3).VorowneTSG wrote: Here's the offending part of the code:
Code:
if( $db->sql_numrows($result) == 0 )
{
$sql = 'SELECT answer
FROM ' . ANTI_BOT_QUEST_TABLE . '
WHERE lang = \'' . $board_config['default_lang'] . '\'
LIMIT 1';
Since it says there's no column named "answer", I changed "SELECT answer" to "SELECT answer1, answer2, answer3, answer4, answer5" and no longer got the above Error message,...
For many reasons you should update your phpbb.
'SELECT answer' is wrong, therefore the mod is updated (version 1.0.3).
The reason for this problem is:VorowneTSG wrote: ...but now it says every answer is incorrect
Code: Select all
#
#-----[ FIND ]------------------------------------------------
#
$strip_var_list = array('email' => 'email', 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests', 'confirm_code' => 'confirm_code');
#
#-----[ IN-LINE FIND ]------------------------------------------------
#
'confirm_code' => 'confirm_code'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
, 'abq_aw' => $board_config['anti_bot_quest_get'], 'idabq' => 'idabq'
Code: Select all
#
#-----[ FIND ]------------------------------------------------
#
$strip_var_list = array('username' => 'username', 'email' => 'email', 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests');
#
#-----[ IN-LINE FIND ]------------------------------------------------
#
'interests' => 'interests'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
, 'abq_aw' => $board_config['anti_bot_quest_get'], 'idabq' => 'idabq'
UsingVorowneTSG wrote: Everything looks like it will work, except for the following part of the instructions:This text does not exist as such in the usercp_register.php file for 2.0.6.Code: Select all
#-----[ FIND ]------------------------------------------------ # $error = TRUE; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong']; } $db->sql_freeresult($result); } }
Code: Select all
#
#-----[ FIND ]------------------------------------------------
#
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
}
}
#
#-----[ AFTER, ADD ]------------------------------------------------
#
// Anti Bot Question Mod - Start
if (($mode == 'register') && ($board_config['anti_bot_quest']))
{
...
Code: Select all
#
#-----[ FIND ]------------------------------------------------
#
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
}
$db->sql_freeresult($result);
}
}
#
#-----[ AFTER, ADD ]------------------------------------------------
#
// Anti Bot Question Mod - Start
if (($mode == 'register') && ($board_config['anti_bot_quest']))
{
...
It means I fixed the mod and updated the download file (current version: 1.0.3).VorowneTSG wrote: Not sure what you mean by this . Is this to say the mod needs updating? Or that I have an updated copy somehow?[/
Code: Select all
#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------------
#
$sql = 'SELECT answer
#
#-----[ REPLACE WITH ]------------------------------------------------
#
$sql = 'SELECT answer1, answer2, answer3, answer4, answer5
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------------
#
$lang['ABQ_Version'] = '1.0.2';
#
#-----[ REPLACE WITH ]------------------------------------------------
#
$lang['ABQ_Version'] = '1.0.3';
Code: Select all
#
#-----[ OPEN ]------------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------------
#
define('CONFIRM_TABLE', $table_prefix.'confirm');
#
#-----[ AFTER, ADD ]------------------------------------------------
#
// Anti Bot Question Mod - Start
define('ANTI_BOT_QUEST_TABLE', $table_prefix.'anti_bot_quest');
// Anti Bot Question Mod - End