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 = prefixed(($a[wins] - $a[losses]) * 100 * 1024 * 1024); } else { $plus_minus = "-"; $plus_minus .= prefixed(($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(); }
function peer_list($array) { ?> <table width="100%" border="1" cellpadding="5" style="border-collapse:collapse"> <tr> <td align="center" class="colhead">User</td> <td align="center" class="colhead">Port&Ip</td> <td align="center" class="colhead">Ratio</td> <td align="center" class="colhead">Downloaded</td> <td align="center" class="colhead">Uploaded</td> <td align="center" class="colhead">Started</td> <td align="center" class="colhead">Finished</td> </tr> <?php foreach ($array as $p) { $time = max(1, time() - $p["started"] - (time() - $p["last_action"])); ?> <tr> <td align="center"><a href="userdetails.php?id=<?php echo $p["p_uid"]; ?> " ><?php echo $p["p_user"]; ?> </a></td> <td align="center"><?php echo get_user_class() >= UC_MODERATOR ? $p["ip"] . ":" . $p["port"] : "xx.xx.xx.xx:xxxx"; ?> </td> <td align="center"><?php echo $p["downloaded"] > 0 ? number_format($p["uploaded"] / $p["downloaded"], 2) : ($p["uploaded"] > 0 ? "∞" : "---"); ?> </td> <td align="center"><?php echo $p["downloaded"] > 0 ? prefixed($p["downloaded"]) . " @" . prefixed(($p["downloaded"] - $p["downloadoffset"]) / $time) . "s" : "0kb"; ?> </td> <td align="center"><?php echo $p["uploaded"] > 0 ? prefixed($p["uploaded"]) . " @" . prefixed(($p["uploaded"] - $p["uploadoffset"]) / $time) . "s" : "0kb"; ?> </td> <td align="center"><?php echo date("d-M/Y H:i", $p["started"]); ?> </td> <td align="center"><?php echo date("d-M/Y H:i", $p["finishedat"]); ?> </td> </tr> <?php } print "</table>"; }
function maketable($res) { global $CURUSER; $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>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)) { $ratio = $CURUSER['downloaded'] > 0 ? $CURUSER['uploaded'] / $CURUSER['downloaded'] : 0; $ratio = number_format($ratio, 3); $color = get_ratio_color($ratio); if ($color) { $ratio = "<font color={$color}>{$ratio}</font>"; } $catimage = safeChar($arr["image"]); $catname = safeChar($arr["catname"]); $size = str_replace(" ", "<br>", prefixed($arr["size"])); $uploaded = str_replace(" ", "<br>", prefixed($arr["uploaded"])); $downloaded = str_replace(" ", "<br>", prefixed($arr["downloaded"])); $seeders = number_format($arr["seeders"]); $leechers = number_format($arr["leechers"]); $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']}&hit=1><b>" . safeChar($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"; } $ret .= "</table>\n"; return $ret; }
function insert_compose_frame($id, $newtopic = true, $quote = false, $attachment = false) { global $maxsubjectlength, $CURUSER, $max_torrent_size, $maxfilesize, $pic_base_url, $use_attachment_mod, $forum_pics, $DEFAULTBASEURL; if ($newtopic) { $res = sql_query("SELECT name FROM forums WHERE id = " . sqlesc($id)) or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_assoc($res) or die("Bad forum ID!"); ?> <h3>New topic in <a href='<?php echo $_SERVER['PHP_SELF']; ?> ?action=viewforum&forumid=<?php echo $id; ?> '><?php echo safeChar($arr["name"]); ?> </a> forum</h3><?php } else { $res = sql_query("SELECT subject, locked FROM topics WHERE id = " . sqlesc($id)) or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_assoc($res) or die("Forum error, Topic not found."); if ($arr['locked'] == 'yes') { stdmsg("Sorry", "The topic is locked."); end_table(); end_main_frame(); stdfoot(); exit; } ?> <h3 align="center"><?php echo $language['replyto']; ?> <a href='<?php echo $_SERVER['PHP_SELF']; ?> action=viewtopic&topicid=<?php echo $id; ?> '><?php echo safeChar($arr["subject"]); ?> </a></h3><?php } begin_frame("Compose", true); ?> <form method='post' name='compose' action='<?php echo $_SERVER['PHP_SELF']; ?> ' enctype='multipart/form-data'> <input type="hidden" name="action" value="post" /> <input type='hidden' name='<?php echo $newtopic ? 'forumid' : 'topicid'; ?> ' value='<?php echo $id; ?> ' /><?php begin_table(true); if ($newtopic) { ?> <tr> <td class='rowhead' width="10%">Subject</td> <td align='left'> <input type='text' size='100' maxlength='<?php echo $maxsubjectlength; ?> ' name='subject' style='height: 19px' /> </td> </tr><?php } if ($quote) { $postid = (int) $_GET["postid"]; if (!is_valid_id($postid)) { stdmsg("Error", "Invalid ID!"); end_table(); end_main_frame(); stdfoot(); exit; } $res = sql_query("SELECT posts.*, users.username FROM posts JOIN users ON posts.userid = users.id WHERE posts.id = {$postid}") or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($res) == 0) { stdmsg("Error", "No post with this ID"); end_table(); end_main_frame(); stdfoot(); exit; } $arr = mysql_fetch_assoc($res); } ?> <tr> <td class='rowhead' width="10%">Body</td> <td><?php $qbody = $quote ? "[quote=" . safeChar($arr["username"]) . "]" . safeChar(unesc($arr["body"])) . "[/quote]" : ''; if (function_exists('textbbcode')) { textbbcode("compose", "body", $qbody); } else { ?> <textarea name="body" style="width:99%" rows="7"><?php echo $qbody; ?> </textarea><?php } if ($use_attachment_mod && $attachment) { ?> <tr> <td colspan='2'><fieldset class="fieldset"><legend>Add attachment</legend> <input type='checkbox' name='uploadattachment' value='yes' /> <input type="file" name="file" size="60" /> <div class='error'>Allowed files: rar, zip<br />Max file size: <?php echo prefixed($maxfilesize); ?> </div></fieldset> </td> </tr><?php } ?> <tr> <td align=center colspan=2> <?php echo post_icons(); ?> </td> </tr> <tr> <td colspan='2' align='center'> <input type='submit' value='Submit' /> </td> </tr> </td> </tr><?php end_table(); ?> </form><?php end_frame(); // ------ Get 10 last posts if this is a reply if (!$newtopic) { $postres = sql_query("SELECT p.id, p.added, p.body, u.id AS uid, u.username, u.avatar " . "FROM posts AS p " . "LEFT JOIN users AS u ON u.id = p.userid " . "WHERE p.topicid = " . sqlesc($id) . " " . "ORDER BY p.id DESC LIMIT 10") or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($postres) > 0) { ?> <br /><?php begin_frame("Last 10 post's in reverse order"); while ($post = mysql_fetch_assoc($postres)) { $avatar = $CURUSER["avatars"] == "yes" ? safeChar($post["avatar"]) : ''; if (empty($avatar)) { $avatar = $pic_base_url . $forum_pics['default_avatar']; } ?> <p class=sub>#<?php echo $post["id"]; ?> by <?php echo !empty($post["username"]) ? $post["username"] : "******"; ?> at <?php echo $post["added"]; ?> GMT</p><?php begin_table(true); ?> <tr> <td height='100' width='100' align='center' style='padding: 0px' valign="top"><img height='100' width='100' src="<?php echo $avatar; ?> " /></td> <td class='comment' valign='top'><?php echo format_comment($post["body"]); ?> </td> </tr><?php end_table(); } end_frame(); } } insert_quick_jump_menu(); }
function doslowcleanup() { global $SITENAME, $DEFAULTBASEURL, $torrent_dir, $autoslowclean_interval, $READPOST_EXPIRY, $CACHE, $queries, $query_stat, $torrent_dir, $tdeadtime, $delaccounts, $oldtorrents, $slotduration, $max_dead_torrent_time, $max_dead_topic_time, $max_dead_user_time, $ad_ratio, $ap_time, $ap_limit, $ap_ratio, $torrent_ttl; set_time_limit(1200); $result = mysql_query("show processlist") or sqlerr(__FILE__, __LINE__); while ($row = mysql_fetch_array($result)) { if ($row["Time"] > 100 || $row["Command"] == "Sleep") { $sql = "kill " . $row["Id"] . ""; mysql_query($sql) or sqlerr(__FILE__, __LINE__); } } ignore_user_abort(1); if ($delaccounts) { // delete inactive user accounts $dt = sqlesc(get_date_time(gmtime() - $max_dead_user_time)); $maximumclass = UC_POWER_USER; sql_query("DELETE FROM users WHERE status='confirmed' AND parked='no' AND class <= {$maximumclass} AND last_access < {$dt}"); } // == Updated promote power users $limit = 25 * 1024 * 1024 * 1024; $res = sql_query("SELECT id, uploaded, downloaded FROM users WHERE class = 0 AND uploaded >= {$limit} AND uploaded / downloaded >= {$ap_ratio} AND enabled='yes' and added < DATE_SUB(NOW(), INTERVAL 28 DAY)") or sqlerr(__FILE__, __LINE__); $msgs_buffer = $users_buffer = array(); if (mysql_num_rows($res) > 0) { $msg = "Congratulations, you have been Auto-Promoted to [b]Power User[/b]. :)\n You can enter the casino your account wont get deleted automatically and you get one extra invite :).\n"; while ($arr = mysql_fetch_assoc($res)) { $ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3); $modcomment = sqlesc(gmdate("Y-m-d H:i") . " - Promoted to Power User by System (UL=" . prefixed($arr['uploaded']) . ", DL=" . prefixed($arr['downloaded']) . ", R=" . $ratio . ") \n"); $msgs_buffer[] = '(0,' . $arr['id'] . ',NOW(), ' . sqlesc($msg) . ', \'Promotion\')'; $users_buffer[] = '(' . $arr['id'] . ',1,1,' . $modcomment . ')'; } if (sizeof($msgs_buffer) > 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__); $count = mysql_affected_rows(); write_log("promotion", "Delayed Cleanup: Promoted " . $count / 2 . " member(s) from User to Power User"); } unset($users_buffer); unset($msgs_buffer); status_change($arr['id']); } // == Updated demote power users $res = sql_query("SELECT id, uploaded, downloaded FROM users WHERE class = 1 AND uploaded / downloaded < {$ad_ratio}") or sqlerr(__FILE__, __LINE__); $msgs_buffer = $users_buffer = array(); if (mysql_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 < {$ad_ratio}.\n"; while ($arr = mysql_fetch_assoc($res)) { $ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3); $modcomment = sqlesc(gmdate("Y-m-d H:i") . " - Demoted To User by System (UL=" . prefixed($arr['uploaded']) . ", DL=" . prefixed($arr['downloaded']) . ", R=" . $ratio . ") \n"); $msgs_buffer[] = '(0,' . $arr['id'] . ',NOW(), ' . sqlesc($msg) . ', \'Demotion\')'; $users_buffer[] = '(' . $arr['id'] . ',0,' . $modcomment . ')'; } if (sizeof($msgs_buffer) > 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),\nmodcomment=concat(values(modcomment),modcomment)") or sqlerr(__FILE__, __LINE__); $count = mysql_affected_rows(); write_log("demotion", "Delayed Cleanup: Demoted " . $count / 2 . " member(s) from Power User to User"); status_change($arr['id']); } unset($users_buffer); unset($msgs_buffer); } // ////////////////////end// // ///////////////////////happyhour//// $f = "{$CACHE}/happyhour.txt"; //$f = "C://AppServ/www/happyhour.txt"; $happy = unserialize(file_get_contents($f)); $happyHour = strtotime($happy["time"]); $curDate = time(); $happyEnd = $happyHour + 3600; if ($happy["status"] == 0) { write_log("happyhour", "Happy hour was @ " . date("Y-m-d H:i", $happyHour) . " and Catid " . $happy["catid"] . " "); happyFile("set"); } elseif ($curDate > $happyEnd && $happy["status"] == 1) { happyFile("reset"); } // ////////////end/////// // Remove userprofile views $days = 7; $dt = sqlesc(get_date_time(gmtime() - $days * 68400)); mysql_query("DELETE FROM userhits WHERE added < {$dt}"); // //////////////////reset ips///// $secs = 24 * 60 * 60; // 24Hours * 60 minutes * 60 seconds... $dt = sqlesc(get_date_time(gmtime() - $secs)); mysql_query("UPDATE users SET ip = '' WHERE last_access < {$dt}"); // Remove expired readposts... $dt = sqlesc(get_date_time(gmtime() - $READPOST_EXPIRY)); sql_query("DELETE readposts FROM readposts " . "LEFT JOIN posts ON readposts.lastpostread = posts.id " . "R .added < {$dt}"); write_log("slowautoclean", " -------------------- Delayed cleanup Complete using {$queries} queries --------------------"); }
// ////////End poster mod // ////////////recommeded torrents/////////////// if ($CURUSER['rohp'] == "yes") { echo "<table width=754><tr><td class=\"colhead\" colspan=\"4\"><h2>" . $language['rtor'] . "</h2></td></tr>"; $res1 = mysql_query("SELECT torrents.id AS torrentid, torrents.size, torrents.name, torrents.filename, torrents.leechers, torrents.seeders, torrents.times_completed, torrents.poster, torrents.countstats, torrents.owner, users.username AS username, users.class AS class FROM torrents INNER JOIN users ON torrents.owner = users.id WHERE torrents.recommended='yes' ORDER BY torrents.times_completed DESC LIMIT 4"); if (mysql_num_rows($res1) > 0) { echo "<tr>"; while ($arr1 = mysql_fetch_assoc($res1)) { $dispname = trim($arr1["name"]); if (strlen($dispname) > 30) { $torlinkalt = " title=\"{$dispname}\""; $dispname = substr($dispname, 0, 30) . "..."; } else { $torlinkalt = " title=\"{$dispname}\""; } echo "<td width=\"188px\" align=\"center\"" . ($arr1['countstats'] == "no" ? " style='background-color:green'" : ($arr1['countstats'] == "yes" ? " style='background-color:orange'" : "")) . ">\n<br />\n<strong><a href=\"./details.php?id={$arr1['torrentid']}&hit=1\"{$torlinkalt}><img src=\"" . safeChar($arr1['poster']) . "\" border=\"0\" width=\"100\" height=\"120\"></a></strong>\n<br />\n<strong><a href=\"./details.php?id={$arr1['torrentid']}&hit=1\"{$torlinkalt}>" . safeChar($dispname) . "</a></strong><br /><br />\n<strong><a href=\"./details.php?id={$arr1['torrentid']}&dllist=1#seeders\"><font color=yellow>Seeders " . safeChar($arr1['seeders']) . "</font> <font color=red>Leechers " . safeChar($arr1['leechers']) . "</font></a></strong><br />\n<strong><em>Size:</em></strong> " . safeChar(prefixed($arr1['size'])) . "<br />\n</td>"; } } echo "</tr></table><br />"; mysql_free_result($res1); unset($arr1); } // //////////////////////////////////////// // /////////////Birthday cache/////////////////////////////////// $file2 = "{$CACHE}/birthday.txt"; $expire = 21600; // 6 hours if (file_exists($file2) && filemtime($file2) > time() - $expire) { $res3 = unserialize(file_get_contents($file2)); } else { $today = date("'%'-m-d");
$res1 = sql_query("INSERT INTO messages (sender, poster, receiver, subject, msg, added) VALUES (0, 0, {$CURUSER['id']}, " . sqlesc($subject) . ", " . sqlesc($msg) . ", '" . get_date_time() . "')") or sqlerr(__FILE__, __LINE__); if (!$res) { stderr("Error", "It appears that something went wrong while trying to add 10% to your upload amount."); } else { stderr("10% Added", "Your total upload amount has been increased by 10% from <b>" . prefixed($uploaded) . "</b> to <b>" . prefixed($newuploaded) . "</b>, which brings your ratio to <b>{$newratio}</b>."); } } stdhead(""); echo "<h1>10%</h1>\n"; if ($CURUSER["tenpercent"] == "yes") { echo "<h2>It appears that you have already used your 10% addition</h2>\n"; } echo "<p><table width=700 border=0 cellspacing=0 cellpadding=5><tr><td\n"; echo "<table width=700 border=0 cellspacing=0 cellpadding=10><tr><td style='padding-bottom: 0px'>\n"; echo "<p><b>How it works:</b></p>"; echo "<p class=sub>From this page you can <b>add 10%</b> of your current upload amount to your upload amount bringing it it to <b>110%</b> of its current amount. More details about how this would work out for you can be found in the tables below.</p>"; echo "<br><p><b>However, there are some things you should know first:</b></p>"; echo "<li>This can only be done <b>once</b>, so chose your moment wisely."; echo "<li>The staff will <b>not</b> reset your 10% addition for any reason."; echo "</td></tr></table>\n"; echo "</td></tr></table></p>\n"; echo "<p><table width=630 class=main align=center border=0 cellspacing=0 cellpadding=5>\n"; echo "<tr><td class=normalrowhead>Current upload amount:</td><td class=normal>" . str_replace(" ", " ", prefixed($uploaded)) . "</td><td class=embedded width=5%></td><td class=normalrowhead>Increase:</td><td class=normal>" . str_replace(" ", " ", prefixed($newuploaded - $uploaded)) . "</td><td class=embedded width=5%></td><td class=normalrowhead>New upload amount:</td><td class=normal>" . str_replace(" ", " ", prefixed($newuploaded)) . "</td></tr>\n"; echo "<tr><td class=normalrowhead>Current download amount:</td><td class=normal>" . str_replace(" ", " ", prefixed($downloaded)) . "</td><td class=embedded width=5%></td><td class=normalrowhead>Increase:</td><td class=normal>" . str_replace(" ", " ", prefixed(0)) . "</td><td class=embedded width=5%></td><td class=normalrowhead>New download amount:</td><td class=normal>" . str_replace(" ", " ", prefixed($downloaded)) . "</td></tr>\n"; echo "<tr><td class=normalrowhead>Current ratio:</td><td class=normal>{$ratio}</td><td class=embedded width=5%></td><td class=normalrowhead>Increase:</td><td class=normal>{$ratiochange}</td><td class=embedded width=5%></td><td class=normalrowhead>New ratio:</td><td class=normal>{$newratio}</td></tr>\n"; echo "</table></p>\n"; echo "<p><table align=center border=0 cellspacing=0 cellpadding=5><form name=tenpercent method=post action=tenpercent.php>\n"; echo "<tr><td align=center><b>Yes please </b><input type=checkbox name=sure value=yes onclick='if (this.checked) enablesubmit(); else disablesubmit();'></td></tr>\n"; echo "<tr><td align=center><input type=submit name=submit value='Add 10%' class=btn disabled></td></tr>\n"; echo "</form></table></p>\n"; stdfoot();
echo "<table cellpadding=4 align=center border=1>"; echo "<tr>"; echo "<td class=colhead>Num</td>"; echo "<td class=colhead>Username</td>"; echo "<td class=colhead>Upped / Downed</td>"; echo "<td class=colhead>Ratio</td>"; echo "<td class=colhead>Num torrents</td>"; echo "<td class=colhead>Last upload</td>"; echo "<td class=colhead>Send PM</td>"; echo "</tr>"; for ($i = 0; $i <= $zerofix; $i++) { $id = mysql_result($result, $i, "id"); $username = mysql_result($result, $i, "username"); $added = mysql_result($result, $i, "added"); $uploaded = prefixed(mysql_result($result, $i, "uploaded")); $downloaded = prefixed(mysql_result($result, $i, "downloaded")); $uploadedratio = mysql_result($result, $i, "uploaded"); $downloadedratio = mysql_result($result, $i, "downloaded"); $donor = mysql_result($result, $i, "donor"); $warned = mysql_result($result, $i, "warned"); // get uploader torrents activity $upperquery = "SELECT added FROM torrents WHERE owner = {$id}"; $upperresult = mysql_query($upperquery); $torrentinfo = mysql_fetch_array($upperresult); $numtorrents = mysql_num_rows($upperresult); if ($downloaded > 0) { $ratio = $uploadedratio / $downloadedratio; $ratio = number_format($ratio, 3); $color = get_ratio_color($ratio); if ($color) { $ratio = "<font color={$color}>{$ratio}</font>";
<?php // CyBerFuN.Ro // By CyBerNe7 // // // http://cyberfun.ro/ // http://xlist.ro/ header("Content-Type: text/html; charset=iso-8859-1"); require_once "include/bittorrent.php"; dbconn(); if (!logged_in()) { header("HTTP/1.0 404 Not Found"); // moddifed logginorreturn by retro//Remember to change the following line to match your server print "<html><h1>Not Found</h1><p>The requested URL /{$_SERVER['PHP_SELF']} was not found on this server.</p><hr /><address>Apache/1.1.11 " . $SITENAME . " Server at " . $_SERVER['SERVER_NAME'] . " Port 80</address></body></html>\n"; die; } $id = 0 + $_GET["id"]; $s = "<table width=500 class=colorss class=main border=\"1\" cellspacing=0 cellpadding=\"5\">\n"; $subres = sql_query("SELECT * FROM files WHERE torrent = {$id} ORDER BY id"); $s .= "<tr><td width=500 class=colhead>Type</td><td class=colhead>Path</td><td class=colhead align=right>Size</td></tr>\n"; while ($subrow = mysql_fetch_array($subres)) { preg_match('/\\.([A-Za-z0-9]+)$/', $subrow["filename"], $ext); $ext = strtolower($ext[1]); if (!file_exists("pic/icons/" . $ext . ".png")) { $ext = "Unknown"; } $s .= "<tr><td align\"center\"><img align=center src=\"pic/icons/" . $ext . ".png\" alt=\"{$ext} file\"></td><td class=tableb2 width=700>" . safeChar($subrow["filename"]) . "</td><td align=\"right\">" . prefixed($subrow["size"]) . "</td></tr>\n"; } $s .= "</table>\n"; echo $s;
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 = '---'; } } if ($arr["status"] == 'confirmed') { $status = "<font color=#1f7309>Confirmed</font>"; } else { $status = "<font color=#ca0226>Pending</font>"; } echo '<tr class=tableb>' . $user . '<td align=center>' . prefixed($arr['uploaded']) . '</td><td align=center>' . prefixed($arr['downloaded']) . '</td><td align=center>' . $ratio . '</td><td align=center>' . $status . '</td>'; if ($arr['status'] == 'pending') { echo '<td align=center><a href=?do=confirm_account&userid=' . (int) $arr['id'] . '&sender=' . (int) $CURUSER['id'] . '><img src=pic/confirm.png border=0 /></a></td>'; } else { echo '<td align=center>---</td>'; } } } echo '</table><br>'; $select = sql_query("SELECT * FROM invite_codes WHERE sender = " . sqlesc($CURUSER['id']) . " AND status = 'Pending'") or sqlerr(); $num_row = mysql_num_rows($select); print "<table border=1 width=750 cellspacing=0 cellpadding=5>" . "<tr class=tabletitle><td colspan=6 class=colhead><b>Created Invite Codes</b></td></tr>"; if (!$num_row) { echo '<tr class=tableb><td colspan=6>You have not created invite codes at the moment!</tr>'; } else { echo '<tr class=tableb><td><b>Invite Code</b></td><td><b>Created Date</b></td><td><b>Delete</b></td><td><b>Status</b></tr>';
function getStats($user, $forced = false) { global $_settings, $countries; if (!file_exists($_settings . $user . ".set") || !is_array($var = unserialize(file_get_contents($_settings . $user . ".set")))) { return false; } $q = mysql_query("SELECT u.id,u.last_login, u.reputation,u.uploaded,u.downloaded,u.country,u.agent,u.hits,u.uptime, count(p.id) as posts ,count(c.id) as comments FROM users as u LEFT JOIN posts as p ON u.id = p.userid LEFT JOIN comments as c ON c.user = u.id WHERE u.username = "******" GROUP BY u.id") or die('Error Error Error!'); if (mysql_num_rows($q) != 1) { die('Error Error Error!'); } $a = mysql_fetch_assoc($q); $ops = array($var['line1']['value'], $var['line2']['value'], $var['line3']['value']); $i = 1; foreach ($ops as $op) { switch ($op) { case 1: $var['line' . $i]['value_p'] = $a['posts'] . " post" . ($a['posts'] > 1 ? "s" : ""); break; case 2: #$var['line'.$i]['value_p'] = mksize($a['downloaded']) . " - " . mksize($a['uploaded']); $var['line' . $i]['value_p'] = prefixed($a['downloaded']) . " - " . prefixed($a['uploaded']); break; case 3: #list($days,$hours,$mins) = explode(",",calctime($a['onirct'])); #$var['line'.$i]['value_p'] = "$days days - $hours hours"; $var['line' . $i]['value_p'] = "not yet"; break; case 4: $var['line' . $i]['value_p'] = $a['reputation'] . " point" . ($a['reputation'] > 1 ? "s" : ""); break; case 5: foreach ($countries as $c) { if ($c['id'] == $a['country']) { $var['line' . $i]['value_p'] = $c; } } break; case 6: $var['line' . $i]['value_p'] = $a['comments'] . " comment" . ($a['comments'] > 1 ? "s" : ""); break; case 7: $var['line' . $i]['value_p'] = $a['agent']; break; case 8: $var['line' . $i]['value_p'] = $a['hits'] . " hit" . ($a['hits'] > 1 ? "s" : ""); break; case 9: $lapsetime = ($lapsetime = time() - sql_timestamp_to_unix_timestamp($a["last_login"])) / 3600 % 24 . ' h ' . $lapsetime / 60 % 60 . ' min ' . $lapsetime % 60 . ' s'; $var['line' . $i]['value_p'] = $lapsetime; break; } $i++; } if (is_writable($_settings . $user . ".set")) { file_put_contents($_settings . $user . ".set", serialize($var)); } else { exit("Can't write user setting"); } if (file_exists($_settings . $user . ".png")) { unlink($_settings . $user . ".png"); } return $var; }
} ?> ] Half Download [ <?php if ($hdown_enabled) { echo "<font color=\"darkgreen\"><strong>ON </strong></font>" . date("d/m", $hdown_start_time) . " - " . date("d/m", $hdown_end_time); } else { echo "<font color=\"" . $hcolor . "\"><strong>" . $hstatus . "</strong></font>"; } ?> ] <?php begin_frame(); $uploaded = $CURUSER['uploaded']; echo '<table align=center width=756 border=1 cellspacing=0 cellpadding=5><tr><td class=colhead2 colspan=4>' . '<h1>' . $SITENAME . ' Karma Bonus Point system:</h1></td></tr><tr><td align=center colspan=4 class=clearalt6>' . 'Exchange your <a class=altlink href=mybonus.php>Karma/Upload Bonus Points</a> [ current ' . $bonus . '/' . prefixed($uploaded) . ' ] for goodies!' . '<br><br>[ If no buttons appear, you have not earned enough bonus points to trade. ]<br><br><tr>' . '<td class=colhead2 align=left>Description</td>' . '<td class=colhead2 align=center>Points</td><td class=colhead2 align=center>Trade</td></tr>'; $res = sql_query("SELECT * FROM bonus WHERE enabled = 'yes' ORDER BY id ASC"); while ($gets = mysql_fetch_assoc($res)) { //=======change colors $count1 = ++$count1 % 2; $class = 'clearalt' . ($count1 == 0 ? '6' : '7'); $otheroption = "<table width=100%><tr><td class={$class}><b>Username:</b><input type=text name=username size=20 maxlength=24></td><td class={$class}> <b>to be given: </b><select name=bonusgift> <option value=100.0> 100.0</option> <option value=200.0> 200.0</option> <option value=300.0> 300.0</option> <option value=400.0> 400.0</option><option value=500.0> 500.0</option><option value=1000.0> 1000.0</option></select> Karma points!</td></tr></table>"; $otheroption2 = "<table width=100%><tr><td class={$class}><b>Username:</b><input type=text name=username size=20 maxlength=24></td><td class={$class}> <b>Amount:</b><input type=text name=amnt size=8 maxlength=24><select name=unit> <option value=2> GB</option></select></td></tr></table>"; $otheroption_title = "<input type=text name=title size=30 maxlength=30>"; $otheroption_donate = "<input type=text name=donate size=10 maxlength=10>"; echo '<form action=mybonus.php?exchange=1 method=post>'; switch (true) { case $gets['id'] == 5: echo '<tr><td align=left class=' . $class . '><h1><font color="#CECFF3">' . $gets['bonusname'] . '</font></h1>' . $gets['description'] . '<br><br>Enter the <b>Special Title</b> you would like to have ' . $otheroption_title . ' click Exchange! </td><td align=center class=' . $class . '>' . $gets['points'] . '</td>'; break; case $gets['id'] == 7:
if ($_GET["done"] == "yes") { $add = "AND addbookmark='ratio'"; } elseif ($_GET["done"] == "no") { $add = "AND addbookmark='no'"; } else { $add = "AND addbookmark='no'"; } $res = mysql_query("SELECT * FROM users WHERE uploaded / downloaded <= 0.70 AND enabled = 'yes' AND immun='no' AND added < {$wdt} {$add} ORDER BY (uploaded/downloaded) ASC") or sqlerr(__FILE__, __LINE__); echo "<table><tr><h1>" . ($_GET["done"] == "yes" ? "already bookmarked" : "not yet bookmarked") . " Bad Ratio User:</h1></tr>"; echo "" . ($_GET["done"] == "yes" ? "<table><tr style=\"border:none;\"><td style=\"border:none;\"><a href=\"" . $_SERVER['PHP_SELF'] . "?done=no\">show non bookmarked users</a></td></tr></table><br />" : "<table><tr style=\"border:none;\"><td style=\"border:none;\"><a href=\"" . $_SERVER['PHP_SELF'] . "?done=yes\">show bookmarked</a></td></tr></table><br />") . ""; if (mysql_num_rows($res) == 0) { echo "<table><tr><td class=colhead><font size=3>Cant believe the list is empty!</font></td></tr></table>"; } else { echo "<table width=550><tr><td class=colhead>Member</td><td class=colhead>Time until incl.</td><td class=colhead>Upload</td><td class=colhead>Download</td><td class=colhead>Ratio</td><td class=colhead>last activity</td></tr>"; while ($row = mysql_fetch_assoc($res)) { if ($row["downloaded"] > 0) { $ratio = number_format($row["uploaded"] / $row["downloaded"], 3); $ratio = "<font color=" . get_ratio_color($ratio) . ">{$ratio}</font>"; } else { if ($row["uploaded"] > 0) { $ratio = "Inf."; } else { $ratio = "---"; } } echo "<tr><td><a href=\"javascript:ajaxpage('inpagebadratio.php?id=" . $row["id"] . "', 'badratio');\">" . $row["username"] . "</a></td><td>" . ($row["addbookmark"] == "ratio" ? "" . substr($row["bookmcomment"], -10, 10) . "" : "not bookmarked") . "</td><td>" . prefixed($row["uploaded"]) . "</td><td>" . prefixed($row["downloaded"]) . "</td><td>" . $ratio . "</td><td>" . date("d.m.Y - H:i:s", strtotime($row["last_access"])) . "</td></tr>"; } echo "</table>"; echo "<div id=\"badratio\"></div>"; } stdfoot();
// ===use this line if you DO NOT HAVE subject in your PM system // mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES(0, 0, $row[userid], '" . get_date_time() . "', " . sqlesc($pn_msg) . ")") or sqlerr(__FILE__, __LINE__); } // === delete all offer stuff @mysql_query("DELETE FROM `offers` WHERE `id` = " . ($_POST['offer'] + 0)); @mysql_query("DELETE FROM `offervotes` WHERE `offerid` = " . ($_POST['offer'] + 0)); @mysql_query("DELETE FROM `comments` WHERE `offer` = " . ($_POST['offer'] + 0) . ""); } } // === end notify people who voted on offer $res = mysql_query("SELECT name FROM categories WHERE id={$catid}") or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_assoc($res); $cat = $arr["name"]; $res = mysql_query("SELECT email FROM users WHERE enabled='yes' AND notifs LIKE '%[cat{$catid}]%' AND notifs LIKE '%[email]%'") or sqlerr(__FILE__, __LINE__); $uploader = $CURUSER['username']; $size = prefixed($totallen); $description = $html ? strip_tags($descr) : $descr; $body = <<<EOD A new torrent has been uploaded. Name: {$torrent} Size: {$size} Category: {$cat} Description ------------------------------------------------------------------------------- {$description} -------------------------------------------------------------------------------
} // leechers ? if ($leechers != 1) { $l = "s"; $aktivl = "{$leechers} leecher{$l}"; } else { $aktivl = "no leecher"; } if (isset($_GET["feed"])) { $feed = $_GET["feed"]; } else { $feed = " "; } // ddl or detail ? if ($feed == "dl") { $link = "{$BASEURL}/rssdownload.php/{$id}/" . ($passkey ? "{$passkey}/" : "") . "{$filename}"; } else { $link = "{$BASEURL}/details.php?id={$id}&hit=1"; } // measure the totalspeed if ($seeders >= 1 && $leechers >= 1) { $spd = mysql_query("SELECT (t.size * t.times_completed + SUM(p.downloaded)) / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(added)) AS totalspeed FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND p.torrent = '{$id}' GROUP BY t.id ORDER BY added ASC") or sqlerr(__FILE__, __LINE__); $a = mysql_fetch_assoc($spd); $totalspeed = prefixed($a["totalspeed"]) . "/s"; } else { $totalspeed = "no traffic"; } // output of all data echo "<item><title>" . htmlspecialchars($name) . "</title>\n<link>" . $link . "</link>\n<category>\nCategory: " . $category[$cat] . " </category>\n<size> Size: " . prefixed($size) . "</size>\n<status> Status: " . $aktivs . " and " . $aktivl . "</status>\n<speed> Speed: " . $totalspeed . "</speed>\n<added> Added: " . $added . "</added>\n<description> Description:\n " . htmlspecialchars($descr) . "\n</description>\n</item>\n"; } echo "</channel>\n</rss>\n";
<td class=tabletorrent align=center width="1%">Download</td> <td class=tabletorrent align=center width="1%">Seedtime</td> <td class=tabletorrent align=center width="1%">leechtime</td> <td class=tabletorrent align=center width="1%">Start Date</td> <td class=tabletorrent align=center width="1%">End Date</td> <td class=tabletorrent align=center width="1%">Seeding</td> <td class=tabletorrent align=center width="1%">Delete</td> </tr> <?php while ($row = mysql_fetch_assoc($result)) { echo '<tr>' . '<td><a href="/userdetails.php?id=' . $row['userid'] . '"><b>' . $row['username'] . '</b></a></td>'; $smallname = substr(safechar($row["name"]), 0, 25); if ($smallname != safechar($row["name"])) { $smallname .= '...'; } echo '<td align=center><a href="/details.php?id=' . $row['torrentid'] . '"><b>' . $smallname . '</b></a></td>', '<td align=center><b>' . $row['hit_and_run'] . '</b></td>' . '<td align=center><b>' . $row['mark_of_cain'] . '</b></td>' . '<td align=center><b>' . $row['timesann'] . '</b></td>' . '<td align=center><b>' . prefixed($row['uploaded']) . '</b></td>' . '<td align=center><b>' . prefixed($row['downloaded']) . '</b></td>' . '<td align=center><b>' . get_snatched_color($row["seedtime"]) . '</b></td>' . '<td align=center>' . mkprettytime($row["leechtime"]) . '</td>' . '<td align=center><nobr><b>' . $row['start_date'] . '</b></td>'; if ($row['complete_date'] > 0) { echo '<td align=center><nobr><b>' . "" . get_elapsed_time(sql_timestamp_to_unix_timestamp($row[complete_date])) . " ago" . '</b></td>'; } else { echo '<td align=center><nobr><b><font color=red>Not Completed</font></b></td>'; } echo '<td align=center><b>' . ($row['seeder'] == 'yes' ? "<img src=/pic/online.gif>" : "<img src=/pic/offline.gif>") . '</b></td>' . '</td>'; //} if (get_user_class() >= UC_SYSOP) { print "<td align=center><font size=\"-2\">[<a class=altlink href=delsnatch.php?action=delete&id=" . $row['id'] . "&returnto=" . urlencode($_SERVER['PHP_SELF']) . "><b>Delete</b></a>]</font></td></tr>"; } else { print "<td align=center><b><font size=\"-2\">[Not Allowed]</font></b></td></tr>"; } } print '</table>'; } else {
echo "</tr>\n"; $res = mysql_query("SELECT s.*, size, username, parked, warned, enabled, donor, timesann, hit_and_run, mark_of_cain FROM snatched AS s INNER JOIN users ON s.userid = users.id INNER JOIN torrents ON s.torrentid = torrents.id WHERE torrentid =" . unsafeChar($id) . " ORDER BY complete_date DESC {$limit}") or sqlerr(); while ($arr = mysql_fetch_assoc($res)) { $upspeed = $arr["upspeed"] > 0 ? prefixed($arr["upspeed"]) : ($arr["seedtime"] > 0 ? prefixed($arr["uploaded"] / ($arr["seedtime"] + $arr["leechtime"])) : prefixed(0)); $downspeed = $arr["downspeed"] > 0 ? prefixed($arr["downspeed"]) : ($arr["leechtime"] > 0 ? prefixed($arr["downloaded"] / $arr["leechtime"]) : prefixed(0)); $ratio = $arr["downloaded"] > 0 ? number_format($arr["uploaded"] / $arr["downloaded"], 3) : ($arr["uploaded"] > 0 ? "Inf." : "---"); $completed = sprintf("%.2f%%", 100 * (1 - $arr["to_go"] / $arr["size"])); $res9 = mysql_query("SELECT seeder FROM peers WHERE torrent={$_GET['id']} AND userid={$arr['userid']}"); $arr9 = mysql_fetch_assoc($res9); echo "<tr>\n"; echo "<td align=left><a href=userdetails.php?id={$arr['userid']}>{$arr['username']}</a>" . get_user_icons($arr) . "</td>\n"; echo "<td align=right>" . safeChar($arr["id"]) . "</td>\n"; echo "<td align=center>" . ($arr["connectable"] == "yes" ? "<img src=/pic/online.gif>" : "<img src=/pic/offline.gif>") . "</td>\n"; echo "<td align=right>" . prefixed($arr["uploaded"]) . "</td>\n"; echo "<td align=right>{$upspeed}/s</td>\n"; echo "<td align=right>" . prefixed($arr["downloaded"]) . "</td>\n"; echo "<td align=right>{$downspeed}/s</td>\n"; echo "<td align=right>{$ratio}</td>\n"; echo "<td align=right>{$completed}</td>\n"; echo "<td align=right>" . safeChar($arr["hit_and_run"]) . "</td>\n"; echo "<td align=right>" . safeChar($arr["mark_of_cain"]) . "</td>\n"; echo "<td align=right><center><b>" . get_snatched_color($arr["seedtime"]) . "</b></center></td>\n"; echo "<td align=right>" . mkprettytime($arr["leechtime"]) . "</td>\n"; echo "<td align=center>{$arr['last_action']}</td>\n"; echo "<td align=center>" . safeChar($arr["complete_date"] == "0000-00-00 00:00:00" ? "Not Complete Yet" : $arr["complete_date"]) . "</td>\n"; echo "<td align=center>" . safeChar($arr[port]) . "</td>\n"; echo "<td align=center>" . ($arr9["seeder"] == "yes" ? "<img src=" . $pic_base_url . "online.gif border=0 alt=\"active Seeder\">" : "<img src=" . $pic_base_url . "offline.gif border=0 alt=\"Not seeding!\">") . "</td>\n"; echo "<td align=right>" . safeChar($arr["timesann"]) . "</td>\n"; echo "</tr>\n"; } echo "</table>\n";
<td class="colhead"><nobr>Last access</td> <td class="colhead"><nobr>Class</td> <td class="colhead">Downloaded</td> <td class="colhead">UpLoaded</td> <td class="colhead">Ratio</td> <td class="colhead">Status</td> <td class="colhead"><nobr>Enabled</td> </tr><?php while ($arr = mysql_fetch_assoc($res)) { if ($arr["downloaded"] > 0) { $ratio = "<font color=" . get_ratio_color(number_format($arr["uploaded"] / $arr["downloaded"], 3)) . ">{$ratio}</font>"; } elseif ($arr["uploaded"] > 0) { $ratio = 'Inf.'; } else { $ratio = "---"; } $uploaded = prefixed($arr["uploaded"]); $downloaded = prefixed($arr["downloaded"]); $added = $arr['added'] != '0000-00-00 00:00:00' ? substr($arr['added'], 0, 10) : '-'; $last_access = $arr['last_access'] != '0000-00-00 00:00:00' ? substr($arr['last_access'], 0, 10) : '-'; $class = get_user_class_name($arr["class"]); echo "<tr align='center'><td><input type=\"checkbox\" name=\"ids[]\" value=\"{$arr['id']}\"></td><td><a href=/userdetails.php?id={$arr['id']}><b>{$arr['username']}</b></a>" . ($arr["donor"] == "yes" ? "<img src=pic/star.gif border=0 alt='Donor'>" : "") . ($arr["warned"] == "yes" ? "<img src=pic/warned.gif border=0 alt='Warned'>" : "") . "</td>\n\t\t<td><nobr>{$added}<br />(<font class='small'>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"])) . " ago</font>)</td>\n\t\t<td><nobr>{$last_access}<br />(<font class='small'>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["last_access"])) . " ago</font>)</td>\n\t\t<td>{$class}</td>\n\t\t<td>{$downloaded}</td>\n\t\t<td>{$uploaded}</td>\n\t\t<td>{$ratio}</td>\n\t\t<td>" . $arr['status'] . "</td>\n\t\t<td>" . $arr['enabled'] . "</td>\n\t\t</tr>\n"; } echo "<tr><td colspan=10 align='center'><select name='do'><option value='enabled' disabled selected>What to do?</option><option value='enabled'>Enable selected</option><option value='confirm'>Confirm selected</option><option value='delete'>Delete selected</option></select><input type='submit' value='Submit'></td></tr></form>"; end_table(); echo $pagerbottom; } else { stdmsg('Sorry', 'Nothing found!'); } end_main_frame(); stdfoot();
} else { $ipstr = "---"; } $auxres = mysql_query("SELECT SUM(uploaded) AS pul, SUM(downloaded) AS pdl FROM peers WHERE userid = " . $user['id']) or sqlerr(__FILE__, __LINE__); $array = mysql_fetch_array($auxres); $pul = $array['pul']; $pdl = $array['pdl']; $auxres = mysql_query("SELECT COUNT(DISTINCT p.id) FROM posts AS p LEFT JOIN topics as t ON p.topicid = t.id\r\n \tLEFT JOIN forums AS f ON t.forumid = f.id WHERE p.userid = " . $user['id'] . " AND f.minclassread <= " . $CURUSER['class']) or sqlerr(__FILE__, __LINE__); $n = mysql_fetch_row($auxres); $n_posts = $n[0]; $auxres = mysql_query("SELECT COUNT(id) FROM comments WHERE user = "******"SELECT COUNT(c.id) FROM comments AS c LEFT JOIN torrents as t ON c.torrent = t.id WHERE c.user = '******'id']."'") or sqlerr(__FILE__, __LINE__); $n = mysql_fetch_row($auxres); $n_comments = $n[0]; echo "<tr><td><b><a href='userdetails.php?id=" . $user['id'] . "'>" . $user['username'] . "</a></b>" . get_user_icons($user) . "</td>" . "<td>" . ratios($user['uploaded'], $user['downloaded']) . "</td>\r\n <td>" . $ipstr . "</td><td>" . $user['email'] . "</td>\r\n <td><div align=center>" . $user['added'] . "</div></td>\r\n <td><div align=center>" . $user['last_access'] . "</div></td>\r\n <td><div align=center>" . $user['status'] . "</div></td>\r\n <td><div align=center>" . $user['enabled'] . "</div></td>\r\n <td><div align=center>" . ratios($pul, $pdl) . "</div></td>" . "<td><div align=right>" . prefixed($pul) . "</div></td>\r\n <td><div align=right>" . prefixed($pdl) . "</div></td>\r\n <td><div align=center>" . ($n_posts ? "<a href=/userhistory.php?action=viewposts&id=" . $user['id'] . ">{$n_posts}</a>" : $n_posts) . "|" . ($n_comments ? "<a href=/userhistory.php?action=viewcomments&id=" . $user['id'] . ">{$n_comments}</a>" : $n_comments) . "</div></td></tr>\n"; } echo "</table>"; if ($count > $perpage) { echo "{$pagerbottom}"; } ?> <br><br> <form method=post action=/new_announcement.php> <table border="1" cellpadding="5" cellspacing="0"> <tr> <td> <div align="center"> <input name="n_pms" type="hidden" value="<?php print $count; ?>
} } echo '<td align=center>' . safeChar(prefixed($row['downloaded'])) . '</td>'; echo '<td align=center>' . $row['peer_id'] . '</td>'; if ($row['connectable'] == 'yes') { echo '<td align=center><font color=green>' . safeChar($row['connectable']) . '</font></td>'; } else { echo '<td align=center><font color=red>' . safeChar($row['connectable']) . '</font></td>'; } if ($row['seeder'] == 'yes') { echo '<td align=center><font color=green>' . safeChar($row['seeder']) . '</font></td>'; } else { echo '<td align=center><font color=red>' . safeChar($row['seeder']) . '</font></td>'; } echo '<td align=center>' . safeChar($row['started']) . '</td>'; echo '<td align=center>' . safeChar($row['last_action']) . '</td>'; echo '<td align=center>' . safeChar($row['prev_action']) . '</td>'; echo '<td align=center>' . safeChar(prefixed($row['uploadoffset'])) . '</td>'; echo '<td align=center>' . safeChar(prefixed($row['downloadoffset'])) . '</td>'; echo '<td align=center>' . safeChar(prefixed($row['to_go'])) . '</td>'; echo '</tr>'; } } } echo '</table>'; echo "{$pagerbottom}"; } else { echo 'Nothing here sad.gif'; } echo "</td></tr></table>\n"; stdfoot();
stdfoot(); } // View application if ($action == "viewapp") { $id = $_GET["id"]; $res = sql_query("SELECT uploadapp.*, users.id AS uid, users.username, users.class, users.added, users.uploaded, users.downloaded FROM uploadapp INNER JOIN users on uploadapp.userid = users.id WHERE uploadapp.id={$id}") or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_assoc($res); $membertime = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"])); $elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["applied"])); stdhead("Uploader applications"); echo "<h1 align=center>Uploader application</h1>"; echo "<table width=750 border=1 cellspacing=0 cellpadding=5>"; echo "<tr><td class=rowhead width=25%>My username is</td><td><a href=userdetails.php?id={$arr['uid']}>{$arr['username']}</a></td></tr>"; echo "<tr><td class=rowhead>I have joined at</td><td>{$arr['added']} ({$membertime} ago)</td></tr>"; echo "<tr><td class=rowhead>My upload amount is</td><td>" . prefixed($arr["uploaded"]) . "</td></tr>"; echo "<tr><td class=rowhead>My download amount is</td><td>" . prefixed($arr["downloaded"]) . "</td></tr>"; echo "<tr><td class=rowhead>My ratio is </td><td>" . number_format($arr["uploaded"] / $arr["downloaded"], 3) . "</td></tr>"; echo "<tr><td class=rowhead>I am connectable</td><td>{$arr['connectable']}</td></tr>"; echo "<tr><td class=rowhead>My current userclass is</td><td>" . get_user_class_name($arr["class"]) . "</td></tr>"; echo "<tr><td class=rowhead>I have applied at</td><td>{$arr['applied']} ({$elapsed} ago)</td></tr>"; echo "<tr><td class=rowhead>My upload speed is</td><td>" . htmlspecialchars($arr["speed"]) . "</td></tr>"; echo "<tr><td class=rowhead>What I have to offer</td><td>" . htmlspecialchars($arr["offer"]) . "</td></tr>"; echo "<tr><td class=rowhead>Why I should be promoted</td><td>" . htmlspecialchars($arr["reason"]) . "</td></tr>"; echo "<tr><td class=rowhead>I am uploader at other sites</td><td>{$arr['sites']}</td></tr>"; if ($arr["sitenames"] != "") { echo "<tr><td class=rowhead>Those sites are</td><td>" . htmlspecialchars($arr["sitenames"]) . "</td></tr>"; } echo "<tr><td class=rowhead>I have scene access</td><td>{$arr['scene']}</td></tr>"; echo "<tr><td colspan=2>I know how to create, upload and seed torrents: <b>{$arr['creating']}</b><br>I understand that I have to keep seeding my torrents until there are at least two other seeders: <b>{$arr['seeding']}</b></td></tr>"; if ($arr["status"] == "pending") { echo "<tr><td align=center colspan=2><form method=post action=?action=acceptapp><input name=id type=hidden value={$arr['id']}><b>Note: (optional)</b><br><input type=text name=note size=40> <input type=submit value=Accept style='height: 20px'></form><br><form method=post action=?action=rejectapp><input name=id type=hidden value={$arr['id']}><b>Reason: (optional)</b><br><input type=text name=reason size=40> <input type=submit value=Reject style='height: 20px'></form></td></tr>";
/** * Remove a part of a string from the beginning if it exists. * * @param $subject * ... * * @param $prefix * ... * * @param $caseInsensitive * ... * * @return * The contents $subject, with $prefix removed if needed. */ function unprefix($subject, $prefix = '', $caseInsensitive = false) { // No need to do anything if (empty($prefix) or !prefixed($subject, $prefix, $caseInsensitive)) { $result = $subject; // Cut the prefix out } else { $result = mb_substr($subject, mb_strlen($prefix)); } return $result; }
die; } if (get_user_class() < UC_MODERATOR) { hacker_dork("Admin Bookmarks - Nosey C**t !"); } stdhead("Staff Bookmarks"); begin_main_frame(); $addbookmark = number_format(get_row_count("users", "WHERE addbookmark='yes'")); begin_frame("In total ({$addbookmark})", true); begin_table(); ?> <table cellpadding="4" cellspacing="1" border="0" style="width:800px" class="tableinborder" ><tr><td class="tabletitle">ID</td><td class="tabletitle" align="left">Username</td><td class="tabletitle" align="left">Suspicion</td><td class="tabletitle" align="left">Uploaded</td><td class="tabletitle" align="left">Downloaded</td><td class="tabletitle" align="left">Ratio</td></tr> <?php $res = mysql_query("SELECT id,username,bookmcomment,uploaded,downloaded FROM users WHERE addbookmark='yes' ORDER BY id") or print mysql_error(); while ($arr = @mysql_fetch_assoc($res)) { if ($arr["downloaded"] != 0) { $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3); } else { $ratio = "---"; } $ratio = "<font color=" . get_ratio_color($ratio) . ">{$ratio}</font>"; $uploaded = prefixed($arr["uploaded"]); $downloaded = prefixed($arr["downloaded"]); $uploaded = str_replace(" ", "<br>", prefixed($arr["uploaded"])); $downloaded = str_replace(" ", "<br>", prefixed($arr["downloaded"])); echo "<tr><td class=table >" . safeChar($arr[id]) . "</td><td class=table align=\"left\"><b><a href=userdetails.php?id=" . safeChar($arr[id]) . ">" . safeChar($arr[username]) . "</b></td><td class=table align=\"left\">" . safeChar($arr[bookmcomment]) . "</a></td><td class=table align=\"left\">" . $uploaded . "</td></a></td><td class=table align=\"left\">" . $downloaded . "</td><td class=table align=\"left\">{$ratio}</td></tr>"; } end_main_frame(); end_frame(); end_table(); stdfoot();
$updq[1] = "uploaded = uploaded + " . ($arrfs['doubleup'] == 'yes' || $double_for_all ? $upthis * 2 : $upthis); $udq = implode(',', $updq); mysql_query("UPDATE users SET {$udq} WHERE id={$userid}") or err("Tracker error 3"); } // ///// Initial sanity check xMB/s for 1 second if ($upthis > 2097152) { // Work out time difference $endtime = time(); $starttime = $self['ts']; $diff = $endtime - $starttime; // Normalise to prevent divide by zero. $rate = $upthis / ($diff + 1); // Currently 2MB/s. Increase to 5MB/s once finished testing. if ($rate > 2097152) { if ($class < UC_CODER and $highspeed == "no") { $rate = prefixed($rate); $client = $agent; $userip = getip(); auto_enter_cheater($userid, $rate, $upthis, $diff, $torrentid, $client, $userip, $last_up); $modcomment = gmdate("Y-m-d") . " Warned and download disabled for possible ratio cheating at high upload speeds\n" . $arr['modcomment']; mysql_query("UPDATE users set warned='yes', downloadpos='no', modcomment = " . sqlesc($modcomment) . " WHERE id={$userid}") or sqlerr(__FILE__, __LINE__); $body = sqlesc("Cheat alert : [url={$BASEURL}/userdetails.php?id=" . $userid . "]View Members profile[/url] \n This member has been flagged with a high upload speed\n Automatic warning and download disablement applied - Please verify the members actual upload speeds.\n "); $subject = sqlesc("High Upload Speed Detected"); auto_post($subject, $body); } } } } // //////////////end abnormal upload speed detection //// function portblacklisted($port) {
</tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6" style="background:url(themes/NB-Revolt/pic/04.png)" ><img src="themes/NB-Revolt/pic/blank.gif" width="6" height="1" /></td> <td> <!--status bar will be here --> <?php // some vars for status bar if ($CURUSER) { $datum = getdate(); $datum["hours"] = sprintf("%02.0f", $datum["hours"]); $datum["minutes"] = sprintf("%02.0f", $datum["minutes"]); $invites = $CURUSER['invites']; $uped = prefixed($CURUSER['uploaded']); $downed = prefixed($CURUSER['downloaded']); $ratio = $CURUSER['downloaded'] > 0 ? $CURUSER['uploaded'] / $CURUSER['downloaded'] : 0; $ratio = number_format($ratio, 1); $color = get_ratio_color($ratio); if ($color) { $ratio = "<font color={$color}>{$ratio}</font>"; } $icon = ""; $icon_style = "style=\"padding-left:2px;padding-right:2px\""; if ($CURUSER['donor'] == "yes") { $icon .= "<img src=\"themes/NB-Revolt/pic/donor.png\" align=\"baseline\"alt=donor title=donor {$icon_style} />"; } if ($CURUSER['warned'] == "yes") { $icon .= "<img src=\"themes/NB-Revolt/pic/warned.png\" align=\"baseline\" alt=warned title=warned {$icon_style} />"; } if ($CURUSER["webseeder"] == "yes") {
} echo "<br /><br /><h2>Top 10 Fastest Downloaders</h2>"; $result = mysql_query("SELECT username, downloaded / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(added)) AS downspeed FROM users WHERE enabled = 'yes' ORDER BY downspeed DESC LIMIT 10"); $counted = mysql_num_rows($result); if ($counted == "10") { $arr = mysql_fetch_rowsarr($result); $user1 = $arr[0]['username']; $user2 = $arr[1]['username']; $user3 = $arr[2]['username']; $user4 = $arr[3]['username']; $user5 = $arr[4]['username']; $user6 = $arr[5]['username']; $user7 = $arr[6]['username']; $user8 = $arr[7]['username']; $user9 = $arr[8]['username']; $user10 = $arr[9]['username']; $upped1 = $arr[0]['downspeed']; $upped2 = $arr[1]['downspeed']; $upped3 = $arr[2]['downspeed']; $upped4 = $arr[3]['downspeed']; $upped5 = $arr[4]['downspeed']; $upped6 = $arr[5]['downspeed']; $upped7 = $arr[6]['downspeed']; $upped8 = $arr[7]['downspeed']; $upped9 = $arr[8]['downspeed']; $upped10 = $arr[9]['downspeed']; echo "{$imgstartbar}\n&chds=0,{$upped1}&chxr=1,0,{$upped1}\n&chd=t:{$upped1},{$upped2},{$upped3},{$upped4},{$upped5},{$upped6},{$upped7},{$upped8},{$upped9},{$upped10}\n&chxt=x,y,x&chxl=0:|{$user1}|{$user2}|{$user3}|{$user4}|{$user5}|{$user6}|{$user7}|{$user8}|{$user9}|{$user10}|1:||||||||||" . prefixed($upped1) . "/s|2:|(" . prefixed($upped1) . "/s)|(" . prefixed($upped2) . "/s)|(" . prefixed($upped3) . "/s)|(" . prefixed($upped4) . "/s)|(" . prefixed($upped5) . "/s)|(" . prefixed($upped6) . "/s)|(" . prefixed($upped7) . "/s)|(" . prefixed($upped8) . "/s)|(" . prefixed($upped9) . "/s)|(" . prefixed($upped10) . "/s)\" />"; } else { echo "<h4>Insufficiant Downloaders (" . $counted . ")</h4>"; } stdfoot();
if ($_SERVER["REQUEST_METHOD"] == "POST") { $tid = isset($_POST["tid"]) ? 0 + $_POST["tid"] : 0; if ($tid == 0) { stderr(":w00t:", "wtf are your trying to do!?"); } if (get_row_count("torrents", "where id=" . $tid) != 1) { stderr(":w00t:", "That is not a torrent !!!!"); } $q = mysql_query("SELECT s.downloaded as sd , t.id as tid, t.name,t.size, u.username,u.id as uid,u.downloaded as ud FROM torrents as t LEFT JOIN snatched as s ON s.torrentid = t.id LEFT JOIN users as u ON u.id = s.userid WHERE t.id =" . $tid) or print mysql_error(); while ($a = mysql_fetch_assoc($q)) { $newd = $a["ud"] > 0 ? $a["ud"] - $a["sd"] : 0; $new_download[] = "(" . $a["uid"] . "," . $newd . ")"; $tname = $a["name"]; $msg = "Hey , " . $a["username"] . "\n"; $msg .= "Looks like torrent [b]" . $a["name"] . "[/b] is nuked and we want to take back the data you downloaded\n"; $msg .= "So you downloaded " . prefixed($a["sd"]) . " your new download will be " . prefixed($newd) . "\n"; $pms[] = "(0," . $a["uid"] . "," . sqlesc(get_date_time()) . "," . sqlesc($msg) . ")"; } //send the pm !! mysql_query("INSERT into messages (sender, receiver, added, msg) VALUES " . join(",", $pms)) or print mysql_error(); //update user download amount mysql_query("INSERT INTO users (id,downloaded) VALUES " . join(",", $new_download) . " ON DUPLICATE key UPDATE downloaded=values(downloaded)") or print mysql_error(); deletetorrent($tid); stderr(":w00t:", "it worked! long live tbdev!"); write_log("Torrent {$tname} was deleted by " . $CURUSER["username"] . " and users Re-Paid Download"); } else { stdhead("Torrent Reset"); begin_frame(); ?> <form action="<?php echo $_SERVER["PHP_SELF"];
<?php echo "<table width=\"100%\">\n"; echo "<td class=\"tableb\" width=10 align=center valign=middle>#</td>\n<td class=\"tableb\">Username</td>\n<td class=\"tableb\" width=10 align=center valign=middle>D</td>\n<td class=\"tableb\" width=10 align=center valign=middle>R</td>"; $res = sql_query("SELECT * FROM cheaters ORDER BY added DESC {$limit}") or sqlerr(__FILE__, __LINE__); while ($arr = mysql_fetch_assoc($res)) { $rrr = sql_query("SELECT id, username, class, downloaded, uploaded FROM users WHERE id = {$arr['userid']}"); $aaa = mysql_fetch_assoc($rrr); $rrr2 = sql_query("SELECT name FROM torrents WHERE id = {$arr['torrentid']}"); $aaa2 = mysql_fetch_assoc($rrr2); if ($aaa["downloaded"] > 0) { $ratio = number_format($aaa["uploaded"] / $aaa["downloaded"], 3); } else { $ratio = "---"; } $ratio = "<font color=" . get_ratio_color($ratio) . ">{$ratio}</font>"; $uppd = prefixed($arr["upthis"]); $cheater = "<b><a href=userdetails.php?id={$aaa['id']}>{$aaa['username']}</a></b> has been caught cheating!<br /><br />Uploaded: <b>{$uppd}</b><br />Speed: <b>{$arr['rate']}/s</b><br />Within: <b>{$arr['timediff']} seconds</b><br />Using Client: <b>{$arr['client']}</b><br />IP Address: <b>{$arr['userip']}</b>"; echo "<tr><td class=\"tableb\" width=\"10\" align=center>{$arr['id']}</td>"; echo "<td class=\"tableb\" align=left><a href=\"javascript: klappe_news('a{$arr['id']}')\">{$aaa['username']}</a> - Added: {$arr['added']}"; echo "<div id=\"ka{$arr['id']}\" style=\"display: none;\"><font color=\"red\">{$cheater}</font></div></td>"; echo "<td class=\"tableb\" valign=\"top\" width=10><input type=\"checkbox\" name=\"desact[]\" value=\"" . $aaa["id"] . "\"/></td>"; echo "<td class=\"tableb\" valign=\"top\" width=10><input type=\"checkbox\" name=\"remove[]\" value=\"" . $arr["id"] . "\"/></td></tr>"; } if (get_user_class() >= UC_MODERATOR) { ?> <tr> <td class="tableb" colspan="4" align="right"> <input type="button" value="Check All Disable" onclick="this.value=check(this.form.elements['desact[]'])"/> <input type="button" value="Check All Remove" onclick="this.value=check(this.form.elements['remove[]'])"/> <input type="hidden" name="nowarned" value="nowarned"><input type="submit" name="submit" value="Apply Changes"> </td> </tr> </table></form>
$dt = sqlesc(get_date_time()); $msg = sqlesc("You beat {$CURUSER['username']} (You had {$a['points']} points, {$CURUSER['username']} had {$playerarr['points']} points).\n\n - [b][url=blackjack.php]Play again[/url][/b]"); $subject = sqlesc("BlackJack Results."); sql_query("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES(0, {$a['userid']}, {$dt}, {$msg}, 0, {$subject})") or sqlerr(__FILE__, __LINE__); } elseif ($a["points"] < $playerarr[points] && $a[points] > 21) { $winorlose = "you lost " . prefixed($mb); sql_query("update users set uploaded = uploaded - {$mb}, bjlosses = bjlosses + 1 where id={$CURUSER['id']}") or sqlerr(__FILE__, __LINE__); sql_query("update users set uploaded = uploaded + {$mb}, bjwins = bjwins + 1 where id={$a['userid']}") or sqlerr(__FILE__, __LINE__); sql_query("delete from blackjack where userid={$CURUSER['id']}"); sql_query("delete from blackjack where userid={$a['userid']}"); $dt = sqlesc(get_date_time()); $msg = sqlesc("You beat {$CURUSER['username']} (You had {$a['points']} points, {$CURUSER['username']} had {$playerarr['points']} points).\n\n - [b][url=blackjack.php]Play again[/url][/b]"); $subject = sqlesc("BlackJack Results."); sql_query("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES(0, {$a['userid']}, {$dt}, {$msg}, 0, {$subject})") or sqlerr(__FILE__, __LINE__); } elseif ($a["points"] > $playerarr[points] && $a[points] > 21) { $winorlose = "you won " . prefixed($mb); sql_query("update users set uploaded = uploaded + {$mb}, bjwins = bjwins + 1 where id={$CURUSER['id']}") or sqlerr(__FILE__, __LINE__); sql_query("update users set uploaded = uploaded - {$mb}, bjlosses = bjlosses + 1 where id={$a['userid']}") or sqlerr(__FILE__, __LINE__); sql_query("delete from blackjack where userid={$CURUSER['id']}"); sql_query("delete from blackjack where userid={$a['userid']}"); $dt = sqlesc(get_date_time()); $msg = sqlesc("You lost to {$CURUSER['username']} (You had {$a['points']} points, {$CURUSER['username']} had {$playerarr['points']} points).\n\n - [b][url=blackjack.php]Play again[/url][/b]"); $subject = sqlesc("BlackJack Results."); sql_query("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES(0, {$a['userid']}, {$dt}, {$msg}, 0, {$subject})") or sqlerr(__FILE__, __LINE__); } echo "<tr><td align=center>Your opponent was " . get_user_name($a["userid"]) . ", they had {$a['points']} points, {$winorlose}.<br /><br /><center><b><a href=blackjack.php>Play again</a></b></center></td></tr>"; } else { sql_query("update blackjack set status = 'waiting', date='" . get_date_time() . "' where userid = {$CURUSER['id']}") or sqlerr(__FILE__, __LINE__); echo "<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 /><center><b><a href=blackjack.php>Back</a></b><br /></center></td></tr>"; } echo "</table>";
?> </td> <td nowrap="nowrap" align="center"><?php echo date("d/M-Y", $ar["added"] + 86400 * $ar["days_valid"]); ?> </td> <td nowrap="nowrap" align="center"><?php echo 0 + $ar["max_users"]; ?> </td> <td nowrap="nowrap" align="center"><?php echo $ar["accounts_made"] > 0 ? "<a href=\"javascript:link(" . $ar["id"] . ")\" >" . $ar["accounts_made"] . "</a>" : 0; ?> </td> <td nowrap="nowrap" align="center"><?php echo prefixed($ar["bonus_upload"] * 1073741824); ?> </td> <td nowrap="nowrap" align="center"><?php echo 0 + $ar["bonus_invites"]; ?> </td> <td nowrap="nowrap" align="center"><?php echo 0 + $ar["bonus_karma"]; ?> </td> <td nowrap="nowrap" align="center"><a href="userdetails.php?id=<?php echo $ar["creator"]; ?> "><?php echo $ar["username"];