pull/141/head 2.6.5
icret 2022-05-27 00:13:59 +08:00
parent 4f73cae1fc
commit 313ce88a64
8 changed files with 45 additions and 64 deletions

View File

@ -180,6 +180,9 @@ $HTTP["url"] =~ "^/(i|public)/" {
<details><summary>点击查看2.0版更新日志</summary>
* 2022-05-27 v2.6.5
- 更改文件位置
* 2022-05-26 v2.6.4
- 更改版本显示方式

View File

@ -780,12 +780,20 @@ if (isset($_GET['recycle_reimg'])) {
<a href="https://github.com/verot/class.upload.php" target="_blank"><span class="label label-badge label-success" data-toggle="tooltip" title="文件管理">Tinyfilemanager</span></a>
<span class="label label-badge label-success" data-toggle="tooltip" title="当前版本"><?php echo get_current_verson(); ?></span>
<?php if (getVersion() !== get_current_verson()) : ?>
<a href="https://github.com/icret/EasyImages2.0/releases" target="_blank"><span class="label label-badge label-warning" data-toggle="tooltip" title="Github有更新,更新后删除<p>/admin/logs/verson/</p>文件夹会自动同步最新版本号"><?php echo getVersion(); ?> New</span></a>
<a href="#NewVersion" data-toggle="collapse" class="label label-badge label-warning" title="Github有更新"><?php echo getVersion(); ?> New</span></a>
<?php endif; ?>
<a href="https://github.com/icret/EasyImages2.0/blob/master/LICENSE" target="_blank"><span class="label label-badge" data-toggle="tooltip" title="许可证">GPL-2.0</span></a>
</p>
<p class="text-muted"><i class="icon icon-certificate"> EasyImage2.0简单图床构建于众多优秀的开源项目之上,非常感谢这些项目!</i></p>
</div>
<div class="collapse" id="NewVersion">
<div class="bg-primary with-padding">
<p>最新版本: <?php echo getVersion('name'); ?> <a href="<?php echo getVersion('zipball_url'); ?>" target="_blank" class="label label-badge">点击下载</a></p>
<p>更新日期: <?php echo getVersion('created_at'); ?></p>
<p>更新内容: <br /><?php echo getVersion('body'); ?></p>
<p>更新后删除<small style="color: black;">/admin/logs/verson/</small>文件夹会自动同步最新版本号</p>
</div>
</div>
</div>
<div class="tab-pane fade" id="Content9">
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">

1
admin/verson.txt Normal file
View File

@ -0,0 +1 @@
2.6.5

View File

@ -8,8 +8,8 @@ if (!is_file(APP_ROOT . '/install/install.lock') and is_file(APP_ROOT . '/instal
* 检测弹窗内容
*/
if (file_exists(APP_ROOT . '/config/EasyIamge.lock')) return; // 查询锁定弹窗文件是否存在
file_put_contents(APP_ROOT . '/config/EasyIamge.lock', '安装环境检测锁定文件,如需再次展示请删除此文件!', FILE_APPEND | LOCK_EX);
if (file_exists(APP_ROOT . '/admin/EasyIamge.lock')) return; // 查询锁定弹窗文件是否存在
file_put_contents(APP_ROOT . '/admin/EasyIamge.lock', '安装环境检测锁定文件,如需再次展示请删除此文件!', FILE_APPEND | LOCK_EX);
?>
<div class="modal fade" id="myModal-1">
<div class="modal-dialog">

View File

@ -14,13 +14,13 @@ class getVerson
$this->url = $url;
}
public function readJson()
public function readJson($name = 'tag_name')
{
if (file_exists(__DIR__ . '/../admin/logs/verson/verson.json')) {
$file = fopen(__DIR__ . '/../admin/logs/verson/verson.json', 'r');
$test = fread($file, filesize(__DIR__ . '/../admin/logs/verson/verson.json'));
$verson = json_decode($test, true);
return $verson['tag_name'];
return $verson[$name];
fclose($file);
} else {
$this->downJson();
@ -30,9 +30,8 @@ class getVerson
public function downJson()
{
if(!is_dir(__DIR__.'/../admin/logs/verson/'))
{
mkdir(__DIR__.'/../admin/logs/verson/',0755,true);
if (!is_dir(__DIR__ . '/../admin/logs/verson/')) {
mkdir(__DIR__ . '/../admin/logs/verson/', 0755, true);
}
$verson = $this->geturl($this->url);

View File

@ -80,7 +80,6 @@ function checkLogin()
return 203;
}
// 管理员登陆
if ($getCOK[1] == $config['password']) {
return 204;
@ -179,7 +178,7 @@ function config_path($path = null)
global $config;
// php5.6 兼容写法:
$path = isset($path) ? $path : date('Y/m/d/');
// php7.0 $path = $path ?? date('Y/m/d/');
// php7.0 $path = $path ?? date('Y/m/d/');
$img_path = $config['path'] . $path;
if (!is_dir($img_path)) {
@ -662,7 +661,7 @@ function imgRatio()
* 定时获取GitHub 最新版本
* @return mixed|null 读取版本信息
*/
function getVersion()
function getVersion($name = 'tag_name')
{
global $config;
@ -677,7 +676,7 @@ function getVersion()
$get_ver_day = array('1006', '2501'); // 检测日期的时间
foreach ($get_ver_day as $day) {
if (empty($getVersion->readJson())) { // 不存在就下载
if (empty($getVersion->readJson($name))) { // 不存在就下载
$getVersion->downJson();
} else if ($day == $now) { // 是否在需要更新的日期
$getVersion->downJson();
@ -686,7 +685,7 @@ function getVersion()
return null;
*/
} else { // 返回版本
return $getVersion->readJson();
return $getVersion->readJson($name);
}
}
}
@ -1347,41 +1346,13 @@ function isAnimatedGifWebp($src)
return strpos($filecontent, chr(0x21) . chr(0xff) . chr(0x0b) . 'NETSCAPE2.0') === FALSE ? false : true;
}
/**
* 读取日志
* @param String $logs 文件路径
*/
function read_upload_logs($logs = null)
{
global $config;
$logs = isset($logs) ? $logs : APP_ROOT . '/admin/logs/upload/' . date('Y-m') . '.php';
if ($config['upload_logs'] == 0) {
$logs = '已经关闭了上传日志!';
} else {
if (file_exists($logs)) {
$logs = file_get_contents($logs, false, null, 274, 1000000);
$logs = str_replace(
array('{', '}}', '"', '\\', 'source:', 'date:', 'ip:', 'port:', 'user_agent:', 'path:', 'size:', 'checkImg:', 'from:'),
array('', '', '', '', '源名:', '日期:', 'IP:', '端口:', '信息:', '路径:', '大小:', '鉴黄状态:', '来源:'),
$logs
);
} else {
$logs = "日志文件不存在,可能是当前月份没有新上传日志,请尝试上传一张!";
}
}
return $logs;
}
/**
* 获取当前版本号
* @param String $file 文件相对路径
* @return String 内容信息
*/
function get_current_verson($file = '/config/verson.txt')
function get_current_verson($file = '/admin/verson.txt')
{
$file = APP_ROOT . $file;
@ -1390,5 +1361,5 @@ function get_current_verson($file = '/config/verson.txt')
return file_get_contents($file);
}
return 'No Verson file';
return 'No Verson';
}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
2.6.4