-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabout.php
More file actions
76 lines (69 loc) · 2.86 KB
/
about.php
File metadata and controls
76 lines (69 loc) · 2.86 KB
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
<?php
// =====================================================
// About Page
// =====================================================
require_once 'includes/config.php';
// Helper function to get setting
function getSetting($conn, $key) {
$stmt = mysqli_prepare($conn, "SELECT setting_value FROM site_settings WHERE setting_key = ?");
mysqli_stmt_bind_param($stmt, 's', $key);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
$row = mysqli_fetch_assoc($result);
return $row ? $row['setting_value'] : '';
}
$about_title = getSetting($conn, 'about_title') ?: 'About Us';
$about_content = getSetting($conn, 'about_content');
$page_title = $about_title . ' - ' . SITE_NAME;
$meta_description = strip_tags(substr($about_content, 0, 160));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?php echo htmlspecialchars($meta_description); ?>">
<title><?php echo htmlspecialchars($page_title); ?></title>
<link rel="icon" type="image/x-icon" href="<?php echo SITE_URL; ?>gif/favicon.ico">
<link rel="stylesheet" href="<?php echo SITE_URL; ?>css/frontend.css">
</head>
<body>
<nav class="navbar">
<div class="container">
<a href="<?php echo SITE_URL; ?>" class="logo"><img src="<?php echo SITE_URL; ?>gif/blog_system_logo.svg" alt="<?php echo SITE_NAME; ?>"></a>
<button class="menu-toggle" onclick="toggleMenu()">
<span></span><span></span><span></span>
</button>
<ul class="nav-menu" id="navMenu">
<li><a href="index.php">Home</a></li>
<li><a href="articles.php">All Articles</a></li>
<li><a href="most-read.php">Most Read</a></li>
<li><a href="about.php" class="active">About</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
</nav>
<main class="main-content">
<div class="container">
<div class="single-article">
<header class="article-header">
<h1><?php echo htmlspecialchars($about_title); ?></h1>
</header>
<div class="article-body">
<?php if ($about_content): ?>
<?php echo $about_content; ?>
<?php else: ?>
<p>About page content has not been set up yet. Please check back later.</p>
<?php endif; ?>
</div>
</div>
</div>
</main>
<footer class="footer">
<div class="container">
<p>© <?php echo date('Y'); ?> <?php echo SITE_NAME; ?>. All rights reserved.</p>
</div>
</footer>
<script src="<?php echo SITE_URL; ?>js/main.js"></script>
</body>
</html>