diff --git a/config/config.php b/config/config.php index 6ea73ed..063c961 100644 --- a/config/config.php +++ b/config/config.php @@ -55,11 +55,11 @@ $config = array( 'maxUploadFiles' => 30, // 是否开启登录上传 开启:true 关闭:false 'mustLogin' => false, - // 是否开启tinyfilemanager文件管理 + // 是否开启tinyfilemanager文件管理 开启:true 关闭:false 'tinyfilemanager' => true, // 登录上传和后台管理密码,管理用户名为:admin 'password' => 'admin@123', - // 是否开启API上传 + // 是否开启API上传 开启:true 关闭:false 'apiStatus' => true, // 是否开启水印:0关闭,1文字水印,2图片水印 不能使用动态gif添加水印 'watermark' => 0, @@ -92,24 +92,24 @@ $config = array( 'minWidth' => 5, // 允许上传的最小高度 'minHeight' => 5, - // 等比例缩小图片 宽度和高度请设置 image_x image_y 开启true,关闭false 关闭下image_x和image_y设置不生效 + // 等比例缩小图片 宽度和高度请设置 image_x image_y 开启:true 关闭:false 关闭下image_x和image_y设置不生效 'imgRatio' => false, // 缩减的最大高度 'image_x' => 10240, // 缩减的最大宽度 'image_y' => 10240, - // 开启静态文件CDN 开启true 关闭false + // 开启静态文件CDN 开启:true 关闭:false 'static_cdn' => false, - // 开启顶部广告 开启true 关闭false 如果想添加或修改广告请到 public/static/ad_top.html + // 开启顶部广告 开启:true 关闭:false 如果想添加或修改广告请到 public/static/ad_top.html 'ad_top' => false, - // 开启底部广告 开启true 关闭false 如果想添加或修改广告请到 public/static/ad_bot.html + // 开启底部广告 开启:true 关闭:false 如果想添加或修改广告请到 public/static/ad_bot.html 'ad_bot' => false, - // 开启游客预览(广场) 开启true 关闭false + // 开启游客预览(广场)开启:true 关闭:false 'showSwitch' => true, // 默认预览数量,可在网址后填写参数实时更改预览数量 如:https://img.545141.com/libs/list.php?num=3 'listNumber' => 20, // 上传框底部自定义信息,仅支持html格式 - 'customize' =>' + 'customize' => ' ', + // 开启环境检测 开启:true 关闭:false + 'checkEnv' => true, // 当前版本 'version' => '2.1.0', ); diff --git a/index.php b/index.php index bc17eb1..c505033 100644 --- a/index.php +++ b/index.php @@ -135,5 +135,5 @@ mustLogin(); }); Icret Ver: - \ No newline at end of file diff --git a/libs/function.php b/libs/function.php index ef7ebb2..7757733 100644 --- a/libs/function.php +++ b/libs/function.php @@ -115,8 +115,7 @@ function static_cdn() - - '; + '; } else { // 本地文件 return ' @@ -128,8 +127,7 @@ function static_cdn() - - '; + '; } } @@ -143,7 +141,6 @@ function tinyfilemanager() } } - // 获取允许上传的扩展名 function getExtensions() { @@ -168,7 +165,6 @@ function getDirectorySize($path) return $bytestotal; } - /** * 获取指定文件夹文件数量 * @param $url 传入一个路径如:/apps/web @@ -188,7 +184,6 @@ function getFileNumber($url) return $num; } - /* * 图片展示页面 * getDir()取文件夹列表,getFile()取对应文件夹下面的文件列表,二者的区别在于判断有没有“.”后缀的文件,其他都一样 @@ -302,7 +297,7 @@ function getActive($url) /** * 加密/解密图片路径 * @param string $data 要加密的内容 - * @param $mode=1或0 1解密 0加密 + * @param int $mode =1或0 1解密 0加密 * */ function ulrHash($data, $mode) @@ -379,39 +374,41 @@ function is_online() * * 检测是否更改默认域名 */ -function checkEnv() +function checkEnv($mode) { global $config; - // 扩展检测 - $expand = array('fileinfo', 'iconv', 'gd', 'mbstring', 'openssl',); - foreach ($expand as $val) { - if (!extension_loaded($val)) { - echo ' + if ($mode) { + // 扩展检测 + $expand = array('fileinfo', 'iconv', 'gd', 'mbstring', 'openssl',); + foreach ($expand as $val) { + if (!extension_loaded($val)) { + echo ' '; + } } - } - // 检测是否更改默认域名 - $url = preg_replace('#^(http(s?))?(://)#', '', 'http://192.168.1.15'); - if (strstr($url, $_SERVER['HTTP_HOST'])) { - echo ' + // 检测是否更改默认域名 + $url = preg_replace('#^(http(s?))?(://)#', '', 'http://192.168.1.15'); + if (strstr($url, $_SERVER['HTTP_HOST'])) { + echo ' '; - } - // 检测是否更改默认密码 - if ($config['password'] === 'admin@123') { - echo ' + } + // 检测是否更改默认密码 + if ($config['password'] === 'admin@123') { + echo ' '; + } } }