From b7efe23d103f64df1677de2d118c9e4f0690f15f Mon Sep 17 00:00:00 2001 From: printempw Date: Fri, 18 Mar 2016 18:57:58 +0800 Subject: [PATCH] now you can set your site name while installing --- admin/install.php | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/admin/install.php b/admin/install.php index 1714d21e..82977927 100644 --- a/admin/install.php +++ b/admin/install.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-01-16 23:01:33 * @Last Modified by: printempw - * @Last Modified time: 2016-03-18 17:46:50 + * @Last Modified time: 2016-03-18 18:54:35 * * Blessing Skin Server Installer */ @@ -59,7 +59,7 @@ if ($conn->connect_error): ?>

详细信息:connect_error; ?>

+if (Database\Database::checkTableExist($conn)): ?>

已安装过

Blessing Skin Server 看起来已经安装妥当。如果想重新安装,请删除数据库中的旧数据表。

返回首页

@@ -90,10 +90,8 @@ case 2: ?>

用户名只能含有数字、字母、下划线。这是唯一的管理员账号。

- - - - + +

@@ -104,11 +102,23 @@ case 2: ?> - - - + +

+ +

+ + + + + + +

+ + 将会显示在首页以及标题栏,最好用纯英文(字体原因) + +

@@ -126,6 +136,7 @@ if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['pass } $username = $_POST['username']; $password = $_POST['password']; + $sitename = isset($_POST['sitename']) ? $_POST['sitename'] : "Blessing Skin Server"; if (User::checkValidUname($username)) { if (strlen($password) > 16 || strlen($password) < 5) { header('Location: install.php?step=2&msg=无效的密码。密码长度应该大于 6 并小于 15。'); @@ -166,7 +177,7 @@ $sql2 = "CREATE TABLE IF NOT EXISTS `$table_options` ( // import options $sql3 = "INSERT INTO `$table_options` (`option_id`, `option_name`, `option_value`) VALUES (1, 'site_url', ''), - (2, 'site_name', 'Default'), + (2, 'site_name', '$sitename'), (3, 'site_description', 'Minecraft 皮肤站'), (4, 'user_can_register', '1'), (5, 'regs_per_ip', '2'), @@ -185,8 +196,8 @@ if (!$conn->query($sql1) || !$conn->query($sql2) || !$conn->query($sql3)) { ?> } // Insert user -$conn->query("INSERT INTO `".DB_PREFIX."users` (`uid`, `username`, `password`, `ip`, `preference`) VALUES - (1, '".$username."', '".md5($_POST['password'])."', '127.0.0.1', 'default')"); +$conn->query("INSERT INTO `$table_users` (`uid`, `username`, `password`, `ip`, `preference`) VALUES + (1, '".$username."', '".md5($_POST['password'])."', '127.0.0.1', 'default')"); if (!is_dir("../textures/")) { if (!mkdir("../textures/")): ?>