From 159992a5fa3456e036888c9e9d8a06409f272db6 Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Sun, 13 Jan 2013 02:46:45 -0600 Subject: Added champion points to leaderboard page --- includes/championPoints.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'includes') diff --git a/includes/championPoints.php b/includes/championPoints.php index e824c0c..b99fde3 100644 --- a/includes/championPoints.php +++ b/includes/championPoints.php @@ -107,9 +107,9 @@ function addPlayerChampionPointsForMapsOfTheDay($fromDate) $sql3 = " -- Add the points for doing the weekly maps UPDATE solutions - SET championPointsWorth = + SET championPointsWorth = championPointsWorth + ( - SELECT SUM(".CP_MAX_WORTH_WEEKLY." * + SELECT IFNULL(SUM(".CP_MAX_WORTH_WEEKLY." * ( SELECT COUNT(*) FROM (SELECT * FROM solutions) AS s2 @@ -119,11 +119,12 @@ function addPlayerChampionPointsForMapsOfTheDay($fromDate) SELECT GREATEST(COUNT(*)-1, 1) FROM (SELECT * FROM solutions) AS s2 WHERE s2.mapID = mapOfTheDay.mapID - ) + ".CP_MIN_WORTH_WEEKLY.") + ) + ".CP_MIN_WORTH_WEEKLY."), 0) FROM mapOfTheDay INNER JOIN (SELECT * FROM solutions) AS usersSolutions ON usersSolutions.mapID = mapOfTheDay.mapID WHERE usersSolutions.ID = solutions.ID AND mapOfTheDay.mapType = 5 + AND mapOfTheDay.mapDate >= '$fromDate' ); "; -- cgit v1.2.3