ой люди, зачем плодить одни и те же моды?
Код: Выделить всё
##############################################################
## MOD Title: Admins can Use a Disabled Board
## MOD Author: Prent < prent@milkohol.net > (n/a) n/a
## MOD Description: Admins can still use a board that is disabled to users.
##
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: common.php
## includes/sessions.php
## includes/page_header.php
## templates/subSilver/overall_header.tpl
##
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This file is for users who have not installed the Disabled Board Message MOD
## and have are installing this mod for the first time.
##
##############################################################
## MOD History:
##
## 2005-07-06 - Version 1.0.1
## - Fixed bug where users and guests could see the board when starting a session.
## - Included version for users of Disabled Board Message MOD (thanks Fountain of Apples)
## - Fixed syntax of this file for common.php
## 2005-06-30 - Version 1.0.0
## - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
common.php
#
#-----[ FIND ]------------------------------------------
#
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
#
#-----[ BEFORE, ADD ]------------------------------------------
#
/*
#
#-----[ FIND ]------------------------------------------
#
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
*/
#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
$login = 0;
$enable_autologin = 0;
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") && !defined("HAS_DIED") && ($userdata['user_level'] != ADMIN) )
{
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
#
#-----[ FIND ]------------------------------------------
#
message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
}
$userdata = $db->sql_fetchrow($result);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Show 'Board is disabled' message if needed, if not in admin panel, if not logging in,
// if message_die() hasn't been called yet, and if user is not an admin
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") && !defined("HAS_DIED") && ($userdata['user_level'] != ADMIN) )
{
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('switch_enable_pm_popup', array());
}
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// If disabled and admin, show Reminder Box below header.
if ( $board_config['board_disable'] && $userdata['user_level'] == ADMIN )
{
$template->set_filenames(array('board_disabled_box' => 'error_body.tpl'));
$template->assign_vars(array('ERROR_MESSAGE' => $lang['Board_disable']));
$template->assign_var_from_handle('BOARD_DISABLE_MSG', 'board_disabled_box');
}
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
<br />
#
#-----[ AFTER, ADD ]------------------------------------------
#
{BOARD_DISABLE_MSG}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Код: Выделить всё
## 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