|
@@ -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 id DESC 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 id DESC 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 id DESC 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> |