@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | define("DEBUG_MODE", true); |
| 6 | 6 | session_start(); |
| 7 | -if(defined("DEBUG_MODE") && DEBUG_MODE) { |
|
| 7 | +if (defined("DEBUG_MODE") && DEBUG_MODE) { |
|
| 8 | 8 | ini_set('display_errors', 1); |
| 9 | 9 | ini_set('display_startup_errors', 1); |
| 10 | 10 | error_reporting(E_ALL); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | function validateCaptcha($privatekey, $response) { |
| 30 | - $responseData = json_decode(file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$privatekey.'&response='.$response)); |
|
| 30 | + $responseData = json_decode(file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $privatekey . '&response=' . $response)); |
|
| 31 | 31 | return $responseData->success; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | $stmt->bind_param("s", $user); |
| 52 | 52 | $stmt->execute(); |
| 53 | 53 | $result = $stmt->get_result(); |
| 54 | - if($result->num_rows === 0) return 'error'; |
|
| 55 | - while($row = $result->fetch_assoc()) { |
|
| 54 | + if ($result->num_rows === 0) return 'error'; |
|
| 55 | + while ($row = $result->fetch_assoc()) { |
|
| 56 | 56 | $id = $row['id']; |
| 57 | 57 | } |
| 58 | 58 | $stmt->close(); |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | $stmt->bind_param("s", $id); |
| 65 | 65 | $stmt->execute(); |
| 66 | 66 | $result = $stmt->get_result(); |
| 67 | - if($result->num_rows === 0) return('error'); |
|
| 68 | - while($row = $result->fetch_assoc()) { |
|
| 67 | + if ($result->num_rows === 0) return('error'); |
|
| 68 | + while ($row = $result->fetch_assoc()) { |
|
| 69 | 69 | $name = htmlspecialchars($row['username']); |
| 70 | 70 | } |
| 71 | 71 | $stmt->close(); |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | $stmt->bind_param("s", $user); |
| 78 | 78 | $stmt->execute(); |
| 79 | 79 | $result = $stmt->get_result(); |
| 80 | - if($result->num_rows === 0) return('error'); |
|
| 81 | - while($row = $result->fetch_assoc()) { |
|
| 80 | + if ($result->num_rows === 0) return('error'); |
|
| 81 | + while ($row = $result->fetch_assoc()) { |
|
| 82 | 82 | $pfp = htmlspecialchars($row['pfp']); |
| 83 | 83 | } |
| 84 | 84 | $stmt->close(); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $stmt->bind_param("ssss", $friend1, $friend2, $friend2, $friend1); |
| 92 | 92 | $stmt->execute(); |
| 93 | 93 | $result = $stmt->get_result(); |
| 94 | - if($result->num_rows === 1){ return true; } |
|
| 94 | + if ($result->num_rows === 1) { return true; } |
|
| 95 | 95 | return false; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $stmt->bind_param("i", $id); |
| 102 | 102 | $stmt->execute(); |
| 103 | 103 | $result = $stmt->get_result(); |
| 104 | - if($result->num_rows === 0) echo('That user does not exist.'); |
|
| 105 | - while($row = $result->fetch_assoc()) { |
|
| 104 | + if ($result->num_rows === 0) echo('That user does not exist.'); |
|
| 105 | + while ($row = $result->fetch_assoc()) { |
|
| 106 | 106 | $userResult['username'] = $row['username']; |
| 107 | 107 | $userResult['id'] = $row['id']; |
| 108 | 108 | $userResult['date'] = $row['date']; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $result = $stmt->get_result(); |
| 123 | 123 | |
| 124 | 124 | $userResult['comments'] = 0; |
| 125 | - while($row = $result->fetch_assoc()) { |
|
| 125 | + while ($row = $result->fetch_assoc()) { |
|
| 126 | 126 | $userResult['comments']++; |
| 127 | 127 | } |
| 128 | 128 | $stmt->close(); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $result = $stmt->get_result(); |
| 134 | 134 | |
| 135 | 135 | $userResult['profilecomments'] = 0; |
| 136 | - while($row = $result->fetch_assoc()) { |
|
| 136 | + while ($row = $result->fetch_assoc()) { |
|
| 137 | 137 | $userResult['profilecomments']++; |
| 138 | 138 | } |
| 139 | 139 | $stmt->close(); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $result = $stmt->get_result(); |
| 145 | 145 | |
| 146 | 146 | $userResult['filesuploaded'] = 0; |
| 147 | - while($row = $result->fetch_assoc()) { |
|
| 147 | + while ($row = $result->fetch_assoc()) { |
|
| 148 | 148 | $userResult['filesuploaded']++; |
| 149 | 149 | } |
| 150 | 150 | $stmt->close(); |