From 37b83cff3e1bce7bdca54fa124957b342a335030 Mon Sep 17 00:00:00 2001 From: LyLme Date: Mon, 6 May 2024 00:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=89=E8=A3=85=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/data/install_struct.sql | 19 +++++++---------- install/data/update.sql | 5 +---- install/index.php | 27 +++++++++++++++--------- install/templates/js/forms.js | 8 ++++---- install/templates/step_1.php | 4 ++-- install/templates/step_2.php | 11 ++++++++-- install/templates/step_4.php | 32 +++++++++++++++++++---------- install/templates/style/install.css | 15 ++++++++++++++ 8 files changed, 76 insertions(+), 45 deletions(-) diff --git a/install/data/install_struct.sql b/install/data/install_struct.sql index 636a1f6..e9c493e 100644 --- a/install/data/install_struct.sql +++ b/install/data/install_struct.sql @@ -36,7 +36,7 @@ INSERT INTO `lylme_config` VALUES (5, 'background', './assets/img/background.jpg', '背景图片'), (6, 'title', '上网导航 - LyLme Spage', '网站标题'), (7, 'cdnpublic', NULL, 'CDN地址'), -(8, 'copyright', 'Copyright ©2022 LyLme Spage. All Rights Reserved.', '版权代码'), +(8, 'copyright', 'Copyright ©2022-2024 LyLme Spage. All Rights Reserved.', '版权代码'), (9, 'description', '六零导航页(LyLme Spage)致力于简洁高效无广告的上网导航和搜索入口,沉淀最具价值链接,全站无商业推广,简约而不简单。', '网站描述'), (10, 'home-title', '

上网,从这里开始!

', '首页标题'), (11, 'icp', '', '备案号'), @@ -46,7 +46,7 @@ INSERT INTO `lylme_config` VALUES (15, 'template', 'default', '网站模板'), (16, 'wztj', '', '网站统计代码(自定义footer)'), (17, 'tq', 'true', '天气显示开关'), -(18, 'version', 'v1.8.5', '程序版本'), +(18, 'version', 'v1.9.5', '程序版本'), (19, 'wap_background', NULL, '手机端背景'), (20, 'wxplus', '', '微信推送密钥'), (21, 'wxplustime', '20:00', '微信推送时间'), @@ -106,7 +106,7 @@ INSERT INTO `lylme_links` VALUES (17, '斗鱼直播', 1, 'https://www.douyu.com/', '', NULL, 10, 1, 0), (18, '企鹅电竞', 1, 'https://egame.qq.com/', '', NULL, 10, 1, 0), (19, '微信文件传输助手', 1, 'https://filehelper.weixin.qq.com/', '', NULL, 10, 1, 0), -(20, '120秒视界', 1, 'https://60s.lylme.com/', '', NULL, 10, 1, 0), +(20, '今日热点', 1, 'https://60s.lylme.com/', '', NULL, 10, 1, 0), (21, 'Office模板', 2, 'https://www.officeplus.cn/', '', NULL, 10, 1, 0), (22, '搞定设计', 2, 'https://www.gaoding.com/', '', NULL, 10, 1, 0), (23, '素材天下', 2, 'http://www.sucaitianxia.net/', '', NULL, 10, 1, 0), @@ -164,9 +164,7 @@ INSERT INTO `lylme_links` VALUES (75, 'STEAM', 6, 'https://store.steampowered.com/', '', NULL, 10, 1, 0), (76, '王者荣耀', 6, 'https://pvp.qq.com/', '', NULL, 10, 1, 0), (77, '3DM GAME', 6, 'https://www.3dmgame.com/', '', NULL, 10, 1, 0), -(78, '官方主页', 7, 'https://www.lylme.com/', '', NULL, 10, 1, 0), -(79, '申请收录', 7, '/apply', '', NULL, 10, 1, 0), -(80, '建议&反馈', 7, 'https://support.qq.com/products/356339', '', NULL, 10, 1, 0); +(78, '申请收录', 7, '/apply', '', NULL, 10, 1, 0); DROP TABLE IF EXISTS `lylme_pwd`; CREATE TABLE `lylme_pwd` ( @@ -210,12 +208,9 @@ CREATE TABLE `lylme_tags` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `lylme_tags` VALUES -(1, '主页', 'https://www.lylme.com/', 0, 10), -(2, '博客', 'https://blog.lylme.com/', 1, 10), -(3, 'Github', 'https://github.com/lylme', 1, 10), -(4, '关于本站', '/about', 1, 10), -(5, '申请收录', '/apply', 1, 10), -(6, '查看', '/pwd', 0, 10); +(1, '关于本站', '/about', 1, 10), +(2, '申请收录', '/apply', 1, 10), +(3, '访问管理', '/pwd', 0, 10); ALTER TABLE `lylme_apply` diff --git a/install/data/update.sql b/install/data/update.sql index c7b5d83..bf37035 100644 --- a/install/data/update.sql +++ b/install/data/update.sql @@ -35,10 +35,7 @@ CREATE TABLE `lylme_tags` ( `tag_target` int(1) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `lylme_tags` (`tag_id`, `tag_name`, `tag_link`, `tag_target`) VALUES -(1, '主页', 'https://www.lylme.com/', 0), -(2, '博客', 'https://blog.lylme.com/', 1), -(3, 'Github', 'https://github.com/lylme', 1), -(4, '关于本站', '/about', 1); +(1, '关于本站', '/about', 10); ALTER TABLE `lylme_tags` ADD PRIMARY KEY (`tag_id`); ALTER TABLE `lylme_tags` diff --git a/install/index.php b/install/index.php index 8007cf9..519b8df 100644 --- a/install/index.php +++ b/install/index.php @@ -1,4 +1,5 @@ @@ -10,12 +11,12 @@ header('Content-Type:text/html; charset=utf-8'); // 检测php版本号 -if (phpversion() < '5.4') { - exit('抱歉,您的PHP版本过低,请升级到PHP5.4或更高版本再安装!'); +if (!(version_compare(phpversion(), '7.1.0', '>=') && version_compare(phpversion(), '8.0.0', '<'))) { + exit('抱歉,您的PHP版本过低或过高,请将PHP版本修改为PHP7.1及以上(不支持PHP8),再安装!'); } // 不限制响应时间 -//error_reporting(0); +error_reporting(E_ERROR | E_WARNING | E_PARSE); set_time_limit(0); // 设置系统路径 @@ -42,11 +43,11 @@ $GLOBALS['isNext'] = true; // 获取当前步骤 function getStep() { - $s1 = $_GET['s'] ?: 0; + $s1 = isset($_GET['s']) ? $_GET['s'] : 0; // 初始化参数 - $s2 = $_POST['s'] ?: 0; + $s2 = isset($_POST['s']) ? $_POST['s'] : 0; // 如果有GET值则覆盖POST值 - if ($s1 > 0 && in_array($s1, [1, 63832, md5('done')])) { + if ($s1 > 0 && in_array($s1, [1, 6766, md5('done')])) { $s2 = $s1; } return $s2; @@ -187,7 +188,7 @@ if ($s == 3) { } // 检测数据库信息 -if ($s == 63832) { +if ($s == 6766) { $dbhost = $_GET['dbhost'] ?: ''; $dbuser = $_GET['dbuser'] ?: ''; $dbpwd = $_GET['dbpwd'] ?: ''; @@ -197,7 +198,7 @@ if ($s == 63832) { $pdo = new PDO($dsn, $dbuser, $dbpwd); echo 'true'; } catch (Exception $e) { - echo 'false'; + echo $e->getMessage(); } exit(); } @@ -229,6 +230,10 @@ function getExtendArray() [ 'name' => 'mbstring', 'status' => extension_loaded('mbstring'), + ], + [ + 'name' => 'MySQLi', + 'status' => extension_loaded('mysqli'), ] ]; foreach ($data as $item) { @@ -300,9 +305,11 @@ function clearBOM($contents) $charset[1] = substr($contents, 0, 1); $charset[2] = substr($contents, 1, 1); $charset[3] = substr($contents, 2, 1); - if (ord($charset[1]) == 239 && + if ( + ord($charset[1]) == 239 && ord($charset[2]) == 187 && - ord($charset[3]) == 191) { + ord($charset[3]) == 191 + ) { return substr($contents, 3); } else { return $contents; diff --git a/install/templates/js/forms.js b/install/templates/js/forms.js index 3457d9a..42ee07a 100644 --- a/install/templates/js/forms.js +++ b/install/templates/js/forms.js @@ -80,7 +80,7 @@ function CheckForm() { $.ajax({ url: 'index.php', data: { - s: 63832, + s: 6766, dbhost: $("#dbhost").val(), dbuser: $("#dbuser").val(), dbpwd: $("#dbpwd").val(), @@ -96,7 +96,7 @@ function CheckForm() { document.form.submit(); return; } else { - $('#cpwdTxt').html('不可用'); + $('#cpwdTxt').html(''+data+''); $("#dbpwd").focus(); $('#cpwd').val("false"); return false; @@ -119,7 +119,7 @@ function CheckPwd() { $.ajax({ url: 'index.php', data: { - s: 63832, + s: 6766, dbhost: $("#dbhost").val(), dbport: $("#dbport").val(), dbuser: $("#dbuser").val(), @@ -132,7 +132,7 @@ function CheckPwd() { $('#cpwdTxt').html('可用'); $('#cpwd').val("true"); } else { - $('#cpwdTxt').html('不可用'); + $('#cpwdTxt').html(''+data+''); $('#cpwd').val("false"); } } diff --git a/install/templates/step_1.php b/install/templates/step_1.php index 6b52da2..2904e5f 100644 --- a/install/templates/step_1.php +++ b/install/templates/step_1.php @@ -33,8 +33,8 @@ PHP 版本 - 5.4 - 7.0 + ≥7.1 && <8.0 + 7.4 diff --git a/install/templates/step_2.php b/install/templates/step_2.php index 5422881..99b4da7 100644 --- a/install/templates/step_2.php +++ b/install/templates/step_2.php @@ -46,10 +46,17 @@ 数据库密码: - - + + + + + + + + + 默认管理员信息 diff --git a/install/templates/step_4.php b/install/templates/step_4.php index cd132e6..452094d 100644 --- a/install/templates/step_4.php +++ b/install/templates/step_4.php @@ -1,25 +1,35 @@ + + - + 六零导航页安装向导 - 安装成功 - + + -
-
-
-
现在您可以:
- 访问首页登录后台

- 您可以访问 帮助文档 获取更多帮助 +
+
+
+
现在您可以:
+ + 六零导航页安装信息:
+

后台地址:

+

后台账号:admin

+

后台密码:123456



+ 您可以访问 帮助文档 获取更多帮助 +
-
- + - + + \ No newline at end of file diff --git a/install/templates/style/install.css b/install/templates/style/install.css index 4b6889d..c3fb42d 100644 --- a/install/templates/style/install.css +++ b/install/templates/style/install.css @@ -348,4 +348,19 @@ input[type="text"]:focus, input[type="password"]:focus { .footer .formSubBtn .back:hover { border: 1px solid #666; text-decoration: none; +} +.installed { + margin: 0.8rem 0 2rem; +} + +.installed a { + background: #46a6ff; + padding: 5px 10px; + font-size: 16px; + border-radius: 10px; + color: #fff; + text-decoration: none !important; +} +.installed .admin { + background: #49739a; } \ No newline at end of file