You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-19 12:03:58 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e317957193 | ||
|
|
f1c922ee5e | ||
|
|
9554ae6107 | ||
|
|
749f0ab814 | ||
|
|
3b523ceb2c | ||
|
|
d2a1a90670 | ||
|
|
aebb5d173f | ||
|
|
c203431179 | ||
|
|
b11a776195 |
67
README.md
67
README.md
@@ -4,14 +4,18 @@
|
||||
之前一直用的图床程序是:[PHP多图长传程序2.4.3](https://www.jb51.net/codes/40544.html)
|
||||
由于版本过老并且使用falsh上传,在当前html5流行大势所趋下,遂利用基础知识新写了一个以html5为默认上传并且支持flash,向下兼容至IE9。
|
||||
|
||||
[](http://php.net)
|
||||
[](https://github.com/icret/EasyImages2.0/stargazers)
|
||||
[](https://github.com/icret/EasyImages2.0/network/members)
|
||||
[](http://php.net)
|
||||
[](https://github.com/icret/EasyImages2.0/releases)
|
||||
[](https://github.com/icret/EasyImages2.0/issues)
|
||||
[](https://github.com/icret/EasyImages2.0/stargazers)
|
||||
[](https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@EasyImage2.0/)
|
||||
[](https://github.com/icret/EasyImages2.0)
|
||||
[](https://github.com/icret/EasyImages2.0/blob/master/LICENSE)
|
||||
[](https://jq.qq.com/?_wv=1027&k=jfXRHU8Y)
|
||||
<!--
|
||||
[](https://github.com/icret/EasyImages2.0/stargazers)
|
||||
[](https://github.com/icret/EasyImages2.0/issues)
|
||||
[](https://github.com/icret/EasyImages2.0)
|
||||
-->
|
||||
|
||||
>[演示](https://png.cm/) | [Chrome/Edge 插件](https://github.com/icret/EasyImage-Browser-Extension) | [使用手册](https://www.kancloud.cn/easyimage/easyimage/) | [Telegram](https://t.me/Easy_Image)
|
||||
>
|
||||
@@ -19,7 +23,7 @@
|
||||
|
||||
## 目录
|
||||
|
||||
[特点](#特点)-[注意](#常见问题)-[安装](#安装)-[升级](#程序升级)-[安全](#安全配置)-[鉴黄](#鉴黄)-[更新日志](#更新日志)-[支持开发者](#支持开发者)-[界面演示](#界面演示)-[兼容](#兼容)-[鸣谢](#鸣谢)-[许可证](#开源许可)
|
||||
[特点](#特点)-[注意](#常见问题)-[安装](#安装)-[升级](#程序升级)-[安全](#安全配置)-[API](#API上传)-[鉴黄](#鉴黄)-[更新日志](#更新日志)-[支持开发者](#支持开发者)-[界面演示](#界面演示)-[兼容](#兼容)-[鸣谢](#鸣谢)-[许可证](#开源许可)
|
||||
|
||||
## 特点
|
||||
|
||||
@@ -39,6 +43,27 @@
|
||||
- [x] 支持创建仅上传用户
|
||||
- [x] 更多支持请安装尝试···
|
||||
|
||||
## 安装
|
||||
> 推荐环境:Nginx + PHP≥7.0 + linux
|
||||
#### windows:
|
||||
- 下载简单图床 [最新版](https://github.com/icret/EasyImages2.0/archive/refs/heads/master.zip)|[稳定版](https://github.com/icret/EasyImages2.0/releases) 上传至web根目录
|
||||
|
||||
#### Linux:
|
||||
|
||||
- `git clone https://github.com/icret/EasyImages2.0.git` 至web目录
|
||||
|
||||
- 赋予web目录www:www和0755权限:
|
||||
```shell
|
||||
chmod 755 -R /web目录
|
||||
chown -R www:www /web目录
|
||||
```
|
||||
|
||||
#### BT宝塔面板
|
||||
- 安装环境 Ngixn(推荐) / Apache + PHP(推荐≥7.0)
|
||||
- 软件商店搜索`简单图床`一键部署
|
||||
|
||||
>更多安装方式和问题请查阅->[使用手册](https://www.kancloud.cn/easyimage/easyimage/2625222)
|
||||
|
||||
## 常见问题
|
||||
|
||||
1. 请将所有文件赋予`0755`和`www`权限
|
||||
@@ -64,27 +89,8 @@ location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
|
||||
}
|
||||
```
|
||||
|
||||
## 安装
|
||||
> 推荐环境:Nginx + PHP≥7.0 + linux
|
||||
#### windows:
|
||||
- 下载简单图床 [最新版](https://github.com/icret/EasyImages2.0/archive/refs/heads/master.zip)|[稳定版](https://github.com/icret/EasyImages2.0/releases) 上传至web根目录
|
||||
|
||||
#### Linux:
|
||||
|
||||
- `git clone https://github.com/icret/EasyImages2.0.git` 至web目录
|
||||
|
||||
- 赋予web目录www:www和0755权限:
|
||||
```shell
|
||||
chmod 755 -R /web目录
|
||||
chown -R www:www /web目录
|
||||
```
|
||||
|
||||
#### BT宝塔面板
|
||||
- 安装环境 Ngixn(推荐) / Apache + PHP(推荐≥7.0)
|
||||
- 软件商店搜索`简单图床`一键部署
|
||||
|
||||
#### API使用
|
||||
- 示例
|
||||
#### API上传
|
||||
- 需要开启图床安全->API上传示例
|
||||
```html
|
||||
<form action="http://127.0.0.1/api/index.php" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="image" accept="image/*">
|
||||
@@ -174,6 +180,15 @@ $HTTP["url"] =~ "^/(i|public)/" {
|
||||
|
||||
<details><summary>点击查看2.0版更新日志</summary>
|
||||
|
||||
* 2022-05-04 v2.6.2
|
||||
- 增加API/用户文件浏览和删除
|
||||
- 增加转换webp后也会添加水印
|
||||
- 转换成webp后不建议开启水印,会增大图片体积
|
||||
- webp水印消耗更多PHP内存,PHP8以上有很大概率失败
|
||||
- 更改广场页面返回顶部
|
||||
- 优化了管理界面UI
|
||||
- 修复一些bug
|
||||
|
||||
* 2022-05-03 v2.6.1
|
||||
- 增加登陆用户有效期
|
||||
- 增加管理员/登陆用户/Token专用目录
|
||||
|
||||
@@ -81,10 +81,51 @@ if (isset($_GET['stop_token'])) {
|
||||
}).show();
|
||||
</script>
|
||||
';
|
||||
header("refresh:2;url=" . $config['domain'] . "/admin/admin.inc.php");
|
||||
header("refresh:1;url=/admin/admin.inc.php");
|
||||
}
|
||||
|
||||
// 删除guset.config.php数组对
|
||||
// 删除Token
|
||||
if (isset($_GET['delete_token'])) {
|
||||
unset($tokenList[$_GET['delete_token']]);
|
||||
$config_file = APP_ROOT . '/config/api_key.php';
|
||||
cache_write($config_file, $tokenList, 'tokenList');
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("删除Token用户成功!", {
|
||||
type: "primary", // 定义颜色主题
|
||||
icon: "ok-sign" // 定义消息图标
|
||||
}).show();
|
||||
</script>
|
||||
';
|
||||
header("refresh:1;url=/admin/admin.inc.php");
|
||||
}
|
||||
|
||||
// 禁用用户
|
||||
if (isset($_GET['stop_guest'])) {
|
||||
$stop_guest = $_GET['stop_guest'];
|
||||
$postArr = array(
|
||||
$stop_guest => array(
|
||||
'password' => $guestConfig[$stop_guest]['password'],
|
||||
'expired' => time(),
|
||||
'add_time' => $guestConfig[$stop_guest]['add_time']
|
||||
)
|
||||
);
|
||||
$new_config = array_replace($guestConfig, $postArr);
|
||||
$config_file = APP_ROOT . '/config/config.guest.php';
|
||||
cache_write($config_file, $new_config, 'guestConfig');
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("禁用上传用户成功!", {
|
||||
type: "primary", // 定义颜色主题
|
||||
icon: "ok-sign" // 定义消息图标
|
||||
}).show();
|
||||
</script>
|
||||
';
|
||||
header("refresh:1;url=/admin/admin.inc.php");
|
||||
}
|
||||
|
||||
|
||||
// 删除用户
|
||||
if (isset($_GET['delete_guest'])) {
|
||||
unset($guestConfig[$_GET['delete_guest']]);
|
||||
$config_file = APP_ROOT . '/config/config.guest.php';
|
||||
@@ -97,6 +138,7 @@ if (isset($_GET['delete_guest'])) {
|
||||
}).show();
|
||||
</script>
|
||||
';
|
||||
header("refresh:1;url=/admin/admin.inc.php");
|
||||
}
|
||||
|
||||
// 添加上传账号 修改config.guest.php
|
||||
@@ -164,6 +206,8 @@ if (isset($_GET['suspic_reimg'])) {
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
header("refresh:1;url=/admin/admin.inc.php");
|
||||
}
|
||||
|
||||
// 回收站恢复图片
|
||||
@@ -188,6 +232,8 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
header("refresh:1;url=/admin/admin.inc.php");
|
||||
}
|
||||
?>
|
||||
<div class="row" style="margin-bottom:100px">
|
||||
@@ -407,9 +453,10 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
<input type="hidden" class="form-control" name="update" value="<?php echo date("Y-m-d H:i:s"); ?>" placeholder="隐藏的保存">
|
||||
<button type="submit" class="btn btn-mini btn-primary">保存</button>
|
||||
</form>
|
||||
<h5 class="page-header">Token列表: <?php if (!$config['token_path_status']) echo '<small>* 删除按钮需开启Token分离, 删除后不可恢复</small>'; ?></h5>
|
||||
<p><kbd>API调用网址:<?php echo $config['domain']; ?>/api/index.php</kbd></p>
|
||||
<table class="table table-hover table-bordered table-condensed table-responsive visible-xs visible-sm" style="margin-top: 10px;">
|
||||
<h5 class="page-header">Token列表: <?php if (!$config['token_path_status']) echo '<small>* 部分按钮需开启Token分离才能激活, 删除后不可恢复</small>'; ?></h5>
|
||||
<p class="text-primary">API调用地址: <code><?php echo $config['domain']; ?>/api/index.php</code></p>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-condensed table-hover table-bordered visible-xs visible-sm" style="margin-top: 10px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
@@ -431,13 +478,16 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
<td><?php echo get_file_by_glob(APP_ROOT . $config['path'] . $value['id'], $type = 'number'); ?></td>
|
||||
<td><?php echo $expired; ?></td>
|
||||
<td>
|
||||
<a class="btn btn-mini btn-danger" href="admin.inc.php?stop_token=<?php echo $key; ?>">禁用</a>
|
||||
<a href='/admin/manager.php?p=<?php echo $value['id']; ?>' target='_blank' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>文件</a>
|
||||
<a href='admin.inc.php?stop_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>禁用</a>
|
||||
<a href='admin.inc.php?delete_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>删除</a>
|
||||
<a href='admin.inc.php?delDir=<?php echo $value['id']; ?>' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>删除上传</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="myDataGrid" class="datagrid table-bordered visible-md visible-lg">
|
||||
<div class="input-control search-box search-box-circle has-icon-left has-icon-right" id="searchboxExample2" style="margin-bottom: 10px;">
|
||||
<input id="inputSearchExample2" type="search" class="form-control search-input input-sm" placeholder="搜索Token">
|
||||
@@ -679,7 +729,7 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
$file_path = $config['path'] . 'suspic/' . $cache_file[$i]; // 相对路径
|
||||
$file_size = getDistUsed(filesize($file_cache_path)); // 大小
|
||||
$filen_name = $cache_file[$i]; // 名称
|
||||
$url = rand_imgurl() . $config['path'] . 'suspic/' . $cache_file[$i]; // 网络连接
|
||||
$url = $config['domain'] . $config['path'] . 'suspic/' . $cache_file[$i]; // 网络连接
|
||||
$unlink_img = $config['domain'] . '/application/del.php?url=' . $file_path; // 删除连接
|
||||
?>
|
||||
<tr>
|
||||
@@ -923,15 +973,19 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($guestConfig as $key => $value) : ?>
|
||||
<?php foreach ($guestConfig as $key => $value) :
|
||||
$expired = $value['expired'] < time() ? '<p class="text-gray">已过期</p>' : '<p class="text-green">' . date('Y年m月d日 H:i:s', $value['expired']) . '</p>';
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $key; ?></td>
|
||||
<td><?php echo $value['password']; ?></td>
|
||||
<td> <?php echo date('Y年m月d日 H:i:s', $value['add_time']); ?></td>
|
||||
<td> <?php echo date('Y年m月d日 H:i:s', $value['expired']); ?></td>
|
||||
<td> <?php echo $expired; ?></td>
|
||||
<td><?php echo get_file_by_glob(APP_ROOT . $config['path'] . $key, $type = 'number'); ?></td>
|
||||
<td>
|
||||
<a class='btn btn-mini btn-danger' href='admin.inc.php?delete_guest=<?php echo $key; ?>'>删除账户</a>
|
||||
<a href='/admin/manager.php?p=<?php echo $key; ?>' target='_blank' class='btn btn-mini btn-primary <?php if (!$config['guest_path_status']) echo 'disabled'; ?>'>文件</a>
|
||||
<a href='admin.inc.php?stop_guest=<?php echo $key; ?>' class='btn btn-mini btn-danger'>禁用</a>
|
||||
<a class='btn btn-mini btn-danger' href='admin.inc.php?delete_guest=<?php echo $key; ?>'>删除</a>
|
||||
<a class='btn btn-mini btn-primary <?php if (!$config['guest_path_status']) echo 'disabled'; ?>' href='admin.inc.php?delDir=<?php echo $key; ?>'>删除上传</a>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -977,7 +1031,7 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
$file_path = $config['path'] . 'recycle/' . $cache_file[$i]; // 相对路径
|
||||
$file_size = getDistUsed(filesize($file_cache_path)); // 大小
|
||||
$filen_name = $cache_file[$i]; // 名称
|
||||
$url = rand_imgurl() . $config['path'] . 'recycle/' . $cache_file[$i]; // 网络连接
|
||||
$url = $config['domain'] . $config['path'] . 'recycle/' . $cache_file[$i]; // 网络连接
|
||||
$unlink_img = $config['domain'] . '/application/del.php?url=' . $file_path; // 删除连接
|
||||
?>
|
||||
<tr>
|
||||
@@ -1109,15 +1163,14 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
<div class="tab-pane fade" id="Content14">
|
||||
<!-- <h4>文件管理 <small>Tinyfilemanager是由作者定制开发,非必要请勿替换</small></h4> -->
|
||||
<h5 class="header-dividing">文件管理 <small>Tinyfilemanager是由作者定制开发,非必要请勿替换</small></h5>
|
||||
<a class="btn btn-mini btn-primary" href="<?php echo $config['domain'] . '/admin/manager.php?p=' . date('Y/m/d'); ?> " target="_blank" data-toggle="tooltip" title="使用Tinyfilemanager管理文件"><i class="icon icon-folder-open"> 文件管理</i></a>
|
||||
|
||||
<a class="btn btn-mini btn-primary" href="/admin/manager.php?p=<?php echo date('Y/m/d'); ?> " target="_blank" data-toggle="tooltip" title="使用Tinyfilemanager管理文件"><i class="icon icon-folder-open"> 文件管理</i></a>
|
||||
<!-- <h4>删除文件 <small>* 删除后不可恢复</small></h4> -->
|
||||
<h5 class="header-dividing">删除文件 <small>* 删除后不可恢复</small></h5>
|
||||
<form class="form-inline" method="get" action="../application/del.php" id="form" name="delForm" target="_blank">
|
||||
<p id="delimgurl"></p>
|
||||
<div class="form-group">
|
||||
<label for="del" class="text-primary">删除单张图片文件: </label>
|
||||
<input type="url" name="url" class="form-control input-sm" id="del" placeholder="请输入图片链接">
|
||||
<input type="url" name="url_admin_inc" class="form-control input-sm" id="del" placeholder="请输入图片链接">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-sm btn-primary" onClick="return confirm('确认要删除?\n* 删除文件后将无法恢复! ');">删除单文件</button>
|
||||
</form>
|
||||
@@ -1260,7 +1313,7 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
name: 'manage',
|
||||
label: '管理Token',
|
||||
html: true,
|
||||
width: 0.2
|
||||
width: 0.25
|
||||
},
|
||||
],
|
||||
array: [
|
||||
@@ -1271,7 +1324,7 @@ if (isset($_GET['recycle_reimg'])) {
|
||||
add_time: '<?php echo date('Y年m月d日 H:i:s', $value['add_time']); ?>',
|
||||
expired: '<?php echo $expired; ?>',
|
||||
number: <?php echo get_file_by_glob(APP_ROOT . $config['path'] . $value['id'], $type = 'number'); ?>,
|
||||
manage: "<a href='admin.inc.php?stop_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>禁用</a> <a href='admin.inc.php?delDir=<?php echo $value['id']; ?>' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>删除上传</a>"
|
||||
manage: "<a href='/admin/manager.php?p=<?php echo $value['id']; ?>' target='_blank' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>文件</a> <a href='admin.inc.php?stop_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>禁用</a> <a href='admin.inc.php?delete_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>删除</a> <a href='admin.inc.php?delDir=<?php echo $value['id']; ?>' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>删除上传</a>"
|
||||
},
|
||||
<?php endforeach; ?>
|
||||
]
|
||||
|
||||
@@ -78,6 +78,12 @@ class Imgs
|
||||
imagecopyresampled($temp_img, $im, 0, 0, 0, 0, $temp_w, $temp_h, $width, $height);
|
||||
imagepng($temp_img, $savepath, 100);
|
||||
break;
|
||||
case 18:
|
||||
$im = imagecreatefromwebp($src);
|
||||
imagesavealpha($im, true); //这里很重要;3-1
|
||||
imagecopyresampled($temp_img, $im, 0, 0, 0, 0, $temp_w, $temp_h, $width, $height);
|
||||
imagewebp($temp_img, $savepath, 100);
|
||||
break;
|
||||
}
|
||||
imagedestroy($im);
|
||||
return $savepath;
|
||||
@@ -162,6 +168,10 @@ class Imgs
|
||||
$dst_img = imagecreatefrompng($src);
|
||||
imagesavealpha($dst_img, true); //这里很重要;3-1
|
||||
break;
|
||||
case 18:
|
||||
$dst_img = imagecreatefromwebp($src);
|
||||
imagesavealpha($dst_img, true); //这里很重要;3-1
|
||||
break;
|
||||
|
||||
default:
|
||||
return array('code' => false, 'msg' => '目标图片类型错误');
|
||||
@@ -200,6 +210,9 @@ class Imgs
|
||||
case 3:
|
||||
$markim = imagecreatefrompng($def['res']);
|
||||
break;
|
||||
case 18:
|
||||
$markim = imagecreatefromwebp($def['res']);
|
||||
break;
|
||||
|
||||
default:
|
||||
return array('code' => false, 'msg' => '水印图片类型错误');
|
||||
@@ -316,6 +329,9 @@ class Imgs
|
||||
case 'gif':
|
||||
imagegif($dst_img, $def['name']);
|
||||
break;
|
||||
case 'webp':
|
||||
imagegif($dst_img, $def['name']);
|
||||
break;
|
||||
default:
|
||||
return array('code' => false, 'msg' => '保存图片类型有误');
|
||||
break;
|
||||
|
||||
@@ -26,8 +26,6 @@ if (isset($_GET['hash'])) {
|
||||
$delHash = $_GET['hash'];
|
||||
$delHash = urlHash($delHash, 1);
|
||||
|
||||
// getDel($delHash, 'hash');
|
||||
|
||||
if ($config['image_recycl']) {
|
||||
// 如果开启回收站则进入回收站
|
||||
if (checkImg($delHash, 3, 'recycle/') == true) {
|
||||
@@ -57,10 +55,20 @@ if (isset($_GET['hash'])) {
|
||||
|
||||
// 检查登录后再处理url删除请求
|
||||
if (is_who_login('admin')) {
|
||||
// 删除
|
||||
|
||||
// 广场页面删除
|
||||
if (isset($_GET['url'])) {
|
||||
getDel($_GET['url'], 'url');
|
||||
}
|
||||
|
||||
// 从管理页面删除
|
||||
if (isset($_GET['url_admin_inc'])) {
|
||||
$del_url = $_GET['url_admin_inc'];
|
||||
if ($config['hide_path']) {
|
||||
$del_url = $config['domain'] . $config['path'] . parse_url($del_url)['path'];
|
||||
}
|
||||
getDel($del_url, 'url');
|
||||
}
|
||||
// 回收
|
||||
if (isset($_GET['recycle_url'])) {
|
||||
$recycle_url = $_GET['recycle_url'];
|
||||
|
||||
@@ -36,7 +36,7 @@ if ($config['notice_status'] == 1 && !empty($config['notice'])) : ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="container text-muted small navbar-fixed-bottom" style="text-align: center;background-color:rgba(255,255,255,0.7);">
|
||||
<footer class="container text-muted small navbar-fixed-bottom" style="text-align: center;background-color:rgba(255,255,255,0.7);z-index: 0;">
|
||||
<hr>
|
||||
<?php /** 页脚信息 */ if (!empty($config['footer'])) echo $config['footer']; ?>
|
||||
<p>
|
||||
|
||||
@@ -1311,6 +1311,8 @@ function is_local($url)
|
||||
|
||||
/**
|
||||
* 将图片域名转换为数组并随即输出
|
||||
* @param $text 字符串
|
||||
* @return String 随机网址
|
||||
*/
|
||||
function rand_imgurl($text = null)
|
||||
{
|
||||
@@ -1319,3 +1321,28 @@ function rand_imgurl($text = null)
|
||||
$url = explode(',', $url);
|
||||
return $url[array_rand($url, 1)];
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断webp或gif动图是否为动态图片
|
||||
* @param $src 图片的绝对路径
|
||||
* @return bool 是|否
|
||||
*/
|
||||
function isAnimatedGifWebp($src)
|
||||
{
|
||||
$ext = pathinfo($src)['extension'];
|
||||
|
||||
if ($ext == 'webp') {
|
||||
$webpContents = file_get_contents($src);
|
||||
$where = strpos($webpContents, "ANMF");
|
||||
if ($where !== FALSE) {
|
||||
// animated
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$fp = fopen($src, 'rb');
|
||||
$filecontent = fread($fp, filesize($src));
|
||||
fclose($fp);
|
||||
return strpos($filecontent, chr(0x21) . chr(0xff) . chr(0x0b) . 'NETSCAPE2.0') === FALSE ? false : true;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ if ($config['ad_top']) echo $config['ad_top_info'];
|
||||
?>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-6" style="text-align: center;">
|
||||
<a href="<?php echo $getIMG; ?>" data-toggle="lightbox" data-group="image-group-1"><img src="<?php echo parse_url($getIMG)['path']; ?>" id="img1" width="50%" height="50%" class="img-rounded" alt=" <?php echo basename($getIMG); ?>"></a>
|
||||
<a href="<?php echo $img_url; ?>" data-toggle="lightbox" data-group="image-group-1"><img src="<?php echo creat_thumbnail_by_list($getIMG); ?>" id="img1" width="350px" height="200px" class="img-rounded" alt=" <?php echo basename($getIMG); ?>"></a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h4>图片名称: <?php echo pathinfo($getIMG, PATHINFO_FILENAME); ?></h4>
|
||||
@@ -66,7 +66,7 @@ if ($config['ad_top']) echo $config['ad_top_info'];
|
||||
<div class="col-md-12" style="padding-bottom: 10px;">
|
||||
<div class="col-md-6" style="padding-bottom: 10px;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="icon icon-link"></i> 直连 </span>
|
||||
<span class="input-group-addon"><i class="icon icon-link"></i> 直 连 </span>
|
||||
<input type="text" class="form-control" id="links" onclick="copyText()" value="<?php echo $img_url; ?>">
|
||||
<span class="input-group-btn"><button class="btn btn-default copyBtn1" type="button">复制</button></span>
|
||||
</div>
|
||||
|
||||
@@ -130,18 +130,33 @@ if ($config['ad_top']) echo $config['ad_top_info'];
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 返回顶部-->
|
||||
<div class="btn btn-primary btn-back-to-top"><i class="icon icon-arrow-up"></i></div>
|
||||
</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>
|
||||
</div>
|
||||
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/EasyImage.css">
|
||||
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/viewjs/viewer.min.css">
|
||||
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css">
|
||||
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/zui/lib/bootbox/bootbox.min.css">
|
||||
<style>
|
||||
/* 返回顶部 */
|
||||
.btn-back-to-top {
|
||||
padding: 0.5rem 1rem;
|
||||
position: fixed;
|
||||
right: 2rem;
|
||||
bottom: 1rem;
|
||||
z-index: 2;
|
||||
-webkit-transition: -webkit-transform 0.2s ease;
|
||||
transition: transform 0.2s ease;
|
||||
-webkit-transform: translateY(200%);
|
||||
transform: translateY(200%);
|
||||
}
|
||||
|
||||
.btn-back-to-top.scrolled {
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0);
|
||||
}
|
||||
</style>
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/bootbox/bootbox.min.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/lazyload/lazyload.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/viewjs/viewer.min.js"></script>
|
||||
@@ -299,69 +314,24 @@ if ($config['ad_top']) echo $config['ad_top_info'];
|
||||
}
|
||||
|
||||
// 返回顶部
|
||||
$(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");
|
||||
});
|
||||
var back_to_top_button = jQuery('.btn-back-to-top');
|
||||
jQuery(window).scroll(function() {
|
||||
if (jQuery(this).scrollTop() > 100 && !back_to_top_button.hasClass('scrolled')) {
|
||||
back_to_top_button.addClass('scrolled');
|
||||
|
||||
} else if (jQuery(this).scrollTop() < 100 && back_to_top_button.hasClass('scrolled')) {
|
||||
back_to_top_button.removeClass('scrolled');
|
||||
|
||||
}
|
||||
});
|
||||
// 返回顶部
|
||||
back_to_top_button.click(function() {
|
||||
jQuery('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
|
||||
//懒加载
|
||||
var lazy = new Lazy({
|
||||
onload: function(elem) {
|
||||
|
||||
@@ -29,7 +29,7 @@ function water($source)
|
||||
// 文字水印
|
||||
if ($config['watermark'] == 1) {
|
||||
// 过滤gif
|
||||
if (isAnimatedGif($source) === 0) {
|
||||
if (!isAnimatedGifWebp($source)) {
|
||||
$arr = [
|
||||
# 水印图片路径(如果不存在将会被当成是字符串水印)
|
||||
'res' => $config['waterText'],
|
||||
@@ -48,7 +48,7 @@ function water($source)
|
||||
// 图片水印
|
||||
if ($config['watermark'] == 2) {
|
||||
// 过滤gif
|
||||
if (isAnimatedGif($source) === 0) {
|
||||
if (!isAnimatedGifWebp($source)) {
|
||||
$arr = [
|
||||
# 水印图片路径(如果不存在将会被当成是字符串水印)
|
||||
'res' => APP_ROOT . $config['waterImg'],
|
||||
|
||||
@@ -15,7 +15,7 @@ $config=Array
|
||||
'user'=>'admin',
|
||||
'password'=>'e6e061838856bf47e1de730719fb2609',
|
||||
'mustLogin'=>0,
|
||||
'apiStatus'=>1,
|
||||
'apiStatus'=>0,
|
||||
'path'=>'/i/',
|
||||
'mime'=>'image/*,video/*',
|
||||
'imgName'=>'default',
|
||||
@@ -80,7 +80,7 @@ $config=Array
|
||||
9=>'month'
|
||||
),
|
||||
'language'=>0,
|
||||
'login_bg'=>'https://png.cm/public/images/login_bg.jpg',
|
||||
'login_bg'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@2.6.2/public/images/login_bg.jpg',
|
||||
'image_recycl'=>1,
|
||||
'tinyfilemanager'=>1,
|
||||
'delDir'=>'thumbnails/',
|
||||
@@ -91,8 +91,8 @@ $config=Array
|
||||
'guest_path_status'=>0,
|
||||
'token_path_status'=>0,
|
||||
'admin_path'=>'u',
|
||||
'version'=>'2.6.1',
|
||||
'update'=>'2022-05-03 19:00:49',
|
||||
'version'=>'2.6.2',
|
||||
'update'=>'2022-05-04 22:54:32',
|
||||
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
|
||||
@@ -21,7 +21,7 @@ if (!IS_WIN) {
|
||||
} else {
|
||||
$file_php = false;
|
||||
}
|
||||
if (is_writable(APP_ROOT . '/i/')) {
|
||||
if (is_writable(APP_ROOT . $config['path'])) {
|
||||
$i_wjj = true;
|
||||
} else {
|
||||
$i_wjj = false;
|
||||
|
||||
BIN
public/images/login_bg.jpg
Executable file
BIN
public/images/login_bg.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
Reference in New Issue
Block a user