@@ -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 "<a href='/view/?id=" . $row['id'] . "'>" . $row['title'] . "</a> by <a href='/view/profile?id=" . getID($row['author'], $conn) . "'>" . $row['author'] . "</a> @ " . $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 | } |
@@ -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']; |