2.4.5 beta 2

pull/18/head
icret 2022-01-13 02:48:08 +08:00
parent 52e929563f
commit 8412ff1405
9 changed files with 1256 additions and 1200 deletions

View File

@ -86,8 +86,14 @@ Deny from all
<details><summary><mark><font color=darkred>点击查看2.0版更新日志</font></mark></summary> <details><summary><mark><font color=darkred>点击查看2.0版更新日志</font></mark></summary>
* 2022-1-13 v2.4.5 beta 2
- 修复一处权限问题
- 修复恢复可疑图片
- 增加复制提示
- 增加默认上传后首选显示链接
* 2022-1-3 v2.4.5 beta * 2022-1-3 v2.4.5 beta
- 增加复制提示
- 更新安装代码 - 更新安装代码
- 更改前端样式 - 更改前端样式
- 更新上传格式 - 更新上传格式
@ -103,7 +109,6 @@ Deny from all
- 修复开启前端压缩导致的上传图片异常 - 修复开启前端压缩导致的上传图片异常
- 屏蔽因缺少PHP扩展而不能生成缩略图的格式 - 屏蔽因缺少PHP扩展而不能生成缩略图的格式
* 2021-12-25 v2.4.4 * 2021-12-25 v2.4.4
- 更改favicon.ico - 更改favicon.ico
- 修复缩略图数量统计 - 修复缩略图数量统计

View File

