-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpost.php
More file actions
146 lines (109 loc) · 6.35 KB
/
Copy pathpost.php
File metadata and controls
146 lines (109 loc) · 6.35 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php require_once 'path.php';
require_once(ROOT_PATH . "/app/includes/header.php");
require_once(ROOT_PATH . "/app/controllers/posts.php");
$posts = $posts = getPublishedPost();
if (isset($_GET['id'])) {
$post = selectOne('posts', ["id" => $_GET['id']]);
}
$pageTitle = $post['title'];
$topicId = $post['topic_id'];
$topic = selectOne('topics', ['id' => $topicId]);
?>
<title><?php echo $pageTitle ?> | Myron-Blog</title>
<div class="content1" style="top: 180px;">
<div class="content">
<section>
<!-------------------------------- Left side ------------------------------------>
<div class="left">
<!-------------------------------- Post section ------------------------------------>
<div class="post_sec">
<div class="post_topic">
<p><?php echo $topic['name'] ?></p>
</div>
<div class="post_header">
<h2><?php echo $post['title'] ?></h2>
</div>
<div class="post_desc">
<div class="author">
<small>By <span style="color: red;">Joe Kachi</span></small>
<small><span style="margin: 0 3px 0 10px;" class="fas fa-clock"></span><?php echo date('F j, Y', strtotime($post['created_at'])) ?></small>
</div>
<div class="shear_it">
<ul>
<li><a href="#"><span class="fas fa-share"></span></i></a></li>
<li><a href="#"><i class="fab fa-facebook-f"></i></a></li>
<li><a href="#"><i class="fab fa-twitter"></i></a></li>
<li><a href="#"><i class="fab fa-instagram"></i></a></li>
</ul>
</div>
</div>
<div class="post_body">
<div class="post_img">
<img style="height: 450px;" src="<?php echo BASE_URL . '/assets/images/' . $post['image'] ?>" alt="">
</div>
<div class="post_header">
<small style="font-size: 14px;"><?php echo $post['title'] ?></small>
</div>
<div class="post_cont" style="line-height:23px; color:#4C4E4D; letter-spacing: 1px; font-size: 18px;">
<?php echo $post['body'] ?>
</div>
<div class="downloa_sec" style="margin: 35px 0;">
<p><strong>Listen and share your thought below:</strong></p>
<p style="margin: 25px 0;"><strong><audio src="audio/Dremo-Monaco-(TrendyBeatz.com).mp3" controls="controls"></audio></strong></p>
<p><a href=""><strong style="color: #040820; font-size: 20px;">DOWNLOAD MP3</strong></a></p>
</div>
</div>
<div id="M811623ScriptRootC1323864">
</div>
<script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script>
<script src="https://jsc.adskeeper.com/x/c/xclusivepop.com.1323864.js" async>
</script>
<div class="recomended">
<!-------------------------------- recomended section ------------------------------------>
<div class="recomend">
<div class="header_line">
<div class="header_title">
<p><span>Recomended</span></p>
</div>
</div>
<div class="Music">
<?php foreach ($posts as $key => $post) : ?>
<!-- function that fetches topics -->
<?php
$topicId = $post['topic_id'];
$topicss = selectOne('topics', ['id' => $topicId]);
// dump($topics);
?>
<div class="card">
<div class="img_sec">
<div class="topic">
<p><a href="#"><?php echo $topicss['name'] ?></a></p>
</div>
<a href="post.php?id=<?php echo $post['id']; ?>"><img src="<?php echo BASE_URL . '/assets/images/' . $post['image'] ?>" alt="<?php echo $post['title'] ?>"></a>
</div>
<div class="title_sec">
<a href="post.php?id=<?php echo $post['id']; ?>">
<h2 class="title"><?php echo $post['title'] ?></h2>
</a>
<a href="post.php?id=<?php echo $post['id']; ?>">
<p class="post_content">
<?php echo substr($post['body'], 0, 120) . '...' ?>
</p>
</a>
<small>BY <a href="#"><span style="color:red; margin-right: 10px;"><?php echo $post['username'] ?></span></a><?php echo date('F j, Y', strtotime($post['created_at'])) ?></small>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
<!-------------------------------- Right side ------------------------------------>
<div class="right">
<?php include("app/includes/side.php") ?>
</div>
</section>
</div>
<?php include(ROOT_PATH . "/app/includes/footer.php") ?>
</div>