diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..6bf2e57 --- /dev/null +++ b/admin.php @@ -0,0 +1,107 @@ + $_POST['site_title'], + 'site_logo' => $_POST['site_logo'], + 'tg_link' => $_POST['tg_link'], + 'footer_copy' => $_POST['footer_copy'], + 'watermark_text' => $_POST['watermark_text'] + ]; + + foreach ($updates as $key => $val) { + $stmt = $pdo->prepare("UPDATE settings SET setting_value = ? WHERE setting_key = ?"); + $stmt->execute([$val, $key]); + } + $message = '设置更新成功!'; +} + +// Get current settings +$settings = []; +$stmt = $pdo->query("SELECT setting_key, setting_value FROM settings"); +while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { + $settings[$row['setting_key']] = $row['setting_value']; +} +$site_logo = $settings['site_logo'] ?? 'assets/pasted-20260207-134833-7329dc42.jpg'; +?> + + + + + 后台管理 - <?php echo htmlspecialchars($settings['site_title'] ?? '财神组聊天框架'); ?> + + + + + + +
+
+ +
+

系统设置

+ +
+ + +
+
+
+
+ + +
+
+ + +
当前路径:
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/admin_steps.php b/admin_steps.php new file mode 100644 index 0000000..e2f1b73 --- /dev/null +++ b/admin_steps.php @@ -0,0 +1,179 @@ +query("SELECT setting_key, setting_value FROM settings"); +$settings = []; +while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { + $settings[$row['setting_key']] = $row['setting_value']; +} +$site_logo = $settings['site_logo'] ?? 'assets/pasted-20260207-134833-7329dc42.jpg'; + +$message = ''; +$edit_day = isset($_GET['edit']) ? (int)$_GET['edit'] : 0; + +// Handle Content Update +if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_step'])) { + $day = (int)$_POST['day_number']; + $stmt = $pdo->prepare("UPDATE steps SET + title = ?, what_to_chat = ?, how_to_chat = ?, why_to_chat = ?, + correct_example = ?, wrong_example = ?, correct_explanation = ?, + wrong_explanation = ?, image_url = ? + WHERE day_number = ?"); + + $stmt->execute([ + $_POST['title'], $_POST['what_to_chat'], $_POST['how_to_chat'], $_POST['why_to_chat'], + $_POST['correct_example'], $_POST['wrong_example'], $_POST['correct_explanation'], + $_POST['wrong_explanation'], $_POST['image_url'], $day + ]); + $message = "第 {$day} 天的内容更新成功!"; + $edit_day = 0; +} + +// Fetch all steps +$steps = $pdo->query("SELECT * FROM steps ORDER BY day_number ASC")->fetchAll(PDO::FETCH_ASSOC); + +// Fetch specific step for editing +$current_step = null; +if ($edit_day > 0) { + foreach ($steps as $s) { + if ($s['day_number'] == $edit_day) { + $current_step = $s; + break; + } + } +} +?> + + + + + 话术管理 - <?php echo htmlspecialchars($settings['site_title'] ?? '财神组聊天框架'); ?> + + + + + + +
+
+ +
+
+

话术管理 (1-7天步骤)