@ -13,7 +13,8 @@ if (!is_online()) {
echo ' echo '
<script> new $.zui.Messager("请登录后再修改!", {type: "danger" // 定义颜色主题 <script> new $.zui.Messager("请登录后再修改!", {type: "danger" // 定义颜色主题
}).show();</script>'; }).show();</script>';
exit(require_once APP_ROOT . '/application/login.php'); require_once APP_ROOT . '/application/login.php';
exit;
} }
if (isset($_POST['form'])) { if (isset($_POST['form'])) {
@ -24,7 +25,7 @@ if (isset($_POST['form'])) {
echo ' echo '
<script> <script>
new $.zui.Messager("保存成功", { new $.zui.Messager("保存成功", {
type: "success" // 定义颜色主题 type: "primary" // 定义颜色主题
}).show(); }).show();
</script> </script>
'; ';
@ -55,6 +56,11 @@ if (isset($_POST['radio'])) {
$radio_value = null; $radio_value = null;
} }
} }
// 恢复图片
if (isset($_GET['reimg'])) {
$name = $_GET['reimg'];
re_checkImg($name);
}
?> ?>
<div class="container"> <div class="container">
@ -75,10 +81,11 @@ if (isset($_POST['radio'])) {
<ul class="nav nav-tabs nav-stacked" id="tabC"> <ul class="nav nav-tabs nav-stacked" id="tabC">
<li class="active"><a data-tab href="#Content1">网站设置</a></li> <li class="active"><a data-tab href="#Content1">网站设置</a></li>
<li><a data-tab href="#Content2">上传设置</a></li> <li><a data-tab href="#Content2">上传设置</a></li>
<li><a data-tab href="#Content7">违规图片</a></li> <li><a data-tab href="#Content9">界面设置</a></li>
<li><a data-tab href="#Content4">文件操作</a></li> <li><a data-tab href="#Content5">API 设置</a></li>
<li><a data-tab href="#Content5">API/Token</a></li>
<li><a data-tab href="#Content3">拓展设置</a></li> <li><a data-tab href="#Content3">拓展设置</a></li>
<li><a data-tab href="#Content7">可疑图片</a></li>
<li><a data-tab href="#Content4">文件操作</a></li>
<li><a data-tab href="#Content6">安全设置</a></li> <li><a data-tab href="#Content6">安全设置</a></li>
<li><a data-tab href="#Content8">系统信息</a></li> <li><a data-tab href="#Content8">系统信息</a></li>
</ul> </ul>
@ -86,7 +93,7 @@ if (isset($_POST['radio'])) {
<div class="col-xs-9"> <div class="col-xs-9">
<div class="tab-content col-xs-9"> <div class="tab-content col-xs-9">
<div class="tab-pane fade active in" id="Content1"> <div class="tab-pane fade active in" id="Content1">
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()"> <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<div class="form-group"> <div class="form-group">
<label>网站域名,末尾不加"/" </label> <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,'')"> <input type="url" class="form-control" name="domain" required="required" value="<?php echo $config['domain']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')">
@ -116,7 +123,7 @@ if (isset($_POST['radio'])) {
<textarea class="form-control" rows="3" name="footer" required="required"><?php echo $config['footer']; ?></textarea> <textarea class="form-control" rows="3" name="footer" required="required"><?php echo $config['footer']; ?></textarea>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>更改网站配色</label> <label>网站配色</label>
<select class="chosen-select form-control" name="theme"> <select class="chosen-select form-control" name="theme">
<option value="default" <?php if ($config['theme'] == 'default') {echo 'selected';} ?>>默认配色</option> <option value="default" <?php if ($config['theme'] == 'default') {echo 'selected';} ?>>默认配色</option>
<option value="red" <?php if ($config['theme'] == 'red') {echo 'selected';} ?>>红色</option> <option value="red" <?php if ($config['theme'] == 'red') {echo 'selected';} ?>>红色</option>
@ -211,7 +218,7 @@ if (isset($_POST['radio'])) {
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>转换图片为指定格式<?php echo $config['imgConvert']; ?></label> <label>将上传图片转换为指定格式<?php echo $config['imgConvert']; ?></label>
<select class="chosen-select form-control" name="imgConvert"> <select class="chosen-select form-control" name="imgConvert">
<option value="" <?php if (empty($config['imgConvert'])) {echo 'selected';} ?>>不转换</option> <option value="" <?php if (empty($config['imgConvert'])) {echo 'selected';} ?>>不转换</option>
<option value="webp" <?php if ($config['imgConvert']=='webp') {echo 'selected';} ?>>WEBP</option> <option value="webp" <?php if ($config['imgConvert']=='webp') {echo 'selected';} ?>>WEBP</option>
@ -254,7 +261,7 @@ if (isset($_POST['radio'])) {
<input type="text" class="form-control" name="waterImg" required="required" value="<?php echo $config['waterImg']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')"> <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>
<div class="form-group"> <div class="form-group">
<label>水印位置</label> <label>水印位置(不开启水印方式不生效)</label>
<select class="chosen-select form-control" name="waterPosition"> <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="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="2" <?php if ($config['waterPosition'] == 2) {echo 'selected';} ?>>顶部居中</option>
@ -465,11 +472,11 @@ if (isset($_POST['radio'])) {
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()"> <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()">
<div class="form-group"> <div class="form-group">
<div class="input-control has-icon-left"> <div class="input-control has-icon-left">
<input type="text" name="user" id="account" class="form-control" placeholder="更改登录用户名"> <input type="text" name="user" id="account" class="form-control" placeholder="更改管理账号 - 不填则保持默认">
<label for="account" class="input-control-icon-left"><i class="icon icon-user "></i></label> <label for="account" class="input-control-icon-left"><i class="icon icon-user "></i></label>
</div> </div>
<div class="input-control has-icon-left" style="margin-top: 10px;"> <div class="input-control has-icon-left" style="margin-top: 10px;">
<input type="text" name="password" id="password" class="form-control" placeholder="更改登录密码"> <input type="text" name="password" id="password" class="form-control" placeholder="更改管理密码 - 不填则保持默认">
<input type="hidden" name="password" id="md5_password"> <input type="hidden" name="password" id="md5_password">
<label for="password" class="input-control-icon-left"><i class="icon icon-key"></i></label> <label for="password" class="input-control-icon-left"><i class="icon icon-key"></i></label>
</div> </div>
@ -477,12 +484,83 @@ if (isset($_POST['radio'])) {
<div class="form-group"> <div class="form-group">
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存"> <input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
</div> </div>
<button type="submit" class="btn btn btn-primary">更改 账号/密码</button> <button type="submit" class="btn btn btn-primary">更改管理 账号/密码</button>
<div class="alert alert-primary with-icon" style="margin-top: 5px;"> <div class="alert alert-primary with-icon" style="margin-top: 5px;">
<i class="icon-info-sign"></i> <i class="icon-info-sign"></i>
<div class="content"> <div class="content">
<p>更改后会立即生效并重新登录,请务必牢记密码!</p> <p>更改后会立即生效并重新登录,请务必牢记账号和密码!</p>
<p>如果忘记用户名可以打开-><code>/config/config.php</code>文件->找到user对应的键值->填入</p> <p>如果忘记账号可以打开-><code>/config/config.php</code>文件->找到user对应的键值->填入</p>
<p>如果忘记密码请将密码->转换成MD5小写-><a href="https://md5jiami.bmcx.com/" target="_blank" class="text-purple">转换网址</a>->打开<code>/config/config.php</code>文件->找到password对应的键值->填入</p>
</div>
</div>
</form>
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()">
<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">开启图片监黄(需要申请key填入分类API/Token的Moderate Key中)</label>
</div>
</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">
<label>缓存有效期,当前:</label>
<label id="cache_freq"><?php echo $config['cache_freq']; ?></label><label>小时</label>
<input type="range" class="form-control" name="cache_freq" value="<?php echo $config['cache_freq']; ?>" min="1" step="1"max="24" onchange="document.getElementById('cache_freq').innerHTML=value">
</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="upload_logs" value="0">
<input type="checkbox" name="upload_logs" value="1" <?php if ($config['upload_logs']) {echo 'checked="checked"';} ?> title="日志每月保存一个文件;经过测试每月二十万条数据并不影响速度!">
<label style="font-weight: bold">开启上传日志</label>
</div>
</div>
<div class="form-group">
<p style="font-weight: bold">
当前版本:<span class="label label-badge label-outline"><?php echo $config['version']; ?></span>
Github<a href="https://github.com/icret/EasyImages2.0/releases" target="_blank"><span class="label label-badge label-success label-outline"><?php echo getVersion(); ?></span></a>
</p>
</div>
<div class="form-group">
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
</div>
<button type="submit" class="btn btn-primary">保存</button>
</form>
</div>
<div class="tab-pane fade" id="Content6">
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()">
<div class="form-group">
<div class="input-control has-icon-left">
<input type="text" name="user" id="account" class="form-control" placeholder="更改管理账号 - 不填则保持默认">
<label for="account" class="input-control-icon-left"><i class="icon icon-user "></i></label>
</div>
<div class="input-control has-icon-left" style="margin-top: 10px;">
<input type="text" name="password" id="password" class="form-control" placeholder="更改管理密码 - 不填则保持默认">
<input type="hidden" name="password" id="md5_password">
<label for="password" class="input-control-icon-left"><i class="icon icon-key"></i></label>
</div>
</div>
<div class="form-group">
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
</div>
<button type="submit" class="btn btn btn-primary">更改管理 账号/密码</button>
<div class="alert alert-primary with-icon" style="margin-top: 5px;">
<i class="icon-info-sign"></i>
<div class="content">
<p>更改后会立即生效并重新登录,请务必牢记账号和密码!</p>
<p>如果忘记账号可以打开-><code>/config/config.php</code>文件->找到user对应的键值->填入</p>
<p>如果忘记密码请将密码->转换成MD5小写-><a href="https://md5jiami.bmcx.com/" target="_blank" class="text-purple">转换网址</a>->打开<code>/config/config.php</code>文件->找到password对应的键值->填入</p> <p>如果忘记密码请将密码->转换成MD5小写-><a href="https://md5jiami.bmcx.com/" target="_blank" class="text-purple">转换网址</a>->打开<code>/config/config.php</code>文件->找到password对应的键值->填入</p>
</div> </div>
</div> </div>
@ -624,6 +702,23 @@ if (isset($_POST['radio'])) {
<p>当前版本:<?php echo $config['version']; ?>Github版本<a href="https://github.com/icret/EasyImages2.0/releases" target="_blank"><?php echo getVersion(); ?></a></p> <p>当前版本:<?php echo $config['version']; ?>Github版本<a href="https://github.com/icret/EasyImages2.0/releases" target="_blank"><?php echo getVersion(); ?></a></p>
</div> </div>
</div> </div>
<div class="tab-pane fade" id="Content9">
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<div class="form-group">
<h5>默认上传后首选显示链接:</h5>
<label class="radio-inline"><input type="radio" name="first_show" value="1" <?php if($config['first_show']==1){echo 'checked';}?>><i class="icon icon-link"> 直链</i></label>
<label class="radio-inline"><input type="radio" name="first_show" value="2" <?php if($config['first_show']==2){echo 'checked';}?>><i class="icon icon-chat"> 论坛代码</i></label>
<label class="radio-inline"><input type="radio" name="first_show" value="3" <?php if($config['first_show']==3){echo 'checked';}?>><i class="icon icon-code"> MarkDown</i></label>
<label class="radio-inline"><input type="radio" name="first_show" value="4" <?php if($config['first_show']==4){echo 'checked';}?>><i class="icon icon-html5"> HTML</i></label>
<label class="radio-inline"><input type="radio" name="first_show" value="5" <?php if($config['first_show']==5){echo 'checked';}?>><i class="icon icon-trash"> 删除</i></label>
</div>
<div class="form-group">
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
</div>
<button type="submit" class="btn btn-primary">保存</button>
</form>
</div>
</div> </div>
</div> </div>

View File

@ -60,7 +60,7 @@
*/ */
</script> </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'];} ?> <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'];} ?>
<?php echo $config['customize']; ?> <?php if($config['customize']){echo $config['customize'];}?>
<hr> <hr>
<!-- 对话框触发按钮 --> <!-- 对话框触发按钮 -->
<a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal"> <a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal">

View File

@ -12,46 +12,6 @@ function isAnimatedGif($filename)
} }
// 校验登录 // 校验登录
/*
function checkLogin()
{
global $config;
$md5Pwd = $config['password'];
if (isset($_POST['password'])) { // 获取登录密码
$postPW = $_POST['password'];
if ($md5Pwd == $postPW) { // 登录密码正确
setcookie('admin', $postPW, time() + 3600 * 24 * 14, '/');
echo '
<script> new $.zui.Messager("登录成功", {type: "success" // 定义颜色主题
}).show();</script>';
header("refresh:1;"); // 1s后刷新当前页面
} else { // 密码错误
echo '
<script> new $.zui.Messager("密码错误", {type: "danger" // 定义颜色主题
}).show();</script>';
//exit(include __DIR__ . '/login.php');
exit(header("refresh:1;"));
}
} elseif (isset($_COOKIE['admin'])) { // cookie正确
if ($_COOKIE['admin'] == $md5Pwd) {
} else { // cookie错误
echo '
<script> new $.zui.Messager("密码已更改,请重新登录", {type: "special" // 定义颜色主题
}).show();</script>';
//header('loction:login.php');
exit(include __DIR__ . '/login.php');
}
} else { // 无登录无cookie
echo '
<script> new $.zui.Messager("请登录后再上传!", {type: "danger" // 定义颜色主题
}).show();</script>';
//header('loction:login.php');
exit(include __DIR__ . '/login.php');
}
}
*/
function checkLogin() function checkLogin()
{ {
global $config; global $config;
@ -91,10 +51,10 @@ function checkLogin()
exit(header("refresh:2;")); exit(header("refresh:2;"));
} }
} }
// 存在cookie 但是cookie错误 // 存在cookie 但是cookie错误
if (isset($_COOKIE[$config_user])) { if (isset($_COOKIE[$config_user])) {
$cookieAdmin = $_COOKIE[$config_user]; $cookieAdmin = $_COOKIE[$config_user];
if ($cookieAdmin != $config_password) { if ($cookieAdmin != $config_password) {
echo ' echo '
<script> <script>
@ -117,6 +77,7 @@ function checkLogin()
exit(include __DIR__ . '/login.php'); exit(include __DIR__ . '/login.php');
} }
} }
// 仅允许登录后上传 // 仅允许登录后上传
function mustLogin() function mustLogin()
{ {
@ -188,27 +149,6 @@ function imgName($source = null)
} }
} }
// 设置广告
function showAD($where)
{
global $config;
switch ($where) {
case 'top':
if ($config['ad_top']) {
include(__DIR__ . '/../public/ad/top.html');
}
break;
case 'bot':
if ($config['ad_bot']) {
include(__DIR__ . '/../public/ad/bottom.html');
}
break;
default:
echo '广告函数出错';
break;
}
}
// 静态文件CDN // 静态文件CDN
function static_cdn() function static_cdn()
{ {
@ -220,16 +160,6 @@ function static_cdn()
} }
} }
// 开启tinyfilemanager图片管理
function tinyfilemanager()
{
global $config;
if (!$config['tinyfilemanager']) {
header('Location: ' . $_SERVER["HTTP_REFERER"] . '?manager-closed');
exit;
}
}
/*
// 获取允许上传的扩展名 // 获取允许上传的扩展名
function getExtensions() function getExtensions()
{ {
@ -240,7 +170,7 @@ function getExtensions()
} }
return rtrim($mime, ','); return rtrim($mime, ',');
} }
*/
// 获取目录大小 如果目录文件较多将很费时 // 获取目录大小 如果目录文件较多将很费时
function getDirectorySize($path) function getDirectorySize($path)
{ {
@ -296,6 +226,7 @@ function getDir($dir)
} }
return $dirArray; return $dirArray;
} }
// 获取文件列表 // 获取文件列表
function getFile($dir) function getFile($dir)
{ {
@ -325,8 +256,6 @@ function getFile($dir)
* echo "目录数为:{$dirn}<br>"; * echo "目录数为:{$dirn}<br>";
* echo "文件数为:{$filen}<br>"; * echo "文件数为:{$filen}<br>";
*/ */
function getdirnum($file) function getdirnum($file)
{ {
$dirn = 0; //目录数 $dirn = 0; //目录数
@ -375,16 +304,12 @@ function getActive($url)
$arr = $_SERVER['SCRIPT_NAME']; $arr = $_SERVER['SCRIPT_NAME'];
if (strpos($arr, $url)) { if (strpos($arr, $url)) {
return 'active'; return 'active';
} else {
return '';
} }
} }
/** /* 加密/解密图片路径
* 加密/解密图片路径
* @param string $data 要加密的内容 * @param string $data 要加密的内容
* @param int $mode =1或0 1解密 0加密 * @param int $mode =1或0 1解密 0加密
*
*/ */
function urlHash($data, $mode) function urlHash($data, $mode)
{ {
@ -392,11 +317,9 @@ function urlHash($data, $mode)
$key = $config['password']; $key = $config['password'];
$iv = 'sciCuBC7orQtDhTO'; $iv = 'sciCuBC7orQtDhTO';
if ($mode) { if ($mode) {
$decode = openssl_decrypt(base64_decode($data), "AES-128-CBC", $key, 0, $iv); return openssl_decrypt(base64_decode($data), "AES-128-CBC", $key, 0, $iv);
return $decode;
} else { } else {
$encode = base64_encode(openssl_encrypt($data, "AES-128-CBC", $key, 0, $iv)); return base64_encode(openssl_encrypt($data, "AES-128-CBC", $key, 0, $iv));
return $encode;
} }
} }
@ -415,7 +338,6 @@ function getDel($url, $type)
$url = APP_ROOT . $url; $url = APP_ROOT . $url;
} }
// 文件是否存在 // 文件是否存在
if (is_file($url)) { if (is_file($url)) {
// 执行删除 // 执行删除
@ -455,7 +377,7 @@ function is_online()
$config_user = $config['user']; $config_user = $config['user'];
$config_password = $config['password']; $config_password = $config['password'];
if (empty($_COOKIE[$config_user]) || $_COOKIE[$config_user] != $config_password) { if (empty($_COOKIE[$config_user]) || $_COOKIE[$config_user] != $config_password) {
echo false; return false;
} else { } else {
return true; return true;
} }
@ -474,8 +396,7 @@ function checkEnv($mode)
{ {
// 初始化安装 // 初始化安装
if (!file_exists(APP_ROOT . '/install/install.lock') and file_exists(APP_ROOT . '/install/install.php')) { 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 ('<script type="text/javascript">window.location.href="' . get_whole_url('/') . '/install/index.php"</script>');
exit;
} }
if ($mode) { if ($mode) {
@ -585,7 +506,7 @@ function deldir($dir)
} }
// curl访问网站并返回解码过的json信息 // curl访问网站并返回解码过的json信息
function moderatecontent_json($img) function moderatecontent_json($img, $url = null)
{ {
global $config; global $config;
@ -607,6 +528,7 @@ function moderatecontent_json($img)
$output = json_decode($output, true); $output = json_decode($output, true);
return $output; return $output;
} }
// 检查图片是否违规 // 检查图片是否违规
function checkImg($imageUrl) function checkImg($imageUrl)
{ {
@ -639,6 +561,7 @@ function re_checkImg($name)
$to_file = APP_ROOT . $config['path'] . $fileToPath; // 要还原图片的绝对位置 */i/2021/10/30/p8vypd.png $to_file = APP_ROOT . $config['path'] . $fileToPath; // 要还原图片的绝对位置 */i/2021/10/30/p8vypd.png
rename($now_path_file, $to_file); rename($now_path_file, $to_file);
} }
// 创建缩略图 // 创建缩略图
function creat_thumbnail_images($imgName) function creat_thumbnail_images($imgName)
{ {
@ -691,7 +614,7 @@ function get_online_thumbnail($imgUrl)
/** /**
* 用户浏览广场的时候生成缩略图,由此解决上传生成缩略图时服务器超时响应 * 用户浏览广场的时候生成缩略图,由此解决上传生成缩略图时服务器超时响应
* @param $imgUrl 源图片网址 * @param $imgUrl string 源图片网址
* @return string 缩略图地址 * @return string 缩略图地址
*/ */
function creat_thumbnail_by_list($imgUrl) function creat_thumbnail_by_list($imgUrl)
@ -760,13 +683,11 @@ function creat_thumbnail_by_list($imgUrl)
} }
} }
/** /* 获取当前页面完整URL地址
* 获取当前页面完整URL地址
* 返回 http://localhost/ww/index.php * 返回 http://localhost/ww/index.php
* https://www.php.cn/php-weizijiaocheng-28181.html * https://www.php.cn/php-weizijiaocheng-28181.html
* $search 返回指定搜索文字之前的内容(不含搜索文字) * $search 返回指定搜索文字之前的内容(不含搜索文字)
*/ */
function get_whole_url($search = null) function get_whole_url($search = null)
{ {
$sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://'; $sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
@ -782,7 +703,7 @@ function get_whole_url($search = null)
} }
} }
//写入 // 配置写入
function cache_write($filename, $values, $var = 'config', $format = false) function cache_write($filename, $values, $var = 'config', $format = false)
{ {
$cachefile = $filename; $cachefile = $filename;
@ -816,7 +737,7 @@ function arrayeval($array, $format = false, $level = 0)
return $evaluate; return $evaluate;
} }
//写入文件 // 配置写入文件
function writefile($filename, $writetext, $openmod = 'w') function writefile($filename, $writetext, $openmod = 'w')
{ {
if (false !== $fp = fopen($filename, $openmod)) { if (false !== $fp = fopen($filename, $openmod)) {

View File

@ -4,12 +4,20 @@
// | 把大图缩略到缩略图指定的范围内,不留白(原图会剪切掉不符合比例的右边和下边) // | 把大图缩略到缩略图指定的范围内,不留白(原图会剪切掉不符合比例的右边和下边)
// | https://www.php.cn/php-ask-458473.html // | https://www.php.cn/php-ask-458473.html
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
require_once __DIR__ . '/function.php'; require_once __DIR__ . '/function.php';
require_once __DIR__ . '/class.thumb.php'; require_once __DIR__ . '/class.thumb.php';
$src = isset($_GET['img']) ? APP_ROOT . $_GET['img'] : APP_ROOT . '/public/images/404.png'; // 原图路径 $src = isset($_GET['img']) ? APP_ROOT . $_GET['img'] : APP_ROOT . '/public/images/404.png'; // 原图路径
$width = isset($_GET['width']) ? $_GET['width'] : 200; // 预生成缩略图的宽
$height = isset($_GET['height']) ? $_GET['height'] : 200; // 预生成缩略图的高 if (!file_exists($src)) {
Thumb::show($src, $width, $height); exit('image does not exist');
}
$w = isset($_GET['width']) ? $_GET['width'] : 200; // 预生成缩略图的宽
$h = isset($_GET['height']) ? $_GET['height'] : 200; // 预生成缩略图的高
Thumb::show($src, $w, $h);

View File

@ -16,7 +16,7 @@
* 本人仅为程序开源创作,如非法网站与本人无关,请勿用于非法用途 * 本人仅为程序开源创作,如非法网站与本人无关,请勿用于非法用途
* 请为本人博客www.545141.com加上网址链接谢谢支持。作为开发者你可以对相应的后台功能进行扩展增删改相应代码,但请保留代码中相关来源信息(例如:本人博客,邮箱等) * 请为本人博客www.545141.com加上网址链接谢谢支持。作为开发者你可以对相应的后台功能进行扩展增删改相应代码,但请保留代码中相关来源信息(例如:本人博客,邮箱等)
* 如果因安装问题或其他问题可以给我发邮件。 * 如果因安装问题或其他问题可以给我发邮件。
*
* 配置分为两大区块 - 1.基础配置 2.图床配置 * 配置分为两大区块 - 1.基础配置 2.图床配置
*/ */

View File

@ -5,8 +5,8 @@ $config=Array
'keywords'=>'简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制', 'keywords'=>'简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制',
'description'=>'简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序最新html5自适应页面兼容手机电脑上传后返回图片直链markdown图片论坛贴图bbscode链接简单方便支持一键复制支持多域名api上传。', 'description'=>'简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序最新html5自适应页面兼容手机电脑上传后返回图片直链markdown图片论坛贴图bbscode链接简单方便支持一键复制支持多域名api上传。',
'tips'=>'本站仅做演示用,不定时清理图片单文件≤5M每次上传≤30张', 'tips'=>'本站仅做演示用,不定时清理图片单文件≤5M每次上传≤30张',
'domain'=>'http://localhost', 'domain'=>'http://192.168.2.100',
'imgurl'=>'http://localhost', 'imgurl'=>'http://192.168.2.100',
'user'=>'admin', 'user'=>'admin',
'password'=>'e6e061838856bf47e1de730719fb2609', 'password'=>'e6e061838856bf47e1de730719fb2609',
'mustLogin'=>0, 'mustLogin'=>0,
@ -24,7 +24,7 @@ $config=Array
'waterImg'=>'/public/images/watermark.png', 'waterImg'=>'/public/images/watermark.png',
'extensions'=>'gif,jpeg,png,tif,bmp,tif,svg,webp,jpg,tga,svg,ico', 'extensions'=>'gif,jpeg,png,tif,bmp,tif,svg,webp,jpg,tga,svg,ico',
'compress'=>0, 'compress'=>0,
'thumbnail'=>0, 'thumbnail'=>1,
'imgConvert'=>'', 'imgConvert'=>'',
'maxWidth'=>10240, 'maxWidth'=>10240,
'maxHeight'=>10240, 'maxHeight'=>10240,
@ -37,7 +37,7 @@ $config=Array
'imgRatio_crop'=>0, 'imgRatio_crop'=>0,
'imgRatio_preserve_headers'=>1, 'imgRatio_preserve_headers'=>1,
'static_cdn'=>0, 'static_cdn'=>0,
'theme'=>'default', 'theme'=>'red',
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0', 'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0',
'TinyImag_key'=>'', 'TinyImag_key'=>'',
'moderatecontent_key'=>'', 'moderatecontent_key'=>'',
@ -55,7 +55,7 @@ $config=Array
<a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a> <a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a>
</div> </div>
', ',
'showSwitch'=>0, 'showSwitch'=>1,
'listNumber'=>20, 'listNumber'=>20,
'customize'=>' <!-- 百度统计代码--> 'customize'=>' <!-- 百度统计代码-->
<script> <script>
@ -66,12 +66,24 @@ $config=Array
var s = document.getElementsByTagName("script")[0]; var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})(); })();
</script>', </script>
<!-- 自定义js举例非img.545141.com跳转
<script type= "text/javascript" >rthost=window.location.host;if(rthost!="img.545141.com"){top.location.href="https://img.545141.com/"};</script>-->
<!--自定义代码举例打赏、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>
</a>
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=3feb4e8be8f1839f71e53bf2e876de36afc6889b2630c33c877d8df5a5583a6f">
<i class="icon icon-qq">加入QQ群</i>
</a>
<a target="_blank" href="/master.zip"><i class="icon icon-download-alt">下载源码</i></a>-->',
'checkEnv'=>1, 'checkEnv'=>1,
'checkImg'=>1, 'checkImg'=>1,
'checkImg_value'=>50, 'checkImg_value'=>50,
'upload_logs'=>1, 'upload_logs'=>1,
'cache_freq'=>2, 'cache_freq'=>2,
'first_show'=>1,
'version'=>'2.4.5 bate', 'version'=>'2.4.5 bate',
'form'=>'2022-01-05 18:27:18' 'form'=>'2022-01-13 02:26:57'
); );

