@@ -18,11 +18,11 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 style="word-wrap: break-word;"> |
| 118 | 118 | <small><?php echo $row['date']; ?></small> |