Too many things I don't even remember :D
This commit is contained in:
parent
5d7ac8f451
commit
e2408fb49d
3 changed files with 104 additions and 34 deletions
45
index.php
45
index.php
|
@ -1,20 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<title>Snuffler</title>
|
||||
</head>
|
||||
<body>
|
||||
<form>
|
||||
<textarea name="text" rows="5" placeholder="Whatcha snuffin' about?"></textarea><br />
|
||||
<select id="user" name="user">
|
||||
<option value=0>SYSTEM</option>
|
||||
<option value=1>User</option>
|
||||
</select>
|
||||
<input type="submit" id="submit" name="submit" value="Snuff!" />
|
||||
<h1>Snuffs</h1>
|
||||
</body>
|
||||
</html>
|
||||
<div id="centerbox">
|
||||
<h1>Snuffler</h1>
|
||||
<form id="postform">
|
||||
<textarea id="postformtextarea" name="text" rows="5" placeholder="Whatcha snuffin' about?"></textarea><br />
|
||||
<div id="postformactionrow">
|
||||
<select id="user" name="user">
|
||||
<option value=0>SYSTEM</option>
|
||||
<option value=1>User</option>
|
||||
</select>
|
||||
<input type="submit" id="submit" name="submit" value="Snuff!" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
|
@ -25,6 +28,24 @@ $database = new DataBase();
|
|||
if(!$database) {
|
||||
die($database->lastErrorMsg());
|
||||
}
|
||||
|
||||
//$database->addPost("Test post", 0);
|
||||
|
||||
$posts = $database->getPosts();
|
||||
//var_dump($posts);
|
||||
foreach($posts as $post) {
|
||||
echo '<div class="post">';
|
||||
echo '<strong>' . $post["user.name"] . '</strong>';
|
||||
echo '<br><small>@' . $post["user.handle"] . '</small>';
|
||||
echo '<p>' . $post["post.text"] . '</p>';
|
||||
echo '<hr><small>' . date("D j.n.Y \k\l\o G:i", $post["post.time"]) . '</small>';
|
||||
echo '<span class="postactions">5👍 0👎 2💬</span>';
|
||||
echo "</div>";
|
||||
|
||||
}
|
||||
$database->close();
|
||||
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue