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 @@