WIP: Blogposts

This commit is contained in:
2025-12-02 17:41:24 +02:00
parent b69f8f5f1b
commit 7d078cb954
20 changed files with 1038 additions and 13 deletions

View File

@@ -51,7 +51,7 @@ if (!empty($bannerImages)) {
<div style="padding-top: 50px; padding-bottom: 50px;">
<img style="width: 250px; margin-bottom: 20px;" src="assets/images/logos/weblogo2.png" alt="Logo">
<h1 class="hero-title" data-aos="flip-up" data-aos-delay="50" data-aos-duration="1500" data-aos-offset="50">
Welcome to<br>the Four Wheel Drive Club<br>of Southern Africa
Welcome to<br>the 4 Wheel Drive Club<br>of Southern Africa
</h1>
<a href="membership.php" class="theme-btn style-two bgc-secondary" style="margin-top: 20px; background-color: #e90000; padding: 10px 20px; color: white; text-decoration: none; border-radius: 25px;">
<span data-hover="Become a Member">Become a Member</span>
@@ -112,7 +112,7 @@ if (countUpcomingTrips() > 0) { ?>
</div>
<div class="content">
<span class="location"><i class="fal fa-map-marker-alt"></i> ' . $location . '</span>
<h5><a href="trip-details.php?trip_id=' . $trip_id . '">' . $trip_name . '</a></h5>
<h5><a href="trip-details.php?token=' . encryptData($trip_id, $salt) . '">' . $trip_name . '</a></h5>
<span class="time">' . convertDate($start_date) . ' - ' . convertDate($end_date) . '</span><br>
<span class="time">' . calculateDaysAndNights($start_date, $end_date) . '</span>
</div>
@@ -541,7 +541,7 @@ if (countUpcomingTrips() > 0) { ?>
</div>
<div class="row justify-content-center">
<?php
$sql = "SELECT blog_id, title, date, category, image, description, author, link, members_only FROM blogs ORDER BY date DESC LIMIT 3";
$sql = "SELECT blog_id, title, date, category, image, description, author, link, members_only FROM blogs WHERE status = 'published' ORDER BY date DESC LIMIT 3 ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
@@ -562,7 +562,7 @@ if (countUpcomingTrips() > 0) { ?>
$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{
@@ -572,7 +572,7 @@ if (countUpcomingTrips() > 0) { ?>
}
}
}else{
$blog_link = $row['link'];
$blog_link = "blog_read.php?token=".encryptData($blog_id, $salt);
$button_hover = "Read More";
$icon = "fa-arrow-right";
}
@@ -591,7 +591,7 @@ if (countUpcomingTrips() > 0) { ?>
</ul>
</div>
<div class="image">
<img style="border-radius:20px;" src="assets/images/blog/' . $blog_id . '/' . $blog_image . '" alt="Blog List">
<img style="border-radius:20px;" src="' . $blog_image . '" alt="Blog List">
</div>
<a style="width:100%;" href="' . $blog_link . '" class="theme-btn">
<span style="width:100%;" data-hover="'.$button_hover.'">Read More</span>