From 3a9dd717e250fb6e40e3bf10ceacb2a8a7883def Mon Sep 17 00:00:00 2001 From: KasuganoSoras Date: Fri, 19 Oct 2018 21:41:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E5=B0=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/loader.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/loader.php b/include/loader.php index fcd9010..55a1928 100644 --- a/include/loader.php +++ b/include/loader.php @@ -6,7 +6,14 @@ include(ROOT . "/include/data/config.php"); $Lang = new Lang(); $Option = new Option(); $result = $Option->getOption("Lang"); -$result = $result == "" ? "zh-CN" : $result; +if($result == "") { + $db = Config::MySQL(); + $conn = mysqli_connect($db['host'], $db['user'], $db['pass'], $db['name'], $db['port']); + mysqli_query($conn, "set names 'utf8mb4'"); + mysqli_query($conn, "INSERT INTO `option` VALUES ('4', 'Lang', 'zh_CN')"); + $result = "zh_CN"; + mysqli_close($conn); +} $Lang->setLang($result); class Loader {