View File

@ -29,44 +29,44 @@ mustLogin();
</div> </div>
<div class="col-md-10 col-md-offset-1"> <div class="col-md-10 col-md-offset-1">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"> <li <?php if($config['first_show']==1){echo 'class="active"';}?>>
<a href="#" data-target="#tab2Content1" data-toggle="tab"><i class="icon icon-link"> 直链</i></a> <a href="#" data-target="#tab2Content1" data-toggle="tab"><i class="icon icon-link"> 直链</i></a>
</li> </li>
<li> <li <?php if($config['first_show']==2){echo 'class="active"';}?>>
<a href="#" data-target="#tab2Content2" data-toggle="tab"><i class="icon icon-chat"> 论坛代码</i></a> <a href="#" data-target="#tab2Content2" data-toggle="tab"><i class="icon icon-chat"> 论坛代码</i></a>
</li> </li>
<li> <li <?php if($config['first_show']==3){echo 'class="active"';}?>>
<a href="#" data-target="#tab2Content3" data-toggle="tab"><i class="icon icon-code"> MarkDown</i></a> <a href="#" data-target="#tab2Content3" data-toggle="tab"><i class="icon icon-code"> MarkDown</i></a>
</li> </li>
<li> <li <?php if($config['first_show']==4){echo 'class="active"';}?>>
<a href="#" data-target="#tab2Content4" data-toggle="tab"><i class="icon icon-html5"> HTML</i></a> <a href="#" data-target="#tab2Content4" data-toggle="tab"><i class="icon icon-html5"> HTML</i></a>
</li> </li>
<li> <li <?php if($config['first_show']==5){echo 'class="active"';}?>>
<a href="#" data-target="#tab2Content5" data-toggle="tab"><i class="icon icon-trash"> 删除</i></a> <a href="#" data-target="#tab2Content5" data-toggle="tab"><i class="icon icon-trash"> 删除</i></a>
</li> </li>
</ul> </ul>
<div class="tab-content" style="text-align:right"> <div class="tab-content" style="text-align:right">
<div class="tab-pane fade active in" id="tab2Content1"> <div class="tab-pane fade <?php if($config['first_show']==1){echo 'active in';}?>" id="tab2Content1">
<textarea class="form-control" rows="5" id="links" readonly></textarea> <textarea class="form-control" rows="5" id="links" readonly></textarea>
<button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button> <button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button>
<button id="btnLinks" class="btn copyBtn1" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button> <button id="btnLinks" class="btn copyBtn1" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button>
</div> </div>
<div class="tab-pane fade" id="tab2Content2"> <div class="tab-pane fade <?php if($config['first_show']==2){echo 'active in';}?>" id="tab2Content2">
<textarea class="form-control" rows="5" id="bbscode" readonly></textarea> <textarea class="form-control" rows="5" id="bbscode" readonly></textarea>
<button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button> <button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button>
<button id="btnBbscode" class="btn copyBtn2" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button> <button id="btnBbscode" class="btn copyBtn2" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button>
</div> </div>
<div class="tab-pane fade" id="tab2Content3"> <div class="tab-pane fade <?php if($config['first_show']==3){echo 'active in';}?>" id="tab2Content3">
<textarea class="form-control" rows="5" id="markdown" readonly></textarea> <textarea class="form-control" rows="5" id="markdown" readonly></textarea>
<button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button> <button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button>
<button id="btnMarkDown" class="btn copyBtn3" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button> <button id="btnMarkDown" class="btn copyBtn3" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button>
</div> </div>
<div class="tab-pane fade" id="tab2Content4"> <div class="tab-pane fade <?php if($config['first_show']==4){echo 'active in';}?>" id="tab2Content4">
<textarea class="form-control" rows="5" id="html" readonly></textarea> <textarea class="form-control" rows="5" id="html" readonly></textarea>
<button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button> <button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button>
<button id="btnHtml" class="btn copyBtn4" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button> <button id="btnHtml" class="btn copyBtn4" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button>
</div> </div>
<div class="tab-pane fade" id="tab2Content5"> <div class="tab-pane fade <?php if($config['first_show']==5){echo 'active in';}?>" id="tab2Content5">
<pre><textarea class="form-control" rows="5" id="del" readonly></textarea></pre> <pre><textarea class="form-control" rows="5" id="del" readonly></textarea></pre>
<button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button> <button class="btn" style="margin-top:10px;" onclick="location.reload()"><i class="icon icon-undo"></i> 刷新</button>
<button id="btndel" class="btn copyBtn5" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button> <button id="btndel" class="btn copyBtn5" data-loading-text="已经复制链接..." style="margin-top:10px;"><i class="icon icon-copy"></i> 复制</button>

