加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bitbucketlog.php 2.28 KB
一键复制 编辑 原始数据 按行查看 历史
mojie126@foxmail.com 提交于 2014-11-12 16:16 . HDCN-PT初始化
<?php
require "include/bittorrent.php";
dbconn();
loggedinorreturn();
parked();
if (get_user_class() < UC_MODERATOR)
stderr("Sorry", "Access denied.");
$bucketpath = "$bitbucket";
if (get_user_class() >= UC_MODERATOR) {
$delete = $_GET["delete"];
if (is_valid_id($delete)) {
$r = sql_query("SELECT name, owner FROM bitbucket WHERE id=" . mysql_real_escape_string($delete)) or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($r) == 1) {
$a = mysql_fetch_assoc($r);
if (get_user_class() >= UC_MODERATOR || $a["owner"] == $CURUSER["id"]) {
sql_query("DELETE FROM bitbucket WHERE id=" . mysql_real_escape_string($delete)) or sqlerr(__FILE__, __LINE__);
if (!unlink("$bucketpath/$a[name]"))
stderr("Warning", "Unable to unlink file: <b>$a[name]</b>. You should contact an administrator about this error.", false);
}
}
}
}
stdhead("BitBucket Log");
$res = sql_query("SELECT count(*) FROM bitbucket") or die(mysql_error());
$row = mysql_fetch_array($res);
$count = $row[0];
$perpage = 10;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] . "?out=" . $_GET["out"] . "&");
print("<h1>BitBucket Log</h1>\n");
print("Total Images Stored: $count");
echo $pagertop;
$res = sql_query("SELECT * FROM bitbucket ORDER BY added DESC $limit") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0)
print("<b>BitBucket Log is empty</b>\n");
else {
print("<table align='center' border='0' cellspacing='0' cellpadding='5'>\n");
while ($arr = mysql_fetch_assoc($res)) {
$date = substr($arr['added'], 0, strpos($arr['added'], " "));
$time = substr($arr['added'], strpos($arr['added'], " ") + 1);
$name = $arr["name"];
list($width, $height, $type, $attr) = getimagesize("" . get_protocol_prefix() . "$BASEURL/$bitbucket/$name");
$url = str_replace(" ", "%20", htmlspecialchars("$bitbucket/$name"));
print("<tr>");
print("<td><center><a href=$url><img src=\"" . $url . "\" border=0 onLoad='SetSize(this, 400)'></a></center>");
print("Uploaded by: " . get_username($arr[owner]) . "<br />");
print("(#$arr[id]) Filename: $name ($width&nbsp;x&nbsp;$height)");
if (get_user_class() >= UC_MODERATOR)
print(" <b><a href=?delete=$arr[id]>[Delete]</a></b><br />");
print("Added: $date $time");
print("</tr>");
}
print("</table>");
}
echo
$pagerbottom;
stdfoot();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化