2003-03-13 12:14:48 +00:00
< ? php
2003-08-22 00:28:45 +00:00
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : adm/index.php
// STARTED : Sat Feb 13, 2001
// COPYRIGHT : <20> 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
define ( 'IN_PHPBB' , 1 );
2003-03-13 12:14:48 +00:00
// Include files
2004-03-06 17:43:32 +00:00
$phpbb_root_path = './../' ;
2003-09-07 16:52:51 +00:00
$phpEx = substr ( strrchr ( __FILE__ , '.' ), 1 );
2003-03-13 12:14:48 +00:00
require ( 'pagestart.' . $phpEx );
// Do we have any admin permissions at all?
if ( ! $auth -> acl_get ( 'a_' ))
{
trigger_error ( $user -> lang [ 'NO_ADMIN' ]);
}
2003-08-24 18:16:53 +00:00
// Define some vars
2003-10-21 00:16:05 +00:00
$pane = request_var ( 'pane' , '' );
2003-08-24 18:16:53 +00:00
2003-03-13 12:14:48 +00:00
// Generate relevant output
2003-08-22 00:28:45 +00:00
if ( $pane == 'top' )
2003-03-13 12:14:48 +00:00
{
2003-05-03 23:58:45 +00:00
adm_page_header ( '' , '' , false );
2003-03-13 12:14:48 +00:00
?>
< table width = " 100% " cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >
< tr >
2004-03-06 17:43:32 +00:00
< td >< a href = " <?php echo " { $phpbb_root_path } index . $phpEx $SID " ; ?> " target = " _top " >< img src = " images/header_left.jpg " width = " 200 " height = " 60 " alt = " phpBB Logo " title = " phpBB Logo " border = " 0 " /></ a ></ td >
2003-03-13 12:14:48 +00:00
< td width = " 100% " background = " images/header_bg.jpg " height = " 60 " align = " right " nowrap = " nowrap " >< span class = " maintitle " >< ? php echo $user -> lang [ 'ADMIN_TITLE' ]; ?> </span> </td>
</ tr >
</ table >
< ? php
2003-05-03 23:58:45 +00:00
adm_page_footer ( false );
2003-03-13 12:14:48 +00:00
}
2003-08-22 00:28:45 +00:00
else if ( $pane == 'left' )
2003-03-13 12:14:48 +00:00
{
// Cheat and use the meta tag to change some stylesheet info
2003-05-03 23:58:45 +00:00
adm_page_header ( '' , '<style type="text/css">body {background-color: #98AAB1}</style>' , false );
2003-03-13 12:14:48 +00:00
// Grab module information using Bart's "neat-o-module" system (tm)
$dir = @ opendir ( '.' );
$setmodules = 1 ;
2003-10-21 00:16:05 +00:00
while ( $file = readdir ( $dir ))
2003-03-13 12:14:48 +00:00
{
if ( preg_match ( '#^admin_(.*?)\.' . $phpEx . '$#' , $file ))
{
include ( $file );
}
}
@ closedir ( $dir );
unset ( $setmodules );
?>
< table width = " 100% " cellpadding = " 0 " cellspacing = " 0 " border = " 0 " >
< tr >
< td width = " 100% " >< table width = " 100% " cellpadding = " 4 " cellspacing = " 1 " border = " 0 " >
< tr >
< th class = " menu " height = " 25 " >& #0187; <?php echo $user->lang['RETURN_TO']; ?></th>
</ tr >
< tr >
2003-08-22 00:28:45 +00:00
< td class = " row1 " >< a class = " genmed " href = " <?php echo " index . $phpEx $SID " ; ?>&pane=right " target = " main " >< ? php echo $user -> lang [ 'ADMIN_INDEX' ]; ?> </a></td>
2003-03-13 12:14:48 +00:00
</ tr >
< tr >
2003-08-22 00:28:45 +00:00
< td class = " row2 " >< a class = " genmed " href = " <?php echo " ../ index . $phpEx $SID " ; ?> " target = " _top " >< ? php echo $user -> lang [ 'FORUM_INDEX' ]; ?> </a></td>
2003-03-13 12:14:48 +00:00
</ tr >
< ? php
if ( is_array ( $module ))
{
@ ksort ( $module );
foreach ( $module as $cat => $action_ary )
{
$cat = ( ! empty ( $user -> lang [ $cat . '_CAT' ])) ? $user -> lang [ $cat . '_CAT' ] : preg_replace ( '#_#' , ' ' , $cat );
?>
< tr >
< th class = " menu " height = " 25 " >& #0187; <?php echo $cat; ?></th>
</ tr >
< ? php
@ ksort ( $action_ary );
2003-04-24 18:24:53 +00:00
$row_class = '' ;
2003-03-13 12:14:48 +00:00
foreach ( $action_ary as $action => $file )
{
if ( ! empty ( $file ))
{
2003-10-21 00:16:05 +00:00
$action = ( ! empty ( $user -> lang [ $action ])) ? $user -> lang [ $action ] : preg_replace ( '#_#' , ' ' , $action );
2003-03-13 12:14:48 +00:00
$row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1' ;
?>
< tr >
< td class = " <?php echo $row_class ; ?> " >< a class = " genmed " href = " <?php echo $file ; ?> " target = " main " >< ? php echo $action ; ?> </a></td>
</ tr >
< ? php
}
}
}
}
?>
</ table ></ td >
</ tr >
</ table >
</ body >
</ html >
< ? php
// Output footer but don't include copyright info
2003-05-03 23:58:45 +00:00
adm_page_footer ( false );
2003-03-13 12:14:48 +00:00
}
2003-08-22 00:28:45 +00:00
elseif ( $pane == 'right' )
2003-03-13 12:14:48 +00:00
{
2003-10-21 00:16:05 +00:00
$action = request_var ( 'action' , '' );
2004-05-26 18:55:28 +00:00
$mark = ( isset ( $_REQUEST [ 'mark' ])) ? implode ( ', ' , request_var ( 'mark' , 0 )) : '' ;
2003-10-12 15:29:18 +00:00
2003-10-21 00:16:05 +00:00
if ( $mark )
2003-03-13 12:14:48 +00:00
{
2003-10-21 00:16:05 +00:00
switch ( $action )
2003-03-13 12:14:48 +00:00
{
2003-10-21 00:16:05 +00:00
case 'activate' :
case 'delete' :
if ( ! $auth -> acl_get ( 'a_user' ))
{
trigger_error ( $user -> lang [ 'NO_ADMIN' ]);
}
2003-03-13 12:14:48 +00:00
2003-10-21 00:16:05 +00:00
$sql = ( $action == 'activate' ) ? 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_NORMAL . " WHERE user_id IN ( $mark ) " : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ( $mark ) " ;
$db -> sql_query ( $sql );
2003-03-13 12:14:48 +00:00
2003-10-21 00:16:05 +00:00
if ( ! $delete )
{
2005-02-02 13:14:46 +00:00
set_config ( 'num_users' , $config [ 'num_users' ] + $db -> sql_affectedrows (), true );
2003-10-21 00:16:05 +00:00
}
2003-10-12 15:29:18 +00:00
2003-10-21 00:16:05 +00:00
$log_action = ( $activate ) ? 'log_index_activate' : 'log_index_delete' ;
2005-02-02 13:14:46 +00:00
add_log ( 'admin' , $log_action , $db -> sql_affectedrows ());
2003-10-21 00:16:05 +00:00
break ;
2003-03-25 14:21:56 +00:00
2003-10-21 00:16:05 +00:00
case 'remind' :
if ( ! $auth -> acl_get ( 'a_user' ))
{
trigger_error ( $user -> lang [ 'NO_ADMIN' ]);
}
2003-03-25 14:21:56 +00:00
2003-10-21 00:16:05 +00:00
if ( empty ( $config [ 'email_enable' ]))
{
trigger_error ( $user -> lang [ 'EMAIL_DISABLED' ]);
}
2003-10-12 15:29:18 +00:00
2005-02-02 13:14:46 +00:00
$sql = ' SELECT user_id , username , user_email , user_lang , user_jabber , user_notify_type , user_regdate , user_actkey
2003-10-21 00:16:05 +00:00
FROM ' . USERS_TABLE . "
WHERE user_id IN ( $mark ) " ;
$result = $db -> sql_query ( $sql );
2003-10-12 15:29:18 +00:00
2003-10-21 00:16:05 +00:00
if ( $row = $db -> sql_fetchrow ( $result ))
{
// Send the messages
include_once ( $phpbb_root_path . 'includes/functions_messenger.' . $phpEx );
2003-03-25 14:21:56 +00:00
2003-10-21 00:16:05 +00:00
$messenger = new messenger ();
2003-10-12 15:29:18 +00:00
2003-10-21 00:16:05 +00:00
$board_url = generate_board_url () . " /ucp. $phpEx ?mode=activate " ;
$sig = str_replace ( '<br />' , " \n " , " -- \n " . $config [ 'board_email_sig' ]);
2003-03-25 14:21:56 +00:00
2003-10-21 00:16:05 +00:00
$usernames = array ();
do
{
$messenger -> template ( 'user_remind_inactive' , $row [ 'user_lang' ]);
2003-03-25 14:21:56 +00:00
2003-10-21 00:16:05 +00:00
$messenger -> replyto ( $config [ 'board_email' ]);
$messenger -> to ( $row [ 'user_email' ], $row [ 'username' ]);
$messenger -> im ( $row [ 'user_jabber' ], $row [ 'username' ]);
2003-03-25 14:21:56 +00:00
2003-10-21 00:16:05 +00:00
$messenger -> assign_vars ( array (
'EMAIL_SIG' => $sig ,
'USERNAME' => $row [ 'username' ],
'SITENAME' => $config [ 'sitename' ],
'REGISTER_DATE' => $user -> format_date ( $row [ 'user_regdate' ]),
'U_ACTIVATE' => " $board_url &mode=activate&u= " . $row [ 'user_id' ] . '&k=' . $row [ 'user_actkey' ])
);
2003-03-25 14:21:56 +00:00
2003-10-21 00:16:05 +00:00
$messenger -> send ( $row [ 'user_notify_type' ]);
2003-10-12 15:29:18 +00:00
2003-10-21 00:16:05 +00:00
$usernames [] = $row [ 'username' ];
}
while ( $row = $db -> sql_fetchrow ( $result ));
2003-10-12 15:29:18 +00:00
2005-02-02 13:14:46 +00:00
if ( $messenger -> queue )
{
$messenger -> queue -> save ();
}
2003-10-21 00:16:05 +00:00
unset ( $email_list );
add_log ( 'admin' , 'LOG_INDEX_REMIND' , implode ( ', ' , $usernames ));
unset ( $usernames );
}
$db -> sql_freeresult ( $result );
break ;
2003-03-25 14:21:56 +00:00
}
2003-03-24 19:03:16 +00:00
}
2003-03-13 12:14:48 +00:00
2003-10-21 00:16:05 +00:00
switch ( $action )
2003-03-13 12:14:48 +00:00
{
2003-10-21 00:16:05 +00:00
case 'online' :
if ( ! $auth -> acl_get ( 'a_defaults' ))
{
trigger_error ( $user -> lang [ 'NO_ADMIN' ]);
}
2003-03-24 19:03:16 +00:00
2003-11-16 21:53:56 +00:00
set_config ( 'record_online_users' , 1 , true );
set_config ( 'record_online_date' , time (), true );
2003-10-21 00:16:05 +00:00
add_log ( 'admin' , 'LOG_RESET_ONLINE' );
break ;
2003-03-24 19:03:16 +00:00
2003-10-21 00:16:05 +00:00
case 'stats' :
if ( ! $auth -> acl_get ( 'a_defaults' ))
{
trigger_error ( $user -> lang [ 'NO_ADMIN' ]);
}
2003-03-24 19:03:16 +00:00
2003-10-21 00:16:05 +00:00
$sql = ' SELECT COUNT ( post_id ) AS stat
FROM ' . POSTS_TABLE . '
WHERE post_approved = 1 ' ;
$result = $db -> sql_query ( $sql );
2003-03-24 19:03:16 +00:00
2003-10-21 00:16:05 +00:00
$row = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2003-11-16 21:53:56 +00:00
set_config ( 'num_posts' , ( int ) $row [ 'stat' ], true );
2003-03-13 12:14:48 +00:00
2003-10-21 00:16:05 +00:00
$sql = ' SELECT COUNT ( topic_id ) AS stat
FROM ' . TOPICS_TABLE . '
WHERE topic_approved = 1 ' ;
$result = $db -> sql_query ( $sql );
2003-03-24 19:03:16 +00:00
2003-10-21 00:16:05 +00:00
$row = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2003-11-16 21:53:56 +00:00
set_config ( 'num_topics' , ( int ) $row [ 'stat' ], true );
2003-03-24 19:03:16 +00:00
2003-10-21 00:16:05 +00:00
$sql = ' SELECT COUNT ( user_id ) AS stat
FROM ' . USERS_TABLE . '
WHERE user_type IN ( ' . USER_NORMAL . ' , ' . USER_FOUNDER . ' ) ' ;
$result = $db -> sql_query ( $sql );
$row = $db -> sql_fetchrow ( $result );
$db -> sql_freeresult ( $result );
2003-11-16 21:53:56 +00:00
set_config ( 'num_users' , ( int ) $row [ 'stat' ], true );
$sql = ' SELECT COUNT ( attach_id ) as stat
FROM ' . ATTACHMENTS_TABLE ;
$result = $db -> sql_query ( $sql );
set_config ( 'num_files' , ( int ) $db -> sql_fetchfield ( 'stat' , 0 , $result ), true );
$db -> sql_freeresult ( $result );
$sql = ' SELECT SUM ( filesize ) as stat
FROM ' . ATTACHMENTS_TABLE ;
$result = $db -> sql_query ( $sql );
set_config ( 'upload_dir_size' , ( int ) $db -> sql_fetchfield ( 'stat' , 0 , $result ), true );
$db -> sql_freeresult ( $result );
2003-10-21 00:16:05 +00:00
add_log ( 'admin' , 'LOG_RESYNC_STATS' );
break ;
2005-01-02 19:12:14 +00:00
// TODO: Temporary or a useful function?
case 'user' :
if ( ! $auth -> acl_get ( 'a_defaults' ))
{
trigger_error ( $user -> lang [ 'NO_ADMIN' ]);
}
$post_count_ary = $auth -> acl_getf ( 'f_postcount' );
$forum_ary = array ();
foreach ( $post_count_ary as $forum_id => $allowed )
{
if ( $allowed [ 'f_read' ] && $allowed [ 'f_postcount' ])
{
$forum_ary [] = $forum_id ;
}
}
$post_count_sql = ( sizeof ( $forum_ary )) ? 'AND f.forum_id IN (' . implode ( ', ' , $forum_ary ) . ')' : '' ;
unset ( $forum_ary , $post_count_ary );
$sql = 'SELECT user_id FROM ' . USERS_TABLE . '
WHERE user_type NOT IN ( ' . USER_INACTIVE . ' ) ' ;
$result = $db -> sql_query ( $sql );
while ( $user_row = $db -> sql_fetchrow ( $result ))
{
$user_id = ( int ) $user_row [ 'user_id' ];
$sql = ' SELECT COUNT ( p . post_id ) AS num_posts
FROM ' . POSTS_TABLE . ' p , ' . FORUMS_TABLE . ' f
WHERE p . poster_id = ' . $user_id . "
AND f . forum_id = p . forum_id
$post_count_sql " ;
$result2 = $db -> sql_query ( $sql );
$num_real_posts = ( int ) $db -> sql_fetchfield ( 'num_posts' , 0 , $result2 );
$db -> sql_freeresult ( $result2 );
$db -> sql_query ( 'UPDATE ' . USERS_TABLE . " SET user_posts = $num_real_posts WHERE user_id = $user_id " );
}
$db -> sql_freeresult ( $result );
add_log ( 'admin' , 'LOG_RESYNC_USER' );
break ;
2003-10-21 00:16:05 +00:00
case 'date' :
if ( ! $auth -> acl_get ( 'a_defaults' ))
{
trigger_error ( $user -> lang [ 'NO_ADMIN' ]);
}
2003-03-24 19:03:16 +00:00
2003-11-16 21:53:56 +00:00
set_config ( 'board_startdate' , time () - 1 , true );
2003-10-21 00:16:05 +00:00
add_log ( 'admin' , 'LOG_RESET_DATE' );
break ;
2003-03-13 12:14:48 +00:00
}
// Get forum statistics
$total_posts = $config [ 'num_posts' ];
$total_topics = $config [ 'num_topics' ];
$total_users = $config [ 'num_users' ];
2003-11-16 21:53:56 +00:00
$total_files = $config [ 'num_files' ];
2003-03-13 12:14:48 +00:00
$start_date = $user -> format_date ( $config [ 'board_startdate' ]);
$boarddays = ( time () - $config [ 'board_startdate' ]) / 86400 ;
$posts_per_day = sprintf ( '%.2f' , $total_posts / $boarddays );
$topics_per_day = sprintf ( '%.2f' , $total_topics / $boarddays );
$users_per_day = sprintf ( '%.2f' , $total_users / $boarddays );
2003-11-16 21:53:56 +00:00
$files_per_day = sprintf ( '%.2f' , $total_files / $boarddays );
$upload_dir_size = ( $config [ 'upload_dir_size' ] >= 1048576 ) ? sprintf ( '%.2f ' . $user -> lang [ 'MB' ], ( $config [ 'upload_dir_size' ] / 1048576 )) : (( $config [ 'upload_dir_size' ] >= 1024 ) ? sprintf ( '%.2f ' . $user -> lang [ 'KB' ], ( $config [ 'upload_dir_size' ] / 1024 )) : sprintf ( '%.2f ' . $user -> lang [ 'BYTES' ], $config [ 'upload_dir_size' ]));
2003-03-13 12:14:48 +00:00
$avatar_dir_size = 0 ;
if ( $avatar_dir = @ opendir ( $phpbb_root_path . $config [ 'avatar_path' ]))
{
2003-10-21 00:16:05 +00:00
while ( $file = readdir ( $avatar_dir ))
2003-03-13 12:14:48 +00:00
{
2003-10-21 00:16:05 +00:00
if ( $file { 0 } != '.' )
2003-03-13 12:14:48 +00:00
{
2003-10-21 00:16:05 +00:00
$avatar_dir_size += filesize ( $phpbb_root_path . $config [ 'avatar_path' ] . '/' . $file );
2003-03-13 12:14:48 +00:00
}
}
@ closedir ( $avatar_dir );
// This bit of code translates the avatar directory size into human readable format
// Borrowed the code from the PHP.net annoted manual, origanally written by:
// Jesse (jesse@jess.on.ca)
2003-11-16 21:53:56 +00:00
$avatar_dir_size = ( $avatar_dir_size >= 1048576 ) ? sprintf ( '%.2f ' . $user -> lang [ 'MB' ], ( $avatar_dir_size / 1048576 )) : (( $avatar_dir_size >= 1024 ) ? sprintf ( '%.2f ' . $user -> lang [ 'KB' ], ( $avatar_dir_size / 1024 )) : sprintf ( '%.2f ' . $user -> lang [ 'BYTES' ], $avatar_dir_size ));
2003-03-13 12:14:48 +00:00
}
else
{
// Couldn't open Avatar dir.
2003-10-21 00:16:05 +00:00
$avatar_dir_size = $user -> lang [ 'NOT_AVAILABLE' ];
2003-03-13 12:14:48 +00:00
}
if ( $posts_per_day > $total_posts )
{
$posts_per_day = $total_posts ;
}
if ( $topics_per_day > $total_topics )
{
$topics_per_day = $total_topics ;
}
if ( $users_per_day > $total_users )
{
$users_per_day = $total_users ;
}
2003-11-16 21:53:56 +00:00
if ( $files_per_day > $total_files )
{
$files_per_day = $total_files ;
}
2003-03-13 12:14:48 +00:00
// DB size ... MySQL only
// This code is heavily influenced by a similar routine
// in phpMyAdmin 2.2.0
2003-10-12 15:29:18 +00:00
if ( preg_match ( '#^mysql#' , SQL_LAYER ))
2003-03-13 12:14:48 +00:00
{
$result = $db -> sql_query ( 'SELECT VERSION() AS mysql_version' );
if ( $row = $db -> sql_fetchrow ( $result ))
{
$version = $row [ 'mysql_version' ];
if ( preg_match ( '#^(3\.23|4\.)#' , $version ))
{
$db_name = ( preg_match ( '#^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)#' , $version )) ? " ` $dbname ` " : $dbname ;
$sql = " SHOW TABLE STATUS
FROM " . $db_name ;
$result = $db -> sql_query ( $sql );
$dbsize = 0 ;
while ( $row = $db -> sql_fetchrow ( $result ))
{
2005-01-02 19:12:14 +00:00
if (( isset ( $row [ 'Type' ]) && $row [ 'Type' ] != 'MRG_MyISAM' ) || ( isset ( $row [ 'Engine' ]) && $row [ 'Engine' ] == 'MyISAM' ))
2003-03-13 12:14:48 +00:00
{
if ( $table_prefix != '' )
{
if ( strstr ( $row [ 'Name' ], $table_prefix ))
{
$dbsize += $row [ 'Data_length' ] + $row [ 'Index_length' ];
}
}
else
{
$dbsize += $row [ 'Data_length' ] + $row [ 'Index_length' ];
}
}
}
}
else
{
2003-07-04 17:22:18 +00:00
$dbsize = $user -> lang [ 'NOT_AVAILABLE' ];
2003-03-13 12:14:48 +00:00
}
}
else
{
2003-07-04 17:22:18 +00:00
$dbsize = $user -> lang [ 'NOT_AVAILABLE' ];
2003-03-13 12:14:48 +00:00
}
}
else if ( preg_match ( '#^mssql#' , SQL_LAYER ))
{
2003-10-12 15:29:18 +00:00
$sql = ' SELECT (( SUM ( size ) * 8.0 ) * 1024.0 ) as dbsize
FROM sysfiles ' ;
2003-03-13 12:14:48 +00:00
$result = $db -> sql_query ( $sql );
2003-07-04 17:22:18 +00:00
$dbsize = ( $row = $db -> sql_fetchrow ( $result )) ? intval ( $row [ 'dbsize' ]) : $user -> lang [ 'NOT_AVAILABLE' ];
2003-03-13 12:14:48 +00:00
}
else
{
2003-05-02 15:50:11 +00:00
$dbsize = $user -> lang [ 'NOT_AVAILABLE' ];
2003-03-13 12:14:48 +00:00
}
if ( is_int ( $dbsize ))
{
2003-11-16 21:53:56 +00:00
$dbsize = ( $dbsize >= 1048576 ) ? sprintf ( '%.2f ' . $user -> lang [ 'MB' ], ( $dbsize / 1048576 )) : (( $dbsize >= 1024 ) ? sprintf ( '%.2f ' . $user -> lang [ 'KB' ], ( $dbsize / 1024 )) : sprintf ( '%.2f ' . $user -> lang [ 'BYTES' ], $dbsize ));
2003-03-13 12:14:48 +00:00
}
2003-05-03 23:58:45 +00:00
adm_page_header ( $user -> lang [ 'ADMIN_INDEX' ]);
2003-03-13 12:14:48 +00:00
?>
< script language = " Javascript " type = " text/javascript " >
<!--
function marklist ( status )
{
for ( i = 0 ; i < document . inactive . length ; i ++ )
{
document . inactive . elements [ i ] . checked = status ;
}
}
//-->
</ script >
< h1 >< ? php echo $user -> lang [ 'WELCOME_PHPBB' ]; ?> </h1>
< p >< ? php echo $user -> lang [ 'ADMIN_INTRO' ]; ?> </p>
< h1 >< ? php echo $user -> lang [ 'FORUM_STATS' ]; ?> </h1>
2003-03-24 19:03:16 +00:00
< form name = " statistics " method = " post " action = " index.<?php echo $phpEx . $SID ; ?>&pane=right " >< table class = " bg " width = " 100% " cellpadding = " 4 " cellspacing = " 1 " border = " 0 " >
2003-03-13 12:14:48 +00:00
< tr >
< th width = " 25% " nowrap = " nowrap " height = " 25 " >< ? php echo $user -> lang [ 'STATISTIC' ]; ?> </th>
< th width = " 25% " >< ? php echo $user -> lang [ 'VALUE' ]; ?> </th>
< th width = " 25% " nowrap = " nowrap " >< ? php echo $user -> lang [ 'STATISTIC' ]; ?> </th>
< th width = " 25% " >< ? php echo $user -> lang [ 'VALUE' ]; ?> </th>
</ tr >
< tr >
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'NUMBER_POSTS' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $total_posts ; ?> </b></td>
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'POSTS_PER_DAY' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $posts_per_day ; ?> </b></td>
</ tr >
< tr >
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'NUMBER_TOPICS' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $total_topics ; ?> </b></td>
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'TOPICS_PER_DAY' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $topics_per_day ; ?> </b></td>
</ tr >
< tr >
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'NUMBER_USERS' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $total_users ; ?> </b></td>
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'USERS_PER_DAY' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $users_per_day ; ?> </b></td>
</ tr >
2003-11-16 21:53:56 +00:00
< tr >
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'NUMBER_FILES' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $total_files ; ?> </b></td>
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'FILES_PER_DAY' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $files_per_day ; ?> </b></td>
</ tr >
2003-03-13 12:14:48 +00:00
< tr >
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'BOARD_STARTED' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $start_date ; ?> </b></td>
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'AVATAR_DIR_SIZE' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $avatar_dir_size ; ?> </b></td>
</ tr >
< tr >
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'DATABASE_SIZE' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $dbsize ; ?> </b></td>
2003-11-16 21:53:56 +00:00
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'UPLOAD_DIR_SIZE' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo $upload_dir_size ; ?> </b></td>
</ tr >
< tr >
2003-03-13 12:14:48 +00:00
< td class = " row1 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'GZIP_COMPRESSION' ]; ?> :</td>
< td class = " row2 " >< b >< ? php echo ( $config [ 'gzip_compress' ]) ? $user -> lang [ 'ON' ] : $user -> lang [ 'OFF' ]; ?> </b></td>
2003-11-16 21:53:56 +00:00
< td class = " row1 " nowrap = " nowrap " >& nbsp ; </ td >
< td class = " row2 " >& nbsp ; </ td >
2003-03-13 12:14:48 +00:00
</ tr >
2003-03-24 19:03:16 +00:00
< tr >
2005-01-02 19:12:14 +00:00
< td class = " cat " colspan = " 4 " align = " right " >< select name = " action " >< option value = " online " >< ? php echo $user -> lang [ 'RESET_ONLINE' ]; ?> </option><option value="date"><?php echo $user->lang['RESET_DATE']; ?></option><option value="stats"><?php echo $user->lang['RESYNC_STATS']; ?></option>
<!-- option value = " user " >< ? php echo $user -> lang [ 'RESYNC_USER_POSTS' ]; ?> </option -->
</ select > < input class = " btnlite " type = " submit " name = " submit " value = " <?php echo $user->lang ['SUBMIT']; ?> " />& nbsp ; </ td >
2003-03-24 19:03:16 +00:00
</ tr >
</ table ></ form >
2003-03-13 12:14:48 +00:00
< h1 >< ? php echo $user -> lang [ 'ADMIN_LOG' ]; ?> </h1>
< p >< ? php echo $user -> lang [ 'ADMIN_LOG_INDEX_EXPLAIN' ]; ?> </p>
< table class = " bg " width = " 100% " cellpadding = " 4 " cellspacing = " 1 " border = " 0 " >
< tr >
< th width = " 15% " height = " 25 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'USERNAME' ]; ?> </th>
< th width = " 15% " >< ? php echo $user -> lang [ 'IP' ]; ?> </th>
< th width = " 20% " >< ? php echo $user -> lang [ 'TIME' ]; ?> </th>
< th width = " 45% " nowrap = " nowrap " >< ? php echo $user -> lang [ 'ACTION' ]; ?> </th>
</ tr >
< ? php
view_log ( 'admin' , $log_data , $log_count , 5 );
2004-05-02 13:06:57 +00:00
$row_class = 'row2' ;
2003-03-13 12:14:48 +00:00
for ( $i = 0 ; $i < sizeof ( $log_data ); $i ++ )
{
$row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1' ;
?>
< tr >
< td class = " <?php echo $row_class ; ?> " >< ? php echo $log_data [ $i ][ 'username' ]; ?> </td>
< td class = " <?php echo $row_class ; ?> " align = " center " >< ? php echo $log_data [ $i ][ 'ip' ]; ?> </td>
< td class = " <?php echo $row_class ; ?> " align = " center " >< ? php echo $user -> format_date ( $log_data [ $i ][ 'time' ]); ?> </td>
< td class = " <?php echo $row_class ; ?> " >< ? php echo $log_data [ $i ][ 'action' ]; ?> </td>
</ tr >
< ? php
}
if ( $auth -> acl_get ( 'a_user' ))
{
?>
</ table >
< h1 >< ? php echo $user -> lang [ 'INACTIVE_USERS' ]; ?> </h1>
< p >< ? php echo $user -> lang [ 'INACTIVE_USERS_EXPLAIN' ]; ?> </p>
< form method = " post " name = " inactive " action = " <?php echo " index . $phpEx $SID & amp ; pane = right " ; ?> " >< table class = " bg " width = " 100% " cellpadding = " 4 " cellspacing = " 1 " border = " 0 " >
< tr >
< th width = " 45% " height = " 25 " nowrap = " nowrap " >< ? php echo $user -> lang [ 'USERNAME' ]; ?> </th>
< th width = " 45% " >< ? php echo $user -> lang [ 'JOINED' ]; ?> </th>
< th width = " 5% " nowrap = " nowrap " >< ? php echo $user -> lang [ 'MARK' ]; ?> </th>
</ tr >
< ? php
2003-05-26 23:53:34 +00:00
$sql = ' SELECT user_id , username , user_regdate
2003-10-15 17:43:07 +00:00
FROM ' . USERS_TABLE . '
WHERE user_type = ' . USER_INACTIVE . '
2003-05-26 23:53:34 +00:00
ORDER BY user_regdate ASC ' ;
2003-03-13 12:14:48 +00:00
$result = $db -> sql_query ( $sql );
if ( $row = $db -> sql_fetchrow ( $result ))
{
do
{
$row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1' ;
?>
< tr >
2003-08-22 00:28:45 +00:00
< td class = " <?php echo $row_class ; ?> " >< a href = " <?php echo " admin_users . $phpEx $SID & amp ; u = " . $row['user_id'] ; ?> " >< ? php echo $row [ 'username' ]; ?> </a></td>
2003-03-13 12:14:48 +00:00
< td class = " <?php echo $row_class ; ?> " >< ? php echo $user -> format_date ( $row [ 'user_regdate' ]); ?> </td>
< td class = " <?php echo $row_class ; ?> " >& nbsp ; < input type = " checkbox " name = " mark[] " value = " <?php echo $row['user_id'] ; ?> " />& nbsp ; </ td >
</ tr >
< ? php
}
while ( $row = $db -> sql_fetchrow ( $result ));
?>
< tr >
2003-10-21 00:16:05 +00:00
< td class = " cat " colspan = " 3 " height = " 28 " align = " right " >< select name = " action " >< option value = " activate " >< ? php echo $user -> lang [ 'ACTIVATE' ]; ?> </option><?php
2003-03-25 14:21:56 +00:00
if ( ! empty ( $config [ 'email_enable' ]))
{
2003-10-21 00:16:05 +00:00
?> <option value="remind"><?php echo $user->lang['REMIND']; ?></option><?php
2003-03-25 14:21:56 +00:00
}
2003-10-21 00:16:05 +00:00
?> <option value="delete"><?php echo $user->lang['DELETE']; ?></option> <input class="btnlite" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" /> </td>
2003-03-13 12:14:48 +00:00
</ tr >
< ? php
}
else
{
?>
< tr >
< td class = " row1 " colspan = " 3 " align = " center " >< ? php echo $user -> lang [ 'NO_INACTIVE_USERS' ]; ?> </td>
</ tr >
< ? php
}
?>
</ table >
< table width = " 100% " cellspacing = " 1 " cellpadding = " 4 " border = " 0 " align = " center " >
< tr >
< td align = " right " valign = " top " nowrap = " nowrap " >< b >< span class = " gensmall " >< a href = " javascript:marklist(true); " class = " gensmall " >< ? php echo $user -> lang [ 'MARK_ALL' ]; ?> </a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b></td>
</ tr >
</ table ></ form >
< ? php
}
2003-05-03 23:58:45 +00:00
adm_page_footer ();
2003-03-13 12:14:48 +00:00
}
else
{
//
// Output the frameset ...
//
header ( " Expires: " . gmdate ( " D, d M Y H:i:s " , time ()) . " GMT " );
header ( " Last-Modified: " . gmdate ( " D, d M Y H:i:s " ) . " GMT " );
header ( " Content-type: text/html; charset= " . $user -> lang [ 'ENCODING' ]);
2003-04-09 22:17:55 +00:00
$adm_url = " index. $phpEx $SID &pane=right " ;
/*
// Allows non-admin pages to link to admin pages
// eg: http://forums.foo.com/adm/index.php?sid=&mod=admin_forums&f=1
if ( ! empty ( $_GET [ 'mod' ]) && preg_match ( '/admin_([a-z]+)/' , $_GET [ 'mod' ], $m ))
{
if ( file_exists ( $phpbb_root_path . 'adm/admin_' . $m [ 1 ] . '.' . $phpEx ))
{
$adm_url = 'admin_' . $m [ 1 ] . '.' . $phpEx . $SID ;
$adm_url .= ( ! empty ( $_GET [ 'mode' ])) ? '&mode=' . htmlspecialchars ( $_GET [ 'mode' ]) : '' ;
$adm_url .= ( ! empty ( $_GET [ 'f' ])) ? '&f=' . intval ( $_GET [ 'f' ]) : '' ;
$adm_url .= ( ! empty ( $_GET [ 'u' ])) ? '&u=' . intval ( $_GET [ 'u' ]) : '' ;
$adm_url .= ( ! empty ( $_GET [ 'g' ])) ? '&g=' . intval ( $_GET [ 'g' ]) : '' ;
}
}
*/
2003-03-13 12:14:48 +00:00
?>
< html >
< head >
2003-04-09 22:17:55 +00:00
< title >< ? php echo $user -> lang [ 'ADMIN_TITLE' ]; ?> </title>
2003-03-13 12:14:48 +00:00
</ head >
< frameset rows = " 60, * " border = " 0 " framespacing = " 0 " frameborder = " NO " >
< frame src = " <?php echo " index . $phpEx $SID & amp ; pane = top " ; ?> " name = " title " noresize marginwidth = " 0 " marginheight = " 0 " scrolling = " NO " >
< frameset cols = " 155,* " rows = " * " border = " 2 " framespacing = " 0 " frameborder = " yes " >
< frame src = " <?php echo " index . $phpEx $SID & amp ; pane = left " ; ?> " name = " nav " marginwidth = " 3 " marginheight = " 3 " scrolling = " yes " >
2003-04-09 22:17:55 +00:00
< frame src = " <?php echo $adm_url ?> " name = " main " marginwidth = " 0 " marginheight = " 0 " scrolling = " auto " >
2003-03-13 12:14:48 +00:00
</ frameset >
</ frameset >
< noframes >
< body bgcolor = " white " text = " #000000 " >
2003-04-09 22:17:55 +00:00
< p >< ? php echo $user -> lang [ 'NO_FRAMES' ]; ?> </p>
2003-03-13 12:14:48 +00:00
</ body >
</ noframes >
</ html >
< ? php
exit ;
}
2005-02-02 13:14:46 +00:00
?>