forked from mufazmi/PhpBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
66 lines (64 loc) · 2.91 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
<?php require_once('include/header.php'); ?>
<?php require_once('admin/include/dbcon.php'); ?>
<?php
if(isset($_GET['post'])){
require_once('blog.php');
}
$mFunction = new Functions;
$posts = $mFunction->getPosts();
?>
<main>
</main>
<body class="mufazmi blue lighten-5" >
<?php require_once('include/navbar.php'); ?>
<!-- container tag starting form here -->
<div class="container">
<div class="center-align">
<h3 style="font-weight: bold;">Social Codia</h3>
<h6 class="grey-text text-darken-2">The Number One Coding Website Of Social Media.</h6>
<!-- starting chip / tag section from here --> <br>
<a href="?tag=Social+Codia">
<div class="chip">
Social Codia
</div>
</a>
<a href="?tag=javascript">
<div class="chip">
javascript
</div>
</a>
<a href="?tag=Python">
<div class="chip">
Python
</div>
</a>
</div>
<!-- Page title tags end here -->
<!-- Row begins -->
<div class="row">
<?php
foreach ($posts as $post) {
$postCard = <<<HERE
<div class="col s12 m4">
<div class="card hoverable small" style="height:400px">
<div class="card-image">
<img src="uploads/$post->postImage" alt="" height="150" width="150">
<a href="?post=$post->postTitle" class="btn-floating halfway-fab waves-effect waves-light red"><i class="material-icons">chevron_right</i></a>
</div>
<div class="card-content">
<p class="grey-text">$post->postTimestamp</p>
<h5 style="font-weight: bold;">$post->postTitle</h5>
<p class="grey-text text-darken-2">$post->postContent</p>
</div>
<div class="card-action">
<a href="?post=$post->postTitle" class="deep-orange-text">Read More</a>
</div>
</div>
</div>
HERE;;
echo $postCard;
}
?>
</div> <!-- row tags end here -->
</div> <!-- container tags end here -->
<?php require_once("include/footer.php") ?>