@@ -142,7 +142,7 @@ |
||
142 | 142 | foreach ($board['children'] as $child) |
143 | 143 | { |
144 | 144 | if (!$child['is_redirect']) |
145 | - $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>'; |
|
145 | + $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>'; |
|
146 | 146 | else |
147 | 147 | $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
148 | 148 |
@@ -67,8 +67,9 @@ discard block |
||
67 | 67 | foreach ($context['categories'] as $category) |
68 | 68 | { |
69 | 69 | // If theres no parent boards we can see, avoid showing an empty category (unless its collapsed) |
70 | - if (empty($category['boards']) && !$category['is_collapsed']) |
|
71 | - continue; |
|
70 | + if (empty($category['boards']) && !$category['is_collapsed']) { |
|
71 | + continue; |
|
72 | + } |
|
72 | 73 | |
73 | 74 | echo ' |
74 | 75 | <div class="main_container"> |
@@ -76,9 +77,10 @@ discard block |
||
76 | 77 | <h3 class="catbg">'; |
77 | 78 | |
78 | 79 | // If this category even can collapse, show a link to collapse it. |
79 | - if ($category['can_collapse']) |
|
80 | - echo ' |
|
80 | + if ($category['can_collapse']) { |
|
81 | + echo ' |
|
81 | 82 | <span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' floatright" data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'], '" style="display: none;"></span>'; |
83 | + } |
|
82 | 84 | |
83 | 85 | echo ' |
84 | 86 | ', $category['link'], ' |
@@ -105,17 +107,19 @@ discard block |
||
105 | 107 | </a>'; |
106 | 108 | |
107 | 109 | // Has it outstanding posts for approval? |
108 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
109 | - echo ' |
|
110 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
111 | + echo ' |
|
110 | 112 | <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>'; |
113 | + } |
|
111 | 114 | |
112 | 115 | echo ' |
113 | 116 | <p class="board_description">', $board['description'], '</p>'; |
114 | 117 | |
115 | 118 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
116 | - if (!empty($board['link_moderators'])) |
|
117 | - echo ' |
|
119 | + if (!empty($board['link_moderators'])) { |
|
120 | + echo ' |
|
118 | 121 | <p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
122 | + } |
|
119 | 123 | |
120 | 124 | // Show some basic information about the number of posts, etc. |
121 | 125 | echo ' |
@@ -127,9 +131,10 @@ discard block |
||
127 | 131 | </div> |
128 | 132 | <div class="lastpost ',!empty($board['last_post']['id']) ? 'lpr_border' : 'hidden', '">'; |
129 | 133 | |
130 | - if (!empty($board['last_post']['id'])) |
|
131 | - echo ' |
|
134 | + if (!empty($board['last_post']['id'])) { |
|
135 | + echo ' |
|
132 | 136 | <p>', $board['last_post']['last_post_message'], '</p>'; |
137 | + } |
|
133 | 138 | echo ' |
134 | 139 | </div>'; |
135 | 140 | // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...) |
@@ -141,14 +146,16 @@ discard block |
||
141 | 146 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
142 | 147 | foreach ($board['children'] as $child) |
143 | 148 | { |
144 | - if (!$child['is_redirect']) |
|
145 | - $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>'; |
|
146 | - else |
|
147 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
149 | + if (!$child['is_redirect']) { |
|
150 | + $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>'; |
|
151 | + } else { |
|
152 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
153 | + } |
|
148 | 154 | |
149 | 155 | // Has it posts awaiting approval? |
150 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) |
|
151 | - $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>'; |
|
156 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) { |
|
157 | + $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>'; |
|
158 | + } |
|
152 | 159 | |
153 | 160 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
154 | 161 | } |
@@ -172,10 +179,11 @@ discard block |
||
172 | 179 | </div>'; |
173 | 180 | |
174 | 181 | // Show the mark all as read button? |
175 | - if ($context['user']['is_logged'] && !empty($context['categories'])) |
|
176 | - echo ' |
|
182 | + if ($context['user']['is_logged'] && !empty($context['categories'])) { |
|
183 | + echo ' |
|
177 | 184 | <div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>'; |
178 | -} |
|
185 | + } |
|
186 | + } |
|
179 | 187 | |
180 | 188 | /** |
181 | 189 | * The lower part of the outer layer of the board index |
@@ -192,8 +200,9 @@ discard block |
||
192 | 200 | { |
193 | 201 | global $context, $options, $txt; |
194 | 202 | |
195 | - if (empty($context['info_center'])) |
|
196 | - return; |
|
203 | + if (empty($context['info_center'])) { |
|
204 | + return; |
|
205 | + } |
|
197 | 206 | |
198 | 207 | // Here's where the "Info Center" starts... |
199 | 208 | echo ' |
@@ -293,14 +302,15 @@ discard block |
||
293 | 302 | /* Each post in latest_posts has: |
294 | 303 | board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.), |
295 | 304 | subject, short_subject (shortened with...), time, link, and href. */ |
296 | - foreach ($context['latest_posts'] as $post) |
|
297 | - echo ' |
|
305 | + foreach ($context['latest_posts'] as $post) { |
|
306 | + echo ' |
|
298 | 307 | <tr class="windowbg"> |
299 | 308 | <td class="recentpost"><strong>', $post['link'], '</strong></td> |
300 | 309 | <td class="recentposter">', $post['poster']['link'], '</td> |
301 | 310 | <td class="recentboard">', $post['board']['link'], '</td> |
302 | 311 | <td class="recenttime">', $post['time'], '</td> |
303 | 312 | </tr>'; |
313 | + } |
|
304 | 314 | echo ' |
305 | 315 | </table>'; |
306 | 316 | } |
@@ -324,9 +334,10 @@ discard block |
||
324 | 334 | </div>'; |
325 | 335 | |
326 | 336 | // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P. |
327 | - if (!empty($context['calendar_holidays'])) |
|
328 | - echo ' |
|
337 | + if (!empty($context['calendar_holidays'])) { |
|
338 | + echo ' |
|
329 | 339 | <p class="inline holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), '</p>'; |
340 | + } |
|
330 | 341 | |
331 | 342 | // People's birthdays. Like mine. And yours, I guess. Kidding. |
332 | 343 | if (!empty($context['calendar_birthdays'])) |
@@ -335,9 +346,10 @@ discard block |
||
335 | 346 | <p class="inline"> |
336 | 347 | <span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>'; |
337 | 348 | // Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) |
338 | - foreach ($context['calendar_birthdays'] as $member) |
|
339 | - echo ' |
|
349 | + foreach ($context['calendar_birthdays'] as $member) { |
|
350 | + echo ' |
|
340 | 351 | <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', '; |
352 | + } |
|
341 | 353 | echo ' |
342 | 354 | </p>'; |
343 | 355 | } |
@@ -351,9 +363,10 @@ discard block |
||
351 | 363 | |
352 | 364 | // Each event in calendar_events should have: |
353 | 365 | // title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. |
354 | - foreach ($context['calendar_events'] as $event) |
|
355 | - echo ' |
|
366 | + foreach ($context['calendar_events'] as $event) { |
|
367 | + echo ' |
|
356 | 368 | ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><span class="generic_icons calendar_modify"></span></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br>' : ', '; |
369 | + } |
|
357 | 370 | echo ' |
358 | 371 | </p>'; |
359 | 372 | } |
@@ -398,15 +411,19 @@ discard block |
||
398 | 411 | |
399 | 412 | // Handle hidden users and buddies. |
400 | 413 | $bracketList = array(); |
401 | - if ($context['show_buddies']) |
|
402 | - $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
403 | - if (!empty($context['num_spiders'])) |
|
404 | - $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
405 | - if (!empty($context['num_users_hidden'])) |
|
406 | - $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
414 | + if ($context['show_buddies']) { |
|
415 | + $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
416 | + } |
|
417 | + if (!empty($context['num_spiders'])) { |
|
418 | + $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
419 | + } |
|
420 | + if (!empty($context['num_users_hidden'])) { |
|
421 | + $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
422 | + } |
|
407 | 423 | |
408 | - if (!empty($bracketList)) |
|
409 | - echo ' (' . implode(', ', $bracketList) . ')'; |
|
424 | + if (!empty($bracketList)) { |
|
425 | + echo ' (' . implode(', ', $bracketList) . ')'; |
|
426 | + } |
|
410 | 427 | |
411 | 428 | echo $context['show_who'] ? '</a>' : '', ' |
412 | 429 | |
@@ -420,9 +437,10 @@ discard block |
||
420 | 437 | ', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']); |
421 | 438 | |
422 | 439 | // Showing membergroups? |
423 | - if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) |
|
424 | - echo ' |
|
440 | + if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) { |
|
441 | + echo ' |
|
425 | 442 | <span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>'; |
443 | + } |
|
426 | 444 | } |
427 | 445 | |
428 | 446 | echo ' |
@@ -86,7 +86,7 @@ |
||
86 | 86 | foreach ($board['children'] as $child) |
87 | 87 | { |
88 | 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>'; |
|
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 | 90 | else |
91 | 91 | $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
92 | 92 |
@@ -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[]\');" class="input_check"></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'], '" class="input_check">'; |
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"> |