@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | while($row = $result->fetch_assoc()) { |
| 46 | 46 | $grouptitle = $row['title']; |
| 47 | 47 | } |
| 48 | - }else{ |
|
| 48 | + } else{ |
|
| 49 | 49 | $grouptitle = "none"; |
| 50 | 50 | } |
| 51 | 51 | $stmt->close(); |
@@ -143,7 +143,9 @@ discard block |
||
| 143 | 143 | $stmt->bind_param("s", $username); |
| 144 | 144 | $stmt->execute(); |
| 145 | 145 | $result = $stmt->get_result(); |
| 146 | - if($result->num_rows > 0) echo('<h1>Files</h1>'); |
|
| 146 | + if($result->num_rows > 0) { |
|
| 147 | + echo('<h1>Files</h1>'); |
|
| 148 | + } |
|
| 147 | 149 | |
| 148 | 150 | while($row = $result->fetch_assoc()) { |
| 149 | 151 | echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>'; |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | <div id="bio" class="notegray"> |
| 170 | 170 | <h1>Bio</h1> |
| 171 | 171 | <?php //echo validateMarkdown($bio); |
| 172 | - echo validateMarkdown($bio); |
|
| 173 | - ?> |
|
| 172 | + echo validateMarkdown($bio); |
|
| 173 | + ?> |
|
| 174 | 174 | </div><br><br> |
| 175 | 175 | <div id='comments'> |
| 176 | 176 | <?php |
@@ -185,9 +185,9 @@ discard block |
||
| 185 | 185 | <small><?php echo $row['date']; ?></small> |
| 186 | 186 | <br> |
| 187 | 187 | <?php |
| 188 | - $forbidden = array("javascript", "</script>", "<script>", "src="); |
|
| 189 | - echo validateMarkdown($row['text']); |
|
| 190 | - ?> |
|
| 188 | + $forbidden = array("javascript", "</script>", "<script>", "src="); |
|
| 189 | + echo validateMarkdown($row['text']); |
|
| 190 | + ?> |
|
| 191 | 191 | </div> |
| 192 | 192 | <div> |
| 193 | 193 | <a style='float: right;' href='/view/profile?id=<?php echo getID($row['author'], $conn); ?>'><?php echo $row['author']; ?></a> |
@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | $stmt->bind_param("i", $_GET['id']); |
| 17 | 17 | $stmt->execute(); |
| 18 | 18 | $result = $stmt->get_result(); |
| 19 | - if($result->num_rows !== 0){ // echo('There are no users.'); // please just refuse to give a user if this is the case |
|
| 20 | - while($row = $result->fetch_assoc()) { // you dont need to use a loop if its only ever gonna return 1 or 0 |
|
| 19 | + if ($result->num_rows !== 0) { // echo('There are no users.'); // please just refuse to give a user if this is the case |
|
| 20 | + while ($row = $result->fetch_assoc()) { // you dont need to use a loop if its only ever gonna return 1 or 0 |
|
| 21 | 21 | $username = $row['username']; // you dont actually need all of these variables oh my god just use an array |
| 22 | 22 | $id = $row['id']; |
| 23 | 23 | $date = $row['date']; |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | $stmt->bind_param("i", $currentgroup); |
| 42 | 42 | $stmt->execute(); |
| 43 | 43 | $result = $stmt->get_result(); |
| 44 | - if($result->num_rows !== 0){ //echo('There are no users.'); // why again |
|
| 45 | - while($row = $result->fetch_assoc()) { |
|
| 44 | + if ($result->num_rows !== 0) { //echo('There are no users.'); // why again |
|
| 45 | + while ($row = $result->fetch_assoc()) { |
|
| 46 | 46 | $grouptitle = $row['title']; |
| 47 | 47 | } |
| 48 | - }else{ |
|
| 48 | + } else { |
|
| 49 | 49 | $grouptitle = "none"; |
| 50 | 50 | } |
| 51 | 51 | $stmt->close(); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $result = $stmt->get_result(); |
| 57 | 57 | |
| 58 | 58 | $comments = 0; |
| 59 | - while($row = $result->fetch_assoc()) { |
|
| 59 | + while ($row = $result->fetch_assoc()) { |
|
| 60 | 60 | $comments++; |
| 61 | 61 | } |
| 62 | 62 | $stmt->close(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $result = $stmt->get_result(); |
| 68 | 68 | |
| 69 | 69 | $profilecomments = 0; |
| 70 | - while($row = $result->fetch_assoc()) { |
|
| 70 | + while ($row = $result->fetch_assoc()) { |
|
| 71 | 71 | $profilecomments++; |
| 72 | 72 | } |
| 73 | 73 | $stmt->close(); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $result = $stmt->get_result(); |
| 79 | 79 | |
| 80 | 80 | $filesuploaded = 0; |
| 81 | - while($row = $result->fetch_assoc()) { |
|
| 81 | + while ($row = $result->fetch_assoc()) { |
|
| 82 | 82 | $filesuploaded++; |
| 83 | 83 | } |
| 84 | 84 | $stmt->close(); |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | </center> |
| 97 | 97 | <hr style="border-top: 1px dashed gray;"> |
| 98 | 98 | <div id="userinfo" style="padding-left: 20px;"> |
| 99 | - <span style="color: gold;">Rank:</span> <?php echo $rank;?><br> |
|
| 100 | - <span style="color: gold;">ID:</span> <?php echo $id;?><br> |
|
| 101 | - <span style="color: gold;">Other Comments:</span> <?php echo $comments;?><br> |
|
| 102 | - <span style="color: gold;">Profile Comments:</span> <?php echo $profilecomments;?><br> |
|
| 103 | - <span style="color: gold;">Current Group:</span> <?php echo $grouptitle;?><br> |
|
| 104 | - <span style="color: gold;">Files Uploaded:</span> <?php echo $filesuploaded;?> |
|
| 99 | + <span style="color: gold;">Rank:</span> <?php echo $rank; ?><br> |
|
| 100 | + <span style="color: gold;">ID:</span> <?php echo $id; ?><br> |
|
| 101 | + <span style="color: gold;">Other Comments:</span> <?php echo $comments; ?><br> |
|
| 102 | + <span style="color: gold;">Profile Comments:</span> <?php echo $profilecomments; ?><br> |
|
| 103 | + <span style="color: gold;">Current Group:</span> <?php echo $grouptitle; ?><br> |
|
| 104 | + <span style="color: gold;">Files Uploaded:</span> <?php echo $filesuploaded; ?> |
|
| 105 | 105 | </div><br> |
| 106 | 106 | <?php if (!isset($_GET["ed"])) { ?> |
| 107 | 107 | <audio autoplay controls> |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | <br> |
| 113 | 113 | <div class="notegray"> |
| 114 | 114 | <?php |
| 115 | - if($_SERVER['REQUEST_METHOD'] == 'POST') |
|
| 115 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') |
|
| 116 | 116 | { |
| 117 | - if(!isset($_SESSION['user'])){ $error = "you are not logged in"; goto skipcomment; } |
|
| 118 | - if(!$_POST['comment']){ $error = "your comment cannot be blank"; goto skipcomment; } |
|
| 119 | - if(strlen($_POST['comment']) > 500){ $error = "your comment must be shorter than 500 characters"; goto skipcomment; } |
|
| 117 | + if (!isset($_SESSION['user'])) { $error = "you are not logged in"; goto skipcomment; } |
|
| 118 | + if (!$_POST['comment']) { $error = "your comment cannot be blank"; goto skipcomment; } |
|
| 119 | + if (strlen($_POST['comment']) > 500) { $error = "your comment must be shorter than 500 characters"; goto skipcomment; } |
|
| 120 | 120 | |
| 121 | 121 | $stmt = $conn->prepare("INSERT INTO `comments` (toid, author, text) VALUES (?, ?, ?)"); |
| 122 | 122 | $stmt->bind_param("sss", $_GET['id'], $_SESSION['user'], $text); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | skipcomment: |
| 130 | 130 | |
| 131 | - if(isset($error)) { echo "<small style='color:red'>".$error."</small>"; } ?> |
|
| 131 | + if (isset($error)) { echo "<small style='color:red'>" . $error . "</small>"; } ?> |
|
| 132 | 132 | <h2>Comment</h2> |
| 133 | 133 | <form method="post" enctype="multipart/form-data"> |
| 134 | 134 | <textarea required cols="33" placeholder="Comment" name="comment"></textarea><br> |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | <div id="badges" class="notegray"> |
| 148 | 148 | <h1>Badges</h1> |
| 149 | 149 | <?php |
| 150 | - foreach($badges as $badge) { |
|
| 151 | - if($badge == "good") { |
|
| 150 | + foreach ($badges as $badge) { |
|
| 151 | + if ($badge == "good") { |
|
| 152 | 152 | echo "<img width='70px;' height='70px;' src='https://cdn.discordapp.com/attachments/740680780740821105/740776214523936808/340juojg3h.png'>"; |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -160,10 +160,10 @@ discard block |
||
| 160 | 160 | $stmt->bind_param("s", $username); |
| 161 | 161 | $stmt->execute(); |
| 162 | 162 | $result = $stmt->get_result(); |
| 163 | - if($result->num_rows > 0) echo('<h1>Files</h1>'); |
|
| 163 | + if ($result->num_rows > 0) echo('<h1>Files</h1>'); |
|
| 164 | 164 | |
| 165 | - while($row = $result->fetch_assoc()) { |
|
| 166 | - echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>'; |
|
| 165 | + while ($row = $result->fetch_assoc()) { |
|
| 166 | + echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [', $row['type'] . ']</a><br>'; |
|
| 167 | 167 | }?> |
| 168 | 168 | </div><br> |
| 169 | 169 | <div id="bio" class="notegray"> |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $stmt->execute(); |
| 180 | 180 | $result = $stmt->get_result(); |
| 181 | 181 | |
| 182 | - while($row = $result->fetch_assoc()) { ?> |
|
| 182 | + while ($row = $result->fetch_assoc()) { ?> |
|
| 183 | 183 | <div class='commentRight' style='display: grid; grid-template-columns: 75% auto; padding:5px;'> |
| 184 | 184 | <div style="word-wrap: break-word;"> |
| 185 | 185 | <small><?php echo $row['date']; ?></small> |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | require(__DIR__ . "/../func/func.php"); |
| 8 | 8 | require(__DIR__ . "/../func/conn.php"); |
| 9 | 9 | |
| 10 | - if(isset($_GET['id'])) { |
|
| 10 | + if (isset($_GET['id'])) { |
|
| 11 | 11 | $stmt = $conn->prepare("SELECT * FROM files WHERE id = ?"); |
| 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.'); |
|
| 16 | - while($row = $result->fetch_assoc()) { |
|
| 15 | + if ($result->num_rows === 0) echo('There are no users.'); |
|
| 16 | + while ($row = $result->fetch_assoc()) { |
|
| 17 | 17 | $author = $row['author']; |
| 18 | 18 | $id = $row['id']; |
| 19 | 19 | $date = $row['date']; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $status = $row['status']; |
| 24 | 24 | $filename = $row['filename']; |
| 25 | 25 | |
| 26 | - if($status != "y") { |
|
| 26 | + if ($status != "y") { |
|
| 27 | 27 | die("Item is not approved yet."); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | <div class="container"> |
| 39 | 39 | <?php |
| 40 | - if($_SERVER['REQUEST_METHOD'] == 'POST') |
|
| 40 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') |
|
| 41 | 41 | { |
| 42 | - if(!isset($_SESSION['user'])){ $error = "you are not logged in"; goto skipcomment; } |
|
| 43 | - if(!$_POST['comment']){ $error = "your comment cannot be blank"; goto skipcomment; } |
|
| 44 | - if(strlen($_POST['comment']) > 500){ $error = "your comment must be shorter than 500 characters"; goto skipcomment; } |
|
| 45 | - if(!isset($_POST['g-recaptcha-response'])) { $error = "captcha validation failed"; goto skipcomment; } |
|
| 46 | - if($config['use_recaptcha'] && !validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error = "captcha validation failed"; goto skipcomment; } |
|
| 42 | + if (!isset($_SESSION['user'])) { $error = "you are not logged in"; goto skipcomment; } |
|
| 43 | + if (!$_POST['comment']) { $error = "your comment cannot be blank"; goto skipcomment; } |
|
| 44 | + if (strlen($_POST['comment']) > 500) { $error = "your comment must be shorter than 500 characters"; goto skipcomment; } |
|
| 45 | + if (!isset($_POST['g-recaptcha-response'])) { $error = "captcha validation failed"; goto skipcomment; } |
|
| 46 | + if ($config['use_recaptcha'] && !validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error = "captcha validation failed"; goto skipcomment; } |
|
| 47 | 47 | |
| 48 | 48 | $stmt = $conn->prepare("INSERT INTO `gamecomments` (toid, author, text, date) VALUES (?, ?, ?, now())"); |
| 49 | 49 | $stmt->bind_param("sss", $_GET['id'], $_SESSION['user'], $text); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $stmt->close(); |
| 53 | 53 | } |
| 54 | 54 | skipcomment: |
| 55 | - if(isset($error)) { |
|
| 55 | + if (isset($error)) { |
|
| 56 | 56 | echo "<span style='color: red;'><small>" . $error . "</small></span><br>"; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | <br><br>" . $extrainfo . "</small><hr>"; |
| 65 | 65 | ?> |
| 66 | 66 | <?php |
| 67 | - switch($type) { |
|
| 67 | + switch ($type) { |
|
| 68 | 68 | case "song": |
| 69 | 69 | echo '<audio controls> <source src="/dynamic/song/' . $filename . '"> </audio>'; |
| 70 | 70 | break; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $result = $stmt->get_result(); |
| 107 | 107 | ?> |
| 108 | 108 | <div class="commentsList"> |
| 109 | - <?php while($row = $result->fetch_assoc()) { ?> |
|
| 109 | + <?php while ($row = $result->fetch_assoc()) { ?> |
|
| 110 | 110 | <div class='commentRight' style='display: grid; grid-template-columns: auto 85%; padding:5px;'> |
| 111 | 111 | <div> |
| 112 | 112 | <a style='float: left;' href='/view/profile?id=<?php echo getID($row['author'], $conn); ?>'><?php echo $row['author']; ?></a> |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | </div> |
| 116 | 116 | <div style="word-wrap: break-word;"> |
| 117 | 117 | <small><?php echo $row['date']; ?></small> |
| 118 | - <?php echo validateMarkdown($row['text']);?> |
|
| 118 | + <?php echo validateMarkdown($row['text']); ?> |
|
| 119 | 119 | </div> |
| 120 | 120 | </div> |
| 121 | 121 | <?php } ?> |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(isset($_SESSION['user'])) { |
|
| 2 | + if (isset($_SESSION['user'])) { |
|
| 3 | 3 | $stmt = $conn->prepare("SELECT * FROM `users` WHERE username = ?"); |
| 4 | 4 | $stmt->bind_param("s", $_SESSION['user']); |
| 5 | 5 | $stmt->execute(); |
| 6 | 6 | $result = $stmt->get_result(); |
| 7 | 7 | |
| 8 | - if($result->num_rows == 0) die('welcome to gamestop how may i help you'); |
|
| 8 | + if ($result->num_rows == 0) die('welcome to gamestop how may i help you'); |
|
| 9 | 9 | } |
| 10 | 10 | ?> |
| 11 | 11 | |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | • <a href="/view/groups">Groups</a> |
| 32 | 32 | |
| 33 | 33 | <span style="float:right;"> |
| 34 | - <?php if(isset($_SESSION['user'])) {?> |
|
| 34 | + <?php if (isset($_SESSION['user'])) {?> |
|
| 35 | 35 | Logged in as |
| 36 | - <a href='/view/profile?id=<?php echo(getID($_SESSION['user'], $conn));?>'> |
|
| 37 | - <?php echo($_SESSION['user']);?> |
|
| 36 | + <a href='/view/profile?id=<?php echo(getID($_SESSION['user'], $conn)); ?>'> |
|
| 37 | + <?php echo($_SESSION['user']); ?> |
|
| 38 | 38 | </a> |
| 39 | 39 | • <a href='/home'>Manage</a> |
| 40 | 40 | • <a href='/logout'>Logout</a> |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | $stmt->execute(); |
| 6 | 6 | $result = $stmt->get_result(); |
| 7 | 7 | |
| 8 | - if($result->num_rows == 0) die('welcome to gamestop how may i help you'); |
|
| 8 | + if($result->num_rows == 0) { |
|
| 9 | + die('welcome to gamestop how may i help you'); |
|
| 10 | + } |
|
| 9 | 11 | } |
| 10 | 12 | ?> |
| 11 | 13 | |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | require(__DIR__ . "/../func/func.php"); |
| 8 | 8 | require(__DIR__ . "/../func/conn.php"); |
| 9 | 9 | |
| 10 | - if(isset($_GET['id'])) { |
|
| 10 | + if (isset($_GET['id'])) { |
|
| 11 | 11 | $stmt = $conn->prepare("SELECT * FROM files WHERE id = ?"); |
| 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.'); |
|
| 16 | - while($row = $result->fetch_assoc()) { |
|
| 15 | + if ($result->num_rows === 0) echo('There are no users.'); |
|
| 16 | + while ($row = $result->fetch_assoc()) { |
|
| 17 | 17 | $author = $row['author']; |
| 18 | 18 | $id = $row['id']; |
| 19 | 19 | $date = $row['date']; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $status = $row['status']; |
| 24 | 24 | $filename = $row['filename']; |
| 25 | 25 | |
| 26 | - if($status != "y") { |
|
| 26 | + if ($status != "y") { |
|
| 27 | 27 | die("Item is not approved yet."); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | <div class="container"> |
| 39 | 39 | <?php |
| 40 | - if($_SERVER['REQUEST_METHOD'] == 'POST') |
|
| 40 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') |
|
| 41 | 41 | { |
| 42 | - if(!isset($_SESSION['user'])){ $error = "you are not logged in"; goto skipcomment; } |
|
| 43 | - if(!$_POST['comment']){ $error = "your comment cannot be blank"; goto skipcomment; } |
|
| 44 | - if(strlen($_POST['comment']) > 500){ $error = "your comment must be shorter than 500 characters"; goto skipcomment; } |
|
| 42 | + if (!isset($_SESSION['user'])) { $error = "you are not logged in"; goto skipcomment; } |
|
| 43 | + if (!$_POST['comment']) { $error = "your comment cannot be blank"; goto skipcomment; } |
|
| 44 | + if (strlen($_POST['comment']) > 500) { $error = "your comment must be shorter than 500 characters"; goto skipcomment; } |
|
| 45 | 45 | //if(!isset($_POST['g-recaptcha-response'])) { $error = "captcha validation failed"; goto skipcomment; } |
| 46 | 46 | //if($config['use_recaptcha'] && !validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error = "captcha validation failed"; goto skipcomment; } |
| 47 | 47 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $stmt->close(); |
| 53 | 53 | } |
| 54 | 54 | skipcomment: |
| 55 | - if(isset($error)) { |
|
| 55 | + if (isset($error)) { |
|
| 56 | 56 | echo "<span style='color: red;'><small>" . $error . "</small></span><br>"; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | <br><br>" . $extrainfo . "</small><hr>"; |
| 65 | 65 | ?> |
| 66 | 66 | <?php |
| 67 | - switch($type) { |
|
| 67 | + switch ($type) { |
|
| 68 | 68 | case "song": |
| 69 | 69 | echo '<audio controls> <source src="/dynamic/song/' . $filename . '"> </audio>'; |
| 70 | 70 | break; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $result = $stmt->get_result(); |
| 107 | 107 | ?> |
| 108 | 108 | <div class="commentsList"> |
| 109 | - <?php while($row = $result->fetch_assoc()) { ?> |
|
| 109 | + <?php while ($row = $result->fetch_assoc()) { ?> |
|
| 110 | 110 | <div class='commentRight' style='display: grid; grid-template-columns: auto 85%; padding:5px;'> |
| 111 | 111 | <div> |
| 112 | 112 | <a style='float: left;' href='/view/profile?id=<?php echo getID($row['author'], $conn); ?>'><?php echo $row['author']; ?></a> |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | </div> |
| 116 | 116 | <div style="word-wrap: break-word;"> |
| 117 | 117 | <small><?php echo $row['date']; ?></small> |
| 118 | - <?php echo htmlspecialchars($row['text']);?> |
|
| 118 | + <?php echo htmlspecialchars($row['text']); ?> |
|
| 119 | 119 | </div> |
| 120 | 120 | </div> |
| 121 | 121 | <?php } ?> |