更新好的

This commit is contained in:
Flatlogic Bot 2026-02-19 07:21:30 +00:00
parent 301a100f16
commit de14bba08e
23 changed files with 189 additions and 105 deletions

View File

@ -1,17 +1,6 @@
<?php
require_once __DIR__ . '/layout.php';
function getLocalSetting($key, $default = null) {
try {
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = ?");
$stmt->execute([$key]);
$val = $stmt->fetchColumn();
return $val !== false ? $val : $default;
} catch (Exception $e) {
return $default;
}
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$settings = [
'email_verification_enabled' => $_POST['email_verification_enabled'] ?? '0',
@ -56,18 +45,42 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$stmt->execute([$favicon_path, $favicon_path]);
}
}
// Handle certificate upload if provided
if (isset($_FILES['certificate_files']) && !empty($_FILES['certificate_files']['name'][0])) {
$paths = [];
foreach ($_FILES['certificate_files']['name'] as $i => $name) {
if ($_FILES['certificate_files']['error'][$i] === 0) {
$ext = pathinfo($name, PATHINFO_EXTENSION);
$filename = 'certificate_' . time() . '_' . $i . '.' . $ext;
$target = __DIR__ . '/../assets/images/' . $filename;
if (!is_dir(__DIR__ . '/../assets/images/')) {
mkdir(__DIR__ . '/../assets/images/', 0777, true);
}
if (move_uploaded_file($_FILES['certificate_files']['tmp_name'][$i], $target)) {
$paths[] = '/assets/images/' . $filename;
}
}
}
if (!empty($paths)) {
$certificate_path = json_encode($paths);
$stmt = db()->prepare("INSERT INTO system_settings (setting_key, setting_value) VALUES ('site_certificate', ?) ON DUPLICATE KEY UPDATE setting_value = ?");
$stmt->execute([$certificate_path, $certificate_path]);
}
}
$success = true;
}
$email_verify = getLocalSetting('email_verification_enabled', '0');
$site_logo = getLocalSetting('site_logo', '');
$site_favicon = getLocalSetting('site_favicon', '');
$trc20_addr = getLocalSetting('usdt_trc20_address', '');
$erc20_addr = getLocalSetting('usdt_erc20_address', '');
$bep20_addr = getLocalSetting('usdt_bep20_address', '');
$service_link = getLocalSetting('service_link', '');
$site_name = getLocalSetting('site_name', 'Byro');
$email_verify = getSetting('email_verification_enabled', '0');
$site_logo = getSetting('site_logo', '');
$site_favicon = getSetting('site_favicon', '');
$site_certificate = getSetting('site_certificate', '');
$trc20_addr = getSetting('usdt_trc20_address', '');
$erc20_addr = getSetting('usdt_erc20_address', '');
$bep20_addr = getSetting('usdt_bep20_address', '');
$service_link = getSetting('service_link', '');
$site_name = getSetting('site_name', 'Byro');
$title = '后台设置';
ob_start();
@ -101,7 +114,7 @@ ob_start();
<div class="d-flex align-items-center gap-3 mb-2">
<?php if ($site_logo): ?>
<div class="bg-dark p-2 rounded">
<img src="<?= $site_logo ?>" height="40" class="d-block">
<img src="<?= $site_logo ?>?v=<?= time() ?>" height="40" class="d-block">
</div>
<?php endif; ?>
<input type="file" name="logo_file" class="form-control">
@ -122,6 +135,27 @@ ob_start();
<div class="form-text">上传后将同步更新浏览器标签页图标。建议使用 32x32 64x64 的正方形图片。</div>
</div>
<div class="mb-4">
<label class="form-label fw-bold">平台注册证书</label>
<div class="mb-2">
<?php
if ($site_certificate):
$certs = json_decode($site_certificate, true);
if (!is_array($certs)) $certs = [$site_certificate];
?>
<div class="d-flex flex-wrap gap-2 mb-2">
<?php foreach ($certs as $cert): ?>
<div class="bg-light p-1 rounded border position-relative">
<img src="<?= $cert ?>" height="60" class="d-block shadow-sm">
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<input type="file" name="certificate_files[]" class="form-control" multiple>
</div>
<div class="form-text">支持多选。上传后,用户可在个人中心点击“注册证书”查看所有证书。</div>
</div>
<hr class="my-4">
<h6 class="fw-bold mb-3 text-primary"><i class="bi bi-wallet2 me-2"></i>充值地址配置</h6>

View File

