diff --git a/phpBB/admin/admin_viewlogs.php b/phpBB/admin/admin_viewlogs.php index bdd48ac1cc..003835b860 100644 --- a/phpBB/admin/admin_viewlogs.php +++ b/phpBB/admin/admin_viewlogs.php @@ -28,6 +28,7 @@ if ( !empty($setmodules) ) $filename = basename(__FILE__); $module['General']['Admin_logs'] = $filename . "$SID&mode=admin"; + $module['General']['Mod_logs'] = $filename . "$SID&mode=mod"; return; } @@ -48,6 +49,9 @@ if ( !$acl->get_acl_admin('general') ) message_die(MESSAGE, $lang['No_admin']); } +// +// Set some variables +// $start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0; if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) @@ -59,6 +63,16 @@ else $mode = 'admin'; } +// +// Define some vars depending on which logs we're looking at +// +$log_table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE; +$l_title = ( $mode == 'admin' ) ? $lang['Admin_logs'] : $lang['Mod_logs']; +$l_title_explain = ( $mode == 'admin' ) ? $lang['Admin_logs_explain'] : $lang['Mod_logs_explain']; + +// +// Delete entries if requested and able +// if ( ( isset($HTTP_POST_VARS['delmarked']) || isset($HTTP_POST_VARS['delall']) ) && $acl->get_acl_admin('clearlogs')) { $where_sql = ''; @@ -71,15 +85,15 @@ if ( ( isset($HTTP_POST_VARS['delmarked']) || isset($HTTP_POST_VARS['delall']) ) $where_sql = "WHERE log_id IN ($where_sql)"; } - $sql = "DELETE FROM " . LOG_ADMIN_TABLE . " + $sql = "DELETE FROM $table_sql $where_sql"; $db->sql_query($sql); - add_admin_log('log_admin_clear'); + add_admin_log('log_' . $mode . '_clear'); } // -// +// Sorting ... this could become a function // if ( isset($HTTP_POST_VARS['sort']) || $start ) { @@ -105,9 +119,6 @@ else $sort_dir = 'd'; } -// -// Sorting -// $previous_days = array(0 => $lang['All_Entries'], 1 => $lang['1_Day'], 7 => $lang['7_Days'], 14 => $lang['2_Weeks'], 30 => $lang['1_Month'], 90 => $lang['3_Months'], 180 => $lang['6_Months'], 364 => $lang['1_Year']); $sort_by_text = array('u' => $lang['Sort_Username'], 't' => $lang['Sort_date'], 'i' => $lang['Sort_ip'], 'o' => $lang['Sort_action']); $sort_by = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); @@ -131,29 +142,64 @@ $sort_order_options = ( $sort_dir == 'a' ) ? ''; + } + while ( $row = $db->sql_fetchrow($result) ); + } + else + { + $forum_id = 0; + $forum_options = ''; + } +} -page_header($lang['Admin_logs']); +// +// Output page +// +page_header($l_title); ?> -
+ - + -