@@ -18,11 +18,12 @@ discard block |
||
| 18 | 18 | global $context, $settings, $options, $scripturl, $modSettings, $txt; |
| 19 | 19 | |
| 20 | 20 | // Let them know why their message became unapproved. |
| 21 | - if ($context['becomesUnapproved']) |
|
| 22 | - echo ' |
|
| 21 | + if ($context['becomesUnapproved']) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="noticebox"> |
| 24 | 24 | ', $txt['post_becomesUnapproved'], ' |
| 25 | 25 | </div>'; |
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) |
| 28 | 29 | { |
@@ -46,17 +47,19 @@ discard block |
||
| 46 | 47 | </a>'; |
| 47 | 48 | |
| 48 | 49 | // Has it outstanding posts for approval? |
| 49 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
| 50 | - echo ' |
|
| 50 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
| 51 | + echo ' |
|
| 51 | 52 | <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>'; |
| 53 | + } |
|
| 52 | 54 | |
| 53 | 55 | echo ' |
| 54 | 56 | <p class="board_description">', $board['description'], '</p>'; |
| 55 | 57 | |
| 56 | 58 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
| 57 | - if (!empty($board['moderators']) || !empty($board['moderator_groups'])) |
|
| 58 | - echo ' |
|
| 59 | + if (!empty($board['moderators']) || !empty($board['moderator_groups'])) { |
|
| 60 | + echo ' |
|
| 59 | 61 | <p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
| 62 | + } |
|
| 60 | 63 | |
| 61 | 64 | // Show some basic information about the number of posts, etc. |
| 62 | 65 | echo ' |
@@ -68,9 +71,10 @@ discard block |
||
| 68 | 71 | </div> |
| 69 | 72 | <div class="lastpost lpr_border">'; |
| 70 | 73 | |
| 71 | - if (!empty($board['last_post']['id'])) |
|
| 72 | - echo ' |
|
| 74 | + if (!empty($board['last_post']['id'])) { |
|
| 75 | + echo ' |
|
| 73 | 76 | <p>', $board['last_post']['last_post_message'], '</p>'; |
| 77 | + } |
|
| 74 | 78 | |
| 75 | 79 | echo ' |
| 76 | 80 | </div>'; |
@@ -84,14 +88,16 @@ discard block |
||
| 84 | 88 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
| 85 | 89 | foreach ($board['children'] as $child) |
| 86 | 90 | { |
| 87 | - if (!$child['is_redirect']) |
|
| 88 | - $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 | - else |
|
| 90 | - $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 | + } |
|
| 91 | 96 | |
| 92 | 97 | // Has it posts awaiting approval? |
| 93 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) |
|
| 94 | - $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 | + } |
|
| 95 | 101 | |
| 96 | 102 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
| 97 | 103 | } |
@@ -113,11 +119,12 @@ discard block |
||
| 113 | 119 | if (!$context['no_topic_listing']) |
| 114 | 120 | { |
| 115 | 121 | // Mobile action buttons (top) |
| 116 | - if (!empty($context['normal_buttons'])) |
|
| 117 | - echo ' |
|
| 122 | + if (!empty($context['normal_buttons'])) { |
|
| 123 | + echo ' |
|
| 118 | 124 | <div class="mobile_buttons floatright"> |
| 119 | 125 | <a class="button mobile_act">', $txt['mobile_action'], '</a> |
| 120 | 126 | </div>'; |
| 127 | + } |
|
| 121 | 128 | |
| 122 | 129 | echo ' |
| 123 | 130 | <div class="pagesection"> |
@@ -136,13 +143,15 @@ discard block |
||
| 136 | 143 | <h3>', $context['name'], '</h3> |
| 137 | 144 | <p>'; |
| 138 | 145 | |
| 139 | - if ($context['description'] != '') |
|
| 140 | - echo ' |
|
| 146 | + if ($context['description'] != '') { |
|
| 147 | + echo ' |
|
| 141 | 148 | ', $context['description']; |
| 149 | + } |
|
| 142 | 150 | |
| 143 | - if (!empty($context['moderators'])) |
|
| 144 | - echo ' |
|
| 151 | + if (!empty($context['moderators'])) { |
|
| 152 | + echo ' |
|
| 145 | 153 | ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.'; |
| 154 | + } |
|
| 146 | 155 | |
| 147 | 156 | echo ' |
| 148 | 157 | </p> |
@@ -150,9 +159,10 @@ discard block |
||
| 150 | 159 | } |
| 151 | 160 | |
| 152 | 161 | // If Quick Moderation is enabled start the form. |
| 153 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
| 154 | - echo ' |
|
| 162 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
| 163 | + echo ' |
|
| 155 | 164 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
| 165 | + } |
|
| 156 | 166 | |
| 157 | 167 | echo ' |
| 158 | 168 | <div id="messageindex">'; |
@@ -162,11 +172,11 @@ discard block |
||
| 162 | 172 | echo ' |
| 163 | 173 | <div class="information">'; |
| 164 | 174 | |
| 165 | - if ($settings['display_who_viewing'] == 1) |
|
| 166 | - echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
| 167 | - |
|
| 168 | - else |
|
| 169 | - 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 | + if ($settings['display_who_viewing'] == 1) { |
|
| 176 | + echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
| 177 | + } else { |
|
| 178 | + 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'] . ')'); |
|
| 179 | + } |
|
| 170 | 180 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board']; |
| 171 | 181 | |
| 172 | 182 | echo ' |
@@ -186,32 +196,36 @@ discard block |
||
| 186 | 196 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
| 187 | 197 | |
| 188 | 198 | // Show a "select all" box for quick moderation? |
| 189 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 190 | - echo ' |
|
| 199 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 200 | + echo ' |
|
| 191 | 201 | <div class="moderation"> |
| 192 | 202 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 193 | 203 | </div>'; |
| 204 | + } |
|
| 194 | 205 | |
| 195 | 206 | // If it's on in "image" mode, don't show anything but the column. |
| 196 | - elseif (!empty($context['can_quick_mod'])) |
|
| 197 | - echo ' |
|
| 207 | + elseif (!empty($context['can_quick_mod'])) { |
|
| 208 | + echo ' |
|
| 198 | 209 | <div class="moderation"></div>'; |
| 210 | + } |
|
| 199 | 211 | } |
| 200 | 212 | |
| 201 | 213 | // No topics... just say, "sorry bub". |
| 202 | - else |
|
| 203 | - echo ' |
|
| 214 | + else { |
|
| 215 | + echo ' |
|
| 204 | 216 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
| 217 | + } |
|
| 205 | 218 | |
| 206 | 219 | echo ' |
| 207 | 220 | </div><!-- #topic_header -->'; |
| 208 | 221 | |
| 209 | 222 | // If this person can approve items and we have some awaiting approval tell them. |
| 210 | - if (!empty($context['unapproved_posts_message'])) |
|
| 211 | - echo ' |
|
| 223 | + if (!empty($context['unapproved_posts_message'])) { |
|
| 224 | + echo ' |
|
| 212 | 225 | <div class="information"> |
| 213 | 226 | <span class="alert">!</span> ', $context['unapproved_posts_message'], ' |
| 214 | 227 | </div>'; |
| 228 | + } |
|
| 215 | 229 | |
| 216 | 230 | // Contain the topic list |
| 217 | 231 | echo ' |
@@ -232,25 +246,30 @@ discard block |
||
| 232 | 246 | echo ' |
| 233 | 247 | <div class="icons floatright">'; |
| 234 | 248 | |
| 235 | - if ($topic['is_watched']) |
|
| 236 | - echo ' |
|
| 249 | + if ($topic['is_watched']) { |
|
| 250 | + echo ' |
|
| 237 | 251 | <span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
| 252 | + } |
|
| 238 | 253 | |
| 239 | - if ($topic['is_locked']) |
|
| 240 | - echo ' |
|
| 254 | + if ($topic['is_locked']) { |
|
| 255 | + echo ' |
|
| 241 | 256 | <span class="generic_icons lock"></span>'; |
| 257 | + } |
|
| 242 | 258 | |
| 243 | - if ($topic['is_sticky']) |
|
| 244 | - echo ' |
|
| 259 | + if ($topic['is_sticky']) { |
|
| 260 | + echo ' |
|
| 245 | 261 | <span class="generic_icons sticky"></span>'; |
| 262 | + } |
|
| 246 | 263 | |
| 247 | - if ($topic['is_redirect']) |
|
| 248 | - echo ' |
|
| 264 | + if ($topic['is_redirect']) { |
|
| 265 | + echo ' |
|
| 249 | 266 | <span class="generic_icons move"></span>'; |
| 267 | + } |
|
| 250 | 268 | |
| 251 | - if ($topic['is_poll']) |
|
| 252 | - echo ' |
|
| 269 | + if ($topic['is_poll']) { |
|
| 270 | + echo ' |
|
| 253 | 271 | <span class="generic_icons poll"></span>'; |
| 272 | + } |
|
| 254 | 273 | |
| 255 | 274 | echo ' |
| 256 | 275 | </div>'; |
@@ -282,26 +301,31 @@ discard block |
||
| 282 | 301 | echo ' |
| 283 | 302 | <div class="moderation">'; |
| 284 | 303 | |
| 285 | - if ($options['display_quick_mod'] == 1) |
|
| 286 | - echo ' |
|
| 304 | + if ($options['display_quick_mod'] == 1) { |
|
| 305 | + echo ' |
|
| 287 | 306 | <input type="checkbox" name="topics[]" value="', $topic['id'], '">'; |
| 288 | - else |
|
| 307 | + } else |
|
| 289 | 308 | { |
| 290 | 309 | // Check permissions on each and show only the ones they are allowed to use. |
| 291 | - if ($topic['quick_mod']['remove']) |
|
| 292 | - 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>'; |
|
| 310 | + if ($topic['quick_mod']['remove']) { |
|
| 311 | + 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>'; |
|
| 312 | + } |
|
| 293 | 313 | |
| 294 | - if ($topic['quick_mod']['lock']) |
|
| 295 | - 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>'; |
|
| 314 | + if ($topic['quick_mod']['lock']) { |
|
| 315 | + 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>'; |
|
| 316 | + } |
|
| 296 | 317 | |
| 297 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
| 298 | - echo '<br>'; |
|
| 318 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
| 319 | + echo '<br>'; |
|
| 320 | + } |
|
| 299 | 321 | |
| 300 | - if ($topic['quick_mod']['sticky']) |
|
| 301 | - 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>'; |
|
| 322 | + if ($topic['quick_mod']['sticky']) { |
|
| 323 | + 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>'; |
|
| 324 | + } |
|
| 302 | 325 | |
| 303 | - if ($topic['quick_mod']['move']) |
|
| 304 | - 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>'; |
|
| 326 | + if ($topic['quick_mod']['move']) { |
|
| 327 | + 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>'; |
|
| 328 | + } |
|
| 305 | 329 | } |
| 306 | 330 | echo ' |
| 307 | 331 | </div><!-- .moderation -->'; |
@@ -319,18 +343,20 @@ discard block |
||
| 319 | 343 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
| 320 | 344 | <option value="">--------</option>'; |
| 321 | 345 | |
| 322 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
| 323 | - if ($context['can_' . $qmod_action]) |
|
| 346 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
| 347 | + if ($context['can_' . $qmod_action]) |
|
| 324 | 348 | echo ' |
| 325 | 349 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
| 350 | + } |
|
| 326 | 351 | |
| 327 | 352 | echo ' |
| 328 | 353 | </select>'; |
| 329 | 354 | |
| 330 | 355 | // Show a list of boards they can move the topic to. |
| 331 | - if ($context['can_move']) |
|
| 332 | - echo ' |
|
| 356 | + if ($context['can_move']) { |
|
| 357 | + echo ' |
|
| 333 | 358 | <span id="quick_mod_jump_to"></span>'; |
| 359 | + } |
|
| 334 | 360 | |
| 335 | 361 | echo ' |
| 336 | 362 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button qaction"> |
@@ -341,17 +367,19 @@ discard block |
||
| 341 | 367 | </div><!-- #messageindex -->'; |
| 342 | 368 | |
| 343 | 369 | // Finish off the form - again. |
| 344 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
| 345 | - echo ' |
|
| 370 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
| 371 | + echo ' |
|
| 346 | 372 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
| 347 | 373 | </form>'; |
| 374 | + } |
|
| 348 | 375 | |
| 349 | 376 | // Mobile action buttons (bottom) |
| 350 | - if (!empty($context['normal_buttons'])) |
|
| 351 | - echo ' |
|
| 377 | + if (!empty($context['normal_buttons'])) { |
|
| 378 | + echo ' |
|
| 352 | 379 | <div class="mobile_buttons floatright"> |
| 353 | 380 | <a class="button mobile_act">', $txt['mobile_action'], '</a> |
| 354 | 381 | </div>'; |
| 382 | + } |
|
| 355 | 383 | |
| 356 | 384 | echo ' |
| 357 | 385 | <div class="pagesection"> |
@@ -367,8 +395,8 @@ discard block |
||
| 367 | 395 | // Show breadcrumbs at the bottom too. |
| 368 | 396 | theme_linktree(); |
| 369 | 397 | |
| 370 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
| 371 | - echo ' |
|
| 398 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
| 399 | + echo ' |
|
| 372 | 400 | <script> |
| 373 | 401 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 374 | 402 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -387,6 +415,7 @@ discard block |
||
| 387 | 415 | sCustomName: "move_to" |
| 388 | 416 | }); |
| 389 | 417 | </script>'; |
| 418 | + } |
|
| 390 | 419 | |
| 391 | 420 | // Javascript for inline editing. |
| 392 | 421 | echo ' |
@@ -423,8 +452,8 @@ discard block |
||
| 423 | 452 | <div class="information"> |
| 424 | 453 | <p class="floatright" id="message_index_jump_to"></p>'; |
| 425 | 454 | |
| 426 | - if (empty($context['no_topic_listing'])) |
|
| 427 | - echo ' |
|
| 455 | + if (empty($context['no_topic_listing'])) { |
|
| 456 | + echo ' |
|
| 428 | 457 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
| 429 | 458 | <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', ' |
| 430 | 459 | '. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br> |
@@ -434,9 +463,10 @@ discard block |
||
| 434 | 463 | <span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br> |
| 435 | 464 | <span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br> |
| 436 | 465 | </p>'; |
| 466 | + } |
|
| 437 | 467 | |
| 438 | - if (!empty($context['jump_to'])) |
|
| 439 | - echo ' |
|
| 468 | + if (!empty($context['jump_to'])) { |
|
| 469 | + echo ' |
|
| 440 | 470 | <script> |
| 441 | 471 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 442 | 472 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -452,6 +482,7 @@ discard block |
||
| 452 | 482 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
| 453 | 483 | }); |
| 454 | 484 | </script>'; |
| 485 | + } |
|
| 455 | 486 | |
| 456 | 487 | echo ' |
| 457 | 488 | <br class="clear"> |
@@ -18,18 +18,20 @@ discard block |
||
| 18 | 18 | global $context, $settings, $options, $txt, $scripturl, $modSettings; |
| 19 | 19 | |
| 20 | 20 | // Let them know, if their report was a success! |
| 21 | - if ($context['report_sent']) |
|
| 22 | - echo ' |
|
| 21 | + if ($context['report_sent']) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="infobox"> |
| 24 | 24 | ', $txt['report_sent'], ' |
| 25 | 25 | </div>'; |
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | // Let them know why their message became unapproved. |
| 28 | - if ($context['becomesUnapproved']) |
|
| 29 | - echo ' |
|
| 29 | + if ($context['becomesUnapproved']) { |
|
| 30 | + echo ' |
|
| 30 | 31 | <div class="noticebox"> |
| 31 | 32 | ', $txt['post_becomesUnapproved'], ' |
| 32 | 33 | </div>'; |
| 34 | + } |
|
| 33 | 35 | |
| 34 | 36 | // Show new topic info here? |
| 35 | 37 | echo ' |
@@ -49,11 +51,13 @@ discard block |
||
| 49 | 51 | <p>'; |
| 50 | 52 | |
| 51 | 53 | // Show just numbers...? |
| 52 | - if ($settings['display_who_viewing'] == 1) |
|
| 53 | - 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 | + } |
|
| 54 | 57 | // Or show the actual people viewing the topic? |
| 55 | - else |
|
| 56 | - 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 | + } |
|
| 57 | 61 | |
| 58 | 62 | // Now show how many guests are here too. |
| 59 | 63 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' |
@@ -91,10 +95,11 @@ discard block |
||
| 91 | 95 | <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> |
| 92 | 96 | <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; |
| 93 | 97 | |
| 94 | - if ($context['allow_results_view']) |
|
| 95 | - echo ' |
|
| 98 | + if ($context['allow_results_view']) { |
|
| 99 | + echo ' |
|
| 96 | 100 | ', $option['bar_ndt'], ' |
| 97 | 101 | <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; |
| 102 | + } |
|
| 98 | 103 | |
| 99 | 104 | echo ' |
| 100 | 105 | </dd>'; |
@@ -103,9 +108,10 @@ discard block |
||
| 103 | 108 | echo ' |
| 104 | 109 | </dl>'; |
| 105 | 110 | |
| 106 | - if ($context['allow_results_view']) |
|
| 107 | - echo ' |
|
| 111 | + if ($context['allow_results_view']) { |
|
| 112 | + echo ' |
|
| 108 | 113 | <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; |
| 114 | + } |
|
| 109 | 115 | } |
| 110 | 116 | // They are allowed to vote! Go to it! |
| 111 | 117 | else |
@@ -114,17 +120,19 @@ discard block |
||
| 114 | 120 | <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; |
| 115 | 121 | |
| 116 | 122 | // Show a warning if they are allowed more than one option. |
| 117 | - if ($context['poll']['allowed_warning']) |
|
| 118 | - echo ' |
|
| 123 | + if ($context['poll']['allowed_warning']) { |
|
| 124 | + echo ' |
|
| 119 | 125 | <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; |
| 126 | + } |
|
| 120 | 127 | |
| 121 | 128 | echo ' |
| 122 | 129 | <ul class="options">'; |
| 123 | 130 | |
| 124 | 131 | // Show each option with its button - a radio likely. |
| 125 | - foreach ($context['poll']['options'] as $option) |
|
| 126 | - echo ' |
|
| 132 | + foreach ($context['poll']['options'] as $option) { |
|
| 133 | + echo ' |
|
| 127 | 134 | <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; |
| 135 | + } |
|
| 128 | 136 | |
| 129 | 137 | echo ' |
| 130 | 138 | </ul> |
@@ -136,9 +144,10 @@ discard block |
||
| 136 | 144 | } |
| 137 | 145 | |
| 138 | 146 | // Is the clock ticking? |
| 139 | - if (!empty($context['poll']['expire_time'])) |
|
| 140 | - echo ' |
|
| 147 | + if (!empty($context['poll']['expire_time'])) { |
|
| 148 | + echo ' |
|
| 141 | 149 | <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>'; |
| 150 | + } |
|
| 142 | 151 | |
| 143 | 152 | echo ' |
| 144 | 153 | </div><!-- #poll_options --> |
@@ -168,11 +177,13 @@ discard block |
||
| 168 | 177 | <li> |
| 169 | 178 | <strong class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></strong>'; |
| 170 | 179 | |
| 171 | - if ($event['can_edit']) |
|
| 172 | - 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 | + } |
|
| 173 | 183 | |
| 174 | - if ($event['can_export']) |
|
| 175 | - 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 | + } |
|
| 176 | 187 | |
| 177 | 188 | echo ' |
| 178 | 189 | <br>'; |
@@ -180,14 +191,14 @@ discard block |
||
| 180 | 191 | if (!empty($event['allday'])) |
| 181 | 192 | { |
| 182 | 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>' : ''; |
| 183 | - } |
|
| 184 | - else |
|
| 194 | + } else |
|
| 185 | 195 | { |
| 186 | 196 | // Display event info relative to user's local timezone |
| 187 | 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'] . '">'; |
| 188 | 198 | |
| 189 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
| 190 | - echo trim($event['end_date_local']) . ', '; |
|
| 199 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
| 200 | + echo trim($event['end_date_local']) . ', '; |
|
| 201 | + } |
|
| 191 | 202 | |
| 192 | 203 | echo trim($event['end_time_local']); |
| 193 | 204 | |
@@ -196,24 +207,28 @@ discard block |
||
| 196 | 207 | { |
| 197 | 208 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
| 198 | 209 | |
| 199 | - 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']) |
|
| 200 | - 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 | + } |
|
| 201 | 213 | |
| 202 | 214 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 203 | 215 | |
| 204 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
| 205 | - echo trim($event['end_date_orig']) . ', '; |
|
| 216 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
| 217 | + echo trim($event['end_date_orig']) . ', '; |
|
| 218 | + } |
|
| 206 | 219 | |
| 207 | 220 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
| 208 | 221 | } |
| 209 | 222 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
| 210 | - else |
|
| 211 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 223 | + else { |
|
| 224 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 225 | + } |
|
| 212 | 226 | } |
| 213 | 227 | |
| 214 | - if (!empty($event['location'])) |
|
| 215 | - echo ' |
|
| 228 | + if (!empty($event['location'])) { |
|
| 229 | + echo ' |
|
| 216 | 230 | <br>', $event['location']; |
| 231 | + } |
|
| 217 | 232 | |
| 218 | 233 | echo ' |
| 219 | 234 | </li>'; |
@@ -235,12 +250,13 @@ discard block |
||
| 235 | 250 | </div>'; |
| 236 | 251 | |
| 237 | 252 | // Mobile action - moderation buttons (top) |
| 238 | - if (!empty($context['normal_buttons'])) |
|
| 239 | - echo ' |
|
| 253 | + if (!empty($context['normal_buttons'])) { |
|
| 254 | + echo ' |
|
| 240 | 255 | <div class="mobile_buttons floatright"> |
| 241 | 256 | <a class="button mobile_act">', $txt['mobile_action'], '</a> |
| 242 | 257 | ', !empty($context['mod_buttons']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', ' |
| 243 | 258 | </div>'; |
| 259 | + } |
|
| 244 | 260 | |
| 245 | 261 | // Show the topic information - icon, subject, etc. |
| 246 | 262 | echo ' |
@@ -251,20 +267,22 @@ discard block |
||
| 251 | 267 | $context['removableMessageIDs'] = array(); |
| 252 | 268 | |
| 253 | 269 | // Get all the messages... |
| 254 | - while ($message = $context['get_message']()) |
|
| 255 | - template_single_post($message); |
|
| 270 | + while ($message = $context['get_message']()) { |
|
| 271 | + template_single_post($message); |
|
| 272 | + } |
|
| 256 | 273 | |
| 257 | 274 | echo ' |
| 258 | 275 | </form> |
| 259 | 276 | </div><!-- #forumposts -->'; |
| 260 | 277 | |
| 261 | 278 | // Mobile action - moderation buttons (bottom) |
| 262 | - if (!empty($context['normal_buttons'])) |
|
| 263 | - echo ' |
|
| 279 | + if (!empty($context['normal_buttons'])) { |
|
| 280 | + echo ' |
|
| 264 | 281 | <div class="mobile_buttons floatright"> |
| 265 | 282 | <a class="button mobile_act">', $txt['mobile_action'], '</a> |
| 266 | 283 | ', !empty($context['mod_buttons']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', ' |
| 267 | 284 | </div>'; |
| 285 | + } |
|
| 268 | 286 | |
| 269 | 287 | // Show the page index... "Pages: [1]". |
| 270 | 288 | echo ' |
@@ -291,8 +309,9 @@ discard block |
||
| 291 | 309 | <div id="display_jump_to"></div>'; |
| 292 | 310 | |
| 293 | 311 | // Show quickreply |
| 294 | - if ($context['can_reply']) |
|
| 295 | - template_quickreply(); |
|
| 312 | + if ($context['can_reply']) { |
|
| 313 | + template_quickreply(); |
|
| 314 | + } |
|
| 296 | 315 | |
| 297 | 316 | // User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device. |
| 298 | 317 | echo ' |
@@ -307,8 +326,8 @@ discard block |
||
| 307 | 326 | </div>'; |
| 308 | 327 | |
| 309 | 328 | // Show the moderation button & pop (if there is anything to show) |
| 310 | - if (!empty($context['mod_buttons'])) |
|
| 311 | - echo ' |
|
| 329 | + if (!empty($context['mod_buttons'])) { |
|
| 330 | + echo ' |
|
| 312 | 331 | <div id="mobile_moderation" class="popup_container"> |
| 313 | 332 | <div class="popup_window description"> |
| 314 | 333 | <div class="popup_heading"> |
@@ -320,6 +339,7 @@ discard block |
||
| 320 | 339 | </div> |
| 321 | 340 | </div> |
| 322 | 341 | </div>'; |
| 342 | + } |
|
| 323 | 343 | |
| 324 | 344 | echo ' |
| 325 | 345 | <script>'; |
@@ -443,9 +463,10 @@ discard block |
||
| 443 | 463 | }); |
| 444 | 464 | }'; |
| 445 | 465 | |
| 446 | - if (!empty($context['ignoredMsgs'])) |
|
| 447 | - echo ' |
|
| 466 | + if (!empty($context['ignoredMsgs'])) { |
|
| 467 | + echo ' |
|
| 448 | 468 | ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; |
| 469 | + } |
|
| 449 | 470 | |
| 450 | 471 | echo ' |
| 451 | 472 | </script>'; |
@@ -462,8 +483,9 @@ discard block |
||
| 462 | 483 | |
| 463 | 484 | $ignoring = false; |
| 464 | 485 | |
| 465 | - if ($message['can_remove']) |
|
| 466 | - $context['removableMessageIDs'][] = $message['id']; |
|
| 486 | + if ($message['can_remove']) { |
|
| 487 | + $context['removableMessageIDs'][] = $message['id']; |
|
| 488 | + } |
|
| 467 | 489 | |
| 468 | 490 | // Are we ignoring this message? |
| 469 | 491 | if (!empty($message['is_ignored'])) |
@@ -490,9 +512,10 @@ discard block |
||
| 490 | 512 | <div class="custom_fields_above_member"> |
| 491 | 513 | <ul class="nolist">'; |
| 492 | 514 | |
| 493 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
| 494 | - echo ' |
|
| 515 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
| 516 | + echo ' |
|
| 495 | 517 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 518 | + } |
|
| 496 | 519 | |
| 497 | 520 | echo ' |
| 498 | 521 | </ul> |
@@ -503,25 +526,28 @@ discard block |
||
| 503 | 526 | <h4>'; |
| 504 | 527 | |
| 505 | 528 | // Show online and offline buttons? |
| 506 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
| 507 | - echo ' |
|
| 529 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
| 530 | + echo ' |
|
| 508 | 531 | ', $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>' : ''; |
| 532 | + } |
|
| 509 | 533 | |
| 510 | 534 | // Custom fields BEFORE the username? |
| 511 | - if (!empty($message['custom_fields']['before_member'])) |
|
| 512 | - foreach ($message['custom_fields']['before_member'] as $custom) |
|
| 535 | + if (!empty($message['custom_fields']['before_member'])) { |
|
| 536 | + foreach ($message['custom_fields']['before_member'] as $custom) |
|
| 513 | 537 | echo ' |
| 514 | 538 | <span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>'; |
| 539 | + } |
|
| 515 | 540 | |
| 516 | 541 | // Show a link to the member's profile. |
| 517 | 542 | echo ' |
| 518 | 543 | ', $message['member']['link']; |
| 519 | 544 | |
| 520 | 545 | // Custom fields AFTER the username? |
| 521 | - if (!empty($message['custom_fields']['after_member'])) |
|
| 522 | - foreach ($message['custom_fields']['after_member'] as $custom) |
|
| 546 | + if (!empty($message['custom_fields']['after_member'])) { |
|
| 547 | + foreach ($message['custom_fields']['after_member'] as $custom) |
|
| 523 | 548 | echo ' |
| 524 | 549 | <span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>'; |
| 550 | + } |
|
| 525 | 551 | |
| 526 | 552 | // Begin display of user info |
| 527 | 553 | echo ' |
@@ -529,50 +555,58 @@ discard block |
||
| 529 | 555 | <ul class="user_info">'; |
| 530 | 556 | |
| 531 | 557 | // Show the user's avatar. |
| 532 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
| 533 | - echo ' |
|
| 558 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
| 559 | + echo ' |
|
| 534 | 560 | <li class="avatar"> |
| 535 | 561 | <a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a> |
| 536 | 562 | </li>'; |
| 563 | + } |
|
| 537 | 564 | |
| 538 | 565 | // Are there any custom fields below the avatar? |
| 539 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
| 540 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 566 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
| 567 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 541 | 568 | echo ' |
| 542 | 569 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 570 | + } |
|
| 543 | 571 | |
| 544 | 572 | // Show the post group icons, but not for guests. |
| 545 | - if (!$message['member']['is_guest']) |
|
| 546 | - echo ' |
|
| 573 | + if (!$message['member']['is_guest']) { |
|
| 574 | + echo ' |
|
| 547 | 575 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
| 576 | + } |
|
| 548 | 577 | |
| 549 | 578 | // Show the member's primary group (like 'Administrator') if they have one. |
| 550 | - if (!empty($message['member']['group'])) |
|
| 551 | - echo ' |
|
| 579 | + if (!empty($message['member']['group'])) { |
|
| 580 | + echo ' |
|
| 552 | 581 | <li class="membergroup">', $message['member']['group'], '</li>'; |
| 582 | + } |
|
| 553 | 583 | |
| 554 | 584 | // Show the member's custom title, if they have one. |
| 555 | - if (!empty($message['member']['title'])) |
|
| 556 | - echo ' |
|
| 585 | + if (!empty($message['member']['title'])) { |
|
| 586 | + echo ' |
|
| 557 | 587 | <li class="title">', $message['member']['title'], '</li>'; |
| 588 | + } |
|
| 558 | 589 | |
| 559 | 590 | // Don't show these things for guests. |
| 560 | 591 | if (!$message['member']['is_guest']) |
| 561 | 592 | { |
| 562 | 593 | // 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. |
| 563 | - if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) |
|
| 564 | - echo ' |
|
| 594 | + if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) { |
|
| 595 | + echo ' |
|
| 565 | 596 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
| 597 | + } |
|
| 566 | 598 | |
| 567 | 599 | // Show how many posts they have made. |
| 568 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 569 | - echo ' |
|
| 600 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 601 | + echo ' |
|
| 570 | 602 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
| 603 | + } |
|
| 571 | 604 | |
| 572 | 605 | // Show their personal text? |
| 573 | - if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) |
|
| 574 | - echo ' |
|
| 606 | + if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) { |
|
| 607 | + echo ' |
|
| 575 | 608 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
| 609 | + } |
|
| 576 | 610 | |
| 577 | 611 | // Any custom fields to show as icons? |
| 578 | 612 | if (!empty($message['custom_fields']['icons'])) |
@@ -581,9 +615,10 @@ discard block |
||
| 581 | 615 | <li class="im_icons"> |
| 582 | 616 | <ol>'; |
| 583 | 617 | |
| 584 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
| 585 | - echo ' |
|
| 618 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
| 619 | + echo ' |
|
| 586 | 620 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 621 | + } |
|
| 587 | 622 | |
| 588 | 623 | echo ' |
| 589 | 624 | </ol> |
@@ -598,19 +633,22 @@ discard block |
||
| 598 | 633 | <ol class="profile_icons">'; |
| 599 | 634 | |
| 600 | 635 | // Don't show an icon if they haven't specified a website. |
| 601 | - if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) |
|
| 602 | - echo ' |
|
| 636 | + if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) { |
|
| 637 | + echo ' |
|
| 603 | 638 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" rel="noopener">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
| 639 | + } |
|
| 604 | 640 | |
| 605 | 641 | // Since we know this person isn't a guest, you *can* message them. |
| 606 | - if ($context['can_send_pm']) |
|
| 607 | - echo ' |
|
| 642 | + if ($context['can_send_pm']) { |
|
| 643 | + echo ' |
|
| 608 | 644 | <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>'; |
| 645 | + } |
|
| 609 | 646 | |
| 610 | 647 | // Show the email if necessary |
| 611 | - if (!empty($message['member']['email']) && $message['member']['show_email']) |
|
| 612 | - echo ' |
|
| 648 | + if (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
| 649 | + echo ' |
|
| 613 | 650 | <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>'; |
| 651 | + } |
|
| 614 | 652 | |
| 615 | 653 | echo ' |
| 616 | 654 | </ol> |
@@ -618,57 +656,65 @@ discard block |
||
| 618 | 656 | } |
| 619 | 657 | |
| 620 | 658 | // Any custom fields for standard placement? |
| 621 | - if (!empty($message['custom_fields']['standard'])) |
|
| 622 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
| 659 | + if (!empty($message['custom_fields']['standard'])) { |
|
| 660 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
| 623 | 661 | echo ' |
| 624 | 662 | <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
| 663 | + } |
|
| 625 | 664 | } |
| 626 | 665 | // Otherwise, show the guest's email. |
| 627 | - elseif (!empty($message['member']['email']) && $message['member']['show_email']) |
|
| 628 | - echo ' |
|
| 666 | + elseif (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
| 667 | + echo ' |
|
| 629 | 668 | <li class="email"> |
| 630 | 669 | <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> |
| 631 | 670 | </li>'; |
| 671 | + } |
|
| 632 | 672 | |
| 633 | 673 | // Show the IP to this user for this post - because you can moderate? |
| 634 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
| 635 | - echo ' |
|
| 674 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
| 675 | + echo ' |
|
| 636 | 676 | <li class="poster_ip"> |
| 637 | 677 | <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> |
| 638 | 678 | </li>'; |
| 679 | + } |
|
| 639 | 680 | |
| 640 | 681 | // Or, should we show it because this is you? |
| 641 | - elseif ($message['can_see_ip']) |
|
| 642 | - echo ' |
|
| 682 | + elseif ($message['can_see_ip']) { |
|
| 683 | + echo ' |
|
| 643 | 684 | <li class="poster_ip"> |
| 644 | 685 | <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a> |
| 645 | 686 | </li>'; |
| 687 | + } |
|
| 646 | 688 | |
| 647 | 689 | // Okay, are you at least logged in? Then we can show something about why IPs are logged... |
| 648 | - elseif (!$context['user']['is_guest']) |
|
| 649 | - echo ' |
|
| 690 | + elseif (!$context['user']['is_guest']) { |
|
| 691 | + echo ' |
|
| 650 | 692 | <li class="poster_ip"> |
| 651 | 693 | <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a> |
| 652 | 694 | </li>'; |
| 695 | + } |
|
| 653 | 696 | |
| 654 | 697 | // Otherwise, you see NOTHING! |
| 655 | - else |
|
| 656 | - echo ' |
|
| 698 | + else { |
|
| 699 | + echo ' |
|
| 657 | 700 | <li class="poster_ip">', $txt['logged'], '</li>'; |
| 701 | + } |
|
| 658 | 702 | |
| 659 | 703 | // Are we showing the warning status? |
| 660 | 704 | // Don't show these things for guests. |
| 661 | - if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) |
|
| 662 | - echo ' |
|
| 705 | + if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) { |
|
| 706 | + echo ' |
|
| 663 | 707 | <li class="warning"> |
| 664 | 708 | ', $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> |
| 665 | 709 | </li>'; |
| 710 | + } |
|
| 666 | 711 | |
| 667 | 712 | // Are there any custom fields to show at the bottom of the poster info? |
| 668 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
| 669 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 713 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
| 714 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 670 | 715 | echo ' |
| 671 | 716 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 717 | + } |
|
| 672 | 718 | |
| 673 | 719 | // Poster info ends. |
| 674 | 720 | echo ' |
@@ -698,9 +744,10 @@ discard block |
||
| 698 | 744 | echo ' |
| 699 | 745 | <span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '','" id="modified_', $message['id'], '">'; |
| 700 | 746 | |
| 701 | - if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
|
| 702 | - echo |
|
| 747 | + if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) { |
|
| 748 | + echo |
|
| 703 | 749 | $message['modified']['last_edit_text']; |
| 750 | + } |
|
| 704 | 751 | |
| 705 | 752 | echo ' |
| 706 | 753 | </span> |
@@ -709,22 +756,24 @@ discard block |
||
| 709 | 756 | </div><!-- .keyinfo -->'; |
| 710 | 757 | |
| 711 | 758 | // Ignoring this user? Hide the post. |
| 712 | - if ($ignoring) |
|
| 713 | - echo ' |
|
| 759 | + if ($ignoring) { |
|
| 760 | + echo ' |
|
| 714 | 761 | <div id="msg_', $message['id'], '_ignored_prompt"> |
| 715 | 762 | ', $txt['ignoring_user'], ' |
| 716 | 763 | <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
| 717 | 764 | </div>'; |
| 765 | + } |
|
| 718 | 766 | |
| 719 | 767 | // Show the post itself, finally! |
| 720 | 768 | echo ' |
| 721 | 769 | <div class="post">'; |
| 722 | 770 | |
| 723 | - if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) |
|
| 724 | - echo ' |
|
| 771 | + if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { |
|
| 772 | + echo ' |
|
| 725 | 773 | <div class="approve_post"> |
| 726 | 774 | ', $txt['post_awaiting_approval'], ' |
| 727 | 775 | </div>'; |
| 776 | + } |
|
| 728 | 777 | echo ' |
| 729 | 778 | <div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '> |
| 730 | 779 | ', $message['body'], ' |
@@ -743,9 +792,9 @@ discard block |
||
| 743 | 792 | foreach ($message['attachment'] as $attachment) |
| 744 | 793 | { |
| 745 | 794 | // Do we want this attachment to not be showed here? |
| 746 | - if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) |
|
| 747 | - continue; |
|
| 748 | - elseif (!$div_output) |
|
| 795 | + if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) { |
|
| 796 | + continue; |
|
| 797 | + } elseif (!$div_output) |
|
| 749 | 798 | { |
| 750 | 799 | $div_output = true; |
| 751 | 800 | |
@@ -762,9 +811,10 @@ discard block |
||
| 762 | 811 | <legend> |
| 763 | 812 | ', $txt['attach_awaiting_approve']; |
| 764 | 813 | |
| 765 | - if ($context['can_approve']) |
|
| 766 | - echo ' |
|
| 814 | + if ($context['can_approve']) { |
|
| 815 | + echo ' |
|
| 767 | 816 | [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; |
| 817 | + } |
|
| 768 | 818 | |
| 769 | 819 | echo ' |
| 770 | 820 | </legend>'; |
@@ -778,12 +828,13 @@ discard block |
||
| 778 | 828 | echo ' |
| 779 | 829 | <div class="attachments_top">'; |
| 780 | 830 | |
| 781 | - if ($attachment['thumbnail']['has_thumb']) |
|
| 782 | - echo ' |
|
| 831 | + if ($attachment['thumbnail']['has_thumb']) { |
|
| 832 | + echo ' |
|
| 783 | 833 | <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>'; |
| 784 | - else |
|
| 785 | - echo ' |
|
| 834 | + } else { |
|
| 835 | + echo ' |
|
| 786 | 836 | <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">'; |
| 837 | + } |
|
| 787 | 838 | |
| 788 | 839 | echo ' |
| 789 | 840 | </div><!-- .attachments_top -->'; |
@@ -793,9 +844,10 @@ discard block |
||
| 793 | 844 | <div class="attachments_bot"> |
| 794 | 845 | <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*"> ' . $attachment['name'] . '</a> '; |
| 795 | 846 | |
| 796 | - if (!$attachment['is_approved'] && $context['can_approve']) |
|
| 797 | - echo ' |
|
| 847 | + if (!$attachment['is_approved'] && $context['can_approve']) { |
|
| 848 | + echo ' |
|
| 798 | 849 | [<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>] '; |
| 850 | + } |
|
| 799 | 851 | echo ' |
| 800 | 852 | <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'])), ' |
| 801 | 853 | </div><!-- .attachments_bot -->'; |
@@ -804,35 +856,40 @@ discard block |
||
| 804 | 856 | </div><!-- .attached -->'; |
| 805 | 857 | |
| 806 | 858 | // Next attachment line ? |
| 807 | - if (++$i % $attachments_per_line === 0) |
|
| 808 | - echo ' |
|
| 859 | + if (++$i % $attachments_per_line === 0) { |
|
| 860 | + echo ' |
|
| 809 | 861 | <br>'; |
| 862 | + } |
|
| 810 | 863 | } |
| 811 | 864 | |
| 812 | 865 | // If we had unapproved attachments clean up. |
| 813 | - if ($last_approved_state == 0) |
|
| 814 | - echo ' |
|
| 866 | + if ($last_approved_state == 0) { |
|
| 867 | + echo ' |
|
| 815 | 868 | </fieldset>'; |
| 869 | + } |
|
| 816 | 870 | |
| 817 | 871 | // Only do this if we output a div above - otherwise it'll break things |
| 818 | - if ($div_output) |
|
| 819 | - echo ' |
|
| 872 | + if ($div_output) { |
|
| 873 | + echo ' |
|
| 820 | 874 | </div><!-- #msg_[id]_footer -->'; |
| 875 | + } |
|
| 821 | 876 | } |
| 822 | 877 | |
| 823 | 878 | // And stuff below the attachments. |
| 824 | - if ($context['can_report_moderator'] || !empty($modSettings['enable_likes']) || $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']) |
|
| 825 | - echo ' |
|
| 879 | + if ($context['can_report_moderator'] || !empty($modSettings['enable_likes']) || $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']) { |
|
| 880 | + echo ' |
|
| 826 | 881 | <div class="under_message">'; |
| 882 | + } |
|
| 827 | 883 | |
| 828 | 884 | // Maybe they want to report this post to the moderator(s)? |
| 829 | - if ($context['can_report_moderator']) |
|
| 830 | - echo ' |
|
| 885 | + if ($context['can_report_moderator']) { |
|
| 886 | + echo ' |
|
| 831 | 887 | <ul class="floatright smalltext"> |
| 832 | 888 | <li class="report_link"> |
| 833 | 889 | <a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a> |
| 834 | 890 | </li> |
| 835 | 891 | </ul>'; |
| 892 | + } |
|
| 836 | 893 | |
| 837 | 894 | // What about likes? |
| 838 | 895 | if (!empty($modSettings['enable_likes'])) |
@@ -879,83 +936,95 @@ discard block |
||
| 879 | 936 | <ul class="quickbuttons">'; |
| 880 | 937 | |
| 881 | 938 | // Can they quote? if so they can select and quote as well! |
| 882 | - if ($context['can_quote']) |
|
| 883 | - echo ' |
|
| 939 | + if ($context['can_quote']) { |
|
| 940 | + echo ' |
|
| 884 | 941 | <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> |
| 885 | 942 | <li style="display:none;" id="quoteSelected_', $message['id'], '"> |
| 886 | 943 | <a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a> |
| 887 | 944 | </li>'; |
| 945 | + } |
|
| 888 | 946 | |
| 889 | 947 | // Can the user modify the contents of this post? Show the modify inline image. |
| 890 | - if ($message['can_modify']) |
|
| 891 | - echo ' |
|
| 948 | + if ($message['can_modify']) { |
|
| 949 | + echo ' |
|
| 892 | 950 | <li class="quick_edit"> |
| 893 | 951 | <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> |
| 894 | 952 | </li>'; |
| 953 | + } |
|
| 895 | 954 | |
| 896 | - if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
| 897 | - echo ' |
|
| 955 | + if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
| 956 | + echo ' |
|
| 898 | 957 | <li class="post_options">', $txt['post_options']; |
| 958 | + } |
|
| 899 | 959 | |
| 900 | 960 | echo ' |
| 901 | 961 | <ul>'; |
| 902 | 962 | |
| 903 | 963 | // Can the user modify the contents of this post? |
| 904 | - if ($message['can_modify']) |
|
| 905 | - echo ' |
|
| 964 | + if ($message['can_modify']) { |
|
| 965 | + echo ' |
|
| 906 | 966 | <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>'; |
| 967 | + } |
|
| 907 | 968 | |
| 908 | 969 | // How about... even... remove it entirely?! |
| 909 | - if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) |
|
| 910 | - echo ' |
|
| 970 | + if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) { |
|
| 971 | + echo ' |
|
| 911 | 972 | <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>'; |
| 912 | - |
|
| 913 | - elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) |
|
| 914 | - echo ' |
|
| 973 | + } elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) { |
|
| 974 | + echo ' |
|
| 915 | 975 | <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>'; |
| 976 | + } |
|
| 916 | 977 | |
| 917 | 978 | // What about splitting it off the rest of the topic? |
| 918 | - if ($context['can_split'] && !empty($context['real_num_replies'])) |
|
| 919 | - echo ' |
|
| 979 | + if ($context['can_split'] && !empty($context['real_num_replies'])) { |
|
| 980 | + echo ' |
|
| 920 | 981 | <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>'; |
| 982 | + } |
|
| 921 | 983 | |
| 922 | 984 | // Can we issue a warning because of this post? Remember, we can't give guests warnings. |
| 923 | - if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) |
|
| 924 | - echo ' |
|
| 985 | + if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) { |
|
| 986 | + echo ' |
|
| 925 | 987 | <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>'; |
| 988 | + } |
|
| 926 | 989 | |
| 927 | 990 | // Can we restore topics? |
| 928 | - if ($context['can_restore_msg']) |
|
| 929 | - echo ' |
|
| 991 | + if ($context['can_restore_msg']) { |
|
| 992 | + echo ' |
|
| 930 | 993 | <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>'; |
| 994 | + } |
|
| 931 | 995 | |
| 932 | 996 | // Maybe we can approve it, maybe we should? |
| 933 | - if ($message['can_approve']) |
|
| 934 | - echo ' |
|
| 997 | + if ($message['can_approve']) { |
|
| 998 | + echo ' |
|
| 935 | 999 | <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>'; |
| 1000 | + } |
|
| 936 | 1001 | |
| 937 | 1002 | // Maybe we can unapprove it? |
| 938 | - if ($message['can_unapprove']) |
|
| 939 | - echo ' |
|
| 1003 | + if ($message['can_unapprove']) { |
|
| 1004 | + echo ' |
|
| 940 | 1005 | <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>'; |
| 1006 | + } |
|
| 941 | 1007 | |
| 942 | 1008 | echo ' |
| 943 | 1009 | </ul> |
| 944 | 1010 | </li>'; |
| 945 | 1011 | |
| 946 | 1012 | // Show a checkbox for quick moderation? |
| 947 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) |
|
| 948 | - echo ' |
|
| 1013 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { |
|
| 1014 | + echo ' |
|
| 949 | 1015 | <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; |
| 1016 | + } |
|
| 950 | 1017 | |
| 951 | - if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
| 952 | - echo ' |
|
| 1018 | + if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
| 1019 | + echo ' |
|
| 953 | 1020 | </ul><!-- .quickbuttons -->'; |
| 1021 | + } |
|
| 954 | 1022 | } |
| 955 | 1023 | |
| 956 | - if ($context['can_report_moderator'] || !empty($modSettings['enable_likes']) || $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']) |
|
| 957 | - echo ' |
|
| 1024 | + if ($context['can_report_moderator'] || !empty($modSettings['enable_likes']) || $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']) { |
|
| 1025 | + echo ' |
|
| 958 | 1026 | </div><!-- .under_message -->'; |
| 1027 | + } |
|
| 959 | 1028 | |
| 960 | 1029 | echo ' |
| 961 | 1030 | </div><!-- .postarea --> |
@@ -968,9 +1037,10 @@ discard block |
||
| 968 | 1037 | <div class="custom_fields_above_signature"> |
| 969 | 1038 | <ul class="nolist">'; |
| 970 | 1039 | |
| 971 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
| 972 | - echo ' |
|
| 1040 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
| 1041 | + echo ' |
|
| 973 | 1042 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 1043 | + } |
|
| 974 | 1044 | |
| 975 | 1045 | echo ' |
| 976 | 1046 | </ul> |
@@ -978,11 +1048,12 @@ discard block |
||
| 978 | 1048 | } |
| 979 | 1049 | |
| 980 | 1050 | // Show the member's signature? |
| 981 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
| 982 | - echo ' |
|
| 1051 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
| 1052 | + echo ' |
|
| 983 | 1053 | <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '> |
| 984 | 1054 | ', $message['member']['signature'], ' |
| 985 | 1055 | </div>'; |
| 1056 | + } |
|
| 986 | 1057 | |
| 987 | 1058 | |
| 988 | 1059 | // Are there any custom profile fields for below the signature? |
@@ -992,9 +1063,10 @@ discard block |
||
| 992 | 1063 | <div class="custom_fields_below_signature"> |
| 993 | 1064 | <ul class="nolist">'; |
| 994 | 1065 | |
| 995 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
| 996 | - echo ' |
|
| 1066 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
| 1067 | + echo ' |
|
| 997 | 1068 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 1069 | + } |
|
| 998 | 1070 | |
| 999 | 1071 | echo ' |
| 1000 | 1072 | </ul> |
@@ -1044,8 +1116,8 @@ discard block |
||
| 1044 | 1116 | <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">'; |
| 1045 | 1117 | |
| 1046 | 1118 | // Guests just need more. |
| 1047 | - if ($context['user']['is_guest']) |
|
| 1048 | - echo ' |
|
| 1119 | + if ($context['user']['is_guest']) { |
|
| 1120 | + echo ' |
|
| 1049 | 1121 | <dl id="post_header"> |
| 1050 | 1122 | <dt> |
| 1051 | 1123 | ', $txt['name'], ': |
@@ -1060,6 +1132,7 @@ discard block |
||
| 1060 | 1132 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" required> |
| 1061 | 1133 | </dd> |
| 1062 | 1134 | </dl>'; |
| 1135 | + } |
|
| 1063 | 1136 | |
| 1064 | 1137 | echo ' |
| 1065 | 1138 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' |
@@ -1084,12 +1157,13 @@ discard block |
||
| 1084 | 1157 | </script>'; |
| 1085 | 1158 | |
| 1086 | 1159 | // Is visual verification enabled? |
| 1087 | - if ($context['require_verification']) |
|
| 1088 | - echo ' |
|
| 1160 | + if ($context['require_verification']) { |
|
| 1161 | + echo ' |
|
| 1089 | 1162 | <div class="post_verification"> |
| 1090 | 1163 | <strong>', $txt['verification'], ':</strong> |
| 1091 | 1164 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
| 1092 | 1165 | </div>'; |
| 1166 | + } |
|
| 1093 | 1167 | |
| 1094 | 1168 | // Finally, the submit buttons. |
| 1095 | 1169 | echo ' |
@@ -1105,8 +1179,8 @@ discard block |
||
| 1105 | 1179 | <br class="clear">'; |
| 1106 | 1180 | |
| 1107 | 1181 | // Draft autosave available and the user has it enabled? |
| 1108 | - if (!empty($context['drafts_autosave'])) |
|
| 1109 | - echo ' |
|
| 1182 | + if (!empty($context['drafts_autosave'])) { |
|
| 1183 | + echo ' |
|
| 1110 | 1184 | <script> |
| 1111 | 1185 | var oDraftAutoSave = new smf_DraftAutoSave({ |
| 1112 | 1186 | sSelf: \'oDraftAutoSave\', |
@@ -1118,12 +1192,14 @@ discard block |
||
| 1118 | 1192 | iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), ' |
| 1119 | 1193 | }); |
| 1120 | 1194 | </script>'; |
| 1195 | + } |
|
| 1121 | 1196 | |
| 1122 | - if ($context['show_spellchecking']) |
|
| 1123 | - echo ' |
|
| 1197 | + if ($context['show_spellchecking']) { |
|
| 1198 | + echo ' |
|
| 1124 | 1199 | <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"> |
| 1125 | 1200 | <input type="hidden" name="spellstring" value=""> |
| 1126 | 1201 | </form>'; |
| 1202 | + } |
|
| 1127 | 1203 | |
| 1128 | 1204 | echo ' |
| 1129 | 1205 | <script> |