Forum Moderators: coopster

Message Too Old, No Replies

Phpbb Admin CP

Link gone, can't access

         

Jeigh

3:03 am on Feb 11, 2007 (gmt 0)

10+ Year Member



I tried manually installing a mod yesterday, the mod didn't work properly but there were no major problems. Today I went to go intot he Admin CP and the link was missing so I tried just typing in www.mydomain.com/forum/admin which worked for other people but it just took me to the main index. I just need to get in there so I can restore with a backup file but I'm all out of ideas.

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]

Jeigh

6:05 am on Feb 11, 2007 (gmt 0)

10+ Year Member



Ok, I just went back through everything in the install process got rid of it all (that I know of) and I'm still getting the message. If it helps I was trying to install the Moderator CP Mod.

Jeigh

9:56 am on Feb 11, 2007 (gmt 0)

10+ Year Member



Looked somthing up and found somthing to add to the functions to help solve the problem, this is what I get now:

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 :)

maccas

11:44 am on Feb 11, 2007 (gmt 0)

10+ Year Member



Just a guess but does the table banlist exist?

Jeigh

11:50 am on Feb 11, 2007 (gmt 0)

10+ Year Member



Yeah it does, just checked.

dreamcatcher

1:10 pm on Feb 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried running a repair on the banlist table?

dc

Jeigh

5:04 am on Feb 12, 2007 (gmt 0)

10+ Year Member



Yeah, just did then but it still dosn't work.

Swanny007

5:23 am on Feb 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Restore the database from the day before you installed that mod.

Jeigh

5:31 am on Feb 12, 2007 (gmt 0)

10+ Year Member



That was the problem :P After I restored it I couldn't acess the forum anymore, but how can I restore it again through phpMyAdmin?

Jeigh

12:00 pm on Feb 12, 2007 (gmt 0)

10+ Year Member



Anymore suggestions?

Jeigh

8:30 am on Feb 13, 2007 (gmt 0)

10+ Year Member



This error is getting annoying lol.

Jeigh

11:50 am on Feb 13, 2007 (gmt 0)

10+ Year Member



I just looked at phpMyadmin again, I have 2 banlist tables, I'm assuming thats a problem? If so how do I delete it and which one should I delete if it matters?

maccas

12:03 pm on Feb 13, 2007 (gmt 0)

10+ Year Member



No that shouldn't be a problem. Are you sure one of them is called phpbb3_banlist with the phpbb3_ part.

Jeigh

12:12 pm on Feb 13, 2007 (gmt 0)

10+ Year Member



One is phpbb2_banlist and the other is phpbb_banlist so no I guess :P

Edit: There is also a phpbb3_banlist so there are three tables altogether.

[edited by: Jeigh at 12:13 pm (utc) on Feb. 13, 2007]

maccas

1:14 pm on Feb 13, 2007 (gmt 0)

10+ Year Member



Seems you may have confused yourself with so many installs. Open config.php what does $table_prefix =? If phpbb3_ try this

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?

maccas

1:24 pm on Feb 13, 2007 (gmt 0)

10+ Year Member



Another thing you could try is replace functions.php with a unmodified functions.php not sure about this banlist mod you installed, did it involve modifing functions.php?

Jeigh

5:05 am on Feb 14, 2007 (gmt 0)

10+ Year Member



I did that and get the same error message, this is the install instructions for the mod if it helps:
#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE `phpbb_banlist` ADD ban_until INT(11) DEFAULT '0' NOT NULL;

#
#-----[ 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

Jeigh

6:16 am on Feb 15, 2007 (gmt 0)

10+ Year Member



I added somthing I missed into functions.php and now I get this error:

Fatal error: Cannot redeclare prune_banlist() (previously declared in /home/graphics/public_html/forum/includes/functions.php:1012) in /home/graphics/public_html/forum/includes/functions.php on line 1020

maccas

8:49 am on Feb 15, 2007 (gmt 0)

10+ Year Member



Hi Jeigh, I really suggest you backup your database and do a fresh install. It can be quicker starting from scratch than trying to find what you may have missed.

Jeigh

9:05 am on Feb 15, 2007 (gmt 0)

10+ Year Member



I want to but how do I restore a back up through phpmyadmin though? I made a backup through the Admin CP and tryed restoring it through the Admin CP but that's when it all stuffed up :P

maccas

9:36 am on Feb 15, 2007 (gmt 0)

10+ Year Member



To backup through phpmyadmin - select your database and click export at the top of the page.

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.

Jeigh

9:47 am on Feb 15, 2007 (gmt 0)

10+ Year Member



So I should delete that whole database? Just making sure before I do anything and thanks a lot for your help :)

I just restored the backup without deleting anything else but Ive got the same error message.

[edited by: Jeigh at 10:27 am (utc) on Feb. 15, 2007]

maccas

10:29 am on Feb 15, 2007 (gmt 0)

10+ Year Member



You may have to, back it up first though. You will proberby get a error along the lines of error "table **** already exists" when you try and import it.

maccas

10:33 am on Feb 15, 2007 (gmt 0)

10+ Year Member



On a new phpbb install? You have to replace all your phpbb files with new ones, then reinstall all your mods.

Jeigh

10:35 am on Feb 15, 2007 (gmt 0)

10+ Year Member



Ah ok thanks :)