164 lines
8.2 KiB
PHP
164 lines
8.2 KiB
PHP
<?php
|
||
require_once __DIR__ . '/db/config.php';
|
||
|
||
$projectName = "财神组聊天构造";
|
||
$projectDesc = "财神组内部资料 翻版必究";
|
||
$projectLogo = "assets/pasted-20260130-145435-442da57a.jpg";
|
||
|
||
$dbError = false;
|
||
$allContent = [];
|
||
|
||
try {
|
||
$db = db();
|
||
$stmt = $db->query("SELECT section_key, title, content FROM site_content ORDER BY id ASC");
|
||
$allContent = $stmt->fetchAll();
|
||
} catch (PDOException $e) {
|
||
$dbError = "数据库连接失败或未初始化。请检查 db/config.php 并访问 /db/setup_db.php";
|
||
error_log("DB Error: " . $e->getMessage());
|
||
}
|
||
?>
|
||
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title><?php echo htmlspecialchars($projectName); ?></title>
|
||
<meta name="description" content="<?php echo htmlspecialchars($projectDesc); ?>">
|
||
<link rel="icon" type="image/jpeg" href="<?php echo htmlspecialchars($projectLogo); ?>">
|
||
|
||
<!-- Bootstrap 5 CSS -->
|
||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||
<!-- Bootstrap Icons -->
|
||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
|
||
<!-- Google Fonts: Inter -->
|
||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
|
||
<!-- Custom CSS -->
|
||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||
</head>
|
||
<body>
|
||
|
||
<!-- Watermark -->
|
||
<div class="watermark">
|
||
<?php for($i=0; $i<40; $i++): ?>
|
||
<div class="watermark-text">财神组</div>
|
||
<?php endfor; ?>
|
||
</div>
|
||
|
||
<!-- Mobile Navbar -->
|
||
<header class="navbar sticky-top bg-danger flex-md-nowrap p-0 shadow d-md-none">
|
||
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6 text-white fw-bold" href="#">
|
||
<img src="<?php echo htmlspecialchars($projectLogo); ?>" alt="Logo" style="height: 30px; margin-right: 10px; border-radius: 4px;">
|
||
<?php echo htmlspecialchars($projectName); ?>
|
||
</a>
|
||
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation" style="right: 1rem; top: .5rem;">
|
||
<span class="navbar-toggler-icon"></span>
|
||
</button>
|
||
</header>
|
||
|
||
<div class="container-fluid">
|
||
<div class="row">
|
||
<!-- Sidebar -->
|
||
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
|
||
<div class="position-sticky pt-3 sidebar-sticky">
|
||
<div class="text-center mb-4 px-3 d-none d-md-block">
|
||
<img src="<?php echo htmlspecialchars($projectLogo); ?>" alt="Logo" class="img-fluid rounded shadow" style="max-height: 100px; border: 2px solid #FFD700;">
|
||
<h5 class="mt-3 fw-black text-danger"><?php echo htmlspecialchars($projectName); ?></h5>
|
||
</div>
|
||
|
||
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-2 text-muted text-uppercase">
|
||
<span><i class="bi bi-journal-text me-2"></i>每日脚本</span>
|
||
</h6>
|
||
<ul class="nav flex-column">
|
||
<?php if (empty($allContent)): ?>
|
||
<li class="nav-item px-3 text-muted small">暂无内容</li>
|
||
<?php else: ?>
|
||
<?php foreach ($allContent as $item):
|
||
if (strpos($item['section_key'], 'day') === 0): ?>
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="#" data-section="<?php echo $item['section_key']; ?>">
|
||
<i class="bi bi-calendar-check me-2"></i>
|
||
<?php echo htmlspecialchars($item['title']); ?>
|
||
</a>
|
||
</li>
|
||
<?php endif; endforeach; ?>
|
||
<?php endif; ?>
|
||
</ul>
|
||
|
||
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-2 text-muted text-uppercase">
|
||
<span><i class="bi bi-list-stars me-2"></i>引导步骤</span>
|
||
</h6>
|
||
<ul class="nav flex-column mb-5">
|
||
<?php if (empty($allContent)): ?>
|
||
<li class="nav-item px-3 text-muted small">暂无内容</li>
|
||
<?php else: ?>
|
||
<?php foreach ($allContent as $item):
|
||
if (strpos($item['section_key'], 'step') === 0): ?>
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="#" data-section="<?php echo $item['section_key']; ?>">
|
||
<i class="bi bi-pin-angle me-2"></i>
|
||
<?php echo htmlspecialchars($item['title']); ?>
|
||
</a>
|
||
</li>
|
||
<?php endif; endforeach; ?>
|
||
<?php endif; ?>
|
||
</ul>
|
||
</div>
|
||
</nav>
|
||
|
||
<!-- Main Content -->
|
||
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4 py-4">
|
||
<?php if ($dbError): ?>
|
||
<div class="alert alert-danger shadow-sm border-start border-5 border-danger">
|
||
<h4 class="alert-heading"><i class="bi bi-exclamation-triangle-fill me-2"></i>系统未就绪</h4>
|
||
<p><?php echo $dbError; ?></p>
|
||
<hr>
|
||
<p class="mb-0 small">请确保您已经在宝塔面板中:1. 创建了数据库;2. 修改了 <code>db/config.php</code>;3. 访问了 <code>您的域名/db/setup_db.php</code>。</p>
|
||
</div>
|
||
<?php endif; ?>
|
||
|
||
<div id="content-area" class="bg-white p-5 rounded shadow-sm">
|
||
<div class="text-center py-5">
|
||
<img src="<?php echo htmlspecialchars($projectLogo); ?>" alt="Welcome" class="img-fluid mb-4 opacity-75" style="max-width: 200px; filter: grayscale(1) brightness(0.5) sepia(1) hue-rotate(-50deg) saturate(5);">
|
||
<h2 class="fw-bold" style="color: #B71C1C;">欢迎使用财神组内部系统</h2>
|
||
<p class="lead text-muted">请从左侧菜单选择对应的脚本或步骤开始学习</p>
|
||
<?php if (empty($allContent) && !$dbError): ?>
|
||
<div class="mt-4 p-3 border rounded bg-light">
|
||
<p class="text-danger fw-bold mb-0">发现数据库中没有内容!</p>
|
||
<a href="db/setup_db.php" class="btn btn-danger mt-2">点击此处初始化数据</a>
|
||
</div>
|
||
<?php endif; ?>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Footer -->
|
||
<footer class="footer rounded shadow-sm mt-4">
|
||
<div class="container">
|
||
<span><i class="bi bi-shield-lock me-2"></i>财神组内部资料 翻版必究</span>
|
||
</div>
|
||
</footer>
|
||
</main>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Telegram Floating Button -->
|
||
<a href="https://t.me/zhangshihao818" target="_blank" class="btn btn-primary rounded-circle shadow-lg position-fixed" style="bottom: 80px; right: 30px; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; z-index: 10000; background-color: #0088cc; border: 3px solid #fff;">
|
||
<i class="bi bi-telegram fs-2 text-white"></i>
|
||
</a>
|
||
|
||
<!-- Back to Top Button -->
|
||
<button id="backToTop" class="btn btn-danger rounded-circle shadow-lg position-fixed d-none" style="bottom: 25px; right: 25px; width: 45px; height: 45px; z-index: 10000; border: 2px solid #FFD700;">
|
||
<i class="bi bi-arrow-up fs-5"></i>
|
||
</button>
|
||
|
||
<!-- JSON Data for Content (Hidden) -->
|
||
<script id="site-data" type="application/json">
|
||
<?php echo json_encode($allContent); ?>
|
||
</script>
|
||
|
||
<!-- Bootstrap JS -->
|
||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||
<!-- Custom JS -->
|
||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||
|
||
</body>
|
||
</html>
|