@@ -17,7 +17,9 @@ |
||
| 17 | 17 | $stmt->bind_param("si", $_SESSION['user'], $_GET['id']); |
| 18 | 18 | $stmt->execute(); |
| 19 | 19 | $result = $stmt->get_result(); |
| 20 | - if($result->num_rows === 0) die('Item doesnt exist or item isnt made by you.'); |
|
| 20 | + if($result->num_rows === 0) { |
|
| 21 | + die('Item doesnt exist or item isnt made by you.'); |
|
| 22 | + } |
|
| 21 | 23 | } else { |
| 22 | 24 | header("Location: index.php"); |
| 23 | 25 | } |
@@ -9,7 +9,9 @@ |
||
| 9 | 9 | $stmt->bind_param("s", $_SESSION['user']); |
| 10 | 10 | $stmt->execute(); |
| 11 | 11 | $result = $stmt->get_result(); |
| 12 | - if($result->num_rows === 0) header('Location: index.php'); |
|
| 12 | + if($result->num_rows === 0) { |
|
| 13 | + header('Location: index.php'); |
|
| 14 | + } |
|
| 13 | 15 | while($row = $result->fetch_assoc()) { |
| 14 | 16 | $username = $row['username']; |
| 15 | 17 | $id = $row['id']; |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | $stmt->execute(); |
| 6 | 6 | $result = $stmt->get_result(); |
| 7 | 7 | |
| 8 | - if($result->num_rows == 0) echo('welcome to gamestop how may i help you'); |
|
| 8 | + if($result->num_rows == 0) { |
|
| 9 | + echo('welcome to gamestop how may i help you'); |
|
| 10 | + } |
|
| 9 | 11 | } |
| 10 | 12 | ?> |
| 11 | 13 | |
@@ -12,7 +12,9 @@ discard block |
||
| 12 | 12 | $stmt->bind_param("i", $_GET['id']); |
| 13 | 13 | $stmt->execute(); |
| 14 | 14 | $result = $stmt->get_result(); |
| 15 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 15 | + if($result->num_rows === 0) { |
|
| 16 | + echo('There are no users.'); |
|
| 17 | + } |
|
| 16 | 18 | while($row = $result->fetch_assoc()) { |
| 17 | 19 | $author = $row['author']; |
| 18 | 20 | $id = $row['id']; |
@@ -215,12 +217,13 @@ discard block |
||
| 215 | 217 | <form method="post" enctype="multipart/form-data" id="submitform"> |
| 216 | 218 | <textarea required cols="77" placeholder="Comment" name="comment"></textarea><br> |
| 217 | 219 | <input type="submit" value="Post" <?php |
| 218 | - if ($config['use_recaptcha']) |
|
| 219 | - echo 'class="g-recaptcha" data-sitekey="' . $config['recaptcha_sitekey'] . '" data-callback="onSubmit"' |
|
| 220 | + if ($config['use_recaptcha']) { |
|
| 221 | + echo 'class="g-recaptcha" data-sitekey="' . $config['recaptcha_sitekey'] . '" data-callback="onSubmit"' |
|
| 220 | 222 | ?>> <small>max limit: 500 characters | supports <a href="https://www.markdownguide.org/basic-syntax">Markdown</a></small> |
| 221 | 223 | </form> |
| 222 | 224 | <?php |
| 223 | 225 | $stmt = $conn->prepare("SELECT * FROM `gamecomments` WHERE toid = ? ORDER BY id DESC"); |
| 226 | + } |
|
| 224 | 227 | $stmt->bind_param("s", $_GET['id']); |
| 225 | 228 | $stmt->execute(); |
| 226 | 229 | $result = $stmt->get_result(); |
@@ -50,7 +50,9 @@ discard block |
||
| 50 | 50 | $stmt->bind_param("i", $_GET['id']); |
| 51 | 51 | $stmt->execute(); |
| 52 | 52 | $result = $stmt->get_result(); |
| 53 | - if($result->num_rows === 0) echo('Group doesnt exist.'); |
|
| 53 | + if($result->num_rows === 0) { |
|
| 54 | + echo('Group doesnt exist.'); |
|
| 55 | + } |
|
| 54 | 56 | while($row = $result->fetch_assoc()) { |
| 55 | 57 | $id = $row['id']; |
| 56 | 58 | ?> |
@@ -80,7 +82,9 @@ discard block |
||
| 80 | 82 | $stmt->bind_param("i", $id); |
| 81 | 83 | $stmt->execute(); |
| 82 | 84 | $result = $stmt->get_result(); |
| 83 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 85 | + if($result->num_rows === 0) { |
|
| 86 | + echo('There are no users.'); |
|
| 87 | + } |
|
| 84 | 88 | $members = 0; |
| 85 | 89 | while($row = $result->fetch_assoc()) { |
| 86 | 90 | $members++; |
@@ -99,7 +99,9 @@ |
||
| 99 | 99 | $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC"); |
| 100 | 100 | $stmt->execute(); |
| 101 | 101 | $result = $stmt->get_result(); |
| 102 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 102 | + if($result->num_rows === 0) { |
|
| 103 | + echo('There are no users.'); |
|
| 104 | + } |
|
| 103 | 105 | while($row = $result->fetch_assoc()) { |
| 104 | 106 | $id = 1; |
| 105 | 107 | echo "<div class='item" . $id . "'><img style='height: 8em;width: 8em;' src='/dynamic/pfp/" . getPFP($row['username'], $conn) . "'><br><a href='/view/profile?id=" . $row['id'] . "'>" . $row['username'] . "</a></div>"; |
@@ -18,7 +18,9 @@ |
||
| 18 | 18 | $stmt = $conn->prepare("SELECT * FROM `groups` ORDER BY id DESC"); |
| 19 | 19 | $stmt->execute(); |
| 20 | 20 | $result = $stmt->get_result(); |
| 21 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 21 | + if($result->num_rows === 0) { |
|
| 22 | + echo('There are no users.'); |
|
| 23 | + } |
|
| 22 | 24 | while($row = $result->fetch_assoc()) { |
| 23 | 25 | echo "<img style='position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'> |
| 24 | 26 | <small> |
@@ -95,7 +95,9 @@ |
||
| 95 | 95 | $stmt->bind_param("s", $username); |
| 96 | 96 | $stmt->execute(); |
| 97 | 97 | $result = $stmt->get_result(); |
| 98 | - if($result->num_rows > 0) echo('<h1>Files</h1>'); |
|
| 98 | + if($result->num_rows > 0) { |
|
| 99 | + echo('<h1>Files</h1>'); |
|
| 100 | + } |
|
| 99 | 101 | |
| 100 | 102 | while($row = $result->fetch_assoc()) { |
| 101 | 103 | echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>'; |
@@ -45,7 +45,9 @@ discard block |
||
| 45 | 45 | $stmt->bind_param("i", $id); |
| 46 | 46 | $stmt->execute(); |
| 47 | 47 | $result = $stmt->get_result(); |
| 48 | - if ($result->num_rows === 0) return 'error'; |
|
| 48 | + if ($result->num_rows === 0) { |
|
| 49 | + return 'error'; |
|
| 50 | + } |
|
| 49 | 51 | return $result->fetch_assoc(); |
| 50 | 52 | } |
| 51 | 53 | |
@@ -54,7 +56,9 @@ discard block |
||
| 54 | 56 | $stmt->bind_param("s", $user); |
| 55 | 57 | $stmt->execute(); |
| 56 | 58 | $result = $stmt->get_result(); |
| 57 | - if($result->num_rows === 0) return 'error'; |
|
| 59 | + if($result->num_rows === 0) { |
|
| 60 | + return 'error'; |
|
| 61 | + } |
|
| 58 | 62 | while($row = $result->fetch_assoc()) { |
| 59 | 63 | $id = $row['id']; |
| 60 | 64 | } |
@@ -67,7 +71,9 @@ discard block |
||
| 67 | 71 | $stmt->bind_param("s", $id); |
| 68 | 72 | $stmt->execute(); |
| 69 | 73 | $result = $stmt->get_result(); |
| 70 | - if($result->num_rows === 0) return('error'); |
|
| 74 | + if($result->num_rows === 0) { |
|
| 75 | + return('error'); |
|
| 76 | + } |
|
| 71 | 77 | while($row = $result->fetch_assoc()) { |
| 72 | 78 | $name = htmlspecialchars($row['username']); |
| 73 | 79 | } |
@@ -80,7 +86,9 @@ discard block |
||
| 80 | 86 | $stmt->bind_param("s", $user); |
| 81 | 87 | $stmt->execute(); |
| 82 | 88 | $result = $stmt->get_result(); |
| 83 | - if($result->num_rows === 0) return('error'); |
|
| 89 | + if($result->num_rows === 0) { |
|
| 90 | + return('error'); |
|
| 91 | + } |
|
| 84 | 92 | while($row = $result->fetch_assoc()) { |
| 85 | 93 | $pfp = htmlspecialchars($row['pfp']); |
| 86 | 94 | } |
@@ -103,7 +111,9 @@ discard block |
||
| 103 | 111 | $stmt->bind_param("s", $user); |
| 104 | 112 | $stmt->execute(); |
| 105 | 113 | $result = $stmt->get_result(); |
| 106 | - if($result->num_rows === 0) return false; |
|
| 114 | + if($result->num_rows === 0) { |
|
| 115 | + return false; |
|
| 116 | + } |
|
| 107 | 117 | while($row = $result->fetch_assoc()) { |
| 108 | 118 | if($row['rank'] == "Admin" || $row['rank'] == "Owner") { |
| 109 | 119 | return true; |
@@ -120,7 +130,9 @@ discard block |
||
| 120 | 130 | $stmt->bind_param("i", $id); |
| 121 | 131 | $stmt->execute(); |
| 122 | 132 | $result = $stmt->get_result(); |
| 123 | - if($result->num_rows === 0) echo('That user does not exist.'); |
|
| 133 | + if($result->num_rows === 0) { |
|
| 134 | + echo('That user does not exist.'); |
|
| 135 | + } |
|
| 124 | 136 | while($row = $result->fetch_assoc()) { |
| 125 | 137 | $userResult['username'] = $row['username']; |
| 126 | 138 | $userResult['id'] = $row['id']; |