@@ -18,8 +18,8 @@ |
||
| 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.'); |
|
| 22 | - while($row = $result->fetch_assoc()) { |
|
| 21 | + if ($result->num_rows === 0) echo('There are no users.'); |
|
| 22 | + while ($row = $result->fetch_assoc()) { |
|
| 23 | 23 | echo "<img style='position: absolute;border: 1px solid white; width: 5em;' src='/pfp/" . getPFP($row['author'], $conn) . "'> |
| 24 | 24 | <small> |
| 25 | 25 | <a href='/viewgroup?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>" . $row['title'] . "</a></i></span><br> |
@@ -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> |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 16 | - if(isset($_SESSION['user'])) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | + if (isset($_SESSION['user'])) { |
|
| 17 | 17 | $stmt = $conn->prepare("INSERT INTO files (type, title, extrainfo, author, filename) VALUES ('review', ?, ?, ?, '')"); |
| 18 | 18 | $stmt->bind_param("sss", $title, $description, $_SESSION['user']); |
| 19 | 19 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $stmt->execute(); |
| 35 | 35 | $result = $stmt->get_result(); |
| 36 | 36 | |
| 37 | - while($row = $result->fetch_assoc()) { |
|
| 37 | + while ($row = $result->fetch_assoc()) { |
|
| 38 | 38 | echo "<br><img style='position: absolute;border: 1px solid white; width: 5em;' src='/pfp/" . getPFP($row['author'], $conn) . "'> |
| 39 | 39 | <small> |
| 40 | 40 | <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br> |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require("dependencies.php"); |
| 3 | 3 | |
| 4 | -if(isset($_SESSION['user'])) { |
|
| 5 | - if(isset($_GET['id'])) { |
|
| 6 | - if(isAdmin($_SESSION['user'], $conn) == "admin") { |
|
| 4 | +if (isset($_SESSION['user'])) { |
|
| 5 | + if (isset($_GET['id'])) { |
|
| 6 | + if (isAdmin($_SESSION['user'], $conn) == "admin") { |
|
| 7 | 7 | $stmt = $conn->prepare("DELETE FROM users WHERE id = ?"); |
| 8 | 8 | $stmt->bind_param("i", $_GET['id']); |
| 9 | 9 | $stmt->execute(); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require("dependencies.php"); |
| 3 | 3 | |
| 4 | -if(isset($_SESSION['user'])) { |
|
| 5 | - if(isset($_GET['id'])) { |
|
| 6 | - if(isAdmin($_SESSION['user'], $conn) == "admin") { |
|
| 4 | +if (isset($_SESSION['user'])) { |
|
| 5 | + if (isset($_GET['id'])) { |
|
| 6 | + if (isAdmin($_SESSION['user'], $conn) == "admin") { |
|
| 7 | 7 | $stmt = $conn->prepare("UPDATE files SET status = 'd' WHERE id = ?"); |
| 8 | 8 | $stmt->bind_param("i", $_GET['id']); |
| 9 | 9 | $stmt->execute(); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | require("dependencies.php"); |
| 3 | 3 | |
| 4 | -if(isset($_SESSION['user'])) { |
|
| 5 | - if(isAdmin($_SESSION['user'], $conn) == "admin") { |
|
| 4 | +if (isset($_SESSION['user'])) { |
|
| 5 | + if (isAdmin($_SESSION['user'], $conn) == "admin") { |
|
| 6 | 6 | echo "<h1>Welcome</h1>"; |
| 7 | 7 | } else { |
| 8 | 8 | die("not a admin"); |
@@ -33,8 +33,8 @@ 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.'); |
|
| 37 | - while($row = $result->fetch_assoc()) { |
|
| 36 | + if ($result->num_rows === 0) echo('There are no items waiting for approval.'); |
|
| 37 | + while ($row = $result->fetch_assoc()) { |
|
| 38 | 38 | 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 | 39 | } |
| 40 | 40 | ?> |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC"); |
| 46 | 46 | $stmt->execute(); |
| 47 | 47 | $result = $stmt->get_result(); |
| 48 | - if($result->num_rows === 0) echo('There are no items waiting for approval.'); |
|
| 49 | - while($row = $result->fetch_assoc()) { |
|
| 48 | + if ($result->num_rows === 0) echo('There are no items waiting for approval.'); |
|
| 49 | + while ($row = $result->fetch_assoc()) { |
|
| 50 | 50 | echo "<a href='/index.php?id=" . $row['id'] . "'>" . $row['username'] . "</a> | <a href='ban.php?id=" . $row['id'] . "'>Ban</a><br>"; |
| 51 | 51 | } |
| 52 | 52 | ?> |
| 53 | 53 | \ No newline at end of file |
@@ -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 | } |
@@ -7,9 +7,9 @@ |
||
| 7 | 7 | $stmt->bind_param("s", $user); |
| 8 | 8 | $stmt->execute(); |
| 9 | 9 | $result = $stmt->get_result(); |
| 10 | - if($result->num_rows === 0) return "user doesn't exist"; |
|
| 11 | - while($row = $result->fetch_assoc()) { |
|
| 12 | - if($row['rank'] == "Admin" || $row['rank'] == "Owner") { |
|
| 10 | + if ($result->num_rows === 0) return "user doesn't exist"; |
|
| 11 | + while ($row = $result->fetch_assoc()) { |
|
| 12 | + if ($row['rank'] == "Admin" || $row['rank'] == "Owner") { |
|
| 13 | 13 | return "admin"; |
| 14 | 14 | } else { |
| 15 | 15 | return "not admin"; |
@@ -7,7 +7,9 @@ |
||
| 7 | 7 | $stmt->bind_param("s", $user); |
| 8 | 8 | $stmt->execute(); |
| 9 | 9 | $result = $stmt->get_result(); |
| 10 | - if($result->num_rows === 0) return "user doesn't exist"; |
|
| 10 | + if($result->num_rows === 0) { |
|
| 11 | + return "user doesn't exist"; |
|
| 12 | + } |
|
| 11 | 13 | while($row = $result->fetch_assoc()) { |
| 12 | 14 | if($row['rank'] == "Admin" || $row['rank'] == "Owner") { |
| 13 | 15 | return "admin"; |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require("dependencies.php"); |
| 3 | 3 | |
| 4 | -if(isset($_SESSION['user'])) { |
|
| 5 | - if(isset($_GET['id'])) { |
|
| 6 | - if(isAdmin($_SESSION['user'], $conn) == "admin") { |
|
| 4 | +if (isset($_SESSION['user'])) { |
|
| 5 | + if (isset($_GET['id'])) { |
|
| 6 | + if (isAdmin($_SESSION['user'], $conn) == "admin") { |
|
| 7 | 7 | $stmt = $conn->prepare("UPDATE files SET status = 'y' WHERE id = ?"); |
| 8 | 8 | $stmt->bind_param("i", $_GET['id']); |
| 9 | 9 | $stmt->execute(); |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 16 | - if(isset($_SESSION['user'])) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | + if (isset($_SESSION['user'])) { |
|
| 17 | 17 | $target_dir = __DIR__ . "/midis/"; |
| 18 | 18 | $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); |
| 19 | 19 | $uploadOk = 1; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | echo 'file with the same name already exists<hr>'; |
| 24 | 24 | $uploadOk = 0; |
| 25 | 25 | } |
| 26 | - if($imageFileType != "xm" && $imageFileType != "mod" && $imageFileType != "s3m" && $imageFileType != "it") { |
|
| 26 | + if ($imageFileType != "xm" && $imageFileType != "mod" && $imageFileType != "s3m" && $imageFileType != "it") { |
|
| 27 | 27 | echo 'unsupported file type. must be .xm, .mod, .s3m, or .it<hr>'; |
| 28 | 28 | $uploadOk = 0; |
| 29 | 29 | } |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 16 | - if(isset($_SESSION['user'])) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | + if (isset($_SESSION['user'])) { |
|
| 17 | 17 | $stmt = $conn->prepare("INSERT INTO files (type, title, extrainfo, author, filename) VALUES ('review', ?, ?, ?, '')"); |
| 18 | 18 | $stmt->bind_param("sss", $title, $description, $_SESSION['user']); |
| 19 | 19 | |