diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-01-29 17:45:34 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-01-29 17:45:34 +0000 |
commit | bb939454231a9281b5dbb3242606c5008c904ed6 (patch) | |
tree | f0652a64b53cbae93861f87c55988f08998dea76 /phpBB/admin | |
parent | bcd4581f7762de33512833cff82638831d3e68e5 (diff) | |
download | forums-bb939454231a9281b5dbb3242606c5008c904ed6.tar forums-bb939454231a9281b5dbb3242606c5008c904ed6.tar.gz forums-bb939454231a9281b5dbb3242606c5008c904ed6.tar.bz2 forums-bb939454231a9281b5dbb3242606c5008c904ed6.tar.xz forums-bb939454231a9281b5dbb3242606c5008c904ed6.zip |
Move logging functions, change name, add mode + lang var case changes
git-svn-id: file:///svn/phpbb/trunk@3401 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/admin')
-rw-r--r-- | phpBB/admin/admin_ban.php | 4 | ||||
-rw-r--r-- | phpBB/admin/admin_board.php | 3 | ||||
-rw-r--r-- | phpBB/admin/admin_database.php | 5 | ||||
-rw-r--r-- | phpBB/admin/admin_disallow.php | 4 | ||||
-rw-r--r-- | phpBB/admin/admin_forums.php | 1 | ||||
-rw-r--r-- | phpBB/admin/admin_permissions.php | 1 | ||||
-rw-r--r-- | phpBB/admin/admin_prune.php | 3 | ||||
-rw-r--r-- | phpBB/admin/admin_prune_users.php | 2 | ||||
-rw-r--r-- | phpBB/admin/admin_styles.php | 4 | ||||
-rw-r--r-- | phpBB/admin/admin_users.php | 1 | ||||
-rw-r--r-- | phpBB/admin/admin_viewlogs.php | 29 | ||||
-rw-r--r-- | phpBB/admin/admin_words.php | 5 | ||||
-rw-r--r-- | phpBB/admin/index.php | 75 | ||||
-rw-r--r-- | phpBB/admin/pagestart.php | 85 |
14 files changed, 69 insertions, 153 deletions
diff --git a/phpBB/admin/admin_ban.php b/phpBB/admin/admin_ban.php index e5fe736f3f..71b58cdd00 100644 --- a/phpBB/admin/admin_ban.php +++ b/phpBB/admin/admin_ban.php @@ -299,7 +299,7 @@ if (isset($_POST['bansubmit']) || isset($_GET['bansubmit'])) // Update log $log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'log_ban_'; - add_admin_log($log_entry . $mode, $ban_reason, $ban_list_log); + add_log('admin', $log_entry . $mode, $ban_reason, $ban_list_log); } trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']); @@ -319,7 +319,7 @@ else if (isset($_POST['unbansubmit'])) WHERE ban_id IN ($unban_sql)"; $db->sql_query($sql); - add_admin_log('log_unban_' . $mode, sizeof($_POST['unban'])); + add_log('admin', 'log_unban_' . $mode, sizeof($_POST['unban'])); } trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']); diff --git a/phpBB/admin/admin_board.php b/phpBB/admin/admin_board.php index 1da74511b5..1235039013 100644 --- a/phpBB/admin/admin_board.php +++ b/phpBB/admin/admin_board.php @@ -37,7 +37,6 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -require_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); // Get mode $mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : ''; @@ -104,7 +103,7 @@ while ($row = $db->sql_fetchrow($result)) if (isset($_POST['submit'])) { - add_admin_log('log_' . $mode . '_config'); + add_log('admin', 'log_' . $mode . '_config'); trigger_error($user->lang['Config_updated']); } diff --git a/phpBB/admin/admin_database.php b/phpBB/admin/admin_database.php index 0bdadf950e..6c07995c5e 100644 --- a/phpBB/admin/admin_database.php +++ b/phpBB/admin/admin_database.php @@ -38,7 +38,6 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); $mode = (isset($_GET['mode'])) ? $_GET['mode'] : ''; @@ -260,7 +259,7 @@ switch($mode) ob_end_clean(); } - add_admin_log('log_db_backup'); + add_log('admin', 'log_db_backup'); if (empty($store_path)) { @@ -373,7 +372,7 @@ switch($mode) } } - add_admin_log('log_db_restore'); + add_log('admin', 'log_db_restore'); trigger_error($user->lang['Restore_success']); } diff --git a/phpBB/admin/admin_disallow.php b/phpBB/admin/admin_disallow.php index 646f348347..af7c7fdf3d 100644 --- a/phpBB/admin/admin_disallow.php +++ b/phpBB/admin/admin_disallow.php @@ -61,7 +61,7 @@ if (isset($_POST['disallow'])) $message = $user->lang['Disallow_successful']; } - add_admin_log('log_disallow_add', str_replace('%', '*', $disallowed_user)); + add_log('admin', 'log_disallow_add', str_replace('%', '*', $disallowed_user)); trigger_error($message); } @@ -78,7 +78,7 @@ else if (isset($_POST['allow'])) WHERE disallow_id = $disallowed_id"; $db->sql_query($sql); - add_admin_log('log_disallow_delete'); + add_log('admin', 'log_disallow_delete'); trigger_error($user->lang['Disallowed_deleted']); } diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php index 8ba708f26a..5fd1c80419 100644 --- a/phpBB/admin/admin_forums.php +++ b/phpBB/admin/admin_forums.php @@ -35,7 +35,6 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Get mode $mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : ''; diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index e7c2e4e3d2..70c7e3206e 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -38,7 +38,6 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Define some vars $forum_id = 0; diff --git a/phpBB/admin/admin_prune.php b/phpBB/admin/admin_prune.php index 396e7c61f4..5b0f5c48c9 100644 --- a/phpBB/admin/admin_prune.php +++ b/phpBB/admin/admin_prune.php @@ -36,7 +36,6 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Do we have permission? if (!$auth->acl_get('a_prune')) @@ -109,7 +108,7 @@ if (isset($_POST['doprune'])) } while($row = $db->sql_fetchrow($result)); - add_admin_log('log_prune', $log_data); + add_log('admin', 'log_prune', $log_data); } else diff --git a/phpBB/admin/admin_prune_users.php b/phpBB/admin/admin_prune_users.php index dd4eacc124..ef466b1be5 100644 --- a/phpBB/admin/admin_prune_users.php +++ b/phpBB/admin/admin_prune_users.php @@ -172,7 +172,7 @@ if (isset($_POST['prune'])) $where_sql"; // $db->sql_query($sql); - add_admin_log($l_admin_log, implode(', ', $usernames)); + add_log('admin', $l_admin_log, implode(', ', $usernames)); unset($user_ids); unset($usernames); diff --git a/phpBB/admin/admin_styles.php b/phpBB/admin/admin_styles.php index f2d1b052a3..0035c9f7fe 100644 --- a/phpBB/admin/admin_styles.php +++ b/phpBB/admin/admin_styles.php @@ -163,7 +163,7 @@ switch ($mode) @chmod($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 0644); - add_admin_log('log_template_edit', $tplname, $tplroot); + add_log('admin', 'log_template_edit', $tplname, $tplroot); exit; } @@ -266,7 +266,7 @@ switch ($mode) WHERE theme_id = $theme_id"; $db->sql_query($sql); - add_admin_log('log_theme_edit', $theme_name); + add_log('admin', 'log_theme_edit', $theme_name); message_die(MESSAGE, $user->lang['Success_theme_update']); } diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php index 65a2c493e7..84e14d4c10 100644 --- a/phpBB/admin/admin_users.php +++ b/phpBB/admin/admin_users.php @@ -36,7 +36,6 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Set mode $mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'main'; diff --git a/phpBB/admin/admin_viewlogs.php b/phpBB/admin/admin_viewlogs.php index a31f27efed..6969233200 100644 --- a/phpBB/admin/admin_viewlogs.php +++ b/phpBB/admin/admin_viewlogs.php @@ -38,7 +38,6 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Do we have styles admin permissions? if (!$auth->acl_get('a_general')) @@ -73,7 +72,7 @@ if ((isset($_POST['delmarked']) || isset($_POST['delall'])) && $auth->acl_get('a $where_sql"; $db->sql_query($sql); - add_admin_log('log_' . $mode . '_clear'); + add_log('admin', 'log_' . $mode . '_clear'); } // Sorting ... this could become a function @@ -102,7 +101,7 @@ else } $previous_days = array(0 => $user->lang['All_Entries'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']); -$sort_by_text = array('u' => $user->lang['Sort_Username'], 't' => $user->lang['Sort_date'], 'i' => $user->lang['Sort_ip'], 'o' => $user->lang['Sort_action']); +$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->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 = ''; @@ -119,7 +118,7 @@ foreach ($sort_by_text as $key => $text) $sort_key_options .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>'; } -$sort_order_options = ($sort_dir == 'a') ? '<option value="a" selected="selected">' . $user->lang['Sort_Ascending'] . '</option><option value="d">' . $user->lang['Sort_Descending'] . '</option>' : '<option value="a">' . $user->lang['Sort_Ascending'] . '</option><option value="d" selected="selected">' . $user->lang['Sort_Descending'] . '</option>'; +$sort_order_options = ($sort_dir == 'a') ? '<option value="a" selected="selected">' . $user->lang['SORT_ASCENDING'] . '</option><option value="d">' . $user->lang['SORT_DESCENDING'] . '</option>' : '<option value="a">' . $user->lang['SORT_ASCENDING'] . '</option><option value="d" selected="selected">' . $user->lang['SORT_DESCENDING'] . '</option>'; $sort_sql = $sort_by[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); @@ -138,13 +137,13 @@ page_header($l_title); // Define forum list if we're looking @ mod logs if ($mode == 'mod') { -//include($phpbb_root_path . '/includes/functions_admin.'.$phpEx); - $forum_box = make_forum_select($forum_id); + + $forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id, false, false); ?> <table width="100%" cellpadding="1" cellspacing="1" border="0"> <tr> - <td align="right"><?php echo $user->lang['SELECT_FORUM']; ?>: <select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ this.form.submit() }"><?php echo $forum_box; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" /></td> + <td align="right"><?php echo $user->lang['SELECT_FORUM']; ?>: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit() }"><?php echo $forum_box; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" /></td> </tr> </table> <?php @@ -155,14 +154,14 @@ if ($mode == 'mod') <table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0"> <tr> - <td class="cat" colspan="5" height="28" align="center"><span class="gensmall"><?php echo $user->lang['Display_log']; ?>: <select name="sort_days"><?php echo $sort_day_options; ?></select> <?php echo $user->lang['Sort_by']; ?> <select name="sort_key"><?php echo $sort_key_options; ?></select> <select name="sort_dir"><?php echo $sort_order_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" name="sort" /></span></td> + <td class="cat" colspan="5" height="28" align="center"><span class="gensmall"><?php echo $user->lang['DISPLAY_LOG']; ?>: <select name="sort_days"><?php echo $sort_day_options; ?></select> <?php echo $user->lang['SORT_BY']; ?> <select name="sort_key"><?php echo $sort_key_options; ?></select> <select name="sort_dir"><?php echo $sort_order_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" name="sort" /></span></td> </tr> <tr> - <th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['Username']; ?></th> + <th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['USERNAME']; ?></th> <th width="15%" nowrap="nowrap"><?php echo $user->lang['IP']; ?></th> - <th width="20%" nowrap="nowrap"><?php echo $user->lang['Time']; ?></th> - <th width="45%" nowrap="nowrap"><?php echo $user->lang['Action']; ?></th> - <th nowrap="nowrap"><?php echo $user->lang['Mark']; ?></th> + <th width="20%" nowrap="nowrap"><?php echo $user->lang['TIME']; ?></th> + <th width="45%" nowrap="nowrap"><?php echo $user->lang['ACTION']; ?></th> + <th nowrap="nowrap"><?php echo $user->lang['MARK']; ?></th> </tr> <?php @@ -196,7 +195,7 @@ if ($log_count) ?> <tr> - <td class="cat" colspan="5" height="28" align="right"><input class="liteoption" type="submit" name="delmarked" value="<?php echo $user->lang['Delete_marked']; ?>" /> <input class="liteoption" type="submit" name="delall" value="<?php echo $user->lang['Delete_all']; ?>" /> </td> + <td class="cat" colspan="5" height="28" align="right"><input class="liteoption" type="submit" name="delmarked" value="<?php echo $user->lang['DELETE_MARKED']; ?>" /> <input class="liteoption" type="submit" name="delall" value="<?php echo $user->lang['DELETE_ALL']; ?>" /> </td> </tr> <?php @@ -206,7 +205,7 @@ else { ?> <tr> - <td class="row1" colspan="5" align="center" nowrap="nowrap"><?php echo $user->lang['No_entries']; ?></td> + <td class="row1" colspan="5" align="center" nowrap="nowrap"><?php echo $user->lang['NO_ENTRIES']; ?></td> </tr> <?php @@ -224,7 +223,7 @@ else { -?><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> <br /><br /><?php +?><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> <br /><br /><?php } diff --git a/phpBB/admin/admin_words.php b/phpBB/admin/admin_words.php index fb92a75785..e8880e86d6 100644 --- a/phpBB/admin/admin_words.php +++ b/phpBB/admin/admin_words.php @@ -35,7 +35,6 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -require_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); // Do we have forum admin permissions? if (!$auth->acl_get('a_words')) @@ -138,7 +137,7 @@ if ($mode != '') $cache->destroy('word_censors'); $log_action = ($word_id) ? 'log_edit_word' : 'log_add_word'; - add_admin_log($log_action, stripslashes($word)); + add_log('admin', $log_action, stripslashes($word)); $message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED']; break; @@ -160,7 +159,7 @@ if ($mode != '') $cache->destroy('word_censors'); - add_admin_log('log_delete_word'); + add_log('admin', 'log_delete_word'); $message = $user->lang['WORD_REMOVE']; break; diff --git a/phpBB/admin/index.php b/phpBB/admin/index.php index 150a5f9b4b..2f285ca04a 100644 --- a/phpBB/admin/index.php +++ b/phpBB/admin/index.php @@ -19,12 +19,11 @@ * ***************************************************************************/ -define('IN_PHPBB', 1); - // Define some vars $pane = (isset($_GET['pane'])) ? $_GET['pane'] : ''; $update = ($pane == 'right') ? true : false; +define('IN_PHPBB', 1); // Include files $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); @@ -46,7 +45,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'top') <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td><a href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td> - <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> + <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> @@ -66,7 +65,7 @@ else if (isset($_GET['pane']) && $_GET['pane'] == 'left') $setmodules = 1; while ($file = @readdir($dir)) { - if (preg_match('/^admin_(.*?)\.' . $phpEx . '$/', $file)) + if (preg_match('#^admin_(.*?)\.' . $phpEx . '$#', $file)) { include($file); } @@ -260,9 +259,9 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') { $version = $row['mysql_version']; - if (preg_match('/^(3\.23|4\.)/', $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; + $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; @@ -297,7 +296,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') $dbsize = $user->lang['Not_available']; } } - else if (preg_match('/^mssql/', SQL_LAYER)) + else if (preg_match('#^mssql#', SQL_LAYER)) { $sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize FROM sysfiles"; @@ -315,7 +314,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') $dbsize = ($dbsize >= 1048576) ? sprintf('%.2f MB', ($dbsize / 1048576)) : (($dbsize >= 1024) ? sprintf('%.2f KB', ($dbsize / 1024)) : sprintf('%.2f Bytes', $dbsize)); } - page_header($user->lang['Admin_Index']); + page_header($user->lang['ADMIN_INDEX']); ?> @@ -331,47 +330,47 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') //--> </script> -<h1><?php echo $user->lang['Welcome_phpBB']; ?></h1> +<h1><?php echo $user->lang['WELCOME_PHPBB']; ?></h1> -<p><?php echo $user->lang['Admin_intro']; ?></p> +<p><?php echo $user->lang['ADMIN_INTRO']; ?></p> -<h1><?php echo $user->lang['Forum_stats']; ?></h1> +<h1><?php echo $user->lang['FORUM_STATS']; ?></h1> <table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0"> <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> + <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="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="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="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="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="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="row1" nowrap="nowrap"><?php echo $user->lang['USERS_PER_DAY']; ?>:</td> <td class="row2"><b><?php echo $users_per_day; ?></b></td> </tr> <tr> - <td class="row1" nowrap="nowrap"><?php echo $user->lang['Board_started']; ?>:</td> + <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="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="row1" nowrap="nowrap"><?php echo $user->lang['DATABASE_SIZE']; ?>:</td> <td class="row2"><b><?php echo $dbsize; ?></b></td> - <td class="row1" nowrap="nowrap"><?php echo $user->lang['Gzip_compression']; ?>:</td> + <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> </tr> <!-- tr> @@ -379,16 +378,16 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') </tr --> </table> -<h1><?php echo $user->lang['Admin_log']; ?></h1> +<h1><?php echo $user->lang['ADMIN_LOG']; ?></h1> -<p><?php echo $user->lang['Admin_log_index_explain']; ?></p> +<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%" 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> + <th width="20%"><?php echo $user->lang['TIME']; ?></th> + <th width="45%" nowrap="nowrap"><?php echo $user->lang['ACTION']; ?></th> </tr> <?php @@ -415,15 +414,15 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') ?> </table> -<h1><?php echo $user->lang['Inactive_users']; ?></h1> +<h1><?php echo $user->lang['INACTIVE_USERS']; ?></h1> -<p><?php echo $user->lang['Inactive_users_explain']; ?></p> +<p><?php echo $user->lang['INACTIVE_USERS_EXPLAIN']; ?></p> <form method="post" name="inactive" action="<?php echo "index.$phpEx$SID&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> + <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 @@ -453,7 +452,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') ?> <tr> - <td class="cat" colspan="3" height="28" align="right"><input class="liteoption" type="submit" name="activate" value="Activate" /> <input class="liteoption" type="submit" name="remind" value="Remind" /> <input class="liteoption" type="submit" name="delete" value="Delete" /> </td> + <td class="cat" colspan="3" height="28" align="right"><input class="liteoption" type="submit" name="activate" value="<?php echo $user->lang['ACTIVATE']; ?>" /> <input class="liteoption" type="submit" name="remind" value="<?php echo $user->lang['REMIND']; ?>" /> <input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> </td> </tr> <?php @@ -463,7 +462,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') ?> <tr> - <td class="row1" colspan="3" align="center"><?php echo $user->lang['No_inactive_users']; ?></td> + <td class="row1" colspan="3" align="center"><?php echo $user->lang['NO_INACTIVE_USERS']; ?></td> </tr> <?php @@ -474,7 +473,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') <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> + <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> diff --git a/phpBB/admin/pagestart.php b/phpBB/admin/pagestart.php index e2096baf4f..b4359312ce 100644 --- a/phpBB/admin/pagestart.php +++ b/phpBB/admin/pagestart.php @@ -26,7 +26,8 @@ if (!defined('IN_PHPBB')) define('IN_ADMIN', true); define('NEED_SID', true); -include($phpbb_root_path . 'common.'.$phpEx); +require($phpbb_root_path . 'common.'.$phpEx); +require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Start session management $user->start($update); @@ -45,7 +46,7 @@ function page_header($sub_title, $meta = '', $table_html = true) // gzip_compression if ($config['gzip_compress']) { - if (extension_loaded('zlib') && strstr($HTTP_USER_AGENT,'compatible') && !headers_sent()) + if (extension_loaded('zlib') && !headers_sent()) { ob_start('ob_gzhandler'); } @@ -105,6 +106,7 @@ function page_footer($copyright_html = true) // Close our DB connection. $db->sql_close(); + ?> </td> @@ -147,7 +149,7 @@ function page_message($title, $message, $show_header = false) <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td><a href="../index.<?php echo $phpEx . $SID; ?>"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td> - <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> + <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> @@ -173,83 +175,6 @@ function page_message($title, $message, $show_header = false) <?php } - -function add_admin_log() -{ - global $db, $user; - - $arguments = func_get_args(); - - $action = array_shift($arguments); - $data = (!sizeof($arguments)) ? '' : addslashes(serialize($arguments)); - - $sql = "INSERT INTO " . LOG_ADMIN_TABLE . " (user_id, log_ip, log_time, log_operation, log_data) - VALUES (" . $user->data['user_id'] . ", '$user->ip', " . time() . ", '$action', '$data')"; - $db->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, $user, $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'] = '<a href="admin_users.'.$phpEx . $SID . '&u=' . $row['user_id'] . '">' . $row['username'] . '</a>'; - $log[$i]['ip'] = $row['log_ip']; - $log[$i]['time'] = $row['log_time']; - - $log[$i]['action'] = (!empty($user->lang[$row['log_operation']])) ? $user->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 // ----------------------------- |