@@ -12,7 +12,9 @@ |
||
| 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']; |
@@ -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 | } |
@@ -44,7 +44,9 @@ discard block |
||
| 44 | 44 | $stmt->bind_param("s", $user); |
| 45 | 45 | $stmt->execute(); |
| 46 | 46 | $result = $stmt->get_result(); |
| 47 | - if($result->num_rows === 0) return 'error'; |
|
| 47 | + if($result->num_rows === 0) { |
|
| 48 | + return 'error'; |
|
| 49 | + } |
|
| 48 | 50 | while($row = $result->fetch_assoc()) { |
| 49 | 51 | $id = $row['id']; |
| 50 | 52 | } |
@@ -57,7 +59,9 @@ discard block |
||
| 57 | 59 | $stmt->bind_param("s", $id); |
| 58 | 60 | $stmt->execute(); |
| 59 | 61 | $result = $stmt->get_result(); |
| 60 | - if($result->num_rows === 0) return('error'); |
|
| 62 | + if($result->num_rows === 0) { |
|
| 63 | + return('error'); |
|
| 64 | + } |
|
| 61 | 65 | while($row = $result->fetch_assoc()) { |
| 62 | 66 | $name = htmlspecialchars($row['username']); |
| 63 | 67 | } |
@@ -70,7 +74,9 @@ discard block |
||
| 70 | 74 | $stmt->bind_param("s", $user); |
| 71 | 75 | $stmt->execute(); |
| 72 | 76 | $result = $stmt->get_result(); |
| 73 | - if($result->num_rows === 0) return('error'); |
|
| 77 | + if($result->num_rows === 0) { |
|
| 78 | + return('error'); |
|
| 79 | + } |
|
| 74 | 80 | while($row = $result->fetch_assoc()) { |
| 75 | 81 | $pfp = htmlspecialchars($row['pfp']); |
| 76 | 82 | } |
@@ -98,7 +104,9 @@ discard block |
||
| 98 | 104 | $stmt->bind_param("i", $id); |
| 99 | 105 | $stmt->execute(); |
| 100 | 106 | $result = $stmt->get_result(); |
| 101 | - if($result->num_rows === 0) echo('That user does not exist.'); |
|
| 107 | + if($result->num_rows === 0) { |
|
| 108 | + echo('That user does not exist.'); |
|
| 109 | + } |
|
| 102 | 110 | while($row = $result->fetch_assoc()) { |
| 103 | 111 | $username = $row['username']; |
| 104 | 112 | $id = $row['id']; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | while($row = $result->fetch_assoc()) { |
| 43 | 43 | $grouptitle = $row['title']; |
| 44 | 44 | } |
| 45 | - }else{ |
|
| 45 | + } else{ |
|
| 46 | 46 | $grouptitle = "none"; |
| 47 | 47 | } |
| 48 | 48 | $stmt->close(); |
@@ -168,7 +168,9 @@ discard block |
||
| 168 | 168 | $stmt->bind_param("s", $username); |
| 169 | 169 | $stmt->execute(); |
| 170 | 170 | $result = $stmt->get_result(); |
| 171 | - if($result->num_rows > 0) echo('<h1>Files</h1>'); |
|
| 171 | + if($result->num_rows > 0) { |
|
| 172 | + echo('<h1>Files</h1>'); |
|
| 173 | + } |
|
| 172 | 174 | |
| 173 | 175 | while($row = $result->fetch_assoc()) { |
| 174 | 176 | echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>'; |
@@ -261,7 +263,9 @@ discard block |
||
| 261 | 263 | $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC"); |
| 262 | 264 | $stmt->execute(); |
| 263 | 265 | $result = $stmt->get_result(); |
| 264 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 266 | + if($result->num_rows === 0) { |
|
| 267 | + echo('There are no users.'); |
|
| 268 | + } |
|
| 265 | 269 | while($row = $result->fetch_assoc()) { |
| 266 | 270 | $id = 1; |
| 267 | 271 | echo "<div class='item" . $id . "'><img style='height: 8em;width: 8em;' src='/pfp/" . getPFP($row['username'], $conn) . "'><br><a href='/?id=" . $row['id'] . "'>" . $row['username'] . "</a></div>"; |
@@ -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 | |
@@ -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++; |
@@ -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='/pfp/" . getPFP($row['author'], $conn) . "'> |
| 24 | 26 | <small> |
@@ -33,7 +33,9 @@ discard block |
||
| 33 | 33 | $stmt = $conn->prepare("SELECT * FROM files WHERE status = 'n'"); |
| 34 | 34 | $stmt->execute(); |
| 35 | 35 | $result = $stmt->get_result(); |
| 36 | - if($result->num_rows === 0) echo('There are no items waiting for approval.'); |
|
| 36 | + if($result->num_rows === 0) { |
|
| 37 | + echo('There are no items waiting for approval.'); |
|
| 38 | + } |
|
| 37 | 39 | while($row = $result->fetch_assoc()) { |
| 38 | 40 | echo "" . $row['title'] . " by " . $row['author'] . " @ " . $row['date'] . " | <a href='approve.php?id=" . $row['id'] . "'>Approve</a> | <a href='deny.php?id=" . $row['id'] . "'>Deny</a><br>"; |
| 39 | 41 | } |
@@ -45,7 +47,9 @@ discard block |
||
| 45 | 47 | $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC"); |
| 46 | 48 | $stmt->execute(); |
| 47 | 49 | $result = $stmt->get_result(); |
| 48 | - if($result->num_rows === 0) echo('There are no items waiting for approval.'); |
|
| 50 | + if($result->num_rows === 0) { |
|
| 51 | + echo('There are no items waiting for approval.'); |
|
| 52 | + } |
|
| 49 | 53 | while($row = $result->fetch_assoc()) { |
| 50 | 54 | echo "<a href='/index.php?id=" . $row['id'] . "'>" . $row['username'] . "</a> | <a href='ban.php?id=" . $row['id'] . "'>Ban</a><br>"; |
| 51 | 55 | } |