找回密码
 注册
搜索
免费空间 免费域名 免费AI 老牌主机商首月仅1美分!27美元/年!Namecheap优惠码Spaceship优惠码
查看: 1601|回复: 36

[建站交流] 站长搞个免费吧网址展示平台吧

[复制链接]
发表于 2025-12-16 14:44:52 | 显示全部楼层 |阅读模式
鉴于大家的个人网站都没人看, 不如搞个网站导航,把大家的个人网站都收录起来。 我们互相挖掘、点击,也算是一个小生态链了。
发表于 2025-12-16 16:51:21 | 显示全部楼层
你搞起来吧
发表于 2025-12-16 17:00:03 | 显示全部楼层
站长自助提交导航:
http://64185.chez.com
发表于 2025-12-16 22:12:46 | 显示全部楼层
来吧 我送你个IP
发表于 2025-12-16 22:18:29 来自手机 | 显示全部楼层
好主意
发表于 2025-12-17 07:54:21 | 显示全部楼层
想法不错
发表于 2025-12-17 09:46:33 | 显示全部楼层
这个想法挺好啊。支持。
发表于 2025-12-24 22:47:51 | 显示全部楼层
本帖最后由 yaner 于 2025-12-25 20:34 编辑

http://sqrqknoaupr8d.s341.xrea.com/

可以测试提交网址试试

后台密码admin,可以批量添加。




源码已附上,欢迎大佬修正优化。源码由grok+豆包生成。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
发表于 2025-12-25 22:11:33 | 显示全部楼层
之前有个带网址收藏夹功能的导航,登录之后收藏夹内容可以同步保存
如果不提交站点的话,单用收藏夹功能也行

https://nav.oiik.cn
发表于 2025-12-25 23:42:51 | 显示全部楼层
http://64185.chez.com
欢迎测试,
今天小谷帮我写的导航提交系统。


源码分享给大家
前台有搜索框。
后台有功能如下:
排序功能,
编辑功能。
密码修改功能。
保存为index.php上传到自己的空间即可!
原始密码Tmd123