View File

@ -9,6 +9,9 @@ copyBtn.onclick = function () {
try { try {
if (document.execCommand('copy', false, null)) { if (document.execCommand('copy', false, null)) {
//success info //success info
new $.zui.Messager("复制成功", {
type: "primary" // 定义颜色主题
}).show();
console.log("复制成功"); console.log("复制成功");
} else { } else {
//fail info //fail info
@ -27,6 +30,9 @@ copyBtn.onclick = function () {
try { try {
if (document.execCommand('copy', false, null)) { if (document.execCommand('copy', false, null)) {
//success info //success info
new $.zui.Messager("复制成功", {
type: "primary" // 定义颜色主题
}).show();
console.log("复制成功"); console.log("复制成功");
} else { } else {
//fail info //fail info
@ -45,6 +51,9 @@ copyBtn.onclick = function () {
try { try {
if (document.execCommand('copy', false, null)) { if (document.execCommand('copy', false, null)) {
//success info //success info
new $.zui.Messager("复制成功", {
type: "primary" // 定义颜色主题
}).show();
console.log("复制成功"); console.log("复制成功");
} else { } else {
//fail info //fail info
@ -63,6 +72,9 @@ copyBtn.onclick = function () {
try { try {
if (document.execCommand('copy', false, null)) { if (document.execCommand('copy', false, null)) {
//success info //success info
new $.zui.Messager("复制成功", {
type: "primary" // 定义颜色主题
}).show();
console.log("复制成功"); console.log("复制成功");
} else { } else {
//fail info //fail info
@ -81,6 +93,9 @@ copyBtn.onclick = function () {
try { try {
if (document.execCommand('copy', false, null)) { if (document.execCommand('copy', false, null)) {
//success info //success info
new $.zui.Messager("复制成功", {
type: "primary" // 定义颜色主题
}).show();
console.log("复制成功"); console.log("复制成功");
} else { } else {
//fail info //fail info