Passed
Push — master ( 286ed0...c1cf78 )
by a
04:01 queued 01:39
created
index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
                     <a href="/media">Featured</a><br>
41 41
                     <?php 
42
-                    if(isset($_SESSION['user'])) { echo "<a href='/home'>Manage</a><br><a href='/files'>Files</a>"; }
42
+                    if (isset($_SESSION['user'])) { echo "<a href='/home'>Manage</a><br><a href='/files'>Files</a>"; }
43 43
                     ?>
44 44
                 </div>
45 45
                 <br>
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                         $stmt = $conn->prepare("SELECT * FROM files WHERE type='review' AND status='y' ORDER BY id DESC LIMIT 1");
50 50
                         $stmt->execute();
51 51
                         $result = $stmt->get_result();
52
-                        while($row = $result->fetch_assoc()) {
52
+                        while ($row = $result->fetch_assoc()) {
53 53
                             echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
54 54
                             <small>
55 55
                             <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                         $stmt = $conn->prepare("SELECT * FROM files WHERE type='news' AND status='y' ORDER BY id DESC LIMIT 1");
66 66
                         $stmt->execute();
67 67
                         $result = $stmt->get_result();
68
-                        while($row = $result->fetch_assoc()) {
68
+                        while ($row = $result->fetch_assoc()) {
69 69
                             echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
70 70
                             <small>
71 71
                             <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'>[" . $row['agerating'] . "] <i>" . $row['title'] . "</a></i></span><br>
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
                             $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC");
82 82
                             $stmt->execute();
83 83
                             $result = $stmt->get_result();
84
-                            if($result->num_rows === 0) echo('There are no users.');
85
-                            while($row = $result->fetch_assoc()) {
84
+                            if ($result->num_rows === 0) echo('There are no users.');
85
+                            while ($row = $result->fetch_assoc()) {
86 86
                                 $id = 1;
87 87
                                 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>";
88 88
                                 $id = $id + 1;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                     $stmt = $conn->prepare("SELECT * FROM files WHERE type='image' AND status='y' ORDER BY id DESC LIMIT 6");
100 100
                     $stmt->execute();
101 101
                     $result = $stmt->get_result();
102
-                    while($row = $result->fetch_assoc()) {
102
+                    while ($row = $result->fetch_assoc()) {
103 103
                         echo "<div style='display: inline-block;' class='notegray'>
104 104
                             <a href='/view?id=" . $row['id'] . "'><img style='width: 7.5em;height: 7.5em;' src='/dynamic/image/" . $row['filename'] . "'>
105 105
                             <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.
view/profile.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
     <body> 
13 13
         <?php require(__DIR__ . "/../important/header.php"); 
14 14
         
15
-        if($_SERVER['REQUEST_METHOD'] == 'POST') 
15
+        if ($_SERVER['REQUEST_METHOD'] == 'POST') 
16 16
         {
17
-            if(!isset($_SESSION['user'])){ $error = "you are not logged in"; goto skipcomment; }
18
-            if(!$_POST['comment']){ $error = "your comment cannot be blank"; goto skipcomment; }
19
-            if(strlen($_POST['comment']) > 500){ $error = "your comment must be shorter than 500 characters"; goto skipcomment; }
17
+            if (!isset($_SESSION['user'])) { $error = "you are not logged in"; goto skipcomment; }
18
+            if (!$_POST['comment']) { $error = "your comment cannot be blank"; goto skipcomment; }
19
+            if (strlen($_POST['comment']) > 500) { $error = "your comment must be shorter than 500 characters"; goto skipcomment; }
20 20
 
21 21
             $stmt = $conn->prepare("INSERT INTO `comments` (toid, author, text) VALUES (?, ?, ?)");
22 22
             $stmt->bind_param("sss", $_GET['id'], $_SESSION['user'], $text);
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
         $stmt->bind_param("i", $_GET['id']);
33 33
         $stmt->execute();
34 34
         $result = $stmt->get_result();
35
-        if($result->num_rows !== 0){ // echo('There are no users.'); // please just refuse to give a user if this is the case
36
-            while($row = $result->fetch_assoc()) { // you dont need to use a loop if its only ever gonna return 1 or 0
35
+        if ($result->num_rows !== 0) { // echo('There are no users.'); // please just refuse to give a user if this is the case
36
+            while ($row = $result->fetch_assoc()) { // you dont need to use a loop if its only ever gonna return 1 or 0
37 37
                 $username = $row['username']; // you dont actually need all of these variables oh my god just use an array
38 38
                 $id = $row['id'];
39 39
                 $date = $row['date'];
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
         $stmt->bind_param("i", $currentgroup);
58 58
         $stmt->execute();
59 59
         $result = $stmt->get_result();
60
-        if($result->num_rows !== 0){ //echo('There are no users.'); // why again
61
-            while($row = $result->fetch_assoc()) {
60
+        if ($result->num_rows !== 0) { //echo('There are no users.'); // why again
61
+            while ($row = $result->fetch_assoc()) {
62 62
                 $grouptitle = $row['title'];
63 63
             }
64
-        }else{
64
+        } else {
65 65
             $grouptitle = "none";
66 66
         }
67 67
         $stmt->close();
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $result = $stmt->get_result();
73 73
 
74 74
         $comments = 0;
75
-        while($row = $result->fetch_assoc()) {
75
+        while ($row = $result->fetch_assoc()) {
76 76
             $comments++;
77 77
         }
78 78
         $stmt->close();
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $result = $stmt->get_result();
84 84
 
85 85
         $profilecomments = 0;
86
-        while($row = $result->fetch_assoc()) {
86
+        while ($row = $result->fetch_assoc()) {
87 87
             $profilecomments++;
88 88
         }
89 89
         $stmt->close();
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $result = $stmt->get_result();
95 95
 
96 96
         $filesuploaded = 0;
97
-        while($row = $result->fetch_assoc()) {
97
+        while ($row = $result->fetch_assoc()) {
98 98
             $filesuploaded++;
99 99
         }
100 100
         $stmt->close();
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
                         </center>
113 113
                         <hr style="border-top: 1px dashed gray;">
114 114
                         <div id="userinfo" style="padding-left: 20px;">
115
-                            <span style="color: gold;">Rank:</span> <?php echo $rank;?><br>
116
-                            <span style="color: gold;">ID:</span> <?php echo $id;?><br>
117
-                            <span style="color: gold;">Other Comments:</span> <?php echo $comments;?><br>
118
-                            <span style="color: gold;">Profile Comments:</span> <?php echo $profilecomments;?><br>
119
-                            <span style="color: gold;">Current Group:</span> <?php echo $grouptitle;?><br>
120
-                            <span style="color: gold;">Files Uploaded:</span> <?php echo $filesuploaded;?>
115
+                            <span style="color: gold;">Rank:</span> <?php echo $rank; ?><br>
116
+                            <span style="color: gold;">ID:</span> <?php echo $id; ?><br>
117
+                            <span style="color: gold;">Other Comments:</span> <?php echo $comments; ?><br>
118
+                            <span style="color: gold;">Profile Comments:</span> <?php echo $profilecomments; ?><br>
119
+                            <span style="color: gold;">Current Group:</span> <?php echo $grouptitle; ?><br>
120
+                            <span style="color: gold;">Files Uploaded:</span> <?php echo $filesuploaded; ?>
121 121
                         </div><br>
122 122
                         <?php if (!isset($_GET["ed"])) { ?>
123 123
                             <audio autoplay controls>
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                     </div>
128 128
                     <br>
129 129
                     <div class="notegray">
130
-                    <?php if(isset($error)) { echo "<small style='color:red'>".$error."</small>"; } ?>
130
+                    <?php if (isset($error)) { echo "<small style='color:red'>" . $error . "</small>"; } ?>
131 131
                     <h2>Comment</h2>
132 132
                     <form method="post" enctype="multipart/form-data">
133 133
                         <textarea required cols="33" placeholder="Comment" name="comment"></textarea><br>
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
                     <div id="badges" class="notegray">
147 147
                         <h1>Badges</h1>
148 148
                         <?php
149
-                            foreach($badges as $badge) {
150
-                                if($badge == "good") {
149
+                            foreach ($badges as $badge) {
150
+                                if ($badge == "good") {
151 151
                                     echo "<img width='70px;' height='70px;' src='https://cdn.discordapp.com/attachments/740680780740821105/740776214523936808/340juojg3h.png'>";
152 152
                                 }
153 153
                             }
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
                         $stmt->bind_param("s", $username);
160 160
                         $stmt->execute();
161 161
                         $result = $stmt->get_result();
162
-                        if($result->num_rows > 0) echo('<h1>Files</h1>');
162
+                        if ($result->num_rows > 0) echo('<h1>Files</h1>');
163 163
                         
164
-                        while($row = $result->fetch_assoc()) { 
165
-                            echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>';
164
+                        while ($row = $result->fetch_assoc()) { 
165
+                            echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [', $row['type'] . ']</a><br>';
166 166
                         }?> 
167 167
                     </div><br>
168 168
                     <div id="bio" class="notegray">
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                             $stmt->execute();
177 177
                             $result = $stmt->get_result();
178 178
                             
179
-                            while($row = $result->fetch_assoc()) { ?>
179
+                            while ($row = $result->fetch_assoc()) { ?>
180 180
                                 <div class='commentRight' style='display: grid; grid-template-columns: 75% auto; padding:5px;'>
181 181
                                     <div style="word-wrap: break-word;">
182 182
                                         <small><?php echo $row['date']; ?></small>
Please login to merge, or discard this patch.