You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-13 11:43:58 +08:00
- 优化二级目录使用
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// 设置html为utf8
|
||||
header('Content-Type:text/html;charset=utf-8');
|
||||
// 定义根目录
|
||||
define('APP_ROOT', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')));
|
||||
define('APP_ROOT', str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname(__FILE__) . '/../')));
|
||||
// 时区设置 https://www.php.net/manual/zh/timezones.php
|
||||
require_once APP_ROOT . '/config/config.php';
|
||||
empty($config['timezone']) ? date_default_timezone_set('Asia/Shanghai') : date_default_timezone_set($config['timezone']);
|
||||
|
||||
@@ -586,7 +586,7 @@ function getDel($url, $type)
|
||||
$url = urldecode(trim($url));
|
||||
|
||||
if ($type == 'url') {
|
||||
$url = $_SERVER['DOCUMENT_ROOT'] . $url;
|
||||
$url = APP_ROOT . $url;
|
||||
}
|
||||
if ($type == 'hash') {
|
||||
$url = APP_ROOT . $url;
|
||||
@@ -643,7 +643,7 @@ function easyimage_delete($url, $type)
|
||||
$url = urldecode(trim($url));
|
||||
|
||||
if ($type == 'url') {
|
||||
$url = $_SERVER['DOCUMENT_ROOT'] . $url;
|
||||
$url = APP_ROOT . $url;
|
||||
}
|
||||
if ($type == 'hash') {
|
||||
$url = APP_ROOT . $url;
|
||||
@@ -1544,7 +1544,7 @@ function write_upload_logs($filePath, $sourceName, $absolutePath, $fileSize, $fr
|
||||
|
||||
// $name = trim(basename($filePath), " \t\n\r\0\x0B"); // 当前图片名称
|
||||
$log = array(basename($filePath) => array( // 以上传图片名称为Array
|
||||
'source' => htmlspecialchars($sourceName), // 原始文件名称
|
||||
'source' => htmlspecialchars($sourceName), // 原始文件名称
|
||||
'date' => date('Y-m-d H:i:s'), // 上传日期
|
||||
'ip' => real_ip(), // 上传IP
|
||||
'port' => $_SERVER['REMOTE_PORT'], // IP端口
|
||||
|
||||
@@ -68,7 +68,7 @@ class Ip2Region
|
||||
$geo = $this->memorySearch($ip);
|
||||
$arr = explode('|', str_replace(['0|'], '|', isset($geo['region']) ? $geo['region'] : ''));
|
||||
if (($last = array_pop($arr)) === '内网IP') $last = '';
|
||||
return join('', $arr) . (empty($last) ? '' : "[{$last}]");
|
||||
return join('', $arr) . (empty($last) ? '' : "【{$last}】");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,7 +126,7 @@ class XdbSearcher
|
||||
// read the vector index block
|
||||
$buff = $this->read(self::HeaderInfoLength + $idx, 8);
|
||||
if ($buff === null) {
|
||||
throw new Exception("failed to read vector index at ${idx}");
|
||||
throw new Exception("failed to read vector index at {$idx}");
|
||||
}
|
||||
|
||||
$sPtr = self::getLong($buff, 0);
|
||||
@@ -147,7 +147,7 @@ class XdbSearcher
|
||||
// read the segment index
|
||||
$buff = $this->read($p, self::SegmentIndexSize);
|
||||
if ($buff == null) {
|
||||
throw new Exception("failed to read segment index at ${p}");
|
||||
throw new Exception("failed to read segment index at {$p}");
|
||||
}
|
||||
|
||||
$sip = self::getLong($buff, 0);
|
||||
|
||||
Binary file not shown.
@@ -31,17 +31,17 @@ Thumb::show($src, $w, $h);
|
||||
* 2022-1-30 06:35:08
|
||||
*
|
||||
* TimThumb参数指南
|
||||
* 命令 作用 参数 描述
|
||||
* src 源 图像URL 告诉TimThumb调整哪个图片
|
||||
* w 宽度 宽度调整 调整输出图像的宽度
|
||||
* h 高度 高度调整 调整输出图像的高度
|
||||
* q 质量 0 - 100 压缩质量,值越大质量越高。不建议高于95
|
||||
* a 对齐 c, t, l, r, b, tl, tr, bl, br 图像对齐。 c = center, t = top, b = bottom, r = right, l = left。 可以创建对角位置
|
||||
* zc 缩放/裁剪 0、1、2、3 0:根据传入的值进行缩放(不裁剪), 1:以最合适的比例裁剪和调整大小(裁剪), 2:按比例调整大小,并添加边框(裁剪),3:按比例调整大小,不添加边框(裁剪)
|
||||
* f 过滤器 太多了 可以改变亮度/对比度;甚至模糊图像
|
||||
* s 锐化 锐化 使得按比例缩小图片看起来有点;更清晰
|
||||
* cc 画布上的颜色 十六进制的颜色值(# ffffff) 改变背景颜色。 大多数更改缩放和作物设置时使用,进而可以添加图像边界。
|
||||
* ct 画布的透明度 true (1) 使用透明而忽略背景颜色
|
||||
* 命令 作用 参数 描述
|
||||
* src 源文件 图像URL 告诉TimThumb调整哪个图片
|
||||
* w 宽度 宽度调整 调整输出图像的宽度
|
||||
* h 高度 高度调整 调整输出图像的高度
|
||||
* q 质量 0-100 压缩质量,值越大质量越高。不建议高于95
|
||||
* a 对齐 c, t, l, r, b, tl, tr, bl, br 图像对齐。 c = center, t = top, b = bottom, r = right, l = left。 可以创建对角位置
|
||||
* zc 缩放/裁剪 0、1、2、3 0: 根据传入的值进行缩放(不裁剪), 1:以最合适的比例裁剪和调整大小(裁剪), 2:按比例调整大小,并添加边框(裁剪),3:按比例调整大小,不添加边框(裁剪)
|
||||
* f 过滤器 太多了 可以改变亮度/对比度;甚至模糊图像
|
||||
* s 锐化 锐化 使得按比例缩小图片看起来有点;更清晰
|
||||
* cc 画布颜色 #ffffff 改变背景颜色。 大多数更改缩放和作物设置时使用,进而可以添加图像边界。
|
||||
* ct 画布透明度 true (1) 使用透明而忽略背景颜色
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/function.php';
|
||||
@@ -74,7 +74,6 @@ $ALLOWED_SITES = array(
|
||||
$config['imgurl'],
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* 修复无法生成生成webp动态图片的缩略图bug
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,6 @@ try {
|
||||
throw new Exception('<div class="alert alert-info">没有上传日志!<div>');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
require_once APP_ROOT . '/app/footer.php';
|
||||
exit;
|
||||
}
|
||||
@@ -176,7 +175,7 @@ try {
|
||||
checkImg: '<?php echo strstr('OFF', $v['checkImg']) ? '否' : '是'; ?>',
|
||||
from: '<?php echo is_string($v['from']) ? "网页" : 'API: ' . $v['from']; ?>',
|
||||
manage: '<div class="btn-group"><a href="<?php echo rand_imgurl() . $v['path']; ?>" target="_blank" class="btn btn-mini btn-success">查看</a> <a href="/app/info.php?img=<?php echo $v['path']; ?>" target="_blank" class="btn btn-mini">信息</a><a href="#" onclick="ajax_post(\'<?php echo $v['path']; ?>\',\'recycle\')" class="btn btn-mini btn-info">回收</a> <a href="#" onclick="ajax_post(\'<?php echo $v['path']; ?>\',\'delete\')" class="btn btn-mini btn-danger">删除</a></div>',
|
||||
},
|
||||
},
|
||||
<?php endforeach; ?>
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user