ReportedContent.template.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines http://www.simplemachines.org
  7. * @copyright 2014 Simple Machines and individual contributors
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. function template_reported_posts()
  13. {
  14. global $context, $txt, $scripturl;
  15. // Let them know the action was a success.
  16. if (!empty($context['report_post_action']))
  17. {
  18. echo '
  19. <div class="infobox">
  20. ', $txt['report_action_'. $context['report_post_action']], '
  21. </div>';
  22. }
  23. echo '
  24. <form id="reported_posts" action="', $scripturl, '?action=moderate;area=reportedposts;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
  25. <div class="cat_bar">
  26. <h3 class="catbg">
  27. ', $context['view_closed'] ? $txt['mc_reportedp_closed'] : $txt['mc_reportedp_active'], '
  28. </h3>
  29. </div>';
  30. // Make the buttons.
  31. $close_button = create_button('close.png', $context['view_closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', $context['view_closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', 'class="centericon"');
  32. $details_button = create_button('details.png', 'mc_reportedp_details', 'mc_reportedp_details', 'class="centericon"');
  33. $ignore_button = create_button('ignore.png', 'mc_reportedp_ignore', 'mc_reportedp_ignore', 'class="centericon"');
  34. $unignore_button = create_button('ignore.png', 'mc_reportedp_unignore', 'mc_reportedp_unignore', 'class="centericon"');
  35. $ban_button = create_button('close.png', 'mc_reportedp_ban', 'mc_reportedp_ban', 'class="centericon"');
  36. $delete_button = create_button('delete.png', 'mc_reportedp_delete', 'mc_reportedp_delete', 'class="centericon"');
  37. foreach ($context['reports'] as $report)
  38. {
  39. echo '
  40. <div class="generic_list_wrapper ', $report['alternate'] ? 'windowbg' : 'windowbg2', '">
  41. <div class="content">
  42. <h5>
  43. <strong>', !empty($report['topic']['board_name']) ? '<a href="' . $scripturl . '?board=' . $report['topic']['id_board'] . '.0">' . $report['topic']['board_name'] . '</a>' : '??', ' / <a href="', $report['topic']['href'], '">', $report['subject'], '</a></strong> ', $txt['mc_reportedp_by'], ' <strong>', $report['author']['link'], '</strong>
  44. </h5>
  45. <div class="smalltext">
  46. ', $txt['mc_reportedp_last_reported'], ': ', $report['last_updated'], '&nbsp;-&nbsp;';
  47. // Prepare the comments...
  48. $comments = array();
  49. foreach ($report['comments'] as $comment)
  50. $comments[$comment['member']['id']] = $comment['member']['link'];
  51. echo '
  52. ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
  53. </div>
  54. <hr>
  55. ', $report['body'], '
  56. <br>
  57. <ul class="quickbuttons">
  58. <li><a href="', $report['report_href'], '">', $details_button, '</a></li>
  59. <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="report_ignore" data-ignore="', (int) !$report['ignore'], '">', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li>
  60. <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>';
  61. // Delete message button.
  62. if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])))
  63. echo '
  64. <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'] ,'.0;msg=', $report['topic']['id_msg'] ,';modcenter;', $context['session_var'], '=', $context['session_id'], '" class="delete_message">', $delete_button, '</a></li>';
  65. // Ban this user button.
  66. if (!$report['closed'] && !empty($context['report_manage_bans']))
  67. echo '
  68. <li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u='. $report['author']['id'] : ';msg='. $report['topic']['id_msg']) ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>';
  69. echo '
  70. <li>', !$context['view_closed'] ? '<input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check">' : '', '</li>
  71. </ul>
  72. </div>
  73. </div>';
  74. }
  75. // Were none found?
  76. if (empty($context['reports']))
  77. echo '
  78. <div class="windowbg2">
  79. <div class="content">
  80. <p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
  81. </div>
  82. </div>';
  83. echo '
  84. <div class="pagesection">
  85. ', !empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many'] ? '<div class="pagelinks floatleft">'. $context['page_index']. '</div>' : '' ,'
  86. <div class="floatright">', !$context['view_closed'] ? '
  87. <input type="hidden" name="'. $context['mod-report-close-all_token_var'] .'" value="'. $context['mod-report-close-all_token'] .'">
  88. <input type="submit" name="close_selected" value="' . $txt['mc_reportedp_close_selected'] . '" class="button_submit">' : '', '
  89. </div>
  90. </div>
  91. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  92. </form>';
  93. }
  94. // A block to show the current top reported posts.
  95. function template_reported_posts_block()
  96. {
  97. global $context, $txt, $scripturl;
  98. echo '
  99. <div class="cat_bar">
  100. <h3 class="catbg">
  101. <span id="reported_posts_toggle" class="', !empty($context['admin_prefs']['mcrp']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
  102. <a href="', $scripturl, '?action=moderate;area=reportedposts" id="reported_posts_link">', $txt['mc_recent_reports'], '</a>
  103. </h3>
  104. </div>
  105. <div class="windowbg" id="reported_posts_panel">
  106. <div class="content modbox">
  107. <ul class="reset">';
  108. foreach ($context['reported_posts'] as $report)
  109. echo '
  110. <li class="smalltext">
  111. <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], '
  112. </li>';
  113. // Don't have any watched users right now?
  114. if (empty($context['reported_posts']))
  115. echo '
  116. <li>
  117. <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
  118. </li>';
  119. echo '
  120. </ul>
  121. </div>
  122. </div>
  123. <script><!-- // --><![CDATA[
  124. var oReportedPostsPanelToggle = new smc_Toggle({
  125. bToggleEnabled: true,
  126. bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcrp']) ? 'true' : 'false', ',
  127. aSwappableContainers: [
  128. \'reported_posts_panel\'
  129. ],
  130. aSwapImages: [
  131. {
  132. sId: \'reported_posts_toggle\',
  133. altExpanded: ', JavaScriptEscape($txt['hide']), ',
  134. altCollapsed: ', JavaScriptEscape($txt['show']), '
  135. }
  136. ],
  137. aSwapLinks: [
  138. {
  139. sId: \'reported_posts_link\',
  140. msgExpanded: ', JavaScriptEscape($txt['mc_recent_reports']), ',
  141. msgCollapsed: ', JavaScriptEscape($txt['mc_recent_reports']), '
  142. }
  143. ],
  144. oThemeOptions: {
  145. bUseThemeSettings: true,
  146. sOptionName: \'admin_preferences\',
  147. sSessionVar: smf_session_var,
  148. sSessionId: smf_session_id,
  149. sThemeId: \'1\',
  150. sAdditionalVars: \';admin_key=mcrp\'
  151. }
  152. });
  153. // ]]></script>';
  154. }
  155. function template_viewmodreport()
  156. {
  157. global $context, $scripturl, $txt;
  158. // Let them know the action was a success.
  159. if (!empty($context['report_post_action']))
  160. {
  161. echo '
  162. <div class="infobox">
  163. ', $txt['report_action_'. $context['report_post_action']], '
  164. </div>';
  165. }
  166. echo '
  167. <div id="modcenter">
  168. <form action="', $scripturl, '?action=moderate;area=reportedposts;sa=handlecomment;rid=', $context['report']['id'], '" method="post" accept-charset="', $context['character_set'], '">
  169. <div class="cat_bar">
  170. <h3 class="catbg">
  171. ', sprintf($txt['mc_viewmodreport'], $context['report']['message_link'], $context['report']['author']['link']), '
  172. </h3>
  173. </div>
  174. <div class="title_bar">
  175. <h3 class="titlebg">
  176. <span class="floatleft">
  177. ', sprintf($txt['mc_modreport_summary'], $context['report']['num_reports'], $context['report']['last_updated']), '
  178. </span>
  179. <span class="floatright">';
  180. // Make the buttons.
  181. $close_button = create_button('close.png', $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', 'class="centericon"');
  182. $ignore_button = create_button('ignore.png', 'mc_reportedp_ignore', 'mc_reportedp_ignore', 'class="centericon"');
  183. $unignore_button = create_button('ignore.png', 'mc_reportedp_unignore', 'mc_reportedp_unignore', 'class="centericon"');
  184. echo '
  185. <a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;ignore=', (int) !$context['report']['ignore'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="report_ignore" data-ignore="', !$context['report']['ignore'] ,'">', $context['report']['ignore'] ? $unignore_button : $ignore_button, '</a>
  186. <a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$context['report']['closed'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a>
  187. </span>
  188. </h3>
  189. </div>
  190. <div class="windowbg2">
  191. <div class="content">
  192. ', $context['report']['body'], '
  193. </div>
  194. </div>
  195. <br>
  196. <div class="cat_bar">
  197. <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3>
  198. </div>';
  199. foreach ($context['report']['comments'] as $comment)
  200. echo '
  201. <div class="windowbg">
  202. <div class="content">
  203. <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
  204. <p>', $comment['message'], '</p>
  205. </div>
  206. </div>';
  207. echo '
  208. <br>
  209. <div class="cat_bar">
  210. <h3 class="catbg">', $txt['mc_modreport_mod_comments'], '</h3>
  211. </div>
  212. <div>';
  213. if (empty($context['report']['mod_comments']))
  214. echo '
  215. <div class="information">
  216. <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
  217. </div>';
  218. foreach ($context['report']['mod_comments'] as $comment)
  219. {
  220. echo
  221. '<div class="cat_bar">
  222. <h4 class="catbg">', $comment['member']['link'], ': <em class="smalltext">(', $comment['time'], ')</em>', ($comment['can_edit'] ? '<span class="floatright"><a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=editcomment;rid='. $context['report']['id'] .';mid='. $comment['id'] .';'. $context['session_var'] .'='. $context['session_id'] .'">'. $txt['mc_reportedp_comment_edit'] .'</a> | <a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=handlecomment;rid='. $context['report']['id'] .';mid='. $comment['id'] .';delete;'. $context['session_var'] .'='. $context['session_id']. ';'. $context['mod-reportC-delete_token_var'] .'='. $context['mod-reportC-delete_token'] .'" class="deleteModComment">'. $txt['mc_reportedp_comment_delete'] .'</a></span>' : '') ,'
  223. </div></h4>';
  224. echo '
  225. <div class="windowbg">
  226. <p class="content">', $comment['message'], '</p>
  227. </div>';
  228. }
  229. echo '
  230. <div class="title_bar">
  231. <h3 class="titlebg">
  232. <span class="floatleft">
  233. ', $txt['mc_reportedp_new_comment'], '
  234. </span>
  235. </h3>
  236. </div>
  237. <div class="content">
  238. <textarea rows="2" cols="60" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 60%') . ';" name="mod_comment"></textarea>
  239. <div class="padding">
  240. <input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button_submit">
  241. <input type="hidden" name="', $context['mod-reportC-add_token_var'], '" value="', $context['mod-reportC-add_token'], '">
  242. </div>
  243. </div>
  244. </div>
  245. <br>';
  246. template_show_list('moderation_actions_list');
  247. echo '
  248. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  249. </form>
  250. </div>';
  251. }
  252. function template_edit_comment()
  253. {
  254. global $context, $scripturl, $txt;
  255. echo '
  256. <div id="modcenter">
  257. <form action="', $scripturl, '?action=moderate;area=reported', $context['report_type'], ';sa=editcomment;mid=', $context['comment_id'], ';rid=', $context['report_id'] ,';save" method="post" accept-charset="', $context['character_set'], '">';
  258. echo '
  259. <br>
  260. <div class="cat_bar">
  261. <h3 class="catbg">', $txt['mc_modreport_edit_mod_comment'] ,'</h3>
  262. </div>
  263. <div class="windowbg2">
  264. <div class="content">';
  265. echo '
  266. <textarea rows="6" cols="60" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 60%') . ';" name="mod_comment">', $context['comment']['body'] ,'</textarea>
  267. <div>
  268. <input type="submit" name="edit_comment" value="', $txt['mc_modreport_edit_mod_comment'], '" class="button_submit">
  269. </div>
  270. </div>
  271. </div>
  272. <br>';
  273. echo '
  274. <input type="hidden" name="', $context['mod-reportC-edit_token_var'], '" value="', $context['mod-reportC-edit_token'], '">
  275. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  276. </form>
  277. </div>';
  278. }
  279. // A block to show the current top reported member profiles.
  280. function template_reported_members_block()
  281. {
  282. global $context, $txt, $scripturl;
  283. echo '
  284. <div class="cat_bar">
  285. <h3 class="catbg">
  286. <span id="reported_members_toggle" class="', !empty($context['admin_prefs']['mcru']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
  287. <a href="', $scripturl, '?action=moderate;area=reportedmembers" id="reported_members_link">', $txt['mc_recent_member_reports'], '</a>
  288. </h3>
  289. </div>
  290. <div class="windowbg" id="reported_users_panel">
  291. <div class="content modbox">
  292. <ul class="reset">';
  293. foreach ($context['reported_members'] as $report)
  294. echo '
  295. <li class="smalltext">
  296. <a href="', $report['report_href'], '">', $report['user_name'], '</a>
  297. </li>';
  298. // Don't have any reported members right now?
  299. if (empty($context['reported_members']))
  300. echo '
  301. <li>
  302. <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
  303. </li>';
  304. echo '
  305. </ul>
  306. </div>
  307. </div>
  308. <script><!-- // --><![CDATA[
  309. var oReportedPostsPanelToggle = new smc_Toggle({
  310. bToggleEnabled: true,
  311. bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcrm']) ? 'true' : 'false', ',
  312. aSwappableContainers: [
  313. \'reported_members_panel\'
  314. ],
  315. aSwapImages: [
  316. {
  317. sId: \'reported_members_toggle\',
  318. altExpanded: ', JavaScriptEscape($txt['hide']), ',
  319. altCollapsed: ', JavaScriptEscape($txt['show']), '
  320. }
  321. ],
  322. aSwapLinks: [
  323. {
  324. sId: \'reported_members_link\',
  325. msgExpanded: ', JavaScriptEscape($txt['mc_recent_member_reports']), ',
  326. msgCollapsed: ', JavaScriptEscape($txt['mc_recent_member_reports']), '
  327. }
  328. ],
  329. oThemeOptions: {
  330. bUseThemeSettings: true,
  331. sOptionName: \'admin_preferences\',
  332. sSessionVar: smf_session_var,
  333. sSessionId: smf_session_id,
  334. sThemeId: \'1\',
  335. sAdditionalVars: \';admin_key=mcrm\'
  336. }
  337. });
  338. // ]]></script>';
  339. }
  340. function template_reported_members()
  341. {
  342. global $context, $txt, $scripturl;
  343. // Let them know the action was a success.
  344. if (!empty($context['report_post_action']) && !empty($txt['report_action_'. $context['report_post_action']]))
  345. {
  346. echo '
  347. <div class="infobox">
  348. ', $txt['report_action_'. $context['report_post_action']], '
  349. </div>';
  350. }
  351. echo '
  352. <form id="reported_members" action="', $scripturl, '?action=moderate;area=reportedmembers;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
  353. <div class="cat_bar">
  354. <h3 class="catbg">
  355. ', $context['view_closed'] ? $txt['mc_reportedp_closed'] : $txt['mc_reportedp_active'], '
  356. </h3>
  357. </div>
  358. <div class="pagesection">
  359. <div class="pagelinks">', $context['page_index'], '</div>
  360. </div>';
  361. // Make the buttons.
  362. $close_button = create_button('close.png', $context['view_closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', $context['view_closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', 'class="centericon"');
  363. $details_button = create_button('details.png', 'mc_reportedp_details', 'mc_reportedp_details', 'class="centericon"');
  364. $ignore_button = create_button('ignore.png', 'mc_reportedp_ignore', 'mc_reportedp_ignore', 'class="centericon"');
  365. $unignore_button = create_button('ignore.png', 'mc_reportedp_unignore', 'mc_reportedp_unignore', 'class="centericon"');
  366. $ban_button = create_button('close.png', 'mc_reportedp_ban', 'mc_reportedp_ban', 'class="centericon"');
  367. foreach ($context['reports'] as $report)
  368. {
  369. echo '
  370. <div class="generic_list_wrapper ', $report['alternate'] ? 'windowbg' : 'windowbg2', '">
  371. <div class="content">
  372. <h5>
  373. <strong><a href="', $report['user']['href'], '">', $report['user']['name'], '</a></strong>
  374. </h5>
  375. <div class="smalltext">
  376. ', $txt['mc_reportedp_last_reported'], ': ', $report['last_updated'], '&nbsp;-&nbsp;';
  377. // Prepare the comments...
  378. $comments = array();
  379. foreach ($report['comments'] as $comment)
  380. $comments[$comment['member']['id']] = $comment['member']['link'];
  381. echo '
  382. ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
  383. </div>
  384. <hr>
  385. <ul class="quickbuttons">
  386. <li><a href="', $report['report_href'], '">', $details_button, '</a></li>
  387. <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="report_ignore" data-ignore="', (int) !$report['ignore'], '">', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li>
  388. <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>';
  389. // Ban this user button.
  390. if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id']))
  391. echo '
  392. <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'] ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>';
  393. echo '
  394. <li>', !$context['view_closed'] ? '<input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check">' : '', '</li>
  395. </ul>
  396. </div>
  397. </div>';
  398. }
  399. // Were none found?
  400. if (empty($context['reports']))
  401. echo '
  402. <div class="windowbg2">
  403. <div class="content">
  404. <p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
  405. </div>
  406. </div>';
  407. echo '
  408. <div class="pagesection">
  409. <div class="pagelinks floatleft">', $context['page_index'], '</div>
  410. <div class="floatright">
  411. ', !$context['view_closed'] ? '<input type="submit" name="close_selected" value="' . $txt['mc_reportedp_close_selected'] . '" class="button_submit">' : '', '
  412. </div>
  413. </div>
  414. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  415. </form>';
  416. }
  417. function template_viewmemberreport()
  418. {
  419. global $context, $scripturl, $txt;
  420. // Let them know the action was a success.
  421. if (!empty($context['report_post_action']))
  422. {
  423. echo '
  424. <div class="infobox">
  425. ', $txt['report_action_'. $context['report_post_action']], '
  426. </div>';
  427. }
  428. echo '
  429. <div id="modcenter">
  430. <form action="', $scripturl, '?action=moderate;area=reportedmembers;sa=handlecomment;rid=', $context['report']['id'], '" method="post" accept-charset="', $context['character_set'], '">
  431. <div class="cat_bar">
  432. <h3 class="catbg">
  433. ', sprintf($txt['mc_viewmemberreport'], $context['report']['user']['link']), '
  434. </h3>
  435. </div>
  436. <div class="title_bar">
  437. <h3 class="titlebg">
  438. <span class="floatleft">
  439. ', sprintf($txt['mc_memberreport_summary'], $context['report']['num_reports'], $context['report']['last_updated']), '
  440. </span>
  441. <span class="floatright">';
  442. // Make the buttons.
  443. $close_button = create_button('close.png', $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', 'class="centericon"');
  444. $ignore_button = create_button('ignore.png', 'mc_reportedp_ignore', 'mc_reportedp_ignore', 'class="centericon"');
  445. $unignore_button = create_button('ignore.png', 'mc_reportedp_unignore', 'mc_reportedp_unignore', 'class="centericon"');
  446. echo '
  447. <a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;ignore=', (int) !$context['report']['ignore'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="report_ignore" data-ignore="', !$context['report']['ignore'] ,'">', $context['report']['ignore'] ? $unignore_button : $ignore_button, '</a>
  448. <a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$context['report']['closed'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a>
  449. </span>
  450. </h3>
  451. </div>
  452. <br>
  453. <div class="cat_bar">
  454. <h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3>
  455. </div>';
  456. foreach ($context['report']['comments'] as $comment)
  457. echo '
  458. <div class="windowbg">
  459. <div class="content">
  460. <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
  461. <p>', $comment['message'], '</p>
  462. </div>
  463. </div>';
  464. echo '
  465. <br>
  466. <div class="cat_bar">
  467. <h3 class="catbg">', $txt['mc_modreport_mod_comments'], '</h3>
  468. </div>
  469. <div>';
  470. if (empty($context['report']['mod_comments']))
  471. echo '
  472. <div class="information">
  473. <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
  474. </div>';
  475. foreach ($context['report']['mod_comments'] as $comment)
  476. {
  477. echo
  478. '<div class="cat_bar">
  479. <h4 class="catbg">', $comment['member']['link'], ': <em class="smalltext">(', $comment['time'], ')</em>', ($comment['can_edit'] ? '<span class="floatright"><a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=editcomment;rid='. $context['report']['id'] .';mid='. $comment['id'] .';'. $context['session_var'] .'='. $context['session_id'] .'">'. $txt['mc_reportedp_comment_edit'] .'</a> | <a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=handlecomment;rid='. $context['report']['id'] .';mid='. $comment['id'] .';delete;'. $context['session_var'] .'='. $context['session_id']. ';'. $context['mod-reportC-delete_token_var'] .'='. $context['mod-reportC-delete_token'] .'" class="deleteModComment">'. $txt['mc_reportedp_comment_delete'] .'</a></span>' : '') ,'
  480. </div></h4>';
  481. echo '
  482. <div class="windowbg">
  483. <p class="content">', $comment['message'], '</p>
  484. </div>';
  485. }
  486. echo '
  487. <div class="title_bar">
  488. <h3 class="titlebg">
  489. <span class="floatleft">
  490. ', $txt['mc_reportedp_new_comment'], '
  491. </span>
  492. </h3>
  493. </div>
  494. <div class="content">
  495. <textarea rows="2" cols="60" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 60%') . ';" name="mod_comment"></textarea>
  496. <div class="padding">
  497. <input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button_submit">
  498. <input type="hidden" name="', $context['mod-reportC-add_token_var'], '" value="', $context['mod-reportC-add_token'], '">
  499. </div>
  500. </div>
  501. </div>
  502. <br>';
  503. template_show_list('moderation_actions_list');
  504. echo '
  505. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  506. </form>
  507. </div>';
  508. }
  509. ?>