61 lines
1.8 KiB
PHP
61 lines
1.8 KiB
PHP
|
<?php include 'templates/header.php'?>
|
||
|
<form name="message" method="post" action="post.php" class="center">
|
||
|
<table>
|
||
|
<tr>
|
||
|
<td>username</td>
|
||
|
<td>
|
||
|
<input type="text" name="username" /> <i>30 char limit</i>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>message</td>
|
||
|
<td>
|
||
|
<textarea rows=8 cols=40 name="message"></textarea>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>image URL</td>
|
||
|
<td>
|
||
|
<input type="text" name="imgurl" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>action</td>
|
||
|
<td>
|
||
|
<input type="submit" name="send" value="send" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</form>
|
||
|
<hr/>
|
||
|
<div>
|
||
|
<?php
|
||
|
require "creds.php";
|
||
|
|
||
|
$result = mysqli_query($mysqli, "SELECT * FROM posts ORDER BY PostID DESC");
|
||
|
|
||
|
while($res = mysqli_fetch_array($result)) {
|
||
|
echo "<div class='message' id='".$res['PostID']."'>";
|
||
|
echo "<a class='sharebutton' href='#".$res['PostID']."'>#</a> <span class='id'>".$res['PostID']."</span> ";
|
||
|
if(empty($res['Username'])) {
|
||
|
echo "<span class='name'>Anonymous";
|
||
|
} else {
|
||
|
echo "<span class='name'>".$res['Username']."";
|
||
|
}
|
||
|
echo "</span> ";
|
||
|
if($_SERVER["HTTP_X_FORWARDED_FOR"] == $res["IP"]) {
|
||
|
echo "<span class='you'>(you) </span>";
|
||
|
}
|
||
|
/*echo "<span id='date'><script>var date = new Date('".$res['Time']."'); document.write(date.toString());</script></span><br>";*/
|
||
|
echo "<span class='date'>".$res['Time']."</span><br>";
|
||
|
/*echo "<span id='date'><script>document.write(new Date('".$res['Time']."').toLocaleString());</script></span><br>";*/
|
||
|
if(! empty($res['ImageURL'])) {
|
||
|
echo "<a href='".$res["ImageURL"]."'><img class='image' src='https://donut.gq/~nezbednik/image_proxy.php?i=".htmlspecialchars($res["ImageURL"])."'/></a><br/>";
|
||
|
}
|
||
|
echo "<span class='message'>".htmlspecialchars($res['Message'])."</span>";
|
||
|
echo "</div>";
|
||
|
}
|
||
|
?>
|
||
|
</div>
|
||
|
<?php include 'templates/footer.php'?>
|