get_acl_admin('general') ) { return; } $filename = basename(__FILE__); $module['Log']['Admin_logs'] = $filename . "$SID&mode=admin"; $module['Log']['Mod_logs'] = $filename . "$SID&mode=mod"; return; } define('IN_PHPBB', 1); // // Include files // $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); // // Do we have styles admin permissions? // 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']) ) { $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; } 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 = ''; if ( isset($HTTP_POST_VARS['delmarked']) && isset($HTTP_POST_VARS['mark']) ) { foreach ( $HTTP_POST_VARS['mark'] as $marked ) { $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . intval($marked); } $where_sql = "WHERE log_id IN ($where_sql)"; } $sql = "DELETE FROM $table_sql $where_sql"; $db->sql_query($sql); add_admin_log('log_' . $mode . '_clear'); } // // Sorting ... this could become a function // if ( isset($HTTP_POST_VARS['sort']) || $start ) { if ( !empty($HTTP_POST_VARS['sort_days']) || !empty($HTTP_GET_VARS['sort_days']) ) { $sort_days = ( !empty($HTTP_POST_VARS['sort_days']) ) ? intval($HTTP_POST_VARS['sort_days']) : intval($HTTP_GET_VARS['sort_days']); $where_sql = time() - ( $sort_days * 86400 ); } else { $where_sql = 0; } $sort_key = ( isset($HTTP_POST_VARS['sort_key']) ) ? $HTTP_POST_VARS['sort_key'] : $HTTP_GET_VARS['sort_key']; $sort_dir = ( isset($HTTP_POST_VARS['sort_dir']) ) ? $HTTP_POST_VARS['sort_dir'] : $HTTP_GET_VARS['sort_dir']; } else { $where_sql = 0; $sort_days = 0; $sort_key = 't'; $sort_dir = 'd'; } $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'); $sort_day_options = ''; foreach ( $previous_days as $day => $text ) { $selected = ( $sort_days == $day ) ? ' selected="selected"' : ''; $sort_day_options .= ''; } $sort_key_options = ''; foreach ( $sort_by_text as $key => $text ) { $selected = ( $sort_key == $key ) ? ' selected="selected"' : ''; $sort_key_options .= ''; } $sort_order_options = ( $sort_dir == 'a' ) ? '' : ''; $sort_sql = $sort_by[$sort_key] . ' ' . ( ( $sort_dir == 'd' ) ? 'DESC' : 'ASC' ); // // Define forum list if we're looking @ mod logs // $forum_options = ''; if ( $mode == 'mod' ) { $sql = "SELECT forum_id, forum_name FROM " . FORUMS_TABLE . " ORDER BY cat_id, forum_order"; $result = $db->sql_query($sql); if ( $row = $db->sql_fetchrow($result) ) { $forum_id = ( isset($HTTP_POST_VARS['f']) ) ? intval($HTTP_POST_VARS['f']) : $row['forum_id']; do { $selected = ( $row['forum_id'] == $forum_id ) ? ' selected="selected"' : ''; $forum_options .= ''; } while ( $row = $db->sql_fetchrow($result) ); } else { $forum_id = 0; $forum_options = ''; } } // // Output page // page_header($l_title); ?>

">
:
get_acl_admin('clearlogs') ) { ?>
:     
   
  get_acl_admin('clearlogs') ) { ?> ::