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 bjtable($res, $frame_caption) { begin_frame($frame_caption, true); begin_table(); ?> <tr> <td class="colhead">Rank</td> <td align="left" class="colhead">User</td> <td align="right" class="colhead">Wins</td> <td align="right" class="colhead">Losses</td> <td align="right" class="colhead">Games</td> <td align="right" class="colhead">Percentage</td> <td align="right" class="colhead">Win/Loss</td> </tr> <?php $num = 0; while ($a = mysql_fetch_assoc($res)) { ++$num; //Calculate Win % $win_perc = number_format($a[wins] / $a[games] * 100, 1); // Add a user's +/- statistic $plus_minus = $a[wins] - $a[losses]; if ($plus_minus >= 0) { $plus_minus = mksize(($a[wins] - $a[losses]) * 100 * 1024 * 1024); } else { $plus_minus = "-"; $plus_minus .= mksize(($a[losses] - $a[wins]) * 100 * 1024 * 1024); } print "<tr><td>{$num}</td><td align=left><table border=0 class=main cellspacing=0 cellpadding=0><tr><td class=embedded>" . "<b><a href=userdetails.php?id=" . $a[id] . ">" . $a[username] . "</a></b></td>" . "</tr></table></td><td align=right>" . number_format($a[wins], 0) . "</td>" . "</td><td align=right>" . number_format($a[losses], 0) . "</td>" . "</td><td align=right>" . number_format($a[games], 0) . "</td>" . "</td><td align=right>{$win_perc}</td>" . "</td><td align=right>{$plus_minus}</td>" . "</tr>\n"; } end_table(); end_frame(); }
function bjtable($res, $frame_caption) { $htmlout = ''; $htmlout .= begin_frame($frame_caption, true); $htmlout .= begin_table(); $htmlout .= "<tr>\r\n\t<td class='colhead'>Rank</td>\r\n\t<td class='colhead' align='left'>User</td>\r\n\t<td class='colhead' align='right'>Wins</td>\r\n\t<td class='colhead' align='right'>Losses</td>\r\n\t<td class='colhead' align='right'>Games</td>\r\n\t<td class='colhead' align='right'>Percentage</td>\r\n\t<td class='colhead' align='right'>Win/Loss</td>\r\n\t</tr>"; $num = 0; while ($a = mysqli_fetch_assoc($res)) { ++$num; //==Calculate Win % $win_perc = number_format($a['wins'] / $a['games'] * 100, 1); //==Add a user's +/- statistic $plus_minus = $a['wins'] - $a['losses']; if ($plus_minus >= 0) { $plus_minus = mksize(($a['wins'] - $a['losses']) * 100 * 1024 * 1024); } else { $plus_minus = "-"; $plus_minus .= mksize(($a['losses'] - $a['wins']) * 100 * 1024 * 1024); } $htmlout .= "<tr><td>{$num}</td><td align='left'>" . "<b><a href='userdetails.php?id=" . $a['id'] . "'>" . $a['username'] . "</a></b></td>" . "<td align='right'>" . number_format($a['wins'], 0) . "</td>" . "<td align='right'>" . number_format($a['losses'], 0) . "</td>" . "<td align='right'>" . number_format($a['games'], 0) . "</td>" . "<td align='right'>{$win_perc}</td>" . "<td align='right'>{$plus_minus}</td>" . "</tr>\n"; } $htmlout .= end_table(); $htmlout .= end_frame(); return $htmlout; }
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 insert_badwords_frame() { global $badwords, $BASEURL; begin_frame("Badwords", true); print "<center>"; begin_table(false, 5); print "<tr>"; for ($I = 0; $I < 3; $I++) { if ($I > 0) { print "<td class=\"tablecat\"> </td>"; } print "<td class=\"tablecat\">Eingeben...</td><td class=\"tablecat\">...für Schlimmes Wort</td>"; } print "</tr>\n"; $I = 0; print "<tr>"; while (list($code, $url) = each($badwords)) { if ($I && $I % 3 == 0) { print "</tr>\n<tr>"; } if ($I % 3) { print "<td class=\"inposttable\"> </td>"; } print "<td class=\"tablea\">{$code}</td><td class=\"tableb\">{$url}</td>"; $I++; } if ($I % 3) { print "<td class=\"inposttable\" colspan=" . (3 - $I % 3) * 3 . "> </td>"; } print "</tr>\n"; end_table(); print "</center>"; end_frame(); }
function insert_smilies_frame() { global $smilies, $BASEURL; begin_frame("Smilies", true); begin_table(false, 5); print "<tr><td class=colhead>Type...</td><td class=colhead>To make a...</td></tr>\n"; while (list($code, $url) = each($smilies)) { print "<tr><td>{$code}</td><td><img src={$BASEURL}/pic/smilies/{$url}></td>\n"; } end_table(); end_frame(); }
function insert_smilies_frame() { global $smilies, $BASEURL, $pic_base_url; begin_frame("Smilies", true); begin_table(false, 5); print "<tr><td class='colhead'>Type...</td><td class='colhead'>To make a...</td></tr>\n"; while (list($code, $url) = each($smilies)) { print "<tr><td>{$code}</td><td><img src=\"{$pic_base_url}smilies/{$url}\" alt='' /></td></tr>\n"; } end_table(); end_frame(); }
function insert_smilies_frame() { global $smilies, $DEFAULTBASEURL; begin_frame("Смайлы", true); begin_table(false, 5); print "<tr><td class=\"colhead\">Написание</td><td class=\"colhead\">Смайл</td></tr>\n"; while (list($code, $url) = each($smilies)) { print "<tr><td>{$code}</td><td><img src=\"{$DEFAULTBASEURL}/pic/smilies/{$url}\"></td>\n"; } end_table(); end_frame(); }
function insert_smilies_frame() { global $smilies, $INSTALLER09; $htmlout = ''; $htmlout .= begin_frame("Smilies", true); $htmlout .= begin_table(false, 5); $htmlout .= "<tr><td class='colhead'>Type...</td><td class='colhead'>To make a...</td></tr>\n"; foreach ($smilies as $code => $url) { $htmlout .= "<tr><td>{$code}</td><td><img src=\"{$INSTALLER09['pic_base_url']}smilies/{$url}\" alt='' /></td></tr>\n"; } $htmlout .= end_table(); $htmlout .= end_frame(); return $htmlout; }
/** * Prints out the display/edit UI to add/remove groups for this user * @param string $memberid id of the member to to change groups for */ function print_edit($edit, &$user) { $group = new Group(new GroupDB()); $non_user_groups = $group->getGroups($user->get_id()); $user_groups = $user->groups; begin_table($user->get_name()); if ($edit) { print_groups_to_add($non_user_groups); print_move_buttons(); print_groups_to_remove($user_groups); print_save_button($user->get_id()); } else { print_groups_to_view($user_groups); } end_table(); }
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(); }
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 _torrenttable($res, $frame_caption, $speed = "false") { global $db; block_begin($frame_caption, 'center'); begin_table(); $num = 0; while ($a = $res->fetch_assoc()) { ++$num; if ($a["leechers"] > 0) { $r = (int) $a["seeds"] / (int) $a["leechers"]; $ratio = number_format($r, 2); } else { $ratio = INFINITE; } if (!isset($menu)) { $menu = ""; } if ($menu != "1") { echo "<tr>" . "<table width='100%' class='lista'>" . "<td class='header' align='center'>" . USER_LEVEL . "</td>" . "<td class='header'>" . FILE . "</td>"; if ($speed != "true") { echo "<td class='header' align='center'>" . FINISHED . "</td>" . "<td class='header' align='center'>" . SEEDERS . "</td>" . "<td class='header' align='center'>" . LEECHERS . "</td>" . "<td class='header' align='center'>" . PEERS . "</td>" . "<td class='header' align='center'>" . RATIO . "</td>"; } else { echo "<td class='header' align='right'>" . SPEED . "</td>"; } echo "</tr>"; $menu = 1; } print "<tr><td class='lista' align='center'>" . $num . "</td><td class='lista' align='left'>"; print "<a href='" . "details.php?id=" . $a['hash'] . "'>" . "<b>"; print security::html_safe($a["name"]) . "</b></a></td>"; if ($speed != "true") { print "<td class='lista' align='center' width='10%' ><a href='torrent_history.php?id=" . $a["hash"] . "'>" . number_format((int) $a["finished"]) . "</a></td><td class='lista' align='center' width='10%' ><a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["seeds"]) . "</a></td><td class='lista' align='center' width='10%' > <a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["leechers"]) . "</a></td><td class='lista' align='center' width='10%' > <a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["leechers"] + (int) $a["seeds"]) . "</a></td><td class='lista' align='center' width='10%'>" . $ratio . "</td>\n"; } else { print "<td class='lista' align='center'>" . misc::makesize((int) $a["speed"]) . "/s" . "\n"; } } end_table(); block_end(); }
// | along with TBDevYSE; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | // +--------------------------------------------------------------------------+ // | Do not remove above lines! | // +--------------------------------------------------------------------------+ */ require "include/bittorrent.php"; dbconn(); loggedinorreturn(); if (get_user_class() < UC_MODERATOR) { stderr($tracker_lang['error'], "Отказано в доступе."); } stdhead("Предупрежденные пользователи"); $warned = number_format(get_row_count("users", "WHERE warned='yes'")); begin_frame("Предупрежденные пользователи: ({$warned})", true); begin_table(); $res = sql_query("SELECT * FROM users WHERE warned=1 AND enabled='yes' ORDER BY (users.uploaded/users.downloaded)") or sqlerr(__FILE__, __LINE__); $num = mysql_num_rows($res); print "<table border=1 width=675 cellspacing=0 cellpadding=2><form action=\"nowarn.php\" method=post>\n"; print "<tr align=center><td class=colhead width=90>Пользователь</td>\n<td class=colhead width=70>Зарегистрирован</td>\n<td class=colhead width=75>Последний раз был на трекере</td>\n<td class=colhead width=75>Класс</td>\n<td class=colhead width=70>Закачал</td>\n<td class=colhead width=70>Раздал</td>\n<td class=colhead width=45>Рейтинг</td>\n<td class=colhead width=125>Окончание</td>\n<td class=colhead width=65>Убрать</td>\n<td class=colhead width=65>Отключить</td></tr>\n"; for ($i = 1; $i <= $num; $i++) { $arr = mysql_fetch_assoc($res); if ($arr['added'] == '0000-00-00 00:00:00') { $arr['added'] = '-'; } if ($arr['last_access'] == '0000-00-00 00:00:00') { $arr['last_access'] = '-'; } if ($arr["downloaded"] != 0) { $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3); } else {
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; }
if ($CURUSER['class'] >= MAX_CLASS || isMod($forumid, "forum")) { if (!is_valid_id($forumid)) { stderr('Error', 'Invalid ID!'); } $res = sql_query("SELECT name, description, min_class_read, min_class_write, min_class_create FROM forums WHERE id=" . sqlesc($forumid)) or sqlerr(__FILE__, __LINE__); if (mysqli_num_rows($res) == 0) { stderr('Error', 'No forum found with that ID!'); } $forum = mysqli_fetch_assoc($res); if ($INSTALLER09['forums_online'] == 0) { $HTMLOUT .= stdmsg('Warning', 'Forums are currently in maintainance mode'); } $HTMLOUT .= begin_main_frame(); $HTMLOUT .= begin_frame("Edit Forum", "center"); $HTMLOUT .= "<form method='post' action='{$INSTALLER09['baseurl']}/forums.php?action=updateforum&forumid={$forumid}'>\n"; $HTMLOUT .= begin_table(); $HTMLOUT .= "<tr><td class='rowhead'>Forum name</td>\r\n <td align='left' style='padding: 0px'><input type='text' size='60' maxlength='{$Multi_forum['configs']['maxsubjectlength']}' name='name' style='border: 0px; height: 19px' value=\"" . htmlsafechars($forum['name']) . "\" /></td></tr>\r\n <tr><td class='rowhead'>Description</td><td align='left' style='padding: 0px'><textarea name='description' cols='68' rows='3' style='border: 0px'>" . htmlsafechars($forum['description']) . "</textarea></td></tr>\r\n <tr><td class='rowhead'></td><td align='left' style='padding: 0px'> Minimum <select name='readclass'>"; for ($i = 0; $i <= MAX_CLASS; ++$i) { $HTMLOUT .= "<option value='{$i}' " . ($i == $forum['min_class_read'] ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>\n"; } $HTMLOUT .= "</select> Class required to View<br />\n Minimum <select name='writeclass'>"; for ($i = 0; $i <= MAX_CLASS; ++$i) { $HTMLOUT .= "<option value='{$i}' " . ($i == $forum['min_class_write'] ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>\n"; } $HTMLOUT .= "</select> Class required to Post<br />\n Minimum <select name='createclass'>"; for ($i = 0; $i <= MAX_CLASS; ++$i) { $HTMLOUT .= "<option value='{$i}' " . ($i == $forum['min_class_create'] ? " selected='selected'" : "") . ">" . get_user_class_name($i) . "</option>\n"; } $HTMLOUT .= "</select> Class required to Create Topics</td></tr>\r\n <tr><td colspan='2' align='center'><input type='submit' value='Submit' /></td></tr>\n"; $HTMLOUT .= end_table(); $HTMLOUT .= "</form>";
$class = "clearalt7"; } else { $count2 = 0; $class = "clearalt6"; } // =======end print "<p class=sub><table border=0 cellspacing=0 cellpadding=0 width=737><tr><td class=colhead width=737>\r\n" . ($newposts ? " <b><font color=red>NEW REPLY!</font></b>" : "") . "<br><b>Forum: </b>\r\n<a class=altlink href=/forums.php?action=viewforum&forumid={$forumid}>{$forumname}</a>\r\n<b>Topic: </b>\r\n<a class=altlink href=/forums.php?action=viewtopic&topicid={$topicid}>{$topicname}</a>\r\n<b>Post: </b>\r\n#<a class=altlink href=/forums.php?action=viewtopic&topicid={$topicid}&page=p{$postid}#{$postid}>{$postid}</a><br>\r\n<b>Last Post By:</b> <a class=altlink href=userdetails.php?id={$posterid}><b>{$res3['username']}</a> added:</b> {$added} </td>\r\n<td class=colhead2 align=right width=20%>"; // === delete subscription if ($_GET[check] == "yes") { echo "<INPUT type=checkbox checked name=deletesubscription[] id=deletesubscription value={$topicid}> "; } else { echo "<INPUT type=checkbox name=deletesubscription[] id=deletesubscription value={$topicid}> "; } // === end print "<b>un-subscribe</b></td></tr></table></p>\n"; begin_table(true); $body = format_comment($arr2["body"]); if (is_valid_id($arr['editedby'])) { $subres = sql_query("SELECT username FROM users WHERE id={$arr['editedby']}"); if (mysql_num_rows($subres) == 1) { $subrow = mysql_fetch_assoc($subres); $body .= "<p><font size=1 class=small>Last edited by <a href=userdetails.php?id={$arr['editedby']}><b>{$subrow['username']}</b></a> at {$arr['editedat']} GMT</font></p>\n"; } } // print("<tr valign=top><td class=$class>" . CutName($body, 300) . "</td></tr>\n"); print "<tr valign=top><td class={$class}>{$body}</td></tr>\n"; // use this line if you don't want to cut the post end_table(); } ?> <br><table width=737><tr><td align=right class=colhead><h1></h1>
function peerstable($res, $frame_caption) { global $lang; $htmlout = ''; $htmlout .= begin_frame($frame_caption, true); $htmlout .= begin_table(); $htmlout .= "<tr><td class='colhead'>{$lang['common_rank']}</td><td class='colhead'>{$lang['peers_uname']}</td><td class='colhead'>{$lang['peers_ulrate']}</td><td class='colhead'>{$lang['peers_dlrate']}</td></tr>"; $n = 1; while ($arr = mysql_fetch_assoc($res)) { $highlight = $CURUSER["id"] == $arr["userid"] ? " bgcolor='#BBAF9B'" : ""; $htmlout .= "<tr><td{$highlight}>{$n}</td><td{$highlight}><a href='userdetails.php?id=" . $arr["userid"] . "'><b>" . $arr["username"] . "</b></a></td><td{$highlight}>" . mksize($arr["uprate"]) . "/s</td><td{$highlight}>" . mksize($arr["downrate"]) . "/s</td></tr>\n"; ++$n; } $htmlout .= end_table(); $htmlout .= end_frame(); return $htmlout; }
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(); }
$res = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE `sender` = " . $CURUSER["id"] . " AND `location` = 'template'"); $template = mysql_result($res, 0); tr2('<a href="mailbox.php?inbox">' . T_("INBOX") . ' </a> ', " {$inbox} " . P_("message", $inbox) . " ({$unread} " . T_("unread") . ")"); tr2('<a href="mailbox.php?outbox">' . T_("OUTBOX") . ' </a> ', " {$outbox} " . P_("message", $outbox)); tr2('<a href="mailbox.php?draft">' . T_("DRAFT") . ' </a> ', " {$draft} " . P_("message", $draft)); tr2('<a href="mailbox.php?templates">' . T_("TEMPLATES") . ' </a> ', " {$template} " . P_("message", $template)); end_table(); echo "<br /><br />"; } elseif ($type == "Mail") { $order = order("added,sender,sendto,subject", "added", true); $res = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE {$where}"); $count = mysql_result($res, 0); list($pagertop, $pagerbottom, $limit) = pager2(20, $count); print $pagertop; begin_form(); begin_table(0, "list"); $table[' '] = th("<input type=\"checkbox\" onclick=\"toggleChecked(this.checked);this.form.remove.disabled=true;\" />", 1); $table['Sender'] = th_left("Sender", 'sender'); $table['Sent_to'] = th_left("Sent To", 'receiver'); $table['Subject'] = th_left("Subject", 'subject'); $table['Date'] = th_left("Date", 'added'); table($table, $tablefmt); $res = SQL_Query_exec("SELECT * FROM messages WHERE {$where} {$order} {$limit}"); while ($arr = mysql_fetch_assoc($res)) { unset($table); $userid = 0; $format = ''; $reading = false; if ($arr["sender"] == $CURUSER['id']) { $sender = "Yourself"; } elseif (is_valid_id($arr["sender"])) {
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> <td class="colhead"><nobr>Class</td> <td class="colhead">Downloaded</td> <td class="colhead">UpLoaded</td> <td class="colhead">Ratio</td> <td class="colhead">Status</td>
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(); }
} $pserno = sprintf("%010d", $serno); echo "<center><b><font size=+2>"; echo "Board Serial Number: {$pserno}"; echo "</font></b></center>\n"; ?> <p> <form action=doedit.php method=POST> <?php echo "<input type=hidden name=serno value={$serno}>\n"; $r = mysql_query("select * from boards where serno={$serno}"); $row = mysql_fetch_array($r); if (!$row) { die("no record of serial number '{$serno}' in database"); } begin_table(5); // ethaddr char(17) print_field("ethaddr", $row, 17); // date date print_field("date", $row); // batch char(32) print_field("batch", $row, 32); // type enum('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY') print_enum("type", $row, $type_vals); // rev tinyint(3) unsigned zerofill print_field("rev", $row, 3, 'rev_filter'); // location char(64) print_field("location", $row, 64); // comments text print_field_multiline("comments", $row, 60, 10, 'text_filter'); // sdram[0-3] enum('32M','64M','128M','256M')
if ($i < 10) { $day .= "<option value=\"0" . $i . "\">0" . $i . "</option>\n"; } else { $day .= "<option value=\"" . $i . "\">" . $i . "</option>\n"; } $i++; } $day .= "</select>\n"; $HTMLOUT .= tr("Birthday", $year . $month . $day, 1); } //== End $HTMLOUT .= "<tr><td align='center' colspan='2'><input type='submit' value='Submit changes!' style='height: 25px' /></td></tr>"; $HTMLOUT .= end_table(); } else { //== Pms $HTMLOUT .= begin_table(true); $HTMLOUT .= "<tr><td class='colhead' colspan='2' style='height:25px;' ><input type='hidden' name='action' value='pm' />Pm options</td></tr>"; $HTMLOUT .= tr($lang['usercp_accept_pm'], "<input type='radio' name='acceptpms'" . ($CURUSER["acceptpms"] == "yes" ? " checked='checked'" : "") . " value='yes' />{$lang['usercp_except_blocks']}\r\n <input type='radio' name='acceptpms'" . ($CURUSER["acceptpms"] == "friends" ? " checked='checked'" : "") . " value='friends' />{$lang['usercp_only_friends']}\r\n <input type='radio' name='acceptpms'" . ($CURUSER["acceptpms"] == "no" ? " checked='checked'" : "") . " value='no' />{$lang['usercp_only_staff']}", 1); $HTMLOUT .= tr($lang['usercp_delete_pms'], "<input type='checkbox' name='deletepms'" . ($CURUSER["deletepms"] == "yes" ? " checked='checked'" : "") . " /> {$lang['usercp_default_delete']}", 1); $HTMLOUT .= tr($lang['usercp_save_pms'], "<input type='checkbox' name='savepms'" . ($CURUSER["savepms"] == "yes" ? " checked='checked'" : "") . " /> {$lang['usercp_default_save']}", 1); $HTMLOUT .= tr("Forum Subscribe Pm", "<input type='radio' name='subscription_pm' " . ($CURUSER["subscription_pm"] == "yes" ? " checked='checked'" : "") . " value='yes' />yes <input type='radio' name='subscription_pm' " . ($CURUSER["subscription_pm"] == "no" ? " checked='checked'" : "") . " value='no' />no<br /> When someone posts in a subscribed thread, you will be PMed.", 1); $HTMLOUT .= tr("Torrent deletion Pm", "<input type='radio' name='pm_on_delete' " . ($CURUSER["pm_on_delete"] == "yes" ? " checked='checked'" : "") . " value='yes' />yes <input type='radio' name='pm_on_delete' " . ($CURUSER["pm_on_delete"] == "no" ? " checked='checked'" : "") . " value='no' />no<br />When any of your uploaded torrents are deleted, you will be PMed.", 1); $HTMLOUT .= tr("Torrent comment Pm", "<input type='radio' name='commentpm' " . ($CURUSER["commentpm"] == "yes" ? " checked='checked'" : "") . " value='yes' />yes <input type='radio' name='commentpm' " . ($CURUSER["commentpm"] == "no" ? " checked='checked'" : "") . " value='no' />no<br />When any of your uploaded torrents are commented on, you will be PMed.", 1); $HTMLOUT .= "<tr><td align='center' colspan='2'><input type='submit' value='Submit changes!' style='height: 25px' /></td></tr>"; $HTMLOUT .= end_table(); } $HTMLOUT .= "</td><td width='95' valign='top' ><table border='1'>"; $HTMLOUT .= "<tr><td class='colhead' width='95' style='height:25px;' >" . htmlentities($CURUSER["username"], ENT_QUOTES) . "'s Avatar</td></tr>"; if (!empty($CURUSER['avatar']) && $CURUSER['av_w'] > 5 && $CURUSER['av_h'] > 5) { $HTMLOUT .= "<tr><td><img src='{$CURUSER['avatar']}' width='{$CURUSER['av_w']}' height='{$CURUSER['av_h']}' alt='' />\r\n <a href='mytorrents.php'>{$lang['usercp_edit_torrents']}</a><br />\r\n <a href='friends.php'>{$lang['usercp_edit_friends']}</a><br />\r\n <a href='users.php'>{$lang['usercp_search']}</a>\r\n </td></tr>"; } else {
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 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; }
require "defs.php"; pg_head("{$bddb_label} - New Log Entry"); if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') { die("serial number not specified or invalid!"); } $serno = intval($_REQUEST['serno']); if (isset($_REQUEST['logno'])) { $logno = $_REQUEST['logno']; die("log number must not be specified when adding! ({$logno})"); } ?> <form action=donewlog.php method=POST> <p></p> <?php echo "<input type=hidden name=serno value={$serno}>\n"; begin_table(3); // date date print_field("date", array('date' => date("Y-m-d"))); // who char(20) print_field("who", array()); // details text print_field_multiline("details", array(), 60, 10, 'text_filter'); end_table(); ?> <p></p> <table width="100%"> <tr> <td align=center> <input type=submit value="Add Log Entry"> </td> <td align=center>
case 'aurl': $options[$key][4] .= '<br > <strong>One per line.</strong>'; $pdef[$key] = implode("\n", $pdef[$key]); } } // OMG, Finally the Output Portion of the script begin_main_frame(); begin_frame('Site Settings'); ?> <CENTER><H1><b><?php echo TBVERSION; ?> </b></H1></CENTER> <form action="" method="post" enctype="application/x-www-form-urlencoded" name="config"> <?php begin_table(1); foreach ($options as $value) { if (is_string($value)) { echo "<tr><td colspan=2 class='colhead'><CENTER>{$value}</CENTER></td></tr>"; } else { if (is_array($value)) { $key = $value[2]; $val = htmlspecialchars(stripslashes($pdef[$plkp[$key]])); if ($value[1]) { $checked = $val ? ' checked' : ''; } eval('$opt="' . addslashes($templates[$value[1]][1]) . ($value[1] == 'tf' ? '' : '<br />') . '";'); if ($value[1] != 'hidden') { tr($value[0], " {$opt} {$value['4']}", 1); } else { echo $opt;
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); //$HTMLOUT .="<td>".htmlspecialchars((!empty($d) && $d != $a['ip']) ? $d : $a['id'])."</td></tr>\n"; $HTMLOUT .= "<td>" . long2ip($a['ip']) . "</td></tr>\n"; } $HTMLOUT .= end_table();
function insert_compose_frame($id, $newtopic = true, $quote = false) { global $maxsubjectlength, $db; MCached::connect(); if ($newtopic) { $arr = MCached::get('forums::name::' . $id); if ($arr === MCached::NO_RESULT) { $res = $db->query("SELECT name FROM forums WHERE id = " . $id) or sqlerr(__FILE__, __LINE__); $arr = $res->fetch_assoc() or die(BAD_FORUM_ID); MCached::add('forums::name::' . $id, $arr, 9600); } $forumname = security::html_safe(unesc($arr["name"])); block_begin(WORD_NEW . " " . TOPIC . " " . IN . " <a href='?action=viewforum&forumid=" . $id . "'>" . $forumname . "</a> " . FORUM); } else { $arr = MCached::get('quick::jump::topics::' . $id); if ($arr === MCached::NO_RESULT) { $res = $db->query("SELECT * FROM topics WHERE id = " . $id) or sqlerr(__FILE__, __LINE__); $arr = $res->fetch_assoc() or stderr(ERROR, FORUM_ERROR . TOPIC_NOT_FOUND); MCached::add('quick::jump::topics::' . $id, $arr, 9600); } $subject = security::html_safe(unesc($arr["subject"])); block_begin(REPLY . " " . TOPIC . ": <a href='?action=viewtopic&topicid=" . $id . "'>" . $subject . "</a>"); } begin_frame(); print "<form method='post' name='compose' action='?action=post'>\n"; if ($newtopic) { print "<input type='hidden' name='forumid' value='" . $id . "'>\n"; } else { print "<input type='hidden' name='topicid' value='" . $id . "'>\n"; } begin_table(); if ($newtopic) { print "<tr><td class='header'>" . SUBJECT . "</td>" . "<td class='lista' align='left' style='padding: 0px'><input type='text' size='50' maxlength='" . $maxsubjectlength . "' name='subject' " . "style='border: 0px; height: 19px'></td></tr>\n"; } if ($quote) { $postid = 0 + (int) $_GET["postid"]; if (!is_valid_id($postid)) { die; } $res = $db->query("SELECT posts.*, users.username FROM posts INNER JOIN users ON posts.userid = users.id WHERE posts.id = " . $postid) or sqlerr(__FILE__, __LINE__); if ($res->num_rows != 1) { stderr(ERROR, ERR_NO_POST_WITH_ID . "" . $postid); } $arr = $res->fetch_assoc(); } print "<tr><td class='header'>" . BODY . "</td><td class='lista' align='left' style='padding: 0px'>"; textbbcode("compose", "body", $quote ? "[quote=" . security::html_safe($arr["username"]) . "]" . security::html_safe(unesc($arr["body"])) . "[/quote]" : ""); print "<tr><td colspan='2' align='center'><input type='submit' class='btn' value='" . FRM_CONFIRM . "'></td></tr>\n"; print "</td></tr>"; end_table(); print "</form>\n"; end_frame(); //------ Get 10 last posts if this is a reply if (!$newtopic) { $postres = $db->query("SELECT * FROM posts WHERE topicid = " . $id . " ORDER BY id DESC LIMIT 10") or sqlerr(__FILE__, __LINE__); begin_frame(LAST_10_POSTS, true); while ($post = $postres->fetch_assoc()) { //-- Get poster details $userres = $db->query("SELECT * FROM users WHERE id = " . (int) $post["userid"] . " LIMIT 1") or sqlerr(__FILE__, __LINE__); $user = $userres->fetch_assoc(); $avatar = $user["avatar"] && $user["avatar"] != "" ? security::html_safe($user["avatar"]) : ""; begin_table(true); print "<tr valign='top'><td width='150' align='center' style='padding: 0px'>#" . (int) $post["id"] . " by " . security::html_safe($user["username"]) . "<br />" . get_date_time($post["added"]) . ($avatar != "" ? "<br /><img width='80' src='" . $avatar . "'>" : "") . "</td><td class='lista'>" . format_comment(unesc($post["body"])) . "</td></tr><br>\n"; end_table(); } end_frame(); } if (!isset($forumid)) { $forumid = 0; } insert_quick_jump_menu($forumid); block_end(); }