-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.php
75 lines (61 loc) · 2.41 KB
/
post.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
<?php include 'inc/header.php';?>
<?php
$id = mysqli_real_escape_string($db->link, $_GET['id']);
if(!isset($id ) || $id == NULL){
header("Location:404.php");
}else{
$id = $id ;
}
?>
<div class="contentsection contemplete clear">
<div class="maincontent clear">
<div class="about">
<?php
$query = "select * from tbl_post where id=$id";
$post = $db->select($query);
if($post){
while ($result = $post->fetch_assoc()){
?>
<h2><a href=" post.php?id=<?php echo $result['id'];?>"><?php echo $result['title'];?></a></h2>
<h4><?php echo $fm->formatDate($result['date']); ?>, By <a href = "#"><?php echo $result['author'];?></a></h4>
<img src="admin/<?php echo $result['image']; ?>" alt="post image"/>
<?php echo $result['body']; ?>
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://http-homerental-ml.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<div class="relatedpost clear">
<h2>Related articles</h2>
<?php
$catid = $result['cat'];
$queryrelated = "select * from tbl_post where cat='$catid' order by rand() limit 6";
$relatedpost = $db->select($queryrelated);
if($relatedpost){
while ($rresult = $relatedpost->fetch_assoc()){
?>
<a href="post.php?id=<?php echo $rresult['id'];?>">
<img src="admin/<?php echo $rresult['image']; ?>" alt="post image"/></a>
<?php } }else{ echo "There are no related post Avaiable...!!!"; }?>
</div>
<?php } }else{ header("Location:404.php");
}
?>
</div>
</div>
<?php include 'inc/sidebar.php';?>
<?php include 'inc/footer.php';?>