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&amp;cid={$row['id']}\" class=\"altlink_white\">Цитата</a>]" : "") . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? " [<a href=" . $redaktor . ".php?action=edit&amp;cid={$row['id']} class=\"altlink_white\">Изменить</a>]" : "") . (get_user_class() >= UC_MODERATOR ? " [<a href=\"" . $redaktor . ".php?action=delete&amp;cid={$row['id']}\" class=\"altlink_white\">Удалить</a>]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? " [<a href=\"" . $redaktor . ".php?action=vieworiginal&amp;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>";
    }
}
Beispiel #2
0
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']}&amp;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;
}
Beispiel #3
0
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']}&amp;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;
}
Beispiel #4
0
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();
}
Beispiel #5
0
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 .= "&nbsp;час";
        } else {
            $ttl .= "&nbsp;часов";
        }
        $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']}&amp;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;
}
Beispiel #6
0
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;
}
Beispiel #7
0
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 = "&nbsp;&nbsp;" . 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 . "&amp;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;
}
Beispiel #8
0
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;
}
Beispiel #9
0
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);
    }
}
Beispiel #10
0
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;
}
Beispiel #11
0
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;
}
Beispiel #12
0
/**
|--------------------------------------------------------------------------|
|   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);
    }
}
Beispiel #13
0
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);
    }
}
Beispiel #14
0
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&amp;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 ? "&infin;" : "---")) . "</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;
}
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']}&amp;{$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 ? "&infin;" : "---")) . "</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;
}
Beispiel #16
0
function maketable($res)
{
	global $cats;
	if (!isset($cats))
	{
		$res2 = mysql_query("SELECT id, image, name FROM categories") or sqlerr(__FILE__, __LINE__);
		while ($arr = mysql_fetch_assoc($res2))
		{
			$catimages[$arr["id"]] = $arr["image"];
			$catnames[$arr["id"]] = $arr["name"];
		}
	}
  $ret = '<table class=main border=1 cellspacing=0 cellpadding=5>' .
    '<tr><td class="colhead" align="center">Tegund</td><td class="colhead">Nafn</td><td class="colhead" align="center">TTL</td><td class="colhead" align="center">Stærð</td><td class="colhead" align="center">Uppl.</td>'."\n" .
    '<td class="colhead" align="center">Downl.</td><td class="colhead" align="center">Hlutfall</td><td class="colhead" align="center">IP-tala</td></tr>'."\n";
  while ($arr = mysql_fetch_assoc($res))
  {
    $res2 = mysql_query("SELECT name,size,category,added FROM torrents WHERE id=$arr[torrent]");
    $arr2 = mysql_fetch_assoc($res2);
    if ($arr["downloaded"] > 0)
    {
      $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
      $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
    }
    else
      if ($arr["uploaded"] > 0)
        $ratio = "Inf.";
      else
        $ratio = "---";
	$catimage = htmlspecialchars($catimages[$arr2["category"]]);
	$catname = htmlspecialchars($catnames[$arr2["category"]]);
	$ttl = (28*24) - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr2["added"])) / 3600);
	if ($ttl == 1) $ttl .= "<br>klst";
	$size = str_replace(" ", "<br>", mksize($arr2["size"]));
	$uploaded = str_replace(" ", "<br>", mksize($arr["uploaded"]));
	$downloaded = str_replace(" ", "<br>", mksize($arr["downloaded"]));
	$ip = $arr['ip'];
    $ret .= '<tr><td style="padding: 0px"><img src="pic/'.$catimage.'" alt="'.$catname.'" width="42" height="42"></td>'."\n" .
		'<td><a href=details.php?id='.$arr[torrent].'&amp;hit=1><b>';
		if(!empty($arr2['name']))
			$ret .= htmlspecialchars($arr2[name]);
		else
			$ret .= '[Ekkert nafn]';
	$ret .=	'</b></a></td><td align="center">'.$ttl.'</td><td align="center">'.$size.'</td><td align="center">'.$uploaded.'</td>'."\n" .
		'<td align="center">'.$downloaded.'</td><td align="center">'.$ratio.'</td><td 
align="center">'.$ip.'</td></tr>'."\n";
  }
  $ret .= "</table>\n";
  return $ret;
}
function peerstable($res)
{
    $ret = "<table align='center' cellpadding=\"3\" cellspacing=\"0\" class=\"table_table\" width=\"100%\" border=\"1\"><tr><th class='table_head'>" . T_("NAME") . "</th><th class='table_head'>" . T_("SIZE") . "</th><th class='table_head'>" . T_("UPLOADED") . "</th>\n<th class='table_head'>" . T_("DOWNLOADED") . "</th><th class='table_head'>" . T_("RATIO") . "</th></tr>\n";
    while ($arr = mysql_fetch_assoc($res)) {
        $res2 = SQL_Query_exec("SELECT name,size FROM torrents WHERE id={$arr['torrent']} ORDER BY name");
        $arr2 = mysql_fetch_assoc($res2);
        if ($arr["downloaded"] > 0) {
            $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
        } else {
            $ratio = "---";
        }
        $ret .= "<tr><td class='table_col1'><a href='torrents-details.php?id={$arr['torrent']}&amp;hit=1'><b>" . htmlspecialchars($arr2["name"]) . "</b></a></td><td align='center' class='table_col2'>" . mksize($arr2["size"]) . "</td><td align='center' class='table_col1'>" . mksize($arr["uploaded"]) . "</td><td align='center' class='table_col2'>" . mksize($arr["downloaded"]) . "</td><td align='center' class='table_col1'>{$ratio}</td></tr>\n";
    }
    $ret .= "</table>\n";
    return $ret;
}
Beispiel #18
0
function snatchtable($res)
{
    global $INSTALLER09, $lang, $CURUSER;
    $htmlout = '';
    $htmlout = "<table class='main' border='1' cellspacing='0' cellpadding='5'>\n <tr>\n<td class='colhead'>{$lang['userdetails_s_cat']}</td>\n<td class='colhead'>{$lang['userdetails_s_torr']}</td>\n<td class='colhead'>{$lang['userdetails_s_up']}</td>\n<td class='colhead'>{$lang['userdetails_rate']}</td>\n" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead'>{$lang['userdetails_downl']}</td>") . "\n" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead'>{$lang['userdetails_rate']}</td>") . "\n<td class='colhead'>{$lang['userdetails_ratio']}</td>\n<td class='colhead'>{$lang['userdetails_activity']}</td>\n<td class='colhead'>{$lang['userdetails_s_fin']}</td>\n</tr>";
    while ($arr = mysqli_fetch_assoc($res)) {
        $upspeed = $arr["upspeed"] > 0 ? mksize($arr["upspeed"]) : ($arr["seedtime"] > 0 ? mksize($arr["uploaded"] / ($arr["seedtime"] + $arr["leechtime"])) : mksize(0));
        $downspeed = $arr["downspeed"] > 0 ? mksize($arr["downspeed"]) : ($arr["leechtime"] > 0 ? mksize($arr["downloaded"] / $arr["leechtime"]) : mksize(0));
        $ratio = $arr["downloaded"] > 0 ? number_format($arr["uploaded"] / $arr["downloaded"], 3) : ($arr["uploaded"] > 0 ? "Inf." : "---");
        $XBT_or_PHP = XBT_TRACKER == true ? $arr['fid'] : $arr['torrentid'];
        $XBT_or_PHP_TIME = XBT_TRACKER == true ? $arr["completedtime"] : $arr["complete_date"];
        $htmlout .= "<tr>\n <td style='padding: 0px'><img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($arr["catimg"]) . "' alt='" . htmlsafechars($arr["catname"]) . "' width='42' height='42' /></td>\n <td><a href='details.php?id=" . (int) $XBT_or_PHP . "'><b>" . (strlen($arr["name"]) > 50 ? substr($arr["name"], 0, 50 - 3) . "..." : htmlsafechars($arr["name"])) . "</b></a></td>\n <td>" . mksize($arr["uploaded"]) . "</td>\n <td>{$upspeed}/s</td>\n " . ($INSTALLER09['ratio_free'] ? "" : "<td>" . mksize($arr["downloaded"]) . "</td>") . "\n " . ($INSTALLER09['ratio_free'] ? "" : "<td>{$downspeed}/s</td>") . "\n <td>{$ratio}</td>\n <td>" . mkprettytime($arr["seedtime"] + $arr["leechtime"]) . "</td>\n <td>" . ($XBT_or_PHP_TIME != 0 ? "<font color='green'><b>{$lang['userdetails_yes']}</b></font>" : "<font color='red'><b>{$lang['userdetails_no']}</b></font>") . "</td>\n </tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
function dltable($name, $arr, $torrent)
{
    global $CURUSER, $lang, $INSTALLER09;
    $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>" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>") . "" . "" . ($INSTALLER09['ratio_free'] ? "" : "<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_NOW;
    $mod = $CURUSER['class'] >= UC_STAFF;
    foreach ($arr as $e) {
        $htmlout .= "<tr>\n";
        if ($e['username']) {
            if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['userid'] || $e['anonymous'] == 'yes' or $e['paranoia'] >= 2) && $CURUSER['id'] != $e['userid'] && $CURUSER['class'] < UC_STAFF) {
                $htmlout .= "<td><b>Kezer Soze</b></td>\n";
            } else {
                $htmlout .= "<td><a href='userdetails.php?id=" . (int) $e['userid'] . "'><b>" . htmlsafechars($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 .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'>" . mksize($e["downloaded"]) . "</td>") . "\n";
        if ($e["seeder"] == "no") {
            $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</span></td>") . "\n";
        } else {
            $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e['st'])) . "/s</span></td>") . "\n";
        }
        $htmlout .= "<td align=\"right\">" . member_ratio($e['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $e['downloaded']) . "</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'>" . htmlsafechars(getagent($e["agent"], $e['peer_id'])) . "</td>\n";
        $htmlout .= "</tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
Beispiel #20
0
function checkout($torrentsize, $torrentcount)
{
    global $standardsize;
    global $standardcount;
    global $overcount;
    global $oversize;
    if ($torrentsize < 1073741824) {
        return false;
    }
    if ($torrentcount >= $overcount) {
        return true;
    } elseif (mksize($torrentsize) >= $oversize) {
        return true;
    } elseif (mksize($torrentsize) >= $standardsize && $torrentcount >= $standardcount) {
        return true;
    } else {
        return false;
    }
}
Beispiel #21
0
function uploadimage($x, $imgname, $tid)
{
    global $max_image_size;
    $maxfilesize = $max_image_size;
    // default 1mb
    $allowed_types = array("image/gif" => "gif", "image/pjpeg" => "jpg", "image/jpeg" => "jpg", "image/jpg" => "jpg", "image/png" => "png");
    if (!($_FILES['image' . $x]['name'] == "")) {
        if ($imgname != "") {
            // Make sure is same as in takeedit.php (except for the $imgname bit)
            $img = "torrents/images/{$imgname}";
            $del = unlink($img);
        }
        $y = $x + 1;
        // Is valid filetype?
        if (!array_key_exists($_FILES['image' . $x]['type'], $allowed_types)) {
            bark("Invalid file type! Image {$y} (" . htmlspecialchars_uni($_FILES['image' . $x]['type']) . ")");
        }
        if (!preg_match('/^(.+)\\.(jpg|jpeg|png|gif)$/si', $_FILES['image' . $x]['name'])) {
            bark("Неверное имя файла (не картинка).");
        }
        // Is within allowed filesize?
        if ($_FILES['image' . $x]['size'] > $maxfilesize) {
            bark("Превышен размер файла! Картинка {$y} - Должна быть меньше " . mksize($maxfilesize));
        }
        // Where to upload?
        // Make sure is same as on takeupload.php
        $uploaddir = "torrents/images/";
        // What is the temporary file name?
        $ifile = $_FILES['image' . $x]['tmp_name'];
        // By what filename should the tracker associate the image with?
        //$ifilename = $tid . $x . substr($_FILES['image'.$x]['name'], strlen($_FILES['image'.$x]['name'])-4, 4);
        $ifilename = $tid . $x . '.' . end(explode('.', $_FILES['image' . $x]['name']));
        // Upload the file
        $copy = copy($ifile, $uploaddir . $ifilename);
        if (!$copy) {
            bark("Error occured uploading image! - Image {$y}");
        }
        return $ifilename;
    }
}
Beispiel #22
0
  function usertable($res, $frame_caption)
  {
    begin_frame($frame_caption, true);
    begin_table();
?>
<tr>
<td class=colhead>Sæti</td>
<td class=colhead align=left>Notandi</td>
<td class=colhead>Uploadað</td>
<td class=colhead>Downloadað</td>
<td class=colhead align=right>Ratio</td>
</tr>
<?
    $num = 0;
    while ($a = mysql_fetch_assoc($res))
    {
      ++$num;
      if ($a["downloaded"])
      {
        $ratio = $a["uploaded"] / $a["downloaded"];
        $color = get_ratio_color($ratio);
        $ratio = number_format($ratio, 2);
        if ($color)
          $ratio = "<font color=$color>$ratio</font>";
	if($a['notoplist'] === '1')
		$tcolor = ' style="background-color:DarkGray"';
	else
		$tcolor = '';
      }
      else
        $ratio = "Endalaust.";
      echo '<tr'.$tcolor.'><td align="center">'.$num.'</td><td align="left"><a href=userdetails.php?id='.$a["id"].'><b>'. $a["username"].
         '</b></a></td><td align="right">'.mksize($a['uploaded']).
         '</td><td align="right">'.mksize($a['downloaded']).
         '</td><td align="right">'.$ratio.'</td></tr>';
    }
    end_table();
    end_frame();
  }
Beispiel #23
0
function StatusDB()
{
    global $prefix, $admin_file, $dbname;
    $result = sql_query("SHOW TABLES FROM " . $dbname . "");
    $content = "";
    while (list($name) = mysql_fetch_array($result)) {
        $content .= "<option value=\"" . $name . "\" selected>" . $name . "</option>";
    }
    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" align=\"center\">" . "<form method=\"post\" action=\"" . $admin_file . ".php\">" . "<tr><td><select name=\"datatable[]\" size=\"10\" multiple=\"multiple\" style=\"width:400px\">" . $content . "</select></td><td>" . "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">" . "<tr><td valign=\"top\"><input type=\"radio\" name=\"type\" value=\"Optimize\" checked></td><td>Оптимизация базы данных<br /><font class=\"small\">Производя оптимизацию базы данных, Вы уменьшаете её размер и соответственно с этим ускоряете её работу. Рекомендуется использовать данную функцию минимум один раз в неделю.</font></td></tr>" . "<tr><td valign=\"top\"><input type=\"radio\" name=\"type\" value=\"Repair\"></td><td>Ремонт базы данных<br /><font class=\"small\">При неожиданной остановке MySQL сервера, во время выполнения каких-либо действий, может произойти повреждение структуры таблиц базы данных, использование этой функции произведёт ремонт повреждённых таблиц.</font></td></tr></table>" . "</td></tr>" . "<input type=\"hidden\" name=\"op\" value=\"StatusDB\">" . "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Выполнить действие\"></td></tr></form></table>";
    if ($_POST['type'] == "Optimize") {
        $result = sql_query("SHOW TABLE STATUS FROM " . $dbname . "");
        $tables = array();
        while ($row = mysql_fetch_array($result)) {
            $total = $row['Data_length'] + $row['Index_length'];
            $totaltotal += $total;
            $free = $row['Data_free'] ? $row['Data_free'] : 0;
            $totalfree += $free;
            $i++;
            $otitle = !$free ? "<font color=\"#FF0000\">Не нуждается</font>" : "<font color=\"#009900\">Оптимизирована</font>";
            //sql_query("OPTIMIZE TABLE ".$row[0]."");
            $tables[] = $row[0];
            $content3 .= "<tr class=\"bgcolor1\"><td align=\"center\">" . $i . "</td><td>" . $row[0] . "</td><td>" . mksize($total) . "</td><td align=\"center\">" . $otitle . "</td><td align=\"center\">" . mksize($free) . "</td></tr>";
        }
        sql_query("OPTIMIZE TABLE " . implode(", ", $tables));
        echo "<center><font class=\"option\">Оптимизация базы данных: " . $dbname . "<br />Общий размер базы данных: " . mksize($totaltotal) . "<br />Общие накладные расходы: " . mksize($totalfree) . "<br /><br />" . "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td class=\"colhead\" align=\"center\">№</td><td class=\"colhead\">Таблица</td><td class=\"colhead\">Размер</td><td class=\"colhead\">Статус</td><td class=\"colhead\">Накладные расходы</td></tr>" . "" . $content3 . "</table>";
    } elseif ($_POST['type'] == "Repair") {
        $result = sql_query("SHOW TABLE STATUS FROM " . $dbname . "");
        while ($row = mysql_fetch_array($result)) {
            $total = $row['Data_length'] + $row['Index_length'];
            $totaltotal += $total;
            $i++;
            $rresult = sql_query("REPAIR TABLE " . $row[0] . "");
            $otitle = !$rresult ? "<font color=\"#FF0000\">Ошибка</font>" : "<font color=\"#009900\">OK</font>";
            $content4 .= "<tr class=\"bgcolor1\"><td align=\"center\">" . $i . "</td><td>" . $row[0] . "</td><td>" . mksize($total) . "</td><td align=\"center\">" . $otitle . "</td></tr>";
        }
        echo "<center><font class=\"option\">Ремонт базы данных: " . $dbname . "<br />Общий размер базы данных: " . mksize($totaltotal) . "<br /><br />" . "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td class=\"colhead\" align=\"center\">№</td><td class=\"colhead\">Таблица</td><td class=\"colhead\">Размер</td><td class=\"colhead\">Статус</td></tr>" . "" . $content4 . "</table>";
    }
}
Beispiel #24
0
function dltable($name, $arr, $torrent)
{
    global $CURUSER, $lang, $INSTALLER09;
    $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 class='table table-bordered'>\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='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>") . "" . "" . ($INSTALLER09['ratio_free'] ? "" : "<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_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
    $now = TIME_NOW;
    $mod = $CURUSER['class'] >= UC_STAFF;
    foreach ($arr as $e) {
        $htmlout .= "<tr>\n";
        $upspeed = $e["upspeed"] > 0 ? mksize($e["upspeed"]) : ($e["seedtime"] > 0 ? mksize($e["uploaded"] / ($e["seedtime"] + $e["leechtime"])) : mksize(0));
        $downspeed = $e["downspeed"] > 0 ? mksize($e["downspeed"]) : ($e["leechtime"] > 0 ? mksize($e["downloaded"] / $e["leechtime"]) : mksize(0));
        if ($e['username']) {
            if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['uid'] || $e['anonymous'] == 'yes' or $e['paranoia'] >= 2 && $CURUSER['id'] != $e['uid']) && $CURUSER['class'] < UC_STAFF) {
                $htmlout .= "<td><b>Kezer Soze</b></td>\n";
            } else {
                $htmlout .= "<td><a href='userdetails.php?id=" . (int) $e['uid'] . "'><b>" . htmlsafechars($e['username']) . "</b></a></td>\n";
            }
        } else {
            $htmlout .= "<td>" . ($mod ? XBT_IP_CONVERT($e["ipa"]) : preg_replace('/\\.\\d+$/', ".xxx", XBT_IP_CONVERT($e["ipa"]))) . "</td>\n";
        }
        $htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
        $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . htmlsafechars($upspeed) . "/s</span></td>\n";
        $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'>" . mksize($e["downloaded"]) . "</td>") . "\n";
        $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . htmlsafechars($downspeed) . "/s</span></td>") . "\n";
        $htmlout .= "<td align=\"right\">" . member_ratio($e['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $e['downloaded']) . "</td>\n";
        $htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["left"] / $torrent["size"])) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
        $htmlout .= "<td align='left'>" . htmlsafechars(getagent($e["peer_id"], $e['peer_id'])) . "</td>\n";
        $htmlout .= "</tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
    if ($show_real_chance) {
        $real_chance = $cheat_value + 5;
    } else {
        $real_chance = 6;
    }
    $HTMLOUT .= tr($lang['casino_your_chance'], "1 : " . $real_chance, 1);
    $HTMLOUT .= tr($lang['casino_you_can_win'], $win_amount_on_number . " * stake", 1);
    $HTMLOUT .= tr($lang['casino_bet_on_a_number'], "<input type=\"submit\" value=\"{$lang['casino_do_it']}!\" />", 1);
    $HTMLOUT .= "</table></form><br />";
    //== User stats table
    $HTMLOUT .= "<table cellspacing='0' width='650' cellpadding='3'>";
    $HTMLOUT .= "<tr><td align=\"center\" class=\"colhead\" colspan=\"3\">{$CURUSER['username']}'s {$lang['casino_details']}</td></tr>\n            <tr><td align='center'>\n            <h1>User @ {$INSTALLER09['site_name']} {$lang['casino_stdhead']}</h1>\n            <table class='message' cellspacing='0' cellpadding='5'>";
    $HTMLOUT .= tr($lang['casino_you_can_win'], mksize($max_download_user), 1);
    $HTMLOUT .= tr($lang['casino_won'], mksize($user_win), 1);
    $HTMLOUT .= tr($lang['casino_lost'], mksize($user_lost), 1);
    $HTMLOUT .= tr($lang['casino_ratio'], $casino_ratio_user, 1);
    $HTMLOUT .= tr($lang['casino_deposit_on_p2p'], mksize($user_deposit + $nobits));
    $HTMLOUT .= "</table>\n            </td><td align='center'>\n            <h1>{$lang['casino_global_stats']}</h1>\n            <table class='message' cellspacing='0' cellpadding='5'>";
    $HTMLOUT .= tr($lang['casino_users_can_win'], mksize($max_download_global), 1);
    $HTMLOUT .= tr($lang['casino_won'], mksize($global_win), 1);
    $HTMLOUT .= tr($lang['casino_lost'], mksize($global_lost), 1);
    $HTMLOUT .= tr($lang['casino_ratio'], $casino_ratio_global, 1);
    $HTMLOUT .= tr($lang['casino_deposit'], mksize($global_deposit));
    $HTMLOUT .= "</table>";
    $HTMLOUT .= "</td><td align='center'>\n            <h1>{$lang['casino_user_stats']}</h1>\n            <table class='message' cellspacing='0' cellpadding='5'>";
    $HTMLOUT .= tr($lang['casino_uploaded'], mksize($User['uploaded'] - $nobits));
    $HTMLOUT .= tr($lang['casino_downloaded'], mksize($User['downloaded']));
    $HTMLOUT .= tr($lang['casino_ratio'], $ratio);
    $HTMLOUT .= "</table></td></tr></table>";
}
echo stdhead("{$INSTALLER09['site_name']} {$lang['casino_stdhead']}") . $HTMLOUT . stdfoot();
Beispiel #26
0
        print "<td class=\"colfollow\">" . get_username($row['userid'], false, true, true, false, false, true) . "</td>";
        print "<td class=\"colfollow\">" . ($row['torrent_size'] ? mksize($row['torrent_size']) : "0") . "</td>";
        print "<td class=\"colfollow\">" . $row['torrent_count'] . "</td>";
        print "<td class=\"colfollow\">" . ($row2['added'] ? gettime($row2['added']) : $lang_uploaders['text_not_available']) . "</td>";
        print "<td class=\"colfollow\">" . ($row2['name'] ? "<a href=\"details.php?id=" . $row2['id'] . "\">" . htmlspecialchars($row2['name']) . "</a>" : $lang_uploaders['text_not_available']) . "</td>";
        print "</tr>";
        $hasupuserid[] = $row['userid'];
        unset($row2);
    }
    $res3 = sql_query("SELECT users.id AS userid, users.username AS username, 0 AS torrent_count, 0 AS torrent_size FROM users WHERE class >= " . UC_UPLOADER . (count($hasupuserid) ? " AND users.id NOT IN (" . implode(",", $hasupuserid) . ")" : "") . " ORDER BY username ASC") or sqlerr(__FILE__, __LINE__);
    while ($row = mysql_fetch_array($res3)) {
        $res2 = sql_query("SELECT torrents.id, torrents.name, torrents.added FROM torrents WHERE owner=" . $row['userid'] . " ORDER BY id DESC LIMIT 1");
        $row2 = mysql_fetch_array($res2);
        print "<tr>";
        print "<td class=\"colfollow\">" . get_username($row['userid'], false, true, true, false, false, true) . "</td>";
        print "<td class=\"colfollow\">" . ($row['torrent_size'] ? mksize($row['torrent_size']) : "0") . "</td>";
        print "<td class=\"colfollow\">" . $row['torrent_count'] . "</td>";
        print "<td class=\"colfollow\">" . ($row2['added'] ? gettime($row2['added']) : $lang_uploaders['text_not_available']) . "</td>";
        print "<td class=\"colfollow\">" . ($row2['name'] ? "<a href=\"details.php?id=" . $row2['id'] . "\">" . htmlspecialchars($row2['name']) . "</a>" : $lang_uploaders['text_not_available']) . "</td>";
        print "</tr>";
        $count++;
        unset($row2);
    }
    print "</table>";
    ?>
</div>
<div style="margin-top: 8px; margin-bottom: 8px;">
<span id="order" onclick="dropmenu(this);"><span style="cursor: pointer;" class="big"><b><?php 
    echo $lang_uploaders['text_order_by'];
    ?>
</b></span>
Beispiel #27
0
                $mc1->update_row(false, array('bjlosses' => $update['bjlosses']));
                $mc1->commit_transaction($INSTALLER09['expires']['curuser']);
                $mc1->begin_transaction('user' . $CURUSER['id']);
                $mc1->update_row(false, array('bjlosses' => $update['bjlosses']));
                $mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
            }
            sql_query("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, " . $a['userid'] . ", {$now}, {$msg}, {$subject})");
            $mc1->delete_value('inbox_new_' . $a['userid']);
            $mc1->delete_value('inbox_new_sb_' . $a['userid']);
            sql_query("DELETE FROM blackjack WHERE userid IN (" . sqlesc($CURUSER['id']) . ", " . sqlesc($a['userid']) . ")");
            $HTMLOUT .= "<tr><td align='center'>Your opponent was " . htmlsafechars($a["username"]) . ", he/she had " . htmlsafechars($a['points']) . " points, {$winorlose}.<br /><br /><b><a href='/blackjack.php'>Play again</a></b></td></tr>";
        } else {
            sql_query("UPDATE blackjack SET status = 'waiting', date=" . $now . ", gameover='yes' WHERE userid = " . sqlesc($CURUSER['id']));
            $HTMLOUT .= "<tr><td align='center'>There are no other players, so you'll have to wait until someone plays against you.<br />You will receive a PM with the game results.<br /><br /><b><a href='/blackjack.php'>Back</a></b><br /></td></tr>";
        }
        $HTMLOUT .= "</table></td></tr></table><br />";
        echo stdhead('Blackjack') . $HTMLOUT . stdfoot();
    }
} else {
    $sql = sql_query('SELECT bjwins, bjlosses ' . 'FROM users ' . 'WHERE id = ' . sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
    $User = mysqli_fetch_assoc($sql);
    $User['bjwins'] = (int) $User['bjwins'];
    $User['bjlosses'] = (int) $User['bjlosses'];
    $tot_wins = (int) $User['bjwins'];
    $tot_losses = (int) $User['bjlosses'];
    $tot_games = $tot_wins + $tot_losses;
    $win_perc = $tot_losses == 0 ? $tot_wins == 0 ? "---" : "100%" : ($tot_wins == 0 ? "0" : number_format($tot_wins / $tot_games * 100, 1)) . '%';
    $plus_minus = ($tot_wins - $tot_losses < 0 ? '-' : '') . mksize(($tot_wins - $tot_losses >= 0 ? $tot_wins - $tot_losses : $tot_losses - $tot_wins) * $mb);
    $HTMLOUT .= "<h1>{$INSTALLER09['site_name']} Blackjack</h1>\n\t<table cellspacing='0' cellpadding='3' width='400'>\n\t<tr><td colspan='2' align='center'>\n\t<table class='message' width='100%' cellspacing='0' cellpadding='10' bgcolor='white'>\n\t<tr><td align='center'><img src='{$INSTALLER09['pic_base_url']}cards/tp.bmp' width='71' height='96' border='0' alt='' />&nbsp;<img src='{$INSTALLER09['pic_base_url']}cards/vp.bmp' width='71' height='96' border='0' alt='' /></td></tr>\n\t<tr><td align='left'>You must collect 21 points without going over.<br /><br />\n\t<b>NOTE:</b> By playing blackjack, you are betting 100 MB of upload credit!</td></tr>\n\t<tr><td align='center'>\n\t<form method='post' action='" . $_SERVER['PHP_SELF'] . "'><input type='hidden' name='game' value='hit' readonly='readonly' /><input type='hidden' name='start_' value='yes' readonly='readonly' /><input type='submit' value='Start!' /></form>\n\t</td></tr></table>\n\t</td></tr></table>\n\t<br /><br /><br />\n  <table cellspacing='0' cellpadding='3' width='400'>\n    <tr><td colspan='2' align='center'>\n    <h1>Personal Statistics</h1></td></tr>\n    <tr><td align='left'><b>Wins</b></td><td align='center'><b>" . htmlsafechars($tot_wins) . "</b></td></tr>\n    <tr><td align='left'><b>Losses</b></td><td align='center'><b>" . htmlsafechars($tot_losses) . "</b></td></tr>\n    <tr><td align='left'><b>Games Played</b></td><td align='center'><b>" . htmlsafechars($tot_games) . "</b></td></tr>\n    <tr><td align='left'><b>Win Percentage</b></td><td align='center'><b>" . htmlsafechars($win_perc) . "</b></td></tr>\n    <tr><td align='left'><b>+/-</b></td><td align='center'><b>" . htmlsafechars($plus_minus) . "</b></td></tr>\n    </table>";
    echo stdhead('Blackjack') . $HTMLOUT . stdfoot();
}
Beispiel #28
0
    exit;
}
switch ($do) {
    case "disabled":
        $query = "SELECT id,username, class, downloaded, uploaded, IF(downloaded>0, round((uploaded/downloaded),2), '---') as ratio, disable_reason, added, last_access FROM users WHERE enabled='no' ORDER BY last_access DESC ";
        $title = "Disabled users";
        $link = "<a href=\"staffpanel.php?tool=warn&amp;action=warn&amp;?do=warned\">warned users</a>";
        break;
    case "warned":
        $query = "SELECT id, username, class, downloaded, uploaded, IF(downloaded>0, round((uploaded/downloaded),2), '---') as ratio, warn_reason, warned, added, last_access FROM users WHERE warned>='1' ORDER BY last_access DESC, warned DESC ";
        $title = "Warned users";
        $link = "<a href=\"staffpanel.php?tool=warn&amp;action=warn&amp;do=disabled\">disabled users</a>";
        break;
}
$g = sql_query($query) or print mysql_error();
$count = mysql_num_rows($g);
$HTMLOUT .= begin_main_frame();
$HTMLOUT .= begin_frame($title . "&nbsp;[<font class=\"small\">total - " . $count . " user" . ($count > 1 ? "s" : "") . "</font>] - " . $link);
if ($count == 0) {
    $HTMLOUT .= stdmsg("hey", "There is no " . strtolower($title));
} else {
    $HTMLOUT .= "<form action='staffpanel.php?tool=warn&amp;action=warn' method='post'>\r\n\t\t<table width='600' cellpadding='3' cellspacing='2' style='border-collapse:separate;' align='center'>\r\n\t\t<tr>    \t\r\n\t\t\t<td class='colhead' align='left' width='100%' >User</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'>Ratio</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'>Class</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'>Last access</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'>Joined</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'><input type='checkbox' name='checkall' /></td>\r\n\t\t</tr>";
    while ($a = mysql_fetch_assoc($g)) {
        $tip = $do == "warned" ? "Warned for : " . $a["warn_reason"] . "<br />" . " Warned till " . get_date($a["warned"], 'DATE', 1) . " - " . mkprettytime($a['warned'] - time()) : "Disabled for " . $a["disable_reason"];
        $HTMLOUT .= "<tr>\r\n\t\t\t\t  <td align='left' width='100%'><a href='userdetails.php?id={$a["id"]}' onmouseover=\"Tip('({$tip})')\" onmouseout=\"UnTip()\">{$a["username"]}</a></td>\r\n\t\t\t\t  <td align='left' nowrap='nowrap'>{$a["ratio"]}<br /><font class='small'><b>D: </b>" . mksize($a["downloaded"]) . "&nbsp;<b>U:</b> " . mksize($a["uploaded"]) . "</font></td>\r\n\t\t\t\t  <td align='center' nowrap='nowrap'>" . get_user_class_name($a["class"]) . "</td>\r\n\t\t\t\t  <td align='center' nowrap='nowrap'>" . get_date($a["last_access"], 'LONG', 0, 1) . "</td>\r\n\t\t\t\t  <td align='center' nowrap='nowrap'>" . get_date($a["added"], 'DATE', 1) . "</td>\r\n\t\t\t\t  <td align='center' nowrap='nowrap'><input type='checkbox' name='users[]' value='{$a["id"]}' /></td>\r\n\t\t\t\t</tr>";
    }
    $HTMLOUT .= "<tr>\r\n\t\t\t<td colspan='6' class='colhead' align='center'>\r\n\t\t\t\t<select name='action'>\r\n\t\t\t\t\t<option value='unwarn'>Unwarn</option>\r\n\t\t\t\t\t<option value='disable'>Disable</option>\r\n\t\t\t\t\t<option value='delete'>Delete</option>\r\n\t\t\t\t</select>\r\n\t\t\t\t&raquo;\r\n\t\t\t\t<input type='submit' value='Apply' />\r\n\t\t\t\t<input type='hidden' value='" . htmlspecialchars($_SERVER["REQUEST_URI"]) . "' name='ref' />\r\n\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t</form>";
}
$HTMLOUT .= end_frame();
$HTMLOUT .= end_main_frame();
echo stdhead($title) . $HTMLOUT . stdfoot($stdfoot);
Beispiel #29
0
if (!preg_match("/.*userid=([0-9]+)\\.png\$/i", $_SERVER['REQUEST_URI'])) {
    die;
}
if (!($my_img = $Cache->get_value('userbar_' . $_SERVER['REQUEST_URI']))) {
    $res = sql_query("SELECT username, uploaded, downloaded, class, privacy FROM users WHERE id=" . sqlesc($userid) . " LIMIT 1");
    $row = mysql_fetch_array($res);
    if (!$row) {
        die;
    } elseif ($row['privacy'] == 'strong') {
        die;
    } elseif ($row['class'] < $userbar_class) {
        die;
    } else {
        $username = $row['username'];
        $uploaded = mksize($row['uploaded']);
        $downloaded = mksize($row['downloaded']);
    }
    $my_img = imagecreatefrompng("pic/userbar/" . $bgpic . ".png");
    imagealphablending($my_img, false);
    if (!$_GET['noname']) {
        if (isset($_GET['namered']) && $_GET['namered'] >= 0 && $_GET['namered'] <= 255) {
            $namered = 0 + $_GET['namered'];
        } else {
            $namered = 255;
        }
        if (isset($_GET['namegreen']) && $_GET['namegreen'] >= 0 && $_GET['namegreen'] <= 255) {
            $namegreen = 0 + $_GET['namegreen'];
        } else {
            $namegreen = 255;
        }
        if (isset($_GET['nameblue']) && $_GET['nameblue'] >= 0 && $_GET['nameblue'] <= 255) {
Beispiel #30
0
    if (!empty($_POST["desact"])) {
        sql_query("UPDATE users SET enabled = 'no' WHERE id IN (" . implode(", ", array_map("sqlesc", $_POST["desact"])) . ")") or sqlerr(__FILE__, __LINE__);
    }
}
$HTMLOUT .= "<div class='row'><div class='col-md-12'>";
$HTMLOUT .= "<h2>{$lang['cheaters_users']}</h2>";
$res = sql_query("SELECT COUNT(*) FROM cheaters") or sqlerr(__FILE__, __LINE__);
$row = mysqli_fetch_array($res);
$count = $row[0];
$perpage = 15;
$pager = pager($perpage, $count, "staffpanel.php?tool=cheaters&amp;action=cheaters&amp;");
$HTMLOUT .= "<form action='staffpanel.php?tool=cheaters&amp;action=cheaters' method='post'>\n<script type='text/javascript'>\n/*<![CDATA[*/\nfunction klappe(id)\n{var klappText=document.getElementById('k'+id);var klappBild=document.getElementById('pic'+id);if(klappText.style.display=='none'){klappText.style.display='block';}\nelse{klappText.style.display='none';}}\nfunction klappe_news(id)\n{var klappText=document.getElementById('k'+id);var klappBild=document.getElementById('pic'+id);if(klappText.style.display=='none'){klappText.style.display='block';klappBild.src='{$INSTALLER09['pic_base_url']}minus.gif';}\nelse{klappText.style.display='none';klappBild.src='{$INSTALLER09['pic_base_url']}plus.gif';}}\t\n</script>\n<script type='text/javascript'>\nvar checkflag = 'false';\nfunction check(field) {\nif (checkflag == 'false') {\nfor (i = 0; i < field.length; i++) {\nfield[i].checked = true;}\ncheckflag = 'true';\nreturn 'Uncheck All Disable'; }\nelse {\nfor (i = 0; i < field.length; i++) {\nfield[i].checked = false; }\ncheckflag = 'false';\nreturn 'Check All Disable'; }\n}\nfunction check2(field) {\nif (checkflag == 'false') {\nfor (i = 0; i < field.length; i++) {\nfield[i].checked = true;}\ncheckflag = 'true';\nreturn 'Uncheck All Remove'; }\nelse {\nfor (i = 0; i < field.length; i++) {\nfield[i].checked = false; }\ncheckflag = 'false';\nreturn 'Check All Remove'; }\n}\n/*]]>*/\n</script>";
if ($count > $perpage) {
    $HTMLOUT .= $pager['pagertop'];
}
$HTMLOUT .= "<table class='table table-bordered'>\n<tr>\n<td>#</td>\n<td>{$lang['cheaters_uname']}</td>\n<td>{$lang['cheaters_d']}</td>\n<td>{$lang['cheaters_r']}</td></tr>\n";
$res = sql_query("SELECT c.id as cid, c.added, c.userid, c.torrentid, c.client, c.rate, c.beforeup, c.upthis, c.timediff, c.userip, u.id, u.username, u.class, u.downloaded, u.uploaded, u.chatpost, u.leechwarn, u.warned, u.pirate, u.king, u.donor, u.enabled, t.id AS tid, t.name AS tname FROM cheaters AS c LEFT JOIN users AS u ON u.id=c.userid LEFT JOIN torrents AS t ON t.id=c.torrentid ORDER BY added DESC " . $pager['limit']) or sqlerr(__FILE__, __LINE__);
while ($arr = mysqli_fetch_assoc($res)) {
    $torrname = htmlsafechars(CutName($arr["tname"], 80));
    $users = $arr;
    $users['id'] = (int) $arr['userid'];
    $cheater = "<b><a href='{$INSTALLER09['baseurl']}/userdetails.php?id=" . (int) $arr['id'] . "'>" . format_username($users) . "</a></b>{$lang['cheaters_hbcc']}<br />\n    <b>{$lang['cheaters_torrent']} <a href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $arr['tid'] . "' title='{$torrname}'>{$torrname}</a></b>\n<br />{$lang['cheaters_upped']} <b>" . mksize((int) $arr['upthis']) . "</b><br />{$lang['cheaters_speed']} <b>" . mksize((int) $arr['rate']) . "/s</b><br />{$lang['cheaters_within']} <b>" . (int) $arr['timediff'] . " {$lang['cheaters_sec']}</b><br />{$lang['cheaters_uc']} <b>" . htmlsafechars($arr['client']) . "</b><br />{$lang['cheaters_ipa']} <b>" . htmlsafechars($arr['userip']) . "</b>";
    $HTMLOUT .= "<tr><td>" . (int) $arr['cid'] . "</td>\n    <td>" . format_username($users) . "<a href=\"javascript:klappe('a1" . (int) $arr['cid'] . "')\"> {$lang['cheaters_added']}" . get_date($arr['added'], 'DATE') . "</a>\n    <div id=\"ka1" . (int) $arr['cid'] . "\" style=\"display: none;\"><font color=\"black\">{$cheater}</font></div></td>\n    <td><input type=\"checkbox\" name=\"desact[]\" value=\"" . (int) $arr["id"] . "\"/></td>\n    <td><input type=\"checkbox\" name=\"remove[]\" value=\"" . (int) $arr["cid"] . "\"/></td></tr>";
}
$HTMLOUT .= "<tr>\n<td>\n<input type=\"button\" value=\"{$lang['cheaters_cad']}\" onclick=\"this.value=check(this.form.elements['desact[]'])\"/> <input type=\"button\" value=\"{$lang['cheaters_car']}\" onclick=\"this.value=check(this.form.elements['remove[]'])\"/> <input type=\"hidden\" name=\"nowarned\" value=\"nowarned\" /><input type=\"submit\" name=\"submit\" value=\"{$lang['cheaters_ac']}\" />\n</td>\n</tr>\n</table></form>";
if ($count > $perpage) {
    $HTMLOUT .= $pager['pagerbottom'];
}
$HTMLOUT .= "</div></div>";
echo stdhead($lang['cheaters_stdhead']) . $HTMLOUT . stdfoot();
die;