Passed
Pull Request — master (#20)
by
unknown
02:03
created
2fa/enable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@
 block discarded – undo
43 43
     <body>
44 44
         <?php require(__DIR__ . "/../important/header.php"); ?>
45 45
         <div class="container">
46
-            <?php if (isset($err)) {echo "<b style='color:red;'>" . $err . "</b><br><br>";}?>
46
+            <?php if (isset($err)) {echo "<b style='color:red;'>" . $err . "</b><br><br>"; }?>
47 47
             To enable 2FA, scan the following QR code with your authenticator app:<br><br>
48 48
             <img src="<?php echo $totp->getQrCodeUri(
49 49
                 'https://api.qrserver.com/v1/create-qr-code/?data=[DATA]&size=300x300&ecc=M&qzone=1&format=png',
50 50
                 '[DATA]'
51
-            );?>"><br><br>
51
+            ); ?>"><br><br>
52 52
             Or use the following string: <b><?php echo $secret; ?></b><br>
53 53
             Then type the 6-digit code your app generates below and click 'Submit':<br><br>
54 54
             <form method="post" enctype="multipart/form-data">
Please login to merge, or discard this patch.
important/header.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
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) echo('welcome to gamestop how may i help you');
8
+        if ($result->num_rows == 0) echo('welcome to gamestop how may i help you');
9 9
     }
10 10
 ?>
11 11
 
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
     &bull; <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
         &bull; <a href='/home'>Manage</a>
40 40
         &bull; <a href='/logout'>Logout</a>
Please login to merge, or discard this patch.
view/profile.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                     </div>
112 112
                     <br>
113 113
                     <div class="notegray">
114
-                    <?php if(isset($error)) { echo "<small style='color:red'>".$error."</small>"; } ?>
114
+                    <?php if (isset($error)) { echo "<small style='color:red'>" . $error . "</small>"; } ?>
115 115
                     <h2>Comment</h2>
116 116
                     <form method="post" enctype="multipart/form-data">
117 117
                         <textarea required cols="33" placeholder="Comment" name="comment"></textarea><br>
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
                     <div id="badges" class="notegray">
131 131
                         <h1>Badges</h1>
132 132
                         <?php
