-
-
Notifications
You must be signed in to change notification settings - Fork 367
/
info.php
executable file
·325 lines (310 loc) · 15.5 KB
/
info.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<?php
include_once __DIR__ . "/header.php";
if (!$config['show_exif_info'] && !is_who_login('admin')) exit(header('Location: ' . $config['domain'] . '?exif#closed'));
// 获取图片地址
if (isset($_GET['img'])) {
// 过滤特殊符号
$getIMG = strip_tags($_GET['img']);
$del_url = $config['domain'] . $getIMG;
} elseif (isset($_GET['history'])) {
// 过滤特殊符号
if ($config['hide_path']) {
$getIMG = $config['path'] . ltrim(strip_tags($_GET['history']), '/');
} else {
$getIMG = strip_tags($_GET['history']);
}
$del_url = $config['domain'] . $getIMG;
} else {
// 未获取到图片地址
$getIMG = "/public/images/404.png";
$del_url = "#";
}
// 开启隐藏上传目录
if ($config['hide_path']) {
$img_url = rand_imgurl() . str_replace($config['path'], '/', $getIMG);
// 获取当前图片日志文件
$logs = str_replace('/', '-', substr(parse_url($img_url, PHP_URL_PATH), 1, 7));
} else {
// 关闭隐藏上传目录
$img_url = rand_imgurl() . $getIMG;
// 获取当前图片日志文件
$logs = str_replace('/', '-', substr(str_replace($config['path'], '', parse_url($img_url, PHP_URL_PATH)), 0, 7));
}
// 导入日志文件
$logsName = basename($img_url);
if (is_file(APP_ROOT . '/admin/logs/upload/' . $logs . '.php')) {
include APP_ROOT . '/admin/logs/upload/' . $logs . '.php';
} else {
$logs = array($logsName => array('source' => '日志文件不存在, 请在图床安全中开启上传日志!', 'date' => '日志文件不存在, 请在图床安全中开启上传日志!', 'ip' => '0.0.0.0', 'port' => '0', 'user_agent' => '日志文件不存在, 请在图床安全中开启上传日志!', 'path' => '日志文件不存在, 请在图床安全中开启上传日志!', 'size' => '日志文件不存在, 请在图床安全中开启上传日志!', 'md5' => '日志文件不存在, 请在图床安全中开启上传日志!', 'checkImg' => '日志文件不存在, 请在图床安全中开启上传日志!', 'from' => '日志文件不存在, 请在图床安全中开启上传日志!'));
}
if (empty($logs[$logsName])) {
$logs = array($logsName => array('source' => '日志不存在', 'date' => '日志不存在', 'ip' => '0.0.0.0', 'port' => '0', 'user_agent' => '日志不存在', 'path' => '日志不存在', 'size' => '日志不存在', 'md5' => '日志不存在', 'checkImg' => '日志不存在', 'from' => '日志不存在'));
}
// 图片真实路径
$imgABPath = APP_ROOT . $getIMG;
// 图片是否存在
if (!is_file($imgABPath)) {
$imgABPath = APP_ROOT . "/public/images/404.png";
$img_url = $config['domain'] . "/public/images/404.png";
}
// 图片尺寸
$imgSize = filesize($imgABPath);
// 上传时间
$upTime = filemtime($imgABPath);
// 广告
if ($config['ad_top']) echo $config['ad_top_info'];
?>
<div class="col-md-12">
<div class="col-md-5" style="text-align: center;">
<img data-toggle="lightbox" src="<?php echo $img_url; ?>" id="img1" class="img-rounded" height="432px" data-caption="<?php echo pathinfo($img_url, PATHINFO_FILENAME); ?>的详细信息" alt="<?php echo $img_url; ?>" />
</div>
<div class="col-md-6 table-responsive table-condensed" style="margin-top: 10px;">
<table class="table table-hover table-striped table-bordered text-nowrap">
<tbody>
<tr>
<td>图片名称</td>
<td> <?php echo basename($getIMG); ?></td>
</tr>
<tr>
<td>图片大小</td>
<td><?php echo getDistUsed($imgSize); ?></td>
</tr>
<tr>
<td>图片类型</td>
<td>image/<?php echo pathinfo($getIMG, PATHINFO_EXTENSION); ?></td>
</tr>
<tr>
<td>图片宽高</td>
<td><span id="wh"></span>px</td>
</tr>
<tr>
<td>上传时间</td>
<td><?php echo $logs[$logsName]['date']; ?></td>
</tr>
<?php if (is_who_login('admin')) : ?>
<tr class="text-primary">
<td>原始名称</td>
<td><?php echo $logs[$logsName]['source']; ?></td>
</tr>
<tr class="text-primary">
<td>原始大小</td>
<td><?php echo $logs[$logsName]['size']; ?></td>
</tr>
<tr class="text-primary">
<td>上传者IP</td>
<td><?php echo $logs[$logsName]['ip'] . ':' . $logs[$logsName]['port']; ?></td>
</tr>
<tr class="text-primary">
<td>上传地址</td>
<td><?php echo Ip2Region($logs[$logsName]['ip']); ?></td>
</tr>
<tr class="text-primary">
<td>监黄状态</td>
<td><?php echo strstr('OFF', $logs[$logsName]['checkImg']) ? '未开启' : '已通过'; ?></td>
</tr>
<tr class="text-primary">
<td>上传方式</td>
<td><?php echo is_numeric($logs[$logsName]['from']) ? '通过API | Token ID: ' . $logs[$logsName]['from'] : "通过网页"; ?></td>
</tr>
<tr class="text-primary">
<td>文件路径</td>
<td><?php echo $logs[$logsName]['path']; ?></td>
</tr>
<tr class="text-primary">
<td>文件MD5</td>
<td><?php echo $logs[$logsName]['md5']; ?></td>
</tr>
<?php endif; ?>
<tr>
<td>文件操作</td>
<td>
<a class="btn btn-mini btn-primary" href="<?php echo $img_url; ?>" target="_blank"><i class="icon icon-picture"> 查看</i></a>
<a class="btn btn-mini btn-primary" href="" onclick="window.location.replace;"><i class="icon icon-spin icon-refresh"></i> 刷新</a>
<a class="btn btn-mini btn-primary" href="/application/down.php?dw=<?php echo $getIMG; ?>" target="_blank"><i class="icon icon-cloud-download"> 下载</i></a>
<?php if (!empty($config['report']) && !is_who_login('admin')) : ?>
<a class="btn btn-mini btn-warning" href="<?php echo $config['report'] . '?Website1=' . $img_url; ?>" target="_blank"><i class="icon icon-question-sign"> 举报</i></a>
<?php endif; ?>
<?php if (is_who_login('admin')) : ?>
<a class="btn btn-mini btn-warning" href="/application/del.php?recycle_url=<?php echo $getIMG; ?>" target="_blank"><i class="icon icon-undo"> 回收</i></a>
<a class="btn btn-mini btn-warning" href="/application/del.php?url=<?php echo $del_url; ?>" target="_blank"><i class="icon icon-trash"> 删除</i></a>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
<h4 class="with-padding hl-gray"><i class="icon icon-info-sign"> 此图片来自网友上传, 不代表<a href="/admin/terms.php" target="_blank">本站立场</a>, 若有侵权, 请举报或联系管理员!</i></h4>
</div>
</div>
<div class="col-md-12" style="padding-bottom: 10px;">
<div class="col-md-6" style="padding-bottom: 10px;">
<div class="input-group">
<span class="input-group-addon"><i class="icon icon-link"></i> 直 链 </span>
<input type="text" class="form-control" id="links" onclick="copyText()" value="<?php echo $img_url; ?>">
<span class="input-group-btn"><button class="btn btn-default copyBtn1" type="button">复制</button></span>
</div>
</div>
<div class="col-md-6" style="padding-bottom: 10px;">
<div class="input-group">
<span class="input-group-addon"><i class="icon icon-chat"></i> 论坛代码 </span>
<input type="text" class="form-control" id="bbscode" value="[img]<?php echo $img_url; ?>[/img]">
<span class="input-group-btn"><button class="btn btn-default copyBtn2" type="button">复制</button></span>
</div>
</div>
</div>
<div class="col-md-12" style="padding-bottom: 10px;">
<div class="col-md-6" style="padding-bottom: 10px;">
<div class="input-group">
<span class="input-group-addon"><i class="icon icon-code"></i> MarkDown</span>
<input type="text" class="form-control" id="markdown" value="![简单图床 - EasyImage](<?php echo $img_url; ?>)">
<span class="input-group-btn"><button class="btn btn-default copyBtn3" type="button">复制</button></span>
</div>
</div>
<div class="col-md-6" style="padding-bottom: 10px;">
<div class="input-group">
<span class="input-group-addon"><i class="icon icon-html5"></i> HTML </span>
<input type="text" class="form-control" id="html" value='<img src="<?php echo $img_url; ?>" alt="简单图床 - EasyImage" />'>
<span class="input-group-btn"><button class="btn btn-default copyBtn4" type="button">复制</button></span>
</div>
</div>
</div>
<?php /** 底部广告 */ if ($config['ad_bot']) echo $config['ad_bot_info']; ?>
<!-- 随机图片 -->
<?php if ($config['info_rand_pic']) : ?>
<div class="col-md-12" style="padding-bottom: 10px;">
<h4 class="header-dividing">当月随机图片:</h4>
<div class="cards cards-borderless">
<?php if ($logs[$logsName]['port'] != 0) : for ($i = 0; $i <= 7; $i++) : $randName = array_rand($logs, 1) ?>
<div class="col-md-4 col-sm-6 col-lg-3">
<a class="card" href="?img=<?php echo $logs[$randName]['path']; ?>" target="_blank">
<img src="thumb.php?img=<?php echo $logs[$randName]['path']; ?>">
<div class="caption"><?php echo $logs[$randName]['source']; ?></div>
</a>
</div>
<?php endfor; ?>
<?php else : ?>
<h3 class="alert alert-danger">本月没有上传图片或上传日志不存在~~</h3>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<script src="<?php static_cdn(); ?>/public/static/EasyImage.js"></script>
<script src="<?php static_cdn(); ?>/public/static/zui/lib/clipboard/clipboard.min.js"></script>
<script>
// 获取图片长宽 https://www.cnblogs.com/houxianzhou/p/14807983.html
var imgReady = (function() {
var list = [],
intervalId = null,
// 用来执行队列
tick = function() {
var i = 0;
for (; i < list.length; i++) {
list[i].end ? list.splice(i--, 1) : list[i]();
};
!list.length && stop();
},
// 停止所有定时器队列
stop = function() {
clearInterval(intervalId);
intervalId = null;
};
return function(url, ready, load, error) {
var onready, width, height, newWidth, newHeight,
img = new Image();
img.src = url;
// 如果图片被缓存,则直接返回缓存数据
if (img.complete) {
ready.call(img);
load && load.call(img);
return;
};
width = img.width;
height = img.height;
// 加载错误后的事件
img.onerror = function() {
error && error.call(img);
onready.end = true;
img = img.onload = img.onerror = null;
};
// 图片尺寸就绪
onready = function() {
newWidth = img.width;
newHeight = img.height;
if (newWidth !== width || newHeight !== height || newWidth * newHeight > 1024) {
// 如果图片已经在其他地方加载可使用面积检测
ready.call(img);
onready.end = true;
};
};
onready();
// 完全加载完毕的事件
img.onload = function() {
// onload在定时器时间差范围内可能比onready快
// 这里进行检查并保证onready优先执行
!onready.end && onready();
load && load.call(img);
// IE gif动画会循环执行onload,置空onload即可
img = img.onload = img.onerror = null;
};
// 加入队列中定期执行
if (!onready.end) {
list.push(onready);
// 无论何时只允许出现一个定时器,减少浏览器性能损耗
if (intervalId === null) intervalId = setInterval(tick, 40);
};
};
})();
imgReady('<?php echo $img_url; ?>', function() {
// alert('size ready: width=' + this.width + '; height=' + this.height);
var hw = document.getElementById("wh");
hw.innerHTML = this.width + "x" + this.height
});
// Exif信息
/*
window.onload = getExif;
function getExif() {
var img1 = document.getElementById("img1");
EXIF.getData(img1, function() {
var make = EXIF.getTag(this, "Make");
var model = EXIF.getTag(this, "Model");
var makeAndModel = document.getElementById("makeAndModel");
makeAndModel.innerHTML = `${make} ${model}`;
});
var img2 = document.getElementById("img1");
EXIF.getData(img2, function() {
var allMetaData = EXIF.getAllTags(this);
var allMetaDataSpan = document.getElementById("allMetaDataSpan");
allMetaDataSpan.innerHTML = EXIF.pretty(this);;
});
}
*/
//禁用右键
document.onkeydown = function() {
var e = window.event || arguments[0];
if (e.keyCode == 123) {
// alert('禁止F12');
return false;
} else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode == 73)) {
// alert('禁止Ctrl+Shift+I');
return false;
} else if ((e.ctrlKey) && (e.keyCode == 85)) {
// alert('禁止Ctrl+u');
return false;
} else if ((e.ctrlKey) && (e.keyCode == 83)) {
// alert('禁止Ctrl+s');
return false;
}
}
// 屏蔽鼠标右键
document.oncontextmenu = function() {
new $.zui.Messager("正在查看图片详细信息", {
type: "success", // 定义颜色主题
icon: "exclamation-sign" // 定义消息图标
}).show();
return false;
}
// 更改网页标题
document.title = "图片<?php echo basename($getIMG); ?>的详细信息 - <?php echo $config['title']; ?>"
</script>
<?php
/** 引入底部 */
require_once APP_ROOT . '/application/footer.php';