@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | // Stick our "create a redirection topic" template in here... |
64 | 64 | template_redirect_options('move'); |
65 | 65 | |
66 | - echo ' |
|
66 | + echo ' |
|
67 | 67 | <input type="submit" value="', $txt['move_topic'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit"> |
68 | 68 | </div> |
69 | 69 | </div>'; |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | */ |
87 | 87 | function template_redirect_options($type) |
88 | 88 | { |
89 | - global $txt, $context, $modSettings; |
|
89 | + global $txt, $context, $modSettings; |
|
90 | 90 | |
91 | - echo ' |
|
91 | + echo ' |
|
92 | 92 | <label for="postRedirect"><input type="checkbox" name="postRedirect" id="postRedirect"', $context['is_approved'] ? ' checked' : '', ' onclick="', $context['is_approved'] ? '' : 'if (this.checked && !confirm(\'' . $txt[$type . '_topic_unapproved_js'] . '\')) return false; ', 'document.getElementById(\'reasonArea\').style.display = this.checked ? \'block\' : \'none\';"> ', $txt['post_redirection'], '.</label> |
93 | 93 | <fieldset id="reasonArea" style="margin-top: 1ex;', $context['is_approved'] ? '' : 'display: none;', '"> |
94 | 94 | <dl class="settings"> |
@@ -37,9 +37,10 @@ discard block |
||
37 | 37 | echo ' |
38 | 38 | <optgroup label="', $category['name'], '">'; |
39 | 39 | |
40 | - foreach ($category['boards'] as $board) |
|
41 | - echo ' |
|
40 | + foreach ($category['boards'] as $board) { |
|
41 | + echo ' |
|
42 | 42 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', $board['id'] == $context['current_board'] ? ' disabled' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level']-1) . '=> ' : '', $board['name'], '</option>'; |
43 | + } |
|
43 | 44 | echo ' |
44 | 45 | </optgroup>'; |
45 | 46 | } |
@@ -68,9 +69,10 @@ discard block |
||
68 | 69 | </div> |
69 | 70 | </div>'; |
70 | 71 | |
71 | - if ($context['back_to_topic']) |
|
72 | - echo ' |
|
72 | + if ($context['back_to_topic']) { |
|
73 | + echo ' |
|
73 | 74 | <input type="hidden" name="goback" value="1">'; |
75 | + } |
|
74 | 76 | |
75 | 77 | echo ' |
76 | 78 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -120,8 +122,7 @@ discard block |
||
120 | 122 | <option value="86400">', $txt['two_months'], '</option> |
121 | 123 | </select> |
122 | 124 | </dd>'; |
123 | - } |
|
124 | - else |
|
125 | + } else |
|
125 | 126 | { |
126 | 127 | echo ' |
127 | 128 | <input type="hidden" name="redirect_expires" value="0">'; |
@@ -217,9 +218,9 @@ discard block |
||
217 | 218 | <input type="submit" value="', $txt['go'], '" class="button_submit"> |
218 | 219 | </form>'; |
219 | 220 | |
221 | + } else { |
|
222 | + echo $txt['target_below']; |
|
220 | 223 | } |
221 | - else |
|
222 | - echo $txt['target_below']; |
|
223 | 224 | |
224 | 225 | echo ' </h4> |
225 | 226 | </div>'; |
@@ -237,12 +238,13 @@ discard block |
||
237 | 238 | |
238 | 239 | $merge_button = create_button('merge', 'merge', ''); |
239 | 240 | |
240 | - foreach ($context['topics'] as $topic) |
|
241 | - echo ' |
|
241 | + foreach ($context['topics'] as $topic) { |
|
242 | + echo ' |
|
242 | 243 | <li> |
243 | 244 | <a href="', $scripturl, '?action=mergetopics;sa=options;board=', $context['current_board'], '.0;from=', $context['origin_topic'], ';to=', $topic['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $merge_button, '</a> |
244 | 245 | <a href="', $scripturl, '?topic=', $topic['id'], '.0" target="_blank" class="new_win">', $topic['subject'], '</a> ', $txt['started_by'], ' ', $topic['poster']['link'], ' |
245 | 246 | </li>'; |
247 | + } |
|
246 | 248 | |
247 | 249 | echo ' |
248 | 250 | </ul> |
@@ -251,8 +253,7 @@ discard block |
||
251 | 253 | <div class="pagesection"> |
252 | 254 | ', $context['page_index'], ' |
253 | 255 | </div>'; |
254 | - } |
|
255 | - else |
|
256 | + } else |
|
256 | 257 | { |
257 | 258 | // Just a nice "There aren't any topics" message |
258 | 259 | echo ' |
@@ -306,8 +307,8 @@ discard block |
||
306 | 307 | </tr> |
307 | 308 | </thead> |
308 | 309 | <tbody>'; |
309 | - foreach ($context['topics'] as $topic) |
|
310 | - echo ' |
|
310 | + foreach ($context['topics'] as $topic) { |
|
311 | + echo ' |
|
311 | 312 | <tr class="windowbg"> |
312 | 313 | <td> |
313 | 314 | <input type="checkbox" name="topics[]" value="' . $topic['id'] . '" checked> |
@@ -327,6 +328,7 @@ discard block |
||
327 | 328 | <input type="checkbox" name="notifications[]" value="' . $topic['id'] . '" checked> |
328 | 329 | </td> |
329 | 330 | </tr>'; |
331 | + } |
|
330 | 332 | echo ' |
331 | 333 | </tbody> |
332 | 334 | </table> |
@@ -337,9 +339,10 @@ discard block |
||
337 | 339 | <fieldset id="merge_subject" class="merge_options"> |
338 | 340 | <legend>', $txt['merge_select_subject'], '</legend> |
339 | 341 | <select name="subject" onchange="this.form.custom_subject.style.display = (this.options[this.selectedIndex].value != 0) ? \'none\': \'\' ;">'; |
340 | - foreach ($context['topics'] as $topic) |
|
341 | - echo ' |
|
342 | + foreach ($context['topics'] as $topic) { |
|
343 | + echo ' |
|
342 | 344 | <option value="', $topic['id'], '"' . ($topic['selected'] ? ' selected' : '') . '>', $topic['subject'], '</option>'; |
345 | + } |
|
343 | 346 | echo ' |
344 | 347 | <option value="0">', $txt['merge_custom_subject'], ':</option> |
345 | 348 | </select> |
@@ -357,11 +360,12 @@ discard block |
||
357 | 360 | <fieldset id="merge_board" class="merge_options"> |
358 | 361 | <legend>', $txt['merge_select_target_board'], '</legend> |
359 | 362 | <ul>'; |
360 | - foreach ($context['boards'] as $board) |
|
361 | - echo ' |
|
363 | + foreach ($context['boards'] as $board) { |
|
364 | + echo ' |
|
362 | 365 | <li> |
363 | 366 | <input type="radio" name="board" value="' . $board['id'] . '"' . ($board['selected'] ? ' checked' : '') . '> ' . $board['name'] . ' |
364 | 367 | </li>'; |
368 | + } |
|
365 | 369 | echo ' |
366 | 370 | </ul> |
367 | 371 | </fieldset>'; |
@@ -372,11 +376,12 @@ discard block |
||
372 | 376 | <fieldset id="merge_poll" class="merge_options"> |
373 | 377 | <legend>' . $txt['merge_select_poll'] . '</legend> |
374 | 378 | <ul>'; |
375 | - foreach ($context['polls'] as $poll) |
|
376 | - echo ' |
|
379 | + foreach ($context['polls'] as $poll) { |
|
380 | + echo ' |
|
377 | 381 | <li> |
378 | 382 | <input type="radio" name="poll" value="' . $poll['id'] . '"' . ($poll['selected'] ? ' checked' : '') . '> ' . $poll['question'] . ' (' . $txt['topic'] . ': <a href="' . $scripturl . '?topic=' . $poll['topic']['id'] . '.0" target="_blank" class="new_win">' . $poll['topic']['subject'] . '</a>) |
379 | 383 | </li>'; |
384 | + } |
|
380 | 385 | echo ' |
381 | 386 | <li> |
382 | 387 | <input type="radio" name="poll" value="-1"> (' . $txt['merge_no_poll'] . ') |
@@ -54,8 +54,9 @@ discard block |
||
54 | 54 | |
55 | 55 | // Prepare the comments... |
56 | 56 | $comments = array(); |
57 | - foreach ($report['comments'] as $comment) |
|
58 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
57 | + foreach ($report['comments'] as $comment) { |
|
58 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
59 | + } |
|
59 | 60 | |
60 | 61 | echo ' |
61 | 62 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -69,18 +70,21 @@ discard block |
||
69 | 70 | <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>'; |
70 | 71 | |
71 | 72 | // Delete message button. |
72 | - if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) |
|
73 | - echo ' |
|
73 | + if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) { |
|
74 | + echo ' |
|
74 | 75 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'], '.0;msg=', $report['topic']['id_msg'], ';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'], '" class="you_sure">', $delete_button, '</a></li>'; |
76 | + } |
|
75 | 77 | |
76 | 78 | // Ban this user button. |
77 | - if (!$report['closed'] && !empty($context['report_manage_bans'])) |
|
78 | - echo ' |
|
79 | + if (!$report['closed'] && !empty($context['report_manage_bans'])) { |
|
80 | + echo ' |
|
79 | 81 | <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>'; |
82 | + } |
|
80 | 83 | |
81 | - if (!$context['view_closed']) |
|
82 | - echo ' |
|
84 | + if (!$context['view_closed']) { |
|
85 | + echo ' |
|
83 | 86 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>'; |
87 | + } |
|
84 | 88 | |
85 | 89 | echo ' |
86 | 90 | </ul> |
@@ -88,11 +92,12 @@ discard block |
||
88 | 92 | } |
89 | 93 | |
90 | 94 | // Were none found? |
91 | - if (empty($context['reports'])) |
|
92 | - echo ' |
|
95 | + if (empty($context['reports'])) { |
|
96 | + echo ' |
|
93 | 97 | <div class="windowbg2"> |
94 | 98 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
95 | 99 | </div>'; |
100 | + } |
|
96 | 101 | |
97 | 102 | echo ' |
98 | 103 | <div class="pagesection"> |
@@ -125,18 +130,20 @@ discard block |
||
125 | 130 | <div class="modbox"> |
126 | 131 | <ul>'; |
127 | 132 | |
128 | - foreach ($context['reported_posts'] as $report) |
|
129 | - echo ' |
|
133 | + foreach ($context['reported_posts'] as $report) { |
|
134 | + echo ' |
|
130 | 135 | <li class="smalltext"> |
131 | 136 | <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], ' |
132 | 137 | </li>'; |
138 | + } |
|
133 | 139 | |
134 | 140 | // Don't have any watched users right now? |
135 | - if (empty($context['reported_posts'])) |
|
136 | - echo ' |
|
141 | + if (empty($context['reported_posts'])) { |
|
142 | + echo ' |
|
137 | 143 | <li> |
138 | 144 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
139 | 145 | </li>'; |
146 | + } |
|
140 | 147 | |
141 | 148 | echo ' |
142 | 149 | </ul> |
@@ -226,12 +233,13 @@ discard block |
||
226 | 233 | <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3> |
227 | 234 | </div>'; |
228 | 235 | |
229 | - foreach ($context['report']['comments'] as $comment) |
|
230 | - echo ' |
|
236 | + foreach ($context['report']['comments'] as $comment) { |
|
237 | + echo ' |
|
231 | 238 | <div class="windowbg"> |
232 | 239 | <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> |
233 | 240 | <p>', $comment['message'], '</p> |
234 | 241 | </div>'; |
242 | + } |
|
235 | 243 | |
236 | 244 | echo ' |
237 | 245 | <br> |
@@ -240,11 +248,12 @@ discard block |
||
240 | 248 | </div> |
241 | 249 | <div>'; |
242 | 250 | |
243 | - if (empty($context['report']['mod_comments'])) |
|
244 | - echo ' |
|
251 | + if (empty($context['report']['mod_comments'])) { |
|
252 | + echo ' |
|
245 | 253 | <div class="information"> |
246 | 254 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
247 | 255 | </div>'; |
256 | + } |
|
248 | 257 | |
249 | 258 | foreach ($context['report']['mod_comments'] as $comment) |
250 | 259 | { |
@@ -334,18 +343,20 @@ discard block |
||
334 | 343 | <div class="modbox"> |
335 | 344 | <ul>'; |
336 | 345 | |
337 | - foreach ($context['reported_members'] as $report) |
|
338 | - echo ' |
|
346 | + foreach ($context['reported_members'] as $report) { |
|
347 | + echo ' |
|
339 | 348 | <li class="smalltext"> |
340 | 349 | <a href="', $report['report_href'], '">', $report['user_name'], '</a> |
341 | 350 | </li>'; |
351 | + } |
|
342 | 352 | |
343 | 353 | // Don't have any reported members right now? |
344 | - if (empty($context['reported_members'])) |
|
345 | - echo ' |
|
354 | + if (empty($context['reported_members'])) { |
|
355 | + echo ' |
|
346 | 356 | <li> |
347 | 357 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
348 | 358 | </li>'; |
359 | + } |
|
349 | 360 | |
350 | 361 | echo ' |
351 | 362 | </ul> |
@@ -431,8 +442,9 @@ discard block |
||
431 | 442 | |
432 | 443 | // Prepare the comments... |
433 | 444 | $comments = array(); |
434 | - foreach ($report['comments'] as $comment) |
|
435 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
445 | + foreach ($report['comments'] as $comment) { |
|
446 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
447 | + } |
|
436 | 448 | |
437 | 449 | echo ' |
438 | 450 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -444,13 +456,15 @@ discard block |
||
444 | 456 | <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>'; |
445 | 457 | |
446 | 458 | // Ban this user button. |
447 | - if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) |
|
448 | - echo ' |
|
459 | + if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) { |
|
460 | + echo ' |
|
449 | 461 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
462 | + } |
|
450 | 463 | |
451 | - if (!$context['view_closed']) |
|
452 | - echo ' |
|
464 | + if (!$context['view_closed']) { |
|
465 | + echo ' |
|
453 | 466 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>'; |
467 | + } |
|
454 | 468 | |
455 | 469 | echo ' |
456 | 470 | </ul> |
@@ -458,11 +472,12 @@ discard block |
||
458 | 472 | } |
459 | 473 | |
460 | 474 | // Were none found? |
461 | - if (empty($context['reports'])) |
|
462 | - echo ' |
|
475 | + if (empty($context['reports'])) { |
|
476 | + echo ' |
|
463 | 477 | <div class="windowbg2"> |
464 | 478 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
465 | 479 | </div>'; |
480 | + } |
|
466 | 481 | |
467 | 482 | echo ' |
468 | 483 | <div class="pagesection"> |
@@ -522,12 +537,13 @@ discard block |
||
522 | 537 | <h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3> |
523 | 538 | </div>'; |
524 | 539 | |
525 | - foreach ($context['report']['comments'] as $comment) |
|
526 | - echo ' |
|
540 | + foreach ($context['report']['comments'] as $comment) { |
|
541 | + echo ' |
|
527 | 542 | <div class="windowbg"> |
528 | 543 | <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> |
529 | 544 | <p>', $comment['message'], '</p> |
530 | 545 | </div>'; |
546 | + } |
|
531 | 547 | |
532 | 548 | echo ' |
533 | 549 | <br> |
@@ -536,11 +552,12 @@ discard block |
||
536 | 552 | </div> |
537 | 553 | <div>'; |
538 | 554 | |
539 | - if (empty($context['report']['mod_comments'])) |
|
540 | - echo ' |
|
555 | + if (empty($context['report']['mod_comments'])) { |
|
556 | + echo ' |
|
541 | 557 | <div class="information"> |
542 | 558 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
543 | 559 | </div>'; |
560 | + } |
|
544 | 561 | |
545 | 562 | foreach ($context['report']['mod_comments'] as $comment) |
546 | 563 | { |
@@ -48,17 +48,19 @@ discard block |
||
48 | 48 | </a>'; |
49 | 49 | |
50 | 50 | // Has it outstanding posts for approval? |
51 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
52 | - echo ' |
|
51 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
52 | + echo ' |
|
53 | 53 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>'; |
54 | + } |
|
54 | 55 | |
55 | 56 | echo ' |
56 | 57 | <p class="board_description">', $board['description'], '</p>'; |
57 | 58 | |
58 | 59 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
59 | - if (!empty($board['moderators']) || !empty($board['moderator_groups'])) |
|
60 | - echo ' |
|
60 | + if (!empty($board['moderators']) || !empty($board['moderator_groups'])) { |
|
61 | + echo ' |
|
61 | 62 | <p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
63 | + } |
|
62 | 64 | |
63 | 65 | // Show some basic information about the number of posts, etc. |
64 | 66 | echo ' |
@@ -70,9 +72,10 @@ discard block |
||
70 | 72 | </div> |
71 | 73 | <div class="lastpost lpr_border">'; |
72 | 74 | |
73 | - if (!empty($board['last_post']['id'])) |
|
74 | - echo ' |
|
75 | + if (!empty($board['last_post']['id'])) { |
|
76 | + echo ' |
|
75 | 77 | <p>', $board['last_post']['last_post_message'], '</p>'; |
78 | + } |
|
76 | 79 | echo ' |
77 | 80 | </div>'; |
78 | 81 | |
@@ -85,14 +88,16 @@ discard block |
||
85 | 88 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
86 | 89 | foreach ($board['children'] as $child) |
87 | 90 | { |
88 | - if (!$child['is_redirect']) |
|
89 | - $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
90 | - else |
|
91 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
91 | + if (!$child['is_redirect']) { |
|
92 | + $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
93 | + } else { |
|
94 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
95 | + } |
|
92 | 96 | |
93 | 97 | // Has it posts awaiting approval? |
94 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) |
|
95 | - $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
98 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) { |
|
99 | + $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
100 | + } |
|
96 | 101 | |
97 | 102 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
98 | 103 | } |
@@ -111,8 +116,9 @@ discard block |
||
111 | 116 | } |
112 | 117 | |
113 | 118 | // They can only mark read if they are logged in and it's enabled! |
114 | - if (!$context['user']['is_logged']) |
|
115 | - unset($context['normal_buttons']['markread']); |
|
119 | + if (!$context['user']['is_logged']) { |
|
120 | + unset($context['normal_buttons']['markread']); |
|
121 | + } |
|
116 | 122 | |
117 | 123 | if (!$context['no_topic_listing']) |
118 | 124 | { |
@@ -135,13 +141,15 @@ discard block |
||
135 | 141 | <div id="description_board" class="generic_list_wrapper"> |
136 | 142 | <h3>', $context['name'], '</h3> |
137 | 143 | <p>'; |
138 | - if ($context['description'] != '') |
|
139 | - echo ' |
|
144 | + if ($context['description'] != '') { |
|
145 | + echo ' |
|
140 | 146 | ', $context['description'], ' '; |
147 | + } |
|
141 | 148 | |
142 | - if (!empty($context['moderators'])) |
|
143 | - echo ' |
|
149 | + if (!empty($context['moderators'])) { |
|
150 | + echo ' |
|
144 | 151 | ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.'; |
152 | + } |
|
145 | 153 | |
146 | 154 | echo ' |
147 | 155 | </p> |
@@ -149,9 +157,10 @@ discard block |
||
149 | 157 | } |
150 | 158 | |
151 | 159 | // If Quick Moderation is enabled start the form. |
152 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
153 | - echo ' |
|
160 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
161 | + echo ' |
|
154 | 162 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
163 | + } |
|
155 | 164 | |
156 | 165 | echo ' |
157 | 166 | <div id="messageindex">'; |
@@ -159,10 +168,11 @@ discard block |
||
159 | 168 | { |
160 | 169 | echo ' |
161 | 170 | <div class="information">'; |
162 | - if ($settings['display_who_viewing'] == 1) |
|
163 | - echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
164 | - else |
|
165 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
171 | + if ($settings['display_who_viewing'] == 1) { |
|
172 | + echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
173 | + } else { |
|
174 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
175 | + } |
|
166 | 176 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board']; |
167 | 177 | |
168 | 178 | echo ' |
@@ -181,19 +191,22 @@ discard block |
||
181 | 191 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
182 | 192 | |
183 | 193 | // Show a "select all" box for quick moderation? |
184 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
|
185 | - echo ' |
|
194 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
195 | + echo ' |
|
186 | 196 | <div class="moderation"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"></div>'; |
197 | + } |
|
187 | 198 | |
188 | 199 | // If it's on in "image" mode, don't show anything but the column. |
189 | - elseif (!empty($context['can_quick_mod'])) |
|
190 | - echo ' |
|
200 | + elseif (!empty($context['can_quick_mod'])) { |
|
201 | + echo ' |
|
191 | 202 | <div class="moderation"> </div>'; |
203 | + } |
|
192 | 204 | } |
193 | 205 | // No topics.... just say, "sorry bub". |
194 | - else |
|
195 | - echo ' |
|
206 | + else { |
|
207 | + echo ' |
|
196 | 208 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
209 | + } |
|
197 | 210 | |
198 | 211 | echo ' |
199 | 212 | </div>'; |
@@ -225,21 +238,26 @@ discard block |
||
225 | 238 | // Now we handle the icons |
226 | 239 | echo ' |
227 | 240 | <div class="icons floatright">'; |
228 | - if ($topic['is_watched']) |
|
229 | - echo ' |
|
241 | + if ($topic['is_watched']) { |
|
242 | + echo ' |
|
230 | 243 | <span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
231 | - if ($topic['is_locked']) |
|
232 | - echo ' |
|
244 | + } |
|
245 | + if ($topic['is_locked']) { |
|
246 | + echo ' |
|
233 | 247 | <span class="generic_icons lock"></span>'; |
234 | - if ($topic['is_sticky']) |
|
235 | - echo ' |
|
248 | + } |
|
249 | + if ($topic['is_sticky']) { |
|
250 | + echo ' |
|
236 | 251 | <span class="generic_icons sticky"></span>'; |
237 | - if ($topic['is_redirect']) |
|
238 | - echo ' |
|
252 | + } |
|
253 | + if ($topic['is_redirect']) { |
|
254 | + echo ' |
|
239 | 255 | <span class="generic_icons move"></span>'; |
240 | - if ($topic['is_poll']) |
|
241 | - echo ' |
|
256 | + } |
|
257 | + if ($topic['is_poll']) { |
|
258 | + echo ' |
|
242 | 259 | <span class="generic_icons poll"></span>'; |
260 | + } |
|
243 | 261 | echo ' |
244 | 262 | </div>'; |
245 | 263 | |
@@ -265,26 +283,31 @@ discard block |
||
265 | 283 | { |
266 | 284 | echo ' |
267 | 285 | <div class="moderation">'; |
268 | - if ($options['display_quick_mod'] == 1) |
|
269 | - echo ' |
|
286 | + if ($options['display_quick_mod'] == 1) { |
|
287 | + echo ' |
|
270 | 288 | <input type="checkbox" name="topics[]" value="', $topic['id'], '">'; |
271 | - else |
|
289 | + } else |
|
272 | 290 | { |
273 | 291 | // Check permissions on each and show only the ones they are allowed to use. |
274 | - if ($topic['quick_mod']['remove']) |
|
275 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
|
292 | + if ($topic['quick_mod']['remove']) { |
|
293 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
|
294 | + } |
|
276 | 295 | |
277 | - if ($topic['quick_mod']['lock']) |
|
278 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
|
296 | + if ($topic['quick_mod']['lock']) { |
|
297 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
|
298 | + } |
|
279 | 299 | |
280 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
281 | - echo '<br>'; |
|
300 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
301 | + echo '<br>'; |
|
302 | + } |
|
282 | 303 | |
283 | - if ($topic['quick_mod']['sticky']) |
|
284 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
|
304 | + if ($topic['quick_mod']['sticky']) { |
|
305 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
|
306 | + } |
|
285 | 307 | |
286 | - if ($topic['quick_mod']['move']) |
|
287 | - echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
308 | + if ($topic['quick_mod']['move']) { |
|
309 | + echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
310 | + } |
|
288 | 311 | } |
289 | 312 | echo ' |
290 | 313 | </div>'; |
@@ -302,18 +325,20 @@ discard block |
||
302 | 325 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
303 | 326 | <option value="">--------</option>'; |
304 | 327 | |
305 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
306 | - if ($context['can_' . $qmod_action]) |
|
328 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
329 | + if ($context['can_' . $qmod_action]) |
|
307 | 330 | echo ' |
308 | 331 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
332 | + } |
|
309 | 333 | |
310 | 334 | echo ' |
311 | 335 | </select>'; |
312 | 336 | |
313 | 337 | // Show a list of boards they can move the topic to. |
314 | - if ($context['can_move']) |
|
315 | - echo ' |
|
338 | + if ($context['can_move']) { |
|
339 | + echo ' |
|
316 | 340 | <span id="quick_mod_jump_to"> </span>'; |
341 | + } |
|
317 | 342 | |
318 | 343 | echo ' |
319 | 344 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction"> |
@@ -324,10 +349,11 @@ discard block |
||
324 | 349 | </div>'; |
325 | 350 | |
326 | 351 | // Finish off the form - again. |
327 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
328 | - echo ' |
|
352 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
353 | + echo ' |
|
329 | 354 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
330 | 355 | </form>'; |
356 | + } |
|
331 | 357 | |
332 | 358 | // Mobile action buttons (bottom) |
333 | 359 | echo ' |
@@ -346,8 +372,8 @@ discard block |
||
346 | 372 | // Show breadcrumbs at the bottom too. |
347 | 373 | theme_linktree(); |
348 | 374 | |
349 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
350 | - echo ' |
|
375 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
376 | + echo ' |
|
351 | 377 | <script> |
352 | 378 | if (typeof(window.XMLHttpRequest) != "undefined") |
353 | 379 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -366,6 +392,7 @@ discard block |
||
366 | 392 | sCustomName: "move_to" |
367 | 393 | }); |
368 | 394 | </script>'; |
395 | + } |
|
369 | 396 | |
370 | 397 | // Javascript for inline editing. |
371 | 398 | echo ' |
@@ -401,8 +428,8 @@ discard block |
||
401 | 428 | <div class="information"> |
402 | 429 | <p class="floatright" id="message_index_jump_to"> </p>'; |
403 | 430 | |
404 | - if (empty($context['no_topic_listing'])) |
|
405 | - echo ' |
|
431 | + if (empty($context['no_topic_listing'])) { |
|
432 | + echo ' |
|
406 | 433 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
407 | 434 | <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', ' |
408 | 435 | '. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br> |
@@ -412,9 +439,10 @@ discard block |
||
412 | 439 | <span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br> |
413 | 440 | <span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br> |
414 | 441 | </p>'; |
442 | + } |
|
415 | 443 | |
416 | - if (!empty($context['jump_to'])) |
|
417 | - echo ' |
|
444 | + if (!empty($context['jump_to'])) { |
|
445 | + echo ' |
|
418 | 446 | <script> |
419 | 447 | if (typeof(window.XMLHttpRequest) != "undefined") |
420 | 448 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -430,6 +458,7 @@ discard block |
||
430 | 458 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
431 | 459 | }); |
432 | 460 | </script>'; |
461 | + } |
|
433 | 462 | |
434 | 463 | echo ' |
435 | 464 | <br class="clear"> |
@@ -43,28 +43,33 @@ discard block |
||
43 | 43 | </div> |
44 | 44 | <div class="list_posts">', $post['message'], '</div>'; |
45 | 45 | |
46 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
47 | - echo ' |
|
46 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
47 | + echo ' |
|
48 | 48 | <ul class="quickbuttons">'; |
49 | + } |
|
49 | 50 | |
50 | 51 | // If they *can* reply? |
51 | - if ($post['can_reply']) |
|
52 | - echo ' |
|
52 | + if ($post['can_reply']) { |
|
53 | + echo ' |
|
53 | 54 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
55 | + } |
|
54 | 56 | |
55 | 57 | // If they *can* quote? |
56 | - if ($post['can_quote']) |
|
57 | - echo ' |
|
58 | + if ($post['can_quote']) { |
|
59 | + echo ' |
|
58 | 60 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
61 | + } |
|
59 | 62 | |
60 | 63 | // How about... even... remove it entirely?! |
61 | - if ($post['can_delete']) |
|
62 | - echo ' |
|
64 | + if ($post['can_delete']) { |
|
65 | + echo ' |
|
63 | 66 | <li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
67 | + } |
|
64 | 68 | |
65 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
66 | - echo ' |
|
69 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
70 | + echo ' |
|
67 | 71 | </ul>'; |
72 | + } |
|
68 | 73 | |
69 | 74 | echo ' |
70 | 75 | </div>'; |
@@ -86,12 +91,13 @@ discard block |
||
86 | 91 | echo ' |
87 | 92 | <div id="recent" class="main_content">'; |
88 | 93 | |
89 | - if ($context['showCheckboxes']) |
|
90 | - echo ' |
|
94 | + if ($context['showCheckboxes']) { |
|
95 | + echo ' |
|
91 | 96 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;"> |
92 | 97 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
93 | 98 | <input type="hidden" name="qaction" value="markread"> |
94 | 99 | <input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
100 | + } |
|
95 | 101 | |
96 | 102 | if (!empty($context['topics'])) |
97 | 103 | { |
@@ -117,11 +123,12 @@ discard block |
||
117 | 123 | </div>'; |
118 | 124 | |
119 | 125 | // Show a "select all" box for quick moderation? |
120 | - if ($context['showCheckboxes']) |
|
121 | - echo ' |
|
126 | + if ($context['showCheckboxes']) { |
|
127 | + echo ' |
|
122 | 128 | <div class="moderation"> |
123 | 129 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
124 | 130 | </div>'; |
131 | + } |
|
125 | 132 | |
126 | 133 | echo ' |
127 | 134 | </div> |
@@ -140,15 +147,18 @@ discard block |
||
140 | 147 | // Now we handle the icons |
141 | 148 | echo ' |
142 | 149 | <div class="icons floatright">'; |
143 | - if ($topic['is_locked']) |
|
144 | - echo ' |
|
150 | + if ($topic['is_locked']) { |
|
151 | + echo ' |
|
145 | 152 | <span class="generic_icons lock"></span>'; |
146 | - if ($topic['is_sticky']) |
|
147 | - echo ' |
|
153 | + } |
|
154 | + if ($topic['is_sticky']) { |
|
155 | + echo ' |
|
148 | 156 | <span class="generic_icons sticky"></span>'; |
149 | - if ($topic['is_poll']) |
|
150 | - echo ' |
|
157 | + } |
|
158 | + if ($topic['is_poll']) { |
|
159 | + echo ' |
|
151 | 160 | <span class="generic_icons poll"></span>'; |
161 | + } |
|
152 | 162 | echo ' |
153 | 163 | </div>'; |
154 | 164 | |
@@ -173,19 +183,21 @@ discard block |
||
173 | 183 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
174 | 184 | </div>'; |
175 | 185 | |
176 | - if ($context['showCheckboxes']) |
|
177 | - echo ' |
|
186 | + if ($context['showCheckboxes']) { |
|
187 | + echo ' |
|
178 | 188 | <div class="moderation"> |
179 | 189 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
180 | 190 | </div>'; |
191 | + } |
|
181 | 192 | |
182 | 193 | echo ' |
183 | 194 | </div>'; |
184 | 195 | } |
185 | 196 | |
186 | - if (empty($context['topics'])) |
|
187 | - echo ' |
|
197 | + if (empty($context['topics'])) { |
|
198 | + echo ' |
|
188 | 199 | <div style="display: none;"></div>'; |
200 | + } |
|
189 | 201 | |
190 | 202 | echo ' |
191 | 203 | </div> |
@@ -197,25 +209,27 @@ discard block |
||
197 | 209 | ', $context['menu_separator'], '<a href="#recent" class="topbottom floatleft">', $txt['go_up'], '</a> |
198 | 210 | <div class="pagelinks">', $context['page_index'], '</div> |
199 | 211 | </div>'; |
200 | - } |
|
201 | - else |
|
202 | - echo ' |
|
212 | + } else { |
|
213 | + echo ' |
|
203 | 214 | <div class="cat_bar"> |
204 | 215 | <h3 class="catbg centertext"> |
205 | 216 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
206 | 217 | </h3> |
207 | 218 | </div>'; |
219 | + } |
|
208 | 220 | |
209 | - if ($context['showCheckboxes']) |
|
210 | - echo ' |
|
221 | + if ($context['showCheckboxes']) { |
|
222 | + echo ' |
|
211 | 223 | </form>'; |
224 | + } |
|
212 | 225 | |
213 | 226 | echo ' |
214 | 227 | </div>'; |
215 | 228 | |
216 | - if (empty($context['no_topic_listing'])) |
|
217 | - template_topic_legend(); |
|
218 | -} |
|
229 | + if (empty($context['no_topic_listing'])) { |
|
230 | + template_topic_legend(); |
|
231 | + } |
|
232 | + } |
|
219 | 233 | |
220 | 234 | /** |
221 | 235 | * Template for showing unread replies (eg new replies to topics you've posted in) |
@@ -227,12 +241,13 @@ discard block |
||
227 | 241 | echo ' |
228 | 242 | <div id="recent">'; |
229 | 243 | |
230 | - if ($context['showCheckboxes']) |
|
231 | - echo ' |
|
244 | + if ($context['showCheckboxes']) { |
|
245 | + echo ' |
|
232 | 246 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;"> |
233 | 247 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
234 | 248 | <input type="hidden" name="qaction" value="markread"> |
235 | 249 | <input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
250 | + } |
|
236 | 251 | |
237 | 252 | if (!empty($context['topics'])) |
238 | 253 | { |
@@ -258,11 +273,12 @@ discard block |
||
258 | 273 | </div>'; |
259 | 274 | |
260 | 275 | // Show a "select all" box for quick moderation? |
261 | - if ($context['showCheckboxes']) |
|
262 | - echo ' |
|
276 | + if ($context['showCheckboxes']) { |
|
277 | + echo ' |
|
263 | 278 | <div class="moderation"> |
264 | 279 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
265 | 280 | </div>'; |
281 | + } |
|
266 | 282 | |
267 | 283 | echo ' |
268 | 284 | </div> |
@@ -281,15 +297,18 @@ discard block |
||
281 | 297 | // Now we handle the icons |
282 | 298 | echo ' |
283 | 299 | <div class="icons floatright">'; |
284 | - if ($topic['is_locked']) |
|
285 | - echo ' |
|
300 | + if ($topic['is_locked']) { |
|
301 | + echo ' |
|
286 | 302 | <span class="generic_icons lock"></span>'; |
287 | - if ($topic['is_sticky']) |
|
288 | - echo ' |
|
303 | + } |
|
304 | + if ($topic['is_sticky']) { |
|
305 | + echo ' |
|
289 | 306 | <span class="generic_icons sticky"></span>'; |
290 | - if ($topic['is_poll']) |
|
291 | - echo ' |
|
307 | + } |
|
308 | + if ($topic['is_poll']) { |
|
309 | + echo ' |
|
292 | 310 | <span class="generic_icons poll"></span>'; |
311 | + } |
|
293 | 312 | echo ' |
294 | 313 | </div>'; |
295 | 314 | |
@@ -314,11 +333,12 @@ discard block |
||
314 | 333 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
315 | 334 | </div>'; |
316 | 335 | |
317 | - if ($context['showCheckboxes']) |
|
318 | - echo ' |
|
336 | + if ($context['showCheckboxes']) { |
|
337 | + echo ' |
|
319 | 338 | <div class="moderation"> |
320 | 339 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
321 | 340 | </div>'; |
341 | + } |
|
322 | 342 | echo ' |
323 | 343 | </div>'; |
324 | 344 | } |
@@ -331,24 +351,26 @@ discard block |
||
331 | 351 | ', $context['menu_separator'], '<a href="#recent" class="topbottom floatleft">', $txt['go_up'], '</a> |
332 | 352 | <div class="pagelinks">', $context['page_index'], '</div> |
333 | 353 | </div>'; |
334 | - } |
|
335 | - else |
|
336 | - echo ' |
|
354 | + } else { |
|
355 | + echo ' |
|
337 | 356 | <div class="cat_bar"> |
338 | 357 | <h3 class="catbg centertext"> |
339 | 358 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
340 | 359 | </h3> |
341 | 360 | </div>'; |
361 | + } |
|
342 | 362 | |
343 | - if ($context['showCheckboxes']) |
|
344 | - echo ' |
|
363 | + if ($context['showCheckboxes']) { |
|
364 | + echo ' |
|
345 | 365 | </form>'; |
366 | + } |
|
346 | 367 | |
347 | 368 | echo ' |
348 | 369 | </div>'; |
349 | 370 | |
350 | - if (empty($context['no_topic_listing'])) |
|
351 | - template_topic_legend(); |
|
352 | -} |
|
371 | + if (empty($context['no_topic_listing'])) { |
|
372 | + template_topic_legend(); |
|
373 | + } |
|
374 | + } |
|
353 | 375 | |
354 | 376 | ?> |
355 | 377 | \ No newline at end of file |
@@ -63,18 +63,19 @@ discard block |
||
63 | 63 | </dt> |
64 | 64 | <dd> |
65 | 65 | ', $modSettings['smileys_url'], '/'; |
66 | - if ($context['current_set']['id'] == 'default') |
|
67 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
68 | - elseif (empty($context['smiley_set_dirs'])) |
|
69 | - echo ' |
|
66 | + if ($context['current_set']['id'] == 'default') { |
|
67 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
68 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
69 | + echo ' |
|
70 | 70 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> '; |
71 | - else |
|
71 | + } else |
|
72 | 72 | { |
73 | 73 | echo ' |
74 | 74 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
75 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
76 | - echo ' |
|
75 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
76 | + echo ' |
|
77 | 77 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
78 | + } |
|
78 | 79 | echo ' |
79 | 80 | </select> '; |
80 | 81 | } |
@@ -89,14 +90,15 @@ discard block |
||
89 | 90 | </dd>'; |
90 | 91 | |
91 | 92 | // If this is a new smiley set they have the option to import smileys already in the directory. |
92 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
93 | - echo ' |
|
93 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
94 | + echo ' |
|
94 | 95 | <dt> |
95 | 96 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
96 | 97 | </dt> |
97 | 98 | <dd> |
98 | 99 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1"> |
99 | 100 | </dd>'; |
101 | + } |
|
100 | 102 | |
101 | 103 | echo ' |
102 | 104 | </dl> |
@@ -130,9 +132,10 @@ discard block |
||
130 | 132 | <dd> |
131 | 133 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">'; |
132 | 134 | |
133 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
134 | - echo ' |
|
135 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
136 | + echo ' |
|
135 | 137 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
138 | + } |
|
136 | 139 | |
137 | 140 | echo ' |
138 | 141 | </select>) |
@@ -147,16 +150,17 @@ discard block |
||
147 | 150 | <strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong> |
148 | 151 | </dt> |
149 | 152 | <dd>'; |
150 | - if (empty($context['filenames'])) |
|
151 | - echo ' |
|
153 | + if (empty($context['filenames'])) { |
|
154 | + echo ' |
|
152 | 155 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">'; |
153 | - else |
|
156 | + } else |
|
154 | 157 | { |
155 | 158 | echo ' |
156 | 159 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
157 | - foreach ($context['filenames'] as $filename) |
|
158 | - echo ' |
|
160 | + foreach ($context['filenames'] as $filename) { |
|
161 | + echo ' |
|
159 | 162 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
163 | + } |
|
160 | 164 | echo ' |
161 | 165 | </select>'; |
162 | 166 | } |
@@ -225,9 +229,10 @@ discard block |
||
225 | 229 | <dd> |
226 | 230 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
227 | 231 | |
228 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
229 | - echo ' |
|
232 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
233 | + echo ' |
|
230 | 234 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
235 | + } |
|
231 | 236 | |
232 | 237 | echo ' |
233 | 238 | </select> |
@@ -236,16 +241,17 @@ discard block |
||
236 | 241 | <strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong> |
237 | 242 | </dt> |
238 | 243 | <dd>'; |
239 | - if (empty($context['filenames'])) |
|
240 | - echo ' |
|
244 | + if (empty($context['filenames'])) { |
|
245 | + echo ' |
|
241 | 246 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">'; |
242 | - else |
|
247 | + } else |
|
243 | 248 | { |
244 | 249 | echo ' |
245 | 250 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
246 | - foreach ($context['filenames'] as $filename) |
|
247 | - echo ' |
|
251 | + foreach ($context['filenames'] as $filename) { |
|
252 | + echo ' |
|
248 | 253 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
254 | + } |
|
249 | 255 | echo ' |
250 | 256 | </select>'; |
251 | 257 | } |
@@ -273,14 +279,15 @@ discard block |
||
273 | 279 | </fieldset> |
274 | 280 | |
275 | 281 | <dl id="uploadMore" style="display: none;" class="settings">'; |
276 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
277 | - echo ' |
|
282 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
283 | + echo ' |
|
278 | 284 | <dt> |
279 | 285 | ', $txt['smileys_add_upload_for1'], ' <strong>', $smiley_set['name'], '</strong> ', $txt['smileys_add_upload_for2'], ': |
280 | 286 | </dt> |
281 | 287 | <dd> |
282 | 288 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');"> |
283 | 289 | </dd>'; |
290 | + } |
|
284 | 291 | echo ' |
285 | 292 | </dl> |
286 | 293 | </div> |
@@ -349,24 +356,27 @@ discard block |
||
349 | 356 | <strong>', empty($context['move_smiley']) ? $txt['smileys_move_select_smiley'] : $txt['smileys_move_select_destination'], '...</strong><br>'; |
350 | 357 | foreach ($location['rows'] as $row) |
351 | 358 | { |
352 | - if (!empty($context['move_smiley'])) |
|
353 | - echo ' |
|
359 | + if (!empty($context['move_smiley'])) { |
|
360 | + echo ' |
|
354 | 361 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
362 | + } |
|
355 | 363 | |
356 | 364 | foreach ($row as $smiley) |
357 | 365 | { |
358 | - if (empty($context['move_smiley'])) |
|
359 | - echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>'; |
|
360 | - else |
|
361 | - echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
|
366 | + if (empty($context['move_smiley'])) { |
|
367 | + echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>'; |
|
368 | + } else { |
|
369 | + echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
|
370 | + } |
|
362 | 371 | } |
363 | 372 | |
364 | 373 | echo ' |
365 | 374 | <br>'; |
366 | 375 | } |
367 | - if (!empty($context['move_smiley'])) |
|
368 | - echo ' |
|
376 | + if (!empty($context['move_smiley'])) { |
|
377 | + echo ' |
|
369 | 378 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
379 | + } |
|
370 | 380 | echo ' |
371 | 381 | </div> |
372 | 382 | <input type="hidden" name="reorder" value="1"> |
@@ -402,14 +412,15 @@ discard block |
||
402 | 412 | </div> |
403 | 413 | <div class="windowbg2"> |
404 | 414 | <dl class="settings">'; |
405 | - if (!$context['new_icon']) |
|
406 | - echo ' |
|
415 | + if (!$context['new_icon']) { |
|
416 | + echo ' |
|
407 | 417 | <dt> |
408 | 418 | <strong>', $txt['smiley_preview'], ': </strong> |
409 | 419 | </dt> |
410 | 420 | <dd> |
411 | 421 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
412 | 422 | </dd>'; |
423 | + } |
|
413 | 424 | echo ' |
414 | 425 | <dt> |
415 | 426 | <strong><label for="icon_filename">', $txt['smileys_filename'], '</label>: </strong><br><span class="smalltext">', $txt['icons_filename_all_png'], '</span> |
@@ -434,9 +445,10 @@ discard block |
||
434 | 445 | { |
435 | 446 | echo ' |
436 | 447 | <optgroup label="', $category['name'], '">'; |
437 | - foreach ($category['boards'] as $board) |
|
438 | - echo ' |
|
448 | + foreach ($category['boards'] as $board) { |
|
449 | + echo ' |
|
439 | 450 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
451 | + } |
|
440 | 452 | echo ' |
441 | 453 | </optgroup>'; |
442 | 454 | } |
@@ -451,19 +463,21 @@ discard block |
||
451 | 463 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
452 | 464 | |
453 | 465 | // Print the list of all the icons it can be put after... |
454 | - foreach ($context['icons'] as $id => $data) |
|
455 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
466 | + foreach ($context['icons'] as $id => $data) { |
|
467 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
456 | 468 | echo ' |
457 | 469 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
470 | + } |
|
458 | 471 | |
459 | 472 | echo ' |
460 | 473 | </select> |
461 | 474 | </dd> |
462 | 475 | </dl>'; |
463 | 476 | |
464 | - if (!$context['new_icon']) |
|
465 | - echo ' |
|
477 | + if (!$context['new_icon']) { |
|
478 | + echo ' |
|
466 | 479 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
480 | + } |
|
467 | 481 | |
468 | 482 | echo ' |
469 | 483 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button_submit"> |
@@ -25,18 +25,20 @@ discard block |
||
25 | 25 | </div> |
26 | 26 | <div class="windowbg2 noup">'; |
27 | 27 | |
28 | - if (!empty($context['move_board'])) |
|
29 | - echo ' |
|
28 | + if (!empty($context['move_board'])) { |
|
29 | + echo ' |
|
30 | 30 | <div class="noticebox"> |
31 | 31 | ', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', ' |
32 | 32 | </div>'; |
33 | + } |
|
33 | 34 | |
34 | 35 | // No categories so show a label. |
35 | - if (empty($context['categories'])) |
|
36 | - echo ' |
|
36 | + if (empty($context['categories'])) { |
|
37 | + echo ' |
|
37 | 38 | <div class="windowbg centertext"> |
38 | 39 | ', $txt['mboards_no_cats'], ' |
39 | 40 | </div>'; |
41 | + } |
|
40 | 42 | |
41 | 43 | // Loop through every category, listing the boards in each as we go. |
42 | 44 | foreach ($context['categories'] as $category) |
@@ -54,9 +56,10 @@ discard block |
||
54 | 56 | <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> |
55 | 57 | <ul id="category_', $category['id'], '" class="nolist">'; |
56 | 58 | |
57 | - if (!empty($category['move_link'])) |
|
58 | - echo ' |
|
59 | + if (!empty($category['move_link'])) { |
|
60 | + echo ' |
|
59 | 61 | <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>'; |
62 | + } |
|
60 | 63 | |
61 | 64 | $recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>'; |
62 | 65 | $redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">'; |
@@ -81,9 +84,10 @@ discard block |
||
81 | 84 | echo ' |
82 | 85 | <li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; |
83 | 86 | |
84 | - foreach ($board['move_links'] as $link) |
|
85 | - echo ' |
|
87 | + foreach ($board['move_links'] as $link) { |
|
88 | + echo ' |
|
86 | 89 | <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>'; |
90 | + } |
|
87 | 91 | |
88 | 92 | echo ' |
89 | 93 | </li>'; |
@@ -132,9 +136,10 @@ discard block |
||
132 | 136 | <select name="cat_order">'; |
133 | 137 | |
134 | 138 | // Print every existing category into a select box. |
135 | - foreach ($context['category_order'] as $order) |
|
136 | - echo ' |
|
139 | + foreach ($context['category_order'] as $order) { |
|
140 | + echo ' |
|
137 | 141 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
142 | + } |
|
138 | 143 | echo ' |
139 | 144 | </select> |
140 | 145 | </dd>'; |
@@ -169,14 +174,15 @@ discard block |
||
169 | 174 | { |
170 | 175 | foreach ($context['custom_category_settings'] as $catset_id => $catset) |
171 | 176 | { |
172 | - if (!empty($catset['dt']) && !empty($catset['dd'])) |
|
173 | - echo ' |
|
177 | + if (!empty($catset['dt']) && !empty($catset['dd'])) { |
|
178 | + echo ' |
|
174 | 179 | <dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '"> |
175 | 180 | ', $catset['dt'], ' |
176 | 181 | </dt> |
177 | 182 | <dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '> |
178 | 183 | ', $catset['dd'], ' |
179 | 184 | </dd>'; |
185 | + } |
|
180 | 186 | } |
181 | 187 | } |
182 | 188 | |
@@ -184,21 +190,23 @@ discard block |
||
184 | 190 | echo ' |
185 | 191 | </dl>'; |
186 | 192 | |
187 | - if (isset($context['category']['is_new'])) |
|
188 | - echo ' |
|
193 | + if (isset($context['category']['is_new'])) { |
|
194 | + echo ' |
|
189 | 195 | <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit">'; |
190 | - else |
|
191 | - echo ' |
|
196 | + } else { |
|
197 | + echo ' |
|
192 | 198 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit"> |
193 | 199 | <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button_submit you_sure">'; |
200 | + } |
|
194 | 201 | echo ' |
195 | 202 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
196 | 203 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
197 | 204 | |
198 | 205 | // If this category is empty we don't bother with the next confirmation screen. |
199 | - if ($context['category']['is_empty']) |
|
200 | - echo ' |
|
206 | + if ($context['category']['is_empty']) { |
|
207 | + echo ' |
|
201 | 208 | <input type="hidden" name="empty" value="1">'; |
209 | + } |
|
202 | 210 | |
203 | 211 | echo ' |
204 | 212 | </div> |
@@ -225,9 +233,10 @@ discard block |
||
225 | 233 | <p>', $txt['mboards_delete_cat_contains'], ':</p> |
226 | 234 | <ul>'; |
227 | 235 | |
228 | - foreach ($context['category']['children'] as $child) |
|
229 | - echo ' |
|
236 | + foreach ($context['category']['children'] as $child) { |
|
237 | + echo ' |
|
230 | 238 | <li>', $child, '</li>'; |
239 | + } |
|
231 | 240 | |
232 | 241 | echo ' |
233 | 242 | </ul> |
@@ -241,10 +250,11 @@ discard block |
||
241 | 250 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>: |
242 | 251 | <select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>'; |
243 | 252 | |
244 | - foreach ($context['category_order'] as $cat) |
|
245 | - if ($cat['id'] != 0) |
|
253 | + foreach ($context['category_order'] as $cat) { |
|
254 | + if ($cat['id'] != 0) |
|
246 | 255 | echo ' |
247 | 256 | <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; |
257 | + } |
|
248 | 258 | |
249 | 259 | echo ' |
250 | 260 | </select> |
@@ -288,9 +298,10 @@ discard block |
||
288 | 298 | </dt> |
289 | 299 | <dd> |
290 | 300 | <select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">'; |
291 | - foreach ($context['categories'] as $category) |
|
292 | - echo ' |
|
301 | + foreach ($context['categories'] as $category) { |
|
302 | + echo ' |
|
293 | 303 | <option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; |
304 | + } |
|
294 | 305 | echo ' |
295 | 306 | </select> |
296 | 307 | </dd>'; |
@@ -317,9 +328,10 @@ discard block |
||
317 | 328 | echo ' |
318 | 329 | <select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '> |
319 | 330 | ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; |
320 | - foreach ($context['board_order'] as $order) |
|
321 | - echo ' |
|
331 | + foreach ($context['board_order'] as $order) { |
|
332 | + echo ' |
|
322 | 333 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
334 | + } |
|
323 | 335 | echo ' |
324 | 336 | </select> |
325 | 337 | </dd>'; |
@@ -348,13 +360,15 @@ discard block |
||
348 | 360 | <dd> |
349 | 361 | <select name="profile">'; |
350 | 362 | |
351 | - if (isset($context['board']['is_new'])) |
|
352 | - echo ' |
|
363 | + if (isset($context['board']['is_new'])) { |
|
364 | + echo ' |
|
353 | 365 | <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; |
366 | + } |
|
354 | 367 | |
355 | - foreach ($context['profiles'] as $id => $profile) |
|
356 | - echo ' |
|
368 | + foreach ($context['profiles'] as $id => $profile) { |
|
369 | + echo ' |
|
357 | 370 | <option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
371 | + } |
|
358 | 372 | |
359 | 373 | echo ' |
360 | 374 | </select> |
@@ -367,8 +381,8 @@ discard block |
||
367 | 381 | </dt> |
368 | 382 | <dd>'; |
369 | 383 | |
370 | - if (!empty($modSettings['deny_boards_access'])) |
|
371 | - echo ' |
|
384 | + if (!empty($modSettings['deny_boards_access'])) { |
|
385 | + echo ' |
|
372 | 386 | <table> |
373 | 387 | <tr> |
374 | 388 | <td></td> |
@@ -376,10 +390,11 @@ discard block |
||
376 | 390 | <th>', $txt['permissions_option_off'], '</th> |
377 | 391 | <th>', $txt['permissions_option_deny'], '</th> |
378 | 392 | </tr>'; |
393 | + } |
|
379 | 394 | |
380 | 395 | // List all the membergroups so the user can choose who may access this board. |
381 | - foreach ($context['groups'] as $group) |
|
382 | - if (empty($modSettings['deny_boards_access'])) |
|
396 | + foreach ($context['groups'] as $group) { |
|
397 | + if (empty($modSettings['deny_boards_access'])) |
|
383 | 398 | echo ' |
384 | 399 | <label for="groups_', $group['id'], '"> |
385 | 400 | <input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '> |
@@ -387,8 +402,9 @@ discard block |
||
387 | 402 | ', $group['name'], ' |
388 | 403 | </span> |
389 | 404 | </label><br>'; |
390 | - else |
|
391 | - echo ' |
|
405 | + } |
|
406 | + else { |
|
407 | + echo ' |
|
392 | 408 | <tr> |
393 | 409 | <td> |
394 | 410 | <label for="groups_', $group['id'], '_a"> |
@@ -408,16 +424,17 @@ discard block |
||
408 | 424 | </td> |
409 | 425 | <td></td> |
410 | 426 | </tr>'; |
427 | + } |
|
411 | 428 | |
412 | - if (empty($modSettings['deny_boards_access'])) |
|
413 | - echo ' |
|
429 | + if (empty($modSettings['deny_boards_access'])) { |
|
430 | + echo ' |
|
414 | 431 | <span class="select_all_box"> |
415 | 432 | <em>', $txt['check_all'], '</em> <input type="checkbox" onclick="invertAll(this, this.form, \'groups[\');"> |
416 | 433 | </span> |
417 | 434 | <br><br> |
418 | 435 | </dd>'; |
419 | - else |
|
420 | - echo ' |
|
436 | + } else { |
|
437 | + echo ' |
|
421 | 438 | <tr class="select_all_box"> |
422 | 439 | <td> |
423 | 440 | </td> |
@@ -436,6 +453,7 @@ discard block |
||
436 | 453 | </tr> |
437 | 454 | </table> |
438 | 455 | </dd>'; |
456 | + } |
|
439 | 457 | |
440 | 458 | // Options to choose moderators, specify as announcement board and choose whether to count posts here. |
441 | 459 | echo ' |
@@ -490,8 +508,8 @@ discard block |
||
490 | 508 | </dl> |
491 | 509 | </div>'; |
492 | 510 | |
493 | - if ($context['board']['redirect']) |
|
494 | - echo ' |
|
511 | + if ($context['board']['redirect']) { |
|
512 | + echo ' |
|
495 | 513 | <div id="reset_redirect_div"> |
496 | 514 | <dl class="settings"> |
497 | 515 | <dt> |
@@ -504,6 +522,7 @@ discard block |
||
504 | 522 | </dd> |
505 | 523 | </dl> |
506 | 524 | </div>'; |
525 | + } |
|
507 | 526 | } |
508 | 527 | |
509 | 528 | echo ' |
@@ -531,9 +550,10 @@ discard block |
||
531 | 550 | <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> |
532 | 551 | <option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>'; |
533 | 552 | |
534 | - foreach ($context['themes'] as $theme) |
|
535 | - echo ' |
|
553 | + foreach ($context['themes'] as $theme) { |
|
554 | + echo ' |
|
536 | 555 | <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
556 | + } |
|
537 | 557 | |
538 | 558 | echo ' |
539 | 559 | </select> |
@@ -562,14 +582,15 @@ discard block |
||
562 | 582 | |
563 | 583 | foreach ($context['custom_board_settings'] as $cbs_id => $cbs) |
564 | 584 | { |
565 | - if (!empty($cbs['dt']) && !empty($cbs['dd'])) |
|
566 | - echo ' |
|
585 | + if (!empty($cbs['dt']) && !empty($cbs['dd'])) { |
|
586 | + echo ' |
|
567 | 587 | <dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '"> |
568 | 588 | ', $cbs['dt'], ' |
569 | 589 | </dt> |
570 | 590 | <dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '> |
571 | 591 | ', $cbs['dd'], ' |
572 | 592 | </dd>'; |
593 | + } |
|
573 | 594 | } |
574 | 595 | |
575 | 596 | echo ' |
@@ -577,9 +598,10 @@ discard block |
||
577 | 598 | </div>'; |
578 | 599 | } |
579 | 600 | |
580 | - if (!empty($context['board']['is_recycle'])) |
|
581 | - echo ' |
|
601 | + if (!empty($context['board']['is_recycle'])) { |
|
602 | + echo ' |
|
582 | 603 | <div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>'; |
604 | + } |
|
583 | 605 | |
584 | 606 | echo ' |
585 | 607 | <input type="hidden" name="rid" value="', $context['redirect_location'], '"> |
@@ -587,21 +609,24 @@ discard block |
||
587 | 609 | <input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">'; |
588 | 610 | |
589 | 611 | // If this board has no children don't bother with the next confirmation screen. |
590 | - if ($context['board']['no_children']) |
|
591 | - echo ' |
|
612 | + if ($context['board']['no_children']) { |
|
613 | + echo ' |
|
592 | 614 | <input type="hidden" name="no_children" value="1">'; |
615 | + } |
|
593 | 616 | |
594 | - if (isset($context['board']['is_new'])) |
|
595 | - echo ' |
|
617 | + if (isset($context['board']['is_new'])) { |
|
618 | + echo ' |
|
596 | 619 | <input type="hidden" name="cur_cat" value="', $context['board']['category'], '"> |
597 | 620 | <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit">'; |
598 | - else |
|
599 | - echo ' |
|
621 | + } else { |
|
622 | + echo ' |
|
600 | 623 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit">'; |
624 | + } |
|
601 | 625 | |
602 | - if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) |
|
603 | - echo ' |
|
626 | + if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) { |
|
627 | + echo ' |
|
604 | 628 | <input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button_submit you_sure">'; |
629 | + } |
|
605 | 630 | echo ' |
606 | 631 | </div> |
607 | 632 | </form> |
@@ -622,12 +647,13 @@ discard block |
||
622 | 647 | sItemListContainerId: \'moderator_container\', |
623 | 648 | aListItems: ['; |
624 | 649 | |
625 | - foreach ($context['board']['moderators'] as $id_member => $member_name) |
|
626 | - echo ' |
|
650 | + foreach ($context['board']['moderators'] as $id_member => $member_name) { |
|
651 | + echo ' |
|
627 | 652 | { |
628 | 653 | sItemId: ', JavaScriptEscape($id_member), ', |
629 | 654 | sItemName: ', JavaScriptEscape($member_name), ' |
630 | 655 | }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; |
656 | + } |
|
631 | 657 | |
632 | 658 | echo ' |
633 | 659 | ] |
@@ -647,12 +673,13 @@ discard block |
||
647 | 673 | sItemListContainerId: \'moderator_group_container\', |
648 | 674 | aListItems: ['; |
649 | 675 | |
650 | - foreach ($context['board']['moderator_groups'] as $id_group => $group_name) |
|
651 | - echo ' |
|
676 | + foreach ($context['board']['moderator_groups'] as $id_group => $group_name) { |
|
677 | + echo ' |
|
652 | 678 | { |
653 | 679 | sItemId: ', JavaScriptEscape($id_group), ', |
654 | 680 | sItemName: ', JavaScriptEscape($group_name), ' |
655 | 681 | }', $id_group == $context['board']['last_moderator_group_id'] ? '' : ','; |
682 | + } |
|
656 | 683 | |
657 | 684 | echo ' |
658 | 685 | ] |
@@ -678,17 +705,19 @@ discard block |
||
678 | 705 | echo ' |
679 | 706 | document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; |
680 | 707 | |
681 | - if ($context['board']['redirect']) |
|
682 | - echo ' |
|
708 | + if ($context['board']['redirect']) { |
|
709 | + echo ' |
|
683 | 710 | document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; |
711 | + } |
|
684 | 712 | } |
685 | 713 | |
686 | 714 | // Include any JavaScript added by mods using the 'integrate_edit_board' hook. |
687 | 715 | if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions'])) |
688 | 716 | { |
689 | - foreach ($context['custom_refreshOptions'] as $refreshOption) |
|
690 | - echo ' |
|
717 | + foreach ($context['custom_refreshOptions'] as $refreshOption) { |
|
718 | + echo ' |
|
691 | 719 | ', $refreshOption; |
720 | + } |
|
692 | 721 | } |
693 | 722 | |
694 | 723 | echo ' |
@@ -717,9 +746,10 @@ discard block |
||
717 | 746 | <p>', $txt['mboards_delete_board_contains'], '</p> |
718 | 747 | <ul>'; |
719 | 748 | |
720 | - foreach ($context['children'] as $child) |
|
721 | - echo ' |
|
749 | + foreach ($context['children'] as $child) { |
|
750 | + echo ' |
|
722 | 751 | <li>', $child['node']['name'], '</li>'; |
752 | + } |
|
723 | 753 | |
724 | 754 | echo ' |
725 | 755 | </ul> |
@@ -733,10 +763,11 @@ discard block |
||
733 | 763 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>: |
734 | 764 | <select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>'; |
735 | 765 | |
736 | - foreach ($context['board_order'] as $board) |
|
737 | - if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
766 | + foreach ($context['board_order'] as $board) { |
|
767 | + if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
738 | 768 | echo ' |
739 | 769 | <option value="', $board['id'], '">', $board['name'], '</option>'; |
770 | + } |
|
740 | 771 | |
741 | 772 | echo ' |
742 | 773 | </select> |
@@ -51,11 +51,13 @@ discard block |
||
51 | 51 | <p>'; |
52 | 52 | |
53 | 53 | // Show just numbers...? |
54 | - if ($settings['display_who_viewing'] == 1) |
|
55 | - echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
54 | + if ($settings['display_who_viewing'] == 1) { |
|
55 | + echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
56 | + } |
|
56 | 57 | // Or show the actual people viewing the topic? |
57 | - else |
|
58 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
58 | + else { |
|
59 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
60 | + } |
|
59 | 61 | |
60 | 62 | // Now show how many guests are here too. |
61 | 63 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' |
@@ -93,10 +95,11 @@ discard block |
||
93 | 95 | <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> |
94 | 96 | <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; |
95 | 97 | |
96 | - if ($context['allow_results_view']) |
|
97 | - echo ' |
|
98 | + if ($context['allow_results_view']) { |
|
99 | + echo ' |
|
98 | 100 | ', $option['bar_ndt'], ' |
99 | 101 | <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; |
102 | + } |
|
100 | 103 | |
101 | 104 | echo ' |
102 | 105 | </dd>'; |
@@ -105,9 +108,10 @@ discard block |
||
105 | 108 | echo ' |
106 | 109 | </dl>'; |
107 | 110 | |
108 | - if ($context['allow_results_view']) |
|
109 | - echo ' |
|
111 | + if ($context['allow_results_view']) { |
|
112 | + echo ' |
|
110 | 113 | <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; |
114 | + } |
|
111 | 115 | } |
112 | 116 | // They are allowed to vote! Go to it! |
113 | 117 | else |
@@ -116,17 +120,19 @@ discard block |
||
116 | 120 | <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; |
117 | 121 | |
118 | 122 | // Show a warning if they are allowed more than one option. |
119 | - if ($context['poll']['allowed_warning']) |
|
120 | - echo ' |
|
123 | + if ($context['poll']['allowed_warning']) { |
|
124 | + echo ' |
|
121 | 125 | <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; |
126 | + } |
|
122 | 127 | |
123 | 128 | echo ' |
124 | 129 | <ul class="options">'; |
125 | 130 | |
126 | 131 | // Show each option with its button - a radio likely. |
127 | - foreach ($context['poll']['options'] as $option) |
|
128 | - echo ' |
|
132 | + foreach ($context['poll']['options'] as $option) { |
|
133 | + echo ' |
|
129 | 134 | <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; |
135 | + } |
|
130 | 136 | |
131 | 137 | echo ' |
132 | 138 | </ul> |
@@ -138,9 +144,10 @@ discard block |
||
138 | 144 | } |
139 | 145 | |
140 | 146 | // Is the clock ticking? |
141 | - if (!empty($context['poll']['expire_time'])) |
|
142 | - echo ' |
|
147 | + if (!empty($context['poll']['expire_time'])) { |
|
148 | + echo ' |
|
143 | 149 | <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>'; |
150 | + } |
|
144 | 151 | |
145 | 152 | echo ' |
146 | 153 | </div> |
@@ -170,11 +177,13 @@ discard block |
||
170 | 177 | <li> |
171 | 178 | <b class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></b>'; |
172 | 179 | |
173 | - if ($event['can_edit']) |
|
174 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
180 | + if ($event['can_edit']) { |
|
181 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
182 | + } |
|
175 | 183 | |
176 | - if ($event['can_export']) |
|
177 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
184 | + if ($event['can_export']) { |
|
185 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
186 | + } |
|
178 | 187 | |
179 | 188 | echo ' |
180 | 189 | <br>'; |
@@ -182,14 +191,14 @@ discard block |
||
182 | 191 | if (!empty($event['allday'])) |
183 | 192 | { |
184 | 193 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' – <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : ''; |
185 | - } |
|
186 | - else |
|
194 | + } else |
|
187 | 195 | { |
188 | 196 | // Display event info relative to user's local timezone |
189 | 197 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
190 | 198 | |
191 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
192 | - echo trim($event['end_date_local']) . ', '; |
|
199 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
200 | + echo trim($event['end_date_local']) . ', '; |
|
201 | + } |
|
193 | 202 | |
194 | 203 | echo trim($event['end_time_local']); |
195 | 204 | |
@@ -198,23 +207,27 @@ discard block |
||
198 | 207 | { |
199 | 208 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
200 | 209 | |
201 | - if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) |
|
202 | - echo trim($event['start_date_orig']), ', '; |
|
210 | + if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) { |
|
211 | + echo trim($event['start_date_orig']), ', '; |
|
212 | + } |
|
203 | 213 | |
204 | 214 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
205 | 215 | |
206 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
207 | - echo trim($event['end_date_orig']) . ', '; |
|
216 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
217 | + echo trim($event['end_date_orig']) . ', '; |
|
218 | + } |
|
208 | 219 | |
209 | 220 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
210 | 221 | } |
211 | 222 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
212 | - else |
|
213 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
223 | + else { |
|
224 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
225 | + } |
|
214 | 226 | } |
215 | 227 | |
216 | - if (!empty($event['location'])) |
|
217 | - echo '<br>', $event['location']; |
|
228 | + if (!empty($event['location'])) { |
|
229 | + echo '<br>', $event['location']; |
|
230 | + } |
|
218 | 231 | |
219 | 232 | echo ' |
220 | 233 | </li>'; |
@@ -252,8 +265,9 @@ discard block |
||
252 | 265 | $context['removableMessageIDs'] = array(); |
253 | 266 | |
254 | 267 | // Get all the messages... |
255 | - while ($message = $context['get_message']()) |
|
256 | - template_single_post($message); |
|
268 | + while ($message = $context['get_message']()) { |
|
269 | + template_single_post($message); |
|
270 | + } |
|
257 | 271 | |
258 | 272 | echo ' |
259 | 273 | </form> |
@@ -290,8 +304,9 @@ discard block |
||
290 | 304 | <div id="display_jump_to"> </div>'; |
291 | 305 | |
292 | 306 | // Show quickreply |
293 | - if ($context['can_reply']) |
|
294 | - template_quickreply(); |
|
307 | + if ($context['can_reply']) { |
|
308 | + template_quickreply(); |
|
309 | + } |
|
295 | 310 | |
296 | 311 | // User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device. |
297 | 312 | echo ' |
@@ -304,8 +319,8 @@ discard block |
||
304 | 319 | </div>'; |
305 | 320 | |
306 | 321 | // Show the moderation button & pop only if user can moderate |
307 | - if ($context['can_moderate_forum'] || $context['user']['is_mod']) |
|
308 | - echo ' |
|
322 | + if ($context['can_moderate_forum'] || $context['user']['is_mod']) { |
|
323 | + echo ' |
|
309 | 324 | <div id="mobile_moderation" class="popup_container"> |
310 | 325 | <div class="popup_window description"> |
311 | 326 | <div class="popup_heading">', $txt['mobile_moderation'], ' |
@@ -315,6 +330,7 @@ discard block |
||
315 | 330 | </div> |
316 | 331 | </div> |
317 | 332 | </div>'; |
333 | + } |
|
318 | 334 | |
319 | 335 | echo ' |
320 | 336 | <script>'; |
@@ -438,9 +454,10 @@ discard block |
||
438 | 454 | }); |
439 | 455 | }'; |
440 | 456 | |
441 | - if (!empty($context['ignoredMsgs'])) |
|
442 | - echo ' |
|
457 | + if (!empty($context['ignoredMsgs'])) { |
|
458 | + echo ' |
|
443 | 459 | ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; |
460 | + } |
|
444 | 461 | |
445 | 462 | echo ' |
446 | 463 | </script>'; |
@@ -457,8 +474,9 @@ discard block |
||
457 | 474 | |
458 | 475 | $ignoring = false; |
459 | 476 | |
460 | - if ($message['can_remove']) |
|
461 | - $context['removableMessageIDs'][] = $message['id']; |
|
477 | + if ($message['can_remove']) { |
|
478 | + $context['removableMessageIDs'][] = $message['id']; |
|
479 | + } |
|
462 | 480 | |
463 | 481 | // Are we ignoring this message? |
464 | 482 | if (!empty($message['is_ignored'])) |
@@ -484,9 +502,10 @@ discard block |
||
484 | 502 | <div class="custom_fields_above_member"> |
485 | 503 | <ul class="nolist">'; |
486 | 504 | |
487 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
488 | - echo ' |
|
505 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
506 | + echo ' |
|
489 | 507 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
508 | + } |
|
490 | 509 | |
491 | 510 | echo ' |
492 | 511 | </ul> |
@@ -497,9 +516,10 @@ discard block |
||
497 | 516 | <h4>'; |
498 | 517 | |
499 | 518 | // Show online and offline buttons? |
500 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
501 | - echo ' |
|
519 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
520 | + echo ' |
|
502 | 521 | ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : ''; |
522 | + } |
|
503 | 523 | |
504 | 524 | |
505 | 525 | // Show a link to the member's profile. |
@@ -512,51 +532,59 @@ discard block |
||
512 | 532 | |
513 | 533 | |
514 | 534 | // Show the user's avatar. |
515 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
516 | - echo ' |
|
535 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
536 | + echo ' |
|
517 | 537 | <li class="avatar"> |
518 | 538 | <a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a> |
519 | 539 | </li>'; |
540 | + } |
|
520 | 541 | |
521 | 542 | // Are there any custom fields below the avatar? |
522 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
523 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
543 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
544 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
524 | 545 | echo ' |
525 | 546 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
547 | + } |
|
526 | 548 | |
527 | 549 | // Show the post group icons, but not for guests. |
528 | - if (!$message['member']['is_guest']) |
|
529 | - echo ' |
|
550 | + if (!$message['member']['is_guest']) { |
|
551 | + echo ' |
|
530 | 552 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
553 | + } |
|
531 | 554 | |
532 | 555 | // Show the member's primary group (like 'Administrator') if they have one. |
533 | - if (!empty($message['member']['group'])) |
|
534 | - echo ' |
|
556 | + if (!empty($message['member']['group'])) { |
|
557 | + echo ' |
|
535 | 558 | <li class="membergroup">', $message['member']['group'], '</li>'; |
559 | + } |
|
536 | 560 | |
537 | 561 | // Show the member's custom title, if they have one. |
538 | - if (!empty($message['member']['title'])) |
|
539 | - echo ' |
|
562 | + if (!empty($message['member']['title'])) { |
|
563 | + echo ' |
|
540 | 564 | <li class="title">', $message['member']['title'], '</li>'; |
565 | + } |
|
541 | 566 | |
542 | 567 | // Don't show these things for guests. |
543 | 568 | if (!$message['member']['is_guest']) |
544 | 569 | { |
545 | 570 | |
546 | 571 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
547 | - if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) |
|
548 | - echo ' |
|
572 | + if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) { |
|
573 | + echo ' |
|
549 | 574 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
575 | + } |
|
550 | 576 | |
551 | 577 | // Show how many posts they have made. |
552 | - if (!isset($context['disabled_fields']['posts'])) |
|
553 | - echo ' |
|
578 | + if (!isset($context['disabled_fields']['posts'])) { |
|
579 | + echo ' |
|
554 | 580 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
581 | + } |
|
555 | 582 | |
556 | 583 | // Show their personal text? |
557 | - if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) |
|
558 | - echo ' |
|
584 | + if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) { |
|
585 | + echo ' |
|
559 | 586 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
587 | + } |
|
560 | 588 | |
561 | 589 | // Any custom fields to show as icons? |
562 | 590 | if (!empty($message['custom_fields']['icons'])) |
@@ -565,9 +593,10 @@ discard block |
||
565 | 593 | <li class="im_icons"> |
566 | 594 | <ol>'; |
567 | 595 | |
568 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
569 | - echo ' |
|
596 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
597 | + echo ' |
|
570 | 598 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
599 | + } |
|
571 | 600 | |
572 | 601 | echo ' |
573 | 602 | </ol> |
@@ -582,19 +611,22 @@ discard block |
||
582 | 611 | <ol class="profile_icons">'; |
583 | 612 | |
584 | 613 | // Don't show an icon if they haven't specified a website. |
585 | - if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) |
|
586 | - echo ' |
|
614 | + if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) { |
|
615 | + echo ' |
|
587 | 616 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
617 | + } |
|
588 | 618 | |
589 | 619 | // Since we know this person isn't a guest, you *can* message them. |
590 | - if ($context['can_send_pm']) |
|
591 | - echo ' |
|
620 | + if ($context['can_send_pm']) { |
|
621 | + echo ' |
|
592 | 622 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
623 | + } |
|
593 | 624 | |
594 | 625 | // Show the email if necessary |
595 | - if (!empty($message['member']['email']) && $message['member']['show_email']) |
|
596 | - echo ' |
|
626 | + if (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
627 | + echo ' |
|
597 | 628 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
629 | + } |
|
598 | 630 | |
599 | 631 | echo ' |
600 | 632 | </ol> |
@@ -602,48 +634,56 @@ discard block |
||
602 | 634 | } |
603 | 635 | |
604 | 636 | // Any custom fields for standard placement? |
605 | - if (!empty($message['custom_fields']['standard'])) |
|
606 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
637 | + if (!empty($message['custom_fields']['standard'])) { |
|
638 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
607 | 639 | echo ' |
608 | 640 | <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
641 | + } |
|
609 | 642 | |
610 | 643 | } |
611 | 644 | // Otherwise, show the guest's email. |
612 | - elseif (!empty($message['member']['email']) && $message['member']['show_email']) |
|
613 | - echo ' |
|
645 | + elseif (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
646 | + echo ' |
|
614 | 647 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
648 | + } |
|
615 | 649 | |
616 | 650 | // Show the IP to this user for this post - because you can moderate? |
617 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
618 | - echo ' |
|
651 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
652 | + echo ' |
|
619 | 653 | <li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>'; |
654 | + } |
|
620 | 655 | |
621 | 656 | // Or, should we show it because this is you? |
622 | - elseif ($message['can_see_ip']) |
|
623 | - echo ' |
|
657 | + elseif ($message['can_see_ip']) { |
|
658 | + echo ' |
|
624 | 659 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
660 | + } |
|
625 | 661 | |
626 | 662 | // Okay, are you at least logged in? Then we can show something about why IPs are logged... |
627 | - elseif (!$context['user']['is_guest']) |
|
628 | - echo ' |
|
663 | + elseif (!$context['user']['is_guest']) { |
|
664 | + echo ' |
|
629 | 665 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
666 | + } |
|
630 | 667 | |
631 | 668 | // Otherwise, you see NOTHING! |
632 | - else |
|
633 | - echo ' |
|
669 | + else { |
|
670 | + echo ' |
|
634 | 671 | <li class="poster_ip">', $txt['logged'], '</li>'; |
672 | + } |
|
635 | 673 | |
636 | 674 | // Are we showing the warning status? |
637 | 675 | // Don't show these things for guests. |
638 | - if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) |
|
639 | - echo ' |
|
676 | + if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) { |
|
677 | + echo ' |
|
640 | 678 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span> ', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
679 | + } |
|
641 | 680 | |
642 | 681 | // Are there any custom fields to show at the bottom of the poster info? |
643 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
644 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
682 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
683 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
645 | 684 | echo ' |
646 | 685 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
686 | + } |
|
647 | 687 | |
648 | 688 | // Poster info ends. |
649 | 689 | echo ' |
@@ -672,9 +712,10 @@ discard block |
||
672 | 712 | echo ' |
673 | 713 | <span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '','" id="modified_', $message['id'], '">'; |
674 | 714 | |
675 | - if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
|
676 | - echo |
|
715 | + if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) { |
|
716 | + echo |
|
677 | 717 | $message['modified']['last_edit_text']; |
718 | + } |
|
678 | 719 | |
679 | 720 | echo ' |
680 | 721 | </span> |
@@ -683,22 +724,24 @@ discard block |
||
683 | 724 | </div>'; |
684 | 725 | |
685 | 726 | // Ignoring this user? Hide the post. |
686 | - if ($ignoring) |
|
687 | - echo ' |
|
727 | + if ($ignoring) { |
|
728 | + echo ' |
|
688 | 729 | <div id="msg_', $message['id'], '_ignored_prompt"> |
689 | 730 | ', $txt['ignoring_user'], ' |
690 | 731 | <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
691 | 732 | </div>'; |
733 | + } |
|
692 | 734 | |
693 | 735 | // Show the post itself, finally! |
694 | 736 | echo ' |
695 | 737 | <div class="post">'; |
696 | 738 | |
697 | - if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) |
|
698 | - echo ' |
|
739 | + if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { |
|
740 | + echo ' |
|
699 | 741 | <div class="approve_post"> |
700 | 742 | ', $txt['post_awaiting_approval'], ' |
701 | 743 | </div>'; |
744 | + } |
|
702 | 745 | echo ' |
703 | 746 | <div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div> |
704 | 747 | </div>'; |
@@ -715,9 +758,9 @@ discard block |
||
715 | 758 | foreach ($message['attachment'] as $attachment) |
716 | 759 | { |
717 | 760 | // Do we want this attachment to not be showed here? |
718 | - if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) |
|
719 | - continue; |
|
720 | - elseif (!$div_output) |
|
761 | + if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) { |
|
762 | + continue; |
|
763 | + } elseif (!$div_output) |
|
721 | 764 | { |
722 | 765 | $div_output = true; |
723 | 766 | |
@@ -733,9 +776,10 @@ discard block |
||
733 | 776 | <fieldset> |
734 | 777 | <legend>', $txt['attach_awaiting_approve']; |
735 | 778 | |
736 | - if ($context['can_approve']) |
|
737 | - echo ' |
|
779 | + if ($context['can_approve']) { |
|
780 | + echo ' |
|
738 | 781 | [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; |
782 | + } |
|
739 | 783 | |
740 | 784 | echo ' |
741 | 785 | </legend>'; |
@@ -749,12 +793,13 @@ discard block |
||
749 | 793 | echo ' |
750 | 794 | <div class="attachments_top">'; |
751 | 795 | |
752 | - if ($attachment['thumbnail']['has_thumb']) |
|
753 | - echo ' |
|
796 | + if ($attachment['thumbnail']['has_thumb']) { |
|
797 | + echo ' |
|
754 | 798 | <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>'; |
755 | - else |
|
756 | - echo ' |
|
799 | + } else { |
|
800 | + echo ' |
|
757 | 801 | <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">'; |
802 | + } |
|
758 | 803 | |
759 | 804 | echo ' |
760 | 805 | </div>'; |
@@ -764,9 +809,10 @@ discard block |
||
764 | 809 | <div class="attachments_bot"> |
765 | 810 | <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*"> ' . $attachment['name'] . '</a> '; |
766 | 811 | |
767 | - if (!$attachment['is_approved'] && $context['can_approve']) |
|
768 | - echo ' |
|
812 | + if (!$attachment['is_approved'] && $context['can_approve']) { |
|
813 | + echo ' |
|
769 | 814 | [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] '; |
815 | + } |
|
770 | 816 | echo ' |
771 | 817 | <br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), ' |
772 | 818 | </div>'; |
@@ -775,33 +821,38 @@ discard block |
||
775 | 821 | </div>'; |
776 | 822 | |
777 | 823 | // Next attachment line ? |
778 | - if (++$i % $attachments_per_line === 0) |
|
779 | - echo ' |
|
824 | + if (++$i % $attachments_per_line === 0) { |
|
825 | + echo ' |
|
780 | 826 | <br>'; |
827 | + } |
|
781 | 828 | } |
782 | 829 | |
783 | 830 | // If we had unapproved attachments clean up. |
784 | - if ($last_approved_state == 0) |
|
785 | - echo ' |
|
831 | + if ($last_approved_state == 0) { |
|
832 | + echo ' |
|
786 | 833 | </fieldset>'; |
834 | + } |
|
787 | 835 | |
788 | 836 | // Only do this if we output a div above - otherwise it'll break things |
789 | - if ($div_output) |
|
790 | - echo ' |
|
837 | + if ($div_output) { |
|
838 | + echo ' |
|
791 | 839 | </div>'; |
840 | + } |
|
792 | 841 | } |
793 | 842 | |
794 | 843 | // And stuff below the attachments. |
795 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
796 | - echo ' |
|
844 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
845 | + echo ' |
|
797 | 846 | <div class="under_message">'; |
847 | + } |
|
798 | 848 | |
799 | 849 | // Maybe they want to report this post to the moderator(s)? |
800 | - if ($context['can_report_moderator']) |
|
801 | - echo ' |
|
850 | + if ($context['can_report_moderator']) { |
|
851 | + echo ' |
|
802 | 852 | <ul class="floatright smalltext"> |
803 | 853 | <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li> |
804 | 854 | </ul>'; |
855 | + } |
|
805 | 856 | |
806 | 857 | // What about likes? |
807 | 858 | if (!empty($modSettings['enable_likes'])) |
@@ -842,78 +893,91 @@ discard block |
||
842 | 893 | <ul class="quickbuttons">'; |
843 | 894 | |
844 | 895 | // Can they quote? if so they can select and quote as well! |
845 | - if ($context['can_quote']) |
|
846 | - echo ' |
|
896 | + if ($context['can_quote']) { |
|
897 | + echo ' |
|
847 | 898 | <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li> |
848 | 899 | <li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>'; |
900 | + } |
|
849 | 901 | |
850 | 902 | // Can the user modify the contents of this post? Show the modify inline image. |
851 | - if ($message['can_modify']) |
|
852 | - echo ' |
|
903 | + if ($message['can_modify']) { |
|
904 | + echo ' |
|
853 | 905 | <li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>'; |
906 | + } |
|
854 | 907 | |
855 | - if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
856 | - echo ' |
|
908 | + if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
909 | + echo ' |
|
857 | 910 | <li class="post_options">', $txt['post_options']; |
911 | + } |
|
858 | 912 | |
859 | 913 | echo ' |
860 | 914 | <ul>'; |
861 | 915 | |
862 | 916 | // Can the user modify the contents of this post? |
863 | - if ($message['can_modify']) |
|
864 | - echo ' |
|
917 | + if ($message['can_modify']) { |
|
918 | + echo ' |
|
865 | 919 | <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>'; |
920 | + } |
|
866 | 921 | |
867 | 922 | // How about... even... remove it entirely?! |
868 | - if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) |
|
869 | - echo ' |
|
923 | + if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) { |
|
924 | + echo ' |
|
870 | 925 | <li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'], '</a></li>'; |
871 | - elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) |
|
872 | - echo ' |
|
926 | + } elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) { |
|
927 | + echo ' |
|
873 | 928 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
929 | + } |
|
874 | 930 | |
875 | 931 | // What about splitting it off the rest of the topic? |
876 | - if ($context['can_split'] && !empty($context['real_num_replies'])) |
|
877 | - echo ' |
|
932 | + if ($context['can_split'] && !empty($context['real_num_replies'])) { |
|
933 | + echo ' |
|
878 | 934 | <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>'; |
935 | + } |
|
879 | 936 | |
880 | 937 | // Can we issue a warning because of this post? Remember, we can't give guests warnings. |
881 | - if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) |
|
882 | - echo ' |
|
938 | + if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) { |
|
939 | + echo ' |
|
883 | 940 | <li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>'; |
941 | + } |
|
884 | 942 | |
885 | 943 | // Can we restore topics? |
886 | - if ($context['can_restore_msg']) |
|
887 | - echo ' |
|
944 | + if ($context['can_restore_msg']) { |
|
945 | + echo ' |
|
888 | 946 | <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>'; |
947 | + } |
|
889 | 948 | |
890 | 949 | // Maybe we can approve it, maybe we should? |
891 | - if ($message['can_approve']) |
|
892 | - echo ' |
|
950 | + if ($message['can_approve']) { |
|
951 | + echo ' |
|
893 | 952 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>'; |
953 | + } |
|
894 | 954 | |
895 | 955 | // Maybe we can unapprove it? |
896 | - if ($message['can_unapprove']) |
|
897 | - echo ' |
|
956 | + if ($message['can_unapprove']) { |
|
957 | + echo ' |
|
898 | 958 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>'; |
959 | + } |
|
899 | 960 | |
900 | 961 | echo ' |
901 | 962 | </ul> |
902 | 963 | </li>'; |
903 | 964 | |
904 | 965 | // Show a checkbox for quick moderation? |
905 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) |
|
906 | - echo ' |
|
966 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { |
|
967 | + echo ' |
|
907 | 968 | <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; |
969 | + } |
|
908 | 970 | |
909 | - if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
910 | - echo ' |
|
971 | + if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
972 | + echo ' |
|
911 | 973 | </ul>'; |
974 | + } |
|
912 | 975 | } |
913 | 976 | |
914 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
915 | - echo ' |
|
977 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
978 | + echo ' |
|
916 | 979 | </div>'; |
980 | + } |
|
917 | 981 | |
918 | 982 | echo ' |
919 | 983 | </div> |
@@ -926,9 +990,10 @@ discard block |
||
926 | 990 | <div class="custom_fields_above_signature"> |
927 | 991 | <ul class="nolist">'; |
928 | 992 | |
929 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
930 | - echo ' |
|
993 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
994 | + echo ' |
|
931 | 995 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
996 | + } |
|
932 | 997 | |
933 | 998 | echo ' |
934 | 999 | </ul> |
@@ -936,9 +1001,10 @@ discard block |
||
936 | 1001 | } |
937 | 1002 | |
938 | 1003 | // Show the member's signature? |
939 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
940 | - echo ' |
|
1004 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
1005 | + echo ' |
|
941 | 1006 | <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>'; |
1007 | + } |
|
942 | 1008 | |
943 | 1009 | |
944 | 1010 | // Are there any custom profile fields for below the signature? |
@@ -948,9 +1014,10 @@ discard block |
||
948 | 1014 | <div class="custom_fields_below_signature"> |
949 | 1015 | <ul class="nolist">'; |
950 | 1016 | |
951 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
952 | - echo ' |
|
1017 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
1018 | + echo ' |
|
953 | 1019 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
1020 | + } |
|
954 | 1021 | |
955 | 1022 | echo ' |
956 | 1023 | </ul> |
@@ -998,8 +1065,8 @@ discard block |
||
998 | 1065 | <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">'; |
999 | 1066 | |
1000 | 1067 | // Guests just need more. |
1001 | - if ($context['user']['is_guest']) |
|
1002 | - echo ' |
|
1068 | + if ($context['user']['is_guest']) { |
|
1069 | + echo ' |
|
1003 | 1070 | <dl id="post_header"> |
1004 | 1071 | <dt> |
1005 | 1072 | ', $txt['name'], ': |
@@ -1014,6 +1081,7 @@ discard block |
||
1014 | 1081 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" required> |
1015 | 1082 | </dd> |
1016 | 1083 | </dl>'; |
1084 | + } |
|
1017 | 1085 | |
1018 | 1086 | echo ' |
1019 | 1087 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' |
@@ -1061,8 +1129,8 @@ discard block |
||
1061 | 1129 | <br class="clear">'; |
1062 | 1130 | |
1063 | 1131 | // draft autosave available and the user has it enabled? |
1064 | - if (!empty($context['drafts_autosave'])) |
|
1065 | - echo ' |
|
1132 | + if (!empty($context['drafts_autosave'])) { |
|
1133 | + echo ' |
|
1066 | 1134 | <script> |
1067 | 1135 | var oDraftAutoSave = new smf_DraftAutoSave({ |
1068 | 1136 | sSelf: \'oDraftAutoSave\', |
@@ -1074,10 +1142,12 @@ discard block |
||
1074 | 1142 | iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), ' |
1075 | 1143 | }); |
1076 | 1144 | </script>'; |
1145 | + } |
|
1077 | 1146 | |
1078 | - if ($context['show_spellchecking']) |
|
1079 | - echo ' |
|
1147 | + if ($context['show_spellchecking']) { |
|
1148 | + echo ' |
|
1080 | 1149 | <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>'; |
1150 | + } |
|
1081 | 1151 | |
1082 | 1152 | echo ' |
1083 | 1153 | <script> |
@@ -86,9 +86,10 @@ discard block |
||
86 | 86 | <span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br>'; |
87 | 87 | |
88 | 88 | // Only offer to search for buddies if we have some! |
89 | - if (!empty($context['show_buddies'])) |
|
90 | - echo ' |
|
89 | + if (!empty($context['show_buddies'])) { |
|
90 | + echo ' |
|
91 | 91 | <span class="smalltext"><label for="buddies"><input type="checkbox" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked' : '', '> ', $txt['find_buddies'], '</label></span><br>'; |
92 | + } |
|
92 | 93 | |
93 | 94 | echo ' |
94 | 95 | <div class="padding righttext"> |
@@ -103,10 +104,10 @@ discard block |
||
103 | 104 | <h3 class="catbg">', $txt['find_results'], '</h3> |
104 | 105 | </div>'; |
105 | 106 | |
106 | - if (empty($context['results'])) |
|
107 | - echo ' |
|
107 | + if (empty($context['results'])) { |
|
108 | + echo ' |
|
108 | 109 | <p class="error">', $txt['find_no_results'], '</p>'; |
109 | - else |
|
110 | + } else |
|
110 | 111 | { |
111 | 112 | echo ' |
112 | 113 | <ul class="padding">'; |
@@ -135,11 +136,12 @@ discard block |
||
135 | 136 | <input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '"> |
136 | 137 | </form>'; |
137 | 138 | |
138 | - if (empty($context['results'])) |
|
139 | - echo ' |
|
139 | + if (empty($context['results'])) { |
|
140 | + echo ' |
|
140 | 141 | <script> |
141 | 142 | document.getElementById("search").focus(); |
142 | 143 | </script>'; |
144 | + } |
|
143 | 145 | |
144 | 146 | echo ' |
145 | 147 | </body> |
@@ -183,8 +185,8 @@ discard block |
||
183 | 185 | { |
184 | 186 | global $txt, $context, $modSettings; |
185 | 187 | |
186 | - if (!empty($modSettings['requireAgreement'])) |
|
187 | - echo ' |
|
188 | + if (!empty($modSettings['requireAgreement'])) { |
|
189 | + echo ' |
|
188 | 190 | <div class="cat_bar"> |
189 | 191 | <h3 class="catbg"> |
190 | 192 | ', $txt['terms_and_rules'], ' - ', $context['forum_name_html_safe'], ' |
@@ -193,11 +195,12 @@ discard block |
||
193 | 195 | <div class="roundframe"> |
194 | 196 | ', $context['agreement'], ' |
195 | 197 | </div>'; |
196 | - else |
|
197 | - echo ' |
|
198 | + } else { |
|
199 | + echo ' |
|
198 | 200 | <div class="noticebox"> |
199 | 201 | ', $txt['agreement_disabled'], ' |
200 | 202 | </div>'; |
201 | -} |
|
203 | + } |
|
204 | + } |
|
202 | 205 | |
203 | 206 | ?> |
204 | 207 | \ No newline at end of file |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | <h3 class="catbg">', $context['page_title'], '</h3> |
47 | 47 | </div>'; |
48 | 48 | |
49 | - if (!empty($context['poll_error']['messages'])) |
|
50 | - echo ' |
|
49 | + if (!empty($context['poll_error']['messages'])) { |
|
50 | + echo ' |
|
51 | 51 | <div class="errorbox"> |
52 | 52 | <dl class="poll_error"> |
53 | 53 | <dt> |
@@ -58,6 +58,7 @@ discard block |
||
58 | 58 | </dt> |
59 | 59 | </dl> |
60 | 60 | </div>'; |
61 | + } |
|
61 | 62 | |
62 | 63 | echo ' |
63 | 64 | <div> |
@@ -79,8 +80,9 @@ discard block |
||
79 | 80 | <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" size="80" maxlength="255">'; |
80 | 81 | |
81 | 82 | // Does this option have a vote count yet, or is it new? |
82 | - if ($choice['votes'] != -1) |
|
83 | - echo ' (', $choice['votes'], ' ', $txt['votes'], ')'; |
|
83 | + if ($choice['votes'] != -1) { |
|
84 | + echo ' (', $choice['votes'], ' ', $txt['votes'], ')'; |
|
85 | + } |
|
84 | 86 | |
85 | 87 | echo ' |
86 | 88 | </dd>'; |
@@ -118,14 +120,15 @@ discard block |
||
118 | 120 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '> |
119 | 121 | </dd>'; |
120 | 122 | |
121 | - if ($context['poll']['guest_vote_allowed']) |
|
122 | - echo ' |
|
123 | + if ($context['poll']['guest_vote_allowed']) { |
|
124 | + echo ' |
|
123 | 125 | <dt> |
124 | 126 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
125 | 127 | </dt> |
126 | 128 | <dd> |
127 | 129 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', '> |
128 | 130 | </dd>'; |
131 | + } |
|
129 | 132 | } |
130 | 133 | |
131 | 134 | echo ' |
@@ -140,12 +143,13 @@ discard block |
||
140 | 143 | </dl> |
141 | 144 | </fieldset>'; |
142 | 145 | // If this is an edit, we can allow them to reset the vote counts. |
143 | - if ($context['is_edit']) |
|
144 | - echo ' |
|
146 | + if ($context['is_edit']) { |
|
147 | + echo ' |
|
145 | 148 | <fieldset id="poll_reset"> |
146 | 149 | <legend>', $txt['reset_votes'], '</legend> |
147 | 150 | <input type="checkbox" name="resetVoteCount" value="on"> ' . $txt['reset_votes_check'] . ' |
148 | 151 | </fieldset>'; |
152 | + } |
|
149 | 153 | echo ' |
150 | 154 | <input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit"> |
151 | 155 | </div> |