comparison forum/Themes/default/ModerationCenter.template.php @ 76:e3e11437ecea website

Add forum code
author Chris Cannam
date Sun, 07 Jul 2013 11:25:48 +0200
parents
children
comparison
equal deleted inserted replaced
75:72f59aa7e503 76:e3e11437ecea
1 <?php
2 /**
3 * Simple Machines Forum (SMF)
4 *
5 * @package SMF
6 * @author Simple Machines
7 * @copyright 2011 Simple Machines
8 * @license http://www.simplemachines.org/about/smf/license.php BSD
9 *
10 * @version 2.0
11 */
12
13 function template_moderation_center()
14 {
15 global $settings, $options, $context, $txt, $scripturl;
16
17 // Show a welcome message to the user.
18 echo '
19 <div id="modcenter">
20 <div class="cat_bar">
21 <h3 class="catbg">', $txt['moderation_center'], '</h3>
22 </div>
23 <div class="information">
24 <strong>', $txt['hello_guest'], ' ', $context['user']['name'], '!</strong>
25 <p>
26 ', $txt['mc_description'], '
27 </p>
28
29 </div>';
30
31 $alternate = true;
32 // Show all the blocks they want to see.
33 foreach ($context['mod_blocks'] as $block)
34 {
35 $block_function = 'template_' . $block;
36
37 echo '
38 <div class="modblock_', $alternate ? 'left' : 'right', '">', function_exists($block_function) ? $block_function() : '', '</div>';
39
40 if (!$alternate)
41 echo '
42 <br class="clear" />';
43
44 $alternate = !$alternate;
45 }
46
47 echo '
48 </div>
49 <br class="clear" />';
50 }
51
52 function template_latest_news()
53 {
54 global $settings, $options, $context, $txt, $scripturl;
55
56 echo '
57 <div class="cat_bar">
58 <h3 class="catbg">
59 <span class="ie6_header floatleft"><a href="', $scripturl, '?action=helpadmin;help=live_news" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a> ', $txt['mc_latest_news'], '</span>
60 </h3>
61 </div>
62 <div class="windowbg">
63 <span class="topslice"><span></span></span>
64 <div class="content">
65 <div id="smfAnnouncements" class="smalltext">', $txt['mc_cannot_connect_sm'], '</div>
66 </div>
67 <span class="botslice"><span></span></span>
68 </div>';
69
70 // This requires a lot of javascript...
71 //!!! Put this in it's own file!!
72 echo '
73 <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
74 <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>
75 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/admin.js?fin20"></script>
76 <script type="text/javascript"><!-- // --><![CDATA[
77 var oAdminIndex = new smf_AdminIndex({
78 sSelf: \'oAdminCenter\',
79
80 bLoadAnnouncements: true,
81 sAnnouncementTemplate: ', JavaScriptEscape('
82 <dl>
83 %content%
84 </dl>
85 '), ',
86 sAnnouncementMessageTemplate: ', JavaScriptEscape('
87 <dt><a href="%href%">%subject%</a> ' . $txt['on'] . ' %time%</dt>
88 <dd>
89 %message%
90 </dd>
91 '), ',
92 sAnnouncementContainerId: \'smfAnnouncements\'
93 });
94 // ]]></script>';
95
96 }
97
98 // Show all the group requests the user can see.
99 function template_group_requests_block()
100 {
101 global $settings, $options, $context, $txt, $scripturl;
102
103 echo '
104 <div class="cat_bar">
105 <h3 class="catbg">
106 <a href="', $scripturl, '?action=groups;sa=requests">', $txt['mc_group_requests'], '</a>
107 </h3>
108 </div>
109 <div class="windowbg">
110 <span class="topslice"><span></span></span>
111 <div class="content modbox">
112 <ul class="reset">';
113
114 foreach ($context['group_requests'] as $request)
115 echo '
116 <li class="smalltext">
117 <a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], '
118 </li>';
119
120 // Don't have any watched users right now?
121 if (empty($context['group_requests']))
122 echo '
123 <li>
124 <strong class="smalltext">', $txt['mc_group_requests_none'], '</strong>
125 </li>';
126
127 echo '
128 </ul>
129 </div>
130 <span class="botslice"><span></span></span>
131 </div>';
132 }
133
134 // A block to show the current top reported posts.
135 function template_reported_posts_block()
136 {
137 global $settings, $options, $context, $txt, $scripturl;
138
139 echo '
140 <div class="cat_bar">
141 <h3 class="catbg">
142 <a href="', $scripturl, '?action=moderate;area=reports">', $txt['mc_recent_reports'], '</a>
143 </h3>
144 </div>
145 <div class="windowbg">
146 <span class="topslice"><span></span></span>
147 <div class="content modbox">
148 <ul class="reset">';
149
150 foreach ($context['reported_posts'] as $report)
151 echo '
152 <li class="smalltext">
153 <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], '
154 </li>';
155
156 // Don't have any watched users right now?
157 if (empty($context['reported_posts']))
158 echo '
159 <li>
160 <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
161 </li>';
162
163 echo '
164 </ul>
165 </div>
166 <span class="botslice"><span></span></span>
167 </div>';
168 }
169
170 function template_watched_users()
171 {
172 global $settings, $options, $context, $txt, $scripturl;
173
174 echo '
175 <div class="cat_bar">
176 <h3 class="catbg">
177 <a href="', $scripturl, '?action=moderate;area=userwatch">', $txt['mc_watched_users'], '</a>
178 </h3>
179 </div>
180 <div class="windowbg">
181 <span class="topslice"><span></span></span>
182 <div class="content modbox">
183 <ul class="reset">';
184
185 foreach ($context['watched_users'] as $user)
186 echo '
187 <li>
188 <span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span>
189 </li>';
190
191 // Don't have any watched users right now?
192 if (empty($context['watched_users']))
193 echo '
194 <li>
195 <strong class="smalltext">', $txt['mc_watched_users_none'], '</strong>
196 </li>';
197
198 echo '
199 </ul>
200 </div>
201 <span class="botslice"><span></span></span>
202 </div>';
203 }
204
205 // Little section for making... notes.
206 function template_notes()
207 {
208 global $settings, $options, $context, $txt, $scripturl;
209
210 echo '
211 <form action="', $scripturl, '?action=moderate;area=index" method="post">
212 <div class="cat_bar">
213 <h3 class="catbg">', $txt['mc_notes'], '</h3>
214 </div>
215 <div class="windowbg">
216 <span class="topslice"><span></span></span>
217 <div class="content modbox">';
218
219 if (!empty($context['notes']))
220 {
221 echo '
222 <ul class="reset moderation_notes">';
223
224 // Cycle through the notes.
225 foreach ($context['notes'] as $note)
226 echo '
227 <li class="smalltext"><a href="', $note['delete_href'], '"><img src="', $settings['images_url'], '/pm_recipient_delete.gif" alt="" /></a> <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>';
228
229 echo '
230 </ul>
231 <div class="pagesection notes">
232 <span class="smalltext">', $txt['pages'], ': ', $context['page_index'], '</span>
233 </div>';
234 }
235
236 echo '
237 <div class="floatleft post_note">
238 <input type="text" name="new_note" value="', $txt['mc_click_add_note'], '" style="width: 95%;" onclick="if (this.value == \'', $txt['mc_click_add_note'], '\') this.value = \'\';" class="input_text" />
239 </div>
240 <div class="floatright">
241 <input type="submit" name="makenote" value="', $txt['mc_add_note'], '" class="button_submit" />
242 </div>
243 <br class="clear" />
244 </div>
245 <span class="botslice"><span></span></span>
246 </div>
247 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
248 </form>';
249 }
250
251 function template_reported_posts()
252 {
253 global $settings, $options, $context, $txt, $scripturl;
254
255 echo '
256 <form action="', $scripturl, '?action=moderate;area=reports', $context['view_closed'] ? ';sa=closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
257 <div class="cat_bar">
258 <h3 class="catbg">
259 ', $context['view_closed'] ? $txt['mc_reportedp_closed'] : $txt['mc_reportedp_active'], '
260 </h3>
261 </div>
262 <div class="pagesection">
263 <div class="pages">', $txt['pages'], ': ', $context['page_index'], '</div>
264 </div>';
265
266 // Make the buttons.
267 $close_button = create_button('close.gif', $context['view_closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', $context['view_closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', 'align="middle"');
268 $details_button = create_button('details.gif', 'mc_reportedp_details', 'mc_reportedp_details', 'align="middle"');
269 $ignore_button = create_button('ignore.gif', 'mc_reportedp_ignore', 'mc_reportedp_ignore', 'align="middle"');
270 $unignore_button = create_button('ignore.gif', 'mc_reportedp_unignore', 'mc_reportedp_unignore', 'align="middle"');
271
272 foreach ($context['reports'] as $report)
273 {
274 echo '
275 <div class="', $report['alternate'] ? 'windowbg' : 'windowbg2', '">
276 <span class="topslice"><span></span></span>
277 <div class="content">
278 <div>
279 <div class="floatleft">
280 <strong><a href="', $report['topic_href'], '">', $report['subject'], '</a></strong> ', $txt['mc_reportedp_by'], ' <strong>', $report['author']['link'], '</strong>
281 </div>
282 <div class="floatright">
283 <a href="', $report['report_href'], '">', $details_button, '</a>
284 <a href="', $scripturl, '?action=moderate;area=reports', $context['view_closed'] ? ';sa=closed' : '', ';ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" ', !$report['ignore'] ? 'onclick="return confirm(\'' . $txt['mc_reportedp_ignore_confirm'] . '\');"' : '', '>', $report['ignore'] ? $unignore_button : $ignore_button, '</a>
285 <a href="', $scripturl, '?action=moderate;area=reports', $context['view_closed'] ? ';sa=closed' : '', ';close=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '">', $close_button, '</a>
286 ', !$context['view_closed'] ? '<input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check" />' : '', '
287 </div>
288 </div><br />
289 <div class="smalltext">
290 &#171; ', $txt['mc_reportedp_last_reported'], ': ', $report['last_updated'], ' &#187;<br />';
291
292 // Prepare the comments...
293 $comments = array();
294 foreach ($report['comments'] as $comment)
295 $comments[$comment['member']['id']] = $comment['member']['link'];
296
297 echo '
298 &#171; ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' &#187;
299 </div>
300 <hr />
301 ', $report['body'], '
302 </div>
303 <span class="botslice"><span></span></span>
304 </div>';
305 }
306
307 // Were none found?
308 if (empty($context['reports']))
309 echo '
310 <div class="windowbg2">
311 <span class="topslice"><span></span></span>
312 <div class="content">
313 <p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
314 </div>
315 <span class="botslice"><span></span></span>
316 </div>';
317
318 echo '
319 <div class="pagesection">
320 <div class="floatleft">
321 ', $txt['pages'], ': ', $context['page_index'], '
322 </div>
323 <div class="floatright">
324 ', !$context['view_closed'] ? '<input type="submit" name="close_selected" value="' . $txt['mc_reportedp_close_selected'] . '" class="button_submit" />' : '', '
325 </div>
326 </div>
327 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
328 </form>
329 <br class="clear" />';
330 }
331
332 // Show a list of all the unapproved posts
333 function template_unapproved_posts()
334 {
335 global $settings, $options, $context, $txt, $scripturl;
336
337 // Just a big table of it all really...
338 echo '
339 <div id="modcenter">
340 <form action="', $scripturl, '?action=moderate;area=postmod;start=', $context['start'], ';sa=', $context['current_view'], '" method="post" accept-charset="', $context['character_set'], '">
341 <div class="cat_bar">
342 <h3 class="catbg">', $txt['mc_unapproved_posts'], '</h3>
343 </div>';
344
345 // Make up some buttons
346 $approve_button = create_button('approve.gif', 'approve', 'approve', 'align="middle"');
347 $remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
348
349 // No posts?
350 if (empty($context['unapproved_items']))
351 echo '
352 <div class="windowbg2">
353 <span class="topslice"><span></span></span>
354 <div class="content">
355 <p class="centertext">', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '</p>
356 </div>
357 <span class="botslice"><span></span></span>
358 </div>';
359 else
360 echo '
361 <div class="pagesection">
362 <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], '</div>
363 </div>';
364
365 foreach ($context['unapproved_items'] as $item)
366 {
367 echo '
368 <div class="cat_bar">
369 <h3 class="catbg">
370 <span class="smalltext floatleft">', $item['counter'], '&nbsp;</span>
371 <span class="smalltext floatleft"><a href="', $scripturl, '#c', $item['category']['id'], '">', $item['category']['name'], '</a> / <a href="', $scripturl, '?board=', $item['board']['id'], '.0">', $item['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $item['topic']['id'], '.msg', $item['id'], '#msg', $item['id'], '">', $item['subject'], '</a></span>
372 <span class="smalltext floatright">', $txt['mc_unapproved_by'], ' ', $item['poster']['link'], ' ', $txt['on'], ': ', $item['time'], '</span>
373 </h3>
374 </div>
375 <div class="', $item['alternate'] ? 'windowbg' : 'windowbg2', '">
376 <span class="topslice"><span></span></span>
377 <div class="content">
378 <div class="post">', $item['body'], '</div>
379 <span class="floatright">
380 <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';approve=', $item['id'], '">', $approve_button, '</a>';
381
382 if ($item['can_delete'])
383 echo '
384 ', $context['menu_separator'], '
385 <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';delete=', $item['id'], '">', $remove_button, '</a>';
386
387 echo '
388 <input type="checkbox" name="item[]" value="', $item['id'], '" checked="checked" class="input_check" /> ';
389
390 echo '
391 </span>
392 <br class="clear" />
393 </div>
394 <span class="botslice"><span></span></span>
395 </div>';
396 }
397
398 echo '
399 <div class="pagesection">
400 <div class="floatright">
401 <select name="do" onchange="if (this.value != 0 &amp;&amp; confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();">
402 <option value="0">', $txt['with_selected'], ':</option>
403 <option value="0">-------------------</option>
404 <option value="approve">&nbsp;--&nbsp;', $txt['approve'], '</option>
405 <option value="delete">&nbsp;--&nbsp;', $txt['delete'], '</option>
406 </select>
407 <noscript><input type="submit" name="submit" value="', $txt['go'], '" class="button_submit" /></noscript>
408 </div>';
409
410 if (!empty($context['unapproved_items']))
411 echo '
412 <div class="floatleft">
413 <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], '</div>
414 </div>';
415
416 echo '
417 </div>
418 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
419 </form>
420 </div>
421 <br class="clear" />';
422 }
423
424 // List all attachments awaiting approval.
425 function template_unapproved_attachments()
426 {
427 global $settings, $options, $context, $txt, $scripturl;
428
429 // Show all the attachments still oustanding.
430 echo '
431 <div id="modcenter">
432 <form action="', $scripturl, '?action=moderate;area=attachmod;sa=attachments;start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
433 <div class="cat_bar">
434 <h3 class="catbg">', $txt['mc_unapproved_attachments'], '</h3>
435 </div>';
436
437 // The ever popular approve button, with the massively unpopular delete.
438 $approve_button = create_button('approve.gif', 'approve', 'approve', 'align="middle"');
439 $remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
440
441 // None awaiting?
442 if (empty($context['unapproved_items']))
443 echo '
444 <div class="windowbg">
445 <span class="topslice"><span></span></span>
446 <div class="content">
447 <p class="centertext">', $txt['mc_unapproved_attachments_none_found'], '</p>
448 </div>
449 <span class="botslice"><span></span></span>
450 </div>';
451 else
452 echo '
453 <div class="pagesection">
454 <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], '</div>
455 </div>
456 <table class="table_grid" width="100%">
457 <thead>
458 <tr class="catbg">
459 <th>', $txt['mc_unapproved_attach_name'], '</th>
460 <th>', $txt['mc_unapproved_attach_size'], '</th>
461 <th>', $txt['mc_unapproved_attach_poster'], '</th>
462 <th>', $txt['date'], '</th>
463 <th nowrap="nowrap" align="center"><input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" checked="checked" /></th>
464 </tr>
465 </thead>
466 <tbody>';
467
468 foreach ($context['unapproved_items'] as $item)
469 {
470 echo '
471 <tr class="', $item['alternate'] ? 'windowbg' : 'windowbg2', '">
472 <td>
473 ', $item['filename'], '
474 </td>
475 <td align="right">
476 ', $item['size'], $txt['kilobyte'], '
477 </td>
478 <td>
479 ', $item['poster']['link'], '
480 </td>
481 <td class="smalltext">
482 ', $item['time'], '<br />', $txt['in'], ' <a href="', $item['message']['href'], '">', $item['message']['subject'], '</a>
483 </td>
484 <td width="4%" align="center">
485 <input type="checkbox" name="item[]" value="', $item['id'], '" checked="checked" class="input_check" />
486 </td>
487 </tr>';
488 }
489
490 if (!empty($context['unapproved_items']))
491 echo '
492 </tbody>
493 </table>';
494
495 echo '
496 <div class="pagesection">
497 <div class="floatright">
498 <select name="do" onchange="if (this.value != 0 &amp;&amp; confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();">
499 <option value="0">', $txt['with_selected'], ':</option>
500 <option value="0">-------------------</option>
501 <option value="approve">&nbsp;--&nbsp;', $txt['approve'], '</option>
502 <option value="delete">&nbsp;--&nbsp;', $txt['delete'], '</option>
503 </select>
504 <noscript><input type="submit" name="submit" value="', $txt['go'], '" class="button_submit" /></noscript>
505 </div>';
506
507 if (!empty($context['unapproved_items']))
508 echo '
509 <div class="floatleft">
510 <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], '</div>
511 </div>';
512
513 echo '
514 </div>
515 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
516 </form>
517 </div>
518 <br class="clear" />';
519 }
520
521 function template_viewmodreport()
522 {
523 global $context, $scripturl, $txt;
524
525 echo '
526 <div id="modcenter">
527 <form action="', $scripturl, '?action=moderate;area=reports;report=', $context['report']['id'], '" method="post" accept-charset="', $context['character_set'], '">
528 <div class="cat_bar">
529 <h3 class="catbg">
530 ', sprintf($txt['mc_viewmodreport'], $context['report']['message_link'], $context['report']['author']['link']), '
531 </h3>
532 </div>
533 <div class="title_bar">
534 <h3 class="titlebg">
535 <span class="floatleft">
536 ', sprintf($txt['mc_modreport_summary'], $context['report']['num_reports'], $context['report']['last_updated']), '
537 </span>
538 <span class="floatright">';
539
540 // Make the buttons.
541 $close_button = create_button('close.gif', $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', 'align="middle"');
542 $ignore_button = create_button('ignore.gif', 'mc_reportedp_ignore', 'mc_reportedp_ignore', 'align="middle"');
543 $unignore_button = create_button('ignore.gif', 'mc_reportedp_unignore', 'mc_reportedp_unignore', 'align="middle"');
544
545 echo '
546 <a href="', $scripturl, '?action=moderate;area=reports;ignore=', (int) !$context['report']['ignore'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], '" ', !$context['report']['ignore'] ? 'onclick="return confirm(\'' . $txt['mc_reportedp_ignore_confirm'] . '\');"' : '', '>', $context['report']['ignore'] ? $unignore_button : $ignore_button, '</a>
547 <a href="', $scripturl, '?action=moderate;area=reports;close=', (int) !$context['report']['closed'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $close_button, '</a>
548 </span>
549 </h3>
550 </div>
551 <div class="windowbg2">
552 <span class="topslice"><span></span></span>
553 <div class="content">
554 ', $context['report']['body'], '
555 </div>
556 <span class="botslice"><span></span></span>
557 </div>
558 <br />
559 <div class="cat_bar">
560 <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3>
561 </div>';
562
563 foreach ($context['report']['comments'] as $comment)
564 echo '
565 <div class="windowbg">
566 <span class="topslice"><span></span></span>
567 <div class="content">
568 <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>
569 <p>', $comment['message'], '</p>
570 </div>
571 <span class="botslice"><span></span></span>
572 </div>';
573
574 echo '
575 <br />
576 <div class="cat_bar">
577 <h3 class="catbg">', $txt['mc_modreport_mod_comments'], '</h3>
578 </div>
579 <div class="windowbg2">
580 <span class="topslice"><span></span></span>
581 <div class="content">';
582
583 if (empty($context['report']['mod_comments']))
584 echo '
585 <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>';
586
587 foreach ($context['report']['mod_comments'] as $comment)
588 echo
589 '<p>', $comment['member']['link'], ': ', $comment['message'], ' <em class="smalltext">(', $comment['time'], ')</em></p>';
590
591 echo '
592 <textarea rows="2" cols="60" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 60%') . ';" name="mod_comment"></textarea>
593 <div>
594 <input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button_submit" />
595 </div>
596 </div>
597 <span class="botslice"><span></span></span>
598 </div>
599 <br />';
600
601 $alt = false;
602
603 template_show_list('moderation_actions_list');
604
605 if (!empty($context['entries']))
606 {
607 echo '
608 <div class="cat_bar">
609 <h3 class="catbg">', $txt['mc_modreport_modactions'], '</h3>
610 </div>
611 <table width="100%" class="table_grid">
612 <thead>
613 <tr class="catbg">
614 <th>', $txt['modlog_action'], '</th>
615 <th>', $txt['modlog_date'], '</th>
616 <th>', $txt['modlog_member'], '</th>
617 <th>', $txt['modlog_position'], '</th>
618 <th>', $txt['modlog_ip'], '</th>
619 </tr>
620 </thead>
621 <tbody>';
622
623 foreach ($context['entries'] as $entry)
624 {
625 echo '
626 <tr class="', $alt ? 'windowbg2' : 'windowbg', '">
627 <td>', $entry['action'], '</td>
628 <td>', $entry['time'], '</td>
629 <td>', $entry['moderator']['link'], '</td>
630 <td>', $entry['position'], '</td>
631 <td>', $entry['ip'], '</td>
632 </tr>
633 <tr>
634 <td colspan="5" class="', $alt ? 'windowbg2' : 'windowbg', '">';
635
636 foreach ($entry['extra'] as $key => $value)
637 echo '
638 <em>', $key, '</em>: ', $value;
639 echo '
640 </td>
641 </tr>';
642 }
643 echo '
644 </tbody>
645 </table>';
646 }
647
648 echo '
649 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
650 </form>
651 </div>
652 <br class="clear" />';
653 }
654
655 // Callback function for showing a watched users post in the table.
656 function template_user_watch_post_callback($post)
657 {
658 global $scripturl, $context, $txt, $delete_button;
659
660 // We'll have a delete please bob.
661 if (empty($delete_button))
662 $delete_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
663
664 $output_html = '
665 <div>
666 <div class="floatleft">
667 <strong><a href="' . $scripturl . '?topic=' . $post['id_topic'] . '.' . $post['id'] . '#msg' . $post['id'] . '">' . $post['subject'] . '</a></strong> ' . $txt['mc_reportedp_by'] . ' <strong>' . $post['author_link'] . '</strong>
668 </div>
669 <div class="floatright">';
670
671 if ($post['can_delete'])
672 $output_html .= '
673 <a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mc_watched_users_delete_post'] . '\');">' . $delete_button . '</a>
674 <input type="checkbox" name="delete[]" value="' . $post['id'] . '" class="input_check" />';
675
676 $output_html .= '
677 </div>
678 </div><br />
679 <div class="smalltext">
680 &#171; ' . $txt['mc_watched_users_posted'] . ': ' . $post['poster_time'] . ' &#187;
681 </div>
682 <hr />
683 ' . $post['body'];
684
685 return $output_html;
686 }
687
688 // Moderation settings
689 function template_moderation_settings()
690 {
691 global $settings, $options, $context, $txt, $scripturl;
692
693 echo '
694 <div id="modcenter">
695 <form action="', $scripturl, '?action=moderate;area=settings" method="post" accept-charset="', $context['character_set'], '">
696 <div class="cat_bar">
697 <h3 class="catbg">', $txt['mc_prefs_title'], '</h3>
698 </div>
699 <div class="information">
700 ', $txt['mc_prefs_desc'], '
701 </div>
702 <div class="windowbg2">
703 <span class="topslice"><span></span></span>
704 <div class="content">
705 <dl class="settings">
706 <dt>
707 <strong>', $txt['mc_prefs_homepage'], ':</strong>
708 </dt>
709 <dd>';
710
711 foreach ($context['homepage_blocks'] as $k => $v)
712 echo '
713 <label for="mod_homepage_', $k, '"><input type="checkbox" id="mod_homepage_', $k, '" name="mod_homepage[', $k, ']"', in_array($k, $context['mod_settings']['user_blocks']) ? ' checked="checked"' : '', ' class="input_check" /> ', $v, '</label><br />';
714
715 echo '
716 </dd>';
717
718 // If they can moderate boards they have more options!
719 if ($context['can_moderate_boards'])
720 {
721 echo '
722 <dt>
723 <strong><label for="mod_show_reports">', $txt['mc_prefs_show_reports'], '</label>:</strong>
724 </dt>
725 <dd>
726 <input type="checkbox" id="mod_show_reports" name="mod_show_reports" ', $context['mod_settings']['show_reports'] ? 'checked="checked"' : '', ' class="input_check" />
727 </dd>
728 <dt>
729 <strong><label for="mod_notify_report">', $txt['mc_prefs_notify_report'], '</label>:</strong>
730 </dt>
731 <dd>
732 <select id="mod_notify_report" name="mod_notify_report">
733 <option value="0" ', $context['mod_settings']['notify_report'] == 0 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_never'], '</option>
734 <option value="1" ', $context['mod_settings']['notify_report'] == 1 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_moderator'], '</option>
735 <option value="2" ', $context['mod_settings']['notify_report'] == 2 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_always'], '</option>
736 </select>
737 </dd>';
738
739 }
740
741 if ($context['can_moderate_approvals'])
742 {
743 echo '
744
745 <dt>
746 <strong><label for="mod_notify_approval">', $txt['mc_prefs_notify_approval'], '</label>:</strong>
747 </dt>
748 <dd>
749 <input type="checkbox" id="mod_notify_approval" name="mod_notify_approval" ', $context['mod_settings']['notify_approval'] ? 'checked="checked"' : '', ' class="input_check" />
750 </dd>';
751 }
752
753 echo '
754 </dl>
755 <div class="righttext">
756 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
757 <input type="submit" name="save" value="', $txt['save'], '" class="button_submit" />
758 </div>
759 </div>
760 <span class="botslice"><span></span></span>
761 </div>
762 </form>
763 </div>
764 <br class="clear" />';
765 }
766
767 // Show a notice sent to a user.
768 function template_show_notice()
769 {
770 global $txt, $settings, $options, $context;
771
772 // We do all the HTML for this one!
773 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
774 <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
775 <head>
776 <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
777 <title>', $context['page_title'], '</title>
778 <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
779 </head>
780 <body>
781 <div class="cat_bar">
782 <h3 class="catbg">', $txt['show_notice'], '</h3>
783 </div>
784 <div class="title_bar">
785 <h3 class="titlebg">', $txt['show_notice_subject'], ': ', $context['notice_subject'], '</h3>
786 </div>
787 <div class="windowbg">
788 <span class="topslice"><span></span></span>
789 <div class="content">
790 <dl>
791 <dt>
792 <strong>', $txt['show_notice_text'], ':</strong>
793 </dt>
794 <dd>
795 ', $context['notice_body'], '
796 </dd>
797 </dl>
798 </div>
799 <span class="botslice"><span></span></span>
800 </div>
801 </body>
802 </html>';
803
804 }
805
806 // Add or edit a warning template.
807 function template_warn_template()
808 {
809 global $context, $settings, $options, $txt, $scripturl;
810
811 echo '
812 <div id="modcenter">
813 <form action="', $scripturl, '?action=moderate;area=warnings;sa=templateedit;tid=', $context['id_template'], '" method="post" accept-charset="', $context['character_set'], '">
814 <div class="cat_bar">
815 <h3 class="catbg">', $context['page_title'], '</h3>
816 </div>
817 <div class="information">
818 ', $txt['mc_warning_template_desc'], '
819 </div>
820 <div class="windowbg">
821 <span class="topslice"><span></span></span>
822 <div class="content">
823 <dl class="settings">
824 <dt>
825 <strong><label for="template_title">', $txt['mc_warning_template_title'], '</label>:</strong>
826 </dt>
827 <dd>
828 <input type="text" id="template_title" name="template_title" value="', $context['template_data']['title'], '" size="30" class="input_text" />
829 </dd>
830 <dt>
831 <strong><label for="template_body">', $txt['profile_warning_notify_body'], '</label>:</strong><br />
832 <span class="smalltext">', $txt['mc_warning_template_body_desc'], '</span>
833 </dt>
834 <dd>
835 <textarea id="template_body" name="template_body" rows="10" cols="45" class="smalltext">', $context['template_data']['body'], '</textarea>
836 </dd>
837 </dl>';
838
839 if ($context['template_data']['can_edit_personal'])
840 echo '
841 <input type="checkbox" name="make_personal" id="make_personal" ', $context['template_data']['personal'] ? 'checked="checked"' : '', ' class="input_check" />
842 <label for="make_personal">
843 <strong>', $txt['mc_warning_template_personal'], '</strong>
844 </label>
845 <br />
846 <span class="smalltext">', $txt['mc_warning_template_personal_desc'], '</span>
847 <br />';
848
849 echo '
850 <input type="submit" name="save" value="', $context['page_title'], '" class="button_submit" />
851 </div>
852 <span class="botslice"><span></span></span>
853 </div>
854 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
855 </form>
856 </div>
857 <br class="clear" />';
858 }
859
860 ?>