+
+ + +
+ + + +
+
+ 正在编辑:第 + +
+
+
+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + + +
+
+ + + + +
+
+
+ + 取消 +
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + +
天数标题最后更新操作
Day + + 编辑 + +
+
+
+
+
+ + \ No newline at end of file diff --git a/assets/css/custom.css b/assets/css/custom.css index 65a1626..75b72dd 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -1,346 +1,213 @@ :root { - --color-bg: #ffffff; - --color-text: #1a1a1a; - --color-primary: #2563EB; /* Vibrant Blue */ - --color-secondary: #000000; - --color-accent: #A3E635; /* Lime Green */ - --color-surface: #f8f9fa; - --font-heading: 'Space Grotesk', sans-serif; - --font-body: 'Inter', sans-serif; - --border-width: 2px; - --shadow-hard: 5px 5px 0px #000; - --shadow-hover: 8px 8px 0px #000; - --radius-pill: 50rem; - --radius-card: 1rem; + --primary-color: #d4af37; + --secondary-color: #1a1a1a; + --text-color: #333; + --bg-color: #f8f9fa; + --sidebar-width: 280px; } body { - font-family: var(--font-body); - background-color: var(--color-bg); - color: var(--color-text); + font-family: 'Inter', "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; + background-color: var(--bg-color); + color: var(--text-color); overflow-x: hidden; } -h1, h2, h3, h4, h5, h6, .navbar-brand { - font-family: var(--font-heading); - letter-spacing: -0.03em; -} - -/* Utilities */ -.text-primary { color: var(--color-primary) !important; } -.bg-black { background-color: #000 !important; } -.text-white { color: #fff !important; } -.shadow-hard { box-shadow: var(--shadow-hard); } -.border-2-black { border: var(--border-width) solid #000; } -.py-section { padding-top: 5rem; padding-bottom: 5rem; } - -/* Navbar */ -.navbar { - background: rgba(255, 255, 255, 0.9); - backdrop-filter: blur(10px); - border-bottom: var(--border-width) solid transparent; - transition: all 0.3s; - padding-top: 1rem; - padding-bottom: 1rem; -} - -.navbar.scrolled { - border-bottom-color: #000; - padding-top: 0.5rem; - padding-bottom: 0.5rem; -} - -.brand-text { - font-size: 1.5rem; - font-weight: 800; -} - -.nav-link { - font-weight: 500; - color: var(--color-text); - margin-left: 1rem; - position: relative; -} - -.nav-link:hover, .nav-link.active { - color: var(--color-primary); -} - -/* Buttons */ -.btn { - font-weight: 700; - font-family: var(--font-heading); - padding: 0.8rem 2rem; - border-radius: var(--radius-pill); - border: var(--border-width) solid #000; - transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1); - box-shadow: var(--shadow-hard); -} - -.btn:hover { - transform: translate(-2px, -2px); - box-shadow: var(--shadow-hover); -} - -.btn:active { - transform: translate(2px, 2px); - box-shadow: 0 0 0 #000; -} - -.btn-primary { - background-color: var(--color-primary); - border-color: #000; - color: #fff; -} - -.btn-primary:hover { - background-color: #1d4ed8; - border-color: #000; - color: #fff; -} - -.btn-outline-dark { - background-color: #fff; - color: #000; -} - -.btn-cta { - background-color: var(--color-accent); - color: #000; -} - -.btn-cta:hover { - background-color: #8cc629; - color: #000; -} - -/* Hero Section */ -.hero-section { - min-height: 100vh; - padding-top: 80px; -} - -.background-blob { - position: absolute; - border-radius: 50%; - filter: blur(80px); - opacity: 0.6; - z-index: 1; -} - -.blob-1 { - top: -10%; - right: -10%; - width: 600px; - height: 600px; - background: radial-gradient(circle, var(--color-accent), transparent); -} - -.blob-2 { - bottom: 10%; - left: -10%; - width: 500px; - height: 500px; - background: radial-gradient(circle, var(--color-primary), transparent); -} - -.highlight-text { - background: linear-gradient(120deg, transparent 0%, transparent 40%, var(--color-accent) 40%, var(--color-accent) 100%); - background-repeat: no-repeat; - background-size: 100% 40%; - background-position: 0 88%; - padding: 0 5px; -} - -.dot { color: var(--color-primary); } - -.badge-pill { - display: inline-block; - padding: 0.5rem 1rem; - border: 2px solid #000; - border-radius: 50px; - font-weight: 700; - background: #fff; - box-shadow: 4px 4px 0 #000; - font-family: var(--font-heading); - font-size: 0.9rem; -} - -/* Marquee */ -.marquee-container { - overflow: hidden; - white-space: nowrap; - border-top: 2px solid #000; - border-bottom: 2px solid #000; -} - -.rotate-divider { - transform: rotate(-2deg) scale(1.05); - z-index: 10; - position: relative; - margin-top: -50px; - margin-bottom: 30px; -} - -.marquee-content { - display: inline-block; - animation: marquee 20s linear infinite; - font-family: var(--font-heading); - font-weight: 700; - font-size: 1.5rem; - letter-spacing: 2px; -} - -@keyframes marquee { - 0% { transform: translateX(0); } - 100% { transform: translateX(-50%); } -} - -/* Portfolio Cards */ -.project-card { - border: 2px solid #000; - border-radius: var(--radius-card); - overflow: hidden; - background: #fff; - transition: transform 0.3s ease; - box-shadow: var(--shadow-hard); +/* Watermark */ +.watermark-container { + position: fixed; + top: 0; + left: 0; + width: 100%; height: 100%; + pointer-events: none; + z-index: 9999; + opacity: 0.05; + overflow: hidden; +} + +.watermark-text { + position: absolute; + width: 200%; + height: 200%; + top: -50%; + left: -50%; display: flex; - flex-direction: column; + flex-wrap: wrap; + justify-content: center; + align-content: center; + transform: rotate(-30deg); + font-size: 24px; + font-weight: bold; + color: #000; } -.project-card:hover { - transform: translateY(-10px); - box-shadow: 8px 8px 0 #000; +.watermark-item { + padding: 60px; + white-space: nowrap; } -.card-img-holder { - height: 250px; +/* Sidebar Layout */ +.wrapper { + display: flex; + min-height: 100vh; +} + +#sidebar { + width: var(--sidebar-width); + background: var(--secondary-color); + color: #fff; + transition: all 0.3s; + position: fixed; + height: 100vh; + z-index: 1000; +} + +#content { + width: calc(100% - var(--sidebar-width)); + margin-left: var(--sidebar-width); + padding: 40px; + transition: all 0.3s; +} + +.sidebar-header { + padding: 25px; + background: #000; + text-align: center; +} + +.sidebar-header h3 { + font-size: 1.2rem; + color: var(--primary-color); + margin: 0; +} + +#sidebar ul.components { + padding: 20px 0; +} + +#sidebar ul li a { + padding: 15px 25px; + display: block; + color: #adb5bd; + text-decoration: none; + transition: 0.3s; +} + +#sidebar ul li a:hover, #sidebar ul li.active > a { + color: #fff; + background: rgba(212, 175, 55, 0.1); + border-left: 4px solid var(--primary-color); +} + +#sidebar ul li a i { + margin-right: 10px; +} + +/* Floating TG Button */ +.tg-float { + position: fixed; + right: 30px; + top: 50%; + transform: translateY(-50%); + z-index: 1001; + text-align: center; +} + +.tg-btn { + width: 60px; + height: 60px; + background-color: #0088cc; + color: white; + border-radius: 50%; display: flex; align-items: center; justify-content: center; - border-bottom: 2px solid #000; - position: relative; - font-size: 4rem; -} - -.placeholder-art { - transition: transform 0.3s ease; -} - -.project-card:hover .placeholder-art { - transform: scale(1.2) rotate(10deg); -} - -.bg-soft-blue { background-color: #e0f2fe; } -.bg-soft-green { background-color: #dcfce7; } -.bg-soft-purple { background-color: #f3e8ff; } -.bg-soft-yellow { background-color: #fef9c3; } - -.category-tag { - position: absolute; - top: 15px; - right: 15px; - background: #000; - color: #fff; - padding: 5px 12px; - border-radius: 20px; - font-size: 0.75rem; - font-weight: 700; -} - -.card-body { padding: 1.5rem; } - -.link-arrow { + font-size: 30px; + box-shadow: 0 4px 15px rgba(0,0,0,0.3); text-decoration: none; - color: #000; - font-weight: 700; - display: inline-flex; - align-items: center; - margin-top: auto; + animation: pulse-tg 2s infinite; } -.link-arrow i { transition: transform 0.2s; margin-left: 5px; } -.link-arrow:hover i { transform: translateX(5px); } - -/* About */ -.about-image-stack { - position: relative; - height: 400px; - width: 100%; +.tg-btn:hover { + color: #fff; } -.stack-card { - position: absolute; - width: 80%; - height: 100%; - border-radius: var(--radius-card); - border: 2px solid #000; - box-shadow: var(--shadow-hard); - left: 10%; - transform: rotate(-3deg); - background-size: cover; +.tg-text { + display: block; + font-size: 12px; + margin-top: 5px; + background: rgba(0,0,0,0.7); + color: #fff; + padding: 2px 8px; + border-radius: 10px; } -/* Forms */ -.form-control { - border: 2px solid #000; - border-radius: 0.5rem; - padding: 1rem; - font-weight: 500; - background: #f8f9fa; +@keyframes pulse-tg { + 0% { box-shadow: 0 0 0 0 rgba(0, 136, 204, 0.7); } + 70% { box-shadow: 0 0 0 20px rgba(0, 136, 204, 0); } + 100% { box-shadow: 0 0 0 0 rgba(0, 136, 204, 0); } } -.form-control:focus { - box-shadow: 4px 4px 0 var(--color-primary); - border-color: #000; +/* Back to Top */ +#back-to-top { + position: fixed; + bottom: 30px; + right: 30px; + display: none; + z-index: 1001; +} + +/* Content Cards */ +.card { + border: none; + border-radius: 12px; + box-shadow: 0 5px 15px rgba(0,0,0,0.05); + margin-bottom: 30px; +} + +.card-header { background: #fff; + border-bottom: 1px solid #eee; + font-weight: bold; + padding: 15px 25px; } -/* Animations */ -.animate-up { - opacity: 0; - transform: translateY(30px); - animation: fadeUp 0.8s ease forwards; +.step-badge { + background: var(--primary-color); + color: #fff; + padding: 5px 15px; + border-radius: 20px; + font-size: 0.8rem; } -.delay-100 { animation-delay: 0.1s; } -.delay-200 { animation-delay: 0.2s; } - -@keyframes fadeUp { - to { - opacity: 1; - transform: translateY(0); - } +/* Example Sections */ +.example-box { + padding: 20px; + border-radius: 8px; + margin-bottom: 20px; } -/* Social */ -.social-links a { - transition: transform 0.2s; - display: inline-block; -} -.social-links a:hover { - transform: scale(1.2) rotate(10deg); - color: var(--color-accent) !important; +.correct-box { + background-color: #e8f5e9; + border-left: 5px solid #4caf50; } -/* Responsive */ -@media (max-width: 991px) { - .rotate-divider { - transform: rotate(0); - margin-top: 0; - margin-bottom: 2rem; - } - - .hero-section { - padding-top: 120px; - text-align: center; - min-height: auto; - padding-bottom: 100px; - } - - .display-1 { font-size: 3.5rem; } - - .blob-1 { width: 300px; height: 300px; right: -20%; } - .blob-2 { width: 300px; height: 300px; left: -20%; } +.wrong-box { + background-color: #ffebee; + border-left: 5px solid #f44336; } + +footer { + padding: 40px 0; + text-align: center; + border-top: 1px solid #eee; + margin-top: 50px; +} + +@media (max-width: 768px) { + #sidebar { margin-left: -var(--sidebar-width); } + #sidebar.active { margin-left: 0; } + #content { width: 100%; margin-left: 0; } + #content.active { margin-left: var(--sidebar-width); } +} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index fdf2cfd..bb71034 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,73 +1,41 @@ -document.addEventListener('DOMContentLoaded', () => { - - // Smooth scrolling for navigation links - document.querySelectorAll('a[href^="#"]').forEach(anchor => { - anchor.addEventListener('click', function (e) { - e.preventDefault(); - const targetId = this.getAttribute('href'); - if (targetId === '#') return; - - const targetElement = document.querySelector(targetId); - if (targetElement) { - // Close mobile menu if open - const navbarToggler = document.querySelector('.navbar-toggler'); - const navbarCollapse = document.querySelector('.navbar-collapse'); - if (navbarCollapse.classList.contains('show')) { - navbarToggler.click(); - } +document.addEventListener('DOMContentLoaded', function () { + const sidebar = document.getElementById('sidebar'); + const content = document.getElementById('content'); + const sidebarCollapse = document.getElementById('sidebarCollapse'); + const backToTop = document.getElementById('back-to-top'); - // Scroll with offset - const offset = 80; - const elementPosition = targetElement.getBoundingClientRect().top; - const offsetPosition = elementPosition + window.pageYOffset - offset; - - window.scrollTo({ - top: offsetPosition, - behavior: "smooth" - }); - } + // Sidebar Toggle for Mobile + if (sidebarCollapse) { + sidebarCollapse.addEventListener('click', function () { + sidebar.classList.toggle('active'); + content.classList.toggle('active'); }); - }); + } - // Navbar scroll effect - const navbar = document.querySelector('.navbar'); - window.addEventListener('scroll', () => { - if (window.scrollY > 50) { - navbar.classList.add('scrolled', 'shadow-sm', 'bg-white'); - navbar.classList.remove('bg-transparent'); + // Back to Top functionality + window.addEventListener('scroll', function () { + if (window.scrollY > 300) { + backToTop.style.display = 'block'; } else { - navbar.classList.remove('scrolled', 'shadow-sm', 'bg-white'); - navbar.classList.add('bg-transparent'); + backToTop.style.display = 'none'; } }); - // Intersection Observer for fade-up animations - const observerOptions = { - threshold: 0.1, - rootMargin: "0px 0px -50px 0px" - }; - - const observer = new IntersectionObserver((entries) => { - entries.forEach(entry => { - if (entry.isIntersecting) { - entry.target.classList.add('animate-up'); - entry.target.style.opacity = "1"; - observer.unobserve(entry.target); // Only animate once - } + backToTop.addEventListener('click', function () { + window.scrollTo({ + top: 0, + behavior: 'smooth' }); - }, observerOptions); - - // Select elements to animate (add a class 'reveal' to them in HTML if not already handled by CSS animation) - // For now, let's just make sure the hero animations run. - // If we want scroll animations, we'd add opacity: 0 to elements in CSS and reveal them here. - // Given the request, the CSS animation I added runs on load for Hero. - // Let's make the project cards animate in. - - const projectCards = document.querySelectorAll('.project-card'); - projectCards.forEach((card, index) => { - card.style.opacity = "0"; - card.style.animationDelay = `${index * 0.1}s`; - observer.observe(card); }); -}); \ No newline at end of file + // Close sidebar when clicking outside on mobile + document.addEventListener('click', function (event) { + const isClickInsideSidebar = sidebar.contains(event.target); + const isClickInsideCollapse = sidebarCollapse ? sidebarCollapse.contains(event.target) : false; + + if (!isClickInsideSidebar && !isClickInsideCollapse && window.innerWidth <= 768) { + sidebar.classList.remove('active'); + content.classList.remove('active'); + } + }); +}); diff --git a/assets/pasted-20260207-134833-7329dc42.jpg b/assets/pasted-20260207-134833-7329dc42.jpg new file mode 100644 index 0000000..f870959 Binary files /dev/null and b/assets/pasted-20260207-134833-7329dc42.jpg differ diff --git a/db/init.php b/db/init.php new file mode 100644 index 0000000..5665364 --- /dev/null +++ b/db/init.php @@ -0,0 +1,68 @@ +exec("CREATE TABLE IF NOT EXISTS users ( + id INT AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(50) NOT NULL UNIQUE, + password VARCHAR(255) NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + )"); + + // Create settings table + $pdo->exec("CREATE TABLE IF NOT EXISTS settings ( + id INT AUTO_INCREMENT PRIMARY KEY, + setting_key VARCHAR(50) NOT NULL UNIQUE, + setting_value TEXT, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + )"); + + // Create steps table + $pdo->exec("CREATE TABLE IF NOT EXISTS steps ( + id INT AUTO_INCREMENT PRIMARY KEY, + day_number INT NOT NULL UNIQUE, + title VARCHAR(255), + what_to_chat TEXT, + how_to_chat TEXT, + why_to_chat TEXT, + correct_example TEXT, + wrong_example TEXT, + correct_explanation TEXT, + wrong_explanation TEXT, + image_url VARCHAR(255), + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + )"); + + // Seed default admin if not exists + $stmt = $pdo->prepare("SELECT COUNT(*) FROM users WHERE username = 'admin'"); + $stmt->execute(); + if ($stmt->fetchColumn() == 0) { + $password = password_hash('admin123', PASSWORD_DEFAULT); + $pdo->prepare("INSERT INTO users (username, password) VALUES ('admin', ?)")->execute([$password]); + } + + // Seed default settings + $defaultSettings = [ + 'site_title' => '财神组聊天框架', + 'site_logo' => 'assets/pasted-20260207-134833-7329dc42.jpg', + 'tg_link' => 'https://t.me/zhangshihao818', + 'footer_copy' => '© 2026 财神组聊天框架构造. 内部资料,翻版必究。', + 'watermark_text' => '财神组专用字体' + ]; + + foreach ($defaultSettings as $key => $val) { + $pdo->prepare("INSERT IGNORE INTO settings (setting_key, setting_value) VALUES (?, ?)")->execute([$key, $val]); + } + + // Seed default steps 1-7 + for ($i = 1; $i <= 7; $i++) { + $pdo->prepare("INSERT IGNORE INTO steps (day_number, title) VALUES (?, ?)")->execute([$i, "第{$i}天:初步沟通"]); + } + +} catch (PDOException $e) { + error_log("DB Init Error: " . $e->getMessage()); +} \ No newline at end of file diff --git a/index.php b/index.php index 7205f3d..e976b3c 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,194 @@ query("SELECT setting_key, setting_value FROM settings"); +while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { + $settings[$row['setting_key']] = $row['setting_value']; +} + +$site_title = $settings['site_title'] ?? '财神组聊天框架'; +$tg_link = $settings['tg_link'] ?? 'https://t.me/zhangshihao818'; +$footer_copy = $settings['footer_copy'] ?? '© 2026 财神组聊天框架构造. 内部资料,翻版必究。'; +$watermark_text = $settings['watermark_text'] ?? '财神组专用字体'; +$site_logo = $settings['site_logo'] ?? 'assets/pasted-20260207-134833-7329dc42.jpg'; + +// Get current day from URL +$current_day = isset($_GET['day']) ? (int)$_GET['day'] : 1; +if ($current_day < 1 || $current_day > 7) $current_day = 1; + +// Fetch step data +$stmt = $pdo->prepare("SELECT * FROM steps WHERE day_number = ?"); +$stmt->execute([$current_day]); +$step = $stmt->fetch(PDO::FETCH_ASSOC); + +if (!$step) { + $step = [ + 'day_number' => $current_day, + 'title' => "第{$current_day}天:步骤加载中", + 'what_to_chat' => '暂无内容', + 'how_to_chat' => '暂无内容', + 'why_to_chat' => '暂无内容', + 'correct_example' => '暂无内容', + 'wrong_example' => '暂无内容', + 'correct_explanation' => '暂无内容', + 'wrong_explanation' => '暂无内容', + 'image_url' => '' + ]; +} ?> - - + + - - - New Style - - - - - - - - - - - - - - - - - - - + + + <?php echo htmlspecialchars($site_title); ?> + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + +
+
+ + + +
-
- + + +
+ + + + 联系客服 +
+ + + + +
+ + + + +
+
+
+

Day

+ +
+ +
+
+
+
聊什么 (Content)
+
+

+
+
+ +
+
为什么要这样聊 (Reasoning)
+
+

+
+
+ +
+
+
+
正确做法
+
+
+ 示例:
+ +
+ 解释:
+ +
+
+
+
+
+
错误做法
+
+
+ 示例:
+ +
+ 解释:
+ +
+
+
+
+
+ +
+
+
怎么去聊 (Technique)
+
+

+
+
+ +
+
聊天示例图
+
+ + Example + +
+
+ 示例图片后续上传 +
+ +
+
+
+
+ + +
+
+
+ + + diff --git a/login.php b/login.php new file mode 100644 index 0000000..485784b --- /dev/null +++ b/login.php @@ -0,0 +1,73 @@ +query("SELECT setting_value FROM settings WHERE setting_key = 'site_logo'"); +$site_logo = $stmt->fetchColumn() ?: 'assets/pasted-20260207-134833-7329dc42.jpg'; + +$error = ''; + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $username = $_POST['username'] ?? ''; + $password = $_POST['password'] ?? ''; + + if ($username === 'admin') { + $stmt = $pdo->prepare("SELECT password FROM users WHERE username = 'admin'"); + $stmt->execute(); + $user = $stmt->fetch(); + + if ($user && password_verify($password, $user['password'])) { + $_SESSION['admin_logged_in'] = true; + header('Location: admin.php'); + exit; + } else { + $error = '用户名或密码错误'; + } + } else { + $error = '权限不足'; + } +} +?> + + + + + + 登录 - 财神组聊天框架 + + + + + +
+ + Logo + +

管理登录

+ +
+ +
+
+ + +
+
+ + +
+ +
+
+ 返回首页 +
+
+ + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..37bc5ab --- /dev/null +++ b/logout.php @@ -0,0 +1,5 @@ +