From b40457114a6f5796229357555c80dfef74937a40 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Sat, 9 Feb 2013 15:37:46 -0800 Subject: Code cleanup / deletions. --- includes/datas.php | 145 +---------------------------------------------------- 1 file changed, 1 insertion(+), 144 deletions(-) (limited to 'includes/datas.php') diff --git a/includes/datas.php b/includes/datas.php index 3f65466..c64edd6 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -9,69 +9,6 @@ include_once('constants.php'); //require_once('includes/FirePHPCore/FirePHP.class.php'); //FirePHP stuff - TODO: Delete -//Select Stats/Scores. -function topScores($mapid, $top = 5, $bottom = 0) { - $sql = " - SELECT - timediff(solutions.dateModified, TIMESTAMP(CURDATE())) as diff, - users.displayName as display, - solutions.moves as m, - users.ID as ID, - users.displayColor, - users.wallColor, - users.wallEmblem, - solutions.dateModified as cdate - FROM - `users` - JOIN `solutions` - ON users.ID = solutions.userID - WHERE solutions.mapID = '$mapid' - ORDER BY solutions.moves DESC, solutions.dateModified ASC - LIMIT $bottom, $top - "; - $result = mysql_query($sql) or die(mysql_error()); - $utime = date("g:i A (T)"); - $output = ""; - $output .= ""; - $output .= ""; - $output .= ""; - $output .= ""; - $output .= ""; - //$output .= ""; - $output .= ""; - while (list($diff, $display, $moves, $userID, $displayColor, $wallColor, $wallEmblem, $cdate) = mysql_fetch_row($result)) { - $i++; - - //$cdate = date("g:i A (T)", strtotime($cdate)); - $cdate = relativeTime(strtotime($cdate)); - - $background = '#262631'; - if ($i % 2 == 1) - $background = '#20202a'; - - if ($_SESSION['userID'] == $userID) - $background = '#343c57'; - //$background = '#356'; - - $output .= " $top) - // continue; - // if ($i <= $bottom) - // continue; - // } - if ($wallEmblem == '') - $wallEmblem = 'blank.png'; - - $cdate = $row['cdate']; - $cdate = date("g:i A (T)", strtotime($cdate)); - $row['dateJoined'] = Date("Y-m-d", strtotime($row['dateJoined'])); $row['dateLogin'] = Date("Y-m-d", strtotime($row['dateLogin'])); @@ -834,43 +754,12 @@ function getMembers($pageNumber = 1, $pageDivide = 50, $order = 'DESC', $orderBy $foundUser = true; } - // if is blind map. - // $row['moves'] = '???'; - $output['users'][$i] = $row; - $output['users'][$i]['scoredDate'] = $cdate; $output['users'][$i]['secondsSinceScored'] = $secondsSinceScored; $output['users'][$i]['background'] = $background; - $output['users'][$i]['medal'] = $medal; $output['users'][$i]['isUser'] = $userPosition == $i; - //$output['users'][$i]['debug'] = "Bestmoves: $bestMoves moves: $moves"; } // END WHILE - //Need to look this up. - //$output['pageCount'] = ceil(($i / $pageDivide)); - //$output['pageCount'] = 5; - if ($prevPage > 0) { - $navi .= " << "; - $navi .= " < "; - } else { - $navi .= " << "; - $navi .= " <"; - } - for ($x = 1; $x <= $pageCount; $x++) { - if ($x < $pageNumber - 3 OR $x > $pageNumber + 3) - continue; - if ($x == $pageNumber) - $navi .= " $x "; - elseif ($userPage == $x) - $navi .= " $x "; - else - $navi .= " $x "; - } - if ($nextPage <= $pageCount) { - $navi .= " > "; - $navi .= " >> "; - } - return $output; } @@ -962,12 +851,6 @@ function getScores($mapID, $pageNumber = 1, $pageDivide = 10) { continue; } - if ($wallEmblem == '') - $wallEmblem = 'blank.png'; - - $cdate = $row['cdate']; - $cdate = date("g:i A (T)", strtotime($cdate)); - $scoredDate = strtotime($row['cdate']); $secondsSinceScored = strtotime("now") - $scoredDate ; @@ -988,16 +871,13 @@ function getScores($mapID, $pageNumber = 1, $pageDivide = 10) { $medal = 'gold'; // if is blind map. - if ($isBlindMap AND $myBestMoves < $moves) - $row['moves'] = '???'; + if ($isBlindMap AND $myBestMoves < $moves) $row['moves'] = '???'; $output['users'][$i] = $row; - $output['users'][$i]['scoredDate'] = $cdate; $output['users'][$i]['secondsSinceScored'] = $secondsSinceScored; $output['users'][$i]['background'] = $background; $output['users'][$i]['medal'] = $medal; $output['users'][$i]['isUser'] = $userPosition == $i; - //$output['users'][$i]['debug'] = "Bestmoves: $bestMoves moves: $moves"; } // END WHILE if ($foundUser) { @@ -1007,29 +887,6 @@ function getScores($mapID, $pageNumber = 1, $pageDivide = 10) { } $output['pageCount'] = ceil(($i / $pageDivide)); - - if ($prevPage > 0) { - $navi .= " << "; - $navi .= " < "; - } else { - $navi .= " << "; - $navi .= " <"; - } - for ($x = 1; $x <= $pageCount; $x++) { - if ($x < $pageNumber - 3 OR $x > $pageNumber + 3) - continue; - if ($x == $pageNumber) - $navi .= " $x "; - elseif ($userPage == $x) - $navi .= " $x "; - else - $navi .= " $x "; - } - if ($nextPage <= $pageCount) { - $navi .= " > "; - $navi .= " >> "; - } - return $output; } -- cgit v1.2.3
RankBadgeNameMovesTime