@ -33,24 +33,9 @@ function renderAdminPage($content, $title = '后台管理') {
global $admin, $lang;
$current_page = basename($_SERVER['PHP_SELF']);
$site_logo = '/assets/images/logo.png';
$site_favicon = '';
$site_name = 'Byro';
try {
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = 'site_logo'");
$stmt->execute();
$val = $stmt->fetchColumn();
if ($val) $site_logo = $val;
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = 'site_favicon'");
$stmt->execute();
$val = $stmt->fetchColumn();
$site_favicon = $val ?: $site_logo;
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = 'site_name'");
$stmt->execute();
$site_name = $stmt->fetchColumn() ?: 'Byro';
} catch (Exception $e) {}
$site_logo = getSetting('site_logo', '/assets/images/logo.png');
$site_favicon = getSetting('site_favicon', $site_logo);
$site_name = getSetting('site_name', 'Byro');
?>
<!DOCTYPE html>
<html lang="<?= $lang ?>">
@ -153,7 +138,7 @@ function renderAdminPage($content, $title = '后台管理') {
<div class="admin-sidebar">
<div class="sidebar-logo">
<?php if ($site_logo): ?>
<img src="<?= $site_logo ?>" height="30" class="me-2">
<img src="<?= $site_logo ?>?v=<?= time() ?>" height="30" class="me-2">
<?php else: ?>
<i class="bi bi-shield-lock-fill me-2"></i>
<?php endif; ?>

View File

@ -10,25 +10,10 @@ if (isset($_SESSION['admin_id'])) {
exit;
}
$site_logo = '/assets/images/logo.png';
$site_favicon = '';
$site_name = 'Byro Admin';
try {
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = 'site_logo'");
$stmt->execute();
$val = $stmt->fetchColumn();
if ($val) $site_logo = $val;
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = 'site_favicon'");
$stmt->execute();
$val = $stmt->fetchColumn();
$site_favicon = $val ?: $site_logo;
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = 'site_name'");
$stmt->execute();
$name = $stmt->fetchColumn();
if ($name) $site_name = $name . ' Admin';
} catch (Exception $e) {}
// Get site settings
$site_logo = getSetting('site_logo', '/assets/images/logo.png');
$site_favicon = getSetting('site_favicon', $site_logo);
$site_name = getSetting('site_name', 'Byro') . ' Admin';
$error = '';
@ -99,10 +84,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</style>
</head>
<body>
<div class="login-card">
<div class="logo">
<?php if ($site_logo): ?>
<img src="<?= $site_logo ?>" height="40" class="mb-2 d-block mx-auto">
<img src="<?= $site_logo ?>?v=<?= time() ?>" height="40" class="mb-2 d-block mx-auto">
<?php else: ?>
<i class="bi bi-shield-lock-fill me-2"></i>
<?php endif; ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -41,8 +41,9 @@ include __DIR__ . '/../includes/header.php';
<div class="col-md-5">
<div class="card bg-dark border-0 shadow-lg p-4 p-md-5" style="border-radius: 30px; background: #161a1e !important; border: 1px solid var(--border) !important;">
<div class="text-center mb-5">
<div class="logo-container d-inline-flex mb-4">
<img src="<?= $site_logo ?>" height="50" alt="<?= $site_name ?>">
<div class="logo-container d-inline-flex mb-4 align-items-center">
<img src="<?= $site_logo ?>?v=<?= $logo_v ?? time() ?>" height="40" alt="<?= $site_name ?>">
<span class="logo-text ms-3" style="font-size: 24px; font-weight: 900; color: #fff; letter-spacing: 1px; text-transform: uppercase;"><?= $site_name ?></span>
</div>
<h2 class="fw-bold text-white mb-2"><?= __('login') ?></h2>
<p class="text-muted"><?= __('welcome_back') ?></p>

View File

@ -3,15 +3,7 @@ require_once __DIR__ . '/../includes/lang.php';
require_once __DIR__ . '/../db/config.php';
$error = '';
if (!function_exists('getSetting')) {
function getSetting($key, $default = null) {
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = ?");
$stmt->execute([$key]);
$row = $stmt->fetch();
return ($row && !empty($row['setting_value'])) ? $row['setting_value'] : $default;
}
}
// getSetting is defined in db/config.php
$email_verify_enabled = getSetting('email_verification_enabled', '0') === '1';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
@ -169,8 +161,9 @@ include __DIR__ . '/../includes/header.php';
<div class="col-md-5">
<div class="card register-card p-4 p-md-5">
<div class="text-center mb-5">
<div class="logo-container d-inline-flex mb-4">
<img src="<?= $site_logo ?>" height="50" alt="<?= $site_name ?>">
<div class="logo-container d-inline-flex mb-4 align-items-center">
<img src="<?= $site_logo ?>?v=<?= $logo_v ?? time() ?>" height="40" alt="<?= $site_name ?>">
<span class="logo-text ms-3" style="font-size: 24px; font-weight: 900; color: #fff; letter-spacing: 1px; text-transform: uppercase;"><?= $site_name ?></span>
</div>
<h2 class="fw-bold text-white mb-2" style="font-size: 28px;"><?= __('register') ?></h2>
<p class="text-muted" style="font-size: 15px;"><?= __('join_secure') ?></p>

64
certificate.php Normal file
View File

@ -0,0 +1,64 @@
<?php
include __DIR__ . '/includes/header.php';
if (!$user) {
header('Location: /auth/login.php');
exit;
}
$site_certificate = getSetting('site_certificate', '');
?>
<div class="container py-4">
<div class="d-flex align-items-center gap-3 mb-4">
<a href="/profile.php" class="btn btn-outline-light btn-sm rounded-circle" style="width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center;">
<i class="bi bi-arrow-left"></i>
</a>
<h4 class="text-white fw-bold mb-0"><?= __('reg_certificate') ?></h4>
</div>
<div class="card bg-surface border-secondary rounded-4 overflow-hidden shadow-lg animate__animated animate__fadeIn">
<div class="card-body p-4 text-center">
<?php
if ($site_certificate):
$certs = json_decode($site_certificate, true);
if (!is_array($certs)) $certs = [$site_certificate];
?>
<div class="mb-3 text-white-50 small">
<i class="bi bi-shield-check me-2 text-primary"></i><?= __('platform_certificate') ?>
</div>
<div class="row g-4 justify-content-center">
<?php foreach ($certs as $cert): ?>
<div class="col-12 col-md-6 col-lg-4">
<div class="certificate-wrapper p-2 bg-white rounded-3 shadow-sm d-inline-block mw-100">
<img src="<?= htmlspecialchars($cert) ?>" alt="Certificate" class="img-fluid rounded-2" style="max-height: 60vh;">
</div>
<div class="mt-3">
<button class="btn btn-primary btn-sm rounded-pill px-3" onclick="window.open('<?= htmlspecialchars($cert) ?>', '_blank')">
<i class="bi bi-zoom-in me-2"></i>查看高清原图
</button>
</div>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<div class="py-5">
<i class="bi bi-image text-white-50 display-1 mb-3"></i>
<p class="text-white-50"><?= __('no_certificate_yet') ?></p>
</div>
<?php endif; ?>
</div>
</div>
</div>
<style>
.certificate-wrapper {
transition: transform 0.3s ease;
}
.certificate-wrapper:hover {
transform: scale(1.02);
}
</style>
<?php include __DIR__ . '/includes/footer.php'; ?>

View File

@ -2,17 +2,8 @@
require_once __DIR__ . '/includes/lang.php';
require_once __DIR__ . '/db/config.php';
$site_name = 'Byro';
$site_logo = '';
try {
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = 'site_name'");
$stmt->execute();
$site_name = $stmt->fetchColumn() ?: 'Byro';
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = 'site_logo'");
$stmt->execute();
$site_logo = $stmt->fetchColumn() ?: '';
} catch (Exception $e) {}
$site_name = getSetting('site_name', 'Byro');
$site_logo = getSetting('site_logo', '');
$title = __('cookie_policy_title');
require_once __DIR__ . '/includes/header.php';

View File

@ -40,3 +40,16 @@ function getAutoVipLevel($totalRecharge) {
if ($totalRecharge >= 10000) return 1;
return 0;
}
if (!function_exists('getSetting')) {
function getSetting($key, $default = null) {
try {
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = ?");
$stmt->execute([$key]);
$val = $stmt->fetchColumn();
return ($val !== false && $val !== '') ? $val : $default;
} catch (Exception $e) {
return $default;
}
}
}

View File

@ -3,7 +3,7 @@
<div class="row g-4 mb-5">
<div class="col-lg-4 col-md-12">
<div class="logo-container mb-3">
<img src="<?= $site_logo ?>" height="40" alt="<?= $site_name ?>">
<img src="<?= $site_logo ?>?v=<?= $logo_v ?? time() ?>" height="40" alt="<?= $site_name ?>">
</div>
<p class="text-muted small mb-4">
<?= __('footer_desc') ?>

View File

@ -9,14 +9,7 @@ if (isset($_SESSION['user_id'])) {
$user = $stmt->fetch();
}
if (!function_exists('getSetting')) {
function getSetting($key, $default = null) {
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = ?");
$stmt->execute([$key]);
$row = $stmt->fetch();
return ($row && !empty($row['setting_value'])) ? $row['setting_value'] : $default;
}
}
// site settings are fetched via getSetting() in db/config.php
?>
<!DOCTYPE html>
<html lang="<?= $lang ?>">
@ -27,12 +20,13 @@ if (!function_exists('getSetting')) {
$site_logo = getSetting('site_logo', '/assets/images/logo.png');
$site_favicon = getSetting('site_favicon', $site_logo);
$site_name = getSetting('site_name', 'BYRO');
$logo_v = time(); // Use timestamp for cache busting
?>
<title><?= $site_name ?> | <?= __('site_title') ?></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<link rel="stylesheet" href="/assets/css/style.css?v=<?= time() ?>">
<link rel="icon" href="<?= $site_favicon ?>">
<link rel="stylesheet" href="/assets/css/style.css?v=<?= $logo_v ?>">
<link rel="icon" href="<?= $site_favicon ?>?v=<?= $logo_v ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
@ -74,9 +68,15 @@ if (!function_exists('getSetting')) {
margin-right: 40px;
}
.logo-container img {
height: 44px;
height: 32px;
width: auto;
object-fit: contain;
filter: drop-shadow(0 0 8px rgba(0, 194, 255, 0.5));
transition: all 0.3s ease;
}
.logo-container:hover img {
filter: drop-shadow(0 0 12px rgba(0, 194, 255, 0.8));
transform: scale(1.05);
}
.logo-icon {
width: 32px;
@ -89,11 +89,22 @@ if (!function_exists('getSetting')) {
margin-right: 10px;
}
.logo-text {
display: none;
font-size: 24px;
font-weight: 800;
display: inline-block;
font-size: 15px;
font-weight: 900;
color: #fff;
letter-spacing: -0.5px;
letter-spacing: 1px;
margin-left: 10px;
text-transform: uppercase;
vertical-align: middle;
text-shadow: 0 0 10px rgba(0, 194, 255, 0.3);
}
.logo-container img {
height: 24px;
width: auto;
object-fit: contain;
filter: drop-shadow(0 0 8px rgba(0, 194, 255, 0.5));
transition: all 0.3s ease;
}
nav {
display: flex;
@ -335,7 +346,8 @@ if (!function_exists('getSetting')) {
<body>
<header>
<a href="/" class="logo-container">
<img src="<?= $site_logo ?>" alt="<?= $site_name ?>">
<img src="<?= $site_logo ?>?v=<?= $logo_v ?>" alt="<?= $site_name ?>">
<span class="logo-text"><?= $site_name ?></span>
</a>
<nav>
<a href="/"><?= __('home') ?></a>

View File

@ -364,6 +364,9 @@ $translations = [
'balance' => '余额',
'kyc' => '实名认证',
'security' => '安全中心',
'reg_certificate' => '注册证书',
'platform_certificate' => '平台注册证书',
'no_certificate_yet' => '暂无证书',
'trade' => '交易',
'failed' => '失败',
'success' => '成功',
@ -869,6 +872,9 @@ $translations = [
'balance' => 'Balance',
'kyc' => 'KYC',
'security' => 'Security Center',
'reg_certificate' => 'Registration Certificate',
'platform_certificate' => 'Platform Registration Certificate',
'no_certificate_yet' => 'No certificate available yet',
'trade' => 'Trade',
'failed' => 'Failed',
'success' => 'Success',

View File

@ -151,6 +151,11 @@ $kycStatusColor = [
<span class="text-white-50 small"><i class="bi bi-lock me-2 text-danger"></i><?= __('security') ?></span>
<span class="text-white-50 small"><i class="bi bi-chevron-right"></i></span>
</a>
<a href="/certificate.php" class="list-group-item list-group-item-action py-3 d-flex justify-content-between align-items-center">
<span class="text-white-50 small"><i class="bi bi-patch-check me-2 text-primary"></i><?= __('reg_certificate') ?></span>
<span class="text-white-50 small"><i class="bi bi-chevron-right"></i></span>
</a>
<a href="/auth/logout.php" class="list-group-item list-group-item-action py-3 d-flex justify-content-between align-items-center text-danger border-0">
<span class="small"><i class="bi bi-box-arrow-right me-2"></i><?= __('logout') ?></span>
@ -334,8 +339,4 @@ $kycStatusColor = [
.col-lg-3 { margin-bottom: 1rem; }
}
</style>
</div>
</div>
</div>
<?php include __DIR__ . '/includes/footer.php'; ?>