You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-13 11:43:58 +08:00
@@ -48,8 +48,8 @@
|
||||
makeCode();
|
||||
}
|
||||
});
|
||||
|
||||
// NProgress
|
||||
</script>
|
||||
<script>
|
||||
$("body").show();
|
||||
$(".version").text(NProgress.version);
|
||||
NProgress.start();
|
||||
@@ -74,23 +74,29 @@
|
||||
<script src="../public/static/hm.js"></script>
|
||||
<footer class="text-muted small col-md-12" style="text-align: center;margin-bottom: 10px"><?php echo showAD('bot'); ?>
|
||||
<p><?php echo $config['customize']; ?></p>
|
||||
|
||||
|
||||
<hr>
|
||||
<p>请勿上传违反中国政策的图片<i class="icon icon-smile"></i> </p>
|
||||
<div>
|
||||
<p>
|
||||
<span class="label label-dot label-outline">Default</span>
|
||||
<span class="label label-dot label-primary label-outline">Primary</span>
|
||||
<span class="label label-dot label-success label-outline">Success</span>
|
||||
<span class="label label-dot label-info label-outline">Info</span>
|
||||
<span class="label label-dot label-warning label-outline">Warning</span>
|
||||
<span class="label label-dot label-danger label-outline">Danger</span>
|
||||
</p>
|
||||
<!-- 对话框触发按钮 -->
|
||||
<a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal">
|
||||
<i class="icon icon-qrcode"></i>二维码 </a>
|
||||
<a href="/tinyfilemanager.php?p=<?php echo date('Y/m/d'); ?>" target="_blank" ><i class="icon icon-desktop"></i>管理 </a>
|
||||
<a href="/api/api-web.php" target="_blank"><i class="icon icon-key"></i>API </a>
|
||||
<span class="label"><i class="icon icon-qrcode"></i> 二维码</a></span>
|
||||
<a href="/tinyfilemanager.php?p=<?php echo date('Y/m/d'); ?>" target="_blank"><span class="label"><i class="icon icon-desktop"></i> 管理</a></span>
|
||||
<a href="/api/api-web.php" target="_blank"><span class="label"><i class="icon icon-key"></i> API</a></span>
|
||||
<?php
|
||||
if (is_online()) {
|
||||
echo '<a href="/libs/logout.php" ><i class="icon icon-signout"></i>退出 </a>';
|
||||
echo '<a href="/libs/logout.php" ><span class="label"><i class="icon icon-signout"></i> 退出</a></span>';
|
||||
} else {
|
||||
echo '<a href="/libs/login.php" ><i class="icon icon-user"></i>登录 </a>';
|
||||
echo '<a href="/libs/login.php" ><span class="label"><i class="icon icon-user"></i> 登录</a></span>';
|
||||
} ?>
|
||||
</div>
|
||||
<hr>
|
||||
<p>请勿上传违反中国政策的图片<i class="icon icon-smile"></i></p>
|
||||
<?php echo 'Copyright © 2018-' . date('Y'); ?>
|
||||
<a href="https://img.545141.com/" target="_blank">EasyImage</a> By
|
||||
<a href="https://www.545141.com/902.html" target="_blank">Icret</a> Ver:<a href="https://github.com/icret/easyImages2.0" target="_blank"><?php echo $config['version']; ?> <i class="icon icon-github"></i></a>
|
||||
|
||||
@@ -58,11 +58,10 @@ function mustLogin()
|
||||
}
|
||||
|
||||
// 检查配置文件中目录是否存在是否可写并创建相应目录
|
||||
function config_path($path = null)
|
||||
function config_path()
|
||||
{
|
||||
global $config;
|
||||
$path = $path ?? date('Y/m/d/');
|
||||
$img_path = $config['path'] . $path;
|
||||
$img_path = $config['path'] . date('Y/m/d/');
|
||||
|
||||
if (!is_dir($img_path)) {
|
||||
@mkdir($img_path, 0755, true);
|
||||
@@ -308,10 +307,10 @@ function urlHash($data, $mode)
|
||||
$key = $config['password'];
|
||||
$iv = 'sciCuBC7orQtDhTO';
|
||||
if ($mode) {
|
||||
$decode = openssl_decrypt(base64_decode($data), "AES-128-CBC", $key, 0, $iv);
|
||||
$decode = openssl_decrypt(base64_decode($data), "AES-128-CBC", $key, 0,$iv);
|
||||
return $decode;
|
||||
} else {
|
||||
$encode = base64_encode(openssl_encrypt($data, "AES-128-CBC", $key, 0, $iv));
|
||||
$encode = base64_encode(openssl_encrypt($data, "AES-128-CBC", $key, 0,$iv));
|
||||
return $encode;
|
||||
}
|
||||
}
|
||||
@@ -414,23 +413,4 @@ function checkEnv($mode)
|
||||
';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 前端改变图片长宽
|
||||
function imgRatio()
|
||||
{
|
||||
global $config;
|
||||
if ($config['imgRatio']) {
|
||||
$image_x = $config['image_x'];
|
||||
$image_y = $config['image_y'];
|
||||
echo '
|
||||
resize:{
|
||||
width: ' . $image_x . ',
|
||||
height: ' . $image_y . ',
|
||||
preserve_headers: false, // 是否保留图片的元数据
|
||||
},
|
||||
';
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,8 +34,15 @@ echo '<!DOCTYPE html>
|
||||
<i class="icon icon-home"> 首页</i>
|
||||
</a>
|
||||
</li>
|
||||
<!-- 管理
|
||||
<li>
|
||||
<a href="//' . $_SERVER['HTTP_HOST'] . '/tinyfilemanager.php?p=' . date('Y/m/d') . '" target="_blank">
|
||||
管理
|
||||
</a>
|
||||
</li>
|
||||
-->
|
||||
<li class="' . getActive('list') . '">
|
||||
<a href="//' . $_SERVER['HTTP_HOST'] . '/libs/list.php?date='. date('Y/m/d/').'&num='.$config['listNumber'].'">
|
||||
<a href="//' . $_SERVER['HTTP_HOST'] . '/libs/list.php">
|
||||
<i class="icon icon-list"> 广场</i>
|
||||
<span class="label label-badge label-success">
|
||||
' . getFileNumber(__DIR__ . '/../' . config_path()) . '</span>
|
||||
@@ -46,6 +53,25 @@ echo '<!DOCTYPE html>
|
||||
<i class="icon icon-github "> 源码下载</i>
|
||||
</a>
|
||||
</li>
|
||||
<!-- 弹窗
|
||||
<li>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="###">更多 <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a href="">任务</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Bug</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">需求</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">用例</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 顶部导航栏END -->
|
||||
|
||||
@@ -2,16 +2,22 @@
|
||||
require_once __DIR__ . '/header.php';
|
||||
|
||||
if ($config['showSwitch']) {
|
||||
$path = $_GET['date'] ?? date('Y/m/d/');
|
||||
$keyNum = $_GET['num'] ?? $config['listNumber'];
|
||||
|
||||
$fileArr = getFile('..' . config_path($path));
|
||||
$fileArr = getFile('..' . config_path());
|
||||
|
||||
if ($fileArr[0]) {
|
||||
foreach ($fileArr as $key => $value) {
|
||||
if ($key < $keyNum) {
|
||||
$boxImg = $config['domain'] . config_path($path) . $value;
|
||||
echo '<div class="col-md-4 col-sm-6 col-lg-3"><div class="card listNum"><img data-toggle="lightbox" data-image="' . $boxImg . '" src="' . $boxImg . '"
|
||||
if (isset($_GET['num'])) {
|
||||
$keyNum = $_GET['num'];
|
||||
} else {
|
||||
$keyNum = $config['listNumber'];
|
||||
}
|
||||
|
||||
if ($fileArr[0] == null) {
|
||||
echo '<p class="text-danger" style="center">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</p>';
|
||||
} else {
|
||||
foreach ($fileArr as $key => $value) {
|
||||
if ($key < $keyNum) {
|
||||
$boxImg = $config['domain'] . config_path() . $value;
|
||||
echo '<div class="col-md-4 col-sm-6 col-lg-3"><div class="card listNum"><img data-toggle="lightbox" data-image="' . $boxImg . '" src="' . $boxImg . '"
|
||||
class="img-thumbnail" alt="简单图床-EasyImage" >
|
||||
<a href="' . $boxImg . '" target="_blank">
|
||||
<div class="pull-left" style="margin-top:5px;">
|
||||
@@ -25,32 +31,19 @@ if ($config['showSwitch']) {
|
||||
</a>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<p class="text-danger" style="center">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<p class="text-danger" style="center">管理员关闭了预览哦~~</p>';
|
||||
echo '<p class="text-danger" style="center">管理员关闭了预览哦~~</p>';
|
||||
}
|
||||
|
||||
$todayUpload = getFileNumber('../' . config_path()); // 今日上传数量
|
||||
$yesterday = date("Y/m/d/", strtotime("-1 day")); // 昨日日期
|
||||
$yesterdayUpload = getFileNumber('../' . $config['path'] . $yesterday); // 昨日上传数量
|
||||
|
||||
$spaceUsed = getDistUsed(disk_total_space(__DIR__) - disk_free_space(__DIR__)); // 占用空间
|
||||
|
||||
$httpUrl = array(
|
||||
'date' => $path,
|
||||
'num' => getFileNumber('..' . config_path($path)),
|
||||
);
|
||||
|
||||
echo '
|
||||
<div class="col-md-12">
|
||||
<a href="list.php" ><span class="label label-success label-outline"> 今日上传:' . $todayUpload . ' 张</span></a>
|
||||
<a href="list.php?date=' . $yesterday . '" ><span class="label label-warning label-outline"> 昨日上传:' . $yesterdayUpload . ' 张</span></a>
|
||||
<a href="list.php?' . http_build_query($httpUrl) . '" ><span class="label label-info label-outline"> 全部上传</span></a>
|
||||
<span class="label label-danger label-outline"> 存储占用:' . $spaceUsed . '</span>
|
||||
<span class="label label-success label-outline"> 今日上传:' . getFileNumber(__DIR__ . '/../' . config_path()) . ' 张</span>
|
||||
<span class="label label-warning label-outline"> 昨日上传:' . getFileNumber(__DIR__ . '/../' . $config['path'] . date("Y/m/d/", strtotime("-1 day"))) . ' 张</span>
|
||||
<a href="?num=' . getFileNumber(__DIR__ . '/../' . config_path()) . '" ><span class="label label-info label-outline"> 今日全部上传</span></a>
|
||||
<span class="label label-danger label-outline"> 存储占用:' . getDistUsed(disk_total_space(__DIR__) - disk_free_space(__DIR__)) . '</span>
|
||||
</div>
|
||||
';
|
||||
require_once './footer.php';
|
||||
|
||||
Reference in New Issue
Block a user