From c16f64c46dca50d0c66e52f6d2ecb70f91bdd65e Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Tue, 15 Jan 2013 01:05:08 -0600 Subject: BUGFIX: Ties not displaying correctly on the achievements page --- includes/datas.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/datas.php b/includes/datas.php index 66c816b..cdaf0c8 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -574,7 +574,7 @@ function getAchievementCurrency($userID, $aType) { case 3: $sql = "SELECT totalTies FROM `users` - WHERE `userID` = '$userID'"; + WHERE `ID` = '$userID'"; break; case 4: $sql = "SELECT championPoints -- cgit v1.2.3 From a6dd38b8debc789769fffd5c053d04bc888dcbbb Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Tue, 15 Jan 2013 01:05:26 -0600 Subject: BUGFIX: Updating high scores going super SUPER slow --- includes/playerStats.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'includes') diff --git a/includes/playerStats.php b/includes/playerStats.php index b302812..ec9a616 100644 --- a/includes/playerStats.php +++ b/includes/playerStats.php @@ -18,22 +18,17 @@ function setIsHighScoreFlag($fromDate) $fromDate = mysql_escape_string($fromDate); $sql = " - UPDATE solutions - SET solutions.isHighScore = 1 - WHERE solutions.ID IN + UPDATE solutions AS s1 + SET s1.isHighScore = 1 + WHERE s1.dateModified < CURDATE() + AND s1.dateModified >= '$fromDate' + AND s1.ID = ( SELECT s2.ID - FROM (SELECT * FROM solutions) AS s2 - INNER JOIN mapOfTheDay ON s2.mapID = mapOfTheDay.mapID - WHERE s2.ID = - ( - SELECT s3.ID - FROM (SELECT * FROM solutions) AS s3 - WHERE s3.mapID = s2.mapID - ORDER BY moves DESC, dateModified ASC - LIMIT 1 - ) - AND mapOfTheDay.mapDate >= '$fromDate' + FROM (SELECT ID, mapID, moves, dateModified FROM solutions) AS s2 + WHERE s2.mapID = s1.mapID + ORDER BY moves DESC, dateModified ASC + LIMIT 1 ) "; @@ -150,7 +145,7 @@ function addPlayerChampionPointsForMapsOfTheDay($fromDate) AND mapOfTheDay.mapDate < CURDATE() ) WHERE solutions.dateModified >= $fromDate; - AND mapOfTheDay.mapDate < CURDATE() + AND solutions.dateModified < CURDATE() "; $sql4 = " -- cgit v1.2.3