Kód:
##############################################################
## MOD Title: Advance Admin Index Stats
## MOD Author: Civphp < civphpbb@civphpbb.net > (Charles Kays) http://www.civphpbb.net
## MOD Description: This Mod adds more statistics to your Admin Index Page
## Adds features like:
## - All the standard phpbb stats
## - Version of phpbb
## - Version of PHP
## - Version of MySQL
## - Number of non-active members
## - Members in need of Activatation
## - Number of Moderators
## - Members with moderator privileges
## - Number of Administrators
## - Members with administrator privileges
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 3 minutes
## Files To Edit: admin/index.php
## language/lang_english/lang_admin.php
## templates/subSilver/admin/index_body.tpl
## Included Files:
##
##############################################################
## 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: Codes in this mod are used (with permission) from PhilippK's DB Maintenance Mod
##
##############################################################
## MOD History:
##
## 2005-03-26 - Version 1.0.0
##
## - First Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
admin/index.php
#
#-----[ FIND ]------------------------------------------
#
"L_GZIP_COMPRESSION" => $lang['Gzip_compression'])
#
#-----[ BEFORE, ADD ]------------------------------------------
#
"L_NUMBER_DEACTIVATED_USERS" => $lang['Thereof_deactivated_users'],
"L_NAME_DEACTIVATED_USERS" => $lang['Deactivated_Users'],
"L_NUMBER_MODERATORS" => $lang['Thereof_Moderators'],
"L_NAME_MODERATORS" => $lang['Users_with_Mod_Privileges'],
"L_NUMBER_ADMINISTRATORS" => $lang['Thereof_Administrators'],
"L_NAME_ADMINISTRATORS" => $lang['Users_with_Admin_Privileges'],
"L_DB_SIZE" => $lang['DB_size'],
"L_PHPBB_VERSION" => $lang['Version_of_board'],
"L_PHP_VERSION" => $lang['Version_of_PHP'],
"L_MYSQL_VERSION" => $lang['Version_of_MySQL'],
#
#-----[ FIND ]------------------------------------------
#
$total_topics = get_db_stat('topiccount');
#
#-----[ AFTER, ADD ]------------------------------------------
#
$sql = "SELECT COUNT(user_id) AS total
FROM " . USERS_TABLE . "
WHERE user_active = 0
AND user_id <> " . ANONYMOUS;
if ( !($result = $db->sql_query($sql)) )
{
throw_error("Couldn't get statistic data!", __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$total_deactivated_users = $row['total'];
}
else
{
throw_error("Couldn't update pending information!", __LINE__, __FILE__, $sql);
}
$db->sql_freeresult($result);
$deactivated_names = '';
$sql = "SELECT username
FROM " . USERS_TABLE . "
WHERE user_active = 0
AND user_id <> " . ANONYMOUS . "
ORDER BY username";
if ( !($result = $db->sql_query($sql)) )
{
throw_error("Couldn't get statistic data!", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$deactivated_names .= (($deactivated_names == '') ? '' : ', ') . $row['username'];
}
$db->sql_freeresult($result);
$sql = "SELECT COUNT(user_id) AS total
FROM " . USERS_TABLE . "
WHERE user_level = " . MOD . "
AND user_id <> " . ANONYMOUS;
if ( !($result = $db->sql_query($sql)) )
{
throw_error("Couldn't get statistic data!", __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$total_moderators = $row['total'];
}
else
{
throw_error("Couldn't update pending information!", __LINE__, __FILE__, $sql);
}
$db->sql_freeresult($result);
$moderator_names = '';
$sql = "SELECT username
FROM " . USERS_TABLE . "
WHERE user_level = " . MOD . "
AND user_id <> " . ANONYMOUS . "
ORDER BY username";
if ( !($result = $db->sql_query($sql)) )
{
throw_error("Couldn't get statistic data!", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$moderator_names .= (($moderator_names == '') ? '' : ', ') . $row['username'];
}
$db->sql_freeresult($result);
$sql = "SELECT COUNT(user_id) AS total
FROM " . USERS_TABLE . "
WHERE user_level = " . ADMIN . "
AND user_id <> " . ANONYMOUS;
if ( !($result = $db->sql_query($sql)) )
{
throw_error("Couldn't get statistic data!", __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$total_administrators = $row['total'];
}
else
{
throw_error("Couldn't update pending information!", __LINE__, __FILE__, $sql);
}
$db->sql_freeresult($result);
$administrator_names = '';
$sql = "SELECT username
FROM " . USERS_TABLE . "
WHERE user_level = " . ADMIN . "
AND user_id <> " . ANONYMOUS . "
ORDER BY username";
if ( !($result = $db->sql_query($sql)) )
{
throw_error("Couldn't get statistic data!", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$administrator_names .= (($administrator_names == '') ? '' : ', ') . $row['username'];
}
#
#-----[ FIND ]------------------------------------------
#
else
{
$dbsize = sprintf("%.2f Bytes", $dbsize);
}
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$sql = "SELECT VERSION() AS mysql_version";
$result = $db->sql_query($sql);
if ( !$result )
{
throw_error("Couldn't obtain MySQL Version", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$mysql_version = $row['mysql_version'];
$db->sql_freeresult($result);
#
#-----[ FIND ]------------------------------------------
#
"GZIP_COMPRESSION" => ( $board_config['gzip_compress'] ) ? $lang['ON'] : $lang['OFF'])
#
#-----[ BEFORE, ADD ]------------------------------------------
#
"PHPBB_VERSION" => '2' . $board_config['version'],
"PHP_VERSION" => phpversion(),
"MYSQL_VERSION" => $mysql_version,
"NUMBER_OF_DEACTIVATED_USERS" => $total_deactivated_users,
"NUMBER_OF_MODERATORS" => $total_moderators,
"NUMBER_OF_ADMINISTRATORS" => $total_administrators,
"NAMES_OF_ADMINISTRATORS" => htmlspecialchars($administrator_names),
"NAMES_OF_MODERATORS" => htmlspecialchars($moderator_names),
"NAMES_OF_DEACTIVATED" => htmlspecialchars($deactivated_names),
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Version_information'] = 'Version Information';
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
//Advance Admin Index
//
$lang['Board_statistic'] = 'Board statistics';
$lang['Database_statistic'] = 'Database statistics';
$lang['Version_info'] = 'Version information';
$lang['Thereof_deactivated_users'] = 'Number of non-active members';
$lang['Thereof_Moderators'] = 'Number of Moderators';
$lang['Thereof_Administrators'] = 'Number of Administrators';
$lang['Deactivated_Users'] = 'Members in need of Activatation';
$lang['Users_with_Admin_Privileges'] = 'Members with administrator privileges';
$lang['Users_with_Mod_Privileges'] = 'Members with moderator privileges';
$lang['DB_size'] = 'Size of the database';
$lang['Version_of_board'] = 'Version of <a href="http://www.phpbb.com">phpbb</a>';
$lang['Version_of_PHP'] = 'Version of <a href="http://www.php.net/">PHP</a>';
$lang['Version_of_MySQL'] = 'Version of <a href="http://www.mysql.com/">MySQL</a>';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<th width="25%" nowrap height="25" class="thCornerL">{L_STATISTIC}</th>
<th width="25%" height="25" class="thTop">{L_VALUE}</th>
<th width="25%" nowrap height="25" class="thTop">{L_STATISTIC}</th>
<th width="25%" height="25" class="thCornerR">{L_VALUE}</th>
</tr>
<tr>
<td class="row1" nowrap>{L_NUMBER_POSTS}:</td>
<td class="row2"><b>{NUMBER_OF_POSTS}</b></td>
<td class="row1" nowrap>{L_POSTS_PER_DAY}:</td>
<td class="row2"><b>{POSTS_PER_DAY}</b></td>
</tr>
<tr>
<td class="row1" nowrap>{L_NUMBER_TOPICS}:</td>
<td class="row2"><b>{NUMBER_OF_TOPICS}</b></td>
<td class="row1" nowrap>{L_TOPICS_PER_DAY}:</td>
<td class="row2"><b>{TOPICS_PER_DAY}</b></td>
</tr>
<tr>
<td class="row1" nowrap>{L_NUMBER_USERS}:</td>
<td class="row2"><b>{NUMBER_OF_USERS}</b></td>
<td class="row1" nowrap>{L_USERS_PER_DAY}:</td>
<td class="row2"><b>{USERS_PER_DAY}</b></td>
</tr>
<tr>
<td class="row1" nowrap>{L_BOARD_STARTED}:</td>
<td class="row2"><b>{START_DATE}</b></td>
<td class="row1" nowrap>{L_AVATAR_DIR_SIZE}:</td>
<td class="row2"><b>{AVATAR_DIR_SIZE}</b></td>
</tr>
<tr>
<td class="row1" nowrap>{L_DB_SIZE}:</td>
<td class="row2"><b>{DB_SIZE}</b></td>
<td class="row1" nowrap>{L_GZIP_COMPRESSION}:</td>
<td class="row2"><b>{GZIP_COMPRESSION}</b></td>
</tr>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<tr>
<th width="25%" nowrap height="25" class="thCornerL" colspan="3">{L_STATISTIC}</th>
<th width="25%" height="25" class="thTop">{L_VALUE}</th>
<th width="25%" nowrap height="25" class="thTop">{L_STATISTIC}</th>
<th width="25%" height="25" class="thCornerR">{L_VALUE}</th>
</tr>
<tr>
<td class="row1" nowrap colspan="3">{L_PHPBB_VERSION}:</td>
<td class="row2" colspan="3"><b>{PHPBB_VERSION}</b></td>
</tr>
<tr>
<td class="row1" nowrap colspan="3">{L_PHP_VERSION}:</td>
<td class="row2"><b>{PHP_VERSION}</b></td>
<td class="row1" nowrap>{L_MYSQL_VERSION}:</td>
<td class="row2"><b>{MYSQL_VERSION}</b></td>
</tr>
<tr>
<td class="row1" nowrap colspan="3">{L_BOARD_STARTED}:</td>
<td class="row2"><b>{START_DATE}</b></td>
<td class="row1" nowrap>{L_AVATAR_DIR_SIZE}:</td>
<td class="row2"><b>{AVATAR_DIR_SIZE}</b></td>
</tr>
<tr>
<td class="row1" nowrap colspan="3">{L_DB_SIZE}:</td>
<td class="row2"><b>{DB_SIZE}</b></td>
<td class="row1" nowrap>{L_GZIP_COMPRESSION}:</td>
<td class="row2"><b>{GZIP_COMPRESSION}</b></td>
</tr>
<tr>
<td class="row1" nowrap colspan="3">{L_NUMBER_POSTS}:</td>
<td class="row2"><b>{NUMBER_OF_POSTS}</b></td>
<td class="row1" nowrap>{L_POSTS_PER_DAY}:</td>
<td class="row2"><b>{POSTS_PER_DAY}</b></td>
</tr>
<tr>
<td class="row1" nowrap colspan="3">{L_NUMBER_TOPICS}:</td>
<td class="row2"><b>{NUMBER_OF_TOPICS}</b></td>
<td class="row1" nowrap>{L_TOPICS_PER_DAY}:</td>
<td class="row2"><b>{TOPICS_PER_DAY}</b></td>
</tr>
<tr>
<td class="row1" nowrap colspan="3">{L_NUMBER_USERS}:</td>
<td class="row2"><b>{NUMBER_OF_USERS}</b></td>
<td class="row1" nowrap>{L_USERS_PER_DAY}:</td>
<td class="row2"><b>{USERS_PER_DAY}</b></td>
</tr>
<tr>
<td class="row3" nowrap width="10"> </td>
<td class="row1" nowrap colspan="2">{L_NUMBER_DEACTIVATED_USERS}:</td>
<td class="row2" colspan="3">{NUMBER_OF_DEACTIVATED_USERS}</td>
</tr>
<tr>
<td class="row3" nowrap width="10"> </td>
<td class="row3" nowrap width="10"> </td>
<td class="row1" nowrap>{L_NAME_DEACTIVATED_USERS}:</td>
<td class="row2" colspan="3">{NAMES_OF_DEACTIVATED}</td>
</tr>
<tr>
<td class="row3" nowrap width="10"> </td>
<td class="row1" nowrap colspan="2">{L_NUMBER_MODERATORS}:</td>
<td class="row2" colspan="3">{NUMBER_OF_MODERATORS}</td>
</tr>
<tr>
<td class="row3" nowrap width="10"> </td>
<td class="row3" nowrap width="10"> </td>
<td class="row1" nowrap>{L_NAME_MODERATORS}:</td>
<td class="row2" colspan="3">{NAMES_OF_MODERATORS}</td>
</tr>
<tr>
<td class="row3" nowrap width="10"> </td>
<td class="row1" nowrap colspan="2">{L_NUMBER_ADMINISTRATORS}:</td>
<td class="row2" colspan="3">{NUMBER_OF_ADMINISTRATORS}</td>
</tr>
<tr>
<td class="row3" nowrap width="10"> </td>
<td class="row3" nowrap width="10"> </td>
<td class="row1" nowrap>{L_NAME_ADMINISTRATORS}:</td>
<td class="row2" colspan="3">{NAMES_OF_ADMINISTRATORS}</td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM