-
Notifications
You must be signed in to change notification settings - Fork 0
/
category.php
98 lines (83 loc) · 3.74 KB
/
category.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php include "includes/head.php"; ?>
<style>
.short-description {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
</style>
<?php
/*--create session array for storing errors-start--*/
if (!isset($_SESSION['errors']) || count($_SESSION['errors']) == 0) {
$_SESSION['errors'] = array();
}
if(isset($_GET['type']) && $_GET['type'] != 0){
$categoryType = $_GET['type'];
}
?>
<body>
<?php include "includes/header.php"; ?>
<main class="site-main">
<!--================ Start Blog Post Area =================-->
<section class="blog-post-area section-margin">
<div class="container">
<div class="row">
<div class="col-lg-8">
<div class="row">
<?php
$sql = "SELECT * FROM `tbl_blogs` WHERE `blog_status` = 'A' AND `blog_category` = '$categoryType' ORDER BY `blog_id` DESC LIMIT 7 ";
$result = mysqli_query($con, $sql);
if($result){
if(mysqli_num_rows($result)>0){
while($row = mysqli_fetch_assoc($result)){
?>
<div class="col-md-6">
<div class="single-recent-blog-post card-view">
<div class="thumb">
<a href="blog.php?blogID=<?php echo $row['blog_id']; ?>"><img class="card-img rounded-0" src="<?php echo "admin/".$row['blog_image']; ?>"
alt="Featured Image"></a>
<ul class="thumb-info">
<li><a><i
class="ti-user"></i><?php echo getUserName($row['blog_postedBy']); ?></a>
</li>
<li><a><i
class="ti-user"></i><?php echo timeago($row['blog_createddate']); ?></a>
</li>
<!-- <li><a href="#"><i class="ti-themify-favicon"></i>2 Comments</a></li> -->
</ul>
</div>
<div class="details mt-20">
<a href="blog.php?blogID=<?php echo $row['blog_id']; ?>">
<h3><?php echo $row['blog_title']; ?></h3>
</a>
<p class="short-description"><?php echo $row['blog_description']; ?></p>
<a class="button" href="#">Read More <i class="ti-arrow-right"></i></a>
</div>
</div>
</div>
<?php }
}else{
?>
<div class="alert alert-info">Not Found</div>
<?php
}
}
?>
</div>
</div>
<!--================ Start Blog Post Area =================-->
<!-- Start Blog Post Siddebar -->
<?php include "includes/sidebar.php"; ?>
<!-- End Blog Post Siddebar -->
</div>
</section>
<!--================ End Blog Post Area =================-->
</div>
</section>
<!--================ End Blog Post Area =================-->
</main>
<?php include "includes/footer.php"; ?>
<?php include "includes/jsfiles.php"; ?>
</body>
</html>