start($update);
$acl = new auth('admin', $userdata);
//
// End session management
//
//
// Configure style, language, etc.
//
$session->configure($userdata);
// -----------------------------
// Functions
//
function page_header($sub_title)
{
global $board_config, $db, $lang, $phpEx;
include('page_header_admin.'.$phpEx);
?>
sql_query($sql);
return;
}
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
{
global $db, $lang, $phpEx, $SID;
$table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE;
$forum_sql = ( $mode == 'mod' && $forum_id ) ? "AND l.forum_id = $forum_id" : '';
$limit_sql = ( $limit ) ? ( ( $offset ) ? "LIMIT $offset, $limit" : "LIMIT $limit" ) : '';
$sql = "SELECT l.log_id, l.user_id, l.log_ip, l.log_time, l.log_operation, l.log_data, u.username
FROM $table_sql l, " . USERS_TABLE . " u
WHERE u.user_id = l.user_id
AND l.log_time >= $limit_days
$forum_sql
ORDER BY $sort_by
$limit_sql";
$result = $db->sql_query($sql);
$log = array();
if ( $row = $db->sql_fetchrow($result) )
{
$i = 0;
do
{
$log[$i]['id'] = $row['log_id'];
$log[$i]['username'] = '' . $row['username'] . '';
$log[$i]['ip'] = $row['log_ip'];
$log[$i]['time'] = $row['log_time'];
$log[$i]['action'] = ( !empty($lang[$row['log_operation']]) ) ? $lang[$row['log_operation']] : ucfirst(str_replace('_', ' ', $row['log_operation']));
if ( !empty($row['log_data']) )
{
$log_data_ary = unserialize(stripslashes($row['log_data']));
foreach ( $log_data_ary as $log_data )
{
$log[$i]['action'] = preg_replace('#%s#', $log_data, $log[$i]['action'], 1);
}
}
$i++;
}
while ( $row = $db->sql_fetchrow($result) );
}
$db->sql_freeresult($result);
$sql = "SELECT COUNT(*) AS total_entries
FROM $table_sql l
WHERE l.log_time >= $limit_days
$forum_sql";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$log_count = $row['total_entries'];
return;
}
//
// End Functions
// -----------------------------
?>