-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog_details.php
205 lines (160 loc) · 6.62 KB
/
blog_details.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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<?php
include "inc/header.php";
?>
<div role="main" class="main">
<!-- ########## START: TOP HEADING ########## -->
<section class="page-header page-header-modern bg-color-light-scale-1 page-header-md"
style="background-image: linear-gradient(to left, rgba(0,0,0,0.4), rgba(0,0,0,0.4)) ,url(assets/images/breadcrumb.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
">
<div class="container">
<div class="row">
<div class="col-md-12 align-self-center p-static order-2 text-center">
<h1 class="text-white font-weight-bold text-8">Blog Details</h1>
</div>
<div class="col-md-12 align-self-center order-1">
<ul class="breadcrumb d-block text-center" >
<li><a href="index.php" class="text-white">HOME</a></li>
<li class="active text-white" >BLOG DETAILS</li>
</ul>
</div>
</div>
</div>
</section>
<!-- ########## END: TOP HEADING ########## -->
<div class="container py-4">
<div class="row">
<div class="col-lg-3 order-lg-2">
<?php include"inc/sidebar.php"; ?>
</div>
<div class="col-lg-9 order-lg-1">
<div class="blog-posts single-post">
<?php
if (isset($_GET['dId'])) {
$find_postId = $_GET['dId'];
$sql = "SELECT * FROM post WHERE post_id='$find_postId'";
$postData = mysqli_query($db, $sql);
while( $row = mysqli_fetch_assoc($postData) ) {
$post_id = $row['post_id'];
$title = $row['title'];
$post_desc = $row['post_desc'];
$image = $row['image'];
$category_id = $row['category_id'];
$author_id = $row['author_id'];
$tags = $row['tags'];
$status = $row['status'];
$post_date = $row['post_date'];
$view_count = $row['view_count'];
// <!-- View Couunting -->
$updateViewCount = $view_count+1;
$sql = "UPDATE post SET view_count='$updateViewCount' WHERE post_id='$post_id'";
$updateViewCount_Query = mysqli_query($db, $sql);
// <!-- View Couunting -->
?>
<article class="post post-large blog-single-post border-0 m-0 p-0">
<div class="post-image ml-0">
<?php
if (!empty($image)) {
echo '<img src="admin/assets/images/posts/' . $image . '" class="img-fluid img-thumbnail img-thumbnail-no-borders rounded-0" alt="'. $title .'">';
}
else {
echo '<img src="admin/img/blog/wide/blog-11.jpg" class="img-fluid img-thumbnail img-thumbnail-no-borders rounded-0" alt="" />';
}
?>
</div>
<div class="post-date ml-0" style="margin-top: -2%;">
<!-- <span class="day">10</span> -->
<span class="month"><?php echo $post_date; ?></span>
</div> <br>
<div class="post-content ml-0">
<h2 class="font-weight-bold"><?php echo $title; ?></h2>
<div class="post-meta">
<span><i class="far fa-user"></i> By <a href="">
<?php
$readUser_Sql = "SELECT * FROM users WHERE user_id ='$author_id'";
$readUser_Quary = mysqli_query($db, $readUser_Sql);
while( $row = mysqli_fetch_assoc($readUser_Quary) ){
$auth_id = $row['user_id'];
$auth_name = $row['user_name'];
echo $auth_name;
}
?>
</a> </span>
<span><i class="far fa-folder"></i> <a href="">
<?php
$readCat_Sql = "SELECT * FROM category WHERE cat_id='$category_id'";
$readCat_Quary = mysqli_query($db, $readCat_Sql);
while( $row = mysqli_fetch_assoc($readCat_Quary) ){
$cc_id = $row['cat_id'];
$cc_name = $row['cat_name'];
?>
<a href="blog_details.php?do=Manage&did=<?php echo $cc_id; ?>"><?php echo $cc_name; ?></a>
<?php
}
?>
</a> </span>
<span><i class="far fa-eye"></i> <a href="#"><?php echo $view_count; ?> Views</a></span>
</div>
<p><?php echo $post_desc; ?> </p>
</div>
<!-- Author Details -->
<?php
}
?>
</div>
</article>
<?php }
?>
</div>
</div>
</div>
</div>
<!-- START: IMAGE SHOWCASE PART -->
<section class="image_show py-5">
<div class="conatiner py-3">
<div class="row text-center pt-3 d-flex align-items-center">
<div class="col-md-10 mx-md-auto">
<h1 class="welcomes">Our Gallary</h1>
</div>
</div>
</div>
<div class="container">
<div class="row">
<?php
$overviewSql = "SELECT * FROM farm_overview WHERE ov_category=1 AND status=1 ORDER BY title ASC";
$overviewQuery = mysqli_query( $db, $overviewSql );
while ($row = mysqli_fetch_assoc($overviewQuery)) {
$ov_id = $row['ov_id'];
$title = $row['title'];
$descrive = $row['descrive'];
$ov_category = $row['ov_category'];
$ov_image = $row['ov_image'];
$status = $row['status'];
?>
<div class="col-lg-3 py-3">
<span class="thumb-info thumb-info-no-borders thumb-info-no-borders-rounded thumb-info-lighten thumb-info-bottom-info thumb-info-bottom-info-dark thumb-info-bottom-info-dark-linear thumb-info-centered-icons">
<span class="thumb-info-wrapper">
<?php
if (!empty($ov_image)) {
echo '<img src="admin/assets/images/overview_img/' . $ov_image . '" style="width: 100%";>';
?>
<span class="thumb-info-title">
<span class="thumb-info-inner line-height-1 galery"><?php echo $title; ?></span>
<span class="thumb-info-type galerys"><?php echo substr($descrive, 0, 30); ?>...</span>
</span>
<?php }
?>
</span>
</span>
</div>
<?php
}
?>
</div>
</div>
</section>
<!-- END: IMAGE SHOWCASE PART -->
</div>
<?php include "inc/footer.php"; ?>