WIP: Blogposts
This commit is contained in:
8
blog.php
8
blog.php
@@ -64,7 +64,7 @@ if (!empty($bannerImages)) {
|
||||
<div class="col-lg-8">
|
||||
<?php
|
||||
// Query to retrieve data from the trips table
|
||||
$sql = "SELECT blog_id, title, date, category, image, description, author, members_only, link FROM blogs ORDER BY date DESC";
|
||||
$sql = "SELECT blog_id, title, date, category, image, description, author, members_only, link FROM blogs WHERE status = 'published' ORDER BY date DESC";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
@@ -86,7 +86,7 @@ if (!empty($bannerImages)) {
|
||||
$icon = "fa-lock";
|
||||
} else {
|
||||
if (getUserMemberStatus($_SESSION['user_id'])) {
|
||||
$blog_link = $row['link'];
|
||||
$blog_link = "blog_read.php?token=".encryptData($blog_id, $salt);
|
||||
$button_hover = "Read More";
|
||||
$icon = "fa-arrow-right";
|
||||
} else {
|
||||
@@ -96,7 +96,7 @@ if (!empty($bannerImages)) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$blog_link = $row['link'];
|
||||
$blog_link = "blog_read.php?token=".encryptData($blog_id, $salt);
|
||||
$button_hover = "Read More";
|
||||
$icon = "fa-arrow-right";
|
||||
}
|
||||
@@ -105,7 +105,7 @@ if (!empty($bannerImages)) {
|
||||
echo '
|
||||
<div class="blog-item style-three" data-aos="fade-up" data-aos-duration="1500" data-aos-offset="50">
|
||||
<div class="image">
|
||||
<img style="border-radius:20px;" src="assets/images/blog/' . $blog_id . '/' . $image . '" alt="Blog List">
|
||||
<img style="border-radius:20px;" src="' . $image . '" alt="Blog List">
|
||||
</div>
|
||||
<div class="content">
|
||||
<a href="blog.php" class="category">' . $category . '</a>
|
||||
|
||||
Reference in New Issue
Block a user