if (!$row) { show_error_msg(T_("ERROR"), "News id invalid", 0); stdfoot(); } echo "<center><b>" . T_("COMMENTSFOR") . "</b> <a href='torrents-details.php?id=" . $row['id'] . "'>" . htmlspecialchars($row['name']) . "</a></center><br />"; } begin_frame(T_("COMMENTS")); $subres = SQL_Query_exec("SELECT COUNT(*) FROM comments WHERE {$type} = {$id}"); $subrow = mysql_fetch_array($subres); $commcount = $subrow[0]; if ($commcount) { list($pagertop, $pagerbottom, $limit) = pager(10, $commcount, "comments.php?id={$id}&type={$type}&"); $commquery = "SELECT comments.id, text, user, comments.added, avatar, signature, username, title, class, uploaded, downloaded, privacy, donated FROM comments LEFT JOIN users ON comments.user = users.id WHERE {$type} = {$id} ORDER BY comments.id {$limit}"; $commres = SQL_Query_exec($commquery); } else { unset($commres); } if ($commcount) { print $pagertop; commenttable($commres, $type); print $pagerbottom; } else { print "<br /><b>" . T_("NOCOMMENTS") . "</b><br />\n"; } echo "<center>"; echo "<form name=\"comment\" method=\"post\" action=\"comments.php?type={$type}&id={$id}&takecomment=yes\">"; echo textbbcode("comment", "body") . "<br />"; echo "<input type=\"submit\" value=\"" . T_("ADDCOMMENT") . "\" />"; echo "</form></center>"; end_frame(); stdfoot();
} else { $HTMLOUT .= "<textarea name='text' rows='10' cols='60'></textarea>"; } $HTMLOUT .= "<br />\n <label for='anonymous'>Tick this to post anonymously</label>\n <input id='anonymous' type='checkbox' name='anonymous' value='yes' />\n <br /><input type='submit' class='btn' value='{$lang['comment_doit']}' /></form>"; $res = sql_query("SELECT comments.id, text, comments.added, comments.{$locale}, comments.anonymous, comments.editedby, comments.editedat, comments.edit_name, username, users.id as user, users.title, users.avatar, users.offavatar, users.av_w, users.av_h, users.class, users.reputation, users.mood, users.donor, users.warned FROM comments LEFT JOIN users ON comments.user = users.id WHERE {$locale} = " . sqlesc($id) . " ORDER BY comments.id DESC LIMIT 5"); $allrows = array(); while ($row = mysqli_fetch_assoc($res)) { $allrows[] = $row; } if (count($allrows)) { require_once INCL_DIR . 'html_functions.php'; require_once INCL_DIR . 'bbcode_functions.php'; require_once INCL_DIR . 'user_functions.php'; require_once INCL_DIR . 'comment_functions.php'; $HTMLOUT .= "<h2>{$lang['comment_recent']}</h2>\n"; $HTMLOUT .= commenttable($allrows, $locale); } echo stdhead("{$lang['comment_add']}'" . $arr[$name] . "'", true, $stdhead) . $HTMLOUT . stdfoot($stdfoot); die; } elseif ($action == "edit") { $commentid = isset($_GET['cid']) ? (int) $_GET['cid'] : 0; if (!is_valid_id($commentid)) { stderr("{$lang['comment_error']}", "{$lang['comment_invalid_id']}"); } $res = sql_query("SELECT c.*, t.{$name}, t.id as tid FROM comments AS c LEFT JOIN {$table_type} AS t ON c.{$locale} = t.id WHERE c.id=" . sqlesc($commentid)) or sqlerr(__FILE__, __LINE__); $arr = mysqli_fetch_assoc($res); if (!$arr) { stderr("{$lang['comment_error']}", "{$lang['comment_invalid_id']}."); } if ($arr["user"] != $CURUSER["id"] && $CURUSER['class'] < UC_STAFF) { stderr("{$lang['comment_error']}", "{$lang['comment_denied']}");
} $HTMLOUT .= "<tr>\r\n<td align='right'><b>offered By</b></td><td align='left'>\r\n<a class='altlink' href='userdetails.php?id={$num['userid']}'>{$num['username']}</a> {$edit} {$delete} {$reset} |\r\n<a class='altlink' href='viewoffers.php'><b>All offers</b></a> </td></tr><tr><td align='right'>\r\n<b>Vote for this offer</b></td><td align='left'><a href='viewoffers.php?id=" . $id . "&offer_vote'><b>Vote</b></a>\r\n</td></tr>\r\n" . ($INSTALLER09['reports'] ? "<tr><td align='right'><b>Report Offer</b></td><td align='left'>\r\nfor breaking the rules \r\n<form action='report.php?type=Offer&id={$id}' method='post'><input class='btn' type='submit' name='submit' value='Report Offer' /></form></td>\r\n</tr>" : ''); if ($num['torrentid'] == 0) { $HTMLOUT .= "<tr><td align='right' valign='top'><b>Accept This Offer</b></td>\r\n <td>\r\n <form method='post' action='viewoffers.php?id=" . $id . "&offer_filled'>\r\n <strong>" . $INSTALLER09['baseurl'] . "/details.php?id=</strong><input type='text' size='10' name='torrentid' value='' /> <input type='submit' value='Fill Offer' class='btn' /><br />\r\n Enter the <b>ID</b> of the torrent. (copy/paste the <strong>ID</strong> from another window/tab the correct ID number)<br /></form></td>\r\n </tr>\n"; } else { $HTMLOUT .= "<tr><td align='right' valign='top'><b>This Offer was accepted:</b></td><td><a class='altlink' href='details.php?id=" . $num['torrentid'] . "'><b>" . $INSTALLER09['baseurl'] . "/details.php?id=" . $num['torrentid'] . "</b></a></td></tr>"; } $HTMLOUT .= "<tr><td class='embedded' colspan='2'><p><a name='startcomments'></a></p>\n"; $commentbar = "<p align='center'><a class='index' href='comment.php?action=add&tid={$id}&type=offer'>Add Comment</a></p>\n"; $subres = sql_query("SELECT COUNT(*) FROM comments WHERE offer = {$id}"); $subrow = mysql_fetch_array($subres); $count = $subrow[0]; $HTMLOUT .= '</td></tr></table>'; if (!$count) { $HTMLOUT .= '<h2>No comments</h2>'; } else { $pager = pager(25, $count, "viewoffers.php?id={$id}&offer_details&", array('lastpagedefault' => 1)); $subres = sql_query("SELECT comments.id, comments.text, comments.user, comments.editedat, \r\n comments.editedby, comments.ori_text, comments.offer AS offer, \r\n comments.added, comments.anonymous, users.avatar, users.av_w ,users.av_h,\r\n users.warned, users.username, users.title, users.class, users.last_access, \r\n users.enabled, users.reputation, users.donor, users.downloaded, users.uploaded \r\n FROM comments LEFT JOIN users ON comments.user = users.id \r\n WHERE offer = {$id} ORDER BY comments.id") or sqlerr(__FILE__, __LINE__); $allrows = array(); while ($subrow = mysql_fetch_assoc($subres)) { $allrows[] = $subrow; } $HTMLOUT .= $commentbar; $HTMLOUT .= $pager['pagertop']; require_once INCL_DIR . 'html_functions.php'; $HTMLOUT .= commenttable($allrows, 'offer'); $HTMLOUT .= $pager['pagerbottom']; } $HTMLOUT .= $commentbar; /////////////////////// HTML OUTPUT ////////////////////////////// print stdhead('Offer Details') . $HTMLOUT . stdfoot($stdfoot);
//== $HTMLOUT .= "<p>\n <a name='startcomments'></a></p>\n <form name='comment' method='post' action='comment.php?action=add&tid={$id}'>\n\t\t<table align='center'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='center'><b>{$lang['details_quick_comment']}</b></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='center'>\n\t\t\t\t\t<textarea name='body' cols='280' rows='4'></textarea>\n\t\t\t\t\t<input type='hidden' name='tid' value='" . htmlsafechars($id) . "' />\n\t\t\t\t\t<br />\n\t\t\t\t\t<a href=\"javascript:SmileIT(':-)','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/smile1.gif' alt='Smile' title='Smile' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':smile:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/smile2.gif' alt='Smiling' title='Smiling' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':-D','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/grin.gif' alt='Grin' title='Grin' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':lol:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/laugh.gif' alt='Laughing' title='Laughing' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':w00t:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/w00t.gif' alt='W00t' title='W00t' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':blum:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/blum.gif' alt='Rasp' title='Rasp' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(';-)','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/wink.gif' alt='Wink' title='Wink' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':devil:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/devil.gif' alt='Devil' title='Devil' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':yawn:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/yawn.gif' alt='Yawn' title='Yawn' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':-/','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/confused.gif' alt='Confused' title='Confused' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':o)','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/clown.gif' alt='Clown' title='Clown' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':innocent:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/innocent.gif' alt='Innocent' title='innocent' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':whistle:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/whistle.gif' alt='Whistle' title='Whistle' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':unsure:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/unsure.gif' alt='Unsure' title='Unsure' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':blush:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/blush.gif' alt='Blush' title='Blush' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':hmm:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/hmm.gif' alt='Hmm' title='Hmm' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':hmmm:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/hmmm.gif' alt='Hmmm' title='Hmmm' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':huh:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/huh.gif' alt='Huh' title='Huh' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':look:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/look.gif' alt='Look' title='Look' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':rolleyes:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/rolleyes.gif' alt='Roll Eyes' title='Roll Eyes' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':kiss:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/kiss.gif' alt='Kiss' title='Kiss' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':blink:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/blink.gif' alt='Blink' title='Blink' /></a> \n\t\t\t\t\t<a href=\"javascript:SmileIT(':baby:','comment','body')\"><img border='0' src='{$INSTALLER09['pic_base_url']}smilies/baby.gif' alt='Baby' title='Baby' /></a>\n\t\t\t\t\t<br />\n\t\t\t\t\t<input class='btn btn-primary' type='submit' value='Submit' />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t</table>\n\t</form>"; if ($torrents["allow_comments"] == "yes" || $CURUSER['class'] >= UC_STAFF && $CURUSER['class'] <= UC_MAX) { $HTMLOUT .= "<p><a name=\"startcomments\"></a></p>\n"; } else { $HTMLOUT .= "<table align='center' class='table table-bordered'>\n\t\t\t<tr>\n\t\t\t\t<td><a name='startcomments'> </a><b>{$lang['details_com_disabled']}</b></td>\n\t\t\t</tr>\n </table>\n"; echo stdhead("{$lang['details_details']}\"" . htmlsafechars($torrents["name"], ENT_QUOTES) . "\"", true, $stdhead) . $HTMLOUT . stdfoot($stdfoot); die; } $HTMLOUT .= "<!-- accordion collapse going here -->\n<script type='text/javascript'>\n/*<![CDATA[*/\njQuery(document).ready(function() {\n jQuery('.content').hide();\n //toggle the componenet with class msg_body\n jQuery('.h1').click(function()\n {\n jQuery(this).next('.content').slideToggle(500);\n });\n});\n/*]]>*/\n</script>"; $commentbar = "<p class='h1 btn btn-primary'>Comments Open/Close</p><div class='content'><p align='center' ><a class='index' href='comment.php?action=add&tid={$id}'>{$lang['details_add_comment']}</a>\n <br /><a class='index' href='{$INSTALLER09['baseurl']}/takethankyou.php?id=" . $id . "'>\n <img src='{$INSTALLER09['pic_base_url']}smilies/thankyou.gif' alt='Thanks' title='Thank You' border='0' /></a></p>\n"; $count = (int) $torrents['comments']; if (!$count) { $HTMLOUT .= "<h2>{$lang['details_no_comment']}</h2>\n"; } else { $perpage = 15; $pager = pager($perpage, $count, "details.php?id={$id}&", array('lastpagedefault' => 1)); $subres = sql_query("SELECT comments.id, comments.text, comments.user_likes, comments.user, comments.torrent, comments.added, comments.anonymous, comments.editedby, comments.editedat, users.avatar, users.av_w, users.av_h, users.offavatar, users.warned, users.reputation, users.opt1, users.opt2, users.mood, users.username, users.title, users.class, users.donor FROM comments LEFT JOIN users ON comments.user = users.id WHERE torrent = " . sqlesc($id) . " ORDER BY comments.id " . $pager['limit']) or sqlerr(__FILE__, __LINE__); $allrows = array(); while ($subrow = mysqli_fetch_assoc($subres)) { $allrows[] = $subrow; } $HTMLOUT .= $commentbar; $HTMLOUT .= $pager['pagertop']; $HTMLOUT .= commenttable($allrows); $HTMLOUT .= $pager['pagerbottom']; } $HTMLOUT .= $commentbar; $HTMLOUT .= "</div>\n</div>\n</div>\n</div>\n</div>"; ///////////////////////// HTML OUTPUT //////////////////////////// echo stdhead("{$lang['details_details']}\"" . htmlsafechars($torrents["name"], ENT_QUOTES) . "\"", true, $stdhead) . $HTMLOUT . stdfoot($stdfoot);
print "<h1>Add a comment to \"" . htmlspecialchars($arr["name"]) . "\"</h1>\n"; print "<p><form method=\"post\" action=\"comment.php?action=add\">\n"; print "<input type=\"hidden\" name=\"tid\" value=\"{$torrentid}\"/>\n"; print "<textarea name=\"text\" rows=\"10\" cols=\"60\"></textarea></p>\n"; print "<p><input type=\"submit\" class='btn' value=\"Do it!\" /></p></form>\n"; $res = mysql_query("SELECT comments.id, text, comments.added, comments.editedby, comments.editedat, username, users.id as user, users.title, users.avatar, users.class, users.donor, users.warned FROM comments LEFT JOIN users ON comments.user = users.id WHERE torrent = {$torrentid} ORDER BY comments.id DESC LIMIT 5"); $allrows = array(); while ($row = mysql_fetch_assoc($res)) { $allrows[] = $row; } if (count($allrows)) { require_once "include/torrenttable_functions.php"; require_once "include/html_functions.php"; require_once "include/bbcode_functions.php"; print "<h2>Most recent comments, in reverse order</h2>\n"; commenttable($allrows); } stdfoot(); die; } elseif ($action == "edit") { $commentid = 0 + $_GET["cid"]; if (!is_valid_id($commentid)) { stderr("Error", "Invalid ID."); } $res = mysql_query("SELECT c.*, t.name FROM comments AS c LEFT JOIN torrents AS t ON c.torrent = t.id WHERE c.id={$commentid}") or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_assoc($res); if (!$arr) { stderr("Error", "Invalid ID."); } if ($arr["user"] != $CURUSER["id"] && get_user_class() < UC_MODERATOR) { stderr("Error", "Permission denied.");
} $HTMLOUT .= "<tr>\r\n<td align='right'><b>{$lang['req_req_by']}</b></td><td align='left'>\r\n<a class='altlink' href='userdetails.php?id={$num['userid']}'>{$num['username']}</a> {$edit} {$delete} {$reset} |\r\n<a class='altlink' href='viewrequests.php'><b>{$lang['details_all_req']}</b></a> </td></tr><tr><td align='right'>\r\n<b>{$lang['details_vote_req']}</b></td><td align='left'><a href='viewrequests.php?id=" . $id . "&req_vote'><b>{$lang['details_vote']}</b></a>\r\n</td></tr>\r\n" . ($TBDEV['reports'] ? "<tr><td align='right'><b>{$lang['details_report']}</b></td><td align='left'>\r\n{$lang['details_break']} \r\n<form action='report.php?type=Request&id={$id}' method='post'><input class='btn' type='submit' name='submit' value='{$lang['details_report']}' /></form></td>\r\n</tr>" : ''); if ($num['torrentid'] == 0) { $HTMLOUT .= "<tr><td align='right' valign='top'><b>{$lang['details_fill_this']}</b></td>\r\n<td>" . ($CURUSER['id'] != $num['userid'] ? "\r\n<form method='post' action='viewrequests.php?id=" . $id . "&req_filled'>\r\n <strong>" . $TBDEV['baseurl'] . "/details.php?id=</strong><input type='text' size='10' name='torrentid' value='' /> <input type='submit' value='{$lang['details_fill']}' class='btn' /><br />\r\n{$lang['details_enter_id']}<br /></form>" : "{$lang['details_yours']}") . "</td>\r\n</tr>\n"; } else { $HTMLOUT .= "<tr><td align='right' valign='top'><b>{$lang['details_filled']}</b></td><td><a class='altlink' href='details.php?id=" . $num['torrentid'] . "'><b>" . $TBDEV['baseurl'] . "/details.php?id=" . $num['torrentid'] . "</b></a></td></tr>"; } $HTMLOUT .= "<tr><td class='embedded' colspan='2'><p><a name='startcomments'></a></p>\n"; $commentbar = "<p align='center'><a class='index' href='comment.php?action=add&tid={$id}&type=request'>{$lang['details_add_comment']}</a></p>\n"; $subres = mysql_query("SELECT COUNT(*) FROM comments WHERE request = {$id}"); $subrow = mysql_fetch_array($subres); $count = $subrow[0]; $HTMLOUT .= '</td></tr></table>'; if (!$count) { $HTMLOUT .= "<h2>{$lang['details_no_comment']}</h2>"; } else { $pager = pager(25, $count, "viewrequests.php?id={$id}&req_details&", array('lastpagedefault' => 1)); $subres = mysql_query("SELECT comments.id, comments.text, comments.user, comments.editedat, \r\n comments.editedby, comments.ori_text, comments.request AS request, \r\n comments.added, comments.anonymous, users.avatar, users.av_w ,users.av_h,\r\n users.warned, users.username, users.title, users.class, users.last_access, \r\n users.enabled, users.reputation, users.donor, users.downloaded, users.uploaded \r\n FROM comments LEFT JOIN users ON comments.user = users.id \r\n WHERE request = {$id} ORDER BY comments.id") or sqlerr(__FILE__, __LINE__); $allrows = array(); while ($subrow = mysql_fetch_assoc($subres)) { $allrows[] = $subrow; } $HTMLOUT .= $commentbar; $HTMLOUT .= $pager['pagertop']; require_once 'include/html_functions.php'; $HTMLOUT .= commenttable($allrows, 'request'); $HTMLOUT .= $pager['pagerbottom']; } $HTMLOUT .= $commentbar; /////////////////////// HTML OUTPUT ////////////////////////////// print stdhead('Request Details') . $HTMLOUT . stdfoot();
$subres = sql_query("SELECT COUNT(*) FROM comments WHERE offer = {$id}"); $subrow = mysql_fetch_array($subres); $count = $subrow[0]; if (!$count) { print "<h1 id=\"startcomments\" align=\"center\">" . $lang_offers['text_no_comments'] . "</h1>\n"; } else { list($pagertop, $pagerbottom, $limit) = pager(10, $count, "offers.php?id={$id}&off_details=1&", array(lastpagedefault => 1)); $subres = sql_query("SELECT id, text, user, added, editedby, editdate FROM comments WHERE offer = " . sqlesc($id) . " ORDER BY id {$limit}") or sqlerr(__FILE__, __LINE__); $allrows = array(); while ($subrow = mysql_fetch_array($subres)) { $allrows[] = $subrow; } //end_frame(); //print($commentbar); print $pagertop; commenttable($allrows, "offer", $id); print $pagerbottom; } print "<table style='border:1px solid #000000;'><tr>" . "<td class=\"text\" align=\"center\"><b>" . $lang_offers['text_quick_comment'] . "</b><br /><br />" . "<form id=\"compose\" name=\"comment\" method=\"post\" action=\"comment.php?action=add&type=offer\" onsubmit=\"return postvalid(this);\">" . "<input type=\"hidden\" name=\"pid\" value=\"" . $id . "\" /><br />"; quickreply('comment', 'body', $lang_offers['submit_add_comment']); print "</form></td></tr></table>"; print $commentbar; stdfoot(); die; } //=== end offer details //=== allow offer by staff if ($_GET["allow_offer"]) { if (get_user_class() < $offermanage_class) { stderr($lang_offers['std_access_denied'], $lang_offers['std_mans_job']); }
tr($lang_details['row_thanks_by'], "<span id=\"thanksadded\" style=\"display: none;\"><input class=\"btn\" type=\"button\" value=\"" . $lang_details['text_thanks_added'] . "\" disabled=\"disabled\" /></span><span id=\"curuser\" style=\"display: none;\">" . get_username($CURUSER['id']) . " </span><span id=\"thanksbutton\">" . $thanksbutton . "</span> <span id=\"nothanks\">" . $nothanks . "</span><span id=\"addcuruser\"></span>" . $thanksby . ($thanks_all < $thanksCount ? $lang_details['text_and_more'] . $thanksCount . $lang_details['text_users_in_total'] : ""), 1); // ------------- end thanked-by block--------------// print "</table>\n"; } else { stdhead($lang_details['head_comments_for_torrent'] . "\"" . $row["name"] . "\""); print "<h1 id=\"top\">" . $lang_details['text_comments_for'] . "<a href=\"details.php?id=" . $id . "\">" . htmlspecialchars($row["name"]) . "</a></h1>\n"; } // -----------------COMMENT SECTION ---------------------// if ($CURUSER['showcomment'] != 'no') { $count = get_row_count("comments", "WHERE torrent=" . sqlesc($id)); if ($count) { print "<br /><br />"; print "<h1 align=\"center\" id=\"startcomments\">" . $lang_details['h1_user_comments'] . "</h1>\n"; list($pagertop, $pagerbottom, $limit) = pager(10, $count, "details.php?id={$id}&cmtpage=1&", array(lastpagedefault => 1), "page"); $subres = sql_query("SELECT id, text, user, added, editedby, editdate FROM comments WHERE torrent = {$id} ORDER BY id {$limit}") or sqlerr(__FILE__, __LINE__); $allrows = array(); while ($subrow = mysql_fetch_array($subres)) { $allrows[] = $subrow; } print $pagertop; commenttable($allrows, "torrent", $id); print $pagerbottom; } } print "<br /><br />"; print "<table style='border:1px solid #000000;'><tr><td class=\"text\" align=\"center\"><b>" . $lang_details['text_quick_comment'] . "</b><br /><br /><form id=\"compose\" name=\"comment\" method=\"post\" action=\"" . htmlspecialchars("comment.php?action=add&type=torrent") . "\" onsubmit=\"return postvalid(this);\"><input type=\"hidden\" name=\"pid\" value=\"" . $id . "\" /><br />"; quickreply('comment', 'body', $lang_details['submit_add_comment']); print "</form></td></tr></table>"; print "<p align=\"center\"><a class=\"index\" href=\"" . htmlspecialchars("comment.php?action=add&pid=" . $id . "&type=torrent") . "\">" . $lang_details['text_add_a_comment'] . "</a></p>\n"; } stdfoot();
print "</table><br/><br/>\n"; $commentbar = "<p align=\"center\"><a class=\"index\" href=\"comment.php?action=add&pid=" . $id . "&type=request\">添加留言</a></p>\n"; $subres = sql_query("SELECT COUNT(*) FROM comments WHERE request = {$id}"); $subrow = mysql_fetch_array($subres); $count = $subrow[0]; if (!$count) { print "<h1 id=\"startcomments\" align=\"center\">没有留言</h1>\n"; } else { list($pagertop, $pagerbottom, $limit) = pager(10, $count, "viewrequest.php?action=view&id={$id}&", array(lastpagedefault => 1)); $subres = sql_query("SELECT id, text, user, added, editedby, editdate FROM comments WHERE request = " . sqlesc($id) . " ORDER BY id {$limit}") or sqlerr(__FILE__, __LINE__); $allrows = array(); while ($subrow = mysql_fetch_array($subres)) { $allrows[] = $subrow; } print $pagertop; commenttable($allrows, "request", $id); print $pagerbottom; } print '<script type="text/javascript"> function quick_reply_to(username) { parent.document.getElementById("quickreplytext").focus(); parent.document.getElementById("quickreplytext").value = "@" + username + " "+parent.document.getElementById("quickreplytext").value; } </script>'; print "<a name='quickreply' id='quickreply'> </a><table style='border:1px solid #000000;'><tr>" . "<td class=\"text\" align=\"center\"><b>快速留言</b><br /><br />" . "<form id=\"compose\" name=\"comment\" method=\"post\" action=\"comment.php?action=add&type=request\" onsubmit=\"return postvalid(this);\">" . "<input type=\"hidden\" name=\"pid\" value=\"" . $id . "\" /><br />"; quickreply('comment', 'body', '我要留言'); print "</form></td></tr></table>"; print $commentbar; stdfoot(); } else {
echo "<div class='hiddenframe' id='MyWall'>"; begin_frame(T_("COMMENTS")); //echo "<p align=center><a class=index href=torrents-comment.php?id=$id>" .T_("ADDCOMMENT"). "</a></p>\n"; $subres = SQL_Query_exec("SELECT COUNT(*) FROM comments WHERE userprofile = {$id}"); $subrow = mysql_fetch_array($subres); $commcount = $subrow[0]; if ($commcount) { list($pagertop, $pagerbottom, $limit) = pager(10, $commcount, "account-details.php?id={$user['id']}&"); $commquery = "SELECT comments.id, text, user, comments.added, avatar, signature, username, title, class, uploaded, downloaded, privacy, donated FROM comments LEFT JOIN users ON comments.user = users.id WHERE userprofile = {$id} ORDER BY comments.id {$limit}"; $commres = SQL_Query_exec($commquery); } else { unset($commres); } if ($commcount) { print $pagertop; commenttable($commres, 'userprofile'); print $pagerbottom; } else { print "<br /><b>" . T_("NOCOMMENTS") . "</b><br />\n"; } require_once "backend/bbcode.php"; if ($CURUSER) { echo "<center>"; echo "<form name=\"comment\" method=\"post\" action=\"account-details.php?id={$user['id']}&takecomment=yes\">"; echo textbbcode("comment", "body") . "<br />"; echo "<input type=\"submit\" value=\"" . T_("ADDCOMMENT") . "\" />"; echo "</form></center>"; } echo "</div>"; end_frame(); echo "<div class='hiddenframe' id='localactiv'>";