Passed
Push — master ( 0f6eba...bc45ce )
by Maxwell
02:23
created
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 class="commentText" 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/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.
view/profile.php 1 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.