本文整理汇总了PHP中mksize函数的典型用法代码示例。如果您正苦于以下问题:PHP mksize函数的具体用法?PHP mksize怎么用?PHP mksize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mksize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commenttable
function commenttable($rows, $redaktor = "comment")
{
global $CURUSER, $avatar_max_width;
$count = 0;
foreach ($rows as $row) {
if ($row["downloaded"] > 0) {
$ratio = $row['uploaded'] / $row['downloaded'];
$ratio = number_format($ratio, 2);
} elseif ($row["uploaded"] > 0) {
$ratio = "Inf.";
} else {
$ratio = "---";
}
if (strtotime($row["last_access"]) > gmtime() - 600) {
$online = "online";
$online_text = "В сети";
} else {
$online = "offline";
$online_text = "Не в сети";
}
print "<table class=maibaugrand width=100% border=1 cellspacing=0 cellpadding=3>";
print "<tr><td class=colhead align=\"left\" colspan=\"2\" height=\"24\">";
if (isset($row["username"])) {
$title = $row["title"];
if ($title == "") {
$title = get_user_class_name($row["class"]);
} else {
$title = htmlspecialchars_uni($title);
}
print ":: <img src=\"pic/buttons/button_" . $online . ".gif\" alt=\"" . $online_text . "\" title=\"" . $online_text . "\" style=\"position: relative; top: 2px;\" border=\"0\" height=\"14\">" . " <a name=comm" . $row["id"] . " href=userdetails.php?id=" . $row["user"] . " class=altlink_white><b>" . get_user_class_color($row["class"], htmlspecialchars_uni($row["username"])) . "</b></a> ::" . ($row["donor"] == "yes" ? "<img src=pic/star.gif alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=\"/pic/warned.gif\" alt=\"Warned\">" : "") . " {$title} ::\n" . " <img src=\"pic/upl.gif\" alt=\"upload\" border=\"0\" width=\"12\" height=\"12\"> " . mksize($row["uploaded"]) . " :: <img src=\"pic/down.gif\" alt=\"download\" border=\"0\" width=\"12\" height=\"12\"> " . mksize($row["downloaded"]) . " :: <font color=\"" . get_ratio_color($ratio) . "\">{$ratio}</font> :: ";
} else {
print "<a name=\"comm" . $row["id"] . "\"><i>[Anonymous]</i></a>\n";
}
$avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars_uni($row["avatar"]) : "";
if (!$avatar) {
$avatar = "pic/default_avatar.gif";
}
if (md5($row['text']) == $row['text_hash']) {
$text = $row['text_parsed'];
} else {
$text = format_comment($row['text']);
sql_query('INSERT INTO comments_parsed (cid, text_hash, text_parsed) VALUES (' . implode(', ', array_map('sqlesc', array($row['id'], md5($row['text']), $text))) . ')') or sqlerr(__FILE__, __LINE__);
}
if ($row["editedby"]) {
//$res = mysql_fetch_assoc(sql_query("SELECT * FROM users WHERE id = $row[editedby]")) or sqlerr(__FILE__,__LINE__);
$text .= "<p><font size=1 class=small>Последний раз редактировалось <a href=userdetails.php?id={$row['editedby']}><b>{$row['editedbyname']}</b></a> в {$row['editedat']}</font></p>\n";
}
print "</td></tr>";
print "<tr valign=top>\n";
print "<td style=\"padding: 0px; width: 5%;\" align=\"center\"><img src={$avatar} width=\"{$avatar_max_width}\"> </td>\n";
print "<td width=100% class=text>";
//print("<span style=\"float: right\"><a href=\"#top\"><img title=\"Top\" src=\"pic/top.gif\" alt=\"Top\" border=\"0\" width=\"15\" height=\"13\"></a></span>");
print "{$text}</td>\n";
print "</tr>\n";
print "<tr><td class=colhead align=\"center\" colspan=\"2\">";
print "<div style=\"float: left; width: auto;\">" . ($CURUSER ? " [<a href=\"" . $redaktor . ".php?action=quote&cid={$row['id']}\" class=\"altlink_white\">Цитата</a>]" : "") . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? " [<a href=" . $redaktor . ".php?action=edit&cid={$row['id']} class=\"altlink_white\">Изменить</a>]" : "") . (get_user_class() >= UC_MODERATOR ? " [<a href=\"" . $redaktor . ".php?action=delete&cid={$row['id']}\" class=\"altlink_white\">Удалить</a>]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? " [<a href=\"" . $redaktor . ".php?action=vieworiginal&cid={$row['id']}\" class=\"altlink_white\">Оригинал</a>]" : "") . (get_user_class() >= UC_MODERATOR ? " IP: " . ($row["ip"] ? "<a href=\"usersearch.php?ip={$row['ip']}\" class=\"altlink_white\">" . $row["ip"] . "</a>" : "Неизвестен") : "") . "</div>";
print "<div align=\"right\"><!--<font size=1 class=small>-->Комментарий добавлен: " . $row["added"] . " GMT<!--</font>--></td></tr>";
print "</table><br>";
}
}
示例2: maketable
function maketable($res)
{
global $pic_base_url;
$ret = "<table class='main' border='1' cellspacing='0' cellpadding='5'>" . "<tr><td class='colhead' align='center'>Type</td><td class='colhead'>Name</td><td class='colhead' align='center'>TTL</td><td class='colhead' align='center'>Size</td><td class='colhead' align='right'>Se.</td><td class='colhead' align='right'>Le.</td><td class='colhead' align='center'>Upl.</td>\n" . "<td class='colhead' align='center'>Downl.</td><td class='colhead' align='center'>Ratio</td></tr>\n";
while ($arr = mysql_fetch_assoc($res)) {
if ($arr["downloaded"] > 0) {
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "<font color='" . get_ratio_color($ratio) . "'>{$ratio}</font>";
} else {
if ($arr["uploaded"] > 0) {
$ratio = "Inf.";
} else {
$ratio = "---";
}
}
$catimage = "{$pic_base_url}caticons/{$arr['image']}";
$catname = htmlspecialchars($arr["catname"]);
$catimage = "<img src=\"" . htmlspecialchars($catimage) . "\" title=\"{$catname}\" alt=\"{$catname}\" width='42' height='42' />";
$ttl = 28 * 24 - floor((time() - $arr["added"]) / 3600);
if ($ttl == 1) {
$ttl .= "<br />hour";
} else {
$ttl .= "<br />hours";
}
$size = str_replace(" ", "<br />", mksize($arr["size"]));
$uploaded = str_replace(" ", "<br />", mksize($arr["uploaded"]));
$downloaded = str_replace(" ", "<br />", mksize($arr["downloaded"]));
$seeders = number_format($arr["seeders"]);
$leechers = number_format($arr["leechers"]);
$ret .= "<tr><td style='padding: 0px'>{$catimage}</td>\n" . "<td><a href='details.php?id={$arr['torrent']}&hit=1'><b>" . htmlspecialchars($arr["torrentname"]) . "</b></a></td><td align='center'>{$ttl}</td><td align='center'>{$size}</td><td align='right'>{$seeders}</td><td align='right'>{$leechers}</td><td align='center'>{$uploaded}</td>\n" . "<td align='center'>{$downloaded}</td><td align='center'>{$ratio}</td></tr>\n";
}
$ret .= "</table>\n";
return $ret;
}
示例3: maketable
function maketable($res)
{
global $INSTALLER09, $lang;
$htmlout = '';
$htmlout .= "<table class='main' border='1' cellspacing='0' cellpadding='5'>" . "<tr><td class='colhead' align='center'>{$lang['userdetails_type']}</td><td class='colhead'>{$lang['userdetails_name']}</td><td class='colhead' align='center'>{$lang['userdetails_size']}</td><td class='colhead' align='right'>{$lang['userdetails_se']}</td><td class='colhead' align='right'>{$lang['userdetails_le']}</td><td class='colhead' align='center'>{$lang['userdetails_upl']}</td>\n" . "<td class='colhead' align='center'>{$lang['userdetails_downl']}</td><td class='colhead' align='center'>{$lang['userdetails_ratio']}</td></tr>\n";
foreach ($res as $arr) {
if ($arr["downloaded"] > 0) {
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "<font color='" . get_ratio_color($ratio) . "'>{$ratio}</font>";
} else {
if ($arr["uploaded"] > 0) {
$ratio = "{$lang['userdetails_inf']}";
} else {
$ratio = "---";
}
}
$catimage = "{$INSTALLER09['pic_base_url']}caticons/{$arr['image']}";
$catname = htmlspecialchars($arr["catname"]);
$catimage = "<img src=\"" . htmlspecialchars($catimage) . "\" title=\"{$catname}\" alt=\"{$catname}\" width='42' height='42' />";
$size = str_replace(" ", "<br />", mksize($arr["size"]));
$uploaded = str_replace(" ", "<br />", mksize($arr["uploaded"]));
$downloaded = str_replace(" ", "<br />", mksize($arr["downloaded"]));
$seeders = number_format($arr["seeders"]);
$leechers = number_format($arr["leechers"]);
$htmlout .= "<tr><td style='padding: 0px'>{$catimage}</td>\n" . "<td><a href='details.php?id={$arr['torrent']}&hit=1'><b>" . htmlspecialchars($arr["torrentname"]) . "</b></a></td><td align='center'>{$size}</td><td align='right'>{$seeders}</td><td align='right'>{$leechers}</td><td align='center'>{$uploaded}</td>\n" . "<td align='center'>{$downloaded}</td><td align='center'>{$ratio}</td></tr>\n";
}
$htmlout .= "</table>\n";
return $htmlout;
}
示例4: bjtable
function bjtable($res, $frame_caption)
{
begin_frame($frame_caption, true);
begin_table();
?>
<tr>
<td class="colhead">Rank</td>
<td align="left" class="colhead">User</td>
<td align="right" class="colhead">Wins</td>
<td align="right" class="colhead">Losses</td>
<td align="right" class="colhead">Games</td>
<td align="right" class="colhead">Percentage</td>
<td align="right" class="colhead">Win/Loss</td>
</tr>
<?php
$num = 0;
while ($a = mysql_fetch_assoc($res)) {
++$num;
//Calculate Win %
$win_perc = number_format($a[wins] / $a[games] * 100, 1);
// Add a user's +/- statistic
$plus_minus = $a[wins] - $a[losses];
if ($plus_minus >= 0) {
$plus_minus = mksize(($a[wins] - $a[losses]) * 100 * 1024 * 1024);
} else {
$plus_minus = "-";
$plus_minus .= mksize(($a[losses] - $a[wins]) * 100 * 1024 * 1024);
}
print "<tr><td>{$num}</td><td align=left><table border=0 class=main cellspacing=0 cellpadding=0><tr><td class=embedded>" . "<b><a href=userdetails.php?id=" . $a[id] . ">" . $a[username] . "</a></b></td>" . "</tr></table></td><td align=right>" . number_format($a[wins], 0) . "</td>" . "</td><td align=right>" . number_format($a[losses], 0) . "</td>" . "</td><td align=right>" . number_format($a[games], 0) . "</td>" . "</td><td align=right>{$win_perc}</td>" . "</td><td align=right>{$plus_minus}</td>" . "</tr>\n";
}
end_table();
end_frame();
}
示例5: maketable
function maketable($res)
{
global $tracker_lang, $use_ttl, $ttl_days;
$ret = "<table class=main border=1 cellspacing=0 cellpadding=5>" . "<tr><td class=colhead align=left>" . $tracker_lang['type'] . "</td><td class=colhead>" . $tracker_lang['name'] . "</td>" . ($use_ttl ? "<td class=colhead align=center>" . $tracker_lang['ttl'] . "</td>" : "") . "<td class=colhead align=center>" . $tracker_lang['size'] . "</td><td class=colhead align=right>" . $tracker_lang['details_seeding'] . "</td><td class=colhead align=right>" . $tracker_lang['details_leeching'] . "</td><td class=colhead align=center>" . $tracker_lang['uploaded'] . "</td>\n" . "<td class=colhead align=center>" . $tracker_lang['downloaded'] . "</td><td class=colhead align=center>" . $tracker_lang['ratio'] . "</td></tr>\n";
while ($arr = mysql_fetch_assoc($res)) {
if ($arr["downloaded"] > 0) {
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "<font color=" . get_ratio_color($ratio) . ">{$ratio}</font>";
} else {
if ($arr["uploaded"] > 0) {
$ratio = "Inf.";
} else {
$ratio = "---";
}
}
$catid = $arr["catid"];
$catimage = htmlspecialchars_uni($arr["image"]);
$catname = htmlspecialchars_uni($arr["catname"]);
$ttl = $ttl_days * 24 - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr["added"])) / 3600);
if ($ttl == 1) {
$ttl .= " час";
} else {
$ttl .= " часов";
}
$size = str_replace(" ", "<br />", mksize($arr["size"]));
$uploaded = str_replace(" ", "<br />", mksize($arr["uploaded"]));
$downloaded = str_replace(" ", "<br />", mksize($arr["downloaded"]));
$seeders = number_format($arr["seeders"]);
$leechers = number_format($arr["leechers"]);
$ret .= "<tr><td style='padding: 0px'><a href=\"browse.php?cat={$catid}\"><img src=\"pic/cats/{$catimage}\" alt=\"{$catname}\" border=\"0\" /></a></td>\n" . "<td><a href=details.php?id={$arr['torrent']}&hit=1><b>" . $arr["torrentname"] . "</b></a></td>" . ($use_ttl ? "<td align=center>{$ttl}</td>" : "") . "<td align=center>{$size}</td><td align=right>{$seeders}</td><td align=right>{$leechers}</td><td align=center>{$uploaded}</td>\n" . "<td align=center>{$downloaded}</td><td align=center>{$ratio}</td></tr>\n";
}
$ret .= "</table>\n";
return $ret;
}
示例6: bjtable
function bjtable($res, $frame_caption)
{
$htmlout = '';
$htmlout .= begin_frame($frame_caption, true);
$htmlout .= begin_table();
$htmlout .= "<tr>\r\n\t<td class='colhead'>Rank</td>\r\n\t<td class='colhead' align='left'>User</td>\r\n\t<td class='colhead' align='right'>Wins</td>\r\n\t<td class='colhead' align='right'>Losses</td>\r\n\t<td class='colhead' align='right'>Games</td>\r\n\t<td class='colhead' align='right'>Percentage</td>\r\n\t<td class='colhead' align='right'>Win/Loss</td>\r\n\t</tr>";
$num = 0;
while ($a = mysqli_fetch_assoc($res)) {
++$num;
//==Calculate Win %
$win_perc = number_format($a['wins'] / $a['games'] * 100, 1);
//==Add a user's +/- statistic
$plus_minus = $a['wins'] - $a['losses'];
if ($plus_minus >= 0) {
$plus_minus = mksize(($a['wins'] - $a['losses']) * 100 * 1024 * 1024);
} else {
$plus_minus = "-";
$plus_minus .= mksize(($a['losses'] - $a['wins']) * 100 * 1024 * 1024);
}
$htmlout .= "<tr><td>{$num}</td><td align='left'>" . "<b><a href='userdetails.php?id=" . $a['id'] . "'>" . $a['username'] . "</a></b></td>" . "<td align='right'>" . number_format($a['wins'], 0) . "</td>" . "<td align='right'>" . number_format($a['losses'], 0) . "</td>" . "<td align='right'>" . number_format($a['games'], 0) . "</td>" . "<td align='right'>{$win_perc}</td>" . "<td align='right'>{$plus_minus}</td>" . "</tr>\n";
}
$htmlout .= end_table();
$htmlout .= end_frame();
return $htmlout;
}
示例7: maketable
function maketable($res)
{
global $INSTALLER09, $lang, $CURUSER;
$htmlout = '';
$htmlout .= "<table class='table table-bordered'>\n\t" . "<tr><td class='text-center'>{$lang['userdetails_type']}</td>\n <td class='text-center'>{$lang['userdetails_name']}</td>\n <td class='text-center'>{$lang['userdetails_size']}</td>\n <td class='text-center'>{$lang['userdetails_se']}</td>\n <td class='text-center'>{$lang['userdetails_le']}</td>\n <td class='text-center'>{$lang['userdetails_upl']}</td>\n" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='text-center'>{$lang['userdetails_downl']}</td>") . "\n <td class='text-center'>{$lang['userdetails_ratio']}</td></tr>\n";
foreach ($res as $arr) {
if ($arr["downloaded"] > 0) {
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "<font color='" . get_ratio_color($ratio) . "'>{$ratio}</font>";
} else {
if ($arr["uploaded"] > 0) {
$ratio = "{$lang['userdetails_inf']}";
} else {
$ratio = "---";
}
}
$catimage = "{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/{$arr['image']}";
$catname = " " . htmlsafechars($arr["catname"]);
$catimage = "<img src=\"" . htmlsafechars($catimage) . "\" title=\"{$catname}\" alt=\"{$catname}\" width='42' height='42' />";
$size = str_replace(" ", "<br />", mksize($arr["size"]));
$uploaded = str_replace(" ", "<br />", mksize($arr["uploaded"]));
$downloaded = str_replace(" ", "<br />", mksize($arr["downloaded"]));
$seeders = number_format($arr["seeders"]);
$leechers = number_format($arr["leechers"]);
$XBT_or_PHP = XBT_TRACKER == true ? $arr['fid'] : $arr['torrent'];
$htmlout .= "<tr><td style='padding: 0px'>{$catimage}</td>\n" . "<td><a href='details.php?id=" . (int) $XBT_or_PHP . "&hit=1'><b>" . htmlsafechars($arr['torrentname']) . "</b></a></td><td align='center'>{$size}</td><td align='right'>{$seeders}</td><td align='right'>{$leechers}</td><td align='center'>{$uploaded}</td>\n" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='center'>{$downloaded}</td>") . "<td align='center'>{$ratio}</td></tr>\n";
}
$htmlout .= "</table>\n";
return $htmlout;
}
示例8: dltable
function dltable($name, $arr, $torrent)
{
global $CURUSER, $lang;
$htmlout = '';
if (!count($arr)) {
return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n";
}
$htmlout = "\n";
$htmlout .= "<table width='100%' class='main' border='1' cellspacing='0' cellpadding='5'>\n";
$htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='center'>{$lang['peerslist_connectable']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_connected']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
$now = time();
//$moderator = (isset($CURUSER) && get_user_class() >= UC_MODERATOR);
//$mod = get_user_class() >= UC_MODERATOR;
foreach ($arr as $e) {
// user/ip/port
// check if anyone has this ip
//($unr = mysql_query("SELECT username, privacy FROM users WHERE id=$e[userid] ORDER BY last_access DESC LIMIT 1")) or die;
//$una = mysql_fetch_assoc($unr);
if ($e["privacy"] == "strong") {
continue;
}
$htmlout .= "<tr>\n";
if ($e["username"]) {
$htmlout .= "<td><a href='userdetails.php?id={$e['userid']}'><b>{$e['username']}</b></a></td>\n";
} else {
$htmlout .= "<td>" . ($mod ? $e["ip"] : preg_replace('/\\.\\d+$/', ".xxx", $e["ip"])) . "</td>\n";
}
$secs = max(1, $now - $e["st"] - ($now - $e["la"]));
//$revived = $e["revived"] == "yes";
$htmlout .= "<td align='center'>" . ($e['connectable'] == "yes" ? "{$lang['peerslist_yes']}" : "<font color='red'>{$lang['peerslist_no']}</font>") . "</td>\n";
$htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
$htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</span></td>\n";
$htmlout .= "<td align='right'>" . mksize($e["downloaded"]) . "</td>\n";
if ($e["seeder"] == "no") {
$htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</span></td>\n";
} else {
$htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e['st'])) . "/s</span></td>\n";
}
if ($e["downloaded"]) {
$ratio = floor($e["uploaded"] / $e["downloaded"] * 1000) / 1000;
$htmlout .= "<td align=\"right\"><font color='" . get_ratio_color($ratio) . "'>" . number_format($ratio, 3) . "</font></td>\n";
} else {
if ($e["uploaded"]) {
$htmlout .= "<td align='right'>{$lang['peerslist_inf']}</td>\n";
} else {
$htmlout .= "<td align='right'>---</td>\n";
}
}
$htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["to_go"] / $torrent["size"])) . "</td>\n";
$htmlout .= "<td align='right'>" . mkprettytime($now - $e["st"]) . "</td>\n";
$htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
$htmlout .= "<td align='left'>" . htmlspecialchars(getagent($e["agent"], $e['peer_id'])) . "</td>\n";
$htmlout .= "</tr>\n";
}
$htmlout .= "</table>\n";
return $htmlout;
}
示例9: docleanup
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(1200);
ignore_user_abort(1);
//== Updated promote power users
$limit = 25 * 1024 * 1024 * 1024;
$minratio = 1.05;
$maxdt = TIME_NOW - 86400 * 28;
$res = sql_query("SELECT id, uploaded, downloaded, invites, modcomment FROM users WHERE class = " . UC_USER . " AND uploaded >= {$limit} AND uploaded / downloaded >= {$minratio} AND enabled='yes' AND added < {$maxdt}") or sqlerr(__FILE__, __LINE__);
$msgs_buffer = $users_buffer = array();
if (mysqli_num_rows($res) > 0) {
$subject = "Auto Promotion";
$msg = "Congratulations, you have been Auto-Promoted to [b]Power User[/b]. :)\n You get one extra invite.\n";
while ($arr = mysqli_fetch_assoc($res)) {
$ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3);
$modcomment = $arr['modcomment'];
$modcomment = get_date(TIME_NOW, 'DATE', 1) . " - Promoted to Power User by System (UL=" . mksize($arr['uploaded']) . ", DL=" . mksize($arr['downloaded']) . ", R=" . $ratio . ").\n" . $modcomment;
$modcom = sqlesc($modcomment);
$msgs_buffer[] = '(0,' . $arr['id'] . ', ' . TIME_NOW . ', ' . sqlesc($msg) . ', ' . sqlesc($subject) . ')';
$users_buffer[] = '(' . $arr['id'] . ', 1, 1, ' . $modcom . ')';
$update['invites'] = $arr['invites'] + 1;
$mc1->begin_transaction('user' . $arr['id']);
$mc1->update_row(false, array('class' => 1, 'invites' => $update['invites']));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('user_stats_' . $arr['id']);
$mc1->update_row(false, array('modcomment' => $modcomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
$mc1->begin_transaction('MyUser_' . $arr['id']);
$mc1->update_row(false, array('class' => 1, 'invites' => $update['invites']));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->delete_value('inbox_new_' . $arr['id']);
$mc1->delete_value('inbox_new_sb_' . $arr['id']);
}
$count = count($users_buffer);
if ($count > 0) {
sql_query("INSERT INTO messages (sender,receiver,added,msg,subject) VALUES " . implode(', ', $msgs_buffer)) or sqlerr(__FILE__, __LINE__);
sql_query("INSERT INTO users (id, class, invites, modcomment) VALUES " . implode(', ', $users_buffer) . " ON DUPLICATE key UPDATE class=values(class), invites = invites+values(invites), modcomment=concat(values(modcomment),modcomment)") or sqlerr(__FILE__, __LINE__);
write_log("Cleanup: Promoted " . $count . " member(s) from User to Power User");
}
unset($users_buffer, $msgs_buffer, $update, $count);
status_change($arr['id']);
//== For Retros announcement mod
}
//==
if ($queries > 0) {
write_log("Power User Updates -------------------- Power User Updates Clean Complete using {$queries} queries--------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
示例10: dltable
function dltable($name, $arr, $torrent)
{
global $CURUSER, $lang;
$htmlout = '';
if (!count($arr)) {
return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n";
}
$htmlout = "\n";
$htmlout .= "<table width='100%' class='main' border='1' cellspacing='0' cellpadding='5'>\n";
$htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='center'>{$lang['peerslist_connectable']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_connected']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
$now = time();
$mod = $CURUSER['class'] >= UC_MODERATOR;
foreach ($arr as $e) {
if ($e["privacy"] == "strong") {
continue;
}
$htmlout .= "<tr>\n";
if ($e['username']) {
if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['userid'] || $e['anonymous'] == 'yes' && $CURUSER['id'] != $e['userid']) && $CURUSER['class'] < UC_MODERATOR) {
$htmlout .= "<td><b>Anonymous</b></td>\n";
} else {
$htmlout .= "<td><a href='userdetails.php?id=" . $e['userid'] . "'><b>" . $e['username'] . "</b></a></td>\n";
}
} else {
$htmlout .= "<td>" . ($mod ? $e["ip"] : preg_replace('/\\.\\d+$/', ".xxx", $e["ip"])) . "</td>\n";
}
$secs = max(1, $now - $e["st"] - ($now - $e["la"]));
$htmlout .= "<td align='center'>" . ($e['connectable'] == "yes" ? "{$lang['peerslist_yes']}" : "<font color='red'>{$lang['peerslist_no']}</font>") . "</td>\n";
$htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
$htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</span></td>\n";
$htmlout .= "<td align='right'>" . mksize($e["downloaded"]) . "</td>\n";
if ($e["seeder"] == "no") {
$htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</span></td>\n";
} else {
$htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e['st'])) . "/s</span></td>\n";
}
if ($e["downloaded"]) {
$ratio = floor($e["uploaded"] / $e["downloaded"] * 1000) / 1000;
$htmlout .= "<td align=\"right\"><font color='" . get_ratio_color($ratio) . "'>" . number_format($ratio, 3) . "</font></td>\n";
} else {
if ($e["uploaded"]) {
$htmlout .= "<td align='right'>{$lang['peerslist_inf']}</td>\n";
} else {
$htmlout .= "<td align='right'>---</td>\n";
}
}
$htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["to_go"] / $torrent["size"])) . "</td>\n";
$htmlout .= "<td align='right'>" . mkprettytime($now - $e["st"]) . "</td>\n";
$htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
$htmlout .= "<td align='left'>" . htmlspecialchars(getagent($e["agent"], $e['peer_id'])) . "</td>\n";
$htmlout .= "</tr>\n";
}
$htmlout .= "</table>\n";
return $htmlout;
}
示例11: snatchtable_staff
function snatchtable_staff($res)
{
global $INSTALLER09, $lang, $CURUSER, $id;
$htmlout_snatch = '';
$count2 = 0;
// $htmlout_snatch .= "<tr><td class='one' align='right' valign='top'><b>{$lang['userdetails_snatched']}</b></td><td class='one'>";
$htmlout_snatch .= "<table border='1' cellspacing='0' cellpadding='5' align='center'><tr><td class='colhead' align='center'>{$lang['userdetails_s_cat']}</td><td class='colhead' align='left'>{$lang['userdetails_s_torr']}</td>" . "<td class='colhead' align='center'>{$lang['userdetails_s_sl']}</td><td class='colhead' align='center'>{$lang['userdetails_s_up']}" . ($INSTALLER09['ratio_free'] ? "" : "{$lang['userdetails_s_down']}") . "</td><td class='colhead' align='center'>{$lang['userdetails_s_tsize']}</td>" . "<td class='colhead' align='center'>{$lang['userdetails_ratio']}</td><td class='colhead' align='center'>{$lang['userdetails_client']}</td></tr>";
while ($arr = mysqli_fetch_assoc($res)) {
//=======change colors
$count2 = ++$count2 % 2;
$class = $count2 == 0 ? 'one' : 'two';
//=== speed color red fast green slow ;)
if ($arr["upspeed"] > 0) {
$ul_speed = $arr["upspeed"] > 0 ? mksize($arr["upspeed"]) : ($arr["seedtime"] > 0 ? mksize($arr["uploaded"] / ($arr["seedtime"] + $arr["leechtime"])) : mksize(0));
} else {
$ul_speed = mksize($arr["uploaded"] / ($arr['l_a'] - $arr['s'] + 1));
}
if ($arr["downspeed"] > 0) {
$dl_speed = $arr["downspeed"] > 0 ? mksize($arr["downspeed"]) : ($arr["leechtime"] > 0 ? mksize($arr["downloaded"] / $arr["leechtime"]) : mksize(0));
} else {
$dl_speed = mksize($arr["downloaded"] / ($arr['c'] - $arr['s'] + 1));
}
switch (true) {
case $dl_speed > 600:
$dlc = 'red';
break;
case $dl_speed > 300:
$dlc = 'orange';
break;
case $dl_speed > 200:
$dlc = 'yellow';
break;
case $dl_speed < 100:
$dlc = 'Chartreuse';
break;
}
if ($arr["downloaded"] > 0) {
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "<font color='" . get_ratio_color($ratio) . "'><b>{$lang['userdetails_s_ratio']}</b><br />{$ratio}</font>";
} else {
if ($arr["uploaded"] > 0) {
$ratio = $lang['userdetails_inf'];
} else {
$ratio = "N/A";
}
}
if (XBT_TRACKER === false) {
$htmlout_snatch .= "<tr><td class='{$class}' align='center'>" . ($arr['owner'] == $id ? "<b><font color='orange'>{$lang['userdetails_s_towner']}</font></b><br />" : "" . ($arr['complete_date'] != '0' ? "<b><font color='lightgreen'>{$lang['userdetails_s_fin']}</font></b><br />" : "<b><font color='red'>{$lang['userdetails_s_nofin']}</font></b><br />") . "") . "<img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($arr['image']) . "' alt='" . htmlsafechars($arr['name']) . "' title='" . htmlsafechars($arr['name']) . "' /></td>" . "\n <td class='{$class}'><a class='altlink' href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $arr['torrentid'] . "'><b>" . htmlsafechars($arr['torrent_name']) . "</b></a>" . ($arr['complete_date'] != '0' ? "<br /><font color='yellow'>{$lang['userdetails_s_started']}" . get_date($arr['start_date'], 0, 1) . "</font><br />" : "<font color='yellow'>{$lang['userdetails_s_started']}" . get_date($arr['start_date'], 0, 1) . "</font><br /><font color='orange'>{$lang['userdetails_s_laction']}" . get_date($arr['last_action'], 0, 1) . "</font>" . get_date($arr['complete_date'], 0, 1) . " " . ($arr['complete_date'] == '0' ? "" . ($arr['owner'] == $id ? "" : "[ " . mksize($arr["size"] - $arr["downloaded"]) . "{$lang['userdetails_s_still']}]") . "" : "") . "") . $lang['userdetails_s_finished'] . get_date($arr['complete_date'], 0, 1) . "" . ($arr['complete_date'] != '0' ? "<br /><font color='silver'>{$lang['userdetails_s_ttod']}" . ($arr['leechtime'] != '0' ? mkprettytime($arr['leechtime']) : mkprettytime($arr['c'] - $arr['s']) . "") . "</font> <font color='{$dlc}'>[ {$lang['userdetails_s_dled']} {$dl_speed} ]</font><br />" : "<br />") . "<font color='lightblue'>" . ($arr['seedtime'] != '0' ? $lang['userdetails_s_tseed'] . mkprettytime($arr['seedtime']) . " </font><font color='{$dlc}'> " : $lang['userdetails_s_tseedn']) . "</font><font color='lightgreen'> [ {$lang['userdetails_s_uspeed']} " . $ul_speed . " ] </font>" . ($arr['complete_date'] == '0' ? "<br /><font color='{$dlc}'>{$lang['userdetails_s_dspeed']}{$dl_speed}</font>" : "") . "</td>" . "\n <td align='center' class='{$class}'>{$lang['userdetails_s_seed']}" . (int) $arr['seeders'] . "<br />{$lang['userdetails_s_leech']}" . (int) $arr['leechers'] . "</td><td align='center' class='{$class}'><font color='lightgreen'>{$lang['userdetails_s_upld']}<br /><b>" . mksize($arr["uploaded"]) . "</b></font>" . ($INSTALLER09['ratio_free'] ? "" : "<br /><font color='orange'>{$lang['userdetails_s_dld']}<br /><b>" . mksize($arr["downloaded"]) . "</b></font>") . "</td><td align='center' class='{$class}'>" . mksize($arr["size"]) . "" . ($INSTALLER09['ratio_free'] ? "" : "<br />{$lang['userdetails_s_diff']}<br /><font color='orange'><b>" . mksize($arr['size'] - $arr["downloaded"]) . "</b></font>") . "</td><td align='center' class='{$class}'>" . $ratio . "<br />" . ($arr['seeder'] == 'yes' ? "<font color='lightgreen'><b>{$lang['userdetails_s_seeding']}</b></font>" : "<font color='red'><b>{$lang['userdetails_s_nseeding']}</b></font>") . "</td><td align='center' class='{$class}'>" . htmlsafechars($arr["agent"]) . "<br />{$lang['userdetails_s_port']}" . (int) $arr["port"] . "<br />" . ($arr["connectable"] == 'yes' ? "<b>{$lang['userdetails_s_conn']}</b> <font color='lightgreen'>{$lang['userdetails_yes']}</font>" : "<b>{$lang['userdetails_s_conn']}</b> <font color='red'><b>{$lang['userdetails_no']}</b></font>") . "</td></tr>\n";
} else {
$htmlout_snatch .= "<tr><td class='{$class}' align='center'>" . ($arr['owner'] == $id ? "<b><font color='orange'>{$lang['userdetails_s_towner']}</font></b><br />" : "" . ($arr['completedtime'] != '0' ? "<b><font color='lightgreen'>{$lang['userdetails_s_fin']}</font></b><br />" : "<b><font color='red'>{$lang['userdetails_s_nofin']}</font></b><br />") . "") . "<img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($arr['image']) . "' alt='" . htmlsafechars($arr['name']) . "' title='" . htmlsafechars($arr['name']) . "' /></td>" . "\n <td class='{$class}'><a class='altlink' href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $arr['fid'] . "'><b>" . htmlsafechars($arr['torrent_name']) . "</b></a>" . ($arr['completedtime'] != '0' ? "<br /><font color='yellow'>{$lang['userdetails_s_started']}" . get_date($arr['started'], 0, 1) . "</font><br />" : "<font color='yellow'>started:" . get_date($arr['started'], 0, 1) . "</font><br /><font color='orange'>{$lang['userdetails_s_laction']}" . get_date($arr['mtime'], 0, 1) . "</font>" . get_date($arr['completedtime'], 0, 1) . " " . ($arr['completedtime'] == '0' ? "" . ($arr['owner'] == $id ? "" : "[ " . mksize($arr["size"] - $arr["downloaded"]) . "{$lang['userdetails_s_still']}]") . "" : "") . "") . "{$lang['userdetails_s_finished']}" . get_date($arr['completedtime'], 0, 1) . "" . ($arr['completedtime'] != '0' ? "<br /><font color='silver'>{$lang['userdetails_s_ttod']}" . ($arr['leechtime'] != '0' ? mkprettytime($arr['leechtime']) : mkprettytime($arr['c'] - $arr['s']) . "") . "</font> <font color='{$dlc}'>[ {$lang['userdetails_s_dled']} {$dl_speed} ]</font><br />" : "<br />") . "<font color='lightblue'>" . ($arr['seedtime'] != '0' ? "{$lang['userdetails_s_tseed']}" . mkprettytime($arr['seedtime']) . " </font><font color='{$dlc}'> " : "{$lang['userdetails_s_tseedn']}") . "</font><font color='lightgreen'> [{$lang['userdetails_s_uspeed']}" . $ul_speed . " ] </font>" . ($arr['completedtime'] == '0' ? "<br /><font color='{$dlc}'>{$lang['userdetails_s_dspeed']} {$dl_speed}</font>" : "") . "</td>" . "\n <td align='center' class='{$class}'>{$lang['userdetails_s_seed']}" . (int) $arr['seeders'] . "<br />{$lang['userdetails_s_leech']}" . (int) $arr['leechers'] . "</td><td align='center' class='{$class}'><font color='lightgreen'>{$lang['userdetails_s_upld']}<br /><b>" . mksize($arr["uploaded"]) . "</b></font>" . ($INSTALLER09['ratio_free'] ? "" : "<br /><font color='orange'>{$lang['userdetails_s_dld']}<br /><b>" . mksize($arr["downloaded"]) . "</b></font>") . "</td><td align='center' class='{$class}'>" . mksize($arr["size"]) . "" . ($INSTALLER09['ratio_free'] ? "" : "<br />{$lang['userdetails_s_diff']}<br /><font color='orange'><b>" . mksize($arr['size'] - $arr["downloaded"]) . "</b></font>") . "</td><td align='center' class='{$class}'>" . $ratio . "<br />" . ($arr['active'] == 1 ? "<font color='lightgreen'><b>{$lang['userdetails_s_seeding']}</b></font>" : "<font color='red'><b>{$lang['userdetails_s_nseeding']}</b></font>") . "</td><td align='center' class='{$class}'>" . htmlsafechars($arr["peer_id"]) . "<br />" . ($arr["connectable"] == 1 ? "<b>{$lang['userdetails_s_conn']}</b> <font color='lightgreen'>{$lang['userdetails_yes']}</font>" : "<b>{$lang['userdetails_s_conn']}</b> <font color='red'><b>{$lang['userdetails_no']}</b></font>") . "</td></tr>\n";
}
}
$htmlout_snatch .= "</table>\n";
return $htmlout_snatch;
}
示例12: Copyright
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V5 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless, Autotron, whocares, Swizzles. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(1200);
ignore_user_abort(1);
//== 09 Auto invite by Bigjoos/pdq
$ratiocheck = 1.0;
$joined = TIME_NOW - 86400 * 90;
$res = sql_query("SELECT id, uploaded, invites, downloaded, modcomment FROM users WHERE invites='1' AND class = " . UC_USER . " AND uploaded / downloaded <= {$ratiocheck} AND enabled='yes' AND added < {$joined}") or sqlerr(__FILE__, __LINE__);
$msgs_buffer = $users_buffer = array();
if (mysqli_num_rows($res) > 0) {
$subject = "Auto Invites";
$msg = "Congratulations, your user group met a set out criteria therefore you have been awarded 2 invites :)\n Please use them carefully. Cheers " . $INSTALLER09['site_name'] . " staff.\n";
while ($arr = mysqli_fetch_assoc($res)) {
$ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3);
$modcomment = $arr['modcomment'];
$modcomment = get_date(TIME_NOW, 'DATE', 1) . " - Awarded 2 bonus invites by System (UL=" . mksize($arr['uploaded']) . ", DL=" . mksize($arr['downloaded']) . ", R=" . $ratio . ") .\n" . $modcomment;
$modcom = sqlesc($modcomment);
$msgs_buffer[] = '(0,' . $arr['id'] . ', ' . TIME_NOW . ', ' . sqlesc($msg) . ', ' . sqlesc($subject) . ')';
$users_buffer[] = '(' . $arr['id'] . ', 2, ' . $modcom . ')';
//== 2 in the user_buffer is award amount :)
$update['invites'] = $arr['invites'] + 2;
//== 2 in the user_buffer is award amount :)
$mc1->begin_transaction('user' . $arr['id']);
$mc1->update_row(false, array('invites' => $update['invites']));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('user_stats_' . $arr['id']);
$mc1->update_row(false, array('modcomment' => $modcomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
$mc1->begin_transaction('MyUser_' . $arr['id']);
$mc1->update_row(false, array('invites' => $update['invites']));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->delete_value('inbox_new_' . $arr['id']);
$mc1->delete_value('inbox_new_sb_' . $arr['id']);
}
$count = count($users_buffer);
if ($count > 0) {
sql_query("INSERT INTO messages (sender,receiver,added,msg,subject) VALUES " . implode(', ', $msgs_buffer)) or sqlerr(__FILE__, __LINE__);
sql_query("INSERT INTO users (id, invites, modcomment) VALUES " . implode(', ', $users_buffer) . " ON DUPLICATE key UPDATE invites = invites+values(invites), modcomment=values(modcomment)") or sqlerr(__FILE__, __LINE__);
write_log("Cleanup: Awarded 2 bonus invites to " . $count . " member(s) ");
}
unset($users_buffer, $msgs_buffer, $update, $count);
}
//==
if ($queries > 0) {
write_log("Auto Invites -------------------- Auto Cleanups cleanup Complete using {$queries} queries --------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
示例13: docleanup
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(1200);
ignore_user_abort(1);
//== Updated demote power users
$minratio = 0.85;
$res = sql_query("SELECT id, uploaded, downloaded, modcomment FROM users WHERE class = " . UC_POWER_USER . " AND uploaded / downloaded < {$minratio}") or sqlerr(__FILE__, __LINE__);
$subject = "Auto Demotion";
$msgs_buffer = $users_buffer = array();
if (mysqli_num_rows($res) > 0) {
$msg = "You have been auto-demoted from [b]Power User[/b] to [b]User[/b] because your share ratio has dropped below {$minratio}.\n";
while ($arr = mysqli_fetch_assoc($res)) {
$ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3);
$modcomment = $arr['modcomment'];
$modcomment = get_date(TIME_NOW, 'DATE', 1) . " - Demoted To User by System (UL=" . mksize($arr['uploaded']) . ", DL=" . mksize($arr['downloaded']) . ", R=" . $ratio . ").\n" . $modcomment;
$modcom = sqlesc($modcomment);
$msgs_buffer[] = '(0,' . $arr['id'] . ', ' . TIME_NOW . ', ' . sqlesc($msg) . ', ' . sqlesc($subject) . ')';
$users_buffer[] = '(' . $arr['id'] . ', 0, ' . $modcom . ')';
$mc1->begin_transaction('user' . $arr['id']);
$mc1->update_row(false, array('class' => 0));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('user_stats_' . $arr['id']);
$mc1->update_row(false, array('modcomment' => $modcomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
$mc1->begin_transaction('MYuser_' . $arr['id']);
$mc1->update_row(false, array('class' => 0));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->delete_value('inbox_new_' . $arr['id']);
$mc1->delete_value('inbox_new_sb_' . $arr['id']);
}
$count = count($users_buffer);
if ($count > 0) {
sql_query("INSERT INTO messages (sender,receiver,added,msg,subject) VALUES " . implode(', ', $msgs_buffer)) or sqlerr(__FILE__, __LINE__);
sql_query("INSERT INTO users (id, class, modcomment) VALUES " . implode(', ', $users_buffer) . " ON DUPLICATE key UPDATE class=values(class),modcomment=concat(values(modcomment),modcomment)") or sqlerr(__FILE__, __LINE__);
write_log("Cleanup: Demoted " . $count . " member(s) from Power User to User");
status_change($arr['id']);
}
unset($users_buffer, $msgs_buffer, $count);
status_change($arr['id']);
//== For Retros announcement mod
}
//==End
if ($queries > 0) {
write_log("Power User Demote Updates -------------------- Power User Demote Updates Clean Complete using {$queries} queries--------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
示例14: peer_list
function peer_list($array)
{
global $INSTALLER09, $lang;
$htmlout = '';
$htmlout .= "<table width='100%' border='1' cellpadding='5' style='border-collapse:collapse'>\r\n\t\t <tr>\r\n \t\t <td align='center' class='colhead'>User</td>\r\n <td align='center' class='colhead'>Port&Ip</td>\r\n <td align='center' class='colhead'>Ratio</td>\r\n <td align='center' class='colhead'>Downloaded</td>\r\n <td align='center' class='colhead'>Uploaded</td>\r\n <td align='center' class='colhead'>Started</td>\r\n <td align='center' class='colhead'>Finished</td>\r\n </tr>";
foreach ($array as $p) {
$time = max(1, time() - $p["started"] - (time() - $p["last_action"]));
$htmlout .= "<tr>\r\n \t\t<td align='center'><a href='userdetails.php?id={$p["p_uid"]}' >{$p["p_user"]}</a></td>\r\n <td align='center'>" . ($CURUSER['class'] >= UC_MODERATOR ? $p["ip"] . ":" . $p["port"] : "xx.xx.xx.xx:xxxx") . "</td>\r\n <td align='center'>" . ($p["downloaded"] > 0 ? number_format($p["uploaded"] / $p["downloaded"], 2) : ($p["uploaded"] > 0 ? "∞" : "---")) . "</td>\r\n <td align='center'>" . ($p["downloaded"] > 0 ? mksize($p["downloaded"]) . " @" . mksize(($p["downloaded"] - $p["downloadoffset"]) / $time) . "s" : "0kb") . "</td>\r\n <td align='center'>" . ($p["uploaded"] > 0 ? mksize($p["uploaded"]) . " @" . mksize(($p["uploaded"] - $p["uploadoffset"]) / $time) . "s" : "0kb") . "</td>\r\n <td align='center'>" . get_date($p["started"], 'LONG', 0, 1) . "</td>\r\n <td align='center'>" . get_date($p["finishedat"], 'LONG', 0, 1) . "</td>\r\n\t\t\t</tr>";
}
$htmlout .= "</table>";
return $htmlout;
}
示例15: peer_list
function peer_list($array)
{
global $INSTALLER09, $lang;
$htmlout = '';
$htmlout .= "<table width='100%' border='1' cellpadding='5' style='border-collapse:collapse'>\n <tr>\n <td align='center' class='colhead'>{$lang['catol_user']}</td>\n <td align='center' class='colhead'>{$lang['catol_port']}&{$lang['catol_ip']}</td>\n <td align='center' class='colhead'>{$lang['catol_ratio']}</td>\n <td align='center' class='colhead'>{$lang['catol_downloaded']}</td>\n <td align='center' class='colhead'>{$lang['catol_uploaded']}</td>\n <td align='center' class='colhead'>{$lang['catol_started']}</td>\n <td align='center' class='colhead'>{$lang['catol_finished']}</td>\n </tr>";
foreach ($array as $p) {
$time = max(1, TIME_NOW - $p["started"] - (TIME_NOW - $p["last_action"]));
$htmlout .= "<tr>\n <td align='center'><a href='userdetails.php?id=" . (int) $p["p_uid"] . "' >" . htmlsafechars($p["p_user"]) . "</a></td>\n <td align='center'>" . ($CURUSER['class'] >= UC_STAFF ? htmlsafechars($p["ip"]) . " : " . (int) $p["port"] : "xx.xx.xx.xx:xxxx") . "</td>\n <td align='center'>" . ($p["downloaded"] > 0 ? number_format($p["uploaded"] / $p["downloaded"], 2) : ($p["uploaded"] > 0 ? "∞" : "---")) . "</td>\n <td align='center'>" . ($p["downloaded"] > 0 ? mksize($p["downloaded"]) . " @" . mksize(($p["downloaded"] - $p["downloadoffset"]) / $time) . "s" : "0kb") . "</td>\n <td align='center'>" . ($p["uploaded"] > 0 ? mksize($p["uploaded"]) . " @" . mksize(($p["uploaded"] - $p["uploadoffset"]) / $time) . "s" : "0kb") . "</td>\n <td align='center'>" . get_date($p["started"], 'LONG', 0, 1) . "</td>\n <td align='center'>" . get_date($p["finishedat"], 'LONG', 0, 1) . "</td>\n </tr>";
}
$htmlout .= "</table>";
return $htmlout;
}