You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-13 11:43:58 +08:00
图表化来临
This commit is contained in:
32
README.md
32
README.md
@@ -66,15 +66,29 @@ RewriteRule config/(.*).(php)$ – [F]
|
||||
|
||||
<details><summary><mark><font color=darkred>点击查看2.0版更新日志</font></mark></summary>
|
||||
|
||||
* 2021年10月30日 v2.3.1
|
||||
* 2021-11-5 v2.4.0
|
||||
- 增加统计缓存
|
||||
- 增加最近30天上传统计与占用空间图表
|
||||
- 增加初始化安装(可能会不支持二级目录安装,可删除install文件夹初始化)
|
||||
- 增加在线编辑配置(之前是需要修改config.php文件,现在可以直接网站端修改了)
|
||||
- 删除广场会导致浏览速度变慢的代码
|
||||
- 删除快捷配置会导致浏览速度变慢的代码
|
||||
|
||||
|
||||
* 2021-11-3 v2.3.2
|
||||
- 增加广场图片缓存
|
||||
- 重构广场样式
|
||||
|
||||
* 2021-11-3 v2.3.1
|
||||
- 增加监黄接口
|
||||
- 增加对php5.6-php8.0的支持
|
||||
- 修复二级目录无法使用
|
||||
- 增加审核违规图片
|
||||
- 修复对php5.6的支持
|
||||
- 修复二级目录的安装
|
||||
|
||||
* 2021-10-24 v2.3.0
|
||||
- 将服务器环境监测改为第一次打开时自动检测(如需再次展示需删除config目录下的EasyImage.lock)
|
||||
- 增加快捷操作中心显示服务信息
|
||||
- 增加自定义上传文件的命名方式(详见config.php文件里的注释)
|
||||
- 增加对上传文件的命名方式(详见config.php文件里的注释)
|
||||
- 增加隐私政策、服务条款、DMCA
|
||||
- 增加自定义静态文件CDN源
|
||||
- 增加dns-prefetch
|
||||
@@ -134,7 +148,7 @@ RewriteRule config/(.*).(php)$ – [F]
|
||||
deny all;
|
||||
}
|
||||
```
|
||||
- - 或者参考:https://www.545141.com/981.html
|
||||
- - 或者参考:https://www.545141.com/992.html https://www.545141.com/939.html
|
||||
- 一些精简
|
||||
|
||||
* 2021-4-14 v2.0.2.1 Dev1
|
||||
@@ -200,7 +214,13 @@ RewriteRule config/(.*).(php)$ – [F]
|
||||
- 全新的压缩 将文件继续缩小
|
||||
- 全新的目录系统,精简代码
|
||||
- 设置仅允许在config.php修改,注释更加明了,即使没有代码基础也可以操作
|
||||
- 增加新的文件管理系统
|
||||
- 增加新的文件管理系统,感谢 tinyfilemanager
|
||||
- ~~支持文字/图片水印 可自定义文字颜色~~
|
||||
- ~~支持文字水印背景颜色~~
|
||||
- ~~支持文字水印透明度~~
|
||||
- ~~支持删除远程上传文件~~ -> 不再支持删除远程文件
|
||||
- ~~(支持开启/关闭api自定义文字水印)~~
|
||||
- ~~支持删除自定义删除图片(仅管理员)~~
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
431
admin/admin.inc.php
Executable file
431
admin/admin.inc.php
Executable file
@@ -0,0 +1,431 @@
|
||||
<?php
|
||||
/*
|
||||
* 登录页面
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../application/function.php';
|
||||
require_once APP_ROOT . '/application/header.php';
|
||||
|
||||
if (!is_online()) {
|
||||
echo '
|
||||
<script> new $.zui.Messager("请登录后再修改!", {type: "danger" // 定义颜色主题
|
||||
}).show();</script>';
|
||||
exit(require_once APP_ROOT . '/application/login.php');
|
||||
}
|
||||
|
||||
if (isset($_POST['form'])) {
|
||||
$postArr = $_POST;
|
||||
$new_config = array_replace($config, $postArr);
|
||||
$config_file = APP_ROOT.'/config/config.php';
|
||||
cache_write($config_file,$new_config);
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("保存成功", {
|
||||
type: "success" // 定义颜色主题
|
||||
}).show();
|
||||
</script>
|
||||
';
|
||||
header("refresh:1;");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
<li class="active"><a href="###" data-target="#tab3Content1" data-toggle="tab">网站设置</a></li>
|
||||
<li><a href="###" data-target="#tab3Content2" data-toggle="tab">上传设置</a></li>
|
||||
<li><a href="###" data-target="#tab3Content3" data-toggle="tab">广告设置</a></li>
|
||||
<li><a href="###" data-target="#tab3Content4" data-toggle="tab">API 设置</a></li>
|
||||
<li><a href="###" data-target="#tab3Content5" data-toggle="tab">安全设置</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-9">
|
||||
<div class="tab-content col-xs-9">
|
||||
<div class="tab-pane fade active in" id="tab3Content1">
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<label>网站域名,末尾不加"/" </label>
|
||||
<input type="url" class="form-control" name="domain" required="required" value="<?php echo $config['domain']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>图片链接域名,末尾不加"/"</label>
|
||||
<input type="text" class="form-control" name="imgurl" required="required" value="<?php echo $config['imgurl']; ?>" placeholder="末尾不加/" onkeyup="this.value=this.value.replace(/\s/g,'')" title="网站域名与图片链接域名可以不同,比如A域名上传,可以返回B域名图片链接,A、B需绑定到同一空间下,如果不变的话,下边2个填写成一样的!">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>登录上传和后台管理密码,管理用户名为:admin,更改后会立即生效</label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" name="password" required="required" value="<?php echo $config['password']; ?>" id="pwd" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button"><i class="icon icon-eye-close" onclick="showhide()" id="eye"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>网站标题</label>
|
||||
<input type="text" class="form-control" name="title" required="required" value="<?php echo $config['title']; ?>" onkeyup="this.value=this.value.trim()">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>网站关键字</label>
|
||||
<textarea class="form-control" rows="3" name="keywords" required="required" onkeyup="this.value=this.value.replace(/\s/g,'')"><?php echo $config['keywords']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>网站描述</label>
|
||||
<textarea class="form-control" rows="3" name="description" required="required" onkeyup="this.value=this.value.replace(/\s/g,'')"><?php echo $config['description']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>网站公告</label>
|
||||
<textarea class="form-control" rows="3" name="tips" required="required" onkeyup="this.value=this.value.replace(/\s/g,'')"><?php echo $config['tips']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="static_cdn" value="0">
|
||||
<input type="checkbox" name="static_cdn" value="1" <?php if ($config['static_cdn']) {
|
||||
echo 'checked="checked"';
|
||||
} ?>>
|
||||
<label style="font-weight: bold">开启静态文件CDN</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>静态文件CDN加速网址 末尾不加 /</label>
|
||||
<input type="url" class="form-control" name="static_cdn_url" value="<?php echo $config['static_cdn_url']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="tab3Content2">
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="mustLogin" value="0">
|
||||
<input type="checkbox" name="mustLogin" value="1" <?php if ($config['mustLogin']) {
|
||||
echo 'checked="checked"';
|
||||
} ?>>
|
||||
<label style="font-weight: bold">开启登录上传</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="apiStatus" value="0">
|
||||
<input type="checkbox" name="apiStatus" value="1" <?php if ($config['apiStatus']) {
|
||||
echo 'checked="checked"';
|
||||
} ?>>
|
||||
<label style="font-weight: bold">开启API上传</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>存储路径 例:/i/ 前后需加英文'/'</label>
|
||||
<input type="text" class="form-control" name="path" required="required" value="<?php echo $config['path']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')" title="可根据Apache/Nginx配置安全,参考:https://www.545141.com/981.html 或 README.md">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>文件的命名方式</label>
|
||||
<select class="chosen-select form-control" name="imgName">
|
||||
<option value="default" <?php if ($config['imgName'] == 'default') {
|
||||
echo 'selected';
|
||||
} ?>>将上传时间+随机数转换为36进制 例:vx77yu</option>
|
||||
<option value="date" <?php if ($config['imgName'] == 'date') {
|
||||
echo 'selected';
|
||||
} ?>>以上传时间 例:192704</option>
|
||||
<option value="unix" <?php if ($config['imgName'] == 'unix') {
|
||||
echo 'selected';
|
||||
} ?>>以Unix时间 例:1635074840</option>
|
||||
<option value="uniqid" <?php if ($config['imgName'] == 'uniqid') {
|
||||
echo 'selected';
|
||||
} ?>>基于以微秒计的当前时间 例:6175436c73418</option>
|
||||
<option value="guid" <?php if ($config['imgName'] == 'guid') {
|
||||
echo 'selected';
|
||||
} ?>>全球唯一标识符 例:6EDAD0CC-AB0C-4F61-BCCA-05FAD65BF0FA</option>
|
||||
<option value="md5" <?php if ($config['imgName'] == 'md5') {
|
||||
echo 'selected';
|
||||
} ?>>md5加密时间 例:3888aa69eb321a2b61fcc63520bf6c82</option>
|
||||
<option value="sha1" <?php if ($config['imgName'] == 'sha1') {
|
||||
echo 'selected';
|
||||
} ?>>sha1加密微秒 例:654faac01499e0cb5fb0e9d78b21e234c63d842a</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>最大上传限制最小1MB,最大50MB,当前:</label><label id="maxSize"><?php echo $config['maxSize'] / 1024 / 1024; ?></label><label>MB</label>
|
||||
<input type="range" class="form-control" name="maxSize" value="<?php echo $config['maxSize']; ?>" min="1048576" max="52428800" step="1048576" onchange="document.getElementById('maxSize').innerHTML=value/1024/1024">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>每次最多上传图片数,当前:</label><label id="maxUploadFiles"><?php echo $config['maxUploadFiles']; ?></label><label>张</label>
|
||||
<input type="range" class="form-control" name="maxUploadFiles" value="<?php echo $config['maxUploadFiles']; ?>" min="1" max="100" step="1" onchange="document.getElementById('maxUploadFiles').innerHTML=value">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>上传水印</label>
|
||||
<select class="chosen-select form-control" name="watermark">
|
||||
<option value="0" <?php if (!$config['watermark']) {
|
||||
echo 'selected';
|
||||
} ?>>关闭水印</option>
|
||||
<option value="1" <?php if ($config['watermark'] == 1) {
|
||||
echo 'selected';
|
||||
} ?>>文字水印</option>
|
||||
<option value="2" <?php if ($config['watermark'] == 2) {
|
||||
echo 'selected';
|
||||
} ?>>图片水印</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>水印文字内容</label>
|
||||
<input type="text" class="form-control" name="waterText" required="required" value="<?php echo $config['waterText']; ?>" onkeyup="this.value=this.value.trim()">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>水印位置:</label>
|
||||
<select class="chosen-select form-control" name="waterPosition">
|
||||
<option value="0" <?php if (!$config['waterPosition']) {
|
||||
echo 'selected';
|
||||
} ?>>随机位置</option>
|
||||
<option value="1" <?php if ($config['waterPosition'] == 1) {
|
||||
echo 'selected';
|
||||
} ?>>顶部居左</option>
|
||||
<option value="2" <?php if ($config['waterPosition'] == 2) {
|
||||
echo 'selected';
|
||||
} ?>>顶部居中</option>
|
||||
<option value="3" <?php if ($config['waterPosition'] == 3) {
|
||||
echo 'selected';
|
||||
} ?>>顶部居右</option>
|
||||
<option value="4" <?php if ($config['waterPosition'] == 4) {
|
||||
echo 'selected';
|
||||
} ?>>左边居中</option>
|
||||
<option value="5" <?php if ($config['waterPosition'] == 5) {
|
||||
echo 'selected';
|
||||
} ?>>图片中心</option>
|
||||
<option value="6" <?php if ($config['waterPosition'] == 6) {
|
||||
echo 'selected';
|
||||
} ?>>右边居中</option>
|
||||
<option value="7" <?php if ($config['waterPosition'] == 7) {
|
||||
echo 'selected';
|
||||
} ?>>底部居左</option>
|
||||
<option value="8" <?php if ($config['waterPosition'] == 8) {
|
||||
echo 'selected';
|
||||
} ?>>底部居中</option>
|
||||
<option value="9" <?php if ($config['waterPosition'] == 9) {
|
||||
echo 'selected';
|
||||
} ?>>底部居右</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>水印文字颜色 rgba 末尾为透明度0-127 0为不透明</label>
|
||||
<input type="text" name="textColor" class="form-control" value="" readonly data-jscolor="{value:'rgba(<?php echo $config['textColor']; ?>)', position:'bottom', height:80, backgroundColor:'#333',palette:'rgba(0,0,0,0) #fff #808080 #000 #996e36 #f55525 #ffe438 #88dd20 #22e0cd #269aff #bb1cd4',paletteCols:11, hideOnPaletteClick:true}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>水印字体大小,当前:</label><label id="textSize"><?php echo $config['textSize']; ?></label><label>像素</label>
|
||||
<input type="range" class="form-control" name="textSize" value="<?php echo $config['textSize']; ?>" min="1" max="50" step="1" onchange="document.getElementById('textSize').innerHTML=value">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>字体路径 如果想改变字体,请选择支持中文的 GB/2312 字体</label>
|
||||
<input type="text" class="form-control" name="textFont" required="required" value="<?php echo $config['textFont']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>图片水印路径 支持GIF,JPG,BMP,PNG和PNG alpha</label>
|
||||
<input type="text" class="form-control" name="waterImg" required="required" value="<?php echo $config['waterImg']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>允许上传的图片扩展名,请以英文,分割</label>
|
||||
<input type="text" class="form-control" name="extensions" required="required" value="<?php echo $config['extensions']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="compress" value="0">
|
||||
<input type="checkbox" name="compress" value="1" <?php if ($config['compress']) {
|
||||
echo 'checked="checked"';
|
||||
} ?> title=" 轻微有损压缩图片, 此压缩有可能使图片变大!特别是小图片 也有一定概率改变图片方向">
|
||||
<label style="font-weight: bold">开启压缩图片-开启后会增加服务器负担</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>转换图片为指定格式<?php echo $config['imgConvert']; ?></label>
|
||||
<select class="chosen-select form-control" name="imgConvert">
|
||||
<option value="">不转换</option>
|
||||
<option value="png">png</option>
|
||||
<option value="jpeg">jpeg</option>
|
||||
<option value="gif">gif</option>
|
||||
<option value="bmp">bmp</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>最大上传宽度</label>
|
||||
<input type="range" class="form-control" name="maxWidth" value="<?php echo $config['maxWidth']; ?>" min="1024" max="102400" step="1024" onchange="document.getElementById('maxWidth').innerHTML=value">
|
||||
<label id="maxWidth"><?php echo $config['maxWidth']; ?></label><label>像素</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>最大上传高度</label>
|
||||
<input type="range" class="form-control" name="maxHeight" value="<?php echo $config['maxHeight']; ?>" min="1024" max="102400" step="1024" onchange="document.getElementById('maxHeight').innerHTML=value">
|
||||
<label id="maxHeight"><?php echo $config['maxHeight']; ?></label><label>像素</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>允许上传的最小宽度</label>
|
||||
<input type="range" class="form-control" name="minWidth" value="<?php echo $config['minWidth']; ?>" min="5" max="1024" step="10" onchange="document.getElementById('minWidth').innerHTML=value">
|
||||
<label id="minWidth"><?php echo $config['minWidth']; ?></label><label>像素</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>允许上传的最小高度</label>
|
||||
<input type="range" class="form-control" name="minHeight" value="<?php echo $config['minHeight']; ?>" min="5" max="1024" step="10" onchange="document.getElementById('minHeight').innerHTML=value">
|
||||
<label id="minHeight"><?php echo $config['minHeight']; ?></label><label>像素</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="imgRatio" value="0">
|
||||
<input type="checkbox" name="imgRatio" value="1" <?php if ($config['imgRatio']) {
|
||||
echo 'checked="checked"';
|
||||
} ?>>
|
||||
<label style="font-weight: bold">开启上传后改变图片尺寸(不开启下边不会生效!)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>开启上传后改变图片尺寸->更改后的宽度:</label><label id="image_x"><?php echo $config['image_x']; ?></label><label>像素</label>
|
||||
<input type="range" class="form-control" name="image_x" value="<?php echo $config['image_x']; ?>" min="100" max="10240" step="100" onchange="document.getElementById('image_x').innerHTML=value">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>开启上传后改变图片尺寸->更改后的高度:</label><label id="image_y"><?php echo $config['image_y']; ?></label><label>像素</label>
|
||||
<input type="range" class="form-control" name="image_y" value="<?php echo $config['image_y']; ?>" min="100" max="10240" step="100" onchange="document.getElementById('image_y').innerHTML=value">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="tab3Content3">
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="ad_top" value="0">
|
||||
<input type="checkbox" name="ad_top" value="1" <?php if ($config['ad_top']) {
|
||||
echo 'checked="checked"';
|
||||
} ?>>
|
||||
<label style="font-weight: bold">开启顶部广告</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>顶部广告内容 支持html代码</label>
|
||||
<textarea class="form-control" rows="5" name="ad_top_info"><?php echo $config['ad_top_info']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="ad_bot" value="0">
|
||||
<input type="checkbox" name="ad_bot" value="1" <?php if ($config['ad_bot']) {
|
||||
echo 'checked="checked"';
|
||||
} ?>>
|
||||
<label style="font-weight: bold">开启底部广告</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>底部广告内容 支持html代码</label>
|
||||
<textarea class="form-control" rows="5" name="ad_bot_info"><?php echo $config['ad_bot_info']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>自定义信息,仅支持html代码 可以放置统计代码</label>
|
||||
<textarea class="form-control" rows="7" name="customize"><?php echo $config['customize']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade " id="tab3Content4">
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<label>TinyImag Key 申请地址:<a href="https://tinypng.com/developers" target="_blank">https://tinypng.com/developers</a></label>
|
||||
<input type="text" class="form-control input-sm" name="TinyImag_key" value="<?php echo $config['TinyImag_key']; ?>" title="开启后会受服务器到https://tinypng.com 速度影响,国内不建议开启!" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="tab3Content5">
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="showSwitch" value="0">
|
||||
<input type="checkbox" name="showSwitch" value="1" <?php if ($config['showSwitch']) {
|
||||
echo 'checked="checked"';
|
||||
} ?>>
|
||||
<label style="font-weight: bold">开启游客预览(广场)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>默认预览数量,当前:</label>
|
||||
<label id="listNumber"><?php echo $config['listNumber']; ?></label><label>张</label>
|
||||
<input type="range" class="form-control" name="listNumber" value="<?php echo $config['listNumber']; ?>" min="10" max="100" step="10" onchange="document.getElementById('listNumber').innerHTML=value" title="可在网址后填写参数实时更改预览数量 如:https://img.545141.com/application/list.php?num=3">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="checkEnv" value="0">
|
||||
<input type="checkbox" name="checkEnv" value="1" <?php if ($config['checkEnv']) {
|
||||
echo 'checked="checked"';
|
||||
} ?>>
|
||||
<label style="font-weight: bold">开启PHP插件检测-安全设置检测-版本检测</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="checkImg" value="0">
|
||||
<input type="checkbox" name="checkImg" value="1" <?php if ($config['checkImg']) {
|
||||
echo 'checked="checked"';
|
||||
} ?> title="开启后会受服务器到https://moderatecontent.com速度影响,国内不建议开启!">
|
||||
<label style="font-weight: bold">开启图片监黄</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>图片监黄key 申请地址:<a href="https://client.moderatecontent.com" target="_blank">https://client.moderatecontent.com</a></label>
|
||||
<input type="text" class="form-control input-sm" name="moderatecontent_key" value="<?php echo $config['moderatecontent_key']; ?>" title="开启后会受服务器到https://moderatecontent.com 速度影响,国内不建议开启!" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>设置是不良图片概率,概率越大准确率越高,当前:</label>
|
||||
<label id="checkImg_value"><?php echo $config['checkImg_value']; ?></label><label>%</label>
|
||||
<input type="range" class="form-control" name="checkImg_value" value="<?php echo $config['checkImg_value']; ?>" min="1" max="100" step="1" onchange="document.getElementById('checkImg_value').innerHTML=value">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<p style="font-weight: bold">当前软件版本:<span class="label label-badge label-outline"><?php echo $config['version']; ?></span></p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="/public/static/jscolor.js"></script>
|
||||
<script>
|
||||
var eye = document.getElementById("eye");
|
||||
var pwd = document.getElementById("pwd");
|
||||
|
||||
function showhide() {
|
||||
if (pwd.type == "password") {
|
||||
pwd.type = "text";
|
||||
eye.className = 'icon icon-eye-open'
|
||||
} else {
|
||||
pwd.type = "password";
|
||||
eye.className = 'icon icon-eye-close'
|
||||
}
|
||||
}
|
||||
// jscolor
|
||||
jscolor.presets.default = {
|
||||
position: 'right',
|
||||
palette: [
|
||||
'#000000', '#7d7d7d', '#870014', '#ec1c23', '#ff7e26',
|
||||
'#fef100', '#22b14b', '#00a1e7', '#3f47cc', '#a349a4',
|
||||
'#ffffff', '#c3c3c3', '#b87957', '#feaec9', '#ffc80d',
|
||||
'#eee3af', '#b5e61d', '#99d9ea', '#7092be', '#c8bfe7',
|
||||
],
|
||||
//paletteCols: 12,
|
||||
//hideOnPaletteClick: true,
|
||||
};
|
||||
// 更改网页标题
|
||||
document.title = "配置中心 - EasyImage2.0 简单图床"
|
||||
</script>
|
||||
<?php
|
||||
require_once APP_ROOT . '/application/footer.php';
|
||||
@@ -2,9 +2,10 @@
|
||||
/*
|
||||
* API 页面管理
|
||||
*/
|
||||
require_once '../libs/header.php';
|
||||
require_once '../application/header.php';
|
||||
require_once APP_ROOT . '/config/api_key.php';
|
||||
require_once APP_ROOT . '/api/libs//apiFunction.php';
|
||||
require_once APP_ROOT . '/api/application/apiFunction.php';
|
||||
require_once APP_ROOT . '/application/chart.php';
|
||||
|
||||
// 检测登录
|
||||
if (!is_online()) {
|
||||
@@ -36,12 +37,30 @@ if (isset($_POST['delDir'])) {
|
||||
header("refresh:1;"); // 1s后刷新当前页面
|
||||
}
|
||||
}
|
||||
|
||||
// 恢复图片
|
||||
if(isset($_GET['reimg'])){
|
||||
if (isset($_GET['reimg'])) {
|
||||
$name = $_GET['reimg'];
|
||||
re_checkImg($name);
|
||||
}
|
||||
|
||||
// 统计图表
|
||||
$char_data = read_chart_total();
|
||||
|
||||
$chart_date = '';
|
||||
foreach ($char_data['date'] as $value) {
|
||||
$chart_date .= $value;
|
||||
}
|
||||
|
||||
$chart_number = '';
|
||||
foreach ($char_data['number'] as $value) {
|
||||
$chart_number .= $value;
|
||||
}
|
||||
|
||||
$chart_disk = '';
|
||||
foreach ($char_data['disk'] as $value) {
|
||||
$chart_disk .= $value;
|
||||
}
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
@@ -79,21 +98,26 @@ if(isset($_GET['reimg'])){
|
||||
<p>访问者IP:<?php echo $_SERVER["REMOTE_ADDR"]; ?></p>
|
||||
<h5>图床信息</h5>
|
||||
<hr />
|
||||
<p><?php $yesterday = date("Y/m/d/", strtotime("-1 day"));
|
||||
echo '今日上传:' . getFileNumber(APP_ROOT . config_path()) . ' 昨日上传:' . getFileNumber(APP_ROOT . $config['path'] . $yesterday); ?></p>
|
||||
<p>当前版本:<?php echo $config['version']; ?>,Github版本:<a href="https://github.com/icret/EasyImages2.0/releases" target="_blank"><?php echo getVersion(); ?></a></p>
|
||||
<p><?php
|
||||
if (empty($tinyImag_key['TinyImag'])) {
|
||||
if (empty($config['TinyImag_key'])) {
|
||||
echo '压缩图片 TinyImag Key未填写,申请地址:<a href="https://tinypng.com/developers" target="_blank">https://tinypng.com/developers</a><br/>';
|
||||
} else {
|
||||
echo '压缩图片 TinyImag Key已填写<br/>';
|
||||
}
|
||||
if (empty($moderatecontent['key'])) {
|
||||
echo '图片检查 moderatecontent key未填写,申请地址: <a href="https://moderatecontent.com/" target="_blank">https://moderatecontent.com/</a>';
|
||||
if (empty($config['moderatecontent_key'])) {
|
||||
echo '图片检查 moderatecontent key未填写,申请地址: <a href="https://client.moderatecontent.com" target="_blank">https://client.moderatecontent.com/</a>';
|
||||
} else {
|
||||
echo '图片检查 moderatecontent key已填写';
|
||||
}
|
||||
?></p>
|
||||
?>
|
||||
</p>
|
||||
<p>当前版本:<?php echo $config['version']; ?>,Github版本:<a href="https://github.com/icret/EasyImages2.0/releases" target="_blank"><?php echo getVersion(); ?></a></p>
|
||||
<p><?php
|
||||
$yesterday = date("Y/m/d/", strtotime("-1 day"));
|
||||
echo '今日上传:' . getFileNumber(APP_ROOT . config_path()) . ' 昨日上传:' . getFileNumber(APP_ROOT . $config['path'] . $yesterday);
|
||||
echo '<br />统计时间: ' . read_total_json('total_time') . ';文件夹:' . read_total_json('dirnum') . '个;托管图片:' . read_total_json('filenum') . '张;占用:' . read_total_json('usage_space') . ';缓存周期:每小时。';
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -130,7 +154,7 @@ if(isset($_GET['reimg'])){
|
||||
<div class="col-md-4">
|
||||
<div id="delimgurl"></div>
|
||||
<div id="title"></div>
|
||||
<form class="form-condensed" method="get" action="del.php" id="form" name="delForm" onSubmit="getStr();" target="_blank">
|
||||
<form class="form-condensed" method="get" action="../application/del.php" id="form" name="delForm" onSubmit="getStr();" target="_blank">
|
||||
<div class="form-group">
|
||||
<label for="del">
|
||||
删除图片
|
||||
@@ -144,7 +168,7 @@ if(isset($_GET['reimg'])){
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4">
|
||||
<form action="../libs/compressing.php" method="post" target="_blank">
|
||||
<form action="../application/compressing.php" method="post" target="_blank">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputInviteCode1">压缩文件夹内图片(格式:2021/05/10/):</label>
|
||||
<input type="text" class="form-control form-date" placeholder="" name="folder" value="<?php echo date('Y/m/d/'); ?>" readonly="">
|
||||
@@ -192,11 +216,17 @@ if(isset($_GET['reimg'])){
|
||||
<label for="exampleInputInviteCode1" style="color:red">删除所选日期文件夹(删除之后无法恢复!):</label>
|
||||
<input type="text" class="form-control form-date" name="delDir" value="<?php echo date('Y/m/d/'); ?>" readonly="">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-mini btn-danger" onClick="return confirm('确认要删除?\n* 删除文件夹后将无法恢复!');">删除目录</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<hr>
|
||||
<h4>上传统计(每日更新)</h4>
|
||||
<canvas id="myChart" width="1920" height="400"></canvas>
|
||||
<p>单位:上传/个 占用/Mb 统计时间:<?php echo $char_data['total_time']; ?></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<hr>
|
||||
<div class="col-md-7">
|
||||
@@ -204,8 +234,8 @@ if(isset($_GET['reimg'])){
|
||||
<button type="button" class="btn" data-toggle="collapse" data-target="#lis_cache">疑似违规的图片<i class="icon icon-hand-down"></i></button>
|
||||
</p>
|
||||
<div class="collapse" id="lis_cache">
|
||||
<p>为了服务器的稳定,仅显示最近20张图片;监黄需要在<code>config.php</code>中开启<code>checkImg</code>属性。</p>
|
||||
<p>key申请地址:<a href="https://moderatecontent.com" target="_blank">https://moderatecontent.com</a></p>
|
||||
<p>为了访问速度,仅显示最近20张图片;监黄需要在<code>config.php</code>中开启<code>checkImg</code>属性。</p>
|
||||
<p>key申请地址:<a href="https://client.moderatecontent.com/" target="_blank">https://client.moderatecontent.com/</a></p>
|
||||
<p>获得key后填入<code>/config/api_key.php</code>-><code>moderatecontent</code>属性</p>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-auto table-condensed table-striped">
|
||||
@@ -214,7 +244,6 @@ if(isset($_GET['reimg'])){
|
||||
<th>序号</th>
|
||||
<th>缩略图</th>
|
||||
<th>文件名</th>
|
||||
<th>长宽(像素)</th>
|
||||
<th>大小</th>
|
||||
<th>查看图片</th>
|
||||
<th>还原图片</th>
|
||||
@@ -224,28 +253,26 @@ if(isset($_GET['reimg'])){
|
||||
<tbody>
|
||||
<?php
|
||||
// 获取被隔离的文件
|
||||
@$cache_dir = APP_ROOT . $config['path'] . 'cache/'; // cache目录
|
||||
@$cache_file = getFile($cache_dir); // 获取所有文件
|
||||
@$cache_num = count($cache_file); // 统计目录文件个数
|
||||
for ($i = 0; $i < $cache_num and $i < 21; $i++) { // 循环输出文件
|
||||
$file_cache_path = APP_ROOT . $config['path'] . 'cache/' . $cache_file[$i]; // 图片绝对路径
|
||||
$file_path = $config['path'] . 'cache/' . $cache_file[$i]; // 图片相对路径
|
||||
@$file_size = getDistUsed(filesize($file_cache_path)); // 图片大小
|
||||
@$filen_name = $cache_file[$i]; // 图片名称
|
||||
@list($width, $height, $type, $attr) = getimagesize($file_cache_path); // 图片长、宽、类型、属性
|
||||
$url = $config['imgurl'] . $config['path'] . 'cache/' . $cache_file[$i]; // 图片网络连接
|
||||
$unlink_img = $config['domain'] . '/api/del.php?url=' . $url; // 图片删除连接
|
||||
@$cache_dir = APP_ROOT . $config['path'] . 'suspic/'; // cache目录
|
||||
@$cache_file = getFile($cache_dir); // 获取所有文件
|
||||
@$cache_num = count($cache_file); // 统计目录文件个数
|
||||
for ($i = 0; $i < $cache_num and $i < 21; $i++) { // 循环输出文件
|
||||
$file_cache_path = APP_ROOT . $config['path'] . 'suspic/' . $cache_file[$i]; // 图片绝对路径
|
||||
$file_path = $config['path'] . 'suspic/' . $cache_file[$i]; // 图片相对路径
|
||||
@$file_size = getDistUsed(filesize($file_cache_path)); // 图片大小
|
||||
@$filen_name = $cache_file[$i]; // 图片名称
|
||||
$url = $config['imgurl'] . $config['path'] . 'suspic/' . $cache_file[$i]; // 图片网络连接
|
||||
$unlink_img = $config['domain'] . '/application/del.php?url=' . $url; // 图片删除连接
|
||||
// 缩略图文件
|
||||
$thumb_cache_file = $config['domain'] . '/libs/thumb.php?img=' . $file_path . '&width=300&height=300';
|
||||
$thumb_cache_file = $config['domain'] . '/application/thumb.php?img=' . $file_path . '&width=300&height=300';
|
||||
echo '
|
||||
<tr>
|
||||
<td>' . $i . '</td>
|
||||
<td><img data-toggle="lightbox" src="' . $thumb_cache_file . '" data-image="' . $thumb_cache_file . '" class="img-thumbnail" ></td>
|
||||
<td>' . $filen_name . '</td>
|
||||
<td>' . $height . '*' . $width . '</td>
|
||||
<td>' . $file_size . '</td>
|
||||
<td><a class="btn btn-mini" href="' . $url . '" target="_blank">查看原图</a></td>
|
||||
<td><a class="btn btn-mini btn-success" href="?reimg='.$filen_name.'">恢复图片</a></td>
|
||||
<td><a class="btn btn-mini btn-success" href="?reimg=' . $filen_name . '">恢复图片</a></td>
|
||||
<td><a class="btn btn-mini btn-danger" href="' . $unlink_img . '" target="_blank">删除图片</a></td>
|
||||
</tr>
|
||||
';
|
||||
@@ -253,7 +280,7 @@ if(isset($_GET['reimg'])){
|
||||
echo '
|
||||
<span class="label label-primary label-outline">总数:' . $cache_num . '</span>
|
||||
<form action="' . $_SERVER['PHP_SELF'] . '" method="post">
|
||||
<input type="hidden" name="delDir" value="/cache/" readonly="">
|
||||
<input type="hidden" name="delDir" value="/suspic/" readonly="">
|
||||
<button class="btn btn-danger btn-mini" ">删除全部违规图片</button>
|
||||
</form>
|
||||
';
|
||||
@@ -263,11 +290,22 @@ if(isset($_GET['reimg'])){
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<form class="form-inline" action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<span class="label label-badge label-primary label-outline">已缓存<?php echo getFileNumber(APP_ROOT . $config['path'] . 'cache/'); ?>个文件
|
||||
缓存占用<?php echo getDistUsed(getDirectorySize(APP_ROOT . $config['path'] . 'cache/')); ?>
|
||||
<button type="submit" class="btn btn-mini btn-primary" name="delDir" value="cache/" onClick="return confirm('确认要删除?\n* 删除文件夹后将无法恢复!');">删除缓存</button></span>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<link href="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet">
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/chart/zui.chart.min.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/chart/excanvas.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
// 动态显示要删除的图片
|
||||
var oBtn = document.getElementById('del');
|
||||
@@ -293,7 +331,37 @@ if(isset($_GET['reimg'])){
|
||||
forceParse: 0,
|
||||
format: "yyyy/mm/dd/"
|
||||
});
|
||||
|
||||
// 图表格式化
|
||||
// 使用jquery方法获取 2d context 对象
|
||||
var ctx = $("#myChart").get(0).getContext("2d");
|
||||
|
||||
// 使用$.zui.Chart构造Chart实例
|
||||
var myNewChart = new $.zui.Chart(ctx);
|
||||
|
||||
var data = {
|
||||
// labels 数据包含依次在X轴上显示的文本标签
|
||||
labels: [<?php echo rtrim($chart_date, ','); ?>],
|
||||
// labels: ["11月7日", "11月6日", "11月5日", "11月4日", "11月3日", "11月2日", "11月1日", "10月31日", "10月30日", "10月29日", "10月28日", "10月27日"],
|
||||
datasets: [{
|
||||
// 数据集名称,会在图例中显示
|
||||
label: "上传",
|
||||
color: "green",
|
||||
// 数据集
|
||||
data: [<?php echo rtrim($chart_number, ','); ?>]
|
||||
}, {
|
||||
label: "占用",
|
||||
color: "red",
|
||||
data: [<?php echo rtrim($chart_disk, ','); ?>]
|
||||
}]
|
||||
};
|
||||
|
||||
var options = {}; // 图表配置项,可以留空来使用默认的配置
|
||||
|
||||
var myLineChart = $("#myChart").lineChart(data, options);
|
||||
|
||||
|
||||
// Title
|
||||
document.title = "管理中心 - <?php echo $config['title']; ?>";
|
||||
</script>
|
||||
<?php require_once APP_ROOT . '/libs/footer.php';
|
||||
<?php require_once APP_ROOT . '/application/footer.php';
|
||||
@@ -2,8 +2,8 @@
|
||||
/*
|
||||
* 登录页面
|
||||
*/
|
||||
require_once 'function.php';
|
||||
require_once APP_ROOT . '/libs/header.php';
|
||||
require_once __DIR__.'/../application/function.php';
|
||||
require_once APP_ROOT . '/application/header.php';
|
||||
|
||||
|
||||
?>
|
||||
@@ -93,4 +93,4 @@ require_once APP_ROOT . '/libs/header.php';
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once APP_ROOT . '/libs/footer.php';
|
||||
require_once APP_ROOT . '/application/footer.php';
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
echo '<title> - EasyImage2.0</title>';
|
||||
require_once '../../libs/function.php';
|
||||
require_once APP_ROOT . '/libs/header.php';
|
||||
require_once '../../application/function.php';
|
||||
require_once APP_ROOT . '/application/header.php';
|
||||
require_once APP_ROOT . '/config/api_key.php';
|
||||
|
||||
// 如果关闭Api上传并且没有登录的情况下关闭测试接口
|
||||
@@ -10,7 +10,7 @@ if (!$config['apiStatus'] and !is_online()) {
|
||||
new $.zui.Messager("Api关闭,请登录", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
// 延时2s跳转
|
||||
window.setTimeout("window.location=\'/../libs/login.php \'",2000);
|
||||
window.setTimeout("window.location=\'/../application/login.php \'",2000);
|
||||
</script>');
|
||||
}
|
||||
|
||||
@@ -35,4 +35,4 @@ if (!$config['apiStatus'] and !is_online()) {
|
||||
<script>
|
||||
document.title = "API图片上传测试 - <?php echo $config['title']; ?>";
|
||||
</script>
|
||||
<?php require_once APP_ROOT . '/libs/footer.php';
|
||||
<?php require_once APP_ROOT . '/application/footer.php';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
require_once __DIR__ . './../libs/function.php';
|
||||
require_once APP_ROOT . '/api/libs/apiFunction.php';
|
||||
require_once APP_ROOT . '/libs/class.upload.php';
|
||||
require_once APP_ROOT . '/libs/WaterMask.php';
|
||||
require_once __DIR__ . './../application/function.php';
|
||||
require_once APP_ROOT . '/api/application/apiFunction.php';
|
||||
require_once APP_ROOT . '/application/class.upload.php';
|
||||
require_once APP_ROOT . '/application/WaterMask.php';
|
||||
require_once APP_ROOT . '/config/api_key.php';
|
||||
|
||||
// 检查是否开启api上传
|
||||
@@ -109,7 +109,7 @@ if ($handle->uploaded) {
|
||||
// 压缩图片 后压缩模式,不影响前台输出速度
|
||||
if (!isAnimatedGif($handle->file_dst_pathname))
|
||||
if ($config['compress']) {
|
||||
require '../libs/compress/Imagick/class.Imgcompress.php';
|
||||
require '../application/compress/Imagick/class.Imgcompress.php';
|
||||
$img = new Imgcompress($handle->file_dst_pathname, 1);
|
||||
$img->compressImg($handle->file_dst_pathname);
|
||||
// 释放
|
||||
|
||||
119
application/chart.php
Executable file
119
application/chart.php
Executable file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/function.php';
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*/
|
||||
|
||||
// 获取最近一周,一个月,一年 https://www.cnblogs.com/-mrl/p/7680700.html
|
||||
function getLatelyTime($type = '')
|
||||
{
|
||||
$now = time();
|
||||
$result = [];
|
||||
if ($type == 'week') {
|
||||
//最近一周
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
$result[] = date('Y/m/d/', strtotime('-' . $i . ' day', $now));
|
||||
}
|
||||
} elseif ($type == 'month') {
|
||||
//最近一个月
|
||||
for ($i = 0; $i < 30; $i++) {
|
||||
$result[] = date('Y/m/d/', strtotime('-' . $i . ' day', $now));
|
||||
}
|
||||
} elseif ($type == 'year') {
|
||||
//最近一年
|
||||
for ($i = 0; $i < 12; $i++) {
|
||||
$result[] = date('Y/m/', strtotime('-' . $i . ' month', $now));
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
$chart_total_fileName = 'total_chart_' . md5_file(APP_ROOT . '/config/config.php'); // 以config.php文件的md5命名
|
||||
$total_contents = APP_ROOT . $config['path']; // 获取用户自定义的上传目录
|
||||
$chart_total_file = $total_contents . 'cache/total_chart_' . $chart_total_fileName . '.php'; // 文件绝对目录
|
||||
|
||||
function write_chart_total()
|
||||
{
|
||||
global $total_contents;
|
||||
global $chart_total_file;
|
||||
|
||||
$count_day = getLatelyTime('month');
|
||||
|
||||
for ($i = 0; $i < count($count_day); $i++) {
|
||||
// 统计每日上传数量
|
||||
$count_contents['chart_data'][] = [$count_day[$i] => getFileNumber($total_contents . $count_day[$i])];
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($count_day); $i++) {
|
||||
// 统计每日占用空间
|
||||
$count_contents['chart_disk'][] = [$count_day[$i] => getDirectorySize($total_contents . $count_day[$i])];
|
||||
}
|
||||
|
||||
$count_contents['total_time'] = date('Y-m-d H:i:s'); // 统计时间
|
||||
$count_contents['date'] = date('Ymd'); // 校对时间
|
||||
|
||||
$count_contents = json_encode($count_contents, true); // serialize存储文件
|
||||
file_put_contents($chart_total_file, $count_contents); // 存储文件
|
||||
}
|
||||
|
||||
function read_chart_total()
|
||||
{
|
||||
global $chart_total_file;
|
||||
|
||||
if (is_file($chart_total_file)) {
|
||||
|
||||
$chart_total_file = file_get_contents($chart_total_file);
|
||||
$chart_total_file = json_decode($chart_total_file, true);
|
||||
|
||||
|
||||
if ($chart_total_file['date'] !== date('Ymd')) {
|
||||
write_chart_total();
|
||||
} else {
|
||||
for ($i = 0; $i < count($chart_total_file['chart_data']); $i++) {
|
||||
// 读取每日上传数量
|
||||
foreach ($chart_total_file['chart_data'][$i] as $key => $value) {
|
||||
$chart_data_date[] = '"' . $key . '" ,';
|
||||
$chart_data_num[] = '"' . $value . '" ,';
|
||||
//echo $key . '<br/>';
|
||||
//echo $value . '<br/>';
|
||||
}
|
||||
foreach ($chart_total_file['chart_disk'][$i] as $value) {
|
||||
$value = round($value / 1024 / 1024, 2);
|
||||
|
||||
$chart_total_disk[] = '"' . $value . '" ,';
|
||||
}
|
||||
}
|
||||
|
||||
return array('date' => $chart_data_date, 'number' => $chart_data_num, 'disk' => $chart_total_disk,'total_time'=>$chart_total_file['total_time']);
|
||||
}
|
||||
} else {
|
||||
write_chart_total();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
switch ($name) {
|
||||
case 'date':
|
||||
return $chart_data_date;
|
||||
break;
|
||||
case 'number':
|
||||
return $chart_data_num;
|
||||
case 'disk':
|
||||
return $chart_total_disk;
|
||||
break;
|
||||
default:
|
||||
return $chart_data_date;
|
||||
}
|
||||
*/
|
||||
}
|
||||
/*
|
||||
|
||||
$char_data = read_chart_total();
|
||||
$chart_date = $char_data['date'];
|
||||
$chart_number = $char_data['number'];
|
||||
$chart_disk = $char_data['disk'];
|
||||
var_dump($char_data['disk']);
|
||||
var_dump($char_data['number']);
|
||||
|
||||
*/
|
||||
@@ -90,8 +90,12 @@ class Thumb{
|
||||
# 创建新的背景画布
|
||||
if($height>=$thumb_h){
|
||||
$thumb=imagecreatetruecolor($width,$thumb_h);
|
||||
@imagealphablending($thumb, false); //这里很重要,意思是不合并颜色,直接用$img图像颜色替换,包括透明色;2-1
|
||||
@imagesavealpha($thumb, true); //这里很重要,意思是不要丢了$thumb图像的透明色;2-2 EasyImage修改
|
||||
}else{
|
||||
$thumb=imagecreatetruecolor($width,$height);
|
||||
@imagealphablending($thumb, false); //这里很重要,意思是不合并颜色,直接用$img图像颜色替换,包括透明色;2-1
|
||||
@imagesavealpha($thumb, true); //这里很重要,意思是不要丢了$thumb图像的透明色;2-2 EasyImage修改
|
||||
$thumb_h=$height;
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ class getVerson
|
||||
|
||||
public function readJson()
|
||||
{
|
||||
if (file_exists(__DIR__ . '/verson.json')) {
|
||||
$file = fopen(__DIR__ . '/verson.json', 'r');
|
||||
$test = fread($file, filesize(__DIR__ . '/verson.json'));
|
||||
if (file_exists(__DIR__ . '/../i/cache/verson.json')) {
|
||||
$file = fopen(__DIR__ . '/../i/cache/verson.json', 'r');
|
||||
$test = fread($file, filesize(__DIR__ . '/../i/cache/verson.json'));
|
||||
$verson = json_decode($test, true);
|
||||
return $verson['tag_name'];
|
||||
fclose($file);
|
||||
@@ -32,7 +32,7 @@ class getVerson
|
||||
|
||||
$verson = $this->geturl($this->url);
|
||||
$verson = json_decode($verson, true);
|
||||
$file = fopen(__DIR__ . '/verson.json', 'w+');
|
||||
$file = fopen(__DIR__ . '/../i/cache/verson.json', 'w+');
|
||||
fwrite($file, $verson);
|
||||
fclose($file);
|
||||
}
|
||||
@@ -4,8 +4,8 @@
|
||||
* 压缩文件函数调用位置
|
||||
*/
|
||||
require_once __DIR__ . '/../function.php';
|
||||
require_once APP_ROOT . '/libs/compress/Imagick/class.Imgcompress.php';
|
||||
require_once APP_ROOT . '/libs/compress/TinyImg/TinyImg.php';
|
||||
require_once APP_ROOT . '/application/compress/Imagick/class.Imgcompress.php';
|
||||
require_once APP_ROOT . '/application/compress/TinyImg/TinyImg.php';
|
||||
require_once APP_ROOT . '/config/api_key.php';
|
||||
|
||||
/**
|
||||
@@ -14,7 +14,6 @@ require_once APP_ROOT . '/config/api_key.php';
|
||||
*/
|
||||
function compress($floder, $type = 'Imgcompress', $source = '')
|
||||
{
|
||||
global $tinyImag_key;
|
||||
global $config;
|
||||
ini_set('max_execution_time', '0'); // 脚本运行的时间(以秒为单位)0不限制
|
||||
|
||||
@@ -35,12 +34,12 @@ function compress($floder, $type = 'Imgcompress', $source = '')
|
||||
}
|
||||
|
||||
if ($type == 'TinyImg') {
|
||||
if (empty($tinyImag_key['TinyImag'])) {
|
||||
if (empty($config['TinyImag_key'])) {
|
||||
exit('请先申请TinyImag key并保存再试!');
|
||||
}
|
||||
$folder = '..' . $config['path'] . $source;
|
||||
$tinyImg = new TinyImg();
|
||||
$key = $tinyImag_key['TinyImag'];
|
||||
$key = $config['TinyImag_key'];
|
||||
$input = $folder; //这个文件夹下的文件会被压缩
|
||||
$output = $folder; //压缩的结果会被保存到这个文件夹中
|
||||
$tinyImg->compressImgsFolder($key, $input, $output);
|
||||
@@ -4,7 +4,7 @@
|
||||
* 压缩状态页面
|
||||
*/
|
||||
require_once 'header.php';
|
||||
require_once APP_ROOT . '/libs/compress/function.compress.php';
|
||||
require_once APP_ROOT . '/application/compress/function.compress.php';
|
||||
|
||||
// 检测登录
|
||||
if (!is_online()) {
|
||||
@@ -3,8 +3,7 @@
|
||||
/**
|
||||
* 删除文件页面
|
||||
*/
|
||||
require_once '../libs/header.php';
|
||||
require_once APP_ROOT . '/libs/function.php';
|
||||
require_once './header.php';
|
||||
echo '<div class="col-md-4 col-md-offset-4">
|
||||
<div id="title" style="margin: 10px;"></div>
|
||||
|
||||
@@ -22,18 +21,14 @@ if (empty($_REQUEST)) {
|
||||
<script>
|
||||
new $.zui.Messager("没有要删除的图片!", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
// 延时3.5s跳转
|
||||
// window.setTimeout("window.location=\'/../ \'",3500);
|
||||
</script>
|
||||
';
|
||||
header("refresh:3;url=".$config['domain']."");
|
||||
//header("refresh:3;url=".$config['domain']."");
|
||||
|
||||
} elseif (isset($_GET['url'])) {
|
||||
$img = $_GET['url'];
|
||||
echo '
|
||||
<div class="col-md-12">
|
||||
<hr />
|
||||
<div style="text-align:center;"><span class="label">图片属性:'.@getimagesize($img)[0].'px X '.@getimagesize($img)[1].'px</span></div>
|
||||
<a href="' . $img . '" target="_blank"><img src="' . $img . '" alt="简单图床-EasyImage" class="img-thumbnail"></a>
|
||||
</div>';
|
||||
}
|
||||
@@ -57,14 +52,14 @@ if (is_online()) {
|
||||
new $.zui.Messager("请登录后再删除", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
// 延时2s跳转
|
||||
// window.setTimeout("window.location=\'/../libs/login.php \'",2000);
|
||||
window.setTimeout("window.location=\'/../application/login.php \'",2000);
|
||||
</script>
|
||||
';
|
||||
header("refresh:2;url=".$config['domain']."/libs/login.php");
|
||||
//header("refresh:2;url=".$config['domain']."/application/login.php");
|
||||
}
|
||||
}
|
||||
|
||||
require_once APP_ROOT . '/libs/footer.php';
|
||||
require_once APP_ROOT . '/application/footer.php';
|
||||
?>
|
||||
<script>
|
||||
// 修改网页标题
|
||||
@@ -52,29 +52,27 @@
|
||||
NProgress.done();
|
||||
</script>
|
||||
<footer class="text-muted small col-md-12" style="text-align: center;margin-bottom: 10px"><?php if($config['ad_bot']){echo $config['ad_bot_info'];} ?>
|
||||
<p><?php echo $config['customize']; ?></p>
|
||||
<p><?php echo html_entity_decode($config['customize']); ?></p>
|
||||
<hr>
|
||||
<p><a href="/libs/terms.php" target="_blank">请勿上传违反中国政策的图片</a><i class="icon icon-smile"></i></p>
|
||||
<p><a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a><i class="icon icon-smile"></i></p>
|
||||
<div>
|
||||
<!-- 对话框触发按钮 -->
|
||||
<a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal">
|
||||
<i class="icon icon-qrcode"></i>二维码 </a>
|
||||
<a href="<?php echo $config['domain']; ?>/api/apiTest/" target="_blank"><i class="icon icon-key"></i>API </a>
|
||||
<?php
|
||||
if (is_online()) {
|
||||
echo '
|
||||
<a href='.$config['domain'].'/libs/list.php?date='.date('Y/m/d/').' target="_blank"><i class="icon icon-desktop"></i>管理 </a>
|
||||
<a href="' . $config['domain'] . '/api/api-web.php" target="_blank"><i class="icon icon-rocket"></i>快捷操作 </a>
|
||||
<a href="' . $config['domain'] . '/libs/logout.php" ><i class="icon icon-signout"></i>退出 </a>
|
||||
';
|
||||
if (is_online()) {
|
||||
// <a href="' . $config['domain'] . '/admin/admin.inc.php" target="_blank"><i class="icon icon-rocket"></i>设置 </a>
|
||||
// <a href="' . $config['domain'] . '/admin/index.php" target="_blank"><i class="icon icon-rocket"></i>快捷操作 </a>
|
||||
echo '<a href="' . $config['domain'] . '/application/logout.php" ><i class="icon icon-signout"></i>退出 </a>';
|
||||
} else {
|
||||
echo '<a href="' . $config['domain'] . '/libs/login.php" ><i class="icon icon-user"></i>登录 </a>';
|
||||
echo '<a href="' . $config['domain'] . '/application/login.php" ><i class="icon icon-user"></i>登录 </a>';
|
||||
} ?>
|
||||
</div>
|
||||
<?php echo 'Copyright © 2018-' . date('Y'); ?>
|
||||
<a href="https://img.545141.com/" target="_blank">EasyImage</a> By
|
||||
<a href="https://www.545141.com/902.html" target="_blank">Icret</a> Version:<a href="https://github.com/icret/EasyImages2.0" target="_blank"><?php echo $config['version']; ?></a>
|
||||
<a href="/libs/terms.php" target="_blank">DMCA</a>
|
||||
<a href="/admin/terms.php" target="_blank">DMCA</a>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../config/config.php';
|
||||
// 设置html为utf8
|
||||
@header('Content-Type:text/html;charset=utf-8');
|
||||
//将时区设置为中国·上海
|
||||
@ini_set('date.timezone', 'Asia/Shanghai');
|
||||
@date_default_timezone_set('Asia/Shanghai');
|
||||
// 修改内存限制 根据服务器配置选择,低于128M容易出现上传失败,你懂得图片挺占用内存的
|
||||
@ini_set('memory_limit', '512M');
|
||||
// 定义根目录
|
||||
@define('APP_ROOT', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')));
|
||||
// 判断当前的系统类型是否为windows
|
||||
@define('IS_WIN', strstr(PHP_OS, 'WIN') ? 1 : 0);
|
||||
|
||||
require_once APP_ROOT . '/config/config.php';
|
||||
|
||||
// 判断GIF图片是否为动态
|
||||
function isAnimatedGif($filename)
|
||||
@@ -89,7 +101,7 @@ function imgName()
|
||||
return trim(com_create_guid(), '{}');
|
||||
}
|
||||
|
||||
return sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
|
||||
return strtolower(sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)));
|
||||
}
|
||||
|
||||
switch ($style) {
|
||||
@@ -333,9 +345,10 @@ function urlHash($data, $mode)
|
||||
// 删除指定文件
|
||||
function getDel($url, $type)
|
||||
{
|
||||
|
||||
global $config;
|
||||
// url本地化
|
||||
$url = htmlspecialchars(parse_url($url)['path']); // 过滤html 获取url path
|
||||
//$url = htmlspecialchars(parse_url($url)['path']); // 过滤html 获取url path
|
||||
$url = htmlspecialchars(str_replace($config['imgurl'], '', $url)); // 过滤html 获取url path
|
||||
$url = urldecode(trim($url));
|
||||
|
||||
if ($type == 'url') {
|
||||
@@ -401,6 +414,12 @@ function is_online()
|
||||
*/
|
||||
function checkEnv($mode)
|
||||
{
|
||||
// 初始化安装
|
||||
if (!file_exists(APP_ROOT . '/install/install.lock') and file_exists(APP_ROOT . '/install/install.php')) {
|
||||
echo '<script type="text/javascript">window.location.href="' . get_whole_url('/') . '/install/index.php"</script>';
|
||||
exit;
|
||||
}
|
||||
|
||||
global $config;
|
||||
if ($mode) {
|
||||
// 扩展检测
|
||||
@@ -416,8 +435,7 @@ function checkEnv($mode)
|
||||
}
|
||||
}
|
||||
// 检测是否更改默认域名
|
||||
$url = preg_replace('#^(http(s?))?(://)#', '', 'http://192.168.2.100');
|
||||
if (strstr($url, $_SERVER['HTTP_HOST'])) {
|
||||
if (strstr('localhost', $_SERVER['HTTP_HOST'])) {
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("请修改默认域名,可能会导致图片访问异常!", {type: "black" // 定义颜色主题
|
||||
@@ -434,7 +452,7 @@ function checkEnv($mode)
|
||||
</script>
|
||||
';
|
||||
}
|
||||
// 检查环境配置
|
||||
// 上部内容
|
||||
if (!is_file(APP_ROOT . '/config/EasyIamge.lock')) {
|
||||
echo '
|
||||
<div class="modal fade" id="myModal-1">
|
||||
@@ -446,64 +464,55 @@ function checkEnv($mode)
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h4>说明:</h4>
|
||||
<h5>1. 建议使用
|
||||
<font color="red">PHP7.0</font>及以上版本;</h5>
|
||||
<h5>2. 上传失败大部分是由于
|
||||
<font color="red">upload_max_filesize、post_max_size、文件权限</font>设置不正确;</h5>
|
||||
<h5>3. 本程序用到
|
||||
<font color="red">Fileinfo、iconv、zip、mbstring、openssl</font>扩展,如果缺失会导致无法访问管理面板以及上传/删除图片。</h5>
|
||||
<h5>4.
|
||||
<font color="red">zip</font>扩展不是必须的,但会影响文件压缩(不会在首页中检测)。</h5>
|
||||
<h5>5. 上传后必须修改
|
||||
<font color="red">config.php</font>的位置:
|
||||
<font color="red">domain</font>当前网站域名,
|
||||
<font color="red">imgurl</font>当前图片域名,
|
||||
<font color="red">password</font>登录管理密码!</h5>
|
||||
<h5>1. 建议使用<font color="red">PHP7.0</font>及以上版本;</h5>
|
||||
<h5>2. 上传失败大部分是由于<font color="red">upload_max_filesize、post_max_size、文件权限</font>设置不正确;</h5>
|
||||
<h5>3. 本程序用到<font color="red">Fileinfo、GD、openssl</font>扩展,如果缺失会导致无法访问管理面板以及上传/删除图片。</h5>
|
||||
<h5>4. 上传后必须修改<font color="red">当前网站域名、当前图片域名,登录管理密码!</font></h5>
|
||||
<hr />
|
||||
<h4>EasyImage2.0 基础检测:</h4>
|
||||
当前PHP版本:<font color="green">' . phpversion() . '</font>';
|
||||
$quanxian = substr(base_convert(fileperms("file.php"), 10, 8), 3);
|
||||
if (!is_executable('file.php') || $quanxian != '755') {
|
||||
echo '
|
||||
<br/>
|
||||
<font color="red">上传文件权限错误(当前权限:' . $quanxian . '),<br />
|
||||
<b>windows可以无视,linux使用 chmod -R 0755 /所在目录/* 赋予权限</font>';
|
||||
} else {
|
||||
echo '
|
||||
<br/>
|
||||
<font color="green">当前文件可执行</font>';
|
||||
}
|
||||
echo '
|
||||
<br />
|
||||
<font color="green">upload_max_filesize</font>PHP上传最大值:' . ini_get('upload_max_filesize');
|
||||
echo '
|
||||
<br />
|
||||
<font color="green">post_max_size</font>PHP POST上传最大值:' . ini_get('post_max_size') . '
|
||||
<br />';
|
||||
$expand = array('fileinfo', 'iconv', 'gd', 'zip', 'mbstring', 'openssl',);
|
||||
当前PHP版本:<font style="color:green">' . phpversion() . '</font><br/>';
|
||||
|
||||
echo '<font color="green">upload_max_filesize</font> - PHP上传最大值:' . ini_get('upload_max_filesize');
|
||||
echo '<br /><font color="green">post_max_size</font> - POST上传最大值:' . ini_get('post_max_size') . '<br />';
|
||||
// 扩展检测
|
||||
$expand = array('fileinfo', 'gd', 'openssl',);
|
||||
foreach ($expand as $val) {
|
||||
if (extension_loaded($val)) {
|
||||
echo '
|
||||
<font color="green">' . $val . "</font>- 已安装
|
||||
<font color="green">' . $val . "</font> - 已安装
|
||||
<br />";
|
||||
} else {
|
||||
echo "
|
||||
<script language='javascript'>alert('$val - 未安装')</script>";
|
||||
echo '
|
||||
<font color="red">' . $val . "- 未安装</font>
|
||||
<font color="red">' . $val . " - 未安装</font>
|
||||
<br />";
|
||||
}
|
||||
}
|
||||
echo '
|
||||
<hr/>以下是当前PHP所有已安装扩展:
|
||||
<br/>';
|
||||
foreach (get_loaded_extensions() as $val) {
|
||||
// 文件权限检测
|
||||
$quanxian = substr(base_convert(fileperms("file.php"), 10, 8), 3);
|
||||
if (IS_WIN) {
|
||||
echo '
|
||||
<font color="green">' . $val . '</font>,';
|
||||
<font style="color:green">file.php 文件可执行</font><br/>
|
||||
<font style="color:green">/i 目录可读写</font><br/>
|
||||
';
|
||||
}
|
||||
if (!IS_WIN) {
|
||||
if ($quanxian !== '755' and !is_writable(APP_ROOT . '/i/')) {
|
||||
echo '
|
||||
<p style="color:red">file.php 文件不可执行</font>><br/>
|
||||
<p style="color:red">/i 目录可读写</font>><br/>
|
||||
';
|
||||
} else {
|
||||
echo '
|
||||
<font style="color:green">file.php 文件可执行</font><br/>
|
||||
<font style="color:green">/i 目录可读写</font><br/>
|
||||
';
|
||||
}
|
||||
}
|
||||
echo '</div>
|
||||
<div class="modal-footer">
|
||||
<p>安装环境检测弹窗只会第一次打开时展示,会在config目录下自动生成EasyIamge.lock,如需再次展示或更换空间请自行删除EasyIamge.lock!刷新后此提示框消失。</p>
|
||||
<p style="font-weight: bold">安装环境检测弹窗只会第一次打开时展示,会在config目录下自动生成EasyIamge.lock,如需再次展示或更换空间请自行删除EasyIamge.lock!刷新后此提示框消失。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -552,7 +561,7 @@ function getVersion()
|
||||
global $config;
|
||||
|
||||
if ($config['checkEnv']) {
|
||||
require_once APP_ROOT . '/libs/class.version.php';
|
||||
require_once APP_ROOT . '/application/class.version.php';
|
||||
// 获取版本地址
|
||||
$url = "https://api.github.com/repositories/188228357/releases/latest";
|
||||
$getVersion = new getVerson($url);
|
||||
@@ -603,9 +612,13 @@ function deldir($dir)
|
||||
// curl访问网站并返回解码过的json信息
|
||||
function get_json($img)
|
||||
{
|
||||
global $moderatecontent;
|
||||
global $config;
|
||||
|
||||
$url = $moderatecontent['url'] . $moderatecontent['key'] . '&url=' . $img;
|
||||
if (empty($config['moderatecontent_key'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$url = 'https://api.moderatecontent.com/moderate/?key=' . $config['moderatecontent_key'] . '&url=' . $img;
|
||||
$headerArray = array("Content-type:application/json;", "Accept:application/json");
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
@@ -620,19 +633,19 @@ function get_json($img)
|
||||
return $output;
|
||||
}
|
||||
// 检查图片是否违规
|
||||
function checkImg($imageUrl, $mode = true)
|
||||
function checkImg($imageUrl)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$response = get_json($imageUrl);
|
||||
if ($response['rating_index'] == 3 or $response['predictions']['adult'] > $config['checkImg_value']) { // (1 = everyone, 2 = teen, 3 = adult)
|
||||
$old_path = APP_ROOT . parse_url($imageUrl)['path']; // 提交网址中的文件路径 /i/2021/10/29/p8vypd.png
|
||||
//$name = date('Y_m_d').'_'.basename($imageUrl); // 文件名 p8vypd.png
|
||||
//$old_path = APP_ROOT . parse_url($imageUrl)['path']; // 提交网址中的文件路径 /i/2021/10/29/p8vypd.png
|
||||
$old_path = APP_ROOT . str_replace($config['imgurl'], '', $imageUrl);; // 提交网址中的文件路径 /i/2021/10/29/p8vypd.png
|
||||
$name = date('Y_m_d') . '_' . basename($imageUrl); // 文件名 2021_10_30_p8vypd.png
|
||||
$new_path = APP_ROOT . $config['path'] . 'cache/' . $name; // 新路径含文件名
|
||||
$cache_dir = APP_ROOT . $config['path'] . 'cache/'; // cache路径
|
||||
$new_path = APP_ROOT . $config['path'] . 'suspic/' . $name; // 新路径含文件名
|
||||
$cache_dir = APP_ROOT . $config['path'] . 'suspic/'; // suspic路径
|
||||
|
||||
if (is_dir($cache_dir)) { // 创建cache目录并移动
|
||||
if (is_dir($cache_dir)) { // 创建suspic目录并移动
|
||||
rename($old_path, $new_path);
|
||||
} else {
|
||||
mkdir($cache_dir, 0777, true);
|
||||
@@ -646,8 +659,114 @@ function re_checkImg($name)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$now_file = str_replace('_', '/', $name); // 当前图片相对位置 2021/10/30/p8vypd.png
|
||||
$now_path_file = APP_ROOT . $config['path'] . 'cache/' . $name; // 当前图片绝对位置 */i/cache/2021_10_30_p8vypd.png
|
||||
$to_file = APP_ROOT . $config['path'] . $now_file; // 还原图片的绝对位置 */i/2021/10/30/p8vypd.png
|
||||
$fileToPath = str_replace('_', '/', $name); // 将图片名称还原为带路径的名称,eg:2021_11_03_pbmn1a.jpg =>2021/11/03/pbmn1a.jpg
|
||||
$now_path_file = APP_ROOT . $config['path'] . 'suspic/' . $name; // 当前图片绝对位置 */i/suspic/2021_10_30_p8vypd.png
|
||||
$to_file = APP_ROOT . $config['path'] . $fileToPath; // 要还原图片的绝对位置 */i/2021/10/30/p8vypd.png
|
||||
rename($now_path_file, $to_file);
|
||||
}
|
||||
// 创建缩略图
|
||||
function creat_cache_images($imgName)
|
||||
{
|
||||
require_once __DIR__ . '/class.thumb.php';
|
||||
global $config;
|
||||
|
||||
$old_img_path = APP_ROOT . config_path() . $imgName; // 获取要创建缩略图文件的绝对路径
|
||||
$cache_path = APP_ROOT . $config['path'] . 'cache/'; // cache目录的绝对路径
|
||||
if (!isAnimatedGif($old_img_path)) { // 仅针对非gif创建图片缩略图
|
||||
if (is_dir($cache_path)) {
|
||||
$new_imgName = APP_ROOT . $config['path'] . 'cache/' . date('Y_m_d') . '_' . $imgName; // 缩略图缓存的绝对路径
|
||||
Thumb::out($old_img_path, $new_imgName, 300, 300); // 保存缩略图
|
||||
} else {
|
||||
mkdir($cache_path, 0777, true); // 创建cache目录
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据请求网址路径返回缩略图网址
|
||||
function back_cache_images($url)
|
||||
{
|
||||
global $config;
|
||||
$cache_image_file = str_replace($config['imgurl'], '', $url);
|
||||
|
||||
if (isAnimatedGif(APP_ROOT . $cache_image_file)) { // 仅读取非gif的缩略图
|
||||
return $url; // 如果是gif则直接返回url
|
||||
} else {
|
||||
$cache_image_file = str_replace($config['path'], '', $cache_image_file); // 将网址中的/i/去除
|
||||
$cache_image_file = str_replace('/', '_', $cache_image_file); // 将文件的/转换为_
|
||||
$isFile = APP_ROOT . $config['path'] . 'cache/' . $cache_image_file; // 缓存文件的绝对路径
|
||||
if (file_exists($isFile)) { // 缓存文件是否存在
|
||||
return $config['imgurl'] . $config['path'] . 'cache/' . $cache_image_file; // 存在则返回缓存文件
|
||||
} else {
|
||||
return $url; // 不存在直接返回url
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前页面完整URL地址
|
||||
* 返回 http://localhost/ww/index.php
|
||||
* https://www.php.cn/php-weizijiaocheng-28181.html
|
||||
* $search 返回指定搜索文字之前的内容(不含搜索文字)
|
||||
*/
|
||||
|
||||
function get_whole_url($search = null)
|
||||
{
|
||||
$sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
|
||||
$php_self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
||||
$path_info = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
|
||||
$relate_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $php_self . (isset($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : $path_info);
|
||||
$whole_domain = $sys_protocal . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . $relate_url;
|
||||
if ($search) {
|
||||
// 返回指定符号之前
|
||||
return substr($whole_domain, 0, strrpos($whole_domain, $search));
|
||||
} else {
|
||||
return $whole_domain;
|
||||
}
|
||||
}
|
||||
|
||||
//写入
|
||||
function cache_write($filename, $values, $var = 'config', $format = false)
|
||||
{
|
||||
$cachefile = $filename;
|
||||
$cachetext = "<?php\r\n" . '$' . $var . '=' . arrayeval($values, $format) . ";";
|
||||
return writefile($cachefile, $cachetext);
|
||||
}
|
||||
|
||||
//数组转换成字串
|
||||
function arrayeval($array, $format = false, $level = 0)
|
||||
{
|
||||
$space = $line = '';
|
||||
if (!$format) {
|
||||
for ($i = 0; $i <= $level; $i++) {
|
||||
$space .= "\t";
|
||||
}
|
||||
$line = "\n";
|
||||
}
|
||||
$evaluate = 'Array' . $line . $space . '(' . $line;
|
||||
$comma = $space;
|
||||
foreach ($array as $key => $val) {
|
||||
$key = is_string($key) ? '\'' . addcslashes($key, '\'\\') . '\'' : $key;
|
||||
$val = !is_array($val) && (!preg_match('/^\-?\d+$/', $val) || strlen($val) > 12) ? '\'' . addcslashes($val, '\'\\') . '\'' : $val;
|
||||
if (is_array($val)) {
|
||||
$evaluate .= $comma . $key . '=>' . arrayeval($val, $format, $level + 1);
|
||||
} else {
|
||||
$evaluate .= $comma . $key . '=>' . $val;
|
||||
}
|
||||
$comma = ',' . $line . $space;
|
||||
}
|
||||
$evaluate .= $line . $space . ')';
|
||||
return $evaluate;
|
||||
}
|
||||
|
||||
//写入文件
|
||||
function writefile($filename, $writetext, $openmod = 'w')
|
||||
{
|
||||
if (false !== $fp = fopen($filename, $openmod)) {
|
||||
flock($fp, 2);
|
||||
fwrite($fp, $writetext);
|
||||
fclose($fp);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
80
application/header.php
Executable file
80
application/header.php
Executable file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/function.php';
|
||||
require_once APP_ROOT.'/application/total_files.php';
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><?php echo $config['title']; ?></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="keywords" content="<?php echo $config['keywords']; ?>" />
|
||||
<meta name="description" content="<?php echo $config['description']; ?>" />
|
||||
<link rel="shortcut icon" href="<?php echo $config['domain']; ?>/favicon.ico" type="image/x-icon" />
|
||||
<link rel="dns-prefetch" href="<?php echo $config['imgurl']; ?>" />
|
||||
<link rel="dns-prefetch" href="<?php echo $config['static_cdn_url']; ?>" />
|
||||
<link href="<?php static_cdn(); ?>/public/static/zui/css/zui.min.css?v1.9.2" rel="stylesheet">
|
||||
<link href="<?php static_cdn(); ?>/public/static/zui/lib/uploader/zui.uploader.min.css?v1.9.2" rel="stylesheet">
|
||||
<link href="<?php static_cdn(); ?>/public/static/nprogress.min.css?v0.2.0" rel="stylesheet">
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/jquery/jquery-3.4.1.min.js?v3.4.1"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/js/zui.min.js?v1.9.2"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/uploader/zui.uploader.min.js?v1.9.2"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/qrcode.min.js?v2.0"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/hm.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/clipboard/clipboard.min.js?vv1.5.5"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/nprogress.min.js"></script>
|
||||
<style>
|
||||
.uploader-files {
|
||||
min-height: 160px;
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
@media screen and (min-width:960px) {
|
||||
.listNum img {
|
||||
width: 268px;
|
||||
height: 268px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="container">
|
||||
<?php if ($config['ad_top']) {
|
||||
echo $config['ad_top_info'];
|
||||
} ?>
|
||||
<div class="md-lg-12 header-dividing">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="<?php echo getActive('index'); ?>">
|
||||
<a href="<?php echo $config['domain']; ?>/index.php">
|
||||
<i class="icon icon-home"> 首页</i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php echo getActive('list'); ?>">
|
||||
<a href="<?php echo $config['domain']; ?>/application/list.php?date=<?php echo date('Y/m/d/') ?>&num=<?php echo $config['listNumber']; ?>">
|
||||
<i class="icon icon-list"> 广场</i>
|
||||
<span class="label label-badge label-success">
|
||||
<?php echo getFileNumber(APP_ROOT . config_path()); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
if (is_online()) {
|
||||
echo '
|
||||
<li class="' . getActive('admin.inc') . '";>
|
||||
<a href="' . $config['domain'] . '/admin/admin.inc.php' . '">
|
||||
<i class="icon icon-rocket"> 图床设置</i>
|
||||
</a>
|
||||
<li>
|
||||
<a href="' . $config['domain'] . '/admin/index.php' . '">
|
||||
<i class="icon icon-rocket"> 快捷操作</i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 顶部导航栏END -->
|
||||
311
application/list.php
Executable file
311
application/list.php
Executable file
@@ -0,0 +1,311 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/header.php';
|
||||
if (!$config['showSwitch'] and !is_online()) {
|
||||
echo '<div class="alert alert-info">管理员关闭了预览哦~~</div>';
|
||||
} else {
|
||||
$path = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/');
|
||||
$path = preg_replace("/^d{4}-d{2}-d{2} d{2}:d{2}:d{2}$/s", "", trim($path)); // 过滤非日期,删除空格
|
||||
|
||||
$keyNum = isset($_GET['num']) ? $_GET['num'] : $config['listNumber'];
|
||||
$keyNum = preg_replace("/[^0-9]/", "", trim($keyNum)); // 过滤非数字,删除空格
|
||||
|
||||
$fileArr = getFile(APP_ROOT . config_path($path)); // 统计当日上传数量
|
||||
|
||||
if ($fileArr[0]) {
|
||||
echo '<div class="cards-condensed listNum">';
|
||||
foreach ($fileArr as $key => $value) {
|
||||
if ($key < $keyNum) {
|
||||
$imgUrl = $config['imgurl'] . config_path($path) . $value;
|
||||
// 会导致速度变慢
|
||||
// $re_img = str_replace($config['imgurl'], '', $imgUrl); // 图片相对路径 /i/2021/11/03/hg82t4.jpg
|
||||
// <p>' . @getimagesize($imgUrl)[0] . 'x' . @getimagesize($imgUrl)[1] . 'px ' . getDistUsed(filesize(APP_ROOT . $re_img)) . '</p>
|
||||
if (is_online()) {
|
||||
echo '
|
||||
<div class="col-md-4 col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<img data-toggle="lightbox" data-image="' . back_cache_images($imgUrl) . '" src="../public/images/loading.svg" alt="简单图床-EasyImage">
|
||||
<div class="caption" style="color:#145ccd " >
|
||||
<label>选择<input type="checkbox" style="zoom:120%;" id="url" name="checkbox" value="' . $imgUrl . '"></label>
|
||||
<a href="' . $imgUrl . '" target="_blank"><i class="icon icon-picture" title="打开原图"></i></a>
|
||||
<a href="' . $config['domain'] . '/application/del.php?url=' . $imgUrl . '" target="_blank" title="删除文件"><i class="icon icon-trash"></i></a>
|
||||
<a data-clipboard-demo="" data-clipboard-action="copy" data-clipboard-text="' . $imgUrl . '" title="复制文件"><i class="icon icon-copy"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
} else {
|
||||
echo '
|
||||
<div class="col-md-4 col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<img data-toggle="lightbox" data-image="' . back_cache_images($imgUrl) . '" src="../public/images/loading.svg" alt="简单图床-EasyImage">
|
||||
<div class="caption" style="color:#145ccd " >
|
||||
<a href="' . $imgUrl . '" target="_blank"><i class="icon icon-picture" title="打开原图"></i></a>
|
||||
<a href="' . $config['domain'] . '/application/del.php?url=' . $imgUrl . '" target="_blank" title="删除文件"><i class="icon icon-trash"></i></a>
|
||||
<a data-clipboard-demo="" data-clipboard-action="copy" data-clipboard-text="' . $imgUrl . '" title="复制文件"><i class="icon icon-copy"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
} else {
|
||||
|
||||
echo '<div class="alert alert-danger">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</div>';
|
||||
}
|
||||
}
|
||||
/*
|
||||
$yesterday = date("Y/m/d/", strtotime("-1 day"));
|
||||
// 昨日日期
|
||||
$todayUpload = getFileNumber(APP_ROOT . config_path());
|
||||
// 今日上传数量
|
||||
$yesterdayUpload = getFileNumber(APP_ROOT . $config['path'] . $yesterday);
|
||||
// 昨日上传数量
|
||||
|
||||
$spaceUsed = getDistUsed(disk_total_space(__DIR__) - disk_free_space(__DIR__));
|
||||
// 占用空间
|
||||
*/
|
||||
// 当前日期全部上传
|
||||
$allUploud = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/');
|
||||
$allUploud = getFileNumber(APP_ROOT . $config['path'] . $allUploud);
|
||||
@$httpUrl = array('date' => $path, 'num' => getFileNumber(APP_ROOT . config_path($path)));
|
||||
?>
|
||||
<style>
|
||||
/** 返回顶部*/
|
||||
* {
|
||||
list-style: none;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#rocket-to-top div {
|
||||
left: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 149px;
|
||||
}
|
||||
|
||||
#rocket-to-top .level-2 {
|
||||
background: url("../public/images/rocket_button_up.png") no-repeat scroll -149px 0 transparent;
|
||||
display: none;
|
||||
height: 250px;
|
||||
opacity: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#rocket-to-top .level-3 {
|
||||
background: none repeat scroll 0 0 transparent;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 150px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#rocket-to-top {
|
||||
background: url("../public/images/rocket_button_up.png") no-repeat scroll 0 0 transparent;
|
||||
cursor: default;
|
||||
display: block;
|
||||
height: 250px;
|
||||
margin: -125px 0 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 80%;
|
||||
width: 149px;
|
||||
z-index: 11;
|
||||
}
|
||||
</style>
|
||||
<script src="<?php static_cdn(); ?>/public/static/lazyload.js"></script>
|
||||
<link href="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet">
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8">
|
||||
<a href="list.php?<?php echo http_build_query($httpUrl); ?>"><span class="label label-info label-outline"> 当前<?php echo $allUploud; ?>张</span></a>
|
||||
<a href="list.php"><span class="label label-success label-outline">今日<?php echo read_total_json('todayUpload'); ?>张</span></a><a href="list.php?date=<?php echo date("Y/m/d/", strtotime("-1 day")) ?>"><span class="label label-danger label-outline">昨日<?php echo read_total_json('yestUpload'); ?>张</span></a>
|
||||
<?php for ($x = 2; $x <= 5; $x++) {
|
||||
/** 倒推日期显示上传图片 */ echo '<a href="list.php?date=' . date('Y/m/d/', strtotime("-{$x} day")) . '"> <span class="label label-danger label-outline"> ' . date('m月d日', strtotime("-{$x} day")) . '</a>';
|
||||
}
|
||||
if (is_online()) {
|
||||
echo '
|
||||
<div class="btn-group" style="padding:5px">
|
||||
<button class="btn btn-mini" type="button" onclick="opcheckboxed(\'checkbox\', \'checkall\')">全选</button>
|
||||
<button class="btn btn-mini" type="button" onclick="opcheckboxed(\'checkbox\', \'reversecheck\')">反选</button>
|
||||
<button class="btn btn-mini btn-primary" type="button" onclick="opcheckboxed(\'checkbox\', \'uncheckall\')">取消</button>
|
||||
<button class="btn btn-mini btn-danger" type="button" onclick="fun()">删除</button>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<form class="form-inline" action="list.php" method="get">
|
||||
<div class="form-group">
|
||||
<!--<label for="exampleInputInviteCode3">按日期</label>-->
|
||||
<input type="text" class="form-control form-date" value="<?php echo date('Y/m/d/'); ?>" name="date" readonly="">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">按日期</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 返回顶部 -->
|
||||
<div style="display: none;" id="rocket-to-top">
|
||||
<div style="opacity:0;display: block;" class="level-2"></div>
|
||||
<div class="level-3"></div>
|
||||
</div>
|
||||
<script>
|
||||
// 复制url
|
||||
var clipboardDemos = new ClipboardJS('[data-clipboard-demo]');
|
||||
clipboardDemos.on('success', function(e) {
|
||||
new $.zui.Messager("复制成功!", {
|
||||
type: "success" // 定义颜色主题
|
||||
}).show();
|
||||
});
|
||||
clipboardDemos.on('error', function(e) {
|
||||
console.error('Action:', e.action);
|
||||
console.error('Trigger:', e.trigger);
|
||||
showTooltip(e.trigger, fallbackMessage(e.action));
|
||||
});
|
||||
|
||||
// 取消/全选文件
|
||||
function opcheckboxed(objName, type) {
|
||||
var objNameList = document.getElementsByName(objName);
|
||||
if (null != objNameList) {
|
||||
for (var i = 0; i < objNameList.length; i++) {
|
||||
if (objNameList[i].checked == true) {
|
||||
if (type != 'checkall') { // 非全选
|
||||
objNameList[i].checked = false;
|
||||
}
|
||||
} else {
|
||||
if (type != 'uncheckall') { // 非取消全选
|
||||
objNameList[i].checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取所有的 checkbox 属性的 input标签
|
||||
function fun() {
|
||||
confirm('确认要删除?\n* 删除文件夹后将无法恢复!');
|
||||
obj = document.getElementsByName("checkbox");
|
||||
check_val = [];
|
||||
for (k in obj) {
|
||||
//判断复选框是否被选中
|
||||
if (obj[k].checked)
|
||||
//获取被选中的复选框的值
|
||||
check_val.push(obj[k].value);
|
||||
console.log(check_val);
|
||||
}
|
||||
$.post("./post_del.php", {
|
||||
'del_url_array': check_val
|
||||
},
|
||||
function(data) {
|
||||
if (data.search('success') > 0) {
|
||||
new $.zui.Messager("删除成功,请刷新浏览器;如果开启了CDN,请等待缓存失效!", {
|
||||
type: "success" // 定义颜色主题
|
||||
}).show();
|
||||
// 延时2秒刷新
|
||||
window.setTimeout(function() {
|
||||
window.location.reload();
|
||||
}, 1500)
|
||||
} else {
|
||||
new $.zui.Messager("文件不存在", {
|
||||
type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
// 返回顶部
|
||||
$(function() {
|
||||
var e = $("#rocket-to-top"),
|
||||
t = $(document).scrollTop(),
|
||||
n,
|
||||
r,
|
||||
i = !0;
|
||||
$(window).scroll(function() {
|
||||
var t = $(document).scrollTop();
|
||||
t == 0 ? e.css("background-position") == "0px 0px" ? e.fadeOut("slow") : i && (i = !1, $(".level-2").css("opacity", 1), e.delay(100).animate({
|
||||
marginTop: "-1000px"
|
||||
},
|
||||
"normal",
|
||||
function() {
|
||||
e.css({
|
||||
"margin-top": "-125px",
|
||||
display: "none"
|
||||
}),
|
||||
i = !0
|
||||
})) : e.fadeIn("slow")
|
||||
}),
|
||||
e.hover(function() {
|
||||
$(".level-2").stop(!0).animate({
|
||||
opacity: 1
|
||||
})
|
||||
},
|
||||
function() {
|
||||
$(".level-2").stop(!0).animate({
|
||||
opacity: 0
|
||||
})
|
||||
}),
|
||||
$(".level-3").click(function() {
|
||||
function t() {
|
||||
var t = e.css("background-position");
|
||||
if (e.css("display") == "none" || i == 0) {
|
||||
clearInterval(n),
|
||||
e.css("background-position", "0px 0px");
|
||||
return
|
||||
}
|
||||
switch (t) {
|
||||
case "0px 0px":
|
||||
e.css("background-position", "-298px 0px");
|
||||
break;
|
||||
case "-298px 0px":
|
||||
e.css("background-position", "-447px 0px");
|
||||
break;
|
||||
case "-447px 0px":
|
||||
e.css("background-position", "-596px 0px");
|
||||
break;
|
||||
case "-596px 0px":
|
||||
e.css("background-position", "-745px 0px");
|
||||
break;
|
||||
case "-745px 0px":
|
||||
e.css("background-position", "-298px 0px");
|
||||
}
|
||||
}
|
||||
if (!i) return;
|
||||
n = setInterval(t, 50),
|
||||
$("html,body").animate({
|
||||
scrollTop: 0
|
||||
},
|
||||
"slow");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
// 按日期浏览
|
||||
$(".form-date").datetimepicker({
|
||||
weekStart: 1,
|
||||
todayBtn: 1,
|
||||
autoclose: 1,
|
||||
todayHighlight: 1,
|
||||
startView: 2,
|
||||
minView: 2,
|
||||
forceParse: 0,
|
||||
format: "yyyy/mm/dd/"
|
||||
});
|
||||
// 更改网页标题
|
||||
document.title = "图床广场 今日上传<?php echo read_total_json('todayUpload'); ?>张 昨日<?php echo read_total_json('yestUpload'); ?>张 - <?php echo $config['title']; ?> "
|
||||
//懒加载
|
||||
var lazy = new Lazy({
|
||||
onload: function(elem) {
|
||||
console.log(elem)
|
||||
},
|
||||
delay: 300
|
||||
})
|
||||
</script>
|
||||
<?php require_once APP_ROOT . '/application/footer.php';
|
||||
@@ -3,7 +3,7 @@
|
||||
* 登录页面
|
||||
*/
|
||||
require_once 'function.php';
|
||||
require_once APP_ROOT . '/libs/header.php';
|
||||
require_once APP_ROOT . '/application/header.php';
|
||||
// 提交登录
|
||||
if (isset($_POST['password'])) {
|
||||
checkLogin();
|
||||
@@ -37,4 +37,4 @@ if (isset($_POST['password'])) {
|
||||
|
||||
<?php
|
||||
|
||||
require_once APP_ROOT . '/libs/footer.php';
|
||||
require_once APP_ROOT . '/application/footer.php';
|
||||
30
application/post_del.php
Executable file
30
application/post_del.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 删除文件页面
|
||||
*/
|
||||
require_once __DIR__ . '/function.php';
|
||||
|
||||
if (!is_online()) {
|
||||
exit('Not Logged!');
|
||||
}
|
||||
|
||||
$del_url_array = isset($_POST['del_url_array']) ? $_POST['del_url_array'] : exit;
|
||||
$del_num = count($del_url_array);
|
||||
for ($i = 0; $i < $del_num; $i++) {
|
||||
getDel($del_url_array[$i], 'url');
|
||||
}
|
||||
|
||||
$path = '/i/cache/';
|
||||
|
||||
if (deldir($path)) {
|
||||
echo '
|
||||
<script> new $.zui.Messager("删除成功!", {type: "success" // 定义颜色主题
|
||||
}).show();</script>';
|
||||
header("refresh:1;"); // 1s后刷新当前页面
|
||||
} else {
|
||||
echo '
|
||||
<script> new $.zui.Messager("删除失败!", {type: "danger" // 定义颜色主题
|
||||
}).show();</script>';
|
||||
header("refresh:1;"); // 1s后刷新当前页面
|
||||
}
|
||||
87
application/total_files.php
Executable file
87
application/total_files.php
Executable file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* 统计文件
|
||||
*
|
||||
* 递归函数实现遍历指定文件下的目录与文件数量
|
||||
* $dirname=指定目录,$dirnum=目录总数,$filen=文件总数
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../config/config.php';
|
||||
|
||||
$dirn = 0; //目录数
|
||||
$filen = 0; //文件数
|
||||
|
||||
//用来统计一个目录下的文件和目录的个数
|
||||
function total_files($file)
|
||||
{
|
||||
global $dirn;
|
||||
global $filen;
|
||||
$dir = opendir($file);
|
||||
while ($filename = readdir($dir)) {
|
||||
if ($filename != "." && $filename != "..") {
|
||||
$filename = $file . "/" . $filename;
|
||||
if (is_dir($filename)) {
|
||||
$dirn++;
|
||||
total_files($filename); //递归,就可以查看所有子目录
|
||||
} else {
|
||||
$filen++;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
$totalJsonName = strval(md5_file(APP_ROOT . '/config/config.php')); // 以config.php文件的md5命名
|
||||
|
||||
function creat_json() // 创建json文件
|
||||
{
|
||||
global $dirn;
|
||||
global $filen;
|
||||
global $totalJsonName;
|
||||
global $config;
|
||||
$total_file_path = APP_ROOT . $config['path'];
|
||||
total_files($total_file_path);
|
||||
$usage_space = getDistUsed(getDirectorySize(APP_ROOT . $config['path']));
|
||||
$todayUpload = getFileNumber(APP_ROOT . config_path()); // 今日上传数量
|
||||
$yestUpload = getFileNumber(APP_ROOT . $config['path'] . date("Y/m/d/", strtotime("-1 day"))); // 昨日上传数量
|
||||
|
||||
$totalJsonInfo = [
|
||||
'filename' => $totalJsonName, // 文件名称
|
||||
'date' => date('YmdH', strtotime('-1 hour')), // 识别日期格式
|
||||
'total_time' => date('Y-m-d H:i:s'), // 统计时间
|
||||
'dirnum' => $dirn, // 文件夹数量
|
||||
'filenum' => $filen, // 文件数量
|
||||
'usage_space' => $usage_space, // 占用空间
|
||||
'todayUpload' => $todayUpload, // 今日上传数量
|
||||
'yestUpload' => $yestUpload // 昨日上传数量
|
||||
];
|
||||
$totalJsonInfo = json_encode($totalJsonInfo, true);
|
||||
if (is_dir($total_file_path . 'cache/')) {
|
||||
$totalJsonFile = fopen($total_file_path . "cache/$totalJsonName.php", 'w+');
|
||||
fwrite($totalJsonFile, $totalJsonInfo);
|
||||
fclose($totalJsonFile);
|
||||
} else {
|
||||
mkdir($total_file_path . 'cache/', 0777, true); // 创建cache目录
|
||||
}
|
||||
}
|
||||
|
||||
function read_total_json($total) // 读取json文件
|
||||
{
|
||||
global $config;
|
||||
global $totalJsonFile;
|
||||
global $totalJsonName;
|
||||
|
||||
$totalJsonPath = APP_ROOT . $config['path'] . 'cache/' . $totalJsonName . '.php'; // 文件的路径
|
||||
|
||||
if (file_exists($totalJsonPath)) {
|
||||
$totalJsonFile = file_get_contents($totalJsonPath);
|
||||
$totalJsonFile = json_decode($totalJsonFile, true);
|
||||
if ($totalJsonFile['date'] !== date('YmdH', strtotime('-1 hour'))) {
|
||||
creat_json();
|
||||
}
|
||||
} else {
|
||||
creat_json();
|
||||
}
|
||||
|
||||
return $totalJsonFile[$total];
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* | 此文件用来存放各种key
|
||||
* | 2021-5-8 22:04:55
|
||||
* 此文件用来存放API Key
|
||||
* 2021-11-6 14:36:35
|
||||
*/
|
||||
|
||||
|
||||
@@ -14,21 +14,4 @@
|
||||
$tokenList = array(
|
||||
0 => '8337effca0ddfcd9c5899f3509b23657',
|
||||
1 => '1c17b11693cb5ec63859b091c5b9c1b2',
|
||||
);
|
||||
|
||||
$tinyImag_key = [//Api_Key
|
||||
// 填写 TinyImag Key 申请地址:https://tinypng.com/developers
|
||||
'TinyImag' => ''
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* moderatecontent key
|
||||
* 图片监黄 key 从 https://moderatecontent.com/ 获取key并填入/config/api_key.php的图片检查key
|
||||
*/
|
||||
$moderatecontent = array(
|
||||
'url' => 'https://api.moderatecontent.com/moderate/?key=',
|
||||
'key' => ''
|
||||
);
|
||||
189
config/config-sample.php
Executable file
189
config/config-sample.php
Executable file
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* EasyImage2.0 - 简单图床配置
|
||||
|
||||
* @author icret
|
||||
* @email lemonim@qq.com
|
||||
* @Github https://github.com/icret/easyImages2.0
|
||||
* QQ Group 623688684
|
||||
* @Last 2021-5-25 21:12:34
|
||||
|
||||
* 上传服务器后第一次打开会检查运行环境,请根据提示操作;
|
||||
* 检查环境仅会在第一开始开始出现,并在config目录下生成EasyImage.lock文件,如需再次查看请删除此文件。
|
||||
|
||||
* 敬请注意:本程序为开源程序,你可以使用本程序在任何的商业、非商业项目或者网站中。但请你务必保留代码中相关信息(页面logo和页面上必要的链接可以清除)
|
||||
* 本人仅为程序开源创作,如非法网站与本人无关,请勿用于非法用途
|
||||
* 请为本人博客(www.545141.com)加上网址链接,谢谢支持。作为开发者你可以对相应的后台功能进行扩展(增删改相应代码),但请保留代码中相关来源信息(例如:本人博客,邮箱等)
|
||||
* 如果因安装问题或其他问题可以给我发邮件。
|
||||
*
|
||||
* 配置分为两大区块 - 1.基础配置 2.图床配置
|
||||
*/
|
||||
|
||||
|
||||
/*---------------基础配置-------------------*/
|
||||
|
||||
// 设置html为utf8
|
||||
@header('Content-Type:text/html;charset=utf-8');
|
||||
//将时区设置为中国·上海
|
||||
@ini_set('date.timezone', 'Asia/Shanghai');
|
||||
@date_default_timezone_set('Asia/Shanghai');
|
||||
// 修改内存限制 根据服务器配置选择,低于128M容易出现上传失败,你懂得图片挺占用内存的
|
||||
@ini_set('memory_limit', '512M');
|
||||
// 定义根目录
|
||||
@define('APP_ROOT', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')));
|
||||
|
||||
|
||||
|
||||
|
||||
/*---------------图床配置-------------------*/
|
||||
|
||||
$config = array(
|
||||
// 网站标题
|
||||
'title' => '简单图床 - EasyImage',
|
||||
// 网站关键字
|
||||
'keywords' => '简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制',
|
||||
// 网站描述
|
||||
'description' => '简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序,最新html5自适应页面兼容手机电脑,上传后返回图片直链,markdown图片,论坛贴图bbscode链接,简单方便支持一键复制,支持多域名,api上传。',
|
||||
// 网站公告 为空则不显示
|
||||
'tips' => '本站仅做演示用,不定时清理图片,单文件≤5M,每次上传≤30张',
|
||||
/**
|
||||
* 网站域名与图片链接域名可以不同,比如A域名上传,可以返回B域名图片链接,A、B需绑定到同一空间下
|
||||
* 如果不变的话,下边2个填写成一样的!
|
||||
*/
|
||||
// 网站域名,末尾不加"/"
|
||||
'domain' => 'http://localhost',
|
||||
// 图片链接域名,末尾不加"/"
|
||||
'imgurl' => 'http://localhost',
|
||||
// 登录上传和后台管理密码,管理用户名为:admin
|
||||
'password' => 'admin@123',
|
||||
// 是否开启登录上传 开启:true 关闭:false
|
||||
'mustLogin' => false,
|
||||
// 是否开启API上传 开启:true 关闭:false
|
||||
'apiStatus' => false,
|
||||
/**
|
||||
* 存储路径 前后要加"/"
|
||||
* 可根据Apache/Nginx配置安全,参考:https://www.545141.com/981.html 或 README.md
|
||||
*/
|
||||
'path' => '/i/',
|
||||
/** 文件的命名方式 更改后不影响之前上传的
|
||||
* date 以上传时间 例:192704
|
||||
* unix 以Unix时间 例:1635074840
|
||||
* uniqid 基于以微秒计的当前时间 例:6175436c73418
|
||||
* guid 全球唯一标识符 例:6EDAD0CC-AB0C-4F61-BCCA-05FAD65BF0FA
|
||||
* md5 md5加密时间 例:3888aa69eb321a2b61fcc63520bf6c82
|
||||
* sha1 sha1加密微秒 例:654faac01499e0cb5fb0e9d78b21e234c63d842a
|
||||
* default 将上传时间+随机数转换为36进制 例:vx77yu
|
||||
*/
|
||||
'imgName' => 'default',
|
||||
// 最大上传限制 默认为5M 请使用工具转换Mb http://www.bejson.com/convert/filesize/
|
||||
'maxSize' => 5242880,
|
||||
// 每次最多上传图片数
|
||||
'maxUploadFiles' => 30,
|
||||
// 是否开启水印:0关闭,1文字水印,2图片水印 不能使用动态gif添加水印
|
||||
'watermark' => 1,
|
||||
// 水印文字内容
|
||||
'waterText' => 'img.545141.com',
|
||||
/**
|
||||
* 水印位置
|
||||
* 0:随机位置,在1-8之间随机选取一个位置
|
||||
* 1:顶部居左 2:顶部居中 3:顶部居右 4:左边居中
|
||||
* 5:图片中心 6:右边居中 7:底部居左 8:底部居中 9:底部居右
|
||||
*/
|
||||
'waterPosition' => 5,
|
||||
// 水印文字颜色 rgba 末尾为透明度0-127 0为不透明
|
||||
'textColor' => '47,79,79,0',
|
||||
// 水印文字大小
|
||||
'textSize' => 16,
|
||||
// 字体路径 如果想改变字体,请选择支持中文的 GB/2312 字体
|
||||
'textFont' => '/public/static/hkxzy.ttf',
|
||||
// 图片水印路径 支持GIF,JPG,BMP,PNG和PNG alpha
|
||||
'waterImg' => 'public/images/watermark.png',
|
||||
// 允许上传的图片扩展名
|
||||
'extensions' => "bmp,jpg,png,tif,gif,pcx,tga,svg,webp,jpeg,tga,svg,ico",
|
||||
/* 轻微有损压缩图片 开启:true 关闭:false
|
||||
* 此压缩有可能使图片变大!特别是小图片 也有一定概率改变图片方向
|
||||
* 开启后会增加服务器负担
|
||||
*/
|
||||
'compress' => false,
|
||||
// 转换图片为指定格式 可选:''|'png'|'jpeg'|'gif'|'bmp';默认值:''
|
||||
'imgConvert' => '',
|
||||
// 最大上传宽度
|
||||
'maxWidth' => 10240,
|
||||
// 最大上传高度
|
||||
'maxHeight' => 10240,
|
||||
// 允许上传的最小宽度
|
||||
'minWidth' => 5,
|
||||
// 允许上传的最小高度
|
||||
'minHeight' => 5,
|
||||
// 改变图片宽高 宽度和高度请设置 image_x image_y 开启:true 关闭:false 关闭下image_x和image_y设置不生效
|
||||
'imgRatio' => false,
|
||||
// 缩减的最大高度
|
||||
'image_x' => 1000,
|
||||
// 缩减的最大宽度
|
||||
'image_y' => 800,
|
||||
// 开启静态文件CDN 开启:true 关闭:false
|
||||
'static_cdn' => false,
|
||||
// 静态文件CDN加速网址 末尾不加 /
|
||||
'static_cdn_url' => '//cdn.jsdelivr.net/gh/icret/EasyImages2.0',
|
||||
// 开启顶部广告 开启:true 关闭:false
|
||||
'ad_top' => false,
|
||||
// 顶部广告内容 支持html
|
||||
'ad_top_info' => '
|
||||
<div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
||||
<!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
<a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a>
|
||||
</div>
|
||||
',
|
||||
// 开启底部广告 开启:true 关闭:false
|
||||
'ad_bot' => false,
|
||||
// 底部广告内容 支持html
|
||||
'ad_bot_info' => '
|
||||
<div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
||||
<!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
<a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a>
|
||||
</div>
|
||||
',
|
||||
// 开启游客预览(广场)开启:true 关闭:false
|
||||
'showSwitch' => true,
|
||||
// 默认预览数量,可在网址后填写参数实时更改预览数量 如:https://img.545141.com/application/list.php?num=3
|
||||
'listNumber' => 20,
|
||||
// 上传框底部自定义信息,仅支持html格式 可以放置统计代码 下面是举例:
|
||||
'customize' => '
|
||||
<!-- 统计代码-->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?5320b69f4f1caa9328dfada73c8e6a75";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- 自定义js举例:非img.545141.com跳转
|
||||
<img style="display:none" src=" " onerror=\'this.onerror=null;var currentDomain="img."+"545141." + "com"; var str1=currentDomain; str2="docu"+"ment.loca"+"tion.host"; str3=eval(str2) ;if( str1!=str3 ){ do_action = "loca" + "tion." + "href = loca" + "tion.href" + ".rep" + "lace(docu" +"ment"+".loca"+"tion.ho"+"st," + "currentDomain" + ")";eval(do_action) }\' />
|
||||
-->
|
||||
<!--自定义代码举例:打赏、QQ邮箱、QQ群 可删除
|
||||
<iframe src="https://img.545141.com/sponsor/index.html" style="overflow-x:hidden;overflow-y:hidden; border:0xp none #fff; min-height:240px; width:100%;" frameborder="0" scrolling="no"></iframe>
|
||||
<a target="_blank" href="https://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=cR0UHB4fGBwxAABfEh4c">
|
||||
<i class="icon icon-envelope-alt">联系邮箱 </i></span>
|
||||
</a>
|
||||
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=3feb4e8be8f1839f71e53bf2e876de36afc6889b2630c33c877d8df5a5583a6f">
|
||||
<i class="icon icon-qq">加入QQ群</i></span>
|
||||
</a>
|
||||
<a target="_blank" href="/master.zip"><i class="icon icon-download-alt">下载源码</i></a>
|
||||
-->
|
||||
',
|
||||
// PHP插件检测-安全设置检测-版本检测 开启:true 关闭:false
|
||||
'checkEnv' => true,
|
||||
/* 图片监黄 开启:true 关闭:false
|
||||
* 从 https://moderatecontent.com/ 获取key并填入/config/api_key.php的图片检查key
|
||||
* 开启后会受服务器到https://moderatecontent.com/ 速度影响,国内不建议开启!
|
||||
*/
|
||||
'checkImg' => false,
|
||||
// 设置是不良图片概率,概率越大准确率越高,
|
||||
'checkImg_value' => 50,
|
||||
// 当前版本
|
||||
'version' => '2.3.1'
|
||||
);
|
||||
@@ -1,187 +1,81 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* EasyImage2.0 - 简单图床配置
|
||||
|
||||
* @author icret
|
||||
* @email lemonim@qq.com
|
||||
* @Github https://github.com/icret/easyImages2.0
|
||||
* QQ Group 623688684
|
||||
* @Last 2021-5-25 21:12:34
|
||||
|
||||
* 上传服务器后第一次打开会检查运行环境,请根据提示操作;
|
||||
* 检查环境仅会在第一开始开始出现,并在config目录下生成EasyImage.lock文件,如需再次查看请删除此文件。
|
||||
|
||||
* 敬请注意:本程序为开源程序,你可以使用本程序在任何的商业、非商业项目或者网站中。但请你务必保留代码中相关信息(页面logo和页面上必要的链接可以清除)
|
||||
* 本人仅为程序开源创作,如非法网站与本人无关,请勿用于非法用途
|
||||
* 请为本人博客(www.545141.com)加上网址链接,谢谢支持。作为开发者你可以对相应的后台功能进行扩展(增删改相应代码),但请保留代码中相关来源信息(例如:本人博客,邮箱等)
|
||||
* 如果因安装问题或其他问题可以给我发邮件。
|
||||
*
|
||||
* 配置分为两大区块 - 1.基础配置 2.图床配置
|
||||
*/
|
||||
|
||||
|
||||
/*---------------基础配置-------------------*/
|
||||
|
||||
// 设置html为utf8
|
||||
@header('Content-Type:text/html;charset=utf-8');
|
||||
//将时区设置为中国·上海
|
||||
@ini_set('date.timezone', 'Asia/Shanghai');
|
||||
@date_default_timezone_set('Asia/Shanghai');
|
||||
// 修改内存限制 根据服务器配置选择,低于128M容易出现上传失败,你懂得图片挺占用内存的
|
||||
@ini_set('memory_limit', '512M');
|
||||
// 定义根目录
|
||||
@define('APP_ROOT', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')));
|
||||
|
||||
|
||||
/*---------------图床配置-------------------*/
|
||||
|
||||
$config = array(
|
||||
// 网站标题
|
||||
'title' => '简单图床 - EasyImage',
|
||||
// 网站关键字
|
||||
'keywords' => '简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制',
|
||||
// 网站描述
|
||||
'description' => '简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序,最新html5自适应页面兼容手机电脑,上传后返回图片直链,markdown图片,论坛贴图bbscode链接,简单方便支持一键复制,支持多域名,api上传。',
|
||||
// 网站公告 为空则不显示
|
||||
'tips' => '本站仅做演示用,不定时清理图片,单文件≤5M,每次上传≤30张',
|
||||
/**
|
||||
* 网站域名与图片链接域名可以不同,比如A域名上传,可以返回B域名图片链接,A、B需绑定到同一空间下
|
||||
* 如果不变的话,下边2个填写成一样的!
|
||||
*/
|
||||
// 网站域名,末尾不加"/"
|
||||
'domain' => 'http://localhost',
|
||||
// 图片链接域名,末尾不加"/"
|
||||
'imgurl' => 'http://localhost',
|
||||
// 登录上传和后台管理密码,管理用户名为:admin
|
||||
'password' => 'admin@123',
|
||||
// 是否开启登录上传 开启:true 关闭:false
|
||||
'mustLogin' => false,
|
||||
// 是否开启API上传 开启:true 关闭:false
|
||||
'apiStatus' => false,
|
||||
/**
|
||||
* 存储路径 前后要加"/"
|
||||
* 可根据Apache/Nginx配置安全,参考:https://www.545141.com/981.html 或 README.md
|
||||
*/
|
||||
'path' => '/i/',
|
||||
/** 文件的命名方式 更改后不影响之前上传的
|
||||
* date 以上传时间 例:192704
|
||||
* unix 以Unix时间 例:1635074840
|
||||
* uniqid 基于以微秒计的当前时间 例:6175436c73418
|
||||
* guid 全球唯一标识符 例:6EDAD0CC-AB0C-4F61-BCCA-05FAD65BF0FA
|
||||
* md5 md5加密时间 例:3888aa69eb321a2b61fcc63520bf6c82
|
||||
* sha1 sha1加密微秒 例:654faac01499e0cb5fb0e9d78b21e234c63d842a
|
||||
* default 将上传时间+随机数转换为36进制 例:vx77yu
|
||||
*/
|
||||
'imgName' => 'default',
|
||||
// 最大上传限制 默认为5M 请使用工具转换Mb http://www.bejson.com/convert/filesize/
|
||||
'maxSize' => 5242880,
|
||||
// 每次最多上传图片数
|
||||
'maxUploadFiles' => 30,
|
||||
// 是否开启水印:0关闭,1文字水印,2图片水印 不能使用动态gif添加水印
|
||||
'watermark' => 0,
|
||||
// 水印文字内容
|
||||
'waterText' => '简单图床 img.545141.com',
|
||||
/**
|
||||
* 水印位置
|
||||
* 0:随机位置,在1-8之间随机选取一个位置
|
||||
* 1:顶部居左 2:顶部居中 3:顶部居右 4:左边居中
|
||||
* 5:图片中心 6:右边居中 7:底部居左 8:底部居中 9:底部居右
|
||||
*/
|
||||
'waterPosition' => 8,
|
||||
// 水印文字颜色 rgba 末尾为透明度0-127 0为不透明
|
||||
'textColor' => '47,79,79,0',
|
||||
// 水印文字大小
|
||||
'textSize' => 16,
|
||||
// 字体路径 如果想改变字体,请选择支持中文的 GB/2312 字体
|
||||
'textFont' => 'public/static/hkxzy.ttf',
|
||||
// 图片水印路径 支持GIF,JPG,BMP,PNG和PNG alpha
|
||||
'waterImg' => 'public/images/watermark.png',
|
||||
// 允许上传的图片扩展名
|
||||
'extensions' => "'bmp,jpg,png,tif,gif,pcx,tga,svg,webp,jpeg,tga,svg,ico'",
|
||||
/* 轻微有损压缩图片 开启:true 关闭:false
|
||||
* 此压缩有可能使图片变大!特别是小图片 也有一定概率改变图片方向
|
||||
* 开启后会增加服务器负担
|
||||
*/
|
||||
'compress' => false,
|
||||
// 转换图片为指定格式 可选:''|'png'|'jpeg'|'gif'|'bmp';默认值:''
|
||||
'imgConvert' => '',
|
||||
// 最大上传宽度
|
||||
'maxWidth' => 10240,
|
||||
// 最大上传高度
|
||||
'maxHeight' => 10240,
|
||||
// 允许上传的最小宽度
|
||||
'minWidth' => 5,
|
||||
// 允许上传的最小高度
|
||||
'minHeight' => 5,
|
||||
// 改变图片宽高 宽度和高度请设置 image_x image_y 开启:true 关闭:false 关闭下image_x和image_y设置不生效
|
||||
'imgRatio' => false,
|
||||
// 缩减的最大高度
|
||||
'image_x' => 1000,
|
||||
// 缩减的最大宽度
|
||||
'image_y' => 800,
|
||||
// 开启静态文件CDN 开启:true 关闭:false
|
||||
'static_cdn' => false,
|
||||
// 静态文件CDN加速网址 末尾不加 /
|
||||
'static_cdn_url' => '//cdn.jsdelivr.net/gh/icret/EasyImages2.0',
|
||||
// 开启顶部广告 开启:true 关闭:false 如果想添加或修改广告请到
|
||||
'ad_top' => false,
|
||||
// 顶部广告内容 支持html
|
||||
'ad_top_info' => '
|
||||
<div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
||||
<!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
<a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a>
|
||||
</div>
|
||||
',
|
||||
// 开启底部广告 开启:true 关闭:false 如果想添加或修改广告请到
|
||||
'ad_bot' => false,
|
||||
// 底部广告内容 支持html
|
||||
'ad_bot_info' => '
|
||||
<div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
||||
<!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
<a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a>
|
||||
</div>
|
||||
',
|
||||
// 开启游客预览(广场)开启:true 关闭:false
|
||||
'showSwitch' => true,
|
||||
// 默认预览数量,可在网址后填写参数实时更改预览数量 如:https://img.545141.com/libs/list.php?num=3
|
||||
'listNumber' => 20,
|
||||
// 上传框底部自定义信息,仅支持html格式 可以放置统计代码 下面是举例:
|
||||
'customize' => '
|
||||
<!-- 统计代码-->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?5320b69f4f1caa9328dfada73c8e6a75";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- 自定义js举例:非img.545141.com跳转
|
||||
<img style="display:none" src=" " onerror=\'this.onerror=null;var currentDomain="img."+"545141." + "com"; var str1=currentDomain; str2="docu"+"ment.loca"+"tion.host"; str3=eval(str2) ;if( str1!=str3 ){ do_action = "loca" + "tion." + "href = loca" + "tion.href" + ".rep" + "lace(docu" +"ment"+".loca"+"tion.ho"+"st," + "currentDomain" + ")";eval(do_action) }\' />
|
||||
-->
|
||||
<!--自定义代码举例:打赏、QQ邮箱、QQ群 可删除
|
||||
<iframe src="https://img.545141.com/sponsor/index.html" style="overflow-x:hidden;overflow-y:hidden; border:0xp none #fff; min-height:240px; width:100%;" frameborder="0" scrolling="no"></iframe>
|
||||
<a target="_blank" href="https://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=cR0UHB4fGBwxAABfEh4c">
|
||||
<i class="icon icon-envelope-alt">联系邮箱 </i></span>
|
||||
</a>
|
||||
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=3feb4e8be8f1839f71e53bf2e876de36afc6889b2630c33c877d8df5a5583a6f">
|
||||
<i class="icon icon-qq">加入QQ群</i></span>
|
||||
</a>
|
||||
<a target="_blank" href="/master.zip"><i class="icon icon-download-alt">下载源码</i></a>
|
||||
-->
|
||||
',
|
||||
// PHP插件检测-安全设置检测-版本检测 开启:true 关闭:false
|
||||
'checkEnv' => true,
|
||||
/* 图片监黄 开启:true 关闭:false
|
||||
* 从 https://moderatecontent.com/ 获取key并填入/config/api_key.php的图片检查key
|
||||
* 开启后会受服务器到https://moderatecontent.com/ 速度影响,国内不建议开启!
|
||||
*/
|
||||
'checkImg' => false,
|
||||
// 设置是不良图片概率,概率越大准确率越高,
|
||||
'checkImg_value' => 50,
|
||||
// 当前版本
|
||||
'version' => '2.3.1'
|
||||
);
|
||||
$config=Array
|
||||
(
|
||||
'title'=>'简单图床 - EasyImage',
|
||||
'keywords'=>'简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制',
|
||||
'description'=>'简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序,最新html5自适应页面兼容手机电脑,上传后返回图片直链,markdown图片,论坛贴图bbscode链接,简单方便支持一键复制,支持多域名,api上传。',
|
||||
'tips'=>'本站仅做演示用,不定时清理图片,单文件≤5M,每次上传≤30张',
|
||||
'domain'=>'http://localhost',
|
||||
'imgurl'=>'http://localhost',
|
||||
'password'=>'admin@123',
|
||||
'mustLogin'=>0,
|
||||
'apiStatus'=>0,
|
||||
'path'=>'/i/',
|
||||
'imgName'=>'default',
|
||||
'maxSize'=>5242880,
|
||||
'maxUploadFiles'=>30,
|
||||
'watermark'=>0,
|
||||
'waterText'=>'简单图床 - img.545141.com',
|
||||
'waterPosition'=>0,
|
||||
'textColor'=>'255,0,0,1',
|
||||
'textSize'=>16,
|
||||
'textFont'=>'/public/static/hkxzy.ttf',
|
||||
'waterImg'=>'/public/images/watermark.png',
|
||||
'extensions'=>'bmp,jpg,png,tif,gif,pcx,tga,svg,webp,jpeg,tga,svg,ico',
|
||||
'compress'=>0,
|
||||
'imgConvert'=>'',
|
||||
'maxWidth'=>10240,
|
||||
'maxHeight'=>10240,
|
||||
'minWidth'=>5,
|
||||
'minHeight'=>5,
|
||||
'imgRatio'=>0,
|
||||
'image_x'=>1000,
|
||||
'image_y'=>800,
|
||||
'static_cdn'=>0,
|
||||
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0',
|
||||
'ad_top'=>0,
|
||||
'ad_top_info'=>' <div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
||||
<!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
<a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a>
|
||||
</div>
|
||||
',
|
||||
'ad_bot'=>0,
|
||||
'ad_bot_info'=>' <div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
||||
<!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
<a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a>
|
||||
</div>
|
||||
',
|
||||
'showSwitch'=>1,
|
||||
'listNumber'=>20,
|
||||
'customize'=>' <!-- 统计代码-->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?5320b69f4f1caa9328dfada73c8e6a75";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- 自定义js举例:非img.545141.com跳转
|
||||
<img style="display:none" src=" " onerror=\'this.onerror=null;var currentDomain="img."+"545141." + "com"; var str1=currentDomain; str2="docu"+"ment.loca"+"tion.host"; str3=eval(str2) ;if( str1!=str3 ){ do_action = "loca" + "tion." + "href = loca" + "tion.href" + ".rep" + "lace(docu" +"ment"+".loca"+"tion.ho"+"st," + "currentDomain" + ")";eval(do_action) }\' />
|
||||
-->
|
||||
<!--自定义代码举例:打赏、QQ邮箱、QQ群 可删除
|
||||
<iframe src="https://img.545141.com/sponsor/index.html" style="overflow-x:hidden;overflow-y:hidden; border:0xp none #fff; min-height:240px; width:100%;" frameborder="0" scrolling="no"></iframe>
|
||||
<a target="_blank" href="https://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=cR0UHB4fGBwxAABfEh4c">
|
||||
<i class="icon icon-envelope-alt">联系邮箱 </i></span>
|
||||
</a>
|
||||
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=3feb4e8be8f1839f71e53bf2e876de36afc6889b2630c33c877d8df5a5583a6f">
|
||||
<i class="icon icon-qq">加入QQ群</i></span>
|
||||
</a>
|
||||
<a target="_blank" href="/master.zip"><i class="icon icon-download-alt">下载源码</i></a>
|
||||
--> ',
|
||||
'checkEnv'=>1,
|
||||
'checkImg'=>0,
|
||||
'checkImg_value'=>50,
|
||||
'version'=>'2.4.0',
|
||||
'form'=>'',
|
||||
'TinyImag_key'=>'',
|
||||
'moderatecontent_key'=>''
|
||||
);
|
||||
24
file.php
24
file.php
@@ -1,8 +1,8 @@
|
||||
|
||||
<?php
|
||||
require __DIR__ . '/libs/function.php';
|
||||
require APP_ROOT . '/libs/class.upload.php';
|
||||
require APP_ROOT . '/libs/WaterMask.php';
|
||||
require __DIR__ . '/application/function.php';
|
||||
require APP_ROOT . '/application/class.upload.php';
|
||||
require APP_ROOT . '/application/WaterMask.php';
|
||||
|
||||
$handle = new Upload($_FILES['file'], 'zh_CN');
|
||||
|
||||
@@ -47,7 +47,7 @@ if ($handle->uploaded) {
|
||||
'pos' => $config['waterPosition'],
|
||||
# 不指定name(会覆盖原图,也就是保存成thumb.jpeg)
|
||||
'name' => $handle->file_dst_pathname,
|
||||
'font' => $config['textFont'],
|
||||
'font' => APP_ROOT . $config['textFont'],
|
||||
'fontSize' => $config['textSize'],
|
||||
'color' => $config['textColor'],
|
||||
];
|
||||
@@ -58,7 +58,7 @@ if ($handle->uploaded) {
|
||||
if (isAnimatedGif($handle->file_src_pathname) === 0) {
|
||||
$arr = [
|
||||
# 水印图片路径(如果不存在将会被当成是字符串水印)
|
||||
'res' => $config['waterImg'],
|
||||
'res' => APP_ROOT . $config['waterImg'],
|
||||
# 水印显示位置
|
||||
'pos' => $config['waterPosition'],
|
||||
# 不指定name(会覆盖原图,也就是保存成thumb.jpeg)
|
||||
@@ -82,11 +82,14 @@ if ($handle->uploaded) {
|
||||
// 判断PHP版本启用删除
|
||||
$ver = substr(PHP_VERSION, 0, 3);
|
||||
if ($ver >= '7.0') {
|
||||
$delUrl = $config['domain'] . '/api/del.php?hash=' . urlHash(config_path() . $handle->file_dst_name, 0);
|
||||
$delUrl = $config['domain'] . '/application/del.php?hash=' . urlHash(config_path() . $handle->file_dst_name, 0);
|
||||
} else {
|
||||
$delUrl = 'PHP≥7.0 才能启用删除!';
|
||||
}
|
||||
|
||||
// 创建缩略图
|
||||
@creat_cache_images($handle->file_dst_name);
|
||||
|
||||
$reJson = array(
|
||||
"result" => 'success',
|
||||
"url" => $imageUrl,
|
||||
@@ -106,7 +109,7 @@ if ($handle->uploaded) {
|
||||
// 压缩图片 后压缩模式,不影响前台输出速度
|
||||
if (!isAnimatedGif($handle->file_dst_pathname))
|
||||
if ($config['compress']) {
|
||||
require 'libs/compress/Imagick/class.Imgcompress.php';
|
||||
require 'application/compress/Imagick/class.Imgcompress.php';
|
||||
$img = new Imgcompress($handle->file_dst_pathname, 1);
|
||||
$img->compressImg($handle->file_dst_pathname);
|
||||
// 释放
|
||||
@@ -116,11 +119,10 @@ if ($handle->uploaded) {
|
||||
|
||||
unset($handle);
|
||||
|
||||
|
||||
// 图片违规检查
|
||||
|
||||
if($config['checkImg']){
|
||||
if ($config['checkImg']) {
|
||||
require_once APP_ROOT . '/config/api_key.php';
|
||||
@checkImg($imageUrl);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
4
i/.htaccess
Executable file
4
i/.htaccess
Executable file
@@ -0,0 +1,4 @@
|
||||
<FilesMatch "\.(?i:php|php3|php4|php5)">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
1
i/cache/d2efe4a4eedde82b566dc7eed5bb2513.php
vendored
Executable file
1
i/cache/d2efe4a4eedde82b566dc7eed5bb2513.php
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"filename":"d2efe4a4eedde82b566dc7eed5bb2513","date":"2021110910","total_time":"2021-11-09 11:00:16","dirnum":6,"filenum":8,"usage_space":"2.13MB","todayUpload":0,"yestUpload":0}
|
||||
1
i/cache/total_chart_total_chart_d2efe4a4eedde82b566dc7eed5bb2513.php
vendored
Executable file
1
i/cache/total_chart_total_chart_d2efe4a4eedde82b566dc7eed5bb2513.php
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"chart_data":[{"2021\/11\/09\/":0},{"2021\/11\/08\/":0},{"2021\/11\/07\/":2},{"2021\/11\/06\/":0},{"2021\/11\/05\/":0},{"2021\/11\/04\/":2},{"2021\/11\/03\/":0},{"2021\/11\/02\/":0},{"2021\/11\/01\/":0},{"2021\/10\/31\/":0},{"2021\/10\/30\/":0},{"2021\/10\/29\/":0},{"2021\/10\/28\/":0},{"2021\/10\/27\/":0},{"2021\/10\/26\/":0},{"2021\/10\/25\/":0},{"2021\/10\/24\/":0},{"2021\/10\/23\/":0},{"2021\/10\/22\/":0},{"2021\/10\/21\/":0},{"2021\/10\/20\/":0},{"2021\/10\/19\/":0},{"2021\/10\/18\/":0},{"2021\/10\/17\/":0},{"2021\/10\/16\/":0},{"2021\/10\/15\/":0},{"2021\/10\/14\/":0},{"2021\/10\/13\/":0},{"2021\/10\/12\/":0},{"2021\/10\/11\/":0}],"chart_disk":[{"2021\/11\/09\/":0},{"2021\/11\/08\/":0},{"2021\/11\/07\/":1113326},{"2021\/11\/06\/":0},{"2021\/11\/05\/":0},{"2021\/11\/04\/":1113326},{"2021\/11\/03\/":0},{"2021\/11\/02\/":0},{"2021\/11\/01\/":0},{"2021\/10\/31\/":0},{"2021\/10\/30\/":0},{"2021\/10\/29\/":0},{"2021\/10\/28\/":0},{"2021\/10\/27\/":0},{"2021\/10\/26\/":0},{"2021\/10\/25\/":0},{"2021\/10\/24\/":0},{"2021\/10\/23\/":0},{"2021\/10\/22\/":0},{"2021\/10\/21\/":0},{"2021\/10\/20\/":0},{"2021\/10\/19\/":0},{"2021\/10\/18\/":0},{"2021\/10\/17\/":0},{"2021\/10\/16\/":0},{"2021\/10\/15\/":0},{"2021\/10\/14\/":0},{"2021\/10\/13\/":0},{"2021\/10\/12\/":0},{"2021\/10\/11\/":0}],"total_time":"2021-11-09 10:56:01","date":"20211109"}
|
||||
41
i/cache/verson.json
vendored
Executable file
41
i/cache/verson.json
vendored
Executable file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"url": "https://api.github.com/repos/icret/EasyImages2.0/releases/52150405",
|
||||
"assets_url": "https://api.github.com/repos/icret/EasyImages2.0/releases/52150405/assets",
|
||||
"upload_url": "https://uploads.github.com/repos/icret/EasyImages2.0/releases/52150405/assets{?name,label}",
|
||||
"html_url": "https://github.com/icret/EasyImages2.0/releases/tag/2.3.0",
|
||||
"id": 52150405,
|
||||
"author": {
|
||||
"login": "icret",
|
||||
"id": 16373024,
|
||||
"node_id": "MDQ6VXNlcjE2MzczMDI0",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/16373024?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/icret",
|
||||
"html_url": "https://github.com/icret",
|
||||
"followers_url": "https://api.github.com/users/icret/followers",
|
||||
"following_url": "https://api.github.com/users/icret/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/icret/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/icret/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/icret/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/icret/orgs",
|
||||
"repos_url": "https://api.github.com/users/icret/repos",
|
||||
"events_url": "https://api.github.com/users/icret/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/icret/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"node_id": "RE_kwDOCzgjBc4DG8CF",
|
||||
"tag_name": "2.3.0",
|
||||
"target_commitish": "master",
|
||||
"name": "EasyImage2.0 简单图床 ver:2.3.0",
|
||||
"draft": false,
|
||||
"prerelease": false,
|
||||
"created_at": "2021-10-27T12:48:26Z",
|
||||
"published_at": "2021-10-27T14:54:09Z",
|
||||
"assets": [
|
||||
|
||||
],
|
||||
"tarball_url": "https://api.github.com/repos/icret/EasyImages2.0/tarball/2.3.0",
|
||||
"zipball_url": "https://api.github.com/repos/icret/EasyImages2.0/zipball/2.3.0",
|
||||
"body": "* 2021-10-24 v2.3.0\r\n- 将服务器环境监测改为第一次打开时自动检测(如需再次展示需删除config目录下的EasyImage.lock)\r\n- 增加快捷操作中心显示服务信息\r\n- 增加自定义上传文件的命名方式(详见config.php文件里的注释)\r\n- 增加隐私政策、服务条款、DMCA\r\n- 增加自定义静态文件CDN源\r\n- 增加dns-prefetch\r\n- 删除了tinyfilemanager文件管理(感觉没什么用)\r\n- 一些bug得以修复"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
require_once 'libs/header.php';
|
||||
require_once 'application/header.php';
|
||||
|
||||
// 公告
|
||||
if (!empty($config['tips'])) {
|
||||
@@ -94,7 +94,7 @@ mustLogin();
|
||||
// 上传格式过滤
|
||||
filters: { // 只允许上传图片或图标(.ico)
|
||||
mime_types: [
|
||||
{title: '图片',extensions: <?php echo $config['extensions']; ?>},
|
||||
{title: '图片',extensions:'<?php echo $config['extensions']; ?>'},
|
||||
{title: '图标',extensions: 'ico'}
|
||||
],
|
||||
prevent_duplicates: true
|
||||
@@ -133,4 +133,4 @@ mustLogin();
|
||||
</script>
|
||||
<?php
|
||||
checkEnv($config['checkEnv']); // 环境检测
|
||||
require_once APP_ROOT . '/libs/footer.php';
|
||||
require_once APP_ROOT . '/application/footer.php';
|
||||
|
||||
52
install/contorl.php
Executable file
52
install/contorl.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/function.php';
|
||||
|
||||
if (file_exists(APP_ROOT . '/install/install.lock')) {
|
||||
exit(header("Location:/../index.php"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_POST['password'])) {
|
||||
if ($_POST['password'] == $_POST['repassword']) {
|
||||
|
||||
$config['password']=$_POST['password'];
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
exit('<script>window.alert("两次密码不一致请重新输入!");location.href="./index.php";</script>');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['domain'])) {
|
||||
$config['domain']= $_POST['domain'];
|
||||
|
||||
}
|
||||
|
||||
if (isset($_POST['imgurl'])) {
|
||||
$config['imgurl']= $_POST['imgurl'];
|
||||
}
|
||||
|
||||
$config_file = APP_ROOT . '/config/config.php';
|
||||
cache_write($config_file, $config);
|
||||
|
||||
file_put_contents(APP_ROOT . '/install/install.lock', '安装程序锁定文件。'); // 创建安装程序锁
|
||||
|
||||
// 跳转主页
|
||||
echo '
|
||||
<script>
|
||||
|
||||
window.alert("安装成功,即将为您跳转到登陆界面!");
|
||||
location.href="/../application/login.php";
|
||||
</script>
|
||||
';
|
||||
|
||||
// 删除安装目录
|
||||
if (isset($_POST['del_install'])) {
|
||||
if ($_POST['del_install'] == "del") {
|
||||
deldir(APP_ROOT . "/install/");
|
||||
}
|
||||
}
|
||||
|
||||
//exit(header("Location:/../application/login.php")); // 跳转主页
|
||||
184
install/index.php
Executable file
184
install/index.php
Executable file
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/function.php';
|
||||
// 存在程序锁则跳转主页
|
||||
if (file_exists(APP_ROOT . '/install/install.lock')) {
|
||||
exit(header("Location:/../index.php"));
|
||||
}
|
||||
$phpEnv = (PHP_VERSION >= 5.6) ? true : false;
|
||||
$fileinfo = extension_loaded('fileinfo') ? true : false;
|
||||
$gd = extension_loaded('gd') ? true : false;
|
||||
$openssl = extension_loaded('openssl') ? true : false;
|
||||
|
||||
$file = substr(base_convert(fileperms(APP_ROOT . "/file.php"), 10, 8), 3);
|
||||
if (IS_WIN) {
|
||||
$file_php = true;
|
||||
$i_wjj = true;
|
||||
}
|
||||
if (!IS_WIN) {
|
||||
if ($file == '755') {
|
||||
$file_php = true;
|
||||
} else {
|
||||
$file_php = false;
|
||||
}
|
||||
if (is_writable(APP_ROOT . '/i/')) {
|
||||
$i_wjj = true;
|
||||
} else {
|
||||
$i_wjj = false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkPASS($name)
|
||||
{
|
||||
if ($name) {
|
||||
echo '<p style="color:green;font-weight: bold"><i class="icon icon-check icon-2x"></i></p>';
|
||||
} else {
|
||||
echo '<p style="color:red;font-weight: bold"><i class="icon icon-times icon-2x"></p>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>EasyIamge 2.0 安装环境检测</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="keywords" content="EasyIamge 2.0 安装环境检测" />
|
||||
<meta name="description" content="EasyIamge 2.0 安装环境检测" />
|
||||
<link rel="shortcut icon" href="./../public/favicon.ico" type="image/x-icon" />
|
||||
<link href="./..//public/static/zui/css/zui.min.css?v1.9.2" rel="stylesheet">
|
||||
<script src="./..//public/static/zui/lib/jquery/jquery-3.4.1.min.js?v3.4.1"></script>
|
||||
<script src="./../public/static/zui/js/zui.min.js?v1.9.2"></script>
|
||||
<script src="./../public/static/qrcode.min.js?v2.0"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body class="container">
|
||||
<!-- install header html end -->
|
||||
|
||||
<h1 style="text-align:center">EasyIamge 2.0 安装环境检测</h1>
|
||||
<table class="table table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>检查名称</th>
|
||||
<th>图床要求</th>
|
||||
<th>检测结果</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>PHP</td>
|
||||
<td>PHP >= 5.6</td>
|
||||
<td><?php checkPASS($phpEnv); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fileinfo</td>
|
||||
<td>必须支持</td>
|
||||
<td> <?php checkPASS($fileinfo); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GD</td>
|
||||
<td>必须支持</td>
|
||||
<td> <?php checkPASS($gd); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>openssl</td>
|
||||
<td>建议支持(用于删除文件,PHP>7.0)</td>
|
||||
<td> <?php checkPASS($openssl); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>file.php</td>
|
||||
<td>0755可执行权限(非windows系统)</td>
|
||||
<td> <?php checkPASS($file_php); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>/i</td>
|
||||
<td>可写</td>
|
||||
<td><?php checkPASS($i_wjj); ?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<?php
|
||||
$checkres = array($phpEnv, $fileinfo, $gd, $i_wjj, $file_php);
|
||||
|
||||
if (in_array(false, $checkres)) {
|
||||
echo '<a href="./index.php" ><button class="btn btn-lg btn-danger" type="button">请满足上述要求后点击刷新</button></a>';
|
||||
} else {
|
||||
echo '
|
||||
<form action="install.php" method="post">
|
||||
<input type="hidden" name="check" value="checked" readonly>
|
||||
<input type="submit" class="btn btn-lg btn-primary" value="下一步(1/2)" >
|
||||
</form>
|
||||
';
|
||||
}
|
||||
?>
|
||||
<!-- install bottom HTML start -->
|
||||
<div class="modal fade" id="myModal">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">关闭</span></button>
|
||||
<h4 class="modal-title icon icon-mobile" style="text-align: center">扫描二维码使用手机上传</h4>
|
||||
</div>
|
||||
<div class="modal-body" align="center">
|
||||
<input id="text" type="hidden" value="" />
|
||||
<p id="qrcode"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-danger btn-sm" href="" target="_blank">访问</a>
|
||||
<button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// js二维码 获取当前网址并赋值给id=text的value
|
||||
document.getElementById("text").value = window.location.href;
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
width: 200,
|
||||
height: 200,
|
||||
});
|
||||
|
||||
function makeCode() {
|
||||
var elText = document.getElementById("text");
|
||||
if (!elText.value) {
|
||||
alert("Input a text");
|
||||
elText.focus();
|
||||
return;
|
||||
}
|
||||
qrcode.makeCode(elText.value);
|
||||
}
|
||||
makeCode();
|
||||
$("#text").on("blur",
|
||||
function() {
|
||||
makeCode();
|
||||
}).on("keydown",
|
||||
function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
makeCode();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<footer class="text-muted small col-md-12" style="text-align: center;margin-bottom: 10px">
|
||||
<hr>
|
||||
<p><a href="/../admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a><i class="icon icon-smile"></i></p>
|
||||
<div>
|
||||
<!-- 对话框触发按钮 -->
|
||||
<a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal">
|
||||
<i class="icon icon-qrcode"></i>二维码 </a>
|
||||
</div>
|
||||
<?php echo 'Copyright © 2018-' . date('Y'); ?>
|
||||
<a href="https://img.545141.com/" target="_blank">EasyImage</a> By
|
||||
<a href="https://www.545141.com/902.html" target="_blank">Icret</a> Version:<a href="https://github.com/icret/EasyImages2.0" target="_blank"><?php echo $config['version']; ?></a>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
175
install/install.php
Executable file
175
install/install.php
Executable file
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/function.php';
|
||||
// 存在程序锁则跳转主页
|
||||
if (file_exists(APP_ROOT . '/install/install.lock')) {
|
||||
exit(header("Location:/../index.php"));
|
||||
}
|
||||
|
||||
// 验证上一步环境检测
|
||||
$state = isset($_POST['check']) ? $_POST['check'] : exit(header("Location:index.php"));
|
||||
if ($state !== 'checked') {
|
||||
exit(header("Location:index.php"));
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>EasyIamge 2.0 即将完成安装!</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="keywords" content="EasyIamge 2.0 即将完成安装!" />
|
||||
<meta name="description" content="EasyIamge 2.0 即将完成安装!" />
|
||||
<link rel="shortcut icon" href="./../public/favicon.ico" type="image/x-icon" />
|
||||
<link href="./../public/static/zui/css/zui.min.css?v1.9.2" rel="stylesheet">
|
||||
<script src="./../public/static/zui/lib/jquery/jquery-3.4.1.min.js?v3.4.1"></script>
|
||||
<script src="./../public/static/zui/js/zui.min.js?v1.9.2"></script>
|
||||
<script src="./../public/static/qrcode.min.js?v2.0"></script>
|
||||
<style>
|
||||
.message {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.wrong {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.right {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="container">
|
||||
<!-- install header html end -->
|
||||
<div class="col-md-12" style="height: 120px;"></div>
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<form class="form-horizontal" action="./contorl.php" method="post">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2">网站域名,末尾不加"/"</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input type="url" class="form-control" name="domain" value="" required="required" onkeyup="this.value=this.value.replace(/\s/g,'')" placeholder="网站域名与图片链接域名可以不同,比如A域名上传,可以返回B域名图片链接,如果不变的话,下边2个填写成一样的!" title="网站域名与图片链接域名可以不同,比如A域名上传,可以返回B域名图片链接,如果不变的话,下边2个填写成一样的!">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2">图片链接域名,末尾不加"/"</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input type="text" class="form-control" name="imgurl" value="" required="required" placeholder="给图片的域名,末尾不加/,如果没有请填写和上边的一样即可" onkeyup="this.value=this.value.replace(/\s/g,'')" placeholder="图片域名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">登录上传和后台管理密码</label>
|
||||
<span class="message">请输入8~18位密码</span>
|
||||
<div class="col-md-6 col-sm-10 register">
|
||||
<input type="text" class="form-control inp" name="password" value="" required="required" placeholder="请使用英文输入法输入密码并不小于8位数" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">确认密码</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input type="text" class="form-control" name="repassword" value="" required="required" placeholder="确认密码" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="del_install" value="del"><span style="font-weight: bold;color:red;">删除安装目录</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-success">准备就绪,开始安装!</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
var password = document.querySelector('.inp');
|
||||
var message = document.querySelector('.message');
|
||||
|
||||
password.onblur = function() {
|
||||
if (this.value.length < 8 || this.value.length > 18) {
|
||||
message.innerHTML = '密码长度错误,应为8~18位';
|
||||
message.className = 'message wrong';
|
||||
} else {
|
||||
message.innerHTML = '密码长度正确';
|
||||
message.className = 'message right';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- install bottom HTML start -->
|
||||
|
||||
|
||||
<div class="modal fade" id="myModal">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">关闭</span></button>
|
||||
<h4 class="modal-title icon icon-mobile" style="text-align: center">扫描二维码使用手机上传</h4>
|
||||
</div>
|
||||
<div class="modal-body" align="center">
|
||||
<input id="text" type="hidden" value="" />
|
||||
<p id="qrcode"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-danger btn-sm" href="" target="_blank">访问</a>
|
||||
<button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// js二维码 获取当前网址并赋值给id=text的value
|
||||
document.getElementById("text").value = window.location.href;
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
width: 200,
|
||||
height: 200,
|
||||
});
|
||||
|
||||
function makeCode() {
|
||||
var elText = document.getElementById("text");
|
||||
if (!elText.value) {
|
||||
alert("Input a text");
|
||||
elText.focus();
|
||||
return;
|
||||
}
|
||||
qrcode.makeCode(elText.value);
|
||||
}
|
||||
makeCode();
|
||||
$("#text").on("blur",
|
||||
function() {
|
||||
makeCode();
|
||||
}).on("keydown",
|
||||
function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
makeCode();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<footer class="text-muted small col-md-12" style="text-align: center;margin-bottom: 10px">
|
||||
<hr>
|
||||
<p><a href="/../admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a><i class="icon icon-smile"></i></p>
|
||||
<div>
|
||||
<!-- 对话框触发按钮 -->
|
||||
<a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal">
|
||||
<i class="icon icon-qrcode"></i>二维码 </a>
|
||||
</div>
|
||||
<?php echo 'Copyright © 2018-' . date('Y'); ?>
|
||||
<a href="https://img.545141.com/" target="_blank">EasyImage</a> By
|
||||
<a href="https://www.545141.com/902.html" target="_blank">Icret</a> Version:<a href="https://github.com/icret/EasyImages2.0" target="_blank"><?php echo $config['version']; ?></a>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/function.php';?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><?php echo $config['title']; ?></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="keywords" content="<?php echo $config['keywords']; ?>" />
|
||||
<meta name="description" content="<?php echo $config['description']; ?>" />
|
||||
<link rel="shortcut icon" href="<?php echo $config['domain']; ?>/favicon.ico" type="image/x-icon" />
|
||||
<link rel="dns-prefetch" href="<?php echo $config['imgurl'];?>" />
|
||||
<link rel="dns-prefetch" href="<?php echo $config['static_cdn_url'];?>" />
|
||||
<link href="<?php static_cdn();?>/public/static/zui/css/zui.min.css?v1.9.2" rel="stylesheet">
|
||||
<link href="<?php static_cdn();?>/public/static/zui/lib/uploader/zui.uploader.min.css?v1.9.2" rel="stylesheet">
|
||||
<link href="<?php static_cdn();?>/public/static/nprogress.min.css?v0.2.0" rel="stylesheet">
|
||||
<script src="<?php static_cdn();?>/public/static/zui/lib/jquery/jquery-3.4.1.min.js?v3.4.1"></script>
|
||||
<script src="<?php static_cdn();?>/public/static/zui/js/zui.min.js?v1.9.2"></script>
|
||||
<script src="<?php static_cdn();?>/public/static/zui/lib/uploader/zui.uploader.min.js?v1.9.2"></script>
|
||||
<script src="<?php static_cdn();?>/public/static/qrcode.min.js?v2.0"></script>
|
||||
<script src="<?php static_cdn();?>/public/static/hm.js"></script>
|
||||
<script src="<?php static_cdn();?>/public/static/zui/lib/clipboard/clipboard.min.js?vv1.5.5"></script>
|
||||
<script src="<?php static_cdn();?>/public/static/nprogress.min.js"></script>
|
||||
<style>
|
||||
.uploader-files {
|
||||
min-height: 160px;
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
@media screen and (min-width:960px) {
|
||||
.listNum img {
|
||||
width: 268px;
|
||||
height: 268px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="container">
|
||||
<?php if($config['ad_top']){echo $config['ad_top_info'];} ?>
|
||||
<div class="md-lg-12 header-dividing">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="<?php echo getActive('index'); ?>">
|
||||
<a href="<?php echo $config['domain']; ?>/index.php">
|
||||
<i class="icon icon-home"> 首页</i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php echo getActive('list'); ?>">
|
||||
<a href="<?php echo $config['domain']; ?>/libs/list.php?date=<?php echo date('Y/m/d/') ?>&num=<?php echo $config['listNumber']; ?>">
|
||||
<i class="icon icon-list"> 广场</i>
|
||||
<span class="label label-badge label-success">
|
||||
<?php echo getFileNumber(APP_ROOT . config_path()); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 顶部导航栏END -->
|
||||
203
libs/list.php
203
libs/list.php
@@ -1,203 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/header.php';
|
||||
if (!$config['showSwitch'] and !is_online()) {
|
||||
echo '<div class="alert alert-info">管理员关闭了预览哦~~</div>';
|
||||
} else {
|
||||
$path = isset($_GET['date']) ?$_GET['date']: date('Y/m/d/');
|
||||
$keyNum =isset( $_GET['num'] )?$_GET['num']:$config['listNumber'];
|
||||
$fileArr = getFile(APP_ROOT . config_path($path));
|
||||
if ($fileArr[0]) {
|
||||
echo '<div class="cards listNum">';
|
||||
foreach ($fileArr as $key => $value) {
|
||||
if ($key < $keyNum) {
|
||||
$imgUrl = $config['imgurl'] . config_path($path) . $value;
|
||||
echo '
|
||||
<div class="col-md-4 col-sm-6 col-lg-3">
|
||||
<img data-toggle="lightbox" data-image="' . $imgUrl . '" src="../public/images/loading.svg" class="img-thumbnail" alt="简单图床-EasyImage">
|
||||
<a href="' . $imgUrl . '" target="_blank">
|
||||
<div class="pull-left">
|
||||
<span class="label label-success">查看源图</span>
|
||||
</div>
|
||||
</a>
|
||||
<a href="' . $config['domain'] . '/api/del.php?url=' . $imgUrl . '" target="_blank">
|
||||
<div class="pull-right">
|
||||
<span class="label label-warning">删除图片</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<div class="alert alert-danger">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</div>';
|
||||
}
|
||||
}
|
||||
$yesterday = date("Y/m/d/", strtotime("-1 day"));
|
||||
// 昨日日期
|
||||
$todayUpload = getFileNumber(APP_ROOT . config_path());
|
||||
// 今日上传数量
|
||||
$yesterdayUpload = getFileNumber(APP_ROOT . $config['path'] . $yesterday);
|
||||
// 昨日上传数量
|
||||
$spaceUsed = getDistUsed(disk_total_space(__DIR__) - disk_free_space(__DIR__));
|
||||
// 占用空间
|
||||
// 当前日期全部上传
|
||||
$allUploud = isset($_GET['date'])?$_GET['date']:date('Y/m/d/');
|
||||
$allUploud = getFileNumber(APP_ROOT . $config['path'] . $allUploud);
|
||||
@($httpUrl = array('date' => $path, 'num' => getFileNumber(APP_ROOT . config_path($path))));
|
||||
?>
|
||||
<style>
|
||||
/** 返回顶部*/
|
||||
* {
|
||||
list-style: none;
|
||||
border: 0;
|
||||
}
|
||||
#rocket-to-top div {
|
||||
left: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 149px;
|
||||
}
|
||||
#rocket-to-top .level-2 {
|
||||
background: url("../public/images/rocket_button_up.png") no-repeat scroll -149px 0 transparent;
|
||||
display: none;
|
||||
height: 250px;
|
||||
opacity: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
#rocket-to-top .level-3 {
|
||||
background: none repeat scroll 0 0 transparent;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 150px;
|
||||
z-index: 2;
|
||||
}
|
||||
#rocket-to-top {
|
||||
background: url("../public/images/rocket_button_up.png") no-repeat scroll 0 0 transparent;
|
||||
cursor: default;
|
||||
display: block;
|
||||
height: 250px;
|
||||
margin: -125px 0 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 80%;
|
||||
width: 149px;
|
||||
z-index: 11;
|
||||
}
|
||||
</style>
|
||||
<script src="<?php static_cdn();?>/public/static/lazyload.js"></script>
|
||||
<link href="<?php static_cdn();?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet">
|
||||
<script src="<?php static_cdn();?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8">
|
||||
<a href="list.php?<?php echo http_build_query($httpUrl);?>"><span class="label label-info label-outline"> 当前:<?php echo $allUploud;?>张</span></a>
|
||||
<a href="list.php"><span class="label label-success label-outline"> 今日:<?php echo $todayUpload;?>张</span></a><a href="list.php?date=<?php echo $yesterday;?>"><span class="label label-warning label-outline"> 昨日:<?php echo $yesterdayUpload;?>张</span></a>
|
||||
<!--<span class="label label-danger label-outline"> 占用:<?php echo $spaceUsed;?></span>-->
|
||||
<?php for ($x = 2; $x <= 7; $x++) {/** 倒推日期显示上传图片 */echo '<a href="list.php?date=' . date('Y/m/d/', strtotime("-{$x} day")) . '"> <span class="label label-danger label-outline"> ' . date('m月d日', strtotime("-{$x} day")) . '</a>';}?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<form class="form-inline" action="list.php" method="get">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputInviteCode3">按日期:</label>
|
||||
<input type="text" class="form-control form-date" value="<?php echo date('Y/m/d/');?>" name="date" readonly="">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">跳转</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 返回顶部 -->
|
||||
<div style="display: none;" id="rocket-to-top">
|
||||
<div style="opacity:0;display: block;" class="level-2"></div>
|
||||
<div class="level-3"></div>
|
||||
</div>
|
||||
<script>// 返回顶部
|
||||
$(function() {
|
||||
var e = $("#rocket-to-top"),
|
||||
t = $(document).scrollTop(),
|
||||
n,
|
||||
r,
|
||||
i = !0;
|
||||
$(window).scroll(function() {
|
||||
var t = $(document).scrollTop();
|
||||
t == 0 ? e.css("background-position") == "0px 0px" ? e.fadeOut("slow") : i && (i = !1, $(".level-2").css("opacity", 1), e.delay(100).animate({
|
||||
marginTop: "-1000px"
|
||||
},
|
||||
"normal",
|
||||
function() {
|
||||
e.css({
|
||||
"margin-top": "-125px",
|
||||
display: "none"
|
||||
}),
|
||||
i = !0
|
||||
})) : e.fadeIn("slow")
|
||||
}),
|
||||
e.hover(function() {
|
||||
$(".level-2").stop(!0).animate({
|
||||
opacity: 1
|
||||
})
|
||||
},
|
||||
function() {
|
||||
$(".level-2").stop(!0).animate({
|
||||
opacity: 0
|
||||
})
|
||||
}),
|
||||
$(".level-3").click(function() {
|
||||
function t() {
|
||||
var t = e.css("background-position");
|
||||
if (e.css("display") == "none" || i == 0) {
|
||||
clearInterval(n),
|
||||
e.css("background-position", "0px 0px");
|
||||
return
|
||||
}
|
||||
switch (t) {
|
||||
case "0px 0px":
|
||||
e.css("background-position", "-298px 0px");
|
||||
break;
|
||||
case "-298px 0px":
|
||||
e.css("background-position", "-447px 0px");
|
||||
break;
|
||||
case "-447px 0px":
|
||||
e.css("background-position", "-596px 0px");
|
||||
break;
|
||||
case "-596px 0px":
|
||||
e.css("background-position", "-745px 0px");
|
||||
break;
|
||||
case "-745px 0px":
|
||||
e.css("background-position", "-298px 0px");
|
||||
}
|
||||
}
|
||||
if (!i) return;
|
||||
n = setInterval(t, 50),
|
||||
$("html,body").animate({
|
||||
scrollTop: 0
|
||||
},
|
||||
"slow");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">// 按日期浏览
|
||||
$(".form-date").datetimepicker({
|
||||
weekStart: 1,
|
||||
todayBtn: 1,
|
||||
autoclose: 1,
|
||||
todayHighlight: 1,
|
||||
startView: 2,
|
||||
minView: 2,
|
||||
forceParse: 0,
|
||||
format: "yyyy/mm/dd/"
|
||||
});
|
||||
// 更改网页标题
|
||||
document.title = "图床广场 今日上传<?php echo $todayUpload;?>张 昨日<?php echo $yesterdayUpload;?>张 - <?php echo $config['title'];?> "
|
||||
//懒加载
|
||||
var lazy = new Lazy({
|
||||
onload: function(elem) {
|
||||
console.log(elem)
|
||||
},
|
||||
delay: 300
|
||||
})</script>
|
||||
<?php require_once APP_ROOT . '/libs/footer.php';
|
||||
4
public/.htaccess
Executable file
4
public/.htaccess
Executable file
@@ -0,0 +1,4 @@
|
||||
<FilesMatch "\.(?i:php|php3|php4|php5)">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
3548
public/static/jscolor.js
Executable file
3548
public/static/jscolor.js
Executable file
File diff suppressed because it is too large
Load Diff
1
public/static/jscolor.min.js
vendored
Executable file
1
public/static/jscolor.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
4
public/static/zui/css/zui.min.css
vendored
4
public/static/zui/css/zui.min.css
vendored
File diff suppressed because one or more lines are too long
6
public/static/zui/js/zui.min.js
vendored
6
public/static/zui/js/zui.min.js
vendored
File diff suppressed because one or more lines are too long
14
public/static/zui/lib/chart/excanvas.js
Executable file
14
public/static/zui/lib/chart/excanvas.js
Executable file
File diff suppressed because one or more lines are too long
14
public/static/zui/lib/chart/zui.chart.min.js
vendored
Executable file
14
public/static/zui/lib/chart/zui.chart.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -2,4 +2,4 @@
|
||||
* Datetimepicker for Bootstrap
|
||||
* Copyright 2012 Stefan Petre
|
||||
* Licensed under the Apache License v2.0
|
||||
*/.datetimepicker{padding:4px;margin-top:1px;white-space:normal;border-radius:4px;direction:ltr}.datetimepicker.datetimepicker-rtl{direction:rtl}.datetimepicker.datetimepicker-rtl table tr td span{float:right}.datetimepicker>div{display:none}.datetimepicker.minutes div.datetimepicker-minutes{display:block}.datetimepicker.hours div.datetimepicker-hours{display:block}.datetimepicker.days div.datetimepicker-days{display:block}.datetimepicker.months div.datetimepicker-months{display:block}.datetimepicker.years div.datetimepicker-years{display:block}.datetimepicker table{margin:0}.datetimepicker table tr td.minute:hover{cursor:pointer;background:#eee}.datetimepicker table tr td.hour:hover{cursor:pointer;background:#eee}.datetimepicker table tr td.day:hover{cursor:pointer;background:#eee}.datetimepicker table tr td span{display:block;float:left;width:23%;height:54px;margin:1%;line-height:54px;cursor:pointer;border-radius:4px}.datetimepicker table tr td span:hover{background:#eee}.datetimepicker table tr td span.old{color:#999}.datetimepicker .datetimepicker-hours span{height:26px;line-height:26px}.datetimepicker .datetimepicker-minutes span{height:26px;line-height:26px}.datetimepicker th.switch{width:145px}.datetimepicker-inline{width:220px}.datetimepicker-dropdown,.datetimepicker-dropdown-left{top:0;left:0}[class*=datetimepicker-dropdown]:before{position:absolute;display:inline-block;content:'';border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);border-left:7px solid transparent}[class*=datetimepicker-dropdown]:after{position:absolute;display:inline-block;content:'';border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent}[class*=datetimepicker-dropdown-top]:before{display:inline-block;content:'';border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);border-right:7px solid transparent;border-bottom:0;border-left:7px solid transparent}[class*=datetimepicker-dropdown-top]:after{display:inline-block;content:'';border-top:6px solid #fff;border-right:6px solid transparent;border-bottom:0;border-left:6px solid transparent}.datetimepicker-dropdown-bottom-left:before{top:-7px;right:6px}.datetimepicker-dropdown-bottom-left:after{top:-6px;right:7px}.datetimepicker-dropdown-bottom-right:before{top:-7px;left:6px}.datetimepicker-dropdown-bottom-right:after{top:-6px;left:7px}.datetimepicker-dropdown-top-left:before{right:6px;bottom:-7px}.datetimepicker-dropdown-top-left:after{right:7px;bottom:-6px}.datetimepicker-dropdown-top-right:before{bottom:-7px;left:6px}.datetimepicker-dropdown-top-right:after{bottom:-6px;left:7px}.datetimepicker td,.datetimepicker th{width:22px;height:20px;padding:3px 0;text-align:center;border:none;border-radius:4px}.table-striped .datetimepicker td,.table-striped .datetimepicker th{background-color:transparent}.datetimepicker td.new,.datetimepicker td.old{color:#999}.datetimepicker td.disabled,.datetimepicker td.disabled:hover{color:#999;cursor:default;background:0 0}.datetimepicker td.day.today{color:#fff;background-color:#f1a325;border-color:#f1a325;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25)}.datetimepicker td.day.active{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#3280fc;border-color:#0462f7;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25)}.datetimepicker td.day.active:hover{background-color:#0462f7}.datetimepicker td.day.today.active:hover,.datetimepicker td.day.today:hover{background-color:#d5890e}.datetimepicker .datetimepicker-hours td span.hour_am,.datetimepicker .datetimepicker-hours td span.hour_pm{width:14.6%}.datetimepicker .datetimepicker-hours fieldset legend,.datetimepicker .datetimepicker-minutes fieldset legend{margin-bottom:inherit;line-height:30px}.datetimepicker td span.disabled,.datetimepicker td span.disabled:hover{color:#999;cursor:default;background:0 0}.datetimepicker td span.active,.datetimepicker td span.active.disabled,.datetimepicker td span.active.disabled:hover,.datetimepicker td span.active:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#3280fc;border-color:#0462f7;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25)}.datetimepicker tfoot tr:first-child th,.datetimepicker thead tr:first-child th{cursor:pointer}.datetimepicker tfoot tr:first-child th:hover,.datetimepicker thead tr:first-child th:hover{background:#eee}.input-group.date>.input-group-addon{border-left:none}.input-append.date .add-on i,.input-group.date .input-group-addon span,.input-prepend.date .add-on i{width:14px;height:14px;cursor:pointer}
|
||||
*/.datetimepicker{padding:4px;margin-top:1px;white-space:normal;border-radius:4px;direction:ltr}.datetimepicker.datetimepicker-rtl{direction:rtl}.datetimepicker.datetimepicker-rtl table tr td span{float:right}.datetimepicker>div{display:none}.datetimepicker.minutes div.datetimepicker-minutes{display:block}.datetimepicker.hours div.datetimepicker-hours{display:block}.datetimepicker.days div.datetimepicker-days{display:block}.datetimepicker.months div.datetimepicker-months{display:block}.datetimepicker.years div.datetimepicker-years{display:block}.datetimepicker table{margin:0}.datetimepicker table tr td.minute:hover{cursor:pointer;background:#eee}.datetimepicker table tr td.hour:hover{cursor:pointer;background:#eee}.datetimepicker table tr td.day:hover{cursor:pointer;background:#eee}.datetimepicker table tr td span{display:block;float:left;width:23%;height:54px;margin:1%;line-height:54px;cursor:pointer;border-radius:4px}.datetimepicker table tr td span:hover{background:#eee}.datetimepicker table tr td span.old{color:#999}.datetimepicker .datetimepicker-hours span{height:26px;line-height:26px}.datetimepicker .datetimepicker-minutes span{height:26px;line-height:26px}.datetimepicker th.switch{width:145px}.datetimepicker-inline{width:220px}.datetimepicker-dropdown,.datetimepicker-dropdown-left{top:0;left:0}[class*=datetimepicker-dropdown]:before{position:absolute;display:inline-block;content:'';border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);border-left:7px solid transparent}[class*=datetimepicker-dropdown]:after{position:absolute;display:inline-block;content:'';border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent}[class*=datetimepicker-dropdown-top]:before{display:inline-block;content:'';border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);border-right:7px solid transparent;border-bottom:0;border-left:7px solid transparent}[class*=datetimepicker-dropdown-top]:after{display:inline-block;content:'';border-top:6px solid #fff;border-right:6px solid transparent;border-bottom:0;border-left:6px solid transparent}.datetimepicker-dropdown-bottom-left:before{top:-7px;right:6px}.datetimepicker-dropdown-bottom-left:after{top:-6px;right:7px}.datetimepicker-dropdown-bottom-right:before{top:-7px;left:6px}.datetimepicker-dropdown-bottom-right:after{top:-6px;left:7px}.datetimepicker-dropdown-top-left:before{right:6px;bottom:-7px}.datetimepicker-dropdown-top-left:after{right:7px;bottom:-6px}.datetimepicker-dropdown-top-right:before{bottom:-7px;left:6px}.datetimepicker-dropdown-top-right:after{bottom:-6px;left:7px}.datetimepicker td,.datetimepicker th{width:22px;height:20px;padding:3px 0;text-align:center;border:none;border-radius:4px}.table-striped .datetimepicker td,.table-striped .datetimepicker th{background-color:transparent}.datetimepicker td.new,.datetimepicker td.old{color:#999}.datetimepicker td.disabled,.datetimepicker td.disabled:hover{color:#999;cursor:default;background:0 0}.datetimepicker td.day.today{color:#fff;background-color:#f1a325;border-color:#f1a325;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25)}.datetimepicker td.day.active{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#3280fc;border-color:#0462f7;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25)}.datetimepicker td.day.active:hover{background-color:#0462f7}.datetimepicker td.day.today.active:hover,.datetimepicker td.day.today:hover{background-color:#d5890e}.datetimepicker .datetimepicker-hours td span.hour_am,.datetimepicker .datetimepicker-hours td span.hour_pm{width:14.6%}.datetimepicker .datetimepicker-hours fieldset legend,.datetimepicker .datetimepicker-minutes fieldset legend{margin-bottom:inherit;line-height:30px}.datetimepicker td span.disabled,.datetimepicker td span.disabled:hover{color:#999;cursor:default;background:0 0}.datetimepicker td span.active,.datetimepicker td span.active.disabled,.datetimepicker td span.active.disabled:hover,.datetimepicker td span.active:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#3280fc;border-color:#0462f7;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25)}.datetimepicker tfoot tr:first-child th,.datetimepicker thead tr:first-child th{cursor:pointer}.datetimepicker tfoot tr:first-child th:hover,.datetimepicker thead tr:first-child th:hover{background:#eee}.input-group.date>.input-group-addon{border-left:none}.input-append.date .add-on i,.input-group.date .input-group-addon span,.input-prepend.date .add-on i{width:14px;height:14px;cursor:pointer}.datetimepicker-only-time table{width:190px}.datetimepicker-only-time tfoot,.datetimepicker-only-time thead{display:none}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* ZUI: 文件上传 - v1.9.2 - 2021-06-16
|
||||
* ZUI: 文件上传 - v1.10.0 - 2021-11-04
|
||||
* http://openzui.com
|
||||
* GitHub: https://github.com/easysoft/zui.git
|
||||
* Copyright (c) 2021 cnezsoft.com; Licensed MIT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* ZUI: 文件上传 - v1.9.2 - 2021-06-16
|
||||
* ZUI: 文件上传 - v1.10.0 - 2021-11-04
|
||||
* http://openzui.com
|
||||
* GitHub: https://github.com/easysoft/zui.git
|
||||
* Copyright (c) 2021 cnezsoft.com; Licensed MIT
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
User-agent: *
|
||||
Disallow:
|
||||
Disallow: /config/
|
||||
Disallow: /admin/
|
||||
Reference in New Issue
Block a user