Forum Moderators: coopster
Thanks in advance.
Edit: How odd, I tried using the link again and it worked this time. But still any ideas on what went wrong would still be appreciated :)
Double Edit: Now I restored it, it's coming up with this error on any link in the Admin CP and the entire forum:
message_die() was called multiple times. This isn't supposed to happen. Was message_die() used in page_tail.php?
[edited by: Jeigh at 3:09 am (utc) on Feb. 11, 2007]
Critical Error!
message_die() was called multiple times.
--------------------------------------------------------------------------------
Error #1
Could not access banlist
Line : 1018
File : /home/graphics/public_html/forum/includes/functions.php
SQL : DELETE FROM phpbb3_banlist WHERE ban_until <> 0 AND ban_until < 1171187149
_____
I'm guessing it might have somthing to do with the temporary ban mod I installed, hope it helps :)
open includes/constants.php (back it up) find
define('BANLIST_TABLE', $table_prefix.'banlist');
replace with
define('BANLIST_TABLE', 'phpbb2_banlist');
What error if any does it give you now?
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_user_ban.php
#
#-----[ FIND ]------------------------------------------
#
$user_list[] = $this_userdata['user_id'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_ban_until = 0;
if ( isset($HTTP_POST_VARS['user_ban_length']) && isset($HTTP_POST_VARS['user_ban_unit']) )
{
$user_ban_until = (int) $HTTP_POST_VARS['user_ban_length'] * $HTTP_POST_VARS['user_ban_unit'];
$user_ban_until = ($user_ban_until > 0)? (time() + $user_ban_until) : 0;
}
#
#-----[ FIND ]------------------------------------------
#
$ip_list[] = encode_ip(str_replace('*', '255', trim($ip_list_temp[$i])));
}
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$ip_ban_until = 0;
if ( isset($HTTP_POST_VARS['ip_ban_length']) && isset($HTTP_POST_VARS['ip_ban_unit']) )
{
$ip_ban_until = (int) $HTTP_POST_VARS['ip_ban_length'] * $HTTP_POST_VARS['ip_ban_unit'];
$ip_ban_until = ($ip_ban_until > 0)? (time() + $ip_ban_until) : 0;
}
#
#-----[ FIND ]------------------------------------------
#
$email_list[] = trim($email_list_temp[$i]);
}
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$email_ban_until = 0;
if ( isset($HTTP_POST_VARS['email_ban_length']) && isset($HTTP_POST_VARS['email_ban_unit']) )
{
$email_ban_until = (int) $HTTP_POST_VARS['email_ban_length'] * $HTTP_POST_VARS['email_ban_unit'];
$email_ban_until = ($email_ban_until > 0)? (time() + $email_ban_until) : 0;
}
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_userid
#
#-----[ IN-LINE FIND ]------------------------------------------
#
ban_userid
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, ban_until
#
#-----[ FIND ]------------------------------------------
#
VALUES (" . $user_list[$i]
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$user_list[$i]
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
. ", " . $user_ban_until
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_ip
#
#-----[ IN-LINE FIND ]------------------------------------------
#
ban_ip
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, ban_until
#
#-----[ FIND ]------------------------------------------
#
VALUES ('" . $ip_list[$i]
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$ip_list[$i] . "'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, " . $ip_ban_until . "
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_email
#
#-----[ IN-LINE FIND ]------------------------------------------
#
ban_email
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, ban_until
#
#-----[ FIND ]------------------------------------------
#
VALUES ('" . str_replace("\'", "''", $email_list[$i]
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$email_list[$i]) . "'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, " . $email_ban_until . "
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT b.ban_id, u.user_id, u.username
#
#-----[ BEFORE, ADD ]------------------------------------------
#
prune_banlist();
#
#-----[ IN-LINE FIND ]------------------------------------------
#
b.ban_id
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, b.ban_until
#
#-----[ FIND ]------------------------------------------
#
$select_userlist .= '<option value="' . $user_list[$i]['ban_id'] . '">' . $user_list[$i]['username'] . '</option>';
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$ban_until = ( $user_list[$i]['ban_until'] > 0 )? ' [' . $lang['Expires'] . ' ' . create_date($lang['Expires_format'], $user_list[$i]['ban_until'], $userdata['user_timezone']) . ']' : '';
#
#-----[ IN-LINE FIND ]------------------------------------------
#
['username']
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
. $ban_until
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT ban_id, ban_ip, ban_email
#
#-----[ IN-LINE FIND ]------------------------------------------
#
ban_email
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, ban_until
#
#-----[ FIND ]------------------------------------------
#
for($i = 0; $i < count($banlist); $i++)
{
$ban_id = $banlist[$i]['ban_id'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$ban_until = ( $banlist[$i]['ban_until'] > 0 )? ' [' . $lang['Expires'] . ' ' . create_date($lang['Expires_format'], $banlist[$i]['ban_until'], $userdata['user_timezone']) . ']' : '';
#
#-----[ FIND ]------------------------------------------
#
$select_iplist .= '<option value="' . $ban_id . '">' . $ban_ip . '</option>';
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$ban_ip
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
. $ban_until
#
#-----[ FIND ]------------------------------------------
#
$select_emaillist .= '<option value="' . $ban_id . '">' . $ban_email . '</option>';
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$ban_email
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
. $ban_until
#
#-----[ FIND ]------------------------------------------
#
'L_FIND_USERNAME' => $lang['Find_username'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_MINUTES' => $lang['Minutes'],
'L_HOURS' => $lang['Hours'],
'L_DAYS' => $lang['Days'],
'L_WEEKS' => $lang['Weeks'],
'L_EXPIRES_AFTER' => $lang['Expires_after'],
'L_EXPIRES_EXPLAIN' => $lang['Expires_explain'],
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);
#
#-----[ IN-LINE FIND ]------------------------------------------
#
include
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
include_once
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
function prune_banlist()
{
global $db;
$sql = "DELETE FROM " . BANLIST_TABLE .
" WHERE ban_until <> 0 AND ban_until < " . time();
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not access banlist', '', __LINE__, __FILE__, $sql);
}
}
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT ban_userid
#
#-----[ BEFORE, ADD ]------------------------------------------
#
prune_banlist();
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_validate.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT ban_email
#
#-----[ BEFORE, ADD ]------------------------------------------
#
prune_banlist();
#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
global $HTTP_COOKIE_VARS,
#
#-----[ AFTER, ADD ]------------------------------------------
#
global $lang, $phpbb_root_path, $phpEx;
// Begin by Lord Le Brand (Stolen from functions.php)
if ( $userdata['user_id']!= ANONYMOUS )
{
if (!empty($userdata['user_lang']))
{
$default_lang = phpbb_ltrim(basename(phpbb_rtrim($userdata['user_lang'])), "'");
}
if (!empty($userdata['user_dateformat']) )
{
$board_config['default_dateformat'] = $userdata['user_dateformat'];
}
if ( isset($userdata['user_timezone']) )
{
$board_config['board_timezone'] = $userdata['user_timezone'];
}
}
else
{
$default_lang = phpbb_ltrim(basename(phpbb_rtrim($board_config['default_lang'])), "'");
}
if (!file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) )
{
if ( $userdata['user_id']!= ANONYMOUS )
{
// For logged in users, try the board default language next
$default_lang = phpbb_ltrim(basename(phpbb_rtrim($board_config['default_lang'])), "'");
}
else
{
// For guests it means the default language is not present, try english
// This is a long shot since it means serious errors in the setup to reach here,
// but english is part of a new install so it's worth us trying
$default_lang = 'english';
}
if (!file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) )
{
message_die(CRITICAL_ERROR, 'Could not locate valid language pack');
}
}
// If we've had to change the value in any way then let's write it back to the database
// before we go any further since it means there is something wrong with it
if ( $userdata['user_id']!= ANONYMOUS && $userdata['user_lang']!== $default_lang )
{
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_lang = '" . $default_lang . "'
WHERE user_lang = '" . $userdata['user_lang'] . "'";
if (!($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not update user language info');
}
$userdata['user_lang'] = $default_lang;
}
elseif ( $userdata['user_id'] === ANONYMOUS && $board_config['default_lang']!== $default_lang )
{
$sql = 'UPDATE ' . CONFIG_TABLE . "
SET config_value = '" . $default_lang . "'
WHERE config_name = 'default_lang'";
if (!($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not update user language info');
}
}
$board_config['default_lang'] = $default_lang;
include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);
if ( defined('IN_ADMIN') )
{
if(!file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.'.$phpEx)) )
{
$board_config['default_lang'] = 'english';
}
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx);
}
// End by Lord Le Brand
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT ban_ip, ban_userid, ban_email
#
#-----[ BEFORE, ADD ]------------------------------------------
#
prune_banlist();
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, ban_email
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, ban_until
#
#-----[ FIND ]------------------------------------------
#
if ( $ban_info['ban_ip'] ¦¦ $ban_info['ban_userid'] ¦¦ $ban_info['ban_email'] )
#
#-----[ FIND ]------------------------------------------
#
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$ban_until = create_date( $lang['Expires_format_banned'], $ban_info['ban_until'], $board_config['board_timezone'] );
if ( $ban_info['ban_until'] > 0 )
{
message_die(CRITICAL_MESSAGE, $lang['You_been_banned'] . '<br /><br />' . $lang['Expires_msg_banned'] . $ban_until);
}
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Ban_explain_warn'] = 'Please
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Expires_after'] = 'Ban expires after';
$lang['Expires_explain'] = 'Set to zero for a permanent ban';
$lang['Expires'] = 'Expires';
$lang['Expires_format'] = 'd M Y g:i a';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Message'] = 'Message';
#
#-----[ AFTER, ADD ]------------------------------------------
#
// 'Hours' and 'Days' are defined elsewhere
$lang['Seconds'] = 'Seconds';
$lang['Minutes'] = 'Minutes';
$lang['Weeks'] = 'Weeks';
// Added in version 1.1.2 to display the banned time to banned members
$lang['Expires_msg_banned'] = 'Your ban expires on ';
$lang['Expires_format_banned'] = 'd M Y g:i a';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_ban_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<p>{L_BAN_EXPLAIN}</p>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<p><b>{S_CURRENT_TIME}</b></p>
#
#-----[ FIND ]------------------------------------------
#
<td class="row2"><input class="post" type="text" class="post" name="username" maxlength="50" size="20" />
#
#-----[ IN-LINE FIND ]------------------------------------------
#
</td>
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
<br />{L_EXPIRES_AFTER} <input class="post" type="text" name="user_ban_length" value="0" size="4" /> <select name="user_ban_unit"><option selected="selected" value="60">{L_MINUTES}</option><option value="3600">{L_HOURS}</option><option value="86400">{L_DAYS}</option><option value="604800">{L_WEEKS}</option></select> <br /><span class="gensmall">{L_EXPIRES_EXPLAIN}</span>
#
#-----[ FIND ]------------------------------------------
#
<td class="row2"><input class="post" type="text" name="ban_ip" size="35" /></td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
</td>
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
<br />{L_EXPIRES_AFTER} <input class="post" type="text" name="ip_ban_length" value="0" size="4" /> <select name="ip_ban_unit"><option selected="selected" value="60">{L_MINUTES}</option><option value="3600">{L_HOURS}</option><option value="86400">{L_DAYS}</option><option value="604800">{L_WEEKS}</option></select> <br /><span class="gensmall">{L_EXPIRES_EXPLAIN}</span>
#
#-----[ FIND ]------------------------------------------
#
<td class="row2"><input class="post" type="text" name="ban_email" size="35" /></td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
</td>
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
<br />{L_EXPIRES_AFTER} <input class="post" type="text" name="email_ban_length" value="0" size="4" /> <select name="email_ban_unit"><option selected="selected" value="60">{L_MINUTES}</option><option value="3600">{L_HOURS}</option><option value="86400">{L_DAYS}</option><option value="604800">{L_WEEKS}</option></select> <br /><span class="gensmall">{L_EXPIRES_EXPLAIN}</span>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
To import/restore a database click on SQL at the top of the page > browse file. You will probably need to drop the phpbb database first (after you back it up through phpmyadmin).
I think that is why you are having problems, phpbb inbuilt backup feature only backs up the required tables. All the tables installed by your mods don't get backed up by phpbb unless you tell it to. I always use phpmyadmin to backup and import databases.