请往下拉,复制第二个代码
重要提示:必须在index.php的同目录下建立一个名为:sessions的文件夹,属性设置为777


  1. <?php
  2. /**
  3. * 炫彩导航 - 终极管理版 (全兼容修复版)
  4. * 功能:搜索、排序、编辑、审核、后台改密
  5. */
  6. header("Content-Type: text/html; charset=utf-8");
  7. session_start();

  8. $dataFile = "nav_db.json";
  9. $title = "炫彩收录导航";

  10. // --- 数据读取与初始化 ---
  11. if (!file_exists($dataFile)) {
  12.     $data = array(
  13.         "config" => array("password" => "Tmd123"),
  14.         "active" => array(array("name"=>"百度","url"=>"https://www.baidu.com")),
  15.         "pending" => array()
  16.     );
  17.     file_put_contents($dataFile, json_encode($data));
  18. } else {
  19.     $data = json_decode(file_get_contents($dataFile), true);
  20.     if (!isset($data['config'])) {
  21.         $data['config'] = array("password" => "Tmd123");
  22.     }
  23. }

  24. $admin_pass = $data['config']['password'];

  25. // --- 登录/退出逻辑 ---
  26. if (isset($_POST['login_pass'])) {
  27.     if (trim($_POST['login_pass']) === $admin_pass) {
  28.         $_SESSION['admin'] = "logined";
  29.         setcookie("admin_auth", md5($admin_pass), time()+3600*24);
  30.         header("Location: index.php"); exit;
  31.     } else { echo "<script>alert('密码错误!');</script>"; }
  32. }
  33. if (isset($_GET['logout'])) {
  34.     session_destroy(); setcookie("admin_auth", "", time()-3600);
  35.     header("Location: index.php"); exit;
  36. }
  37. $isAdmin = (isset($_SESSION['admin']) && $_SESSION['admin'] === "logined") || (isset($_COOKIE['admin_auth']) && $_COOKIE['admin_auth'] === md5($admin_pass));

  38. // --- 核心业务逻辑 ---
  39. if ($isAdmin && isset($_POST['change_pw'])) {
  40.     $new_pw = trim($_POST['new_password']);
  41.     if (!empty($new_pw)) {
  42.         $data['config']['password'] = $new_pw;
  43.         file_put_contents($dataFile, json_encode($data));
  44.         echo "<script>alert('密码修改成功!请重新登录');location.href='?logout=1';</script>";
  45.         exit;
  46.     }
  47. }

  48. if (isset($_POST['save_node'])) {
  49.     $name = htmlspecialchars(trim($_POST['app_name']));
  50.     $url = htmlspecialchars(trim($_POST['app_url']));
  51.     $edit_id = $_POST['edit_id'];
  52.     if ($edit_id !== "") {
  53.         if($isAdmin) $data['active'][(int)$edit_id] = array("name"=>$name, "url"=>$url, "time"=>date("Y-m-d"));
  54.     } else {
  55.         $data['pending'][] = array("name"=>$name, "url"=>$url, "time"=>date("Y-m-d"));
  56.         echo "<script>alert('申请已提交');</script>";
  57.     }
  58.     file_put_contents($dataFile, json_encode($data));
  59.     header("Location: index.php"); exit;
  60. }

  61. if ($isAdmin && isset($_GET['action']) && isset($_GET['id'])) {
  62.     $id = (int)$_GET['id'];
  63.     switch ($_GET['action']) {
  64.         case 'approve': $data['active'][] = $data['pending'][$id]; unset($data['pending'][$id]); break;
  65.         case 'reject': unset($data['pending'][$id]); break;
  66.         case 'del': unset($data['active'][$id]); break;
  67.         case 'up': if($id>0){ $tmp=$data['active'][$id]; $data['active'][$id]=$data['active'][$id-1]; $data['active'][$id-1]=$tmp; } break;
  68.         case 'down': if($id<count($data['active'])-1){ $tmp=$data['active'][$id]; $data['active'][$id]=$data['active'][$id+1]; $data['active'][$id+1]=$tmp; } break;
  69.     }
  70.     // 修复点:改用兼容低版本 PHP 的数组重排方式
  71.     if(isset($data['pending'])) { $data['pending'] = array_values($data['pending']); } else { $data['pending'] = array(); }
  72.     if(isset($data['active'])) { $data['active'] = array_values($data['active']); } else { $data['active'] = array(); }
  73.    
  74.     file_put_contents($dataFile, json_encode($data));
  75.     header("Location: index.php"); exit;
  76. }

  77. $edit_node = array("name"=>"", "url"=>"", "id"=>"");
  78. if($isAdmin && isset($_GET['edit'])){
  79.     $eid = (int)$_GET['edit'];
  80.     if(isset($data['active'][$eid])){ $edit_node = $data['active'][$eid]; $edit_node['id'] = $eid; }
  81. }
  82. ?>
  83. <!DOCTYPE html>
  84. <html lang="zh-CN">
  85. <head>
  86.     <meta charset="UTF-8">
  87.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  88.     <title><?php echo $title; ?></title>
  89.     <style>
  90.         @keyframes gradient { 0% {background-position: 0% 50%;} 50% {background-position: 100% 50%;} 100% {background-position: 0% 50%;} }
  91.         body { margin: 0; min-height: 100vh; background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab); background-size: 400% 400%; animation: gradient 15s ease infinite; font-family: sans-serif; color: #fff; }
  92.         .container { max-width: 900px; margin: 0 auto; padding: 20px; }
  93.         .glass { background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 15px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
  94.         .search-area { text-align: center; margin-bottom: 30px; }
  95.         #search-input { width: 60%; max-width: 400px; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4); padding: 12px 20px; border-radius: 30px; color: #fff; font-size: 16px; outline: none; transition: 0.3s; }
  96.         #search-input:focus { width: 80%; background: #fff; color: #333; }
  97.         .engine-btns { margin-top: 12px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
  98.         .engine-btns button { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 6px 15px; border-radius: 20px; cursor: pointer; font-size: 13px; }
  99.         .nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
  100.         .card-wrap { position: relative; }
  101.         .nav-card { background: rgba(255, 255, 255, 0.2); padding: 20px; border-radius: 12px; text-decoration: none; color: #fff; text-align: center; font-weight: bold; display: block; border: 1px solid rgba(255,255,255,0.1); transition: 0.3s; overflow: hidden; text-overflow: ellipsis; }
  102.         .nav-card:hover { background: #fff; color: #e73c7e; transform: translateY(-3px); }
  103.         .sort-tools { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); display: none; background: rgba(0,0,0,0.7); border-radius: 10px; padding: 2px 8px; gap: 8px; z-index: 5; }
  104.         .card-wrap:hover .sort-tools { display: flex; }
  105.         .sort-tools a { color: #fff; text-decoration: none; font-size: 11px; }
  106.         .del-tag { position: absolute; top: -8px; right: -5px; background: #ff4d4d; color: white; border-radius: 50%; width: 18px; height: 18px; text-decoration: none; font-size: 12px; line-height: 18px; text-align:center; }
  107.         .edit-tag { position: absolute; top: -8px; left: -5px; background: #23a6d5; color: white; border-radius: 50%; width: 18px; height: 18px; text-decoration: none; font-size: 11px; line-height: 18px; text-align:center; }
  108.         input { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); padding: 10px; border-radius: 8px; color: #fff; outline: none; margin: 5px 0;}
  109.         .btn-main { background: #fff; color: #e73c7e; border: none; padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; }
  110.         footer { text-align: center; padding: 40px; background: rgba(0,0,0,0.2); margin-top: 40px; }
  111.     </style>
  112. </head>
  113. <body>
  114. <div class="container">
  115.     <h1 style="text-align:center; text-shadow: 0 4px 10px rgba(0,0,0,0.2);">✨ <?php echo $title; ?></h1>

  116.     <div class="search-area">
  117.         <input type="text" id="search-input" placeholder="输入关键词搜索..." onkeyup="filterLinks()">
  118.         <div class="engine-btns">
  119.             <button onclick="webSearch('https://www.baidu.com/s?wd=')">百度</button>
  120.             <button onclick="webSearch('https://www.google.com/search?q=')">Google</button>
  121.             <button onclick="webSearch('https://yandex.com/search/?text=')">Yandex</button>
  122.         </div>
  123.     </div>

  124.     <?php if($isAdmin): ?>
  125.     <div class="glass" style="border-left: 5px solid #00ff00;">
  126.         <div style="display:flex; justify-content:space-between; align-items:flex-start;">
  127.             <div>
  128.                 <h3 style="margin:0">🛠️ 管理中心 | <a href="?logout=1" style="color:yellow; text-decoration:none;">退出登录</a></h3>
  129.                 <div style="margin-top:10px;">
  130.                     <form method="POST" style="display:flex; gap:5px;">
  131.                         <input type="text" name="new_password" placeholder="设置新管理密码" style="padding:5px; font-size:12px;">
  132.                         <button type="submit" name="change_pw" class="btn-main" style="padding:5px 10px; font-size:12px;">修改密码</button>
  133.                     </form>
  134.                 </div>
  135.             </div>
  136.             <div style="text-align:right;">
  137.                 <?php if(!empty($data['pending'])): ?>
  138.                 <p style="margin:0; font-size:14px;">待审核 (<?php echo count($data['pending']); ?>)</p>
  139.                 <?php foreach($data['pending'] as $id => $item): ?>
  140.                     <div style="font-size:12px; margin-top:5px;">
  141.                         <?php echo $item['name']; ?>
  142.                         <a href="?action=approve&id=<?php echo $id; ?>" style="color:#0f0;">[准]</a>
  143.                         <a href="?action=reject&id=<?php echo $id; ?>" style="color:#f44;">[拒]</a>
  144.                     </div>
  145.                 <?php endforeach; ?>
  146.                 <?php endif; ?>
  147.             </div>
  148.         </div>
  149.     </div>
  150.     <?php endif; ?>

  151.     <div class="nav-grid" id="link-container">
  152.         <?php if(!empty($data['active'])): ?>
  153.             <?php foreach($data['active'] as $id => $nav): ?>
  154.                 <div class="card-wrap" data-name="<?php echo strtolower(htmlspecialchars($nav['name'])); ?>">
  155.                     <a href="<?php echo $nav['url']; ?>" target="_blank" class="nav-card"><?php echo htmlspecialchars($nav['name']); ?></a>
  156.                     <?php if($isAdmin): ?>
  157.                         <a href="?edit=<?php echo $id; ?>#form" class="edit-tag">✎</a>
  158.                         <a href="?action=del&id=<?php echo $id; ?>" class="del-tag" onclick="return confirm('确定删除?')">×</a>
  159.                         <div class="sort-tools">
  160.                             <a href="?action=up&id=<?php echo $id; ?>">◀ 前移</a> <a href="?action=down&id=<?php echo $id; ?>">后移 ▶</a>
  161.                         </div>
  162.                     <?php endif; ?>
  163.                 </div>
  164.             <?php endforeach; ?>
  165.         <?php endif; ?>
  166.     </div>

  167.     <div id="form" class="glass" style="margin-top:40px; text-align:center;">
  168.         <h3><?php echo ($edit_node['id']!=="") ? "📝 修改内容" : "📩 申请收录"; ?></h3>
  169.         <form method="POST">
  170.             <input type="hidden" name="edit_id" value="<?php echo $edit_node['id']; ?>">
  171.             <input type="text" name="app_name" placeholder="网站名称" required style="width:120px;" value="<?php echo $edit_node['name']; ?>">
  172.             <input type="url" name="app_url" placeholder="网址 https://..." required style="width:250px;" value="<?php echo $edit_node['url']; ?>">
  173.             <button type="submit" name="save_node" class="btn-main"><?php echo ($edit_node['id']!=="") ? "保存修改" : "提交申请"; ?></button>
  174.             <?php if($edit_node['id']!==""): ?><br><a href="index.php" style="color:#fff; font-size:12px;">取消编辑</a><?php endif; ?>
  175.         </form>
  176.     </div>
  177. </div>

  178. <script>
  179. function filterLinks() {
  180.     let input = document.getElementById('search-input').value.toLowerCase();
  181.     let cards = document.getElementsByClassName('card-wrap');
  182.     for (let i = 0; i < cards.length; i++) {
  183.         let name = cards[i].getAttribute('data-name');
  184.         cards[i].style.display = name.includes(input) ? "block" : "none";
  185.     }
  186. }
  187. function webSearch(baseUrl) {
  188.     let query = document.getElementById('search-input').value;
  189.     if (query) { window.open(baseUrl + encodeURIComponent(query), '_blank'); }
  190.     else { alert('请输入搜索关键词'); }
  191. }
  192. </script>

  193. <footer>
  194.     <?php if(!$isAdmin): ?>
  195.         <form method="POST"><input type="password" name="login_pass" placeholder="管理密码" style="width:80px; font-size:12px;"><button type="submit" class="btn-main" style="padding:5px 10px; font-size:12px;">登录</button></form>
  196.     <?php endif; ?>
  197.     <p style="font-size:10px; opacity:0.5; margin-top:15px;">&copy; 2025 <?php echo $title; ?> | 全兼容版</p>
  198. </footer>
  199. </body>
  200. </html>
复制代码
















最新修改版:

  1. <?php
  2. /**
  3. * 炫彩导航 - 绚丽全能版 (兼容老版本PHP)
  4. * 炫彩导航 - 终极管理版 (全兼容修复版)
  5. * 功能:搜索、提交提示确认、排序、编辑、审核通过,审核不通过、后台改密
  6. * 初始密码:Tmd123
  7. */

  8. if(function_exists('date_default_timezone_set')){
  9.     date_default_timezone_set('PRC');
  10. }
  11. ob_start();
  12. header("Content-Type: text/html; charset=utf-8");
  13. @session_start();

  14. define('DATA_FILE', 'nav_db.json');
  15. define('SITE_TITLE', '炫彩收录导航');
  16. define('DEFAULT_PASS', 'Tmd123');

  17. // --- 兼容性工具函数 ---
  18. function safe_input($str) {
  19.     if(empty($str)) return '';
  20.     if(get_magic_quotes_gpc()) $str = stripslashes($str);
  21.     return htmlspecialchars(trim($str), ENT_QUOTES, 'UTF-8');
  22. }

  23. // 解决低版本 PHP preg_replace_callback 报错
  24. function json_encode_52($data) {
  25.     if(function_exists('json_encode')){
  26.         $json = json_encode($data);
  27.         return preg_replace("#\\\u([0-9a-f]{4})#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $json);
  28.     }
  29.     return '';
  30. }

  31. function safe_save($file, $data) {
  32.     $fp = fopen($file, 'w');
  33.     if(!$fp) return false;
  34.     flock($fp, LOCK_EX);
  35.     $result = fwrite($fp, json_encode_52($data));
  36.     flock($fp, LOCK_UN);
  37.     fclose($fp);
  38.     return $result !== false;
  39. }

  40. // --- 数据读取与初始化 ---
  41. if (!file_exists(DATA_FILE)) {
  42.     $data = array(
  43.         "config" => array("password" => md5(DEFAULT_PASS)),
  44.         "active" => array(array("name"=>"百度","url"=>"https://www.baidu.com", "time"=>date("Y-m-d"))),
  45.         "pending" => array()
  46.     );
  47.     safe_save(DATA_FILE, $data);
  48. } else {
  49.     $data = json_decode(@file_get_contents(DATA_FILE), true);
  50. }
  51. $admin_hash = isset($data['config']['password']) ? $data['config']['password'] : md5(DEFAULT_PASS);

  52. // --- 权限管理 ---
  53. $isAdmin = false;
  54. if ((isset($_SESSION['admin']) && $_SESSION['admin'] === "logined") || (isset($_COOKIE['admin_auth']) && $_COOKIE['admin_auth'] === $admin_hash)) {
  55.     $_SESSION['admin'] = "logined";
  56.     $isAdmin = true;
  57. }

  58. // 登录与退出逻辑
  59. if (isset($_POST['login_pass'])) {
  60.     if (md5(trim($_POST['login_pass'])) === $admin_hash) {
  61.         $_SESSION['admin'] = "logined";
  62.         setcookie("admin_auth", $admin_hash, time()+86400, '/');
  63.         header("Location: index.php"); exit;
  64.     } else { echo "<script>alert('管理口令错误!');</script>"; }
  65. }
  66. if (isset($_GET['logout'])) {
  67.     session_destroy(); setcookie("admin_auth", "", time()-3600, '/');
  68.     header("Location: index.php"); exit;
  69. }

  70. // --- 管理员操作:改密、审核、删除 ---
  71. if ($isAdmin && isset($_POST['update_pass'])) {
  72.     $new_pw = trim($_POST['new_password']);
  73.     if (strlen($new_pw) >= 5) {
  74.         $data['config']['password'] = md5($new_pw);
  75.         safe_save(DATA_FILE, $data);
  76.         echo "<script>alert('密码已更新,请重新登录!'); window.location.href='?logout=1';</script>"; exit;
  77.     }
  78. }

  79. if (isset($_POST['save_node'])) {
  80.     $name = safe_input($_POST['app_name']);
  81.     $url = safe_input($_POST['app_url']);
  82.     $edit_id = $_POST['edit_id'];
  83.     if ($isAdmin && $edit_id !== "") {
  84.         $idx = intval($edit_id);
  85.         if(isset($data['active'][$idx])) { $data['active'][$idx] = array("name"=>$name, "url"=>$url, "time"=>date("Y-m-d")); }
  86.         safe_save(DATA_FILE, $data);
  87.         header("Location: index.php"); exit;
  88.     } else {
  89.         $data['pending'][] = array("name"=>$name, "url"=>$url, "time"=>date("Y-m-d"));
  90.         safe_save(DATA_FILE, $data);
  91.         echo "<script>alert('提交成功,请等待管理员审核!'); window.location.href='index.php';</script>"; exit;
  92.     }
  93. }

  94. if ($isAdmin && isset($_GET['action']) && isset($_GET['id'])) {
  95.     $id = intval($_GET['id']);
  96.     if($_GET['action'] == 'approve' && isset($data['pending'][$id])){
  97.         $data['active'][] = $data['pending'][$id];
  98.         unset($data['pending'][$id]);
  99.     } elseif($_GET['action'] == 'reject' && isset($data['pending'][$id])){
  100.         unset($data['pending'][$id]);
  101.     } elseif($_GET['action'] == 'del' && isset($data['active'][$id])){
  102.         unset($data['active'][$id]);
  103.     }
  104.     $data['active'] = array_values((array)$data['active']);
  105.     $data['pending'] = array_values((array)$data['pending']);
  106.     safe_save(DATA_FILE, $data);
  107.     header("Location: index.php"); exit;
  108. }

  109. $edit_node = array("name"=>"", "url"=>"", "id"=>"");
  110. if($isAdmin && isset($_GET['edit'])){
  111.     $eid = intval($_GET['edit']);
  112.     if(isset($data['active'][$eid])){ $edit_node = $data['active'][$eid]; $edit_node['id'] = $eid; }
  113. }
  114. ?>
  115. <!DOCTYPE html>
  116. <html lang="zh-CN">
  117. <head>
  118.     <meta charset="UTF-8">
  119.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  120.     <title><?php echo SITE_TITLE; ?></title>
  121.     <style>
  122.         /* 绚丽多色流光动画 */
  123.         @keyframes grad { 0% {background-position: 0% 50%;} 50% {background-position: 100% 50%;} 100% {background-position: 0% 50%;} }
  124.         body { margin: 0; min-height: 100vh; background: linear-gradient(-45deg, #1a1a2e, #e94560, #1b998b, #f1a208, #0f3460); background-size: 500% 500%; animation: grad 18s ease infinite; font-family: sans-serif; color: #fff; }
  125.         .container { max-width: 900px; margin: 0 auto; padding: 20px; }
  126.         .glass { background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 18px; padding: 25px; margin-bottom: 25px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
  127.         
  128.         /* 搜索框设计 */
  129.         .search-area { text-align: center; margin-bottom: 40px; }
  130.         #search-input { width: 75%; max-width: 500px; background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.3); padding: 14px 25px; border-radius: 40px; color: #fff; outline: none; transition: 0.3s; font-size: 16px; }
  131.         #search-input:focus { background: #fff; color: #222; }
  132.         .engine-btns { margin-top: 15px; }
  133.         .engine-btns button { background: rgba(255,255,255,0.15); border: 1px solid #fff; color: #fff; padding: 6px 18px; border-radius: 20px; cursor: pointer; font-size: 12px; margin: 4px; transition: 0.3s; }
  134.         .engine-btns button:hover { background: #fff; color: #e94560; }

  135.         /* 卡片网格 */
  136.         .nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
  137.         .card-wrap { position: relative; }
  138.         .nav-card { background: rgba(255, 255, 255, 0.15); padding: 25px 15px; border-radius: 15px; text-decoration: none; color: #fff; text-align: center; font-weight: bold; display: block; border: 1px solid rgba(255,255,255,0.1); transition: 0.3s; }
  139.         .nav-card:hover { background: #fff; color: #1a1a2e; transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.4); }
  140.         
  141.         /* 管理员小图标 */
  142.         .admin-tag { position: absolute; background: #00d2ff; color: #fff; border-radius: 50%; width: 24px; height: 24px; line-height: 24px; font-size: 13px; text-align: center; text-decoration: none; z-index: 10; border: 1px solid #fff; }
  143.         .edit-tag { top: -10px; left: -8px; }
  144.         .del-tag { top: -10px; right: -8px; background: #ff4757; }

  145.         input { background: rgba(255,255,255,0.2); border: 1px solid #fff; padding: 10px; border-radius: 10px; color: #fff; margin: 5px; outline: none; }
  146.         .btn-main { background: #fff; color: #e94560; border: none; padding: 10px 25px; border-radius: 10px; font-weight: bold; cursor: pointer; transition: 0.3s; }
  147.         .btn-main:hover { background: #f1a208; color: #fff; transform: scale(1.05); }
  148.         
  149.         /* 管理登录区 */
  150.         .admin-footer { background: rgba(0,0,0,0.4); margin-top: 60px; padding: 40px 20px; border-radius: 25px 25px 0 0; border-top: 1px solid rgba(255,255,255,0.1); }
  151.     </style>
  152. </head>
  153. <body>
  154. <div class="container">
  155.     <h1 style="text-align:center; font-size: 30px; text-shadow: 2px 4px 10px rgba(0,0,0,0.3);">🌈 <?php echo SITE_TITLE; ?></h1>
  156.    
  157.     <div class="search-area">
  158.         <input type="text" id="search-input" placeholder="输入搜索词...">
  159.         <div class="engine-btns">
  160.             <button onclick="webSearch('https://www.baidu.com/s?wd=')">百度</button>
  161.             <button onclick="webSearch('https://www.google.com/search?q=')">谷歌</button>
  162.             <button onclick="webSearch('https://cn.bing.com/search?q=')">必应</button>
  163.             <button onclick="webSearch('https://yandex.com/search/?text=')">Yandex</button>
  164.         </div>
  165.     </div>

  166.     <?php if($isAdmin): ?>
  167.     <div class="glass" style="border-left: 5px solid #f1a208;">
  168.         <strong style="color:#f1a208;">🛡️ 管理员后台已登录</strong> | <a href="?logout=1" style="color:#fff; text-decoration:none;">[安全退出]</a>
  169.         <form method="POST" style="margin-top:10px;">
  170.             改密:<input type="password" name="new_password" placeholder="输入新密码" required style="width:130px;">
  171.             <button type="submit" name="update_pass" class="btn-main" style="padding:6px 15px; font-size:12px;">保存</button>
  172.         </form>
  173.         <?php if(!empty($data['pending'])): ?>
  174.             <div style="margin-top:15px; border-top:1px dashed rgba(255,255,255,0.3); padding-top:10px;">
  175.                 审核请求:
  176.                 <?php foreach($data['pending'] as $id => $item): ?>
  177.                     <div style="font-size:13px; margin:10px 0; background:rgba(0,0,0,0.2); padding:10px; border-radius:8px;">
  178.                         <strong><?php echo $item['name']; ?></strong> (<?php echo $item['url']; ?>)
  179.                         <a href="?action=approve&id=<?php echo $id; ?>" style="color:#00ffcc; margin-left:15px;">[准予收录]</a>
  180.                         <a href="?action=reject&id=<?php echo $id; ?>" style="color:#ff6b81; margin-left:10px;" onclick="return confirm('确定拒绝?')">[不通过]</a>
  181.                     </div>
  182.                 <?php endforeach; ?>
  183.             </div>
  184.         <?php endif; ?>
  185.     </div>
  186.     <?php endif; ?>

  187.     <div class="nav-grid">
  188.         <?php foreach($data['active'] as $id => $nav): ?>
  189.             <div class="card-wrap">
  190.                 <a href="<?php echo $nav['url']; ?>" target="_blank" class="nav-card"><?php echo $nav['name']; ?></a>
  191.                 <?php if($isAdmin): ?>
  192.                     <a href="?edit=<?php echo $id; ?>#form" class="admin-tag edit-tag" title="编辑">✎</a>
  193.                     <a href="?action=del&id=<?php echo $id; ?>" class="admin-tag del-tag" onclick="return confirm('确定删除?')" title="删除">×</a>
  194.                 <?php endif; ?>
  195.             </div>
  196.         <?php endforeach; ?>
  197.     </div>

  198.     <div id="form" class="glass" style="margin-top:50px; text-align:center;">
  199.         <h3 style="margin-top:0;"><?php echo ($edit_node['id']!=="") ? "📝 修改站点信息" : "📩 申请加入导航"; ?></h3>
  200.         <form method="POST">
  201.             <input type="hidden" name="edit_id" value="<?php echo $edit_node['id']; ?>">
  202.             <input type="text" name="app_name" placeholder="网站名称" required value="<?php echo $edit_node['name']; ?>">
  203.             <input type="url" name="app_url" placeholder="网址 http://..." required value="<?php echo $edit_node['url']; ?>">
  204.             <br><br><button type="submit" name="save_node" class="btn-main">立即提交申请</button>
  205.         </form>
  206.     </div>
  207. </div>

  208. <script>
  209. function webSearch(baseUrl) {
  210.     var query = document.getElementById('search-input').value;
  211.     if (query) { window.open(baseUrl + encodeURIComponent(query), '_blank'); }
  212.     else { alert('请输入关键词'); }
  213. }
  214. </script>

  215. <footer class="admin-footer" style="text-align:center;">
  216.     <?php if(!$isAdmin): ?>
  217.         <form method="POST">
  218.             <span style="font-size:14px; opacity:0.8;">🔒 管理入口:</span>
  219.             <input type="password" name="login_pass" placeholder="管理口令" style="width:140px;">
  220.             <button type="submit" class="btn-main" style="padding:8px 20px; font-size:13px;">登录系统</button>
  221.         </form>
  222.     <?php endif; ?>
  223.     <p style="opacity:0.5; font-size:12px; margin-top:20px;">&copy; 2025 <?php echo SITE_TITLE; ?> - 保持探索的乐趣</p>
  224. </footer>
  225. </body>
  226. </html>
  227. <?php ob_end_flush(); ?>
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|免费吧论坛

GMT+8, 2026-8-15 06:52 , Processed in 0.079933 second(s), 3 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表