-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
47 lines (40 loc) · 1.07 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/*
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
*/
include 'core/Config.php';
include('core/BaseTable.class.php');
include('core/Post.class.php');
$post = new Post();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="description" content="My blog for testing">
<link rel="stylesheet" type="text/css" href="design.css">
</head>
<body>
<div id="header">
<h1><a href="index.php">My Super Blog!</a></h1>
</div>
<div id="section">
<?php if (count($post->getPosts()) > 0) { ?>
Last posts:
<?php foreach($post->getPosts() as $key=>$post) { ?>
<h2><?php echo htmlspecialchars($post['title']); ?> | On: <?php echo htmlspecialchars($post['creation_date']); ?></h2>
<p><?php echo htmlspecialchars($post['content']); ?></p>
<a href="comments.php?id_post=<?php echo $post['id']; ?>">Comments</a>
<hr>
<?php } ?>
<?php } else { ?>
please post content!
<?php } ?>
</div>
<div id="footer">
© 2016
</div>
</body>
</html>