133
-                            foreach($badges as $badge) {
134
-                                if($badge == "good") {
133
+                            foreach ($badges as $badge) {
134
+                                if ($badge == "good") {
135 135
                                     echo "<img width='70px;' height='70px;' src='https://cdn.discordapp.com/attachments/740680780740821105/740776214523936808/340juojg3h.png'>";
136 136
                                 }
137 137
                             }
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
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) echo('<h1>Files</h1>');
147 147
                         
148
-                        while($row = $result->fetch_assoc()) { 
149
-                            echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>';
148
+                        while ($row = $result->fetch_assoc()) { 
149
+                            echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [', $row['type'] . ']</a><br>';
150 150
                         }?> 
151 151
                     </div><br>
152 152
                     <div id="bio" class="notegray">
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                             $stmt->execute();
161 161
                             $result = $stmt->get_result();
162 162
                             
163
-                            while($row = $result->fetch_assoc()) { ?>
163
+                            while ($row = $result->fetch_assoc()) { ?>
164 164
                                 <div class='commentRight' style='display: grid; grid-template-columns: 75% auto; padding:5px;'>
165 165
                                     <div style="word-wrap: break-word;">
166 166
                                         <small><?php echo $row['date']; ?></small>
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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>';
Please login to merge, or discard this patch.
index.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
         <div class="container">
24 24
             <br>   
25 25
             <?php
26
-            if($_SERVER['REQUEST_METHOD'] == 'POST') 
26
+            if ($_SERVER['REQUEST_METHOD'] == 'POST') 
27 27
             {
28
-                if(!isset($_SESSION['user'])){ $error = "you are not logged in"; goto skipcomment; }
29
-                if(!$_POST['comment']){ $error = "your comment cannot be blank"; goto skipcomment; }
30
-                if(strlen($_POST['comment']) > 500){ $error = "your comment must be shorter than 500 characters"; goto skipcomment; }
28
+                if (!isset($_SESSION['user'])) { $error = "you are not logged in"; goto skipcomment; }
29
+                if (!$_POST['comment']) { $error = "your comment cannot be blank"; goto skipcomment; }
30
+                if (strlen($_POST['comment']) > 500) { $error = "your comment must be shorter than 500 characters"; goto skipcomment; }
31 31
 
32 32
                 $stmt = $conn->prepare("INSERT INTO `comments` (toid, author, text) VALUES (?, ?, ?)");
33 33
                 $stmt->bind_param("sss", $_GET['id'], $_SESSION['user'], $text);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
                     <a href="/media">Featured</a><br>
59 59
                     <?php 
60
-                    if(isset($_SESSION['user'])) { echo "<a href='/home'>Manage</a><br><a href='/files'>Files<a>"; }
60
+                    if (isset($_SESSION['user'])) { echo "<a href='/home'>Manage</a><br><a href='/files'>Files<a>"; }
61 61
                     ?>
62 62
                 </div>
63 63
                 <br>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                         $stmt = $conn->prepare("SELECT * FROM files WHERE type='review' AND status='y' ORDER BY RAND() LIMIT 1");
68 68
                         $stmt->execute();
69 69
                         $result = $stmt->get_result();
70
-                        while($row = $result->fetch_assoc()) {
70
+                        while ($row = $result->fetch_assoc()) {
71 71
                             echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
72 72
                             <small>
73 73
                             <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                         $stmt = $conn->prepare("SELECT * FROM files WHERE type='news' AND status='y' ORDER BY RAND() LIMIT 1");
84 84
                         $stmt->execute();
85 85
                         $result = $stmt->get_result();
86
-                        while($row = $result->fetch_assoc()) {
86
+                        while ($row = $result->fetch_assoc()) {
87 87
                             echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
88 88
                             <small>
89 89
                             <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'>[" . $row['agerating'] . "] <i>" . $row['title'] . "</a></i></span><br>
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
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.');
103
-                            while($row = $result->fetch_assoc()) {
102
+                            if ($result->num_rows === 0) echo('There are no users.');
103
+                            while ($row = $result->fetch_assoc()) {
104 104
                                 $id = 1;
105 105
                                 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>";
106 106
                                 $id = $id + 1;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                     $stmt = $conn->prepare("SELECT * FROM files WHERE type='image' AND status='y' ORDER BY RAND() LIMIT 6");
118 118
                     $stmt->execute();
119 119
                     $result = $stmt->get_result();
120
-                    while($row = $result->fetch_assoc()) {
120
+                    while ($row = $result->fetch_assoc()) {
121 121
                         echo "<div style='display: inline-block;' class='notegray'>
122 122
                             <a href='/view?id=" . $row['id'] . "'><img style='width: 7.5em;height: 7.5em;' src='/dynamic/image/" . $row['filename'] . "'>
123 123
                             <br><center><b>" . htmlspecialchars($row['title']) . "</b><br><span style='color: gray;'>By " . $row['author'] . "</span></center>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,9 @@
 block discarded – undo
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>";
Please login to merge, or discard this patch.
home.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
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');
13
-            while($row = $result->fetch_assoc()) {
12
+            if ($result->num_rows === 0) header('Location: index.php');
13
+            while ($row = $result->fetch_assoc()) {
14 14
                 $username = $row['username'];
15 15
                 $id = $row['id'];
16 16
                 $date = $row['date'];
@@ -28,21 +28,21 @@  discard block
 block discarded – undo
28 28
     <body> 
29 29
         <?php require(__DIR__ . "/important/header.php"); 
30 30
         
31
-        if(@$_POST['bioset']) {
31
+        if (@$_POST['bioset']) {
32 32
             $stmt = $conn->prepare("UPDATE users SET bio = ? WHERE `users`.`username` = ?;");
33 33
             $stmt->bind_param("ss", $text, $_SESSION['user']);
34 34
             $text = $_POST['bio'];
35 35
             $stmt->execute(); 
36 36
             $stmt->close();
37 37
             header("Location: home.php");
38
-        } else if(@$_POST['css']) {
38
+        } else if (@$_POST['css']) {
39 39
             $stmt = $conn->prepare("UPDATE users SET css = ? WHERE `users`.`username` = ?;");
40 40
             $stmt->bind_param("ss", $validatedcss, $_SESSION['user']);
41 41
             $validatedcss = validateCSS($_POST['css']);
42 42
             $stmt->execute(); 
43 43
             $stmt->close();
44 44
             header("Location: home.php");
45
-        } else if(@$_POST['submit']) {
45
+        } else if (@$_POST['submit']) {
46 46
             $target_dir = "dynamic/pfp/";
47 47
             $target_name = md5_file($_FILES["fileToUpload"]["tmp_name"]);
48 48
             $imageFileType = strtolower(pathinfo($$_FILES["fileToUpload"]["name"], PATHINFO_EXTENSION));
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
             $target_file = $target_dir . $target_name . "." . $imageFileType;
51 51
             
52 52
             $uploadOk = 1;
53
-            if(isset($_POST["submit"])) {
53
+            if (isset($_POST["submit"])) {
54 54
                 $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
55
-                if($check !== false) {
55
+                if ($check !== false) {
56 56
                     $uploadOk = 1;
57 57
                 } else {
58 58
                     $uploadOk = 0;
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 //                echo 'file with the same name already exists<hr>';
63 63
 //                $uploadOk = 0;
64 64
 //            }
65
-            if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
66
-            && $imageFileType != "gif" ) {
65
+            if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
66
+            && $imageFileType != "gif") {
67 67
                 echo 'unsupported file type. must be jpg, png, jpeg, or gif<hr>';
68 68
                 $uploadOk = 0;
69 69
             }
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
                     echo 'fatal error<hr>';
80 80
                 }
81 81
             }
82
-        } else if(@$_POST['photoset']) {
82
+        } else if (@$_POST['photoset']) {
83 83
             $uploadOk = true;
84 84
             $target_dir = "music/";
85 85
             $target_file = basename($_FILES["fileToUpload"]["name"]);
86 86
             $imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));
87 87
             $target_file = $target_dir . getID($_SESSION['user'], $conn) . "." . $imageFileType;
88
-            if(isset($_POST["submit"])) {
88
+            if (isset($_POST["submit"])) {
89 89
                 $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
90
-                if($check !== false) {
90
+                if ($check !== false) {
91 91
                     $uploadOk = true;
92 92
                 } else {
93 93
                     $uploadOk = false;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 //                echo 'file with the same name already exists<hr>';
98 98
 //                $uploadOk = false;
99 99
 //            }
100
-            if($imageFileType != "ogg" && $imageFileType != "mp3") {
100
+            if ($imageFileType != "ogg" && $imageFileType != "mp3") {
101 101
                 echo 'unsupported file type. must be mp3 or ogg<hr>';
102 102
                 $uploadOk = false;
103 103
             }
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
             <button><a href="/2fa">Manage 2-Factor Authentication</a></button><br><br>
131 131
             <b>Bio</b>
132 132
             <form method="post" enctype="multipart/form-data">
133
-                <textarea required cols="58" placeholder="Bio" name="bio"><?php echo $bio;?></textarea><br>
133
+                <textarea required cols="58" placeholder="Bio" name="bio"><?php echo $bio; ?></textarea><br>
134 134
                 <input name="bioset" type="submit" value="Set">
135 135
                 <small>max limit: 500 characters | supports <a href="https://www.markdownguide.org/basic-syntax">Markdown</a></small>
136 136
             </form><br>
137 137
             <b>CSS</b>
138 138
             <button onclick="loadpfwin()" id="prevbtn">Show Live CSS Preview</button>
139 139
             <form method="post" enctype="multipart/form-data">
140
-                <textarea required rows="15" cols="58" placeholder="Your CSS" name="css" id="css_code"><?php echo $css;?></textarea><br>
140
+                <textarea required rows="15" cols="58" placeholder="Your CSS" name="css" id="css_code"><?php echo $css; ?></textarea><br>
141 141
                 <input name="cssset" type="submit" value="Set"> <small>max limit: 5000 characters</small>
142 142
             </form><br>
143 143
         </div>
Please login to merge, or discard this patch.
view/group.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
         
22 22
         <div class="container">
23 23
             <?php
24
-                if($_SERVER['REQUEST_METHOD'] == 'POST')  {
25
-                    if(!isset($_SESSION['user'])) {
24
+                if ($_SERVER['REQUEST_METHOD'] == 'POST') {
25
+                    if (!isset($_SESSION['user'])) {
26 26
                         $error = "you are not logged in";
27 27
                         goto skipcomment;
28 28
                     }
29
-                    if(!$_POST['comment']) {
29
+                    if (!$_POST['comment']) {
30 30
                         $error = "your comment cannot be blank";
31 31
                         goto skipcomment;
32 32
                     }
33
-                    if(strlen($_POST['comment']) > 500) {
33
+                    if (strlen($_POST['comment']) > 500) {
34 34
                         $error = "your comment must be shorter than 500 characters";
35 35
                         goto skipcomment;
36 36
                     }
@@ -43,26 +43,26 @@  discard block
 block discarded – undo
43 43
                 }
44 44
                 skipcomment:
45 45
 
46
-                if(isset($_GET['id'])) {
46
+                if (isset($_GET['id'])) {
47 47
                     $stmt = $conn->prepare("SELECT * FROM `groups` WHERE id = ?");
48 48
                     $stmt->bind_param("i", $_GET['id']);
49 49
                     $stmt->execute();
50 50
                     $result = $stmt->get_result();
51
-                    if($result->num_rows === 0) echo('Group doesnt exist.');
52
-                    while($row = $result->fetch_assoc()) {
51
+                    if ($result->num_rows === 0) echo('Group doesnt exist.');
52
+                    while ($row = $result->fetch_assoc()) {
53 53
                         $id = $row['id'];
54 54
                         ?>
55 55
                         <img style='border: 1px solid white; width: 5em;'
56
-                             src='/dynamic/pfp/<?php echo getPFP($row["author"], $conn);?>'>
56
+                             src='/dynamic/pfp/<?php echo getPFP($row["author"], $conn); ?>'>
57 57
                         <span style='float: right;text-align: right;'>
58
-                            <a href='/view/group?id=<?php echo $row["id"];?>' style='color: gold;font-size:1.5em'>
59
-                                <?php echo $row['title'];?>
58
+                            <a href='/view/group?id=<?php echo $row["id"]; ?>' style='color: gold;font-size:1.5em'>
59
+                                <?php echo $row['title']; ?>
60 60
                             </a><br>
61 61
                             <small>
62 62
                                 <i>
63 63
                                     Created by
64
-                                    <a href='/view/profile?id=<?php echo getID($row["author"], $conn);?>'>
65
-                                        <?php echo $row['author'];?>
64
+                                    <a href='/view/profile?id=<?php echo getID($row["author"], $conn); ?>'>
65
+                                        <?php echo $row['author']; ?>
66 66
                                     </a>
67 67
                                 </i><br>
68 68
                                 <?php echo $row['date']?>
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
                     $stmt->bind_param("i", $id);
79 79
                     $stmt->execute();
80 80
                     $result = $stmt->get_result();
81
-                    if($result->num_rows === 0) echo('There are no users.');
81
+                    if ($result->num_rows === 0) echo('There are no users.');
82 82
                     $members = 0;
83
-                    while($row = $result->fetch_assoc()) {
83
+                    while ($row = $result->fetch_assoc()) {
84 84
                         $members++;
85 85
                     }
86
-                    echo "<span style='float:right;'><a href='/joingroup?id=" . $id. "'><button>Join</button></a></span>";
86
+                    echo "<span style='float:right;'><a href='/joingroup?id=" . $id . "'><button>Join</button></a></span>";
87 87
                 } else {
88 88
                     header("Location: view/groups.php");
89 89
                 }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             <hr>
93 93
             <div>
94 94
                 <div class="left">
95
-                    <?php if(isset($error)) {echo "<small style='color:red'>" . $error . "</small>";}?>
95
+                    <?php if (isset($error)) {echo "<small style='color:red'>" . $error . "</small>"; }?>
96 96
                     <h2>Comments</h2>
97 97
                     <?php if (isset($_SESSION['user'])) { ?>
98 98
                         <form method="post" enctype="multipart/form-data">
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
                             $stmt->execute();
110 110
                             $result = $stmt->get_result();
111 111
                 
112
-                            while($row = $result->fetch_assoc()) { ?>
112
+                            while ($row = $result->fetch_assoc()) { ?>
113 113
                                 <div class='commentRight' style='display: grid; grid-template-columns: 75% auto; padding:5px;'>
114 114
                                     <div style="word-wrap: break-word;">
115 115
                                         <small><?php echo $row['date']; ?></small>
116
-                                        <?php echo validateMarkdown($row['text']);?>
116
+                                        <?php echo validateMarkdown($row['text']); ?>
117 117
                                     </div>
118 118
                                     <div>
119 119
                                         <a style='float: right;' href='/view/profile?id=<?php echo getID($row['author'], $conn); ?>'><?php echo $row['author']; ?></a>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                     </div>
126 126
                 </div>
127 127
                 <div class="right">
128
-                    <h2>Members (<?php echo $members;?>)</h2>
128
+                    <h2>Members (<?php echo $members; ?>)</h2>
129 129
                     <?php
130 130
                         $stmt = $conn->prepare("SELECT `username`, `id` FROM `users` WHERE `currentgroup` = ?");
131 131
                         $stmt->bind_param("i", $id);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
                         echo "<ul>";
136 136
                         while ($row = $result->fetch_assoc()) {
137
-                            echo "<li><a href='/view/profile?id=" . $row['id'] . "'>". $row['username'] . "</a></li>";
137
+                            echo "<li><a href='/view/profile?id=" . $row['id'] . "'>" . $row['username'] . "</a></li>";
138 138
                         }
139 139
                         echo "</ul>";
140 140
                     ?>
Please login to merge, or discard this patch.
view/items.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
             require(__DIR__ . "/../func/func.php");
9 9
             require(__DIR__ . "/../func/conn.php"); 
10 10
             $featured = array(1, 3, 12);
11
-            $newlines = array("<br>", " <br>", "<br>" , " <br> ");
11
+            $newlines = array("<br>", " <br>", "<br>", " <br> ");
12 12
         ?>
13 13
         <title>4Grounds - Hub</title>
14 14
     </head>
@@ -17,27 +17,27 @@  discard block
 block discarded – undo
17 17
         <div class="container"><br>
18 18
             <h1>Search results for type '<?php echo htmlspecialchars($_GET['type']); ?>'</h1>
19 19
             <?php
20
-            if(isset($_GET['type'])) {
20
+            if (isset($_GET['type'])) {
21 21
                 $stmt = $conn->prepare("SELECT * FROM `files` WHERE type = ? AND status = 'y' ORDER BY id DESC");
22 22
                 $stmt->bind_param("s", $_GET['type']);
23 23
                 $stmt->execute();
24 24
                 $result = $stmt->get_result();
25 25
 
26
-                while($row = $result->fetch_assoc()) { 
27
-                    if($row['type'] == "song") {
26
+                while ($row = $result->fetch_assoc()) { 
27
+                    if ($row['type'] == "song") {
28 28
                         echo '<b><a href="/view?id=' . $row['id'] . '">' . htmlspecialchars($row['title']) . '</b></a> <span style="float:right;"><small>Uploader: <b>' . $row['author'] . '</b></small></span><br>
29 29
                         ' . $row['extrainfo'] . '<br>
30 30
                         <audio controls>
31 31
                         <source src="/dynamic/song/' . $row['filename'] . '">
32 32
                         </audio><hr>';
33
-                    } else if($row['type'] == "image") {
33
+                    } else if ($row['type'] == "image") {
34 34
                         //im sorry for this abomination
35 35
                         echo "<div style='display: inline-block;' class='notegray'>
36 36
                             <a href='/view?id=" . $row['id'] . "'><img style='width: 10em;height: 10em;' src='images/" . $row['filename'] . "'>
37 37
                             <br><center><b>" . htmlspecialchars($row['title']) . "</b><br><span style='color: gray;'>By " . $row['author'] . "</span></center>
38 38
                             </a>
39 39
                         </div> ";  
40
-                    } else if($row['type'] == "news" || $row['type'] == "review") {
40
+                    } else if ($row['type'] == "news" || $row['type'] == "review") {
41 41
                         echo "<small>
42 42
                         <img style='position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
43 43
                         <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'>[" . $row['agerating'] . "] <i>" . $row['title'] . "</a></i></span><br>
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                     } else {
48 48
                         echo "<b><a href='/view?id=" . $row['id'] . "'>" . htmlspecialchars($row['title']) . " by " . $row['author'] . "
49 49
                         </a><small><span style='float:right;'>[" . $row['date'] . "]</small></span>";
50
-                        if(in_array($row['id'], $featured)) {
50
+                        if (in_array($row['id'], $featured)) {
51 51
                             echo "<span style='float:right; color: gold;margin-right: 10px;'>Featured!</span> &nbsp;";
52 52
                         }
53 53
                         echo "</b><br>" . $row['extrainfo'] . "<br><hr>";
Please login to merge, or discard this patch.
view/groups.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
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='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
24 24
                     <small>
25 25
                     <a href='/view/group?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>" . $row['title'] . "</a></i></span><br>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,9 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
files.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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='/dynamic/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>
Please login to merge, or discard this patch.