BLACKSITE
:
216.73.216.140
:
199.188.200.160 / jeddahhousingltd.com
:
Linux server383.web-hosting.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
:
/
home
/
jeddveug
/
www
/
Upload File:
files >> /home/jeddveug/www/blog_details.php
<?php require_once 'config/db.php'; $slug = $_GET['slug'] ?? ''; if (!$slug) { header('Location: ' . baseUrl('blog.php')); exit; } $stmt = $pdo->prepare("SELECT * FROM blogs WHERE slug = ? AND status = 'publish'"); $stmt->execute([$slug]); $blog = $stmt->fetch(); if (!$blog) { header('Location: ' . baseUrl('blog.php')); exit; } // SEO: Use blog-specific meta or fall back to title $page_title = $blog['meta_title'] ?: $blog['title']; $meta_description = $blog['meta_description'] ?: substr(strip_tags($blog['content']), 0, 160); // Get recent posts for sidebar $recent = $pdo->prepare("SELECT id, title, slug, image, publish_date FROM blogs WHERE status = 'publish' AND id != ? ORDER BY publish_date DESC LIMIT 5"); $recent->execute([$blog['id']]); $recent_posts = $recent->fetchAll(); require_once 'includes/header.php'; ?> <!-- Breadcrumb --> <div class="bg-primary-900 pt-24 pb-10"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> <div class="flex items-center text-sm text-primary-200 mb-3"> <a href="<?= baseUrl('/') ?>" class="hover:text-gold-400 transition-colors">Home</a> <i class="fas fa-chevron-right text-xs mx-2 text-primary-400"></i> <a href="<?= baseUrl('blog.php') ?>" class="hover:text-gold-400 transition-colors">Blog</a> <i class="fas fa-chevron-right text-xs mx-2 text-primary-400"></i> <span class="text-gold-400 truncate max-w-xs"><?= htmlspecialchars($blog['title']) ?></span> </div> <h1 class="text-2xl md:text-4xl font-bold text-white"><?= htmlspecialchars($blog['title']) ?></h1> <div class="flex items-center mt-4 text-primary-200 text-sm space-x-4"> <span><i class="fas fa-user mr-1"></i><?= htmlspecialchars($blog['author']) ?></span> <span><i class="fas fa-calendar mr-1"></i><?= $blog['publish_date'] ? date('F j, Y', strtotime($blog['publish_date'])) : '' ?></span> </div> </div> </div> <section class="py-12 bg-gray-50"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> <div class="grid grid-cols-1 lg:grid-cols-3 gap-8"> <!-- Blog Content --> <div class="lg:col-span-2"> <article class="bg-white rounded-2xl shadow-sm overflow-hidden"> <?php if ($blog['image']): ?> <img src="<?= baseUrl('uploads/blogs/' . htmlspecialchars($blog['image'])) ?>" class="w-full h-64 md:h-96 object-cover" alt="<?= htmlspecialchars($blog['title']) ?>"> <?php endif; ?> <div class="p-8"> <div class="prose max-w-none text-gray-600 leading-relaxed text-base"> <?= nl2br(htmlspecialchars($blog['content'])) ?> </div> </div> </article> <!-- Share --> <div class="bg-white rounded-2xl shadow-sm p-6 mt-6"> <h4 class="font-semibold text-gray-800 mb-3">Share this post</h4> <div class="flex space-x-3"> <a href="https://www.facebook.com/sharer/sharer.php?u=<?= urlencode('https://jeddahhousingltd.com/blog_details.php?slug=' . $blog['slug']) ?>" target="_blank" class="w-10 h-10 bg-blue-600 hover:bg-blue-700 rounded-full flex items-center justify-center text-white transition-colors"><i class="fab fa-facebook-f"></i></a> <a href="https://twitter.com/intent/tweet?url=<?= urlencode('https://jeddahhousingltd.com/blog_details.php?slug=' . $blog['slug']) ?>&text=<?= urlencode($blog['title']) ?>" target="_blank" class="w-10 h-10 bg-sky-500 hover:bg-sky-600 rounded-full flex items-center justify-center text-white transition-colors"><i class="fab fa-twitter"></i></a> <a href="https://wa.me/?text=<?= urlencode($blog['title'] . ' - https://jeddahhousingltd.com/blog_details.php?slug=' . $blog['slug']) ?>" target="_blank" class="w-10 h-10 bg-green-500 hover:bg-green-600 rounded-full flex items-center justify-center text-white transition-colors"><i class="fab fa-whatsapp"></i></a> </div> </div> </div> <!-- Sidebar --> <aside> <div class="bg-white rounded-2xl shadow-sm p-6 sticky top-24"> <h3 class="font-bold text-gray-800 mb-4">Recent Posts</h3> <?php if (empty($recent_posts)): ?> <p class="text-gray-400 text-sm">No other posts yet.</p> <?php else: ?> <div class="space-y-4"> <?php foreach ($recent_posts as $rp): ?> <a href="<?= baseUrl('blog_details.php?slug=' . htmlspecialchars($rp['slug'])) ?>" class="flex items-start space-x-3 group"> <?php if ($rp['image']): ?> <img src="<?= baseUrl('uploads/blogs/' . htmlspecialchars($rp['image'])) ?>" class="w-16 h-12 object-cover rounded-lg flex-shrink-0" alt=""> <?php else: ?> <div class="w-16 h-12 bg-gray-200 rounded-lg flex-shrink-0 flex items-center justify-center"><i class="fas fa-image text-gray-400 text-xs"></i></div> <?php endif; ?> <div> <h4 class="text-sm font-medium text-gray-800 group-hover:text-primary-700 transition-colors line-clamp-2"><?= htmlspecialchars($rp['title']) ?></h4> <span class="text-xs text-gray-400"><?= $rp['publish_date'] ? date('M j, Y', strtotime($rp['publish_date'])) : '' ?></span> </div> </a> <?php endforeach; ?> </div> <?php endif; ?> </div> </aside> </div> </div> </section> <?php require_once 'includes/footer.php'; ?>