Kód:
## EasyMod 0.0.7 compliant
##############################################################
## MOD Title: Admin ignore board disabled
## MOD Author: Leuchte < mail@leuchte.net > http://www.leuchte.net
## MOD Description: The admin could access the board even if it is disabled.
##
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: 3
common.php, page_header.php, overall_header.tpl
## Included Files: 0
##############################################################
## For Security Purposes, Please Check: http://www.leuchte.net/mods/ for the
## latest version of this MOD.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
## MOD History:
##
## 2004-07-12 - Version 1.0.0
##
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
common.php
#
#-----[ FIND ]------------------------------------------
#
//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
#
#-----[ REPLACE, WITH ]------------------------------------------
#
//
// Show 'Board is disabled' message if needed.
//
$sql = "SELECT u.user_id, u.user_level, s.session_logged_in
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id";
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query user data", "", __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") && !$row['session_logged_in'] && !$row['user_level'] == ADMIN )
{
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
}
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_BOARD_DISABLE' => $lang['Board_disable'],
#
#-----[ FIND ]------------------------------------------
#
$template->pparse('overall_header');
#
#-----[ BEFORE, ADD ]------------------------------------------
#
if ( $board_config['board_disable'] && $userdata['user_level'] == ADMIN )
{
$template->assign_block_vars('switch_admin_disable_board', array());
}
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
# At the bottom of the File
</tr>
</table></td>
</tr>
</table>
<br />
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN switch_admin_disable_board -->
<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center">
<tr>
<td class="forumline" align="center"><span class="gen"><b>{L_BOARD_DISABLE}</b></span></td>
</tr>
</table>
<!-- END switch_admin_disable_board -->
#
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM