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