fix PHP8.0

This commit is contained in:
icret
2022-04-02 18:10:17 +08:00
parent 22842e24ea
commit bbfb384311
9 changed files with 168 additions and 160 deletions

View File

@@ -1,105 +1,11 @@
<?php require_once __DIR__ . '/header.php'; ?>
<style>
/** 图片列表*/
@media screen and (min-width:960px) {
.listNum img {
width: 258px;
height: 258px;
}
}
@media screen and (max-width:960px) {
.listNum img {
width: 358px;
height: 258px;
}
}
/** 返回顶部*/
* {
list-style: none;
border: 0;
}
#rocket-to-top div {
left: 0;
margin: 0;
overflow: hidden;
padding: 0;
position: absolute;
top: 0;
width: 110px;
}
#rocket-to-top .level-2 {
background: url("../public/images/rocket_button_up.png") no-repeat scroll -149px 0 transparent;
display: none;
height: 250px;
opacity: 0;
z-index: 1;
}
#rocket-to-top .level-3 {
background: none repeat scroll 0 0 transparent;
cursor: pointer;
display: block;
height: 150px;
z-index: 2;
}
#rocket-to-top {
background: url("../public/images/rocket_button_up.png") no-repeat scroll 0 0 transparent;
cursor: default;
display: block;
height: 250px;
margin: -125px 0 0;
overflow: hidden;
padding: 0;
position: fixed;
right: 0;
top: 80%;
width: 110px;
z-index: 11;
}
.cards {
padding-top: 0px;
padding-bottom: 0px;
margin-right: 0px;
margin-left: 0px;
}
.card {
box-shadow: rgba(0, 0, 0, 0.45) 0px 25px 20px -20px;
border-radius: 5px 5px 5px 5px;
}
img {
cursor: pointer;
transition: all 0.8s;
}
img:hover {
transform: scale(1.5);
position: relative;
z-index: 100;
}
.bottom-bar {
width: 100%;
position: absolute;
bottom: -4px;
background-color: rgba(0, 0, 0, 0.2);
}
</style>
<div class="row" style="margin-bottom:100px">
<div class="col-md-12">
<?php
if (!$config['showSwitch'] && !is_who_login('admin')) {
echo '<div class="alert alert-info">管理员关闭了预览哦~~</div>';
} else {
if (!$config['showSwitch'] && !is_who_login('admin')) : ?>
<div class="alert alert-info">管理员关闭了预览哦~~</div>
<?php exit(require_once __DIR__ . '/footer.php');
else :
$path = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/'); // 获取指定目录
$path = preg_replace("/^d{4}-d{2}-d{2} d{2}:d{2}:d{2}$/s", "", trim($path)); // 过滤非日期,删除空格
$keyNum = isset($_GET['num']) ? $_GET['num'] : $config['listNumber']; // 获取指定浏览数量
@@ -107,42 +13,38 @@
// $fileArr = getFile(APP_ROOT . config_path($path)); // 获取当日上传列表
$fileType = isset($_GET['search']) ? '*.' . preg_replace("/[\W]/", "", $_GET['search']) : '*.*'; // 按照图片格式
$fileArr = get_file_by_glob(APP_ROOT . config_path($path) . $fileType, 'list'); // 获取当日上传列表
echo '
<ul id="viewjs">
<div class="cards listNum">';
if ($fileArr[0]) {
foreach ($fileArr as $key => $value) {
if ($key < $keyNum) {
$imgUrl = $config['imgurl'] . config_path($path) . $value;
echo '
<div class="col-md-4 col-sm-6 col-lg-3">
<div class="card">
<li><img src="../public/images/loading.svg" data-image="' . creat_thumbnail_by_list($imgUrl) . '" data-original="' . $imgUrl . '" alt="简单图床-EasyImage"></li>
<div class="bottom-bar">
<a href="' . $imgUrl . '" target="_blank"><i class="icon icon-picture" data-toggle="tooltip" title="原图" style="margin-left:10px;"></i></a>
<a href="#" class="copy" data-clipboard-text="' . $imgUrl . '" data-toggle="tooltip" title="复制" style="margin-left:10px;"><i class="icon icon-copy"></i></a>
<a href="/application/info.php?img=' . $imgUrl . '" data-toggle="tooltip" title="信息" target="_blank" style="margin-left:10px;"><i class="icon icon-info-sign"></i></a>
<a href="' . $config['domain'] . '/application/del.php?recycle_url=' . $imgUrl . '" target="_blank" data-toggle="tooltip" title="回收" style="margin-left:10px;"><i class="icon icon-undo"></i></a>
<a href="' . $config['domain'] . '/application/del.php?url=' . $imgUrl . '" target="_blank" data-toggle="tooltip" title="删除" style="margin-left:10px;"><i class="icon icon-trash"></i></a>
<label style="margin-left:10px;" class="text-primary"><input type="checkbox" style="margin: left 200px;" id="url" name="checkbox" value="' . $imgUrl . '"> 选择</label>
</div>
$allUploud = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/');
$allUploud = get_file_by_glob(APP_ROOT . $config['path'] . $allUploud, 'number'); // 当前日期全部上传
$httpUrl = array('date' => $path, 'num' => getFileNumber(APP_ROOT . config_path($path))); // 组合url
if (empty($fileArr[0])) : ?>
<div class="alert alert-danger">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</div>
<?php else : ?>
<ul id="viewjs">
<div class="cards listNum">
<?php
foreach ($fileArr as $key => $value) :
if ($key < $keyNum) {
$imgUrl = $config['imgurl'] . config_path($path) . $value;
}
?>
<div class="col-md-4 col-sm-6 col-lg-3">
<div class="card">
<li><img src="../public/images/loading.svg" data-image="<?php echo creat_thumbnail_by_list($imgUrl); ?>" data-original="<?php echo $imgUrl; ?>" alt="简单图床-EasyImage"></li>
<div class="bottom-bar">
<a href="<?php echo $imgUrl; ?>" target="_blank"><i class="icon icon-picture" data-toggle="tooltip" title="原图" style="margin-left:10px;"></i></a>
<a href="#" class="copy" data-clipboard-text="<?php echo $imgUrl; ?>" data-toggle="tooltip" title="复制" style="margin-left:10px;"><i class="icon icon-copy"></i></a>
<a href="/application/info.php?img=<?php echo $imgUrl; ?>" data-toggle="tooltip" title="信息" target="_blank" style="margin-left:10px;"><i class="icon icon-info-sign"></i></a>
<a href="<?php echo $config['domain']; ?>/application/del.php?recycle_url=<?php echo $imgUrl; ?>" target="_blank" data-toggle="tooltip" title="回收" style="margin-left:10px;"><i class="icon icon-undo"></i></a>
<a href="<?php echo $config['domain']; ?>/application/del.php?url=<?php echo $imgUrl; ?>" target="_blank" data-toggle="tooltip" title="删除" style="margin-left:10px;"><i class="icon icon-trash"></i></a>
<label style="margin-left:10px;" class="text-primary"><input type="checkbox" style="margin: left 200px;" id="url" name="checkbox" value="<?php echo $imgUrl; ?>"> 选择</label>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
';
}
}
echo '</div>';
} 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');
// 组合url
@$httpUrl = array('date' => $path, 'num' => getFileNumber(APP_ROOT . config_path($path)));
?>
</ul>
<?php endif;
endif; ?>
</div>
<div class="col-md-12">
<hr />
@@ -212,6 +114,7 @@
<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">
<script src="<?php static_cdn(); ?>/public/static/lazyload/lazyload.js"></script>