start($update);
$auth->acl($userdata, false, 'a_');
$user = new user($userdata);
//
// End session management
//
// -----------------------------
// Functions
function page_header($sub_title, $meta = '', $table_html = true)
{
global $board_config, $db, $lang, $phpEx;
define('HEADER_INC', true);
// gzip_compression
if ( $board_config['gzip_compress'] )
{
if ( extension_loaded('zlib') && strstr($HTTP_USER_AGENT,'compatible') && !headers_sent() )
{
ob_start('ob_gzhandler');
}
}
header("Content-type: text/html; charset=" . $lang['ENCODING']);
?>
sql_close();
exit;
}
function page_message($title, $message, $show_header = false)
{
global $phpEx, $SID, $lang;
if ( $show_header )
{
?>
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
// -----------------------------
?>