-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
77 lines (62 loc) · 3.23 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
require("config.php");
include(ROOT_PATH.'/controllers/post_controller.php');
?>
<!DOCTYPE html>
<html lang="en">
<?php include(ROOT_PATH.'/layout/header.php'); ?>
<?php include(ROOT_PATH.'/layout/navbar.php'); ?>
<!-- Home Section -->
<section id="home" class="main-home parallax-section">
<div class="overlay"></div>
<div id="particles-js"></div>
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<h1>Hello! This is My Blog.</h1>
<h4>Responsive Blog </h4>
<!-- <a href="#blog" class="smoothScroll btn btn-default">Discover More</a> -->
</div>
</div>
</div>
</section>
<!-- Blog Section -->
<section id="blog">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-10 col-sm-12">
<?php foreach($posts as $post): ?>
<div class="blog-post-thumb">
<div class="blog-post-image">
<a href='<?php echo "single-post.php?openpost=".$post['id'] ?>'>
<img style="height: 300px;" src="<?php echo BASE_URL.$post['header_photo'] ?>" class="img-responsive" alt="Blog Image">
</a>
</div>
<div class="blog-post-title">
<h3><a href='<?php echo "single-post.php?openpost=".$post['id'] ?>'><?php echo $post['title'] ?></a></h3>
</div>
<div class="blog-post-format">
<span><a href="#"><img src="<?php echo BASE_URL.$post['photo'] ?>" class="img-responsive img-circle"> <?php echo $post['auther'] ?></a></span>
<span><i class="fa fa-date"></i> <?php echo date('F d, Y', strtotime($post['created_at'])); ?></span>
<!-- Todo: get the count of comments for every post -->
<!-- <span><a href="#"><i class="fa fa-comment-o"></i> 35 Comments</a></span> -->
</div>
<div class="blog-post-des">
<!-- Todo: Here a post summery will be added... Done -->
<p><?php echo substr(strip_tags($post['content']), 0, 200); ?></p></p>
<!-- if we could get the tags array for every post in the same query. -->
<!-- <div class="tag-items">
<span class="small-text">Tags:</span>
<php foreach ($tags as $tag):
echo '<a href="#" rel="tag">'.$tag['title'].'</a> ';
endforeach; ?>
</div> -->
<a href='<?php echo "single-post.php?openpost=".$post['id'] ?>' class="btn btn-default">Continue Reading</a>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</section>
<?php include('./layout/footer.php'); ?>