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(); }
/** |--------------------------------------------------------------------------| | 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 newerr($heading = '', $text = '', $die = true, $foot = true, $div = 'error', $htmlstrip = false) { newmsg($heading, $text, $div, $htmlstrip); if ($foot) { end_main_frame(); } stdfoot(); if ($die) { die; } }
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; }
function usercommenttable($rows) { global $CURUSER, $pic_base_url, $userid; 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 " 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" ? 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 {$row['editedat']} GMT</font></p>\n"; } 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(); }
} 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();
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 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(); }
function editForum() { stdhead("Edit Forum"); $id = isset($_GET["id"]) ? (int) $_GET["id"] : stderr("Error", "Not Found"); echo '<span class="btn"><a href="forummanage.php">Cancel</a></span><br /><br />'; begin_frame("Edit Forum"); $result = mysql_query("SELECT * FROM forums where id = '{$id}'"); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { ?> <form method="post" action="forummanage.php?action=takeedit"> <table width="600" border="0" cellspacing="0" cellpadding="3" align="center"> <tr align="center"> <td colspan="2" class='colhead'>Edit Forum: <?php echo htmlentities($row["name"], ENT_QUOTES); ?> </td> </tr> <tr> <td><b>Forum Name</b></td> <td><input name="name" type="text" size="30" maxlength="60" value="<?php echo htmlentities($row["name"], ENT_QUOTES); ?> " /></td> </tr> <tr> <td><b>Forum Description</b></td> <td><input name="desc" type="text" size="30" maxlength="200" value="<?php echo htmlentities($row["description"], ENT_QUOTES); ?> " /></td> </tr> <tr> <td><b>Minimun Read Permission</b></td> <td><select name='readclass'> <?php $maxclass = get_user_class(); for ($i = 0; $i <= $maxclass; ++$i) { if (get_user_class_name($i) != "") { print "<option value='{$i}'" . ($row["minclassread"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>"; } } ?> </select> </td> </tr> <tr> <td><b>Minimal Post Rank</b></td> <td><select name='writeclass'> <?php $maxclass = get_user_class(); for ($i = 0; $i <= $maxclass; ++$i) { if (get_user_class_name($i) != "") { print "<option value='{$i}'" . ($row["minclasswrite"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>"; } } ?> </select></td> </tr> <tr> <td><b>Minimal Create Topic Rank</b></td> <td><select name='createclass'> <?php $maxclass = get_user_class(); for ($i = 0; $i <= $maxclass; ++$i) { if (get_user_class_name($i) != "") { print "<option value='{$i}'" . ($row["minclasscreate"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>"; } } ?> </select></td> </tr> <tr> <td><b>Forum Rank</b></td> <td><select name='sort'> <?php $res = mysql_query("SELECT sort FROM forums"); $nr = mysql_num_rows($res); $maxclass = $nr + 1; for ($i = 0; $i <= $maxclass; ++$i) { print "<option value='{$i}'" . ($row["sort"] == $i ? " selected='selected'" : "") . ">{$i}</option>"; } ?> </select> </td> </tr> <tr align="center"> <td colspan="2"> <input type="hidden" name="id" value="<?php echo $id; ?> " /> <input type="submit" name="Submit" value="Edit Forum" class="btn" /> </td> </tr> </table> </form> <?php } } else { print "Sorry, no records were found!"; } // end_frame(); end_main_frame(); stdfoot(); }
function insert_compose_frame($id, $newtopic = true, $quote = false, $attachment = false) { global $CURUSER, $INSTALLER09, $Multi_forum; $htmlout = ''; if ($newtopic) { $res = sql_query("SELECT name FROM forums WHERE id=" . sqlesc($id)) or sqlerr(__FILE__, __LINE__); $arr = mysqli_fetch_assoc($res) or die("Bad forum ID!"); // $htmlout .="<h3>New topic in <a href='{$INSTALLER09['baseurl']}/forums.php?action=viewforum&forumid=".$id."'>".htmlsafechars($arr["name"])."</a> forum</h3>"; $htmlout .= "<!--<div class='navigation'>\n\t\t\t\t<a href='index.php'>" . $INSTALLER09["site_name"] . "</a> \n\t\t\t\t>\n\t\t\t\t<a href='forums.php'>Forums</a>\n\t\t\t\t>\n\t\t\t\t<a href='{$INSTALLER09['baseurl']}/forums.php?action=viewforum&forumid=" . $id . "'>" . htmlsafechars($arr["name"]) . "</a>\n\t\t\t\t<br><img src='templates/1/pic/carbon/nav_bit.png' alt=''>\n\t\t\t\t<span class='active'>New Topic</span>\n\t\t\t\t</div><br />-->"; } else { $res = sql_query("SELECT t.forum_id, t.topic_name, t.locked, f.min_class_read, f.name AS forum_name FROM topics AS t LEFT JOIN forums AS f ON f.id = t.forum_id WHERE t.id=" . sqlesc($id)) or sqlerr(__FILE__, __LINE__); $arr = mysqli_fetch_assoc($res) or die("Forum error, Topic not found."); $forum = htmlsafechars($arr["forum_name"]); $forumid = (int) $arr['forum_id']; if ($arr['locked'] == 'yes') { stderr("Sorry", "The topic is locked."); $htmlout .= end_table(); $htmlout .= end_main_frame(); echo stdhead("Compose", true, $stdhead) . $htmlout . stdfoot($stdfoot); exit; } if ($CURUSER["class"] < $arr["min_class_read"]) { $htmlout .= stdmsg("Sorry", "You are not allowed in here."); $htmlout .= end_table(); $htmlout .= end_main_frame(); echo stdhead("Compose") . $htmlout . stdfoot(); exit; } $htmlout .= "<!--<div class='navigation'>\n\t\t\t\t<a href='index.php'>" . $INSTALLER09["site_name"] . "</a> \n\t\t\t\t>\n\t\t\t\t<a href='forums.php'>Forums</a>\n\t\t\t\t>\n\t\t\t\t<a href='{$INSTALLER09['baseurl']}/forums.php?action=viewforum&forumid=" . $forumid . "'>{$forum}</a>\n\t\t\t\t>\n\t\t\t\t<a href='{$INSTALLER09['baseurl']}/forums.php?action=viewtopic&topicid=" . $id . "'>" . htmlsafechars($arr["topic_name"]) . "</a>\n\t\t\t\t<br><img src='templates/1/pic/carbon/nav_bit.png' alt=''>\n\t\t\t\t<span class='active'>Post Reply</span>\n\t\t\t\t</div><br />-->"; // $htmlout .="<h3 align='center'>Reply to topic:<a href='{$INSTALLER09['baseurl']}/forums.php?action=viewtopic&topicid=".$id."'>".htmlsafechars($arr["topic_name"])."</a></h3>"; } $htmlout .= "\n <script type='text/javascript'>\n /*<![CDATA[*/\n function Preview()\n {\n document.compose.action = './forums/preview.php'\n document.compose.target = '_blank';\n document.compose.submit();\n return true;\n }\n /*]]>*/\n </script>"; //$htmlout .= begin_frame("Compose", true); $htmlout .= "<form method='post' name='compose' action='{$INSTALLER09['baseurl']}/forums.php' enctype='multipart/form-data'>\n\t <input type='hidden' name='action' value='post' />\n\t <input type='hidden' name='" . ($newtopic ? 'forumid' : 'topicid') . "' value='" . $id . "' />"; //$htmlout .= begin_table(true); $htmlout .= "<table border='0' cellspacing='0' cellpadding='5' class='tborder'>\n\t<tr>\n<td class='thead' colspan='2'><strong>Compose</strong></td>\n</tr>\n\t"; if ($newtopic) { $htmlout .= "<tr>\n\t\t\t<td class=row width='10%'>Subject</td>\n\t\t\t<td class=row align='left'>\n\t\t\t\t<input type='text' class='form-control col-md-12' size='100' maxlength='{$Multi_forum['configs']['maxsubjectlength']}' name='topic_name' />\n\t\t\t</td>\n\t\t</tr>"; } if ($quote) { $postid = (int) $_GET["postid"]; if (!is_valid_id($postid)) { stderr("Error", "Invalid ID!"); $htmlout .= end_table(); $htmlout .= end_main_frame(); echo stdhead("Compose", true, $stdhead) . $htmlout . stdfoot($stdfoot); exit; } $res = sql_query("SELECT posts.*, users.username FROM posts JOIN users ON posts.user_id = users.id WHERE posts.id =" . sqlesc($postid)) or sqlerr(__FILE__, __LINE__); if (mysqli_num_rows($res) == 0) { stderr("Error", "No post with this ID"); $htmlout .= end_table(); $htmlout .= end_main_frame(); echo stdhead("Error - No post with this ID", true, $stdhead) . $htmlout . stdfoot($stdfoot); exit; } $arr = mysqli_fetch_assoc($res); } $htmlout .= "<tr>\n\t\t<td class=row valign='top'>Body</td>\n\t\t<td class=row>"; $qbody = $quote ? "[quote=" . htmlsafechars($arr["username"]) . "]" . htmlsafechars($arr["body"]) . "[/quote]" : ""; //if (function_exists('BBcode')) //$htmlout .= BBcode($qbody, true); if (function_exists('textbbcode')) { $htmlout .= ' ' . textbbcode('compose', 'body', isset($qbody) ? htmlsafechars($qbody) : '') . ' '; } else { $htmlout .= "<textarea name='body' style='width:99%' rows='7'>{$qbody}</textarea>"; } $htmlout .= "</td></tr>"; if ($Multi_forum['configs']['use_attachment_mod'] && $attachment) { $htmlout .= "<tr>\n\t\t\t\t<td colspan='2'><fieldset class='fieldset'><legend>Add Attachment</legend>\n\t\t\t\t<input type='checkbox' name='uploadattachment' value='yes' />\n\t\t\t\t<input type='file' name='file' size='60' />\n <div class='error'>Allowed Files: rar, zip<br />Size Limit " . mksize($Multi_forum['configs']['maxfilesize']) . "</div></fieldset>\n\t\t\t\t</td>\n\t\t\t</tr>"; } $htmlout .= "<tr>\n \t <td class=row align='center' colspan='2'>" . post_icons() . "</td>\n \t </tr><tr class=row>\n \t\t <td colspan='2' align='center'>\n \t <input class='btn btn-primary dropdown-toggle' type='submit' value='Submit' /><input class='btn btn-primary dropdown-toggle' type='button' value='Preview' name='button2' onclick='return Preview();' />\n"; if ($newtopic) { $htmlout .= "Anonymous Topic<input type='checkbox' name='anonymous' value='yes'/>\n"; } else { $htmlout .= "Anonymous Post<input type='checkbox' name='anonymous' value='yes'/>\n"; } $htmlout .= "</td></tr></form>\n"; $htmlout .= "<tr>\n\t\t\t\t<td colspan='2' align='right' class='tfoot'>\n\t\t\t\t" . insert_quick_jump_menu() . "\n\t\t\t\t</td>\n\t\t\t</tr>"; $htmlout .= end_table(); $htmlout .= "<br />"; // $htmlout .= end_frame(); // ------ Get 10 last posts if this is a reply if (!$newtopic && $INSTALLER09['show_last_10']) { $postres = sql_query("SELECT p.id, p.added, p.body, p.anonymous, u.id AS uid, u.enabled, u.class, u.donor, u.warned, u.chatpost, u.leechwarn, u.pirate, u.king, u.username, u.avatar, u.offensive_avatar " . "FROM posts AS p " . "LEFT JOIN users AS u ON u.id = p.user_id " . "WHERE p.topic_id=" . sqlesc($id) . " " . "ORDER BY p.id DESC LIMIT 10") or sqlerr(__FILE__, __LINE__); if (mysqli_num_rows($postres) > 0) { $htmlout .= "<br />"; $htmlout .= begin_frame("10 last posts, in reverse order"); while ($post = mysqli_fetch_assoc($postres)) { //$avatar = ($CURUSER["avatars"] == "all" ? htmlsafechars($post["avatar"]) : ($CURUSER["avatars"] == "some" && $post["offavatar"] == "no" ? htmlsafechars($post["avatar"]) : "")); $avatar = $CURUSER["avatars"] == "yes" ? avatar_stuff($post) : ""; if ($post['anonymous'] == 'yes') { $avatar = $INSTALLER09['pic_base_url'] . $Multi_forum['configs']['forum_pics']['default_avatar']; } else { $avatar = $CURUSER["avatars"] == "yes" ? avatar_stuff($post) : ''; } if (empty($avatar)) { $avatar = $INSTALLER09['pic_base_url'] . $Multi_forum['configs']['forum_pics']['default_avatar']; } $user_stuff = $post; $user_stuff['id'] = (int) $post['uid']; if ($post["anonymous"] == "yes") { if ($CURUSER['class'] < UC_STAFF && $post["uid"] != $CURUSER["id"]) { $htmlout .= "<p class='sub'>#" . (int) $post["id"] . " by <i>Anonymous</i> at " . get_date($post["added"], 'LONG', 1, 0) . "</p>"; } else { $htmlout .= "<p class='sub'>#" . (int) $post["id"] . " by <i>Anonymous</i> [<b>" . format_username($user_stuff, true) . "</b>] at " . get_date($post["added"], 'LONG', 1, 0) . "</p>"; } } else { $htmlout .= "<p class='sub'>#" . (int) $post["id"] . " by " . (!empty($post["username"]) ? format_username($user_stuff, true) : "unknown[" . (int) $post['uid'] . "]") . " at " . get_date($post["added"], 'LONG', 1, 0) . "</p>"; } $htmlout .= begin_table(true); $htmlout .= "<tr>\n\t\t\t\t <td height='100' width='100' align='center' style='padding: 0px' valign='top'><img height='100' width='100' src='" . $avatar . "' alt='User avvy' /></td>\n\t\t\t\t <td class='comment' valign='top'>" . format_comment($post["body"]) . "</td>\n\t\t\t\t </tr>"; $htmlout .= end_table(); } $htmlout .= end_frame(); } } //$htmlout .= insert_quick_jump_menu(); return $htmlout; }
function commenttable($rows) { global $CURUSER, $HTTP_SERVER_VARS; // === get smilie based on ratio begin_main_frame(); begin_frame(); $count = 0; foreach ($rows as $row) { $querie = sql_query("SELECT anonymous FROM comments WHERE id =" . unsafeChar($row['id']) . ""); $arraya = mysql_fetch_assoc($querie); echo "<p class=sub>#" . safeChar($row["id"]) . " by "; $title = !empty($row["title"]) ? $row["title"] : get_user_class_name($row["class"]); if ($arraya['anonymous'] == 'no' && 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}>" . safeChar($ratio) . " " . get_user_ratio_image($ratio) . "</font>"; } } else { if ($rat["uploaded"] > 0) { $ratio = "Inf."; } else { $ratio = "---"; } } echo "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . safeChar($row["user"]) . "><b>" . safeChar($row["username"]) . "</b></a> " . $title . " " . ($row["donor"] == "yes" ? "<img src=pic/star.gif alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=" . "/pic/warned.gif alt=\"Warned\">" : "") . " Ratio: {$ratio}\n"; } else { if (!isset($row["username"])) { echo "<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n"; } else { if ($arraya['anonymous'] == 'yes') { echo "<a name=\"comm" . $row["id"] . "\"><font color=blue><b>Anonymous</b></font></a>\n"; } } } echo " at " . display_date_time($row["added"]) . " GMT" . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=comment.php?action=edit&cid={$row['id']}>" . 'Edit' . "</a>] " : "") . (get_user_class() >= UC_VIP ? " - [<a href=report.php?type=Comment&id={$row['id']}>Report this Comment</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"; $resa = sql_query("SELECT owner, anonymous FROM torrents WHERE owner = {$row['user']}"); $array = mysql_fetch_assoc($resa); if ($row['anonymous'] == 'yes' && $row['user'] == $array['owner']) { $avatar = "/pic/default_avatar.gif"; } else { $avatar = $CURUSER["avatars"] == "yes" ? safeChar($row["avatar"]) : ""; } if (!$avatar) { $avatar = "/pic/default_avatar.gif"; } begin_table(true); echo "<tr valign=top>\n"; echo "<td align=center width=100 style='padding: 0px'><img width=100 src={$avatar}><br />" . get_reputation($row, 'comments') . "</td>\n"; echo "<td class=text>" . format_comment($row["text"]) . "</td>\n"; echo "</tr>\n"; end_table(); } end_frame(); end_main_frame(); }
<input type='hidden' name='item_name' value='#item_name' /> <input type='hidden' name='item_number' value='#item_number' /> <input type='hidden' name='currency_code' value='{$INSTALLER09['paypal_config']['currency']}' /> <input type='hidden' name='no_shipping' value='1' /> <input type='hidden' name='notify_url' value='{$INSTALLER09['baseurl']}/donatecheck.php' /> <input type='hidden' name='rm' value='2' /> <input type='hidden' name='custom' value='#id' /> <input type='hidden' name='return' value='{$INSTALLER09['baseurl']}/donate.php?done=1' /> <input type='submit' value='Donate #amount {$INSTALLER09['paypal_config']['currency']}' /> </form> PAYPAL; //this shows what they get $donate = array($INSTALLER09['paypal_config']['gb_donated_1'] => array('ViP ' . $INSTALLER09['paypal_config']['vip_dur_1'] . ' week', 'Donor ' . $INSTALLER09['paypal_config']['donor_dur_1'] . ' week', 'Freeleech ' . $INSTALLER09['paypal_config']['free_dur_1'] . ' wk', '' . $INSTALLER09['paypal_config']['up_amt_1'] . 'G upload', '' . $INSTALLER09['paypal_config']['kp_amt_1'] . ' bonus points', '' . $INSTALLER09['paypal_config']['inv_amt_1'] . ' invite', 'Donor star ' . $INSTALLER09['paypal_config']['duntil_dur_1'] . ' week', 'Imunnity ' . $INSTALLER09['paypal_config']['imm_dur_1'] . ' week'), $INSTALLER09['paypal_config']['gb_donated_2'] => array('ViP ' . $INSTALLER09['paypal_config']['vip_dur_2'] . ' weeks', 'Donor ' . $INSTALLER09['paypal_config']['donor_dur_2'] . ' weeks', 'Freeleech ' . $INSTALLER09['paypal_config']['free_dur_2'] . ' wks', '' . $INSTALLER09['paypal_config']['up_amt_2'] . 'G upload', '' . $INSTALLER09['paypal_config']['kp_amt_2'] . ' bonus points', '' . $INSTALLER09['paypal_config']['inv_amt_2'] . ' invites', 'Donor star ' . $INSTALLER09['paypal_config']['duntil_dur_2'] . ' weeks', 'Imunnity ' . $INSTALLER09['paypal_config']['imm_dur_2'] . ' weeks'), $INSTALLER09['paypal_config']['gb_donated_3'] => array('ViP ' . $INSTALLER09['paypal_config']['vip_dur_3'] . ' weeks', 'Donor ' . $INSTALLER09['paypal_config']['donor_dur_3'] . ' weeks', 'Freeleech ' . $INSTALLER09['paypal_config']['free_dur_3'] . ' wks', '' . $INSTALLER09['paypal_config']['up_amt_3'] . 'G upload', '' . $INSTALLER09['paypal_config']['kp_amt_3'] . ' bonus points', '' . $INSTALLER09['paypal_config']['inv_amt_3'] . ' invites', 'Donor star ' . $INSTALLER09['paypal_config']['duntil_dur_3'] . ' weeks', 'Imunnity ' . $INSTALLER09['paypal_config']['imm_dur_3'] . ' weeks'), $INSTALLER09['paypal_config']['gb_donated_4'] => array('ViP ' . $INSTALLER09['paypal_config']['vip_dur_4'] . ' weeks', 'Donor ' . $INSTALLER09['paypal_config']['donor_dur_4'] . ' weeks', 'Freeleech ' . $INSTALLER09['paypal_config']['free_dur_4'] . ' wks', '' . $INSTALLER09['paypal_config']['up_amt_4'] . 'G upload', '' . $INSTALLER09['paypal_config']['kp_amt_4'] . ' bonus points', '' . $INSTALLER09['paypal_config']['inv_amt_4'] . ' invites', 'Donor star ' . $INSTALLER09['paypal_config']['duntil_dur_4'] . ' weeks', 'Imunnity ' . $INSTALLER09['paypal_config']['imm_dur_4'] . ' weeks'), $INSTALLER09['paypal_config']['gb_donated_5'] => array('ViP ' . $INSTALLER09['paypal_config']['vip_dur_5'] . ' weeks', 'Donor ' . $INSTALLER09['paypal_config']['donor_dur_5'] . ' weeks', 'Freeleech ' . $INSTALLER09['paypal_config']['free_dur_5'] . ' wks', '' . $INSTALLER09['paypal_config']['up_amt_5'] . 'G upload', '' . $INSTALLER09['paypal_config']['kp_amt_5'] . ' bonus points', '' . $INSTALLER09['paypal_config']['inv_amt_5'] . ' invites', 'Donor star ' . $INSTALLER09['paypal_config']['duntil_dur_5'] . ' weeks', 'Imunnity ' . $INSTALLER09['paypal_config']['imm_dur_5'] . ' weeks'), $INSTALLER09['paypal_config']['gb_donated_6'] => array('ViP ' . $INSTALLER09['paypal_config']['vip_dur_6'] . ' weeks', 'Donor ' . $INSTALLER09['paypal_config']['donor_dur_6'] . ' weeks', 'Freeleech ' . $INSTALLER09['paypal_config']['free_dur_6'] . ' wks', '' . $INSTALLER09['paypal_config']['up_amt_6'] . 'G upload', '' . $INSTALLER09['paypal_config']['kp_amt_6'] . ' bonus points', '' . $INSTALLER09['paypal_config']['inv_amt_6'] . ' invites', 'Donor star ' . $INSTALLER09['paypal_config']['duntil_dur_6'] . ' weeks', 'Imunnity ' . $INSTALLER09['paypal_config']['imm_dur_6'] . ' weeks')); $done = isset($_GET['done']) && $_GET['done'] == 1 ? true : false; if ($INSTALLER09['paypal_config']['enable'] == 0) { $out = stdmsg('Sorry', 'Donation system is currently offline.'); } else { $out = begin_main_frame() . ($done ? stdmsg('Success', 'Your donations was sent to paypal wait for processing, this should be immediately! If any errors appear youll be contacted by someone from staff') : '') . begin_frame('Donate') . '<table width=\'80%\' align=\'center\' cellpadding=\'2\' cellspacing=\'3\'><tr>'; foreach ($donate as $amount => $ops) { $out .= '<td align=\'center\' valign=\'top\'><table cellpadding=\'2\'> <tr><td class=\'colhead\' align=\'center\'>Donate ' . $amount . ' ' . $INSTALLER09['paypal_config']['currency'] . '</td></tr> <tr><td align=\'left\'><ul style=\'margin-left: 0px;padding-left:15px\'>'; foreach ($ops as $op) { $out .= '<li>' . $op . '</li>'; } $out .= '</ul></td></tr><tr><td align=\'center\'>' . str_replace(array('#amount', '#item_name', '#item_number', '#id'), array($amount, $nick, $amount, $CURUSER['id']), $form_template); $out .= '</td></tr></table></td>'; } $out .= '</tr></table>' . end_frame() . stdmsg('Note', 'If you want to say something to ' . $INSTALLER09['site_name'] . ' staff, click on <b>Add special instructions to seller</b> link as soon as you are on paypal.com page' . ' Please note donating will reset Hit and Runs, any warnings and download bans.') . end_main_frame(); } echo stdhead('Donate') . $out . stdfoot();
$lang = array_merge($lang, load_language('ad_nameblacklist')); $blacklist = file_exists($INSTALLER09['nameblacklist']) && is_array(unserialize(file_get_contents($INSTALLER09['nameblacklist']))) ? unserialize(file_get_contents($INSTALLER09['nameblacklist'])) : array(); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $badnames = isset($_POST['badnames']) && !empty($_POST['badnames']) ? trim($_POST['badnames']) : ''; if (empty($badnames)) { stderr($lang['name_hmm'], $lang['name_think']); } if (strpos($badnames, ',')) { foreach (explode(',', $badnames) as $badname) { $blacklist[$badname] = (int) 1; } } else { $blacklist[$badnames] = (int) 1; } if (file_put_contents($INSTALLER09['nameblacklist'], serialize($blacklist))) { header('Refresh:2; url=staffpanel.php?tool=nameblacklist'); stderr($lang['name_success'], $lang['name_file']); } else { stderr($lang['name_err'], ' ' . $lang['name_hmm'] . '<b>' . $INSTALLER09['nameblacklist'] . '</b>' . $lang['name_is'] . ''); } } else { $out = begin_main_frame(); $out .= stdmsg($lang['name_curr'], count($blacklist) ? join(', ', array_keys($blacklist)) : $lang['name_no']); $out .= stdmsg($lang['name_add'], '<form action="staffpanel.php?tool=nameblacklist&action=nameblacklist" method="post"><table width="90%" cellspacing="2" cellpadding="5" align="center" style="border-collapse:separate"> <tr><td align="center"><textarea rows="3" cols="100" name="badnames"></textarea></td></tr> <tr><td align="center">' . $lang['name_note'] . '</td></tr> <tr> <td align="center"><input type="submit" value="' . $lang['name_update'] . '"/></td></tr> </table></form>'); $out .= end_main_frame(); echo stdhead($lang['name_stdhead']) . $out . stdfoot(); }
function editForum() { global $lang; $id = isset($_GET["id"]) ? (int) $_GET["id"] : stderr("Error", "Not Found"); $HTMLOUT = ''; $HTMLOUT .= "<span class='btn'><a href='admin.php?action=forummanage'>{$lang['btn_cancel']}</a></span><br /><br />"; $HTMLOUT .= begin_frame("{$lang['frame_editforum']}"); $result = mysql_query("SELECT * FROM forums where id = '{$id}'"); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $HTMLOUT .= "<form method='post' action='admin.php?action=forummanage&mode=takeedit'>\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_editforum']} " . htmlentities($row["name"], ENT_QUOTES) . "</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='30' maxlength='60' value='" . htmlentities($row["name"], ENT_QUOTES) . "' /></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' value='" . htmlentities($row["description"], ENT_QUOTES) . "' /></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) { if (get_user_class_name($i) != "") { $HTMLOUT .= "<option value='{$i}'" . ($row["minclassread"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>"; } } $HTMLOUT .= "</select>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td><b>{$lang['table_minpostrank']}</b></td>\r\n <td><select name='writeclass'>"; $maxclass = get_user_class(); for ($i = 0; $i <= $maxclass; ++$i) { if (get_user_class_name($i) != "") { $HTMLOUT .= "<option value='{$i}'" . ($row["minclasswrite"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>"; } } $HTMLOUT .= "</select></td>\r\n </tr>\r\n <tr>\r\n <td><b>{$lang['table_mincreatetrank']}</b></td>\r\n <td><select name='createclass'>"; $maxclass = get_user_class(); for ($i = 0; $i <= $maxclass; ++$i) { if (get_user_class_name($i) != "") { $HTMLOUT .= "<option value='{$i}'" . ($row["minclasscreate"] == $i ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>"; } } $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}'" . ($row["sort"] == $i ? " selected='selected'" : "") . ">{$i}</option>"; } $HTMLOUT .= "</select>\r\n </td>\r\n </tr>\r\n\r\n <tr align='center'>\r\n <td colspan='2'>\r\n <input type='hidden' name='id' value='{$row['id']}' />\r\n <input type='submit' name='Submit' value='{$lang['btn_editforum']}' class='btn' />\r\n </td>\r\n </tr>\r\n </table>\r\n </form>"; } } else { $HTMLOUT .= "{$lang['text_sorry']}"; } // end_frame(); $HTMLOUT .= end_main_frame(); print stdhead("{$lang['stdhead_editforum']}") . $HTMLOUT . stdfoot(); }
function commenttable($rows) { global $CURUSER, $TBDEV; $lang = load_language('torrenttable_functions'); $htmlout = ''; $count = 0; $htmlout .= begin_main_frame(); $htmlout .= begin_frame(); foreach ($rows as $row) { $htmlout .= "<p class='sub'>#{$row["id"]} {$lang["commenttable_by"]} "; if (isset($row["username"])) { $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"] || get_user_class() >= UC_MODERATOR ? "- [<a href='comment.php?action=edit&cid={$row['id']}'>" . $lang["commenttable_edit"] . "</a>]" : "") . (get_user_class() >= UC_MODERATOR ? "- [<a href='comment.php?action=delete&cid={$row['id']}'>" . $lang["commenttable_delete"] . "</a>]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "- [<a href='comment.php?action=vieworiginal&cid={$row['id']}'>" . $lang["commenttable_view_original"] . "</a>]" : "") . "</p>\n"; $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : ""; if (!$avatar) { $avatar = "{$TBDEV['pic_base_url']}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"; // damn it // I forgot to changed it back ... $htmlout .= "<td align='center' width='150' style='padding: 0px'><img width='{$row['av_w']}' height='{$row['av_h']}' src='{$avatar}' alt='' /></td>\n"; $htmlout .= "<td class='text'>{$text}</td>\n"; $htmlout .= "</tr>\n"; $htmlout .= end_table(); } $htmlout .= end_frame(); $htmlout .= end_main_frame(); return $htmlout; }
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; }
} else { $edit_action = true; $a3 = mysql_fetch_assoc($r3); } } $htmlout .= end_frame() . begin_frame($edit_action ? 'Edit forum <u>' . htmlspecialchars($a3['f_name']) . '</u>' : 'Add new forum'); $htmlout .= "<form action='" . $this_url . "' method='post'>\r\n\t<table width='100%' border='0' align='center' cellpadding='2' cellspacing='0' id='edit'>\r\n\t<tr><td colspan='2' align='center' class='colhead'>" . ($edit_action ? 'Edit forum <u>' . htmlspecialchars($a3['f_name']) . '</u>' : 'Add new forum') . "</td></tr>\r\n\t<tr><td align='right' valign='top'>Forum name</td><td align='left'><input type='text' value='" . ($edit_action ? $a3['f_name'] : '') . "'name='forumname' size='40' /></td></tr>\r\n\t<tr><td align='right' valign='top'>Forum description</td><td align='left'><textarea rows='3' cols='38' name='forumdescr'>" . ($edit_action ? $a3['description'] : '') . "</textarea></td></tr>"; $htmlout .= "<tr><td align='right' valign='top'>Overforum</td><td align='left'><select name='overforum'>"; $r2 = sql_query('SELECT id,name FROM overforums ORDER BY name') or sqlerr(__FILE__, __LINE__); while ($a = mysql_fetch_assoc($r2)) { $htmlout .= "<option value='" . $a['id'] . "' " . ($edit_action && $a['id'] == $a3['forid'] ? 'selected=\'selected\'' : '') . ">" . htmlspecialchars($a['name']) . "</option>"; } $htmlout .= "</select></td></tr>"; $classes = "<select name='#name'>"; for ($i = UC_USER; $i <= UC_SYSOP; $i++) { $classes .= "<option value='" . $i . "'>" . get_user_class_name($i) . "</option>"; } $classes .= "</select>"; if ($edit_action) { $htmlout .= "\r\n\t<tr><td align='right' valign='top'>Minim class read</td><td align='left'>" . str_replace(array('#name', 'value=\'' . $a3['minclassread'] . '\''), array('minclassread', 'value=\'' . $a3['minclassread'] . '\' selected=\'selected\''), $classes) . "</td></tr>\r\n\t<tr><td align='right' valign='top'>Minim class write</td><td align='left'>" . str_replace(array('#name', 'value=\'' . $a3['minclasswrite'] . '\''), array('minclasswrite', 'value=\'' . $a3['minclasswrite'] . '\' selected=\'selected\''), $classes) . "</td></tr>\r\n\t<tr><td align='right' valign='top'>Minim class create</td><td align='left'>" . str_replace(array('#name', 'value=\'' . $a3['minclasscreate'] . '\''), array('minclasscreate', 'value=\'' . $a3['minclasscreate'] . '\' selected=\'selected\''), $classes) . "</td></tr>"; } else { $htmlout .= "\r\n\t<tr><td align='right' valign='top'>Minim class read</td><td align='left'>" . str_replace('#name', 'minclassread', $classes) . "</td></tr>\r\n\t<tr><td align='right' valign='top'>Minim class write</td><td align='left'>" . str_replace('#name', 'minclasswrite', $classes) . "</td></tr>\r\n\t<tr><td align='right' valign='top'>Minim class create</td><td align='left'>" . str_replace('#name', 'minclasscreate', $classes) . "</td></tr>"; } $htmlout .= "<tr><td align='right' valign='top'>Forum rank</td><td align='left'><select name='forumsort'>"; for ($i = 0; $i <= $f_count + 1; $i++) { $htmlout .= "<option value='" . $i . "' " . ($edit_action && $a3['sort'] == $i ? 'selected=\'selected\'' : '') . ">" . $i . "</option>"; } $htmlout .= "</select></td></tr>\r\n\t<tr><td align='center' class='colhead' colspan='2'>" . ($edit_action ? "<input type='hidden' name='do' value='process_edit' /><input type='hidden' name='id' value='" . $a3['fid'] . "'/><input type='submit' value='Edit forum' />" : "<input type='hidden' name='do' value='process_add' /><input type='submit' value='Add forum' />") . "</td></tr>\r\n\t</table></form>"; $htmlout .= end_frame() . end_main_frame(); print stdhead('Forum manager') . $htmlout . stdfoot(); }
function commenttable($rows, $type, $parent_id, $review = false) { global $lang_functions; global $CURUSER, $commanage_class; global $Advertisement; begin_main_frame(); begin_frame(); $count = 0; if ($Advertisement->enable_ad()) { $commentad = $Advertisement->get_ad('comment'); } foreach ($rows as $row) { $userRow = get_user_row($row['user']); if ($count >= 1) { if ($Advertisement->enable_ad()) { if ($commentad[$count - 1]) { echo "<div align=\"center\" style=\"margin-top: 10px\" id=\"ad_comment_" . $count . "\">" . $commentad[$count - 1] . "</div>"; } } } print "<div style=\"margin-top: 8pt; margin-bottom: 8pt;\"><table id=\"cid" . $row["id"] . "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td class=\"embedded\" width=\"99%\">#" . $row["id"] . " <font color=\"gray\">" . $lang_functions['text_by'] . "</font>"; print get_username($row["user"], false, true, true, false, false, true); print " <font color=\"gray\">" . $lang_functions['text_at'] . "</font>" . gettime($row["added"]) . ($row["editedby"] && get_user_class() >= $commanage_class ? " - [<a href=\"comment.php?action=vieworiginal&cid=" . $row[id] . "&type=" . $type . "\">" . $lang_functions['text_view_original'] . "</a>]" : "") . "</td><td class=\"embedded nowrap\" width=\"1%\"><a href=\"#top\"><img class=\"top\" src=\"pic/trans.gif\" alt=\"Top\" title=\"Top\" /></a> </td></tr></table></div>"; $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars(trim($userRow["avatar"])) : ""; if (!$avatar) { $avatar = "pic/default_avatar.png"; } $text = format_comment($row["text"]); $text_editby = ""; if ($row["editedby"]) { $lastedittime = gettime($row['editdate'], true, false); $text_editby = "<br /><p><font class=\"small\">" . $lang_functions['text_last_edited_by'] . get_username($row['editedby']) . $lang_functions['text_edited_at'] . $lastedittime . "</font></p>\n"; } print "<table class=\"main\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n"; $secs = 900; $dt = sqlesc(date("Y-m-d H:i:s", TIMENOW - $secs)); // calculate date. print "<tr>\n"; print "<td class=\"rowfollow\" width=\"150\" valign=\"top\" style=\"padding: 0px;\">" . return_avatar_image($avatar) . "</td>\n"; print "<td class=\"rowfollow\" valign=\"top\"><br />" . $text . $text_editby . "</td>\n"; print "</tr>\n"; $actionbar = "<a href=\"comment.php?action=add&sub=quote&cid=" . $row[id] . "&pid=" . $parent_id . "&type=" . $type . "\"><img class=\"f_quote\" src=\"pic/trans.gif\" alt=\"Quote\" title=\"" . $lang_functions['title_reply_with_quote'] . "\" /></a>" . "<a href=\"comment.php?action=add&pid=" . $parent_id . "&type=" . $type . "\"><img class=\"f_reply\" src=\"pic/trans.gif\" alt=\"Add Reply\" title=\"" . $lang_functions['title_add_reply'] . "\" /></a>" . (get_user_class() >= $commanage_class ? "<a href=\"comment.php?action=delete&cid=" . $row[id] . "&type=" . $type . "\"><img class=\"f_delete\" src=\"pic/trans.gif\" alt=\"Delete\" title=\"" . $lang_functions['title_delete'] . "\" /></a>" : "") . ($row["user"] == $CURUSER["id"] || get_user_class() >= $commanage_class ? "<a href=\"comment.php?action=edit&cid=" . $row[id] . "&type=" . $type . "\"><img class=\"f_edit\" src=\"pic/trans.gif\" alt=\"Edit\" title=\"" . $lang_functions['title_edit'] . "\" />" . "</a>" : ""); print "<tr><td class=\"toolbox\"> " . ("'" . $userRow['last_access'] . "'" > $dt ? "<img class=\"f_online\" src=\"pic/trans.gif\" alt=\"Online\" title=\"" . $lang_functions['title_online'] . "\" />" : "<img class=\"f_offline\" src=\"pic/trans.gif\" alt=\"Offline\" title=\"" . $lang_functions['title_offline'] . "\" />") . "<a href=\"sendmessage.php?receiver=" . htmlspecialchars(trim($row["user"])) . "\"><img class=\"f_pm\" src=\"pic/trans.gif\" alt=\"PM\" title=\"" . $lang_functions['title_send_message_to'] . htmlspecialchars($userRow["username"]) . "\" /></a><a href=\"report.php?commentid=" . htmlspecialchars(trim($row["id"])) . "\"><img class=\"f_report\" src=\"pic/trans.gif\" alt=\"Report\" title=\"" . $lang_functions['title_report_this_comment'] . "\" /></a></td><td class=\"toolbox\" align=\"right\">" . $actionbar . "</td>"; print "</tr></table>\n"; $count++; } end_frame(); end_main_frame(); }
function insert_compose_frame($id, $newtopic = true, $quote = false, $attachment = false) { global $maxsubjectlength, $CURUSER, $TBDEV, $maxfilesize, $use_attachment_mod, $forum_pics; $htmlout = ''; if ($newtopic) { $res = mysql_query("SELECT name FROM forums WHERE id = " . sqlesc($id)) or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_assoc($res) or die("Bad forum ID!"); $htmlout .= "<h3>New topic in <a href='" . $_SERVER['PHP_SELF'] . "?action=viewforum&forumid=" . $id . "'>" . htmlspecialchars($arr["name"]) . "</a> forum</h3>"; } else { $res = mysql_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') { stderr("Sorry", "The topic is locked."); $htmlout .= end_table(); $htmlout .= end_main_frame(); print stdhead("Compose") . $htmlout . stdfoot(); exit; } $htmlout .= "<h3 align='center'>Reply to topic: <a href='" . $_SERVER['PHP_SELF'] . "action=viewtopic&topicid=" . $id . "'>" . htmlspecialchars($arr["subject"]) . "</a></h3>"; } $htmlout .= "\r\n <script type='text/javascript'>\r\n /*<![CDATA[*/\r\n function Preview()\r\n {\r\n document.compose.action = './preview.php'\r\n document.compose.target = '_blank';\r\n document.compose.submit();\r\n return true;\r\n }\r\n /*]]>*/\r\n </script>"; $htmlout .= begin_frame("Compose", true); $htmlout .= "<form method='post' name='compose' action='" . $_SERVER['PHP_SELF'] . "' enctype='multipart/form-data'>\r\n\t <input type='hidden' name='action' value='post' />\r\n\t <input type='hidden' name='" . ($newtopic ? 'forumid' : 'topicid') . "' value='" . $id . "' />"; $htmlout .= begin_table(true); if ($newtopic) { $htmlout .= "<tr>\r\n\t\t\t<td class='rowhead' width='10%'>Subject</td>\r\n\t\t\t<td align='left'>\r\n\t\t\t\t<input type='text' size='100' maxlength='" . $maxsubjectlength . "' name='subject' style='height: 19px' />\r\n\t\t\t</td>\r\n\t\t</tr>"; } if ($quote) { $postid = (int) $_GET["postid"]; if (!is_valid_id($postid)) { stderr("Error", "Invalid ID!"); $htmlout .= end_table(); $htmlout .= end_main_frame(); print stdhead("Compose") . $htmlout . stdfoot(); exit; } $res = mysql_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) { stderr("Error", "No post with this ID"); $htmlout .= end_table(); $htmlout .= end_main_frame(); print stdhead("Error - No post with this ID") . $htmlout . stdfoot(); exit; } $arr = mysql_fetch_assoc($res); } $htmlout .= "<tr>\r\n\t\t<td class='rowhead' width='10%'>Body</td>\r\n\t\t<td>"; $qbody = $quote ? "[quote=" . htmlspecialchars($arr["username"]) . "]" . htmlspecialchars(unesc($arr["body"])) . "[/quote]" : ""; if (function_exists('textbbcode')) { $htmlout .= textbbcode("compose", "body", $qbody); } else { $htmlout .= "<textarea name='body' style='width:99%' rows='7'>{$qbody}</textarea>"; } $htmlout .= "</td></tr>"; if ($use_attachment_mod && $attachment) { $htmlout .= "<tr>\r\n\t\t\t\t<td colspan='2'><fieldset class='fieldset'><legend>Add Attachment</legend>\r\n\t\t\t\t<input type='checkbox' name='uploadattachment' value='yes' />\r\n\t\t\t\t<input type='file' name='file' size='60' />\r\n <div class='error'>Allowed Files: rar, zip<br />Size Limit " . mksize($maxfilesize) . "</div></fieldset>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>"; } $htmlout .= "<tr>\r\n \t <td align='center' colspan='2'>" . post_icons() . "</td>\r\n \t </tr><tr>\r\n \t\t <td colspan='2' align='center'>\r\n \t <input type='submit' value='Submit' /><input type='button' value='Preview' name='button2' onclick='return Preview();' />\n"; if ($newtopic) { $htmlout .= "Anonymous Topic<input type='checkbox' name='anonymous' value='yes'/>\n"; } else { $htmlout .= "Anonymous Post<input type='checkbox' name='anonymous' value='yes'/>\n"; } $htmlout .= "</td></tr>\n"; $htmlout .= end_table(); $htmlout .= "</form>"; $htmlout .= end_frame(); // ------ Get 10 last posts if this is a reply if (!$newtopic) { $postres = mysql_query("SELECT p.id, p.added, p.body, p.anonymous, u.id AS uid, u.username, u.avatar, u.offavatar " . "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) { $htmlout .= "<br />"; $htmlout .= begin_frame("10 last posts, in reverse order"); while ($post = mysql_fetch_assoc($postres)) { $avatar = $CURUSER["avatars"] == "all" ? htmlspecialchars($post["avatar"]) : ($CURUSER["avatars"] == "some" && $post["offavatar"] == "no" ? htmlspecialchars($post["avatar"]) : ""); if ($post['anonymous'] == 'yes') { $avatar = $TBDEV['pic_base_url'] . $forum_pics['default_avatar']; } else { $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars($post["avatar"]) : ''; } if (empty($avatar)) { $avatar = $TBDEV['pic_base_url'] . $forum_pics['default_avatar']; } if ($post["anonymous"] == "yes") { if ($CURUSER['class'] < UC_MODERATOR && $post["uid"] != $CURUSER["id"]) { $htmlout .= "<p class='sub'>#" . $post["id"] . " by <i>Anonymous</i> at " . get_date($post["added"], 'LONG', 1, 0) . "</p>"; } else { $htmlout .= "<p class='sub'>#" . $post["id"] . " by <i>Anonymous</i> (<b>" . $post["username"] . "</b>) at " . get_date($post["added"], 'LONG', 1, 0) . "</p>"; } } else { $htmlout .= "<p class='sub'>#" . $post["id"] . " by " . (!empty($post["username"]) ? $post["username"] : "******") . " at " . get_date($post["added"], 'LONG', 1, 0) . "</p>"; } $htmlout .= begin_table(true); $htmlout .= "<tr>\r\n\t\t\t\t\t\t<td height='100' width='100' align='center' style='padding: 0px' valign='top'><img height='100' width='100' src='" . $avatar . "' alt='User avvy' /></td>\r\n\t\t\t\t\t\t<td class='comment' valign='top'>" . format_comment($post["body"]) . "</td>\r\n\t\t\t\t\t</tr>"; $htmlout .= end_table(); } $htmlout .= end_frame(); } } $htmlout .= insert_quick_jump_menu(); return $htmlout; }
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 messagemenu($selected = 1) { global $lang_messages; global $BASEURL; global $CURUSER; begin_main_frame(); print "<div id=\"pmboxnav\"><ul id=\"pmboxmenu\" class=\"menu\">"; print "<li" . ($selected == 1 ? " class=selected" : "") . "><a href=\"" . get_protocol_prefix() . $BASEURL . "/messages.php\" >" . $lang_messages['text_inbox'] . "</a></li>"; print "<li" . ($selected == -1 ? " class=selected" : "") . "><a href=\"" . get_protocol_prefix() . $BASEURL . "/messages.php?action=viewmailbox&box=-1\">" . $lang_messages['text_sentbox'] . "</a></li>"; $res = sql_query('SELECT * FROM pmboxes WHERE userid=' . sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($res)) { while ($row = mysql_fetch_assoc($res)) { print "<li" . ($selected == $row['boxnumber'] ? " class=selected" : "") . "><a href=\"" . get_protocol_prefix() . $BASEURL . "/messages.php?action=viewmailbox&box=" . $row['boxnumber'] . "\">" . $row['name'] . "</a></li>"; } } print "</ul></div>"; end_main_frame(); }
<li><a href="?year=<?php echo $year; ?> &month=<?php echo $month; ?> &order=torrent_size"><?php echo $lang_uploaders['text_torrent_size']; ?> </a></li> <li><a href="?year=<?php echo $year; ?> &month=<?php echo $month; ?> &order=torrent_count"><?php echo $lang_uploaders['text_torrent_num']; ?> </a></li> </ul> </span> </span> </div> <?php } ?> </div> <?php end_main_frame(); 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 commenttable($rows, $variant = 'torrent') { require_once INCL_DIR . 'html_functions.php'; require_once INCL_DIR . 'add_functions.php'; global $CURUSER, $INSTALLER09, $mood, $mc1; $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' : ($variant == 'offer' ? '&type=offer' : ''); $htmlout .= begin_main_frame(); $htmlout .= begin_frame(); foreach ($rows as $row) { $moodname = isset($mood['name'][$row['mood']]) ? htmlsafechars($mood['name'][$row['mood']]) : 'is feeling neutral'; $moodpic = isset($mood['image'][$row['mood']]) ? htmlsafechars($mood['image'][$row['mood']]) : 'noexpression.gif'; $htmlout .= "<p class='sub'>#{$row["id"]} {$lang["commenttable_by"]} "; // --------------- likes start------ $att_str = ''; if (!empty($row['user_likes'])) { $likes = explode(',', $row['user_likes']); } else { $likes = ''; } if (!empty($likes) && count(array_unique($likes)) > 0) { if (in_array($CURUSER['id'], $likes)) { if (count($likes) == 1) { $att_str = jq('You like this'); } elseif (count(array_unique($likes)) > 1) { $att_str = jq('You and ') . (count(array_unique($likes)) - 1 == '1' ? '1 other person likes this' : count($likes) - 1 . 'others like this'); } } elseif (!in_array($CURUSER['id'], $likes)) { if (count(array_unique($likes)) == 1) { $att_str = '1 other person likes this'; } elseif (count(array_unique($likes)) > 1) { $att_str = count(array_unique($likes)) . ' others like this'; } } } $wht = !empty($likes) && count(array_unique($likes)) > 0 && in_array($CURUSER['id'], $likes) ? 'unlike' : 'like'; // --------------- likes end------ if (isset($row["username"])) { if ($row['anonymous'] == 'yes') { //$htmlout.= '/*<![CDATA[*/'; $htmlout .= ($CURUSER['class'] >= UC_STAFF ? 'Anonymous - Posted by: <b>' . htmlsafechars($row['username']) . '</b> ID: ' . (int) $row['user'] . '' : 'Anonymous') . ' '; } else { $title = $row["title"]; if ($title == "") { $title = get_user_class_name($row["class"]); } else { $title = htmlsafechars($title); } $username = htmlsafechars($row['username']); $avatar1 = $row['anonymous'] == 'yes' ? "<img src=\\'{$INSTALLER09['pic_base_url']}anonymous_1.jpg\\' width=\\'150\\' height=\\'150\\' border=\\'0\\' alt=\\'Avatar\\' title=\\'Avatar\\' />" : "<img src=\\'" . htmlsafechars($row['avatar']) . "\\' width=\\'150\\' height=\\'150\\' border=\\'0\\' alt=\\'Avatar\\' title=\\'Avatar\\' />"; if (!$avatar1) { $avatar1 = "{$INSTALLER09['pic_base_url']}default_avatar.gif"; } $htmlout .= "<a name='comm" . (int) $row["id"] . "' onmouseover=\"Tip('<b>{$username}</b><br />{$avatar1}');\" onmouseout=\"UnTip();\" 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='" . $lang["commenttable_donor_alt"] . "' />" : "") . ($row["warned"] == "yes" ? "<img src='{$INSTALLER09['pic_base_url']}warned.gif' alt='" . $lang["commenttable_warned_alt"] . "' />" : "") . " ({$title})\n"; $htmlout .= '<a href="javascript:;" onclick="PopUp(\'usermood.php\',\'Mood\',530,500,1,1);"> <span class="tool"><img src="' . $INSTALLER09['pic_base_url'] . 'smilies/' . $moodpic . '" alt="' . $moodname . '" border="0" /> <span class="tip">' . ($row['anonymous'] == 'yes' ? '<i>Anonymous</i>' : htmlsafechars($row['username'])) . ' ' . $moodname . ' !</span></span></a>'; } } else { $htmlout .= "<a name='comm" . (int) $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=" . (int) $row['id'] . $extra_link . "&tid=" . $row[$variant] . "'>" . $lang["commenttable_edit"] . "</a>]" : "") . ($CURUSER["class"] >= UC_VIP ? " - [<a href='report.php?type=Comment&id=" . (int) $row['id'] . "'>Report this Comment</a>]" : "") . ($CURUSER["class"] >= UC_STAFF ? " - [<a href='comment.php?action=delete&cid=" . (int) $row['id'] . $extra_link . "&tid=" . $row[$variant] . "'>" . $lang["commenttable_delete"] . "</a>]" : "") . ($row["editedby"] && $CURUSER["class"] >= UC_STAFF ? "- [<a href='comment.php?action=vieworiginal&cid=" . (int) $row['id'] . $extra_link . "&tid=" . $row[$variant] . "'>" . $lang["commenttable_view_original"] . "</a>]" : "") . "\n\t\t\n\t\t <span id='mlike' data-com='" . (int) $row["id"] . "' class='comment {$wht}'>[" . ucfirst($wht) . "]</span><span class='tot-" . (int) $row["id"] . "' data-tot='" . (!empty($likes) && count(array_unique($likes)) > 0 ? count(array_unique($likes)) : '') . "'> {$att_str}</span></p>\n"; $avatar = $row['anonymous'] == "yes" ? "{$INSTALLER09['pic_base_url']}anonymous_1.jpg" : htmlsafechars($row["avatar"]); if (!$avatar) { $avatar = "{$INSTALLER09['pic_base_url']}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=" . (int) $row['editedby'] . "'><b>" . htmlsafechars($row['edit_name']) . "</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='150' height='150' src='{$avatar}' alt='' /><br />" . get_reputation($row, 'comments') . "</td>\n"; $htmlout .= "<td class='text'>{$text}</td>\n"; $htmlout .= "</tr>\n"; $htmlout .= end_table(); //$htmlout.= '/*]]>*/'; } $htmlout .= end_frame(); $htmlout .= end_main_frame(); return $htmlout; }