function addForum() { global $CURUSER, $lang; $HTMLOUT = ''; $HTMLOUT .= "<span class='btn'><a href='admin.php?action=forummanage'>{$lang['btn_cancel']}</a></span><br /><br />"; $HTMLOUT .= begin_main_frame(); $HTMLOUT .= "<form method='post' action='admin.php?action=forummanage&mode=takeadd'>\r\n <table width='600' border='0' cellspacing='0' cellpadding='3' align='center'>\r\n <tr align='center'>\r\n <td colspan='2' class='colhead'>{$lang['header_makenew']}</td>\r\n </tr>\r\n <tr>\r\n <td><b>{$lang['table_forumname']}</b></td>\r\n <td><input name='name' type='text' size='20' maxlength='60' /></td>\r\n </tr>\r\n <tr>\r\n <td><b>{$lang['table_forumdescr']}</b></td>\r\n <td><input name='desc' type='text' size='30' maxlength='200' /></td>\r\n </tr>\r\n <tr>\r\n <td><b>{$lang['table_minreadperm']}</b></td>\r\n <td><select name='readclass'>"; $maxclass = get_user_class(); for ($i = 0; $i <= $maxclass; ++$i) { $HTMLOUT .= "<option value='{$i}'" . ($CURUSER["class"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>\n"; } $HTMLOUT .= "</select>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td><b>{$lang['table_minwriteperm']}</b></td>\r\n <td><select name='writeclass'>"; $maxclass = get_user_class(); for ($i = 0; $i <= $maxclass; ++$i) { $HTMLOUT .= "<option value='{$i}'" . ($CURUSER["class"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>\n"; } $HTMLOUT .= "</select></td>\r\n </tr>\r\n <tr>\r\n <td><b>{$lang['table_mincreatetperm']}</b></td>\r\n <td><select name='createclass'>"; $maxclass = get_user_class(); for ($i = 0; $i <= $maxclass; ++$i) { $HTMLOUT .= "<option value='{$i}'" . ($CURUSER["class"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>\n"; } $HTMLOUT .= "</select></td>\r\n </tr>\r\n <tr>\r\n <td><b>{$lang['table_forumrank']}</b></td>\r\n <td><select name='sort'>"; $res = mysql_query("SELECT sort FROM forums"); $nr = mysql_num_rows($res); $maxclass = $nr + 1; for ($i = 0; $i <= $maxclass; ++$i) { $HTMLOUT .= "<option value='{$i}'>{$i} </option>\n"; } $HTMLOUT .= "</select>\r\n \r\n </td>\r\n </tr>\r\n\r\n <tr align='center'>\r\n <td colspan='2'>\r\n <!--<input type='hidden' name='action' value='takeadd' /> -->\r\n <input type='submit' name='Submit' value='{$lang['btn_makeforum']}' class='btn' /></td>\r\n </tr>\r\n </table>\r\n </form>"; // end_frame(); $HTMLOUT .= end_main_frame(); print stdhead("{$lang['stdhead_addforum']}") . $HTMLOUT . stdfoot(); }
/** |--------------------------------------------------------------------------| | https://github.com/Bigjoos/ | |--------------------------------------------------------------------------| | Licence Info: GPL | |--------------------------------------------------------------------------| | Copyright (C) 2010 U-232 V4 | |--------------------------------------------------------------------------| | A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. | |--------------------------------------------------------------------------| | Project Leaders: Mindless,putyn. | |--------------------------------------------------------------------------| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ ( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e ) \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ */ function rsstfreakinfo() { require_once INCL_DIR . 'html_functions.php'; global $INSTALLER09; $html = ''; $use_limit = true; $limit = 5; $xml = file_get_contents('http://feed.torrentfreak.com/Torrentfreak/'); $html = begin_main_frame() . begin_frame('Torrent Freak news'); $icount = 1; $doc = new DOMDocument(); @$doc->loadXML($xml); $items = $doc->getElementsByTagName('item'); foreach ($items as $item) { $html .= '<h3><u>' . $item->getElementsByTagName('title')->item(0)->nodeValue . '</u></h3><font class="small">by ' . str_replace(array('<![CDATA[', ']]>'), '', $item->getElementsByTagName('creator')->item(0)->nodeValue) . ' on ' . $item->getElementsByTagName('pubDate')->item(0)->nodeValue . '</font><br />' . str_replace(array('<![CDATA[', ']]>'), '', $item->getElementsByTagName('description')->item(0)->nodeValue) . '<br /><a href="' . $item->getElementsByTagName('link')->item(0)->nodeValue . '" target="_blank"><font class="small">Read more</font></a>'; if ($use_limit && $icount == $limit) { break; } $icount++; } $html = str_replace(array('“', '”'), '"', $html); $html = str_replace(array("’", "‘", "‘"), "'", $html); $html = str_replace("–", "-", $html); $html .= end_frame() . end_main_frame(); return $html; }
function reqmenu($selected = "viewrequest") { global $title; stdhead($title); begin_main_frame(); end_main_frame(); }
function commenttable_new($rows) { global $CURUSER, $HTTP_SERVER_VARS; begin_main_frame(); begin_frame(); $count = 0; foreach ($rows as $row) { $subres = mysql_query("SELECT name from torrents where id=" . unsafeChar($row["torrent"])) or sqlerr(__FILE__, __LINE__); $subrow = mysql_fetch_array($subres); print "<br /><a href=\"details.php?id=" . safeChar($row["torrent"]) . "\">" . safeChar($subrow["name"]) . "</a><br />\n"; print "<p class=sub>#" . $row["id"] . " by "; if (isset($row["username"])) { print "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . safeChar($row["user"]) . "><b>" . safechar($row["username"]) . "</b></a>" . ($row["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt=\"Warned\">" : ""); } else { print "<a name=\"comm" . safeChar($row["id"]) . "\"><i>(orphaned)</i></a>\n"; } print " at " . safeChar($row["added"]) . " GMT" . "- [<a href=comment.php?action=edit&cid={$row['id']}>Edit</a>]" . "- [<a href=deletecomment.php?id={$row['id']}>Delete</a>]</p>\n"; $avatar = $CURUSER["avatars"] == "yes" ? safechar($row["avatar"]) : ""; if (!$avatar) { $avatar = "pic/default_avatar.gif"; } begin_table(true); print "<tr valign=top>\n"; print "<td align=center width=150 style='padding: 0px'><img width=150 src={$avatar}></td>\n"; print "<td class=text>" . format_comment($row["text"]) . "</td>\n"; print "</tr>\n"; end_table(); } end_frame(); end_main_frame(); }
function usercommenttable($rows) { global $CURUSER, $pic_base_url, $userid; begin_main_frame(); begin_frame(); $count = 0; foreach ($rows as $row) { echo "<p class=sub>#" . $row["id"] . " by "; if (isset($row["username"])) { $title = $row["title"]; if ($title == "") { $title = get_user_class_name($row["class"]); } else { $title = safeChar($title); } echo "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . $row["user"] . "><b>" . safeChar($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src=\"{$pic_base_url}star.gif\" alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=" . "\"{$pic_base_url}warned.gif\" alt=\"Warned\">" : "") . " ({$title})\n"; } else { echo "<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n"; } echo " at " . $row["added"] . " GMT" . ($userid == $CURUSER["id"] || $row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=usercomment.php?action=edit&cid={$row['id']}>Edit</a>]" : "") . ($userid == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=usercomment.php?action=delete&cid={$row['id']}>Delete</a>]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "- [<a href=usercomment.php?action=vieworiginal&cid={$row['id']}>View original</a>]" : "") . "</p>\n"; $avatar = $CURUSER["avatars"] == "yes" ? safeChar($row["avatar"]) : ""; $text = format_comment($row["text"]); if ($row["editedby"]) { $text .= "<p><font size=1 class=small>Last edited by <a href=userdetails.php?id={$row['editedby']}><b>{$row['username']}</b></a> at {$row['editedat']} GMT</font></p>\n"; } begin_table(true); echo "<tr valign=top>\n"; echo "<td align=center width=150 style='padding: 0px'><img width=150 src=\"{$avatar}\"></td>\n"; echo "<td class=text>{$text}</td>\n"; echo "</tr>\n"; end_table(); } end_frame(); end_main_frame(); }
function logmenu($selected = "candidate") { global $lang_log; global $showfunbox_main; begin_main_frame(); print "<div id=\"lognav\"><ul id=\"logmenu\" class=\"menu\">"; print "<li" . ($selected == "recycle" ? " class=selected" : "") . "><a href=\"?status=recycle\">回收站</a></li>"; print "<li" . ($selected == "candidate" ? " class=selected" : "") . "><a href=\"?status=candidate\">候选区</a></li>"; print "</ul></div>"; end_main_frame(); }
function usercpmenu($selected = "home") { global $lang_usercp; begin_main_frame(); print "<div id=\"usercpnav\"><ul id=\"usercpmenu\" class=\"menu\">"; print "<li" . ($selected == "home" ? " class=selected" : "") . "><a href=\"usercp.php\">" . $lang_usercp['text_user_cp_home'] . "</a></li>"; print "<li" . ($selected == "personal" ? " class=selected" : "") . "><a href=\"?action=personal\">" . $lang_usercp['text_personal_settings'] . "</a></li>"; print "<li" . ($selected == "tracker" ? " class=selected" : "") . "><a href=\"?action=tracker\">" . $lang_usercp['text_tracker_settings'] . "</a></li>"; print "<li" . ($selected == "forum" ? " class=selected" : "") . "><a href=\"?action=forum\">" . $lang_usercp['text_forum_settings'] . "</a></li>"; print "<li" . ($selected == "security" ? " class=selected" : "") . "><a href=\"?action=security\">" . $lang_usercp['text_security_settings'] . "</a></li>"; print "</ul></div>"; end_main_frame(); }
function logmenu($selected = "dailylog") { global $lang_log; global $showfunbox_main; begin_main_frame(); print "<div id=\"lognav\"><ul id=\"logmenu\" class=\"menu\">"; print "<li" . ($selected == "dailylog" ? " class=selected" : "") . "><a href=\"?action=dailylog\">" . $lang_log['text_daily_log'] . "</a></li>"; print "<li" . ($selected == "chronicle" ? " class=selected" : "") . "><a href=\"?action=chronicle\">" . $lang_log['text_chronicle'] . "</a></li>"; if ($showfunbox_main == 'yes') { print "<li" . ($selected == "funbox" ? " class=selected" : "") . "><a href=\"?action=funbox\">" . $lang_log['text_funbox'] . "</a></li>"; } print "<li" . ($selected == "news" ? " class=selected" : "") . "><a href=\"?action=news\">" . $lang_log['text_news'] . "</a></li>"; print "<li" . ($selected == "poll" ? " class=selected" : "") . "><a href=\"?action=poll\">" . $lang_log['text_poll'] . "</a></li>"; print "</ul></div>"; end_main_frame(); }
function reqcommenttable($rows) { global $CURUSER, $HTTP_SERVER_VARS; begin_main_frame(); begin_frame(); $count = 0; foreach ($rows as $row) { print("<p class=sub>#" . $row["id"] . " bY: "); if (isset($row["username"])) { $username = $row["username"]; $ratres = mysql_query("SELECT uploaded, downloaded FROM users WHERE username='******'"); $rat = mysql_fetch_array($ratres); if ($rat["downloaded"] > 0) { $ratio = $rat['uploaded'] / $rat['downloaded']; $ratio = number_format($ratio, 3); $color = get_ratio_color($ratio); if ($color) $ratio = "<font color=$color>$ratio</font>"; } else if ($rat["uploaded"] > 0) $ratio = "Inf."; else $ratio = "---"; $title = $row["title"]; if ($title == "") $title = get_user_class_name($row["class"]); else $title = htmlspecialchars($title); print("<a name=comm".$row["id"]." href=userdetails.php?id=".$row["user"]."><b>".htmlspecialchars($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) (Ratio: $ratio)\n"); } else print("<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n"); print(" at " . $row["added"] . " GMT" .($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=reqcomment.php?action=edit&cid=$row[id]>Edit</a>]" : "") .(get_user_class() >= UC_MODERATOR ? "- [<a href=reqcomment.php?action=delete&cid=$row[id]>Delete</a>]" : "") . "</p>\n");$avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : ""); if (!$avatar) $avatar = "/pic/default_avatar.gif"; $text = format_comment($row["text"]); begin_table(true); print("<tr valign=top>\n"); print("<td align=center width=150 style='padding: 0px'><img width=150 src=$avatar></td>\n"); print("<td class=text>$text</td>\n"); print("</tr>\n"); end_table(); } end_frame(); end_main_frame(); }
/** * https://09source.kicks-ass.net:8443/svn/installer09/ * Licence Info: GPL * Copyright (C) 2010 Installer09 v.2 * A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. * Project Leaders: Mindless,putyn,kidvision. **/ function rsstfreakinfo() { require_once INCL_DIR . 'html_functions.php'; global $TBDEV; $html = ''; $use_limit = true; $limit = 5; $xml = file_get_contents('http://feed.torrentfreak.com/Torrentfreak/'); preg_match_all('/\\<(title|pubDate|dc:creator|link|description)\\>(.+?)\\<\\/\\1\\>/i', $xml, $out, PREG_PATTERN_ORDER); $feeds = $out[2]; $c = count($feeds); $html = begin_main_frame() . begin_frame('Torrent Freak news'); for ($i = 5; $i < $c; $i += 5) { $html .= '<h3><u>' . $feeds[$i] . '</u></h3><font class="small">by ' . $feeds[$i + 3] . ' on ' . $feeds[$i + 2] . '</font><br /><p>' . str_replace(array('<![CDATA[', ']]>'), '', $feeds[$i + 4]) . '</p><br /><a href="' . $feeds[$i + 1] . '" target="_blank"><font class="small">Read more</font></a>'; if ($use_limit && $i >= $limit * 5) { break; } } $html .= end_frame() . end_main_frame(); return $html; }
function usercommenttable($rows) { $htmlout = ''; global $CURUSER, $INSTALLER09, $userid; $htmlout .= begin_main_frame(); $htmlout .= begin_frame(); $count = 0; foreach ($rows as $row) { $htmlout .= "<p class='sub'>#{$row['id']} by "; if (isset($row["username"])) { $title = $row["title"]; if ($title == "") { $title = get_user_class_name($row["class"]); } else { $title = htmlsafechars($title); } $htmlout .= "<a name='comm" . (int) $row['id'] . "' href='userdetails.php?id=" . (int) $row['user'] . "'><b>" . htmlsafechars($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src=\"{$INSTALLER09['pic_base_url']}star.gif\" alt='Donor' />" : "") . ($row["warned"] >= 1 ? "<img src=" . "\"{$INSTALLER09['pic_base_url']}warned.gif\" alt=\"Warned\" />" : "") . " ({$title})\n"; } else { $htmlout .= "<a name=\"comm" . (int) $row["id"] . "\"><i>(orphaned)</i></a>\n"; } $htmlout .= " " . get_date($row["added"], 'DATE', 0, 1) . "" . ($userid == $CURUSER["id"] || $row["user"] == $CURUSER["id"] || $CURUSER['class'] >= UC_STAFF ? " - [<a href='usercomment.php?action=edit&cid={$row['id']}'>Edit</a>]" : "") . ($userid == $CURUSER["id"] || $CURUSER['class'] >= UC_STAFF ? " - [<a href='usercomment.php?action=delete&cid=" . (int) $row['id'] . "'>Delete</a>]" : "") . ($row["editedby"] && $CURUSER['class'] >= UC_STAFF ? " - [<a href='usercomment.php?action=vieworiginal&cid=" . (int) $row['id'] . "'>View original</a>]" : "") . "</p>\n"; $avatar = $CURUSER["avatars"] == "yes" ? htmlsafechars($row["avatar"]) : ""; if (!$avatar) { $avatar = "{$INSTALLER09['pic_base_url']}default_avatar.gif"; } $text = format_comment($row["text"]); if ($row["editedby"]) { $text .= "<font size='1' class='small'><br /><br />Last edited by <a href='userdetails.php?id=" . (int) $row['editedby'] . "'><b>" . htmlsafechars($row['username']) . "</b></a> " . get_date($row['editedat'], 'DATE', 0, 1) . "</font>\n"; } $htmlout .= begin_table(true); $htmlout .= "<tr valign='top'>\n"; $htmlout .= "<td align='center' width='150' style='padding:0px'><img width='150' src=\"{$avatar}\" alt=\"Avatar\" /></td>\n"; $htmlout .= "<td class='text'>{$text}</td>\n"; $htmlout .= "</tr>\n"; $htmlout .= end_table(); } $htmlout .= end_frame(); $htmlout .= end_main_frame(); return $htmlout; }
switch ($do) { case 'check': #ipban check break; default: $res = sql_query("SELECT username FROM users WHERE id =" . sqlesc($uid) . "") or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($res) == 0) { stderr("Error", "User not found"); exit; } $perpage = 5; $username = mysql_result($res, 0); $count = get_row_count("iplog", 'WHERE userid =' . $uid); $pager = pager($perpage, $count, 'admin.php?action=iphistory&id=' . $uid . '&' . (($order == 'access' ? 'order=access' : 'order=ip') . '&')); $q1 = sql_query('SELECT u.id,INET_ATON(u.ip) as cip, l.ip, l.access AS last_access, (SELECT count(u2.id) FROM users as u2 WHERE u2.id != u.id AND INET_ATON(u2.ip) = l.ip ) as log_count, (SELECT count(b.id) FROM bans as b WHERE l.ip >= first AND l.ip <= last ) as ban_count FROM users as u LEFT JOIN iplog as l ON u.id = l.userid WHERE u.id = ' . $uid . ' ORDER BY ' . ($order == 'access' ? 'l.access' : 'l.ip') . ' DESC ' . $pager['limit']) or sqlerr(__FILE__, __LINE__); $HTMLOUT = begin_main_frame() . begin_frame("Historical IP addresses used by <a href='{$TBDEV['baseurl']}/userdetails.php?id={$uid}'><b>" . $username . "</b></a>", true); if ($count > $perpage) { $HTMLOUT .= $pager['pagertop']; } $HTMLOUT .= begin_table() . "<tr>\r\n\t<td class='colhead'><a class='colhead' href='{$TBDEV['baseurl']}/admin.php?action=iphistory&id=" . $uid . "&order=access'>Last access</a></td>\n\r\n\t<td class='colhead'><a class='colhead' href='{$TBDEV['baseurl']}/admin.php?action=iphistory&id=" . $uid . "&order=ip'>IP</a></td>\n\r\n\t<td class='colhead'>Hostname</td>\n\r\n\t</tr>\n"; while ($a = mysql_fetch_assoc($q1)) { $HTMLOUT .= "<tr><td>" . get_date($a["last_access"], 'DATE', 1, 0) . "</td>\n"; $ip = long2ip($a['ip']); if ($a['log_count'] >= 1) { $HTMLOUT .= "<td><b><a href='{$TBDEV['baseurl']}/admin.php?action=ipsearch&ip=" . $ip . "' title='ip used by other persons'>" . $ip . "</a></b></td>\n"; } elseif ($a['ban_count'] > 0) { $HTMLOUT .= "<td><a href='{$TBDEV['baseurl']}/admin.php?action=testip&ip=" . $ip . "' title='ip banned'><font color='#FF0000' ><b>" . $ip . "</b></font></a></td>\n"; } else { $HTMLOUT .= "<td><b>" . $ip . "</b></td>\n"; } //$d = gethost($ip);
sql_query("UPDATE users SET status = 'confirmed' WHERE ID IN(" . join(', ', $ids) . ") AND status = 'pending'"); } elseif ($do == 'delete') { sql_query("DELETE FROM users WHERE ID IN(" . join(', ', $ids) . ")"); } else { header('Location: ' . $_SERVER['PHP_SELF']); exit; } } $disabled = number_format(get_row_count("users", "WHERE enabled='no'")); $pending = number_format(get_row_count("users", "WHERE status='pending'")); $count = number_format(get_row_count("users", "WHERE enabled='no' OR status='pending' ORDER BY username DESC")); $perpage = '25'; list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER['PHP_SELF'] . "?"); $res = mysql_query("SELECT id, username, added, downloaded, uploaded, last_access, class, donor, warned, enabled, status FROM users WHERE enabled='no' OR status='pending' ORDER BY username DESC"); stdhead("ACP Manager"); begin_main_frame("Disabled Users: [{$disabled}] | Pending Users: [{$pending}]"); ?> <script language="Javascript" type="text/javascript">eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('6 2="3";6 d=b 9;f e(a){c(2=="3"){4(1=0;1<a.5;1++){a[1].7=8}2="8"}g{4(1=0;1<a.5;1++){a[1].7=3}2="3"}};',17,17,'|i|checkflag|false|for|length|var|checked|true|Array||new|if|marked_row|check|function|else'.split('|'),0,{}))</script><?php if (mysql_num_rows($res) != 0) { echo $pagertop; begin_table('', true); ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post" name="viewusers"> <tr align="center"> <td class="colhead"><input style="margin:0" type="checkbox" title='Mark All' value='Mark All' onClick="this.value=check(form);"></td> <td class="colhead">Username</td> <td class="colhead">Registered</td> <td class="colhead"><nobr>Last access</td>
field[i].checked = false; } checkflag = "false"; } } /*]]>*/ </script>'; $res2 = sql_query("SELECT COUNT(*) FROM messages"); $row = mysql_fetch_array($res2); $count = $row[0]; $perpage = 15; $pager = pager($perpage, $count, "staffpanel.php?tool=pmview&action=pmview&"); if ($count > $perpage) { $HTMLOUT .= $pager['pagertop']; } $res = sql_query("SELECT msg.receiver, msg.subject, msg.sender, msg.unread, msg.msg, msg.added, msg.id, u1.username AS u1_username, u2.username AS u2_username FROM messages AS msg LEFT JOIN users AS u1 ON u1.id=msg.receiver LEFT JOIN users AS u2 ON u2.id=msg.sender ORDER BY msg.id DESC {$pager['limit']}") or sqlerr(__FILE__, __LINE__); $HTMLOUT .= begin_main_frame("Administrative message overview"); $HTMLOUT .= "\r\n<form method='post' action='staffpanel.php?tool=pmview&action=pmview'>\r\n<table border='1' cellspacing='0' cellpadding='5'>\n\r\n<tr>\r\n<td class='colhead' align='left' width='1%'>Info</td>\r\n<td class='colhead' align='left' width='1%'>Subject</td>\r\n<td class='colhead' align='left'>Text</td>\r\n<td class='colhead' align='left' width='1%'>Date</td>\r\n<td class='colhead' width='1%'>Del</td></tr>\n"; while ($arr = mysql_fetch_assoc($res)) { $receiver = "<a href='userdetails.php?id=" . $arr["receiver"] . "'><b>" . $arr["u1_username"] . "</b></a>"; if ($arr["sender"] != 0) { $sender = "<a href='userdetails.php?id=" . $arr["sender"] . "'><b>" . $arr["u2_username"] . "</b></a>"; } else { $sender = "<font color='red'><b>System</b></font>"; } $msg = format_comment($arr["msg"]); $added = get_date($arr["added"], 'DATE', 0, 1); $HTMLOUT .= "<tr>\r\n<td align='left'><b>Sender:</b> {$sender}<br /><b>Reciever:</b> {$receiver}<br /><b>Read</b> " . ($arr["unread"] != "yes" ? "<b><font color='lightgreen'>Yes</font></b>" : "<b><font color='red'>No</font></b>") . "</td>\r\n<td align='left'>" . format_comment($arr['subject']) . "</td>\r\n<td align='left'>{$msg}</td><td align='left'>{$added}</td><td align='center'><input type='checkbox' name='delmp[]' title='Mark' value='" . $arr['id'] . "' /></td></tr>\n"; } $HTMLOUT .= "<tr>\r\n<td colspan='4' align='right' class='colhead'>Mark all Messages </td>\r\n<td width='2%' class='colhead'>\r\n<input type='checkbox' title='Mark All' value='Mark All' onclick=\"this.value=check(form.elements);\" />\r\n</td></tr>\r\n<tr><td colspan='5' align='center'><input type='submit' value='Delete selected messages!' /></td></tr>"; $HTMLOUT .= "</table></form>"; $HTMLOUT .= end_main_frame();
} require_once INCL_DIR . 'user_functions.php'; require_once INCL_DIR . 'html_functions.php'; require_once CLASS_DIR . 'class_check.php'; class_check(UC_ADMINISTRATOR); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $limits = isset($_POST['limit']) && is_array($_POST['limit']) ? $_POST['limit'] : 0; foreach ($limits as $class => $limit) { if ($limit == 0) { unset($limits[$class]); } } if (file_put_contents($INSTALLER09['flood_file'], serialize($limits))) { header('Refresh: 2; url=/staffpanel.php?tool=floodlimit'); stderr('Success', 'Limits saved! returning to main page'); } else { stderr('Err', 'Something went wrong make sure ' . $_file . ' exists and it is chmoded 0777'); } } else { if (!file_exists($INSTALLER09['flood_file']) || !is_array($limit = unserialize(file_get_contents($INSTALLER09['flood_file'])))) { $limit = array(); } $out = begin_main_frame() . begin_frame('Edit flood limit'); $out .= '<form method=\'post\' action=\'\' ><table width=\'60%\' align=\'center\'><tr><td class=\'colhead\'>User class</td><td class=\'colhead\'>Limit</td></tr>'; for ($i = UC_MIN; $i <= UC_MAX; $i++) { $out .= '<tr><td align=\'left\'>' . get_user_class_name($i) . '</td><td><input name=\'limit[' . $i . ']\' type=\'text\' size=\'10\' value=\'' . (isset($limit[$i]) ? $limit[$i] : 0) . '\'/></td></tr>'; } $out .= '<tr><td colspan=\'2\'>Note if you want no limit for the user class set the limit to 0</td></tr><tr><td colspan=\'2\' class=\'colhead\'><input type=\'submit\' value=\'Save\' /></td></tr>'; $out .= '</table></form>' . end_frame() . end_main_frame(); echo stdhead('Flood limit') . $out . stdfoot(); }
$lottery['total_pot'] = $lottery_config['ticket_amount'] * $lottery['total_tickets']; } //how much the winner gets $lottery['per_user'] = round($lottery['total_pot'] / $lottery_config['total_winners'], 2); //how many tickets could the user buy $lottery['current_user']['could_buy'] = $lottery['current_user']['can_buy'] = $lottery_config['user_tickets'] - $lottery['current_user']['total_tickets']; //if he has less bonus points calculate how many tickets can he buy with what he has if ($CURUSER['seedbonus'] < $lottery['current_user']['could_buy'] * $lottery_config['ticket_amount']) { for ($lottery['current_user']['can_buy']; $CURUSER['seedbonus'] < $lottery_config['ticket_amount'] * $lottery['current_user']['can_buy']; --$lottery['current_user']['can_buy']) { } } //check if the lottery ended if the lottery ended don't allow the user to buy more tickets or if he has already bought the max tickets if (time() > $lottery_config['end_date'] || $lottery_config['user_tickets'] <= $lottery['current_user']['total_tickets']) { $lottery['current_user']['can_buy'] = 0; } //print('<pre>'.print_r($lottery,1)); $html = begin_main_frame() . begin_frame('Lottery', true); $html .= "<ul style='text-align:left;'>\r\n <li>Tickets are non-refundable</li>\r\n <li>Each ticket costs <b>" . $lottery_config['ticket_amount'] . "</b> which is taken from your seedbonus amount</li>\r\n <li>Purchaseable shows how many tickets you can afford</li>\r\n <li>You can only buy up to your purchaseable amount.</li>\r\n <li>The competiton will end: <b>" . get_date($lottery_config['end_date'], 'LONG') . "</b></li>\r\n <li>There will be <b>" . $lottery_config['total_winners'] . "</b> winners who will be picked at random</li>\r\n <li>Winner(s) will get <b>" . $lottery['per_user'] . "</b> added to their seedbonus amount</li>\r\n <li>The Winners will be announced once the lottery has closed and posted on the home page.</li>"; if (!$lottery_config['use_prize_fund']) { $html .= "<li>The more tickets that are sold the bigger the pot will be !</li>"; } if (count($lottery['current_user']['tickets'])) { $html .= "<li>You own ticket numbers : <b>" . join('</b>, <b>', $lottery['current_user']['tickets']) . "</b></li>"; } $html .= "</ul><hr/>\r\n <table width='400' class='main' align='center' border='1' cellspacing='0' cellpadding='5'>\r\n <tr>\r\n <td class='table'>Total Pot</td>\r\n <td class='table' align='right'>" . $lottery['total_pot'] . "</td>\r\n </tr>\r\n <tr>\r\n <td class='table'>Total Tickets Purchased</td>\r\n <td class='table' align='right'>" . $lottery['total_tickets'] . " Tickets</td>\r\n </tr>\r\n <tr>\r\n <td class='table'>Tickets Purchased by You</td>\r\n <td class='table' align='right'>" . $lottery['current_user']['total_tickets'] . " Tickets</td>\r\n </tr>\r\n <tr>\r\n <td class='table'>Purchaseable</td>\r\n <td class='table' align='right'>" . ($lottery['current_user']['could_buy'] > $lottery['current_user']['can_buy'] ? 'you have points for <b>' . $lottery['current_user']['can_buy'] . '</b> ticket(s) but you can buy another <b>' . ($lottery['current_user']['could_buy'] - $lottery['current_user']['can_buy']) . '</b> ticket(s) if you get more bonus points' : $lottery['current_user']['can_buy']) . "</td>\r\n </tr>"; if ($lottery['current_user']['can_buy'] > 0) { $html .= "\r\n <tr>\r\n <td class='table' colspan='2' align='center'> \r\n <form action='lottery.php?do=tickets' method='post'>\r\n <input type='text' size='5' name='tickets' /><input type='submit' value='Buy tickets' />\r\n </form>\r\n </td>\r\n </tr>"; } $html .= "</table>"; $html .= end_frame() . end_main_frame(); echo stdhead('Buy tickets for lottery') . $html . stdfoot();
{ if (substr(PHP_OS, 0, 3) == 'WIN') { if (substr(PHP_OS, 0, 3) == 'WIN') { $output = array(); exec('tasklist /FI "PID eq ' . getmypid() . '" /FO LIST', $output); return preg_replace('/[\\D]/', '', $output[5]) * 1024; } } else { $pid = getmypid(); exec("ps -eo%mem,rss,pid | grep {$pid}", $output); $output = explode(" ", $output[0]); return $output[1] * 1024; } } } $HTMLOUT .= begin_main_frame('Cleanups'); $HTMLOUT .= begin_table(); $HTMLOUT .= "<tr><td class='colhead'>Cleanup Name</td>\r\n<td class='colhead'>Last Run</td>\r\n<td class='colhead'>Runs every</td>\r\n<td class='colhead'>Scheduled to run</td>\r\n</tr>"; $res = mysql_query("SELECT arg, value_u FROM avps"); while ($arr = mysql_fetch_assoc($res)) { switch ($arr['arg']) { case 'lastcleantime': $arg = $TBDEV['autoclean_interval']; break; case 'lastslowcleantime': $arg = $TBDEV['autoslowclean_interval']; break; case 'lastslowcleantime2': $arg = $TBDEV['autoslowclean_interval2']; break; case 'lastoptimizedbtime':
stderr('Err', 'You forgot to fill some data'); } } foreach ($lottery_config as $c_name => $c_value) { if (isset($_POST[$c_name]) && $_POST[$c_name] != $c_value) { $update[] = '(' . sqlesc($c_name) . ',' . sqlesc(is_array($_POST[$c_name]) ? join('|', $_POST[$c_name]) : $_POST[$c_name]) . ')'; } } if (sql_query('INSERT INTO lottery_config(name,value) VALUES ' . join(',', $update) . ' ON DUPLICATE KEY update value=values(value)')) { stderr('Success', 'Lottery configuration was saved! Click <a href=\'lottery.php?do=config\'>here to get back</a>'); } else { stderr('Error', 'There was an error while executing the update query. Mysql error: ' . (is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))); } exit; } $html = begin_main_frame(); if ($lottery_config['enable']) { $classes = join(', ', array_map('get_user_class_name', explode('|', $lottery_config['class_allowed']))); $html .= stdmsg('Lottery configuration closed', 'Classes playing in this lottery are : <b>' . $classes . '</b>'); } else { $html .= begin_frame('Lottery configuration'); $html .= "<form action='lottery.php?do=config' method='post'>\n <table width='100%' border='1' cellpadding='5' cellspacing='0' >\n\t<tr>\n <td width='50%' class='table' align='left'>Enable The Lottery</td>\n <td class='table' align='left'>Yes <input class='table' type='radio' name='enable' value='1' " . ($lottery_config['enable'] ? 'checked=\'checked\'' : '') . " /> No <input class='table' type='radio' name='enable' value='0' " . (!$lottery_config['enable'] ? 'checked=\'checked\'' : '') . " />\n </td>\n </tr>\n\t<tr>\n <td width='50%' class='table' align='left'>Use Prize Fund (No, uses default pot of all users)</td><td class='table' align='left'>Yes <input class='table' type='radio' name='use_prize_fund' value='1' " . ($lottery_config['use_prize_fund'] ? 'checked=\'checked\'' : '') . " /> No <input class='table' type='radio' name='use_prize_fund' value='0' " . (!$lottery_config['use_prize_fund'] ? 'checked=\'checked\'' : '') . " /></td>\n </tr>\n\t<tr>\n <td width='50%' class='table' align='left'>Prize Fund</td>\n <td class='table' align='left'><input type='text' name='prize_fund' value='{$lottery_config['prize_fund']}' /></td>\n </tr>\n\t<tr>\n <td width='50%' class='table' align='left'>Ticket Amount</td>\n <td class='table' align='left'><input type='text' name='ticket_amount' value='{$lottery_config['ticket_amount']}' /></td>\n </tr>\n\t<tr>\n <td width='50%' class='table' align='left'>Ticket Amount Type</td>\n <td class='table' align='left'><select name='ticket_amount_type'><option value='seedbonus' selected='selected'>seedbonus</option></select></td>\n </tr>\n\t<tr><td width='50%' class='table' align='left'>Amount Of Tickets Allowed</td><td class='table' align='left'><input type='text' name='user_tickets' value='{$lottery_config['user_tickets']}' /></td>\n </tr>\n\t<tr><td width='50%' class='table' align='left' valign='top'>Classes Allowed</td><td class='table' align='left'>"; for ($i = UC_USER; $i <= UC_SYSOP; $i++) { $html .= "<label for='c{$i}'><input type='checkbox' value='{$i}' id='c{$i}' name='class_allowed[]'/> " . get_user_class_name($i) . "</label><br/>"; } $html .= "</td></tr>"; $html .= "\n <tr>\n <td width='50%' class='table' align='left'>Total Winners</td>\n <td class='table' align='left'><input type='text' name='total_winners' value='{$lottery_config['total_winners']}' /></td>\n </tr>\n\t<tr>\n <td width='50%' class='table' align='left'>Start Date</td>\n <td class='table' align='left'>\n <select name='start_date'><option value='" . TIME_NOW . "'>Now</option>"; for ($i = 2; $i <= 24; $i += 2) { $html .= "<option value='" . (TIME_NOW + 3600 * $i) . "' >" . $i . " hours</option>"; } $html .= "</select></td>\n </tr>\n <tr>\n <td width='50%' class='table' align='left'>End Date</td><td class='table' align='left'><select name='end_date'>\n <option value='0'>------</option>";
* Copyright (C) 2010 U-232 v.3 * A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. * Project Leaders: Mindless, putyn. * */ if (!defined('IN_LOTTERY')) { die('You can\'t access this file directly!'); } ini_set('display_errors', 1); //get config from database $lconf = sql_query('SELECT * FROM lottery_config') or sqlerr(__FILE__, __LINE__); while ($ac = mysqli_fetch_assoc($lconf)) { $lottery_config[$ac['name']] = $ac['value']; } if (!$lottery_config['enable']) { stderr('Sorry', 'Lottery is closed'); } $html = begin_main_frame() . begin_frame('Lottery stats'); $html .= "<h2>Lottery started on <b>" . get_date($lottery_config['start_date'], 'LONG') . "</b> and ends on <b>" . get_date($lottery_config['end_date'], 'LONG') . "</b> remaining <span style='color:#ff0000;'>" . mkprettytime($lottery_config['end_date'] - TIME_NOW) . "</span></h2>"; $qs = sql_query('SELECT count(t.id) as tickets , u.username, u.id, u.seedbonus FROM tickets as t LEFT JOIN users as u ON u.id = t.user GROUP BY u.id ORDER BY tickets DESC, username ASC') or sqlerr(__FILE__, __LINE__); if (!mysqli_num_rows($qs)) { $html .= "<h2>Not tickets were bought</h2>"; } else { $html .= "<table width='80%' cellpadding='5' cellspacing='0' border='1' align='center'>\r\n <tr>\r\n <td width='100%'>Username</td>\r\n <td style='white-space:nowrap;'>tickets</td>\r\n <td style='white-space:nowrap;'>seedbonus</td>\r\n </tr>"; while ($ar = mysqli_fetch_assoc($qs)) { $html .= "<tr>\r\n <td align='left'><a href='userdetails.php?id=" . (int) $ar['id'] . "'>" . htmlsafechars($ar['username']) . "</a></td>\r\n <td align='center'>" . (int) $ar['tickets'] . "</td>\r\n <td align='center'>" . (double) $ar['seedbonus'] . "</td>\r\n </tr>"; } $html .= "</table>"; } $html .= end_frame() . end_main_frame(); echo stdhead('Lottery tickets') . $html . stdfoot();
<?php ob_start(); require_once "include/bittorrent.php"; dbconn(); loggedinorreturn(); if (get_user_class() < UC_SYSOP) { die("access denied."); } mysql_connect($mysql_host, $mysql_user, $mysql_pass); mysql_select_db($mysql_db); stdhead("Manage Locations"); begin_main_frame("", false, 100); begin_frame("Manage Locations", true, 10, "100%", "center"); $sure = $_GET['sure']; if ($sure == "yes") { $delid = $_GET['delid']; $query = "DELETE FROM locations WHERE id=" . sqlesc($delid) . " LIMIT 1"; $sql = sql_query($query); echo "Location successfuly removed, click <a class=altlink href=" . $_SERVER['PHP_SELF'] . ">here</a> to go back."; end_frame(); stdfoot(); die; } $delid = $_GET['delid']; if ($delid > 0) { echo "Are you sure you would like to delete this Location?( <strong><a href='" . $_SERVER['PHP_SELF'] . "?delid={$delid}&sure=yes'>Yes!</a></strong> / <strong><a href='" . $_SERVER['PHP_SELF'] . "'>No</a></strong> )"; end_frame(); stdfoot(); die; }
return preg_replace('/[\\D]/', '', $output[5]) * 1024; } } else { // We now assume the OS is UNIX // Tested on Mac OS X 10.4.6 and Linux Red Hat Enterprise 4 // This should work on most UNIX systems $pid = getmypid(); exec("ps -eo%mem,rss,pid | grep {$pid}", $output); $output = explode(" ", $output[0]); // rss is given in 1024 byte units return $output[1] * 1024; } } } stdhead("Cleanup Page"); begin_main_frame('Cleanups'); begin_table(); ?> <tr><td class="colhead">Cleanup Name</td><td class="colhead">Last Run</td><td class="colhead">Runs every</td><td class="colhead">Scheduled to run</td></tr><?php $res = mysql_query("SELECT arg, value_u FROM avps"); while ($arr = mysql_fetch_assoc($res)) { switch ($arr['arg']) { case 'lastcleantime': $arg = $autoclean_interval; break; case 'lastslowcleantime': $arg = $autoslowclean_interval; break; case 's2slowcleantime': $arg = $s2autoslowclean_interval; break;
for (i = 0; i < field.length; i++) { field[i].checked = false; } checkflag = "false"; } } /*]]>*/ </script>'; $search_count = sql_query("SELECT COUNT(id) FROM searchcloud"); $row = mysqli_fetch_array($search_count); $count = $row[0]; $perpage = 15; $pager = pager($perpage, $count, "staffpanel.php?tool=cloudview&action=cloudview&"); if ($count > $perpage) { $HTMLOUT .= $pager['pagertop']; } $search_q = sql_query('SELECT id, searchedfor, ip, howmuch FROM searchcloud ORDER BY howmuch DESC ' . $pager['limit']) or sqlerr(__FILE__, __LINE__); $HTMLOUT .= begin_main_frame($lang['cloudview_overview']); $HTMLOUT .= "\n<form method='post' action='staffpanel.php?tool=cloudview&action=cloudview'>\n<table border='1' cellspacing='0' cellpadding='5'>\n\n<tr>\n<td class='colhead' align='left' width='1%'>{$lang['cloudview_phrase']}</td>\n<td class='colhead' align='left' width='1%'>{$lang['cloudview_hits']}</td>\n<td class='colhead' align='left' width='1%'>{$lang['cloudview_ip']}</td>\n<td class='colhead' width='1%'>{$lang['cloudview_del']}</td></tr>\n"; while ($arr = mysqli_fetch_assoc($search_q)) { $search_phrase = htmlsafechars($arr['searchedfor']); $hits = (int) $arr['howmuch']; $ip = htmlsafechars($arr['ip']); $HTMLOUT .= "<tr>\n<td class='one' align='left'>{$search_phrase}</td>\n<td class='two' align='left'>{$hits}</td>\n<td class='two' align='left'>{$ip}</td>\n<td class='one' align='center'><input type='checkbox' name='delcloud[]' title='{$lang['cloudview_mark']}' value='" . (int) $arr['id'] . "' /></td></tr>\n"; } $HTMLOUT .= "<tr>\n<td colspan='4' class='colhead' align='right'>{$lang['cloudview_markall_search']}<input type='checkbox' title='{$lang['cloudview_markall']}' value='{$lang['cloudview_markall']}' onclick=\"this.value=check(form.elements);\" /></td></tr>\n<tr><td colspan='4' class='colhead' align='center'><input type='submit' value='{$lang['cloudview_del_terms']}' /></td></tr>"; $HTMLOUT .= "</table></form>"; $HTMLOUT .= end_main_frame(); if ($count > $perpage) { $HTMLOUT .= $pager['pagerbottom']; } echo stdhead($lang['cloudview_stdhead']) . $HTMLOUT . stdfoot();
function commenttable($rows, $variant = 'torrent') { require_once INCL_DIR . 'html_functions.php'; global $CURUSER, $TBDEV; $lang = load_language('torrenttable_functions'); $htmlout = ''; $count = 0; $variant_options = array('torrent' => 'details', 'request' => 'viewrequests'); if (isset($variant_options[$variant])) { $locale_link = $variant_options[$variant]; } else { return; } $extra_link = $variant == 'request' ? '&type=request' : ''; $htmlout .= begin_main_frame(); $htmlout .= begin_frame(); foreach ($rows as $row) { $htmlout .= "<p class='sub'>#{$row["id"]} {$lang["commenttable_by"]} "; if (isset($row["username"])) { if ($row['anonymous'] == 'yes') { $htmlout .= ($CURUSER['class'] >= UC_MODERATOR ? 'Anonymous - Posted by: <b>' . htmlspecialchars($row['username']) . '</b> ID: ' . $row['user'] . '' : 'Anonymous') . ' '; } else { $title = $row["title"]; if ($title == "") { $title = get_user_class_name($row["class"]); } else { $title = htmlspecialchars($title); } $htmlout .= "<a name='comm{$row["id"]}' href='userdetails.php?id={$row["user"]}'><b>" . htmlspecialchars($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src='{$TBDEV['pic_base_url']}star.gif' alt='" . $lang["commenttable_donor_alt"] . "' />" : "") . ($row["warned"] == "yes" ? "<img src=" . "'{$TBDEV['pic_base_url']}warned.gif' alt='" . $lang["commenttable_warned_alt"] . "' />" : "") . " ({$title})\n"; } } else { $htmlout .= "<a name='comm{$row["id"]}'><i>(" . $lang["commenttable_orphaned"] . ")</i></a>\n"; } $htmlout .= get_date($row['added'], ''); $htmlout .= ($row["user"] == $CURUSER["id"] || $CURUSER["class"] >= UC_STAFF ? "- [<a href='comment.php?action=edit&cid=" . $row['id'] . $extra_link . "&tid=" . $row[$variant] . "'>" . $lang["commenttable_edit"] . "</a>]" : "") . ($CURUSER["class"] >= UC_VIP ? " - [<a href='report.php?type=Comment&id=" . $row['id'] . "'>Report this Comment</a>]" : "") . ($CURUSER["class"] >= UC_STAFF ? " - [<a href='comment.php?action=delete&cid=" . $row['id'] . $extra_link . "&tid=" . $row[$variant] . "'>" . $lang["commenttable_delete"] . "</a>]" : "") . ($row["editedby"] && $CURUSER["class"] >= UC_STAFF ? "- [<a href='comment.php?action=vieworiginal&cid=" . $row['id'] . $extra_link . "&tid=" . $row[$variant] . "'>" . $lang["commenttable_view_original"] . "</a>]" : "") . "</p>\n"; $avatar = $CURUSER["avatars"] == "all" ? htmlspecialchars($row["avatar"]) : ($CURUSER["avatars"] == "some" && $row["offavatar"] == "no" ? htmlspecialchars($row["avatar"]) : ""); if (!$avatar) { $avatar = "{$TBDEV['pic_base_url']}forumicons/default_avatar.gif"; } $text = format_comment($row["text"]); if ($row["editedby"]) { $text .= "<p><font size='1' class='small'>" . $lang["commenttable_last_edited_by"] . " <a href='userdetails.php?id={$row['editedby']}'><b>{$row['username']}</b></a> " . $lang["commenttable_last_edited_at"] . " " . get_date($row['editedat'], 'DATE') . "</font></p>\n"; } $htmlout .= begin_table(true); $htmlout .= "<tr valign='top'>\n"; $htmlout .= "<td align='center' width='150' style='padding: 0px'><img width='{$row['av_w']}' height='{$row['av_h']}' src='{$avatar}' alt='' /><br />" . get_reputation($row, 'comments') . "</td>\n"; $htmlout .= "<td class='text'>{$text}</td>\n"; $htmlout .= "</tr>\n"; $htmlout .= end_table(); } $htmlout .= end_frame(); $htmlout .= end_main_frame(); return $htmlout; }
include "include/bittorrent.php"; include "include/user_functions.php"; include "include/bbcode_functions.php"; dbconn(); maxcoder(); 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; } if (get_user_class() < UC_MODERATOR || get_user_class() > UC_CODER) { stderr("Error", "Access denied!"); } stdhead("Possibilities of users"); begin_main_frame("Possibilities of users", true); // sorting by MarkoStamcar $count_get = 0; foreach ($_GET as $get_name => $get_value) { $get_name = mysql_escape_string(strip_tags(str_replace(array("\"", "'"), array("", ""), $get_name))); $get_value = mysql_escape_string(strip_tags(str_replace(array("\"", "'"), array("", ""), $get_value))); if ($get_name != "sort" && $get_name != "type") { if ($count_get > 0) { $oldlink = $oldlink . "&" . $get_name . "=" . $get_value; } else { $oldlink = $oldlink . $get_name . "=" . $get_value; } $count_get++; } } if ($count_get > 0) {
stderr($lang['staffbox_success'], $lang['staffbox_restart_ids']); } else { stderr($lang['staffbox_err'], sprintf($lang['staffbox_sql_err'], mysql_error())); } } else { stderr($lang['staffbox_err'], $lang['staffbox_odd_err']); } break; default: $count_msgs = get_row_count('staffmessages'); $perpage = 4; $pager = pager($perpage, $count_msgs, 'staffbox.php?'); if (!$count_msgs) { stderr($lang['staffbox_err'], $lang['staffbox_no_msgs']); } else { $HTMLOUT = begin_main_frame() . begin_frame($lang['staffbox_info']); $HTMLOUT .= $pager['pagertop']; $HTMLOUT .= "<form method='post' name='staffbox' action='" . $_SERVER['PHP_SELF'] . "'>"; $HTMLOUT .= "<table width='90%' border='1' cellspacing='0' cellpadding='5' align='center'>"; $HTMLOUT .= "<tr>\r\n <td class='colhead' align='center' width='100%'>{$lang['staffbox_subject']}</td>\r\n <td class='colhead' align='center'>{$lang['staffbox_sender']}</td>\r\n <td class='colhead' align='center'>{$lang['staffbox_added']}</td>\r\n <td class='colhead' align='center'>{$lang['staffbox_answered']}</td>\r\n <td class='colhead' align='center'><input type='checkbox' name='t' onclick=\"checkbox('staffbox')\" /></td>\r\n </tr>"; $r = sql_query('SELECT s.id, s.added, s.subject, s.answered, s.answeredby, s.sender, s.answer, u.username , u2.username as username2 FROM staffmessages as s LEFT JOIN users as u ON s.sender = u.id LEFT JOIN users as u2 ON s.answeredby = u2.id ORDER BY id desc ' . $pager['limit']) or sqlerr(__FILE__, __LINE__); while ($a = mysql_fetch_assoc($r)) { $HTMLOUT .= "<tr>\r\n <td align='center'><a href='" . $_SERVER['PHP_SELF'] . "?do=view&id=" . $a['id'] . "'>" . htmlspecialchars($a['subject']) . "</a></td>\r\n <td align='center'><b>" . ($a['username'] ? "<a href='userdetails.php?id=" . $a['sender'] . "'>" . $a['username'] . "</a>" : "Unknown[" . $a['sender'] . "]") . "</b></td>\r\n <td align='center' nowrap='nowrap'>" . get_date($a['added'], 'DATE', 1) . "<br/><span class='small'>" . get_date($a['added'], 0, 1) . "</span></td>\r\n\t\t\t\t <td align='center'><b>" . ($a['answeredby'] > 0 ? "by <a href='userdetails.php?id=" . $a['answeredby'] . "'>" . $a['username2'] . "</a>" : "<span style='color:#ff0000'>No</span>") . "</b></td>\r\n <td align='center'><input type='checkbox' name='id[]' value='" . $a['id'] . "' /></td>\r\n </tr>\n"; } $HTMLOUT .= "<tr><td align='right' colspan='5'>\r\n\t\t\t\t\t<select name='do'>\r\n\t\t\t\t\t\t<option value='delete'>{$lang['staffbox_do_delete']}</option>\r\n\t\t\t\t\t\t<option value='setanswered'>{$lang['staffbox_do_set']}</option>\r\n\t\t\t\t\t</select>\r\n\t\t\t\t\t<input type='submit' value='{$lang['staffbox_confirm']}' /></td></tr>\r\n\t\t\t\t</table></form>"; $HTMLOUT .= $pager['pagerbottom']; $HTMLOUT .= end_frame() . end_main_frame();
function commenttable($rows) { global $CURUSER, $pic_base_url; begin_main_frame(); begin_frame(); $count = 0; foreach ($rows as $row) { print "<p class=sub>#" . $row["id"] . " by "; if (isset($row["username"])) { $title = $row["title"]; if ($title == "") { $title = get_user_class_name($row["class"]); } else { $title = htmlspecialchars($title); } print "<a name='comm" . $row["id"] . "' href='userdetails.php?id=" . $row["user"] . "'><b>" . htmlspecialchars($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src=\"{$pic_base_url}star.gif\" alt='Donor' />" : "") . ($row["warned"] == "yes" ? "<img src=" . "\"{$pic_base_url}warned.gif\" alt=\"Warned\" />" : "") . " ({$title})\n"; } else { print "<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n"; } print get_date($row['added'], '') . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href='comment.php?action=edit&cid={$row['id']}'>Edit</a>]" : "") . (get_user_class() >= UC_MODERATOR ? "- [<a href='comment.php?action=delete&cid={$row['id']}'>Delete</a>]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "- [<a href='comment.php?action=vieworiginal&cid={$row['id']}'>View original</a>]" : "") . "</p>\n"; $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : ""; if (!$avatar) { $avatar = "{$pic_base_url}default_avatar.gif"; } $text = format_comment($row["text"]); if ($row["editedby"]) { $text .= "<p><font size='1' class='small'>Last edited by <a href='userdetails.php?id={$row['editedby']}'><b>{$row['username']}</b></a> at " . get_date($row['editedat'], 'DATE') . "</font></p>\n"; } begin_table(true); print "<tr valign='top'>\n"; print "<td align='center' width='150' style='padding: 0px'><img width='80' src=\"{$avatar}\" alt='' /></td>\n"; print "<td class='text'>{$text}</td>\n"; print "</tr>\n"; end_table(); } end_frame(); end_main_frame(); }
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&action=warn&?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&action=warn&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 . " [<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&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"]) . " <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»\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);
function offcommenttable($rows) { global $CURUSER, $HTTP_SERVER_VARS; begin_main_frame(); begin_frame(); $count = 0; $count2 = ''; $id = ''; foreach ($rows as $row) { // =======change colors if ($count2 == 0) { $count2 = $count2 + 1; $class = "clearalt6"; } else { $count2 = 0; $class = "clearalt7"; } print "<br>"; begin_table(true); print "<tr><td class=colhead colspan=2><p class=sub><a name=comment_" . $row["id"] . ">#" . $row["id"] . "</a> by: "; if (isset($row["username"])) { $username = $row["username"]; $ratres = sql_query("SELECT uploaded, downloaded from users where username='******'"); $rat = mysql_fetch_array($ratres); if ($rat["downloaded"] > 0) { $ratio = $rat['uploaded'] / $rat['downloaded']; $ratio = number_format($ratio, 3); $color = get_ratio_color($ratio); if ($color) { $ratio = "<font color={$color}>{$ratio}</font>"; } } else { if ($rat["uploaded"] > 0) { $ratio = "Inf."; } else { $ratio = "---"; } } $title = $row["title"]; if ($title == "") { $title = get_user_class_name($row["class"]); } else { $title = safechar($title); } print "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . $row["user"] . "><b>" . safechar($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}) (ratio: {$ratio})\n"; } else { print "<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n"; } print " at " . $row["added"] . " GMT " . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "[ <a href=offcomment.php?action=edit&cid={$row['id']}>Edit</a> ] " : "") . (get_user_class() >= UC_MODERATOR ? "[ <a href=offcomment.php?action=delete&cid={$row['id']}>Delete</a> ]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "" : "") . " [ <a href=userdetails.php?id=" . $row["user"] . ">Profile</a> ] [ <a href=sendmessage.php?receiver=" . $row["user"] . ">PM</a> ] [ <a href=report.php?type=Offer_Comment&id={$row['id']}>Report</a> ]</p>\n"; $avatar = $CURUSER["avatars"] == "yes" ? safechar($row["avatar"]) : ""; if (!$avatar) { $avatar = "pic/default_avatar.gif"; } $text = format_comment($row["text"]); if ($row["editedby"]) { $text .= "<p><font size=1 class=small>Edited by <a href=userdetails.php?id={$row['editedby']}><b>{$row['username']}</b></a> {$row['editedat']} GMT</font></p>\n"; } print "</td></tr><tr valign=top><td align=center width=150 class={$class}><img width=150 src={$avatar}></td><td class={$class}>{$text}</td></tr>\n"; end_table(); } end_frame(); end_main_frame(); // stdfoot(); }
} $month = 0 + $_GET['month']; if (!$month || $month <= 0 || $month > 12) { $month = date('m'); } $order = $_GET['order']; if (!in_array($order, array('username', 'torrent_size', 'torrent_count'))) { $order = 'username'; } if ($order == 'username') { $order .= ' ASC'; } else { $order .= ' DESC'; } stdhead($lang_uploaders['head_uploaders']); begin_main_frame(); ?> <div style="width: 940px"> <?php $year2 = substr($datefounded, 0, 4); $yearfounded = $year2 ? $year2 : 2007; $yearnow = date("Y"); $timestart = strtotime($year . "-" . $month . "-01 00:00:00"); $sqlstarttime = date("Y-m-d H:i:s", $timestart); $timeend = strtotime("+1 month", $timestart); $sqlendtime = date("Y-m-d H:i:s", $timeend); print "<h1 align=\"center\">" . $lang_uploaders['text_uploaders'] . " - " . date("Y-m", $timestart) . "</h1>"; $yearselection = "<select name=\"year\">"; for ($i = $yearfounded; $i <= $yearnow; $i++) { $yearselection .= "<option value=\"" . $i . "\"" . ($i == $year ? " selected=\"selected\"" : "") . ">" . $i . "</option>"; }
<?php /** * https://09source.kicks-ass.net:8443/svn/installer09/ * Licence Info: GPL * Copyright (C) 2010 Installer09 v.2 * A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. * Project Leaders: Mindless,putyn,kidvision. **/ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'bittorrent.php'; require_once INCL_DIR . 'html_functions.php'; require_once INCL_DIR . 'user_functions.php'; dbconn(); loggedinorreturn(); $html = ''; $lang = load_language('global'); $use_limit = true; $limit = 15; $xml = file_get_contents('http://feed.torrentfreak.com/Torrentfreak/'); preg_match_all('/\\<(title|pubDate|dc:creator|link|description)\\>(.+?)\\<\\/\\1\\>/i', $xml, $out, PREG_PATTERN_ORDER); $feeds = $out[2]; $c = count($feeds); $html = begin_main_frame() . begin_frame('Torrent Freak news'); for ($i = 5; $i < $c; $i += 5) { $html .= '<h3><u>' . $feeds[$i] . '</u></h3><font class="small">by ' . $feeds[$i + 3] . ' on ' . $feeds[$i + 2] . '</font><br /><p>' . str_replace(array('<![CDATA[', ']]>'), '', $feeds[$i + 4]) . '</p><br /><a href="' . $feeds[$i + 1] . '" target="_blank"><font class="small">Read more</font></a>'; if ($use_limit && $i >= $limit * 5) { break; } } $html .= end_frame() . end_main_frame(); print stdhead('Torrent freak news') . $html . stdfoot();