summaryrefslogtreecommitdiffstats
path: root/includes/championPoints.php
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2013-01-13 02:46:45 -0600
committerBlueRaja <BlueRaja.admin@gmail.com>2013-01-13 02:46:45 -0600
commit159992a5fa3456e036888c9e9d8a06409f272db6 (patch)
tree4c1f5ca672981d506cd2c0ce36bd27e92c4cd608 /includes/championPoints.php
parent468e9a700736166f175b974e185d24d0d2a4f33e (diff)
downloadpathery-159992a5fa3456e036888c9e9d8a06409f272db6.tar.xz
Added champion points to leaderboard page
Diffstat (limited to 'includes/championPoints.php')
-rw-r--r--includes/championPoints.php7
1 files changed, 4 insertions, 3 deletions
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'
);
";