-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetGJScores20.php
More file actions
27 lines (26 loc) · 1 KB
/
Copy pathgetGJScores20.php
File metadata and controls
27 lines (26 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
include "connection.php";
$type = $_POST["type"];
if ($type == "top") {
$sql = "SELECT * FROM gdpsUsers WHERE blocked=0 ORDER BY stars DESC, demons DESC LIMIT 100";
} elseif ($type == "creator") {
$sql = "SELECT * FROM gdpsUsers WHERE blocked=0 AND creatorPoints > 0 ORDER BY creatorPoints DESC, stars DESC LIMIT 100";
} else {
die('-1');
}
$result = mysqli_query($conn, $sql) or die('-1');
if (mysqli_num_rows($result) == 0) {
die('-1');
}
$rank = 1;
$finalstring = '';
while ($row = mysqli_fetch_assoc($result)) {
if ($finalstring != '') {
$finalstring .= '|';
}
$finalstring .= "1:".$row["userName"].":2:".$row["userID"].":13:".$row["coins"].":17:".$row["userCoins"].":6:".$rank.":9:".$row["icon"].":10:".$row["color1"].":11:".$row["color2"].":14:".$row["iconType"].":15:".$row["special"].":16:".$row['accountID'].":3:".$row["stars"].":8:".$row["creatorPoints"].":4:".$row["demons"].":7:".$row["accountID"].":46:".$row["diamonds"];
$rank++;
}
echo $finalstring;
// TO DO LIST: GLOBAL AND FRIEND LEADERBOARD
?>