@@ -1,9 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
| 4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
| 4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
| 5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
| 6 | -else |
|
| 6 | +} else { |
|
| 7 | 7 | exit; |
| 8 | +} |
|
| 8 | 9 | |
| 9 | 10 | ?> |
| 10 | 11 | \ No newline at end of file |
@@ -51,11 +51,13 @@ discard block |
||
| 51 | 51 | <p>'; |
| 52 | 52 | |
| 53 | 53 | // Show just numbers...? |
| 54 | - if ($settings['display_who_viewing'] == 1) |
|
| 55 | - echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
| 54 | + if ($settings['display_who_viewing'] == 1) { |
|
| 55 | + echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
| 56 | + } |
|
| 56 | 57 | // Or show the actual people viewing the topic? |
| 57 | - else |
|
| 58 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
| 58 | + else { |
|
| 59 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
| 60 | + } |
|
| 59 | 61 | |
| 60 | 62 | // Now show how many guests are here too. |
| 61 | 63 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' |
@@ -93,10 +95,11 @@ discard block |
||
| 93 | 95 | <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> |
| 94 | 96 | <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; |
| 95 | 97 | |
| 96 | - if ($context['allow_results_view']) |
|
| 97 | - echo ' |
|
| 98 | + if ($context['allow_results_view']) { |
|
| 99 | + echo ' |
|
| 98 | 100 | ', $option['bar_ndt'], ' |
| 99 | 101 | <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; |
| 102 | + } |
|
| 100 | 103 | |
| 101 | 104 | echo ' |
| 102 | 105 | </dd>'; |
@@ -105,9 +108,10 @@ discard block |
||
| 105 | 108 | echo ' |
| 106 | 109 | </dl>'; |
| 107 | 110 | |
| 108 | - if ($context['allow_results_view']) |
|
| 109 | - echo ' |
|
| 111 | + if ($context['allow_results_view']) { |
|
| 112 | + echo ' |
|
| 110 | 113 | <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; |
| 114 | + } |
|
| 111 | 115 | } |
| 112 | 116 | // They are allowed to vote! Go to it! |
| 113 | 117 | else |
@@ -116,17 +120,19 @@ discard block |
||
| 116 | 120 | <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; |
| 117 | 121 | |
| 118 | 122 | // Show a warning if they are allowed more than one option. |
| 119 | - if ($context['poll']['allowed_warning']) |
|
| 120 | - echo ' |
|
| 123 | + if ($context['poll']['allowed_warning']) { |
|
| 124 | + echo ' |
|
| 121 | 125 | <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; |
| 126 | + } |
|
| 122 | 127 | |
| 123 | 128 | echo ' |
| 124 | 129 | <ul class="options">'; |
| 125 | 130 | |
| 126 | 131 | // Show each option with its button - a radio likely. |
| 127 | - foreach ($context['poll']['options'] as $option) |
|
| 128 | - echo ' |
|
| 132 | + foreach ($context['poll']['options'] as $option) { |
|
| 133 | + echo ' |
|
| 129 | 134 | <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; |
| 135 | + } |
|
| 130 | 136 | |
| 131 | 137 | echo ' |
| 132 | 138 | </ul> |
@@ -138,9 +144,10 @@ discard block |
||
| 138 | 144 | } |
| 139 | 145 | |
| 140 | 146 | // Is the clock ticking? |
| 141 | - if (!empty($context['poll']['expire_time'])) |
|
| 142 | - echo ' |
|
| 147 | + if (!empty($context['poll']['expire_time'])) { |
|
| 148 | + echo ' |
|
| 143 | 149 | <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>'; |
| 150 | + } |
|
| 144 | 151 | |
| 145 | 152 | echo ' |
| 146 | 153 | </div> |
@@ -170,11 +177,13 @@ discard block |
||
| 170 | 177 | <li> |
| 171 | 178 | <b class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></b>'; |
| 172 | 179 | |
| 173 | - if ($event['can_edit']) |
|
| 174 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 180 | + if ($event['can_edit']) { |
|
| 181 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 182 | + } |
|
| 175 | 183 | |
| 176 | - if ($event['can_export']) |
|
| 177 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 184 | + if ($event['can_export']) { |
|
| 185 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 186 | + } |
|
| 178 | 187 | |
| 179 | 188 | echo ' |
| 180 | 189 | <br>'; |
@@ -182,14 +191,14 @@ discard block |
||
| 182 | 191 | if (!empty($event['allday'])) |
| 183 | 192 | { |
| 184 | 193 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' – <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : ''; |
| 185 | - } |
|
| 186 | - else |
|
| 194 | + } else |
|
| 187 | 195 | { |
| 188 | 196 | // Display event info relative to user's local timezone |
| 189 | 197 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 190 | 198 | |
| 191 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
| 192 | - echo trim($event['end_date_local']) . ', '; |
|
| 199 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
| 200 | + echo trim($event['end_date_local']) . ', '; |
|
| 201 | + } |
|
| 193 | 202 | |
| 194 | 203 | echo trim($event['end_time_local']); |
| 195 | 204 | |
@@ -198,23 +207,27 @@ discard block |
||
| 198 | 207 | { |
| 199 | 208 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
| 200 | 209 | |
| 201 | - if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) |
|
| 202 | - echo trim($event['start_date_orig']), ', '; |
|
| 210 | + if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) { |
|
| 211 | + echo trim($event['start_date_orig']), ', '; |
|
| 212 | + } |
|
| 203 | 213 | |
| 204 | 214 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 205 | 215 | |
| 206 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
| 207 | - echo trim($event['end_date_orig']) . ', '; |
|
| 216 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
| 217 | + echo trim($event['end_date_orig']) . ', '; |
|
| 218 | + } |
|
| 208 | 219 | |
| 209 | 220 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
| 210 | 221 | } |
| 211 | 222 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
| 212 | - else |
|
| 213 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 223 | + else { |
|
| 224 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 225 | + } |
|
| 214 | 226 | } |
| 215 | 227 | |
| 216 | - if (!empty($event['location'])) |
|
| 217 | - echo '<br>', $event['location']; |
|
| 228 | + if (!empty($event['location'])) { |
|
| 229 | + echo '<br>', $event['location']; |
|
| 230 | + } |
|
| 218 | 231 | |
| 219 | 232 | echo ' |
| 220 | 233 | </li>'; |
@@ -252,8 +265,9 @@ discard block |
||
| 252 | 265 | $context['removableMessageIDs'] = array(); |
| 253 | 266 | |
| 254 | 267 | // Get all the messages... |
| 255 | - while ($message = $context['get_message']()) |
|
| 256 | - template_single_post($message); |
|
| 268 | + while ($message = $context['get_message']()) { |
|
| 269 | + template_single_post($message); |
|
| 270 | + } |
|
| 257 | 271 | |
| 258 | 272 | echo ' |
| 259 | 273 | </form> |
@@ -290,8 +304,9 @@ discard block |
||
| 290 | 304 | <div id="display_jump_to"> </div>'; |
| 291 | 305 | |
| 292 | 306 | // Show quickreply |
| 293 | - if ($context['can_reply']) |
|
| 294 | - template_quickreply(); |
|
| 307 | + if ($context['can_reply']) { |
|
| 308 | + template_quickreply(); |
|
| 309 | + } |
|
| 295 | 310 | |
| 296 | 311 | // User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device. |
| 297 | 312 | echo ' |
@@ -304,8 +319,8 @@ discard block |
||
| 304 | 319 | </div>'; |
| 305 | 320 | |
| 306 | 321 | // Show the moderation button & pop only if user can moderate |
| 307 | - if ($context['can_moderate_forum'] || $context['user']['is_mod']) |
|
| 308 | - echo ' |
|
| 322 | + if ($context['can_moderate_forum'] || $context['user']['is_mod']) { |
|
| 323 | + echo ' |
|
| 309 | 324 | <div id="mobile_moderation" class="popup_container"> |
| 310 | 325 | <div class="popup_window description"> |
| 311 | 326 | <div class="popup_heading">', $txt['mobile_moderation'], ' |
@@ -315,6 +330,7 @@ discard block |
||
| 315 | 330 | </div> |
| 316 | 331 | </div> |
| 317 | 332 | </div>'; |
| 333 | + } |
|
| 318 | 334 | |
| 319 | 335 | echo ' |
| 320 | 336 | <script>'; |
@@ -438,9 +454,10 @@ discard block |
||
| 438 | 454 | }); |
| 439 | 455 | }'; |
| 440 | 456 | |
| 441 | - if (!empty($context['ignoredMsgs'])) |
|
| 442 | - echo ' |
|
| 457 | + if (!empty($context['ignoredMsgs'])) { |
|
| 458 | + echo ' |
|
| 443 | 459 | ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; |
| 460 | + } |
|
| 444 | 461 | |
| 445 | 462 | echo ' |
| 446 | 463 | </script>'; |
@@ -457,8 +474,9 @@ discard block |
||
| 457 | 474 | |
| 458 | 475 | $ignoring = false; |
| 459 | 476 | |
| 460 | - if ($message['can_remove']) |
|
| 461 | - $context['removableMessageIDs'][] = $message['id']; |
|
| 477 | + if ($message['can_remove']) { |
|
| 478 | + $context['removableMessageIDs'][] = $message['id']; |
|
| 479 | + } |
|
| 462 | 480 | |
| 463 | 481 | // Are we ignoring this message? |
| 464 | 482 | if (!empty($message['is_ignored'])) |
@@ -484,9 +502,10 @@ discard block |
||
| 484 | 502 | <div class="custom_fields_above_member"> |
| 485 | 503 | <ul class="nolist">'; |
| 486 | 504 | |
| 487 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
| 488 | - echo ' |
|
| 505 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
| 506 | + echo ' |
|
| 489 | 507 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 508 | + } |
|
| 490 | 509 | |
| 491 | 510 | echo ' |
| 492 | 511 | </ul> |
@@ -497,9 +516,10 @@ discard block |
||
| 497 | 516 | <h4>'; |
| 498 | 517 | |
| 499 | 518 | // Show online and offline buttons? |
| 500 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
| 501 | - echo ' |
|
| 519 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
| 520 | + echo ' |
|
| 502 | 521 | ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : ''; |
| 522 | + } |
|
| 503 | 523 | |
| 504 | 524 | |
| 505 | 525 | // Show a link to the member's profile. |
@@ -512,51 +532,59 @@ discard block |
||
| 512 | 532 | |
| 513 | 533 | |
| 514 | 534 | // Show the user's avatar. |
| 515 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
| 516 | - echo ' |
|
| 535 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
| 536 | + echo ' |
|
| 517 | 537 | <li class="avatar"> |
| 518 | 538 | <a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a> |
| 519 | 539 | </li>'; |
| 540 | + } |
|
| 520 | 541 | |
| 521 | 542 | // Are there any custom fields below the avatar? |
| 522 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
| 523 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 543 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
| 544 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 524 | 545 | echo ' |
| 525 | 546 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 547 | + } |
|
| 526 | 548 | |
| 527 | 549 | // Show the post group icons, but not for guests. |
| 528 | - if (!$message['member']['is_guest']) |
|
| 529 | - echo ' |
|
| 550 | + if (!$message['member']['is_guest']) { |
|
| 551 | + echo ' |
|
| 530 | 552 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
| 553 | + } |
|
| 531 | 554 | |
| 532 | 555 | // Show the member's primary group (like 'Administrator') if they have one. |
| 533 | - if (!empty($message['member']['group'])) |
|
| 534 | - echo ' |
|
| 556 | + if (!empty($message['member']['group'])) { |
|
| 557 | + echo ' |
|
| 535 | 558 | <li class="membergroup">', $message['member']['group'], '</li>'; |
| 559 | + } |
|
| 536 | 560 | |
| 537 | 561 | // Show the member's custom title, if they have one. |
| 538 | - if (!empty($message['member']['title'])) |
|
| 539 | - echo ' |
|
| 562 | + if (!empty($message['member']['title'])) { |
|
| 563 | + echo ' |
|
| 540 | 564 | <li class="title">', $message['member']['title'], '</li>'; |
| 565 | + } |
|
| 541 | 566 | |
| 542 | 567 | // Don't show these things for guests. |
| 543 | 568 | if (!$message['member']['is_guest']) |
| 544 | 569 | { |
| 545 | 570 | |
| 546 | 571 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
| 547 | - if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) |
|
| 548 | - echo ' |
|
| 572 | + if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) { |
|
| 573 | + echo ' |
|
| 549 | 574 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
| 575 | + } |
|
| 550 | 576 | |
| 551 | 577 | // Show how many posts they have made. |
| 552 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 553 | - echo ' |
|
| 578 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 579 | + echo ' |
|
| 554 | 580 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
| 581 | + } |
|
| 555 | 582 | |
| 556 | 583 | // Show their personal text? |
| 557 | - if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) |
|
| 558 | - echo ' |
|
| 584 | + if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) { |
|
| 585 | + echo ' |
|
| 559 | 586 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
| 587 | + } |
|
| 560 | 588 | |
| 561 | 589 | // Any custom fields to show as icons? |
| 562 | 590 | if (!empty($message['custom_fields']['icons'])) |
@@ -565,9 +593,10 @@ discard block |
||
| 565 | 593 | <li class="im_icons"> |
| 566 | 594 | <ol>'; |
| 567 | 595 | |
| 568 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
| 569 | - echo ' |
|
| 596 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
| 597 | + echo ' |
|
| 570 | 598 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 599 | + } |
|
| 571 | 600 | |
| 572 | 601 | echo ' |
| 573 | 602 | </ol> |
@@ -582,19 +611,22 @@ discard block |
||
| 582 | 611 | <ol class="profile_icons">'; |
| 583 | 612 | |
| 584 | 613 | // Don't show an icon if they haven't specified a website. |
| 585 | - if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) |
|
| 586 | - echo ' |
|
| 614 | + if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) { |
|
| 615 | + echo ' |
|
| 587 | 616 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
| 617 | + } |
|
| 588 | 618 | |
| 589 | 619 | // Since we know this person isn't a guest, you *can* message them. |
| 590 | - if ($context['can_send_pm']) |
|
| 591 | - echo ' |
|
| 620 | + if ($context['can_send_pm']) { |
|
| 621 | + echo ' |
|
| 592 | 622 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
| 623 | + } |
|
| 593 | 624 | |
| 594 | 625 | // Show the email if necessary |
| 595 | - if (!empty($message['member']['email']) && $message['member']['show_email']) |
|
| 596 | - echo ' |
|
| 626 | + if (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
| 627 | + echo ' |
|
| 597 | 628 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
| 629 | + } |
|
| 598 | 630 | |
| 599 | 631 | echo ' |
| 600 | 632 | </ol> |
@@ -602,48 +634,56 @@ discard block |
||
| 602 | 634 | } |
| 603 | 635 | |
| 604 | 636 | // Any custom fields for standard placement? |
| 605 | - if (!empty($message['custom_fields']['standard'])) |
|
| 606 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
| 637 | + if (!empty($message['custom_fields']['standard'])) { |
|
| 638 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
| 607 | 639 | echo ' |
| 608 | 640 | <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
| 641 | + } |
|
| 609 | 642 | |
| 610 | 643 | } |
| 611 | 644 | // Otherwise, show the guest's email. |
| 612 | - elseif (!empty($message['member']['email']) && $message['member']['show_email']) |
|
| 613 | - echo ' |
|
| 645 | + elseif (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
| 646 | + echo ' |
|
| 614 | 647 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
| 648 | + } |
|
| 615 | 649 | |
| 616 | 650 | // Show the IP to this user for this post - because you can moderate? |
| 617 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
| 618 | - echo ' |
|
| 651 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
| 652 | + echo ' |
|
| 619 | 653 | <li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>'; |
| 654 | + } |
|
| 620 | 655 | |
| 621 | 656 | // Or, should we show it because this is you? |
| 622 | - elseif ($message['can_see_ip']) |
|
| 623 | - echo ' |
|
| 657 | + elseif ($message['can_see_ip']) { |
|
| 658 | + echo ' |
|
| 624 | 659 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
| 660 | + } |
|
| 625 | 661 | |
| 626 | 662 | // Okay, are you at least logged in? Then we can show something about why IPs are logged... |
| 627 | - elseif (!$context['user']['is_guest']) |
|
| 628 | - echo ' |
|
| 663 | + elseif (!$context['user']['is_guest']) { |
|
| 664 | + echo ' |
|
| 629 | 665 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
| 666 | + } |
|
| 630 | 667 | |
| 631 | 668 | // Otherwise, you see NOTHING! |
| 632 | - else |
|
| 633 | - echo ' |
|
| 669 | + else { |
|
| 670 | + echo ' |
|
| 634 | 671 | <li class="poster_ip">', $txt['logged'], '</li>'; |
| 672 | + } |
|
| 635 | 673 | |
| 636 | 674 | // Are we showing the warning status? |
| 637 | 675 | // Don't show these things for guests. |
| 638 | - if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) |
|
| 639 | - echo ' |
|
| 676 | + if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) { |
|
| 677 | + echo ' |
|
| 640 | 678 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span> ', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
| 679 | + } |
|
| 641 | 680 | |
| 642 | 681 | // Are there any custom fields to show at the bottom of the poster info? |
| 643 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
| 644 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 682 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
| 683 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 645 | 684 | echo ' |
| 646 | 685 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 686 | + } |
|
| 647 | 687 | |
| 648 | 688 | // Poster info ends. |
| 649 | 689 | echo ' |
@@ -672,9 +712,10 @@ discard block |
||
| 672 | 712 | echo ' |
| 673 | 713 | <span class="smalltext modified" id="modified_', $message['id'], '">'; |
| 674 | 714 | |
| 675 | - if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
|
| 676 | - echo |
|
| 715 | + if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) { |
|
| 716 | + echo |
|
| 677 | 717 | $message['modified']['last_edit_text']; |
| 718 | + } |
|
| 678 | 719 | |
| 679 | 720 | echo ' |
| 680 | 721 | </span>'; |
@@ -685,22 +726,24 @@ discard block |
||
| 685 | 726 | </div>'; |
| 686 | 727 | |
| 687 | 728 | // Ignoring this user? Hide the post. |
| 688 | - if ($ignoring) |
|
| 689 | - echo ' |
|
| 729 | + if ($ignoring) { |
|
| 730 | + echo ' |
|
| 690 | 731 | <div id="msg_', $message['id'], '_ignored_prompt"> |
| 691 | 732 | ', $txt['ignoring_user'], ' |
| 692 | 733 | <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
| 693 | 734 | </div>'; |
| 735 | + } |
|
| 694 | 736 | |
| 695 | 737 | // Show the post itself, finally! |
| 696 | 738 | echo ' |
| 697 | 739 | <div class="post">'; |
| 698 | 740 | |
| 699 | - if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) |
|
| 700 | - echo ' |
|
| 741 | + if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { |
|
| 742 | + echo ' |
|
| 701 | 743 | <div class="approve_post"> |
| 702 | 744 | ', $txt['post_awaiting_approval'], ' |
| 703 | 745 | </div>'; |
| 746 | + } |
|
| 704 | 747 | echo ' |
| 705 | 748 | <div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div> |
| 706 | 749 | </div>'; |
@@ -717,9 +760,9 @@ discard block |
||
| 717 | 760 | foreach ($message['attachment'] as $attachment) |
| 718 | 761 | { |
| 719 | 762 | // Do we want this attachment to not be showed here? |
| 720 | - if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) |
|
| 721 | - continue; |
|
| 722 | - elseif (!$div_output) |
|
| 763 | + if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) { |
|
| 764 | + continue; |
|
| 765 | + } elseif (!$div_output) |
|
| 723 | 766 | { |
| 724 | 767 | $div_output = true; |
| 725 | 768 | |
@@ -735,9 +778,10 @@ discard block |
||
| 735 | 778 | <fieldset> |
| 736 | 779 | <legend>', $txt['attach_awaiting_approve']; |
| 737 | 780 | |
| 738 | - if ($context['can_approve']) |
|
| 739 | - echo ' |
|
| 781 | + if ($context['can_approve']) { |
|
| 782 | + echo ' |
|
| 740 | 783 | [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; |
| 784 | + } |
|
| 741 | 785 | |
| 742 | 786 | echo ' |
| 743 | 787 | </legend>'; |
@@ -751,12 +795,13 @@ discard block |
||
| 751 | 795 | echo ' |
| 752 | 796 | <div class="attachments_top">'; |
| 753 | 797 | |
| 754 | - if ($attachment['thumbnail']['has_thumb']) |
|
| 755 | - echo ' |
|
| 798 | + if ($attachment['thumbnail']['has_thumb']) { |
|
| 799 | + echo ' |
|
| 756 | 800 | <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>'; |
| 757 | - else |
|
| 758 | - echo ' |
|
| 801 | + } else { |
|
| 802 | + echo ' |
|
| 759 | 803 | <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">'; |
| 804 | + } |
|
| 760 | 805 | |
| 761 | 806 | echo ' |
| 762 | 807 | </div>'; |
@@ -766,9 +811,10 @@ discard block |
||
| 766 | 811 | <div class="attachments_bot"> |
| 767 | 812 | <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*"> ' . $attachment['name'] . '</a> '; |
| 768 | 813 | |
| 769 | - if (!$attachment['is_approved'] && $context['can_approve']) |
|
| 770 | - echo ' |
|
| 814 | + if (!$attachment['is_approved'] && $context['can_approve']) { |
|
| 815 | + echo ' |
|
| 771 | 816 | [<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>] '; |
| 817 | + } |
|
| 772 | 818 | echo ' |
| 773 | 819 | <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'])), ' |
| 774 | 820 | </div>'; |
@@ -777,33 +823,38 @@ discard block |
||
| 777 | 823 | </div>'; |
| 778 | 824 | |
| 779 | 825 | // Next attachment line ? |
| 780 | - if (++$i % $attachments_per_line === 0) |
|
| 781 | - echo ' |
|
| 826 | + if (++$i % $attachments_per_line === 0) { |
|
| 827 | + echo ' |
|
| 782 | 828 | <br>'; |
| 829 | + } |
|
| 783 | 830 | } |
| 784 | 831 | |
| 785 | 832 | // If we had unapproved attachments clean up. |
| 786 | - if ($last_approved_state == 0) |
|
| 787 | - echo ' |
|
| 833 | + if ($last_approved_state == 0) { |
|
| 834 | + echo ' |
|
| 788 | 835 | </fieldset>'; |
| 836 | + } |
|
| 789 | 837 | |
| 790 | 838 | // Only do this if we output a div above - otherwise it'll break things |
| 791 | - if ($div_output) |
|
| 792 | - echo ' |
|
| 839 | + if ($div_output) { |
|
| 840 | + echo ' |
|
| 793 | 841 | </div>'; |
| 842 | + } |
|
| 794 | 843 | } |
| 795 | 844 | |
| 796 | 845 | // And stuff below the attachments. |
| 797 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
| 798 | - echo ' |
|
| 846 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
| 847 | + echo ' |
|
| 799 | 848 | <div class="under_message">'; |
| 849 | + } |
|
| 800 | 850 | |
| 801 | 851 | // Maybe they want to report this post to the moderator(s)? |
| 802 | - if ($context['can_report_moderator']) |
|
| 803 | - echo ' |
|
| 852 | + if ($context['can_report_moderator']) { |
|
| 853 | + echo ' |
|
| 804 | 854 | <ul class="floatright smalltext"> |
| 805 | 855 | <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li> |
| 806 | 856 | </ul>'; |
| 857 | + } |
|
| 807 | 858 | |
| 808 | 859 | // What about likes? |
| 809 | 860 | if (!empty($modSettings['enable_likes'])) |
@@ -844,78 +895,91 @@ discard block |
||
| 844 | 895 | <ul class="quickbuttons">'; |
| 845 | 896 | |
| 846 | 897 | // Can they quote? if so they can select and quote as well! |
| 847 | - if ($context['can_quote']) |
|
| 848 | - echo ' |
|
| 898 | + if ($context['can_quote']) { |
|
| 899 | + echo ' |
|
| 849 | 900 | <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> |
| 850 | 901 | <li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>'; |
| 902 | + } |
|
| 851 | 903 | |
| 852 | 904 | // Can the user modify the contents of this post? Show the modify inline image. |
| 853 | - if ($message['can_modify']) |
|
| 854 | - echo ' |
|
| 905 | + if ($message['can_modify']) { |
|
| 906 | + echo ' |
|
| 855 | 907 | <li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>'; |
| 908 | + } |
|
| 856 | 909 | |
| 857 | - if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
| 858 | - echo ' |
|
| 910 | + if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
| 911 | + echo ' |
|
| 859 | 912 | <li class="post_options">', $txt['post_options']; |
| 913 | + } |
|
| 860 | 914 | |
| 861 | 915 | echo ' |
| 862 | 916 | <ul>'; |
| 863 | 917 | |
| 864 | 918 | // Can the user modify the contents of this post? |
| 865 | - if ($message['can_modify']) |
|
| 866 | - echo ' |
|
| 919 | + if ($message['can_modify']) { |
|
| 920 | + echo ' |
|
| 867 | 921 | <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>'; |
| 922 | + } |
|
| 868 | 923 | |
| 869 | 924 | // How about... even... remove it entirely?! |
| 870 | - if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) |
|
| 871 | - echo ' |
|
| 925 | + if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) { |
|
| 926 | + echo ' |
|
| 872 | 927 | <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>'; |
| 873 | - elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) |
|
| 874 | - echo ' |
|
| 928 | + } elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) { |
|
| 929 | + echo ' |
|
| 875 | 930 | <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>'; |
| 931 | + } |
|
| 876 | 932 | |
| 877 | 933 | // What about splitting it off the rest of the topic? |
| 878 | - if ($context['can_split'] && !empty($context['real_num_replies'])) |
|
| 879 | - echo ' |
|
| 934 | + if ($context['can_split'] && !empty($context['real_num_replies'])) { |
|
| 935 | + echo ' |
|
| 880 | 936 | <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>'; |
| 937 | + } |
|
| 881 | 938 | |
| 882 | 939 | // Can we issue a warning because of this post? Remember, we can't give guests warnings. |
| 883 | - if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) |
|
| 884 | - echo ' |
|
| 940 | + if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) { |
|
| 941 | + echo ' |
|
| 885 | 942 | <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>'; |
| 943 | + } |
|
| 886 | 944 | |
| 887 | 945 | // Can we restore topics? |
| 888 | - if ($context['can_restore_msg']) |
|
| 889 | - echo ' |
|
| 946 | + if ($context['can_restore_msg']) { |
|
| 947 | + echo ' |
|
| 890 | 948 | <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>'; |
| 949 | + } |
|
| 891 | 950 | |
| 892 | 951 | // Maybe we can approve it, maybe we should? |
| 893 | - if ($message['can_approve']) |
|
| 894 | - echo ' |
|
| 952 | + if ($message['can_approve']) { |
|
| 953 | + echo ' |
|
| 895 | 954 | <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>'; |
| 955 | + } |
|
| 896 | 956 | |
| 897 | 957 | // Maybe we can unapprove it? |
| 898 | - if ($message['can_unapprove']) |
|
| 899 | - echo ' |
|
| 958 | + if ($message['can_unapprove']) { |
|
| 959 | + echo ' |
|
| 900 | 960 | <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>'; |
| 961 | + } |
|
| 901 | 962 | |
| 902 | 963 | echo ' |
| 903 | 964 | </ul> |
| 904 | 965 | </li>'; |
| 905 | 966 | |
| 906 | 967 | // Show a checkbox for quick moderation? |
| 907 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) |
|
| 908 | - echo ' |
|
| 968 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { |
|
| 969 | + echo ' |
|
| 909 | 970 | <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; |
| 971 | + } |
|
| 910 | 972 | |
| 911 | - if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
| 912 | - echo ' |
|
| 973 | + if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
| 974 | + echo ' |
|
| 913 | 975 | </ul>'; |
| 976 | + } |
|
| 914 | 977 | } |
| 915 | 978 | |
| 916 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
| 917 | - echo ' |
|
| 979 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
| 980 | + echo ' |
|
| 918 | 981 | </div>'; |
| 982 | + } |
|
| 919 | 983 | |
| 920 | 984 | echo ' |
| 921 | 985 | </div> |
@@ -928,9 +992,10 @@ discard block |
||
| 928 | 992 | <div class="custom_fields_above_signature"> |
| 929 | 993 | <ul class="nolist">'; |
| 930 | 994 | |
| 931 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
| 932 | - echo ' |
|
| 995 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
| 996 | + echo ' |
|
| 933 | 997 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 998 | + } |
|
| 934 | 999 | |
| 935 | 1000 | echo ' |
| 936 | 1001 | </ul> |
@@ -938,9 +1003,10 @@ discard block |
||
| 938 | 1003 | } |
| 939 | 1004 | |
| 940 | 1005 | // Show the member's signature? |
| 941 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
| 942 | - echo ' |
|
| 1006 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
| 1007 | + echo ' |
|
| 943 | 1008 | <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>'; |
| 1009 | + } |
|
| 944 | 1010 | |
| 945 | 1011 | |
| 946 | 1012 | // Are there any custom profile fields for below the signature? |
@@ -950,9 +1016,10 @@ discard block |
||
| 950 | 1016 | <div class="custom_fields_below_signature"> |
| 951 | 1017 | <ul class="nolist">'; |
| 952 | 1018 | |
| 953 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
| 954 | - echo ' |
|
| 1019 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
| 1020 | + echo ' |
|
| 955 | 1021 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 1022 | + } |
|
| 956 | 1023 | |
| 957 | 1024 | echo ' |
| 958 | 1025 | </ul> |
@@ -1000,8 +1067,8 @@ discard block |
||
| 1000 | 1067 | <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">'; |
| 1001 | 1068 | |
| 1002 | 1069 | // Guests just need more. |
| 1003 | - if ($context['user']['is_guest']) |
|
| 1004 | - echo ' |
|
| 1070 | + if ($context['user']['is_guest']) { |
|
| 1071 | + echo ' |
|
| 1005 | 1072 | <dl id="post_header"> |
| 1006 | 1073 | <dt> |
| 1007 | 1074 | ', $txt['name'], ': |
@@ -1016,6 +1083,7 @@ discard block |
||
| 1016 | 1083 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required> |
| 1017 | 1084 | </dd> |
| 1018 | 1085 | </dl>'; |
| 1086 | + } |
|
| 1019 | 1087 | |
| 1020 | 1088 | echo ' |
| 1021 | 1089 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' |
@@ -1063,8 +1131,8 @@ discard block |
||
| 1063 | 1131 | <br class="clear">'; |
| 1064 | 1132 | |
| 1065 | 1133 | // draft autosave available and the user has it enabled? |
| 1066 | - if (!empty($context['drafts_autosave'])) |
|
| 1067 | - echo ' |
|
| 1134 | + if (!empty($context['drafts_autosave'])) { |
|
| 1135 | + echo ' |
|
| 1068 | 1136 | <script> |
| 1069 | 1137 | var oDraftAutoSave = new smf_DraftAutoSave({ |
| 1070 | 1138 | sSelf: \'oDraftAutoSave\', |
@@ -1076,10 +1144,12 @@ discard block |
||
| 1076 | 1144 | iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), ' |
| 1077 | 1145 | }); |
| 1078 | 1146 | </script>'; |
| 1147 | + } |
|
| 1079 | 1148 | |
| 1080 | - if ($context['show_spellchecking']) |
|
| 1081 | - echo ' |
|
| 1149 | + if ($context['show_spellchecking']) { |
|
| 1150 | + echo ' |
|
| 1082 | 1151 | <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>'; |
| 1152 | + } |
|
| 1083 | 1153 | |
| 1084 | 1154 | echo ' |
| 1085 | 1155 | <script> |
@@ -1,9 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
| 4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
| 4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
| 5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
| 6 | -else |
|
| 6 | +} else { |
|
| 7 | 7 | exit; |
| 8 | +} |
|
| 8 | 9 | |
| 9 | 10 | ?> |
| 10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
| 4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
| 4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
| 5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
| 6 | -else |
|
| 6 | +} else { |
|
| 7 | 7 | exit; |
| 8 | +} |
|
| 8 | 9 | |
| 9 | 10 | ?> |
| 10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
| 4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
| 4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
| 5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
| 6 | -else |
|
| 6 | +} else { |
|
| 7 | 7 | exit; |
| 8 | +} |
|
| 8 | 9 | |
| 9 | 10 | ?> |
| 10 | 11 | \ No newline at end of file |
@@ -18,9 +18,10 @@ discard block |
||
| 18 | 18 | global $context, $txt, $scripturl; |
| 19 | 19 | |
| 20 | 20 | // Are we done sending the newsletter? |
| 21 | - if (!empty($context['newsletter_sent'])) |
|
| 22 | - echo ' |
|
| 21 | + if (!empty($context['newsletter_sent'])) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="infobox">', $txt['admin_news_newsletter_' . $context['newsletter_sent']], '</div>'; |
| 24 | + } |
|
| 24 | 25 | |
| 25 | 26 | echo ' |
| 26 | 27 | <div id="admincenter"> |
@@ -39,9 +40,10 @@ discard block |
||
| 39 | 40 | </dt> |
| 40 | 41 | <dd>'; |
| 41 | 42 | |
| 42 | - foreach ($context['groups'] as $group) |
|
| 43 | - echo ' |
|
| 43 | + foreach ($context['groups'] as $group) { |
|
| 44 | + echo ' |
|
| 44 | 45 | <label for="groups_', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
| 46 | + } |
|
| 45 | 47 | |
| 46 | 48 | echo ' |
| 47 | 49 | <br> |
@@ -82,9 +84,10 @@ discard block |
||
| 82 | 84 | </dt> |
| 83 | 85 | <dd>'; |
| 84 | 86 | |
| 85 | - foreach ($context['groups'] as $group) |
|
| 86 | - echo ' |
|
| 87 | + foreach ($context['groups'] as $group) { |
|
| 88 | + echo ' |
|
| 87 | 89 | <label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '" class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
| 90 | + } |
|
| 88 | 91 | |
| 89 | 92 | echo ' |
| 90 | 93 | <br> |
@@ -228,9 +231,10 @@ discard block |
||
| 228 | 231 | <div id="bbcBox_message"></div>'; |
| 229 | 232 | |
| 230 | 233 | // What about smileys? |
| 231 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
| 232 | - echo ' |
|
| 234 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
| 235 | + echo ' |
|
| 233 | 236 | <div id="smileyBox_message"></div>'; |
| 237 | + } |
|
| 234 | 238 | |
| 235 | 239 | // Show BBC buttons, smileys and textbox. |
| 236 | 240 | echo ' |
@@ -251,9 +255,10 @@ discard block |
||
| 251 | 255 | <input type="hidden" name="email_force" value="', $context['email_force'], '"> |
| 252 | 256 | <input type="hidden" name="total_emails" value="', $context['total_emails'], '">'; |
| 253 | 257 | |
| 254 | - foreach ($context['recipients'] as $key => $values) |
|
| 255 | - echo ' |
|
| 258 | + foreach ($context['recipients'] as $key => $values) { |
|
| 259 | + echo ' |
|
| 256 | 260 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
| 261 | + } |
|
| 257 | 262 | |
| 258 | 263 | echo ' |
| 259 | 264 | <script>'; |
@@ -408,9 +413,10 @@ discard block |
||
| 408 | 413 | <input type="hidden" name="parse_html" value="', $context['parse_html'], '">'; |
| 409 | 414 | |
| 410 | 415 | // All the things we must remember! |
| 411 | - foreach ($context['recipients'] as $key => $values) |
|
| 412 | - echo ' |
|
| 416 | + foreach ($context['recipients'] as $key => $values) { |
|
| 417 | + echo ' |
|
| 413 | 418 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
| 419 | + } |
|
| 414 | 420 | |
| 415 | 421 | echo ' |
| 416 | 422 | </div> |
@@ -443,9 +449,10 @@ discard block |
||
| 443 | 449 | { |
| 444 | 450 | global $context, $txt; |
| 445 | 451 | |
| 446 | - if (!empty($context['saved_successful'])) |
|
| 447 | - echo ' |
|
| 452 | + if (!empty($context['saved_successful'])) { |
|
| 453 | + echo ' |
|
| 448 | 454 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 455 | + } |
|
| 449 | 456 | |
| 450 | 457 | template_show_list('news_lists'); |
| 451 | 458 | } |
@@ -1,9 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
| 4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
| 4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
| 5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
| 6 | -else |
|
| 6 | +} else { |
|
| 7 | 7 | exit; |
| 8 | +} |
|
| 8 | 9 | |
| 9 | 10 | ?> |
| 10 | 11 | \ No newline at end of file |
@@ -19,26 +19,28 @@ discard block |
||
| 19 | 19 | global $context, $settings, $scripturl, $txt, $modSettings; |
| 20 | 20 | |
| 21 | 21 | // Not allowed to edit? |
| 22 | - if (!$context['can_modify']) |
|
| 23 | - echo ' |
|
| 22 | + if (!$context['can_modify']) { |
|
| 23 | + echo ' |
|
| 24 | 24 | <div class="errorbox"> |
| 25 | 25 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
| 26 | 26 | </div>'; |
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | echo ' |
| 29 | 30 | <div id="admin_form_wrapper"> |
| 30 | 31 | <form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">'; |
| 31 | 32 | |
| 32 | - if (!empty($context['profile'])) |
|
| 33 | - echo ' |
|
| 33 | + if (!empty($context['profile'])) { |
|
| 34 | + echo ' |
|
| 34 | 35 | <div class="cat_bar"> |
| 35 | 36 | <h3 class="catbg">', $txt['permissions_for_profile'], ': "', $context['profile']['name'], '"</h3> |
| 36 | 37 | </div>'; |
| 37 | - else |
|
| 38 | - echo ' |
|
| 38 | + } else { |
|
| 39 | + echo ' |
|
| 39 | 40 | <div class="cat_bar"> |
| 40 | 41 | <h3 class="catbg">', $txt['permissions_title'], '</h3> |
| 41 | 42 | </div>'; |
| 43 | + } |
|
| 42 | 44 | |
| 43 | 45 | echo ' |
| 44 | 46 | <table class="table_grid"> |
@@ -47,13 +49,14 @@ discard block |
||
| 47 | 49 | <th>', $txt['membergroups_name'], '</th> |
| 48 | 50 | <th class="small_table">', $txt['membergroups_members_top'], '</th>'; |
| 49 | 51 | |
| 50 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 51 | - echo ' |
|
| 52 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 53 | + echo ' |
|
| 52 | 54 | <th class="small_table">', $txt['membergroups_permissions'], '</th>'; |
| 53 | - else |
|
| 54 | - echo ' |
|
| 55 | + } else { |
|
| 56 | + echo ' |
|
| 55 | 57 | <th class="small_table">', $txt['permissions_allowed'], '</th> |
| 56 | 58 | <th class="small_table">', $txt['permissions_denied'], '</th>'; |
| 59 | + } |
|
| 57 | 60 | |
| 58 | 61 | echo ' |
| 59 | 62 | <th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th> |
@@ -71,22 +74,24 @@ discard block |
||
| 71 | 74 | <td> |
| 72 | 75 | ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', ' <span>', $group['name'], '</span>'; |
| 73 | 76 | |
| 74 | - if (!empty($group['children'])) |
|
| 75 | - echo ' |
|
| 77 | + if (!empty($group['children'])) { |
|
| 78 | + echo ' |
|
| 76 | 79 | <br> |
| 77 | 80 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
| 81 | + } |
|
| 78 | 82 | |
| 79 | 83 | echo ' |
| 80 | 84 | </td> |
| 81 | 85 | <td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>'; |
| 82 | 86 | |
| 83 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 84 | - echo ' |
|
| 87 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 88 | + echo ' |
|
| 85 | 89 | <td>', $group['num_permissions']['allowed'], '</td>'; |
| 86 | - else |
|
| 87 | - echo ' |
|
| 90 | + } else { |
|
| 91 | + echo ' |
|
| 88 | 92 | <td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '>', $group['num_permissions']['allowed'], '</td> |
| 89 | 93 | <td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>', $group['num_permissions']['denied'], '</td>'; |
| 94 | + } |
|
| 90 | 95 | |
| 91 | 96 | echo ' |
| 92 | 97 | <td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']) . '</a>' : '', '</td> |
@@ -133,9 +138,10 @@ discard block |
||
| 133 | 138 | <option value="empty">(', $txt['permissions_select_membergroup'], ')</option>'; |
| 134 | 139 | foreach ($context['groups'] as $group) |
| 135 | 140 | { |
| 136 | - if ($group['id'] != 1) |
|
| 137 | - echo ' |
|
| 141 | + if ($group['id'] != 1) { |
|
| 142 | + echo ' |
|
| 138 | 143 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
| 144 | + } |
|
| 139 | 145 | } |
| 140 | 146 | |
| 141 | 147 | echo ' |
@@ -145,9 +151,10 @@ discard block |
||
| 145 | 151 | <select name="add_remove"> |
| 146 | 152 | <option value="add">', $txt['permissions_add'], '...</option> |
| 147 | 153 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
| 148 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 149 | - echo ' |
|
| 154 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 155 | + echo ' |
|
| 150 | 156 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
| 157 | + } |
|
| 151 | 158 | echo ' |
| 152 | 159 | </select> |
| 153 | 160 | </dt> |
@@ -156,30 +163,34 @@ discard block |
||
| 156 | 163 | <option value="">(', $txt['permissions_select_permission'], ')</option>'; |
| 157 | 164 | foreach ($context['permissions'] as $permissionType) |
| 158 | 165 | { |
| 159 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
| 160 | - continue; |
|
| 166 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
| 167 | + continue; |
|
| 168 | + } |
|
| 161 | 169 | |
| 162 | 170 | foreach ($permissionType['columns'] as $column) |
| 163 | 171 | { |
| 164 | 172 | foreach ($column as $permissionGroup) |
| 165 | 173 | { |
| 166 | - if ($permissionGroup['hidden']) |
|
| 167 | - continue; |
|
| 174 | + if ($permissionGroup['hidden']) { |
|
| 175 | + continue; |
|
| 176 | + } |
|
| 168 | 177 | |
| 169 | 178 | echo ' |
| 170 | 179 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
| 171 | 180 | foreach ($permissionGroup['permissions'] as $perm) |
| 172 | 181 | { |
| 173 | - if ($perm['hidden']) |
|
| 174 | - continue; |
|
| 182 | + if ($perm['hidden']) { |
|
| 183 | + continue; |
|
| 184 | + } |
|
| 175 | 185 | |
| 176 | - if ($perm['has_own_any']) |
|
| 177 | - echo ' |
|
| 186 | + if ($perm['has_own_any']) { |
|
| 187 | + echo ' |
|
| 178 | 188 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
| 179 | 189 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
| 180 | - else |
|
| 181 | - echo ' |
|
| 190 | + } else { |
|
| 191 | + echo ' |
|
| 182 | 192 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
| 193 | + } |
|
| 183 | 194 | } |
| 184 | 195 | } |
| 185 | 196 | } |
@@ -246,17 +257,18 @@ discard block |
||
| 246 | 257 | } |
| 247 | 258 | </script>'; |
| 248 | 259 | |
| 249 | - if (!empty($context['profile'])) |
|
| 250 | - echo ' |
|
| 260 | + if (!empty($context['profile'])) { |
|
| 261 | + echo ' |
|
| 251 | 262 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
| 263 | + } |
|
| 252 | 264 | |
| 253 | 265 | echo ' |
| 254 | 266 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 255 | 267 | <input type="hidden" name="', $context['admin-mpq_token_var'], '" value="', $context['admin-mpq_token'], '">'; |
| 256 | - } |
|
| 257 | - else |
|
| 258 | - echo ' |
|
| 268 | + } else { |
|
| 269 | + echo ' |
|
| 259 | 270 | </table>'; |
| 271 | + } |
|
| 260 | 272 | |
| 261 | 273 | echo ' |
| 262 | 274 | </form> |
@@ -296,9 +308,10 @@ discard block |
||
| 296 | 308 | <h3 class="subbg">', $category['name'], '</h3> |
| 297 | 309 | </div>'; |
| 298 | 310 | |
| 299 | - if (!empty($category['boards'])) |
|
| 300 | - echo ' |
|
| 311 | + if (!empty($category['boards'])) { |
|
| 312 | + echo ' |
|
| 301 | 313 | <ul class="perm_boards flow_hidden">'; |
| 314 | + } |
|
| 302 | 315 | |
| 303 | 316 | foreach ($category['boards'] as $board) |
| 304 | 317 | { |
@@ -315,33 +328,36 @@ discard block |
||
| 315 | 328 | echo ' |
| 316 | 329 | <select name="boardprofile[', $board['id'], ']">'; |
| 317 | 330 | |
| 318 | - foreach ($context['profiles'] as $id => $profile) |
|
| 319 | - echo ' |
|
| 331 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 332 | + echo ' |
|
| 320 | 333 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 334 | + } |
|
| 321 | 335 | |
| 322 | 336 | echo ' |
| 323 | 337 | </select>'; |
| 324 | - } |
|
| 325 | - else |
|
| 326 | - echo ' |
|
| 338 | + } else { |
|
| 339 | + echo ' |
|
| 327 | 340 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
| 341 | + } |
|
| 328 | 342 | |
| 329 | 343 | echo ' |
| 330 | 344 | </span> |
| 331 | 345 | </li>'; |
| 332 | 346 | } |
| 333 | 347 | |
| 334 | - if (!empty($category['boards'])) |
|
| 335 | - echo ' |
|
| 348 | + if (!empty($category['boards'])) { |
|
| 349 | + echo ' |
|
| 336 | 350 | </ul>'; |
| 351 | + } |
|
| 337 | 352 | } |
| 338 | 353 | |
| 339 | - if ($context['edit_all']) |
|
| 340 | - echo ' |
|
| 354 | + if ($context['edit_all']) { |
|
| 355 | + echo ' |
|
| 341 | 356 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button_submit">'; |
| 342 | - else |
|
| 343 | - echo ' |
|
| 357 | + } else { |
|
| 358 | + echo ' |
|
| 344 | 359 | <a class="button_link" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
| 360 | + } |
|
| 345 | 361 | |
| 346 | 362 | echo ' |
| 347 | 363 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -381,12 +397,13 @@ discard block |
||
| 381 | 397 | <tr class="windowbg"> |
| 382 | 398 | <td>'; |
| 383 | 399 | |
| 384 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
| 385 | - echo ' |
|
| 400 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
| 401 | + echo ' |
|
| 386 | 402 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '" class="input_text">'; |
| 387 | - else |
|
| 388 | - echo ' |
|
| 403 | + } else { |
|
| 404 | + echo ' |
|
| 389 | 405 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
| 406 | + } |
|
| 390 | 407 | |
| 391 | 408 | echo ' |
| 392 | 409 | </td> |
@@ -406,9 +423,10 @@ discard block |
||
| 406 | 423 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 407 | 424 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
| 408 | 425 | |
| 409 | - if ($context['can_edit_something']) |
|
| 410 | - echo ' |
|
| 426 | + if ($context['can_edit_something']) { |
|
| 427 | + echo ' |
|
| 411 | 428 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button_submit">'; |
| 429 | + } |
|
| 412 | 430 | |
| 413 | 431 | echo ' |
| 414 | 432 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button_submit" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '/> |
@@ -433,9 +451,10 @@ discard block |
||
| 433 | 451 | <dd> |
| 434 | 452 | <select name="copy_from">'; |
| 435 | 453 | |
| 436 | - foreach ($context['profiles'] as $id => $profile) |
|
| 437 | - echo ' |
|
| 454 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 455 | + echo ' |
|
| 438 | 456 | <option value="', $id, '">', $profile['name'], '</option>'; |
| 457 | + } |
|
| 439 | 458 | |
| 440 | 459 | echo ' |
| 441 | 460 | </select> |
@@ -463,8 +482,7 @@ discard block |
||
| 463 | 482 | <div class="errorbox"> |
| 464 | 483 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
| 465 | 484 | </div>'; |
| 466 | - } |
|
| 467 | - else |
|
| 485 | + } else |
|
| 468 | 486 | { |
| 469 | 487 | echo ' |
| 470 | 488 | <script> |
@@ -484,21 +502,23 @@ discard block |
||
| 484 | 502 | <div id="admincenter"> |
| 485 | 503 | <form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">'; |
| 486 | 504 | |
| 487 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
| 488 | - echo ' |
|
| 505 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
| 506 | + echo ' |
|
| 489 | 507 | <div class="information"> |
| 490 | 508 | ', $txt['permissions_option_desc'], ' |
| 491 | 509 | </div>'; |
| 510 | + } |
|
| 492 | 511 | |
| 493 | 512 | echo ' |
| 494 | 513 | <div class="cat_bar"> |
| 495 | 514 | <h3 class="catbg">'; |
| 496 | - if ($context['permission_type'] == 'board') |
|
| 497 | - echo ' |
|
| 515 | + if ($context['permission_type'] == 'board') { |
|
| 516 | + echo ' |
|
| 498 | 517 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
| 499 | - else |
|
| 500 | - echo ' |
|
| 518 | + } else { |
|
| 519 | + echo ' |
|
| 501 | 520 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
| 521 | + } |
|
| 502 | 522 | echo ' |
| 503 | 523 | </h3> |
| 504 | 524 | </div>'; |
@@ -521,15 +541,17 @@ discard block |
||
| 521 | 541 | template_modify_group_display('board'); |
| 522 | 542 | } |
| 523 | 543 | |
| 524 | - if ($context['profile']['can_modify']) |
|
| 525 | - echo ' |
|
| 544 | + if ($context['profile']['can_modify']) { |
|
| 545 | + echo ' |
|
| 526 | 546 | <div class="padding"> |
| 527 | 547 | <input type="submit" value="', $txt['permissions_commit'], '" class="button_submit"> |
| 528 | 548 | </div>'; |
| 549 | + } |
|
| 529 | 550 | |
| 530 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
| 531 | - echo ' |
|
| 551 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
| 552 | + echo ' |
|
| 532 | 553 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
| 554 | + } |
|
| 533 | 555 | |
| 534 | 556 | echo ' |
| 535 | 557 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -557,17 +579,19 @@ discard block |
||
| 557 | 579 | |
| 558 | 580 | foreach ($column as $permissionGroup) |
| 559 | 581 | { |
| 560 | - if (empty($permissionGroup['permissions'])) |
|
| 561 | - continue; |
|
| 582 | + if (empty($permissionGroup['permissions'])) { |
|
| 583 | + continue; |
|
| 584 | + } |
|
| 562 | 585 | |
| 563 | 586 | // Are we likely to have something in this group to display or is it all hidden? |
| 564 | 587 | $has_display_content = false; |
| 565 | 588 | if (!$permissionGroup['hidden']) |
| 566 | 589 | { |
| 567 | 590 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
| 568 | - foreach ($permissionGroup['permissions'] as $permission) |
|
| 569 | - if (!$permission['hidden']) |
|
| 591 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
| 592 | + if (!$permission['hidden']) |
|
| 570 | 593 | $has_display_content = true; |
| 594 | + } |
|
| 571 | 595 | |
| 572 | 596 | if ($has_display_content) |
| 573 | 597 | { |
@@ -576,10 +600,11 @@ discard block |
||
| 576 | 600 | <th></th> |
| 577 | 601 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
| 578 | 602 | |
| 579 | - if ($context['group']['id'] != -1) |
|
| 580 | - echo ' |
|
| 603 | + if ($context['group']['id'] != -1) { |
|
| 604 | + echo ' |
|
| 581 | 605 | <th>', $txt['permissions_option_own'], '</th> |
| 582 | 606 | <th>', $txt['permissions_option_any'], '</th>'; |
| 607 | + } |
|
| 583 | 608 | |
| 584 | 609 | echo ' |
| 585 | 610 | </tr>'; |
@@ -602,17 +627,18 @@ discard block |
||
| 602 | 627 | // Guests can't do their own thing. |
| 603 | 628 | if ($context['group']['id'] != -1) |
| 604 | 629 | { |
| 605 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 606 | - echo ' |
|
| 630 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 631 | + echo ' |
|
| 607 | 632 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" class="input_check" ', $disable_field, '/>'; |
| 608 | - else |
|
| 633 | + } else |
|
| 609 | 634 | { |
| 610 | 635 | echo ' |
| 611 | 636 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
| 612 | 637 | |
| 613 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 614 | - echo ' |
|
| 638 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 639 | + echo ' |
|
| 615 | 640 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 641 | + } |
|
| 616 | 642 | echo ' |
| 617 | 643 | </select>'; |
| 618 | 644 | } |
@@ -622,39 +648,41 @@ discard block |
||
| 622 | 648 | <td>'; |
| 623 | 649 | } |
| 624 | 650 | |
| 625 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
| 626 | - echo ' |
|
| 651 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
| 652 | + echo ' |
|
| 627 | 653 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>'; |
| 628 | - else |
|
| 654 | + } else |
|
| 629 | 655 | { |
| 630 | 656 | echo ' |
| 631 | 657 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
| 632 | 658 | |
| 633 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 634 | - echo ' |
|
| 659 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 660 | + echo ' |
|
| 635 | 661 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 662 | + } |
|
| 636 | 663 | echo ' |
| 637 | 664 | </select>'; |
| 638 | 665 | } |
| 639 | - } |
|
| 640 | - else |
|
| 666 | + } else |
|
| 641 | 667 | { |
| 642 | - if ($context['group']['id'] != -1) |
|
| 643 | - echo ' |
|
| 668 | + if ($context['group']['id'] != -1) { |
|
| 669 | + echo ' |
|
| 644 | 670 | </td> |
| 645 | 671 | <td>'; |
| 672 | + } |
|
| 646 | 673 | |
| 647 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
| 648 | - echo ' |
|
| 674 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
| 675 | + echo ' |
|
| 649 | 676 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>'; |
| 650 | - else |
|
| 677 | + } else |
|
| 651 | 678 | { |
| 652 | 679 | echo ' |
| 653 | 680 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
| 654 | 681 | |
| 655 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 656 | - echo ' |
|
| 682 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 683 | + echo ' |
|
| 657 | 684 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 685 | + } |
|
| 658 | 686 | echo ' |
| 659 | 687 | </select>'; |
| 660 | 688 | } |
@@ -684,11 +712,11 @@ discard block |
||
| 684 | 712 | echo ' |
| 685 | 713 | <fieldset id="', $context['current_permission'], '"> |
| 686 | 714 | <legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>'; |
| 687 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 688 | - echo ' |
|
| 715 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 716 | + echo ' |
|
| 689 | 717 | <ul>'; |
| 690 | - else |
|
| 691 | - echo ' |
|
| 718 | + } else { |
|
| 719 | + echo ' |
|
| 692 | 720 | <div class="information">', $txt['permissions_option_desc'], '</div> |
| 693 | 721 | <dl class="settings"> |
| 694 | 722 | <dt> |
@@ -698,46 +726,51 @@ discard block |
||
| 698 | 726 | </dt> |
| 699 | 727 | <dd> |
| 700 | 728 | </dd>'; |
| 729 | + } |
|
| 701 | 730 | foreach ($context['member_groups'] as $group) |
| 702 | 731 | { |
| 703 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 704 | - echo ' |
|
| 732 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 733 | + echo ' |
|
| 705 | 734 | <dt>'; |
| 706 | - else |
|
| 707 | - echo ' |
|
| 735 | + } else { |
|
| 736 | + echo ' |
|
| 708 | 737 | <li>'; |
| 738 | + } |
|
| 709 | 739 | |
| 710 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 711 | - echo ' |
|
| 740 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 741 | + echo ' |
|
| 712 | 742 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_check">'; |
| 713 | - else |
|
| 714 | - echo ' |
|
| 743 | + } else { |
|
| 744 | + echo ' |
|
| 715 | 745 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_radio"></span> |
| 716 | 746 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', ' class="input_radio"></span> |
| 717 | 747 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', ' class="input_radio"></span>'; |
| 748 | + } |
|
| 718 | 749 | |
| 719 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 720 | - echo ' |
|
| 750 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 751 | + echo ' |
|
| 721 | 752 | </dt> |
| 722 | 753 | <dd> |
| 723 | 754 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
| 724 | 755 | </dd>'; |
| 725 | - else |
|
| 726 | - echo ' |
|
| 756 | + } else { |
|
| 757 | + echo ' |
|
| 727 | 758 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
| 728 | 759 | </li>'; |
| 760 | + } |
|
| 729 | 761 | } |
| 730 | 762 | |
| 731 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 732 | - echo ' |
|
| 763 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 764 | + echo ' |
|
| 733 | 765 | <li> |
| 734 | 766 | <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');"> |
| 735 | 767 | <span>', $txt['check_all'], '</span> |
| 736 | 768 | </li> |
| 737 | 769 | </ul>'; |
| 738 | - else |
|
| 739 | - echo ' |
|
| 770 | + } else { |
|
| 771 | + echo ' |
|
| 740 | 772 | </dl>'; |
| 773 | + } |
|
| 741 | 774 | |
| 742 | 775 | echo ' |
| 743 | 776 | </fieldset> |
@@ -777,9 +810,10 @@ discard block |
||
| 777 | 810 | if (!empty($modSettings['postmod_active'])) |
| 778 | 811 | { |
| 779 | 812 | // Got advanced permissions - if so warn! |
| 780 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 781 | - echo ' |
|
| 813 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 814 | + echo ' |
|
| 782 | 815 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
| 816 | + } |
|
| 783 | 817 | |
| 784 | 818 | echo ' |
| 785 | 819 | <div class="padding"> |
@@ -794,10 +828,11 @@ discard block |
||
| 794 | 828 | ', $txt['permissions_post_moderation_select'], ': |
| 795 | 829 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
| 796 | 830 | |
| 797 | - foreach ($context['profiles'] as $profile) |
|
| 798 | - if ($profile['can_modify']) |
|
| 831 | + foreach ($context['profiles'] as $profile) { |
|
| 832 | + if ($profile['can_modify']) |
|
| 799 | 833 | echo ' |
| 800 | 834 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 835 | + } |
|
| 801 | 836 | |
| 802 | 837 | echo ' |
| 803 | 838 | </select> |
@@ -818,11 +853,12 @@ discard block |
||
| 818 | 853 | ', $txt['permissions_post_moderation_replies_any'], ' |
| 819 | 854 | </th>'; |
| 820 | 855 | |
| 821 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 822 | - echo ' |
|
| 856 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 857 | + echo ' |
|
| 823 | 858 | <th class="centercol" colspan="3"> |
| 824 | 859 | ', $txt['permissions_post_moderation_attachments'], ' |
| 825 | 860 | </th>'; |
| 861 | + } |
|
| 826 | 862 | |
| 827 | 863 | echo ' |
| 828 | 864 | </tr> |
@@ -840,11 +876,12 @@ discard block |
||
| 840 | 876 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
| 841 | 877 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
| 842 | 878 | |
| 843 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 844 | - echo ' |
|
| 879 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 880 | + echo ' |
|
| 845 | 881 | <th><span class="generic_icons post_moderation_allow"></span></th> |
| 846 | 882 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
| 847 | 883 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
| 884 | + } |
|
| 848 | 885 | |
| 849 | 886 | echo ' |
| 850 | 887 | </tr> |
@@ -857,9 +894,10 @@ discard block |
||
| 857 | 894 | <tr class="windowbg"> |
| 858 | 895 | <td class="half_table"> |
| 859 | 896 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
| 860 | - if (!empty($group['children'])) |
|
| 861 | - echo ' |
|
| 897 | + if (!empty($group['children'])) { |
|
| 898 | + echo ' |
|
| 862 | 899 | <br><span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
| 900 | + } |
|
| 863 | 901 | |
| 864 | 902 | echo ' |
| 865 | 903 | </td> |
@@ -872,8 +910,7 @@ discard block |
||
| 872 | 910 | { |
| 873 | 911 | echo ' |
| 874 | 912 | <td colspan="3"></td>'; |
| 875 | - } |
|
| 876 | - else |
|
| 913 | + } else |
|
| 877 | 914 | { |
| 878 | 915 | echo ' |
| 879 | 916 | <td class="centercol"><input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', ' class="input_radio"></td> |
@@ -1,9 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
| 4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
| 4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
| 5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
| 6 | -else |
|
| 6 | +} else { |
|
| 7 | 7 | exit; |
| 8 | +} |
|
| 8 | 9 | |
| 9 | 10 | ?> |
| 10 | 11 | \ No newline at end of file |