From b1f1b930e5860c2c1ce8e6d0e425b0ca79491d58 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Mon, 2 Sep 2019 19:48:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=A4=A7=E5=B0=8F=E4=B8=8D=E8=B5=B7=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/Upload.php | 8 +++++++- application/models/Query.php | 8 ++++++++ application/views/admin/index.php | 6 ++++++ application/views/user/header.php | 13 ++++++------- data/version.txt | 2 +- static/embed.js | 4 ++-- 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/application/controllers/Upload.php b/application/controllers/Upload.php index 975ecc0..7ceff56 100644 --- a/application/controllers/Upload.php +++ b/application/controllers/Upload.php @@ -62,6 +62,12 @@ } //通用上传设置 protected function config($upload_path = ''){ + //获取上传限制 + $limit = $this->query->get_limit(); + $limit = json_decode($limit); + + //最大上传大小 + $max_size = $limit->max_size * 1024; //设置上传路径 if($upload_path == ''){ $upload_path = $this->upload_path; @@ -70,7 +76,7 @@ $config['upload_path'] = $upload_path; $config['allowed_types'] = 'gif|jpg|jpeg|png|bmp|webp'; //$config['allowed_types'] = 'image/jpeg|image/png|image/gif|image/bmp|image/x-ms-bmp|image/webp'; - $config['max_size'] = 5120; + $config['max_size'] = $max_size; $config['file_ext_tolower'] = TRUE; //文件名转换为小写 $config['overwrite'] = TRUE; //覆盖同名文件 $config['encrypt_name'] = TRUE; //随机命名图片 diff --git a/application/models/Query.php b/application/models/Query.php index 86d98ae..3b414d9 100644 --- a/application/models/Query.php +++ b/application/models/Query.php @@ -364,5 +364,13 @@ $imginfo = $this->db->query($sql)->row(); return $imginfo; } + //获取上传限制 + public function get_limit(){ + $sql = "SELECT `values` FROM img_options WHERE `name` = 'uplimit' LIMIT 1;"; + $query = $this->db->query($sql); + //只获取一行 + $row = $query->row(); + return $row->values; + } } ?> \ No newline at end of file diff --git a/application/views/admin/index.php b/application/views/admin/index.php index 5b937a9..37f3303 100644 --- a/application/views/admin/index.php +++ b/application/views/admin/index.php @@ -67,6 +67,12 @@

341195621

+
+
+

购买专业版

+

https://dwz.ovh/9

+
+
diff --git a/application/views/user/header.php b/application/views/user/header.php index fa18b42..334260c 100644 --- a/application/views/user/header.php +++ b/application/views/user/header.php @@ -44,16 +44,15 @@