Passed
Push — master ( 257dab...c5007e )
by Maxwell
02:19
created
important/header.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
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) {
9
+            echo('welcome to gamestop how may i help you');
10
+        }
9 11
     }
10 12
 ?>
11 13
 
Please login to merge, or discard this 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.
index.php 2 patches
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.
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 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,9 @@
 block discarded – undo
95 95
                         $stmt->bind_param("s", $username);
96 96
                         $stmt->execute();
97 97
                         $result = $stmt->get_result();
98
-                        if($result->num_rows > 0) echo('<h1>Files</h1>');
98
+                        if($result->num_rows > 0) {
99
+                            echo('<h1>Files</h1>');
100
+                        }
99 101
                         
100 102
                         while($row = $result->fetch_assoc()) { 
101 103
                             echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>';
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
     <body> 
19 19
         <?php require(__DIR__ . "/../important/header.php"); 
20 20
         
21
-        if($_SERVER['REQUEST_METHOD'] == 'POST') 
21
+        if ($_SERVER['REQUEST_METHOD'] == 'POST') 
22 22
         {
23
-            if(!isset($_SESSION['user'])){ $error = "you are not logged in"; goto skipcomment; }
24
-            if(!$_POST['comment']){ $error = "your comment cannot be blank"; goto skipcomment; }
25
-            if(strlen($_POST['comment']) > 500){ $error = "your comment must be shorter than 500 characters"; goto skipcomment; }
23
+            if (!isset($_SESSION['user'])) { $error = "you are not logged in"; goto skipcomment; }
24
+            if (!$_POST['comment']) { $error = "your comment cannot be blank"; goto skipcomment; }
25
+            if (strlen($_POST['comment']) > 500) { $error = "your comment must be shorter than 500 characters"; goto skipcomment; }
26 26
 
27 27
             $stmt = $conn->prepare("INSERT INTO `comments` (toid, author, text) VALUES (?, ?, ?)");
28 28
             $stmt->bind_param("sss", $_GET['id'], $_SESSION['user'], $text);
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
                     </center>
48 48
                     <hr style="border-top: 1px dashed gray;">
49 49
                     <div id="userinfo" style="padding-left: 20px;">
50
-                        <span style="color: gold;">Rank:</span> <?php echo $user['rank'];?><br>
51
-                        <span style="color: gold;">ID:</span> <?php echo $user['id'];?><br>
52
-                        <span style="color: gold;">Other Comments:</span> <?php echo $user['comments'];?><br>
53
-                        <span style="color: gold;">Profile Comments:</span> <?php echo $user['profilecomments'];?><br>
54
-                        <?php $userGroup = getGroup($user['currentgroup'], $conn);?>
55
-                        <span style="color: gold;">Current Group:</span> <a href="/view/group?id=<?php echo $userGroup['id'];?>"><?php echo $userGroup['title'];?></a><br>
56
-                        <span style="color: gold;">Files Uploaded:</span> <?php echo $user['filesuploaded'];?>
50
+                        <span style="color: gold;">Rank:</span> <?php echo $user['rank']; ?><br>
51
+                        <span style="color: gold;">ID:</span> <?php echo $user['id']; ?><br>
52
+                        <span style="color: gold;">Other Comments:</span> <?php echo $user['comments']; ?><br>
53
+                        <span style="color: gold;">Profile Comments:</span> <?php echo $user['profilecomments']; ?><br>
54
+                        <?php $userGroup = getGroup($user['currentgroup'], $conn); ?>
55
+                        <span style="color: gold;">Current Group:</span> <a href="/view/group?id=<?php echo $userGroup['id']; ?>"><?php echo $userGroup['title']; ?></a><br>
56
+                        <span style="color: gold;">Files Uploaded:</span> <?php echo $user['filesuploaded']; ?>
57 57
                     </div><br>
58 58
                         <?php if (!isset($_GET["ed"])) { ?>
59 59
                             <audio autoplay controls>
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                     </div>
64 64
                     <br>
65 65
                     <div class="notegray">
66
-                    <?php if(isset($error)) { echo "<small style='color:red'>".$error."</small>"; } ?>
66
+                    <?php if (isset($error)) { echo "<small style='color:red'>" . $error . "</small>"; } ?>
67 67
                     <h2>Comment</h2>
68 68
                     <form method="post" enctype="multipart/form-data">
69 69
                         <textarea required cols="33" placeholder="Comment" name="comment"></textarea><br>
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
                     <div id="badges" class="notegray">
83 83
                         <h1>Badges</h1>
84 84
                         <?php
85
-                            foreach($user['badges'] as $badge) {
86
-                                if($badge == "good") {
85
+                            foreach ($user['badges'] as $badge) {
86
+                                if ($badge == "good") {
87 87
                                     echo "<img width='70px;' height='70px;' src='https://cdn.discordapp.com/attachments/740680780740821105/740776214523936808/340juojg3h.png'>";
88 88
                                 }
89 89
                             }
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
                         $stmt->bind_param("s", $username);
96 96
                         $stmt->execute();
97 97
                         $result = $stmt->get_result();
98
-                        if($result->num_rows > 0) echo('<h1>Files</h1>');
98
+                        if ($result->num_rows > 0) echo('<h1>Files</h1>');
99 99
                         
100
-                        while($row = $result->fetch_assoc()) { 
101
-                            echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>';
100
+                        while ($row = $result->fetch_assoc()) { 
101
+                            echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [', $row['type'] . ']</a><br>';
102 102
                         }?> 
103 103
                     </div><br>
104 104
                     <div id="bio" class="notegray">
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                             $stmt->execute();
113 113
                             $result = $stmt->get_result();
114 114
                             
115
-                            while($row = $result->fetch_assoc()) { ?>
115
+                            while ($row = $result->fetch_assoc()) { ?>
116 116
                                 <div class='commentRight' style='display: grid; grid-template-columns: 75% auto; padding:5px;'>
117 117
                                     <div class="commentText" style="word-wrap: break-word;">
118 118
                                         <small><?php echo $row['date']; ?></small>
Please login to merge, or discard this patch.
view/index.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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><br>
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                     </div>
115 115
                     <div class="commentText" style="word-wrap: break-word;">
116 116
                         <small><?php echo $row['date']; ?></small>
117
-                        <?php echo validateMarkdown($row['text']);?>
117
+                        <?php echo validateMarkdown($row['text']); ?>
118 118
                     </div>
119 119
                 </div>
120 120
                 <?php } ?>
Please login to merge, or discard this patch.