parent
b2e5972d7f
commit
0fd10babb5
|
@ -103,9 +103,12 @@ $HTTP["url"] =~ "^/(i|public)/" {
|
||||||
|
|
||||||
<details><summary><mark>点击查看2.0版更新日志</mark></summary>
|
<details><summary><mark>点击查看2.0版更新日志</mark></summary>
|
||||||
|
|
||||||
* 2022-3-2 v2.5.5
|
* 2022-3-4 v2.5.5
|
||||||
- 增加设置页面检测是否开启登录上传
|
- 增加设置页面检测是否开启登录上传
|
||||||
- 将footer固定在底部
|
- 将footer固定在底部
|
||||||
|
- 移除function_API.php
|
||||||
|
- 修复TimThumb不支持bmp格式的bug
|
||||||
|
- 修复TimThumb不支持webp动态图片bug
|
||||||
|
|
||||||
* 2022-2-29 v2.5.4
|
* 2022-2-29 v2.5.4
|
||||||
- 增加Token有效期
|
- 增加Token有效期
|
||||||
|
|
1573
admin/admin.inc.php
1573
admin/admin.inc.php
File diff suppressed because it is too large
Load Diff
|
@ -3,8 +3,6 @@
|
||||||
* 统计中心
|
* 统计中心
|
||||||
*/
|
*/
|
||||||
require_once '../application/header.php';
|
require_once '../application/header.php';
|
||||||
require_once APP_ROOT . '/config/api_key.php';
|
|
||||||
require_once APP_ROOT . '/api/function_API.php';
|
|
||||||
require_once APP_ROOT . '/application/chart.php';
|
require_once APP_ROOT . '/application/chart.php';
|
||||||
|
|
||||||
// 检测是否开启统计
|
// 检测是否开启统计
|
||||||
|
@ -67,7 +65,7 @@ if (is_array($char_data)) {
|
||||||
box-shadow: 3px 2px 3px 2px rgba(19, 17, 36, 0.5);
|
box-shadow: 3px 2px 3px 2px rgba(19, 17, 36, 0.5);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="row">
|
<div class="row" style="margin-bottom:100px">
|
||||||
<div class="clo-md-12">
|
<div class="clo-md-12">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
<form action="chart.php" method="post">
|
<form action="chart.php" method="post">
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
* 统计中心
|
* 统计中心
|
||||||
*/
|
*/
|
||||||
require_once '../application/header.php';
|
require_once '../application/header.php';
|
||||||
require_once APP_ROOT . '/config/api_key.php';
|
|
||||||
require_once APP_ROOT . '/api/function_API.php';
|
|
||||||
require_once APP_ROOT . '/application/chart.php';
|
require_once APP_ROOT . '/application/chart.php';
|
||||||
|
|
||||||
// 检测是否开启统计
|
// 检测是否开启统计
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
require_once './../config/api_key.php';
|
|
||||||
require_once './../config/config.php';
|
|
||||||
|
|
||||||
// Token 生成
|
|
||||||
function privateToken($length = 32)
|
|
||||||
{
|
|
||||||
$output = '';
|
|
||||||
for ($a = 0; $a < $length; $a++) {
|
|
||||||
$output .= chr(mt_rand(65, 122)); //生成php随机数
|
|
||||||
}
|
|
||||||
return md5($output);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 通过Token查找用户ID
|
|
||||||
function getID($token)
|
|
||||||
{
|
|
||||||
global $tokenList;
|
|
||||||
$token = preg_replace('/[\W]/', '', $token); // 过滤非字母数字,删除空格
|
|
||||||
$key = array_search($token, $tokenList);
|
|
||||||
if ($key >= 0) {
|
|
||||||
return $key;
|
|
||||||
} else {
|
|
||||||
return ('没有这个用户ID');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 通过ID查找用户Token
|
|
||||||
function getIDToken($id)
|
|
||||||
{
|
|
||||||
global $tokenList;
|
|
||||||
$id = preg_replace('/[\W]/', '', $id); // 过滤非字母数字,删除空格
|
|
||||||
foreach ($tokenList as $key => $value) {
|
|
||||||
if ($key == $id) {
|
|
||||||
return $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查是否开启api上传
|
|
||||||
* code:201 访问成功但是服务端关闭API上传
|
|
||||||
* code:202 访问成功但是Token错误
|
|
||||||
*/
|
|
||||||
function check_api($token)
|
|
||||||
{
|
|
||||||
global $config;
|
|
||||||
global $tokenList;
|
|
||||||
|
|
||||||
if (!$config['apiStatus']) {
|
|
||||||
// API关闭 服务端关闭API上传
|
|
||||||
$reJson = array(
|
|
||||||
"result" => 'failed',
|
|
||||||
'code' => 201,
|
|
||||||
'message' => 'API Closed',
|
|
||||||
);
|
|
||||||
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!in_array($tokenList[$token], $tokenList)) {
|
|
||||||
// Token 是否存在
|
|
||||||
$reJson = array(
|
|
||||||
"result" => 'failed',
|
|
||||||
'code' => 202,
|
|
||||||
'message' => 'Token Error',
|
|
||||||
);
|
|
||||||
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($tokenList[$token]['expired'] < time()) {
|
|
||||||
// Token 是否过期
|
|
||||||
$reJson = array(
|
|
||||||
"result" => 'failed',
|
|
||||||
'code' => 203,
|
|
||||||
'message' => 'Token Expired',
|
|
||||||
);
|
|
||||||
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/../application/function.php';
|
require_once __DIR__ . '/../application/function.php';
|
||||||
require_once APP_ROOT . '/api/function_API.php';
|
|
||||||
require_once APP_ROOT . '/application/class.upload.php';
|
require_once APP_ROOT . '/application/class.upload.php';
|
||||||
require_once APP_ROOT . '/config/api_key.php';
|
require_once APP_ROOT . '/config/api_key.php';
|
||||||
|
|
||||||
|
|
|
@ -319,7 +319,7 @@ class timthumb
|
||||||
|
|
||||||
$cachePrefix = ($this->isURL ? '_ext_' : '_int_');
|
$cachePrefix = ($this->isURL ? '_ext_' : '_int_');
|
||||||
if ($this->isURL) {
|
if ($this->isURL) {
|
||||||
$arr = explode('&', $_SERVER ['QUERY_STRING']);
|
$arr = explode('&', $_SERVER['QUERY_STRING']);
|
||||||
asort($arr);
|
asort($arr);
|
||||||
$this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . implode('', $arr) . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
|
$this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . implode('', $arr) . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
|
||||||
} else {
|
} else {
|
||||||
|
@ -333,7 +333,7 @@ class timthumb
|
||||||
$this->debug(1, "Local image path is {$this->localImage}");
|
$this->debug(1, "Local image path is {$this->localImage}");
|
||||||
$this->localImageMTime = @filemtime($this->localImage);
|
$this->localImageMTime = @filemtime($this->localImage);
|
||||||
//We include the mtime of the local file in case in changes on disk.
|
//We include the mtime of the local file in case in changes on disk.
|
||||||
$this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . $this->localImageMTime . $_SERVER ['QUERY_STRING'] . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
|
$this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . $this->localImageMTime . $_SERVER['QUERY_STRING'] . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
|
||||||
}
|
}
|
||||||
$this->debug(2, "Cache file is: " . $this->cachefile);
|
$this->debug(2, "Cache file is: " . $this->cachefile);
|
||||||
|
|
||||||
|
@ -580,7 +580,7 @@ class timthumb
|
||||||
$mimeType = $sData['mime'];
|
$mimeType = $sData['mime'];
|
||||||
|
|
||||||
$this->debug(3, "Mime type of image is $mimeType");
|
$this->debug(3, "Mime type of image is $mimeType");
|
||||||
if (!preg_match('/^image\/(?:gif|jpg|jpeg|png|webp)$/i', $mimeType)) {
|
if (!preg_match('/^image\/(?:gif|jpg|jpeg|png|webp|bmp)$/i', $mimeType)) {
|
||||||
return $this->error("The image being resized is not a valid gif, jpg or png.");
|
return $this->error("The image being resized is not a valid gif, jpg or png.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -828,8 +828,11 @@ class timthumb
|
||||||
$imgType = 'gif';
|
$imgType = 'gif';
|
||||||
imagegif($canvas, $tempfile);
|
imagegif($canvas, $tempfile);
|
||||||
} else if (preg_match('/^image\/webp$/i', $mimeType)) {
|
} else if (preg_match('/^image\/webp$/i', $mimeType)) {
|
||||||
$imgType = 'WEBP';
|
$imgType = 'webp';
|
||||||
imagewebp($canvas, $tempfile);
|
imagewebp($canvas, $tempfile);
|
||||||
|
} else if (preg_match('/^image\/bmp$/i', $mimeType)) {
|
||||||
|
$imgType = 'bmp';
|
||||||
|
imagebmp($canvas, $tempfile);
|
||||||
} else {
|
} else {
|
||||||
return $this->sanityFail("Could not match mime type after verifying it previously.");
|
return $this->sanityFail("Could not match mime type after verifying it previously.");
|
||||||
}
|
}
|
||||||
|
@ -876,9 +879,9 @@ class timthumb
|
||||||
$tempfile4 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
|
$tempfile4 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
|
||||||
$context = stream_context_create();
|
$context = stream_context_create();
|
||||||
$fp = fopen($tempfile, 'r', 0, $context);
|
$fp = fopen($tempfile, 'r', 0, $context);
|
||||||
if(strlen($imgType) == 3) {
|
if (strlen($imgType) == 3) {
|
||||||
file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //7 extra bytes, first 3 being image type
|
file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //7 extra bytes, first 3 being image type
|
||||||
}elseif (strlen($imgType) == 4){
|
} elseif (strlen($imgType) == 4) {
|
||||||
file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //7 extra bytes, first 4 being image type
|
file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //7 extra bytes, first 4 being image type
|
||||||
}
|
}
|
||||||
file_put_contents($tempfile4, $fp, FILE_APPEND);
|
file_put_contents($tempfile4, $fp, FILE_APPEND);
|
||||||
|
@ -1096,7 +1099,7 @@ class timthumb
|
||||||
}
|
}
|
||||||
|
|
||||||
$mimeType = $this->getMimeType($tempfile);
|
$mimeType = $this->getMimeType($tempfile);
|
||||||
if (!preg_match("/^image\/(?:jpg|jpeg|gif|png|webp)$/i", $mimeType)) {
|
if (!preg_match("/^image\/(?:jpg|jpeg|gif|png|webp|bmp)$/i", $mimeType)) {
|
||||||
$this->debug(3, "Remote file has invalid mime type: $mimeType");
|
$this->debug(3, "Remote file has invalid mime type: $mimeType");
|
||||||
@unlink($this->cachefile);
|
@unlink($this->cachefile);
|
||||||
touch($this->cachefile);
|
touch($this->cachefile);
|
||||||
|
@ -1171,6 +1174,9 @@ class timthumb
|
||||||
if (strtolower($mimeType) == 'image/webp') {
|
if (strtolower($mimeType) == 'image/webp') {
|
||||||
$mimeType = 'image/webp';
|
$mimeType = 'image/webp';
|
||||||
}
|
}
|
||||||
|
if (strtolower($mimeType) == 'image/bmp') {
|
||||||
|
$mimeType = 'image/bmp';
|
||||||
|
}
|
||||||
$gmdate_expires = gmdate('D, d M Y H:i:s', strtotime('now +10 days')) . ' GMT';
|
$gmdate_expires = gmdate('D, d M Y H:i:s', strtotime('now +10 days')) . ' GMT';
|
||||||
$gmdate_modified = gmdate('D, d M Y H:i:s') . ' GMT';
|
$gmdate_modified = gmdate('D, d M Y H:i:s') . ' GMT';
|
||||||
// send content headers then display image
|
// send content headers then display image
|
||||||
|
@ -1193,7 +1199,6 @@ class timthumb
|
||||||
|
|
||||||
protected function securityChecks()
|
protected function securityChecks()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function param($property, $default = '')
|
protected function param($property, $default = '')
|
||||||
|
@ -1215,6 +1220,10 @@ class timthumb
|
||||||
case 'image/webp':
|
case 'image/webp':
|
||||||
$image = imagecreatefromwebp($src);
|
$image = imagecreatefromwebp($src);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'image/bmp':
|
||||||
|
$image = imagecreatefrombmp($src);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'image/png':
|
case 'image/png':
|
||||||
$image = imagecreatefrompng($src);
|
$image = imagecreatefrompng($src);
|
||||||
|
@ -1412,5 +1421,4 @@ class timthumb
|
||||||
{
|
{
|
||||||
return $this->is404;
|
return $this->is404;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,8 @@ function write_chart_total()
|
||||||
$count_contents['chart_disk'][] = [$count_day[$i] => getDirectorySize($total_contents . $count_day[$i])];
|
$count_contents['chart_disk'][] = [$count_day[$i] => getDirectorySize($total_contents . $count_day[$i])];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_dir(APP_ROOT.'/admin/logs/counts/')){
|
if (!is_dir(APP_ROOT . '/admin/logs/counts/')) {
|
||||||
mkdir(APP_ROOT.'/admin/logs/counts/',0755,true);
|
mkdir(APP_ROOT . '/admin/logs/counts/', 0755, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$count_contents = json_encode($count_contents, true);
|
$count_contents = json_encode($count_contents, true);
|
||||||
|
|
|
@ -43,9 +43,6 @@ if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
|
||||||
<script src="<?php static_cdn(); ?>/public/static/nprogress/nprogress.min.js"></script>
|
<script src="<?php static_cdn(); ?>/public/static/nprogress/nprogress.min.js"></script>
|
||||||
<script src="<?php static_cdn(); ?>/public/static/qrcode/qrcode.min.js"></script>
|
<script src="<?php static_cdn(); ?>/public/static/qrcode/qrcode.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// NProgress
|
|
||||||
NProgress.start();
|
|
||||||
NProgress.done();
|
|
||||||
// 导航状态
|
// 导航状态
|
||||||
$('.nav-pills').find('a').each(function() {
|
$('.nav-pills').find('a').each(function() {
|
||||||
if (this.href == document.location.href) {
|
if (this.href == document.location.href) {
|
||||||
|
@ -53,6 +50,10 @@ if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// NProgress
|
||||||
|
NProgress.start();
|
||||||
|
NProgress.done();
|
||||||
|
|
||||||
// js 获取当前网址二维码
|
// js 获取当前网址二维码
|
||||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||||
text: window.location.href,
|
text: window.location.href,
|
||||||
|
|
|
@ -1078,3 +1078,78 @@ function IP_URL_Ping($host, $port, $timeout)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成Token
|
||||||
|
* @param int $length Token长度
|
||||||
|
* @return string 返回Token
|
||||||
|
*/
|
||||||
|
function privateToken($length = 32)
|
||||||
|
{
|
||||||
|
$output = '';
|
||||||
|
for ($a = 0; $a < $length; $a++) {
|
||||||
|
$output .= chr(mt_rand(65, 122)); //生成php随机数
|
||||||
|
}
|
||||||
|
return md5($output);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查Token
|
||||||
|
* @param $token 要检查的Token
|
||||||
|
* code:201 访问成功但是服务端关闭API上传
|
||||||
|
* code:202 访问成功但是Token错误
|
||||||
|
*/
|
||||||
|
function check_api($token)
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
global $tokenList;
|
||||||
|
|
||||||
|
if (!$config['apiStatus']) {
|
||||||
|
// API关闭 服务端关闭API上传
|
||||||
|
$reJson = array(
|
||||||
|
"result" => 'failed',
|
||||||
|
'code' => 201,
|
||||||
|
'message' => 'API Closed',
|
||||||
|
);
|
||||||
|
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!in_array($tokenList[$token], $tokenList)) {
|
||||||
|
// Token 是否存在
|
||||||
|
$reJson = array(
|
||||||
|
"result" => 'failed',
|
||||||
|
'code' => 202,
|
||||||
|
'message' => 'Token Error',
|
||||||
|
);
|
||||||
|
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tokenList[$token]['expired'] < time()) {
|
||||||
|
// Token 是否过期
|
||||||
|
$reJson = array(
|
||||||
|
"result" => 'failed',
|
||||||
|
'code' => 203,
|
||||||
|
'message' => 'Token Expired',
|
||||||
|
);
|
||||||
|
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断webp是否为动态图片
|
||||||
|
* @param $src 图像文件
|
||||||
|
* @return bool 是|否
|
||||||
|
*/
|
||||||
|
function isWebpAnimated($src)
|
||||||
|
{
|
||||||
|
$webpContents = file_get_contents($src);
|
||||||
|
$where = strpos($webpContents, "ANMF");
|
||||||
|
if ($where !== FALSE) {
|
||||||
|
// animated
|
||||||
|
$isAnimated = true;
|
||||||
|
} else {
|
||||||
|
// non animated
|
||||||
|
$isAnimated = false;
|
||||||
|
}
|
||||||
|
return $isAnimated;
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php require_once __DIR__ . '/header.php'; ?>
|
<?php require_once __DIR__ . '/header.php'; ?>
|
||||||
|
|
||||||
<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">
|
|
||||||
<style>
|
<style>
|
||||||
/** 图片列表*/
|
/** 图片列表*/
|
||||||
|
|
||||||
|
@ -97,26 +95,27 @@
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="col-md-12">
|
<div class="row" style="margin-bottom:100px">
|
||||||
<?php
|
<div class="col-md-12">
|
||||||
if (!$config['showSwitch'] && !is_who_login('admin')) {
|
<?php
|
||||||
echo '<div class="alert alert-info">管理员关闭了预览哦~~</div>';
|
if (!$config['showSwitch'] && !is_who_login('admin')) {
|
||||||
} else {
|
echo '<div class="alert alert-info">管理员关闭了预览哦~~</div>';
|
||||||
$path = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/'); // 获取指定目录
|
} else {
|
||||||
$path = preg_replace("/^d{4}-d{2}-d{2} d{2}:d{2}:d{2}$/s", "", trim($path)); // 过滤非日期,删除空格
|
$path = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/'); // 获取指定目录
|
||||||
$keyNum = isset($_GET['num']) ? $_GET['num'] : $config['listNumber']; // 获取指定浏览数量
|
$path = preg_replace("/^d{4}-d{2}-d{2} d{2}:d{2}:d{2}$/s", "", trim($path)); // 过滤非日期,删除空格
|
||||||
$keyNum = preg_replace("/[\W]/", "", trim($keyNum)); // 过滤非数字,删除空格
|
$keyNum = isset($_GET['num']) ? $_GET['num'] : $config['listNumber']; // 获取指定浏览数量
|
||||||
// $fileArr = getFile(APP_ROOT . config_path($path)); // 获取当日上传列表
|
$keyNum = preg_replace("/[\W]/", "", trim($keyNum)); // 过滤非数字,删除空格
|
||||||
$fileType = isset($_GET['search']) ? '*.' . preg_replace("/[\W]/", "", $_GET['search']) : '*.*'; // 按照图片格式
|
// $fileArr = getFile(APP_ROOT . config_path($path)); // 获取当日上传列表
|
||||||
$fileArr = get_file_by_glob(APP_ROOT . config_path($path) . $fileType, 'list'); // 获取当日上传列表
|
$fileType = isset($_GET['search']) ? '*.' . preg_replace("/[\W]/", "", $_GET['search']) : '*.*'; // 按照图片格式
|
||||||
echo '
|
$fileArr = get_file_by_glob(APP_ROOT . config_path($path) . $fileType, 'list'); // 获取当日上传列表
|
||||||
|
echo '
|
||||||
<ul id="viewjs">
|
<ul id="viewjs">
|
||||||
<div class="cards listNum">';
|
<div class="cards listNum">';
|
||||||
if ($fileArr[0]) {
|
if ($fileArr[0]) {
|
||||||
foreach ($fileArr as $key => $value) {
|
foreach ($fileArr as $key => $value) {
|
||||||
if ($key < $keyNum) {
|
if ($key < $keyNum) {
|
||||||
$imgUrl = $config['imgurl'] . config_path($path) . $value;
|
$imgUrl = $config['imgurl'] . config_path($path) . $value;
|
||||||
echo '
|
echo '
|
||||||
<div class="col-md-4 col-sm-6 col-lg-3">
|
<div class="col-md-4 col-sm-6 col-lg-3">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<li><img src="../public/images/loading.svg" data-image="' . creat_thumbnail_by_list($imgUrl) . '" data-original="' . $imgUrl . '" alt="简单图床-EasyImage"></li>
|
<li><img src="../public/images/loading.svg" data-image="' . creat_thumbnail_by_list($imgUrl) . '" data-original="' . $imgUrl . '" alt="简单图床-EasyImage"></li>
|
||||||
|
@ -130,48 +129,48 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
echo '</div>';
|
||||||
|
} else {
|
||||||
|
echo '<div class="alert alert-danger">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</div>';
|
||||||
}
|
}
|
||||||
echo '</div>';
|
echo '</ul>';
|
||||||
} else {
|
|
||||||
echo '<div class="alert alert-danger">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</div>';
|
|
||||||
}
|
}
|
||||||
echo '</ul>';
|
// 当前日期全部上传
|
||||||
}
|
$allUploud = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/');
|
||||||
// 当前日期全部上传
|
$allUploud = get_file_by_glob(APP_ROOT . $config['path'] . $allUploud, 'number');
|
||||||
$allUploud = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/');
|
// 组合url
|
||||||
$allUploud = get_file_by_glob(APP_ROOT . $config['path'] . $allUploud, 'number');
|
@$httpUrl = array('date' => $path, 'num' => getFileNumber(APP_ROOT . config_path($path)));
|
||||||
// 组合url
|
?>
|
||||||
@$httpUrl = array('date' => $path, 'num' => getFileNumber(APP_ROOT . config_path($path)));
|
</div>
|
||||||
?>
|
<div class="col-md-12">
|
||||||
</div>
|
<hr />
|
||||||
<div class="col-md-12">
|
<div class="col-md-8 col-xs-12" style="padding-bottom:5px">
|
||||||
<hr />
|
<div class="btn-toolbar">
|
||||||
<div class="col-md-8 col-xs-12" style="padding-bottom:5px">
|
<div class="btn-group">
|
||||||
<div class="btn-toolbar">
|
<a class="btn btn-danger btn-mini" href="?<?php echo http_build_query($httpUrl); ?>">当前<?php echo $allUploud; ?></a>
|
||||||
<div class="btn-group">
|
<a class="btn btn-primary btn-mini" href="list.php">今日<?php echo get_file_by_glob(APP_ROOT . config_path() . '*.*', 'number'); ?></a>
|
||||||
<a class="btn btn-danger btn-mini" href="?<?php echo http_build_query($httpUrl); ?>">当前<?php echo $allUploud; ?></a>
|
<a class="btn btn-mini" href="?date=<?php echo date("Y/m/d/", strtotime("-1 day")) ?>">昨日<?php echo get_file_by_glob(APP_ROOT . $config['path'] . date("Y/m/d/", strtotime("-1 day")), 'number'); ?></a>
|
||||||
<a class="btn btn-primary btn-mini" href="list.php">今日<?php echo get_file_by_glob(APP_ROOT . config_path() . '*.*', 'number'); ?></a>
|
<?php
|
||||||
<a class="btn btn-mini" href="?date=<?php echo date("Y/m/d/", strtotime("-1 day")) ?>">昨日<?php echo get_file_by_glob(APP_ROOT . $config['path'] . date("Y/m/d/", strtotime("-1 day")), 'number'); ?></a>
|
// 倒推日期显示上传图片
|
||||||
<?php
|
for ($x = 2; $x <= 6; $x++)
|
||||||
// 倒推日期显示上传图片
|
echo '<a class="btn btn-mini hidden-xs inline-block" href="?date=' . date('Y/m/d/', strtotime("-$x day")) . '">' . date('m月d日', strtotime("-$x day")) . '</a>';
|
||||||
for ($x = 2; $x <= 6; $x++)
|
?>
|
||||||
echo '<a class="btn btn-mini hidden-xs inline-block" href="?date=' . date('Y/m/d/', strtotime("-$x day")) . '">' . date('m月d日', strtotime("-$x day")) . '</a>';
|
</div>
|
||||||
?>
|
<div class="btn-group">
|
||||||
</div>
|
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'checkall')">全选</a>
|
||||||
<div class="btn-group">
|
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'reversecheck')">反选</a>
|
||||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'checkall')">全选</a>
|
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'uncheckall')">取消</a>
|
||||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'reversecheck')">反选</a>
|
<a class="btn btn-mini" onclick="recycle_img()">回收</a>
|
||||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'uncheckall')">取消</a>
|
<a class="btn btn-mini" onclick="delete_img()">删除</a>
|
||||||
<a class="btn btn-mini" onclick="recycle_img()">回收</a>
|
</div>
|
||||||
<a class="btn btn-mini" onclick="delete_img()">删除</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- 按格式 -->
|
||||||
<!-- 按格式 -->
|
<div class="row">
|
||||||
<div class="row">
|
<!--
|
||||||
<!--
|
|
||||||
<div class="col-md-2 col-xs-6">
|
<div class="col-md-2 col-xs-6">
|
||||||
<form action="list.php" method="get">
|
<form action="list.php" method="get">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
@ -186,33 +185,36 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="col-md-2 col-xs-6">
|
<div class="col-md-2 col-xs-6">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=jpg'; ?>">JPG</a>
|
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=jpg'; ?>">JPG</a>
|
||||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=png'; ?>">PNG</a>
|
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=png'; ?>">PNG</a>
|
||||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=gif'; ?>">GIF</a>
|
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=gif'; ?>">GIF</a>
|
||||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=webp'; ?>">Webp</a>
|
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=webp'; ?>">Webp</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 按日期-->
|
||||||
|
<div class="col-md-2 col-xs-6">
|
||||||
|
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="get">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon fix-border fix-padding"></span>
|
||||||
|
<input type="text" class="form-control form-date input-sm" name="date" value="<?php echo date('Y/m/d/'); ?>" readonly="readonly">
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button type="submit" class="btn btn-primary input-sm">按日期</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 按日期-->
|
</div>
|
||||||
<div class="col-md-2 col-xs-6">
|
<!-- 返回顶部 -->
|
||||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="get">
|
<div style="display: none;" id="rocket-to-top">
|
||||||
<div class="input-group">
|
<div style="opacity:0;display: block;" class="level-2"></div>
|
||||||
<span class="input-group-addon fix-border fix-padding"></span>
|
<div class="level-3"></div>
|
||||||
<input type="text" class="form-control form-date input-sm" name="date" value="<?php echo date('Y/m/d/'); ?>" readonly="readonly">
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button type="submit" class="btn btn-primary input-sm">按日期</button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 返回顶部 -->
|
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/viewjs/viewer.min.css">
|
||||||
<div style="display: none;" id="rocket-to-top">
|
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css">
|
||||||
<div style="opacity:0;display: block;" class="level-2"></div>
|
|
||||||
<div class="level-3"></div>
|
|
||||||
</div>
|
|
||||||
<script src="<?php static_cdn(); ?>/public/static/lazyload/lazyload.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>
|
<script src="<?php static_cdn(); ?>/public/static/viewjs/viewer.min.js"></script>
|
||||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
|
<script src="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
|
||||||
|
@ -293,7 +295,7 @@
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 删除图片
|
// 删除图片
|
||||||
function delete_img() {
|
function delete_img() {
|
||||||
var r = confirm("确认要删除?\n* 删除文件夹后将无法恢复!")
|
var r = confirm("确认要删除?\n* 删除文件夹后将无法恢复!")
|
||||||
if (r == true) {
|
if (r == true) {
|
||||||
|
|
|
@ -83,5 +83,25 @@ $ALLOWED_SITES = array(
|
||||||
'mindsharestudios.com'
|
'mindsharestudios.com'
|
||||||
);
|
);
|
||||||
|
|
||||||
require_once __DIR__ . '/TimThumb.php';
|
/**
|
||||||
timthumb::start();
|
* 修复无法生成生成webp动态图片的缩略图bug
|
||||||
|
*/
|
||||||
|
if (isset($_GET['img'])) {
|
||||||
|
// 获取图片后缀后4位
|
||||||
|
$ext = substr($_GET['img'], -4);
|
||||||
|
// 图片绝对路径
|
||||||
|
$src = APP_ROOT . $_GET['img'];
|
||||||
|
// 检测图片
|
||||||
|
if ($ext == 'webp' && isWebpAnimated($src)) {
|
||||||
|
// 输出动态的webp
|
||||||
|
header("Content-type: image/webp");
|
||||||
|
exit(file_get_contents($src, true));
|
||||||
|
}
|
||||||
|
// 非动态webp输出
|
||||||
|
require_once __DIR__ . '/TimThumb.php';
|
||||||
|
timthumb::start();
|
||||||
|
} else {
|
||||||
|
// 输出404
|
||||||
|
header("Content-type: image/webp");
|
||||||
|
exit(file_get_contents(APP_ROOT . '/public/images/404.png', true));
|
||||||
|
}
|
||||||
|
|
|
@ -39,9 +39,9 @@ $config=Array
|
||||||
'imgRatio_quality'=>80,
|
'imgRatio_quality'=>80,
|
||||||
'imgRatio_crop'=>0,
|
'imgRatio_crop'=>0,
|
||||||
'imgRatio_preserve_headers'=>1,
|
'imgRatio_preserve_headers'=>1,
|
||||||
'static_cdn'=>0,
|
'static_cdn'=>1,
|
||||||
'theme'=>'default',
|
'theme'=>'default',
|
||||||
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@2.5.4',
|
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0',
|
||||||
'TinyPng_key'=>'',
|
'TinyPng_key'=>'',
|
||||||
'checkImg'=>0,
|
'checkImg'=>0,
|
||||||
'checkImg_value'=>50,
|
'checkImg_value'=>50,
|
||||||
|
@ -62,7 +62,7 @@ var _hmt = _hmt || [];
|
||||||
<div class="col-md-12" style="text-align: center;margin:2px;">
|
<div class="col-md-12" style="text-align: center;margin:2px;">
|
||||||
<a href="https://app.cloudcone.com.cn/?ref=3521" target="_blank"><img src="/public/images/EasyImage2.0.png" /></a>
|
<a href="https://app.cloudcone.com.cn/?ref=3521" target="_blank"><img src="/public/images/EasyImage2.0.png" /></a>
|
||||||
</div>',
|
</div>',
|
||||||
'ad_bot'=>1,
|
'ad_bot'=>0,
|
||||||
'ad_bot_info'=>'<div class="col-md-12" style="text-align: center;padding:12px 0 90px 0;">
|
'ad_bot_info'=>'<div class="col-md-12" style="text-align: center;padding:12px 0 90px 0;">
|
||||||
<a href="../public/images/wechat.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#329d38;" data-lightbox-group="group1644998953432"><i class="icon icon-wechat"></i> 打赏作者</a>
|
<a href="../public/images/wechat.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#329d38;" data-lightbox-group="group1644998953432"><i class="icon icon-wechat"></i> 打赏作者</a>
|
||||||
<a href="../public/images/alipay.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#1970fc;" data-lightbox-group="group1644998953432"><i class="icon icon-zhifubao"></i> 打赏作者</a>
|
<a href="../public/images/alipay.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#1970fc;" data-lightbox-group="group1644998953432"><i class="icon icon-zhifubao"></i> 打赏作者</a>
|
||||||
|
@ -98,7 +98,7 @@ var _hmt = _hmt || [];
|
||||||
'language'=>0,
|
'language'=>0,
|
||||||
'image_recycl'=>1,
|
'image_recycl'=>1,
|
||||||
'version'=>'2.5.4',
|
'version'=>'2.5.4',
|
||||||
'update'=>'2022-03-02 18:12:15',
|
'update'=>'2022-03-04 20:52:07',
|
||||||
'terms'=>'<div class="container">
|
'terms'=>'<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-3">
|
<div class="col-xs-3">
|
||||||
|
|
40
index.php
40
index.php
|
@ -78,6 +78,27 @@ mustLogin();
|
||||||
<script src="<?php static_cdn(); ?>/public/static/marquee/marquee.min.js"></script>
|
<script src="<?php static_cdn(); ?>/public/static/marquee/marquee.min.js"></script>
|
||||||
<script src="<?php static_cdn(); ?>/public/static/EasyImage.js"></script>
|
<script src="<?php static_cdn(); ?>/public/static/EasyImage.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
// 公告
|
||||||
|
(function() {
|
||||||
|
new Marquee({
|
||||||
|
// 要滚动的元素
|
||||||
|
elem: document.getElementById("marquee2"),
|
||||||
|
// 每次滚动的步长(px),默认0
|
||||||
|
step: 30,
|
||||||
|
// 滚动效果执行时间(ms),默认400
|
||||||
|
stepInterval: 400,
|
||||||
|
// 每次滚动间隔时间(ms),默认3000
|
||||||
|
interval: 3000,
|
||||||
|
// 滚动方向,up、down、left、right,默认为"left" 当前只支持上下
|
||||||
|
dir: 'up',
|
||||||
|
// 是否自动滚动,默认为true
|
||||||
|
autoPlay: true,
|
||||||
|
// 是否在鼠标滑过低级元素时暂停滚动,默认为true
|
||||||
|
hoverPause: true
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
|
// 上传控制
|
||||||
$('#upShowID').uploader({
|
$('#upShowID').uploader({
|
||||||
// 自动上传
|
// 自动上传
|
||||||
autoUpload: false,
|
autoUpload: false,
|
||||||
|
@ -131,25 +152,6 @@ mustLogin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 公告
|
|
||||||
(function() {
|
|
||||||
new Marquee({
|
|
||||||
// 要滚动的元素
|
|
||||||
elem: document.getElementById("marquee2"),
|
|
||||||
// 每次滚动的步长(px),默认0
|
|
||||||
step: 30,
|
|
||||||
// 滚动效果执行时间(ms),默认400
|
|
||||||
stepInterval: 400,
|
|
||||||
// 每次滚动间隔时间(ms),默认3000
|
|
||||||
interval: 3000,
|
|
||||||
// 滚动方向,up、down、left、right,默认为"left" 当前只支持上下
|
|
||||||
dir: 'up',
|
|
||||||
// 是否自动滚动,默认为true
|
|
||||||
autoPlay: true,
|
|
||||||
// 是否在鼠标滑过低级元素时暂停滚动,默认为true
|
|
||||||
hoverPause: true
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
/** 环境检测 */ if ($config['checkEnv']) require_once APP_ROOT . '/application/check.php';
|
/** 环境检测 */ if ($config['checkEnv']) require_once APP_ROOT . '/application/check.php';
|
||||||
|
|
Loading…
Reference in New Issue