From 099e2d5ab8effe07b0e5d8c59e18c81f519fd833 Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Sun, 13 Jan 2013 19:27:39 -0600 Subject: Added totalWins and totalTies columns to the users table. Also, removed all references to the 'statistics' table - it's not needed anymore. --- pages/admin.php | 10 +++++----- pages/faq.php | 2 +- pages/memberlist.php | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'pages') diff --git a/pages/admin.php b/pages/admin.php index afc6418..0f54285 100644 --- a/pages/admin.php +++ b/pages/admin.php @@ -10,7 +10,7 @@ include_once('./includes/datas.php'); include_once('./includes/maps.php'); include_once('./includes/mapoftheday.php'); include_once('./includes/sqlEmbedded.php'); -include_once('./includes/championPoints.php'); +include_once('./includes/playerStats.php'); if ($_GET['applyall'] == 'true') { echo "Apply-All command heard. Executing..."; @@ -27,10 +27,10 @@ if ($_GET['applyall'] == 'true') { echo "Execution complete!"; } -else if ($_GET['recalcChamp'] == 'true') { - echo "Recalculating champion points..."; +else if ($_GET['recalcStats'] == 'true') { + echo "Recalculating all player stats..."; - recalculateAllPlayersChampionPoints(); + recalculateStatsForAllPlayers(); echo "Complete!"; } @@ -45,7 +45,7 @@ echo '

News:

Buttons:
- +

Hello admins, this is our current userlist.

diff --git a/pages/faq.php b/pages/faq.php index e9d8e5f..95b0b87 100644 --- a/pages/faq.php +++ b/pages/faq.php @@ -8,7 +8,7 @@ echo soundManager2(); topbar($Links); include_once('./includes/maps.php'); -include_once('./includes/championPoints.php'); +include_once('./includes/playerStats.php'); // Demo maps: diff --git a/pages/memberlist.php b/pages/memberlist.php index 3baf456..2fa2cdc 100644 --- a/pages/memberlist.php +++ b/pages/memberlist.php @@ -115,8 +115,8 @@ $sql = "SELECT WHERE solutions.userID = users.ID AND solutions.dateModified BETWEEN DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY) AND CURRENT_DATE) AS totalMovesThisWeek, (SELECT COUNT(*) FROM solutions WHERE solutions.userID = users.ID AND solutions.dateModified < CURRENT_DATE) AS totalMazes, - SUM(CASE WHEN statistics.type IN (32, 33, 34, 35) THEN statistics.value ELSE 0 END) as totalWins, - SUM(CASE WHEN statistics.type IN (1, 2, 3, 4) THEN statistics.value ELSE 0 END) as totalTies, + users.totalWins, + users.totalTies, IfNull(userData.wallColor, '#666666') as wallColor, IfNull(userData.displayColor, '#cccccc'), userData.wallEmblem, @@ -124,7 +124,6 @@ $sql = "SELECT users.dateLogin as dateLogin FROM `users` LEFT JOIN `userData` ON users.ID = userData.userID -LEFT JOIN `statistics` ON users.ID = statistics.userID GROUP BY users.ID $order "; -- cgit v1.2.3