From 12f21fee97c61059c4ed7b0d57eb40d40cc2a4b5 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Mon, 24 Mar 2003 19:03:16 +0000 Subject: Capitalisation, additional of one or two new options, removal of global prune option, addition of stats reset on admin index page git-svn-id: file:///svn/phpbb/trunk@3708 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 64 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 6 deletions(-) (limited to 'phpBB/adm/index.php') diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 454d6e15eb..ef478deffb 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -177,11 +177,63 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') { trigger_error($user->lang['NO_ADMIN']); } + } + else if (isset($_POST['online'])) + { + if (!$auth->acl_get('a_defaults')) + { + trigger_error($user->lang['NO_ADMIN']); + } + set_config('record_online_users', 1); + set_config('record_online_date', time()); + add_log('admin', 'LOG_RESET_ONLINE'); } - else if (isset($_POST['resetonline'])) + else if (isset($_POST['stats'])) { + if (!$auth->acl_get('a_defaults')) + { + trigger_error($user->lang['NO_ADMIN']); + } + $sql = "SELECT COUNT(post_id) AS stat + FROM " . POSTS_TABLE . " + WHERE post_approved = 1"; + $result = $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + set_config('num_posts', $row['stat']); + + $sql = "SELECT COUNT(topic_id) AS stat + FROM " . TOPICS_TABLE . " + WHERE topic_approved = 1"; + $result = $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + set_config('num_topics', $row['stat']); + + $sql = "SELECT COUNT(user_id) AS stat + FROM " . USERS_TABLE . " + WHERE user_active = 1"; + $result = $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + set_config('num_users', $row['stat']); + + add_log('admin', 'LOG_RESYNC_STATS'); + } + else if (isset($_POST['date'])) + { + if (!$auth->acl_get('a_defaults')) + { + trigger_error($user->lang['NO_ADMIN']); + } + + set_config('board_startdate', time() - 1); + add_log('admin', 'LOG_RESET_DATE'); } // Get forum statistics @@ -336,7 +388,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')

lang['FORUM_STATS']; ?>

- +
@@ -373,10 +425,10 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') - -
lang['STATISTIC']; ?> lang['VALUE']; ?>lang['GZIP_COMPRESSION']; ?>: lang['ON'] : $user->lang['OFF']; ?>
+ +      + +

lang['ADMIN_LOG']; ?>

-- cgit v1.2.1