@@ -54,9 +54,10 @@ discard block |
||
| 54 | 54 | <dd> |
| 55 | 55 | <div id="known_themes_list">'; |
| 56 | 56 | |
| 57 | - foreach ($context['themes'] as $theme) |
|
| 58 | - echo ' |
|
| 57 | + foreach ($context['themes'] as $theme) { |
|
| 58 | + echo ' |
|
| 59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>'; |
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | echo ' |
| 62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
| 73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
| 74 | 75 | |
| 75 | 76 | // Put an option for each theme in the select box. |
| 76 | - foreach ($context['themes'] as $theme) |
|
| 77 | - echo ' |
|
| 77 | + foreach ($context['themes'] as $theme) { |
|
| 78 | + echo ' |
|
| 78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
| 80 | + } |
|
| 79 | 81 | |
| 80 | 82 | echo ' |
| 81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
| 90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
| 91 | 93 | |
| 92 | 94 | // Same thing, this time for changing the theme of everyone. |
| 93 | - foreach ($context['themes'] as $theme) |
|
| 94 | - echo ' |
|
| 95 | + foreach ($context['themes'] as $theme) { |
|
| 96 | + echo ' |
|
| 95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
| 98 | + } |
|
| 96 | 99 | |
| 97 | 100 | echo ' |
| 98 | 101 | </select> |
@@ -189,11 +192,12 @@ discard block |
||
| 189 | 192 | global $context, $scripturl, $txt; |
| 190 | 193 | |
| 191 | 194 | // Show a nice confirmation message. |
| 192 | - if (isset($_GET['done'])) |
|
| 193 | - echo ' |
|
| 195 | + if (isset($_GET['done'])) { |
|
| 196 | + echo ' |
|
| 194 | 197 | <div class="infobox"> |
| 195 | 198 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
| 196 | 199 | </div>'; |
| 200 | + } |
|
| 197 | 201 | |
| 198 | 202 | echo ' |
| 199 | 203 | <div id="admincenter">'; |
@@ -356,11 +360,12 @@ discard block |
||
| 356 | 360 | if (empty($setting) || !is_array($setting)) |
| 357 | 361 | { |
| 358 | 362 | // Insert a separator (unless this is the first item in the list) |
| 359 | - if ($i !== $first_option_key) |
|
| 360 | - echo ' |
|
| 363 | + if ($i !== $first_option_key) { |
|
| 364 | + echo ' |
|
| 361 | 365 | </dl> |
| 362 | 366 | <hr> |
| 363 | 367 | <dl class="settings">'; |
| 368 | + } |
|
| 364 | 369 | |
| 365 | 370 | // Should we give a name to this section? |
| 366 | 371 | if (is_string($setting) && !empty($setting)) |
@@ -368,9 +373,9 @@ discard block |
||
| 368 | 373 | $titled_section = true; |
| 369 | 374 | echo ' |
| 370 | 375 | <dt><b>' . $setting . '</b></dt><dd></dd>'; |
| 376 | + } else { |
|
| 377 | + $titled_section = false; |
|
| 371 | 378 | } |
| 372 | - else |
|
| 373 | - $titled_section = false; |
|
| 374 | 379 | |
| 375 | 380 | continue; |
| 376 | 381 | } |
@@ -379,19 +384,21 @@ discard block |
||
| 379 | 384 | <dt ', $context['theme_options_reset'] ? 'style="width:50%"' : '', '>'; |
| 380 | 385 | |
| 381 | 386 | // Show the change option box ? |
| 382 | - if ($context['theme_options_reset']) |
|
| 383 | - echo ' |
|
| 387 | + if ($context['theme_options_reset']) { |
|
| 388 | + echo ' |
|
| 384 | 389 | <span class="floatleft"><select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
| 385 | 390 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
| 386 | 391 | <option value="1">', $txt['themeadmin_reset_options_change'], '</option> |
| 387 | 392 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
| 388 | 393 | </select> </span>'; |
| 394 | + } |
|
| 389 | 395 | |
| 390 | 396 | echo ' |
| 391 | 397 | <label for="options_', $setting['id'], '">', !$titled_section ? '<b>' : '', $setting['label'], !$titled_section ? '</b>' : '', '</label>'; |
| 392 | - if (isset($setting['description'])) |
|
| 393 | - echo ' |
|
| 398 | + if (isset($setting['description'])) { |
|
| 399 | + echo ' |
|
| 394 | 400 | <br><span class="smalltext">', $setting['description'], '</span>'; |
| 401 | + } |
|
| 395 | 402 | echo ' |
| 396 | 403 | </dt>'; |
| 397 | 404 | |
@@ -433,13 +440,11 @@ discard block |
||
| 433 | 440 | |
| 434 | 441 | echo ' |
| 435 | 442 | <input type="number"', $min . $max . $step; |
| 436 | - } |
|
| 437 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 443 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 438 | 444 | { |
| 439 | 445 | echo' |
| 440 | 446 | <input type="url"'; |
| 441 | - } |
|
| 442 | - else |
|
| 447 | + } else |
|
| 443 | 448 | { |
| 444 | 449 | echo ' |
| 445 | 450 | <input type="text"'; |
@@ -483,8 +488,8 @@ discard block |
||
| 483 | 488 | <br>'; |
| 484 | 489 | |
| 485 | 490 | // @todo Why can't I edit the default theme popup. |
| 486 | - if ($context['theme_settings']['theme_id'] != 1) |
|
| 487 | - echo ' |
|
| 491 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
| 492 | + echo ' |
|
| 488 | 493 | <div class="cat_bar"> |
| 489 | 494 | <h3 class="catbg config_hd"> |
| 490 | 495 | ', $txt['theme_edit'], ' |
@@ -500,6 +505,7 @@ discard block |
||
| 500 | 505 | </li> |
| 501 | 506 | </ul> |
| 502 | 507 | </div>'; |
| 508 | + } |
|
| 503 | 509 | |
| 504 | 510 | echo ' |
| 505 | 511 | <div class="cat_bar"> |
@@ -553,9 +559,10 @@ discard block |
||
| 553 | 559 | <dd> |
| 554 | 560 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
| 555 | 561 | |
| 556 | - foreach ($context['theme_variants'] as $key => $variant) |
|
| 557 | - echo ' |
|
| 562 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
| 563 | + echo ' |
|
| 558 | 564 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 565 | + } |
|
| 559 | 566 | |
| 560 | 567 | echo ' |
| 561 | 568 | </select> |
@@ -590,11 +597,12 @@ discard block |
||
| 590 | 597 | if (empty($setting) || !is_array($setting)) |
| 591 | 598 | { |
| 592 | 599 | // We don't need a separator before the first list element |
| 593 | - if ($i !== $first_setting_key) |
|
| 594 | - echo ' |
|
| 600 | + if ($i !== $first_setting_key) { |
|
| 601 | + echo ' |
|
| 595 | 602 | </dl> |
| 596 | 603 | <hr> |
| 597 | 604 | <dl class="settings">'; |
| 605 | + } |
|
| 598 | 606 | |
| 599 | 607 | // Add a fake heading? |
| 600 | 608 | if (is_string($setting) && !empty($setting)) |
@@ -602,9 +610,9 @@ discard block |
||
| 602 | 610 | $titled_section = true; |
| 603 | 611 | echo ' |
| 604 | 612 | <dt><b>' . $setting . '</b></dt><dd></dd>'; |
| 613 | + } else { |
|
| 614 | + $titled_section = false; |
|
| 605 | 615 | } |
| 606 | - else |
|
| 607 | - $titled_section = false; |
|
| 608 | 616 | |
| 609 | 617 | continue; |
| 610 | 618 | } |
@@ -613,9 +621,10 @@ discard block |
||
| 613 | 621 | <dt> |
| 614 | 622 | <label for="', $setting['id'], '">', !$titled_section ? '<b>' : '', $setting['label'], !$titled_section ? '</b>' : '', '</label>:'; |
| 615 | 623 | |
| 616 | - if (isset($setting['description'])) |
|
| 617 | - echo '<br> |
|
| 624 | + if (isset($setting['description'])) { |
|
| 625 | + echo '<br> |
|
| 618 | 626 | <span class="smalltext">', $setting['description'], '</span>'; |
| 627 | + } |
|
| 619 | 628 | |
| 620 | 629 | echo ' |
| 621 | 630 | </dt>'; |
@@ -636,9 +645,10 @@ discard block |
||
| 636 | 645 | <dd> |
| 637 | 646 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
| 638 | 647 | |
| 639 | - foreach ($setting['options'] as $value => $label) |
|
| 640 | - echo ' |
|
| 648 | + foreach ($setting['options'] as $value => $label) { |
|
| 649 | + echo ' |
|
| 641 | 650 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 651 | + } |
|
| 642 | 652 | |
| 643 | 653 | echo ' |
| 644 | 654 | </select> |
@@ -667,13 +677,11 @@ discard block |
||
| 667 | 677 | |
| 668 | 678 | echo ' |
| 669 | 679 | <input type="number"', $min . $max . $step; |
| 670 | - } |
|
| 671 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 680 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 672 | 681 | { |
| 673 | 682 | echo' |
| 674 | 683 | <input type="url"'; |
| 675 | - } |
|
| 676 | - else |
|
| 684 | + } else |
|
| 677 | 685 | { |
| 678 | 686 | echo ' |
| 679 | 687 | <input type="text"'; |
@@ -826,21 +834,23 @@ discard block |
||
| 826 | 834 | <div class="windowbg">'; |
| 827 | 835 | |
| 828 | 836 | // Oops! there was an error :( |
| 829 | - if (!empty($context['error_message'])) |
|
| 830 | - echo ' |
|
| 837 | + if (!empty($context['error_message'])) { |
|
| 838 | + echo ' |
|
| 831 | 839 | <p> |
| 832 | 840 | ', $context['error_message'], ' |
| 833 | 841 | </p>'; |
| 842 | + } |
|
| 834 | 843 | |
| 835 | 844 | // Not much to show except a link back... |
| 836 | - else |
|
| 837 | - echo ' |
|
| 845 | + else { |
|
| 846 | + echo ' |
|
| 838 | 847 | <p> |
| 839 | 848 | <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], ' |
| 840 | 849 | </p> |
| 841 | 850 | <p> |
| 842 | 851 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
| 843 | 852 | </p>'; |
| 853 | + } |
|
| 844 | 854 | |
| 845 | 855 | echo ' |
| 846 | 856 | </div> |
@@ -907,10 +917,11 @@ discard block |
||
| 907 | 917 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
| 908 | 918 | <span class="floatright">'; |
| 909 | 919 | |
| 910 | - if ($template['can_copy']) |
|
| 911 | - echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
|
| 912 | - else |
|
| 913 | - echo $txt['themeadmin_edit_no_copy']; |
|
| 920 | + if ($template['can_copy']) { |
|
| 921 | + echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
|
| 922 | + } else { |
|
| 923 | + echo $txt['themeadmin_edit_no_copy']; |
|
| 924 | + } |
|
| 914 | 925 | |
| 915 | 926 | echo ' |
| 916 | 927 | </span> |
@@ -933,11 +944,12 @@ discard block |
||
| 933 | 944 | echo ' |
| 934 | 945 | <div id="admincenter">'; |
| 935 | 946 | |
| 936 | - if (!empty($context['browse_title'])) |
|
| 937 | - echo ' |
|
| 947 | + if (!empty($context['browse_title'])) { |
|
| 948 | + echo ' |
|
| 938 | 949 | <div class="cat_bar"> |
| 939 | 950 | <h3 class="catbg">', $context['browse_title'], '</h3> |
| 940 | 951 | </div>'; |
| 952 | + } |
|
| 941 | 953 | |
| 942 | 954 | echo ' |
| 943 | 955 | <table class="table_grid tborder"> |
@@ -957,14 +969,13 @@ discard block |
||
| 957 | 969 | <tr class="windowbg"> |
| 958 | 970 | <td>'; |
| 959 | 971 | |
| 960 | - if ($file['is_editable']) |
|
| 961 | - echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
|
| 962 | - |
|
| 963 | - elseif ($file['is_directory']) |
|
| 964 | - echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
|
| 965 | - |
|
| 966 | - else |
|
| 967 | - echo $file['filename']; |
|
| 972 | + if ($file['is_editable']) { |
|
| 973 | + echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
|
| 974 | + } elseif ($file['is_directory']) { |
|
| 975 | + echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
|
| 976 | + } else { |
|
| 977 | + echo $file['filename']; |
|
| 978 | + } |
|
| 968 | 979 | |
| 969 | 980 | echo ' |
| 970 | 981 | </td> |
@@ -986,11 +997,12 @@ discard block |
||
| 986 | 997 | { |
| 987 | 998 | global $context, $settings, $scripturl, $txt; |
| 988 | 999 | |
| 989 | - if ($context['session_error']) |
|
| 990 | - echo ' |
|
| 1000 | + if ($context['session_error']) { |
|
| 1001 | + echo ' |
|
| 991 | 1002 | <div class="errorbox"> |
| 992 | 1003 | ', $txt['error_session_timeout'], ' |
| 993 | 1004 | </div>'; |
| 1005 | + } |
|
| 994 | 1006 | |
| 995 | 1007 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
| 996 | 1008 | echo ' |
@@ -1053,17 +1065,18 @@ discard block |
||
| 1053 | 1065 | try |
| 1054 | 1066 | { |
| 1055 | 1067 | '; |
| 1056 | - if (isBrowser('is_ie')) |
|
| 1057 | - echo ' |
|
| 1068 | + if (isBrowser('is_ie')) { |
|
| 1069 | + echo ' |
|
| 1058 | 1070 | var sheets = frames["css_preview_box"].document.styleSheets; |
| 1059 | 1071 | for (var j = 0; j < sheets.length; j++) |
| 1060 | 1072 | { |
| 1061 | 1073 | if (sheets[j].id == "css_preview_box") |
| 1062 | 1074 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
| 1063 | 1075 | }'; |
| 1064 | - else |
|
| 1065 | - echo ' |
|
| 1076 | + } else { |
|
| 1077 | + echo ' |
|
| 1066 | 1078 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
| 1079 | + } |
|
| 1067 | 1080 | echo ' |
| 1068 | 1081 | } |
| 1069 | 1082 | catch (e) |
@@ -1115,9 +1128,10 @@ discard block |
||
| 1115 | 1128 | </div> |
| 1116 | 1129 | <div class="windowbg">'; |
| 1117 | 1130 | |
| 1118 | - if (!$context['allow_save']) |
|
| 1119 | - echo ' |
|
| 1131 | + if (!$context['allow_save']) { |
|
| 1132 | + echo ' |
|
| 1120 | 1133 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1134 | + } |
|
| 1121 | 1135 | |
| 1122 | 1136 | echo ' |
| 1123 | 1137 | <textarea name="entire_file" cols="80" rows="20" style="width: 96%; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br> |
@@ -1130,9 +1144,10 @@ discard block |
||
| 1130 | 1144 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1131 | 1145 | |
| 1132 | 1146 | // Hopefully it exists. |
| 1133 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1134 | - echo ' |
|
| 1147 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1148 | + echo ' |
|
| 1135 | 1149 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1150 | + } |
|
| 1136 | 1151 | |
| 1137 | 1152 | echo ' |
| 1138 | 1153 | </form> |
@@ -1146,18 +1161,20 @@ discard block |
||
| 1146 | 1161 | { |
| 1147 | 1162 | global $context, $scripturl, $txt; |
| 1148 | 1163 | |
| 1149 | - if ($context['session_error']) |
|
| 1150 | - echo ' |
|
| 1164 | + if ($context['session_error']) { |
|
| 1165 | + echo ' |
|
| 1151 | 1166 | <div class="errorbox"> |
| 1152 | 1167 | ', $txt['error_session_timeout'], ' |
| 1153 | 1168 | </div>'; |
| 1169 | + } |
|
| 1154 | 1170 | |
| 1155 | - if (isset($context['parse_error'])) |
|
| 1156 | - echo ' |
|
| 1171 | + if (isset($context['parse_error'])) { |
|
| 1172 | + echo ' |
|
| 1157 | 1173 | <div class="errorbox"> |
| 1158 | 1174 | ', $txt['themeadmin_edit_error'], ' |
| 1159 | 1175 | <div><pre>', $context['parse_error'], '</pre></div> |
| 1160 | 1176 | </div>'; |
| 1177 | + } |
|
| 1161 | 1178 | |
| 1162 | 1179 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1163 | 1180 | echo ' |
@@ -1168,16 +1185,18 @@ discard block |
||
| 1168 | 1185 | </div> |
| 1169 | 1186 | <div class="windowbg">'; |
| 1170 | 1187 | |
| 1171 | - if (!$context['allow_save']) |
|
| 1172 | - echo ' |
|
| 1188 | + if (!$context['allow_save']) { |
|
| 1189 | + echo ' |
|
| 1173 | 1190 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1191 | + } |
|
| 1174 | 1192 | |
| 1175 | - foreach ($context['file_parts'] as $part) |
|
| 1176 | - echo ' |
|
| 1193 | + foreach ($context['file_parts'] as $part) { |
|
| 1194 | + echo ' |
|
| 1177 | 1195 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
| 1178 | 1196 | <div class="centertext"> |
| 1179 | 1197 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
| 1180 | 1198 | </div>'; |
| 1199 | + } |
|
| 1181 | 1200 | |
| 1182 | 1201 | echo ' |
| 1183 | 1202 | <div class="padding righttext"> |
@@ -1186,9 +1205,10 @@ discard block |
||
| 1186 | 1205 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1187 | 1206 | |
| 1188 | 1207 | // Hopefully it exists. |
| 1189 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1190 | - echo ' |
|
| 1208 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1209 | + echo ' |
|
| 1191 | 1210 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1211 | + } |
|
| 1192 | 1212 | |
| 1193 | 1213 | echo ' |
| 1194 | 1214 | </div> |
@@ -1204,18 +1224,20 @@ discard block |
||
| 1204 | 1224 | { |
| 1205 | 1225 | global $context, $scripturl, $txt; |
| 1206 | 1226 | |
| 1207 | - if ($context['session_error']) |
|
| 1208 | - echo ' |
|
| 1227 | + if ($context['session_error']) { |
|
| 1228 | + echo ' |
|
| 1209 | 1229 | <div class="errorbox"> |
| 1210 | 1230 | ', $txt['error_session_timeout'], ' |
| 1211 | 1231 | </div>'; |
| 1232 | + } |
|
| 1212 | 1233 | |
| 1213 | 1234 | //Is this file writeable? |
| 1214 | - if (!$context['allow_save']) |
|
| 1215 | - echo ' |
|
| 1235 | + if (!$context['allow_save']) { |
|
| 1236 | + echo ' |
|
| 1216 | 1237 | <div class="errorbox"> |
| 1217 | 1238 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
| 1218 | 1239 | </div>'; |
| 1240 | + } |
|
| 1219 | 1241 | |
| 1220 | 1242 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1221 | 1243 | echo ' |
@@ -1231,9 +1253,10 @@ discard block |
||
| 1231 | 1253 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1232 | 1254 | |
| 1233 | 1255 | // Hopefully it exists. |
| 1234 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1235 | - echo ' |
|
| 1256 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1257 | + echo ' |
|
| 1236 | 1258 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1259 | + } |
|
| 1237 | 1260 | |
| 1238 | 1261 | echo ' |
| 1239 | 1262 | </div> |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | <div id="personal_messages">'; |
| 22 | 22 | |
| 23 | 23 | // Show the capacity bar, if available. |
| 24 | - if (!empty($context['limit_bar'])) |
|
| 25 | - echo ' |
|
| 24 | + if (!empty($context['limit_bar'])) { |
|
| 25 | + echo ' |
|
| 26 | 26 | <div class="cat_bar"> |
| 27 | 27 | <h3 class="catbg"> |
| 28 | 28 | <span class="floatleft">', $txt['pm_capacity'], ':</span> |
@@ -32,14 +32,16 @@ discard block |
||
| 32 | 32 | <span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span> |
| 33 | 33 | </h3> |
| 34 | 34 | </div>'; |
| 35 | + } |
|
| 35 | 36 | |
| 36 | 37 | // Message sent? Show a small indication. |
| 37 | - if (isset($context['pm_sent'])) |
|
| 38 | - echo ' |
|
| 38 | + if (isset($context['pm_sent'])) { |
|
| 39 | + echo ' |
|
| 39 | 40 | <div class="infobox"> |
| 40 | 41 | ', $txt['pm_sent'], ' |
| 41 | 42 | </div>'; |
| 42 | -} |
|
| 43 | + } |
|
| 44 | + } |
|
| 43 | 45 | |
| 44 | 46 | /** |
| 45 | 47 | * Just the end of the index bar, nothing special. |
@@ -72,8 +74,7 @@ discard block |
||
| 72 | 74 | { |
| 73 | 75 | echo ' |
| 74 | 76 | <div class="no_unread">', $txt['pm_no_unread'], '</div>'; |
| 75 | - } |
|
| 76 | - else |
|
| 77 | + } else |
|
| 77 | 78 | { |
| 78 | 79 | foreach ($context['unread_pms'] as $id_pm => $pm_details) |
| 79 | 80 | { |
@@ -193,14 +194,15 @@ discard block |
||
| 193 | 194 | if ($context['get_pmessage']('message', true)) |
| 194 | 195 | { |
| 195 | 196 | // Show the helpful titlebar - generally. |
| 196 | - if ($context['display_mode'] != 1) |
|
| 197 | - echo ' |
|
| 197 | + if ($context['display_mode'] != 1) { |
|
| 198 | + echo ' |
|
| 198 | 199 | <div class="cat_bar"> |
| 199 | 200 | <h3 class="catbg"> |
| 200 | 201 | <span id="author">', $txt['author'], '</span> |
| 201 | 202 | <span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span> |
| 202 | 203 | </h3> |
| 203 | 204 | </div>'; |
| 205 | + } |
|
| 204 | 206 | |
| 205 | 207 | // Show a few buttons if we are in conversation mode and outputting the first message. |
| 206 | 208 | if ($context['display_mode'] == 2) |
@@ -229,9 +231,10 @@ discard block |
||
| 229 | 231 | <div class="custom_fields_above_member"> |
| 230 | 232 | <ul class="nolist">'; |
| 231 | 233 | |
| 232 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
| 233 | - echo ' |
|
| 234 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
| 235 | + echo ' |
|
| 234 | 236 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 237 | + } |
|
| 235 | 238 | |
| 236 | 239 | echo ' |
| 237 | 240 | </ul> |
@@ -243,9 +246,10 @@ discard block |
||
| 243 | 246 | <a id="msg', $message['id'], '"></a>'; |
| 244 | 247 | |
| 245 | 248 | // Show online and offline buttons? |
| 246 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
| 247 | - echo ' |
|
| 249 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
| 250 | + echo ' |
|
| 248 | 251 | <span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>'; |
| 252 | + } |
|
| 249 | 253 | |
| 250 | 254 | // Show a link to the member's profile (but only if the sender isn't a guest). |
| 251 | 255 | echo ' |
@@ -258,48 +262,56 @@ discard block |
||
| 258 | 262 | <ul class="user_info">'; |
| 259 | 263 | |
| 260 | 264 | // Show the user's avatar. |
| 261 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
| 262 | - echo ' |
|
| 265 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
| 266 | + echo ' |
|
| 263 | 267 | <li class="avatar"> |
| 264 | 268 | <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a> |
| 265 | 269 | </li>'; |
| 270 | + } |
|
| 266 | 271 | |
| 267 | 272 | // Are there any custom fields below the avatar? |
| 268 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
| 269 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 273 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
| 274 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 270 | 275 | echo ' |
| 271 | 276 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 277 | + } |
|
| 272 | 278 | |
| 273 | - if (!$message['member']['is_guest']) |
|
| 274 | - echo ' |
|
| 279 | + if (!$message['member']['is_guest']) { |
|
| 280 | + echo ' |
|
| 275 | 281 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
| 282 | + } |
|
| 276 | 283 | // Show the member's primary group (like 'Administrator') if they have one. |
| 277 | - if (isset($message['member']['group']) && $message['member']['group'] != '') |
|
| 278 | - echo ' |
|
| 284 | + if (isset($message['member']['group']) && $message['member']['group'] != '') { |
|
| 285 | + echo ' |
|
| 279 | 286 | <li class="membergroup">', $message['member']['group'], '</li>'; |
| 287 | + } |
|
| 280 | 288 | |
| 281 | 289 | // Show the member's custom title, if they have one. |
| 282 | - if (isset($message['member']['title']) && $message['member']['title'] != '') |
|
| 283 | - echo ' |
|
| 290 | + if (isset($message['member']['title']) && $message['member']['title'] != '') { |
|
| 291 | + echo ' |
|
| 284 | 292 | <li class="title">', $message['member']['title'], '</li>'; |
| 293 | + } |
|
| 285 | 294 | |
| 286 | 295 | // Don't show these things for guests. |
| 287 | 296 | if (!$message['member']['is_guest']) |
| 288 | 297 | { |
| 289 | 298 | // 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. |
| 290 | - if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') |
|
| 291 | - echo ' |
|
| 299 | + if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') { |
|
| 300 | + echo ' |
|
| 292 | 301 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
| 302 | + } |
|
| 293 | 303 | |
| 294 | 304 | // Show how many posts they have made. |
| 295 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 296 | - echo ' |
|
| 305 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 306 | + echo ' |
|
| 297 | 307 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
| 308 | + } |
|
| 298 | 309 | |
| 299 | 310 | // Show their personal text? |
| 300 | - if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') |
|
| 301 | - echo ' |
|
| 311 | + if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') { |
|
| 312 | + echo ' |
|
| 302 | 313 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
| 314 | + } |
|
| 303 | 315 | |
| 304 | 316 | // Any custom fields to show as icons? |
| 305 | 317 | if (!empty($message['custom_fields']['icons'])) |
@@ -308,9 +320,10 @@ discard block |
||
| 308 | 320 | <li class="im_icons"> |
| 309 | 321 | <ol>'; |
| 310 | 322 | |
| 311 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
| 312 | - echo ' |
|
| 323 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
| 324 | + echo ' |
|
| 313 | 325 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 326 | + } |
|
| 314 | 327 | |
| 315 | 328 | echo ' |
| 316 | 329 | </ol> |
@@ -318,19 +331,22 @@ discard block |
||
| 318 | 331 | } |
| 319 | 332 | |
| 320 | 333 | // Show the IP to this user for this post - because you can moderate? |
| 321 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
| 322 | - echo ' |
|
| 334 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
| 335 | + echo ' |
|
| 323 | 336 | <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>'; |
| 337 | + } |
|
| 324 | 338 | |
| 325 | 339 | // Or, should we show it because this is you? |
| 326 | - elseif ($message['can_see_ip']) |
|
| 327 | - echo ' |
|
| 340 | + elseif ($message['can_see_ip']) { |
|
| 341 | + echo ' |
|
| 328 | 342 | <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>'; |
| 343 | + } |
|
| 329 | 344 | |
| 330 | 345 | // Okay, you are logged in, then we can show something about why IPs are logged... |
| 331 | - else |
|
| 332 | - echo ' |
|
| 346 | + else { |
|
| 347 | + echo ' |
|
| 333 | 348 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
| 349 | + } |
|
| 334 | 350 | |
| 335 | 351 | // Show the profile, website, email address, and personal message buttons. |
| 336 | 352 | if ($message['member']['show_profile_buttons']) |
@@ -340,24 +356,28 @@ discard block |
||
| 340 | 356 | <ol class="profile_icons">'; |
| 341 | 357 | |
| 342 | 358 | // Show the profile button |
| 343 | - if ($message['member']['can_view_profile']) |
|
| 344 | - echo ' |
|
| 359 | + if ($message['member']['can_view_profile']) { |
|
| 360 | + echo ' |
|
| 345 | 361 | <li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>'; |
| 362 | + } |
|
| 346 | 363 | |
| 347 | 364 | // Don't show an icon if they haven't specified a website. |
| 348 | - if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) |
|
| 349 | - echo ' |
|
| 365 | + if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) { |
|
| 366 | + echo ' |
|
| 350 | 367 | <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>'; |
| 368 | + } |
|
| 351 | 369 | |
| 352 | 370 | // Don't show the email address if they want it hidden. |
| 353 | - if ($message['member']['show_email']) |
|
| 354 | - echo ' |
|
| 371 | + if ($message['member']['show_email']) { |
|
| 372 | + echo ' |
|
| 355 | 373 | <li><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>'; |
| 374 | + } |
|
| 356 | 375 | |
| 357 | 376 | // Since we know this person isn't a guest, you *can* message them. |
| 358 | - if ($context['can_send_pm']) |
|
| 359 | - echo ' |
|
| 377 | + if ($context['can_send_pm']) { |
|
| 378 | + echo ' |
|
| 360 | 379 | <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>'; |
| 380 | + } |
|
| 361 | 381 | |
| 362 | 382 | echo ' |
| 363 | 383 | </ol> |
@@ -365,21 +385,24 @@ discard block |
||
| 365 | 385 | } |
| 366 | 386 | |
| 367 | 387 | // Any custom fields for standard placement? |
| 368 | - if (!empty($message['custom_fields']['standard'])) |
|
| 369 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
| 388 | + if (!empty($message['custom_fields']['standard'])) { |
|
| 389 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
| 370 | 390 | echo ' |
| 371 | 391 | <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
| 392 | + } |
|
| 372 | 393 | |
| 373 | 394 | // Are we showing the warning status? |
| 374 | - if ($message['member']['can_see_warning']) |
|
| 375 | - echo ' |
|
| 395 | + if ($message['member']['can_see_warning']) { |
|
| 396 | + echo ' |
|
| 376 | 397 | <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>'; |
| 398 | + } |
|
| 377 | 399 | |
| 378 | 400 | // Are there any custom fields to show at the bottom of the poster info? |
| 379 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
| 380 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 401 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
| 402 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 381 | 403 | echo ' |
| 382 | 404 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 405 | + } |
|
| 383 | 406 | } |
| 384 | 407 | |
| 385 | 408 | // Done with the information about the poster... on to the post itself. |
@@ -398,24 +421,28 @@ discard block |
||
| 398 | 421 | <span class="smalltext">« <strong> ', $txt['sent_to'], ':</strong> '; |
| 399 | 422 | |
| 400 | 423 | // People it was sent directly to.... |
| 401 | - if (!empty($message['recipients']['to'])) |
|
| 402 | - echo implode(', ', $message['recipients']['to']); |
|
| 424 | + if (!empty($message['recipients']['to'])) { |
|
| 425 | + echo implode(', ', $message['recipients']['to']); |
|
| 426 | + } |
|
| 403 | 427 | // Otherwise, we're just going to say "some people"... |
| 404 | - elseif ($context['folder'] != 'sent') |
|
| 405 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 428 | + elseif ($context['folder'] != 'sent') { |
|
| 429 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 430 | + } |
|
| 406 | 431 | |
| 407 | 432 | echo ' |
| 408 | 433 | <strong> ', $txt['on'], ':</strong> ', $message['time'], ' » |
| 409 | 434 | </span>'; |
| 410 | 435 | |
| 411 | 436 | // If we're in the sent items, show who it was sent to besides the "To:" people. |
| 412 | - if (!empty($message['recipients']['bcc'])) |
|
| 413 | - echo ' |
|
| 437 | + if (!empty($message['recipients']['bcc'])) { |
|
| 438 | + echo ' |
|
| 414 | 439 | <br><span class="smalltext">« <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' »</span>'; |
| 440 | + } |
|
| 415 | 441 | |
| 416 | - if (!empty($message['is_replied_to'])) |
|
| 417 | - echo ' |
|
| 442 | + if (!empty($message['is_replied_to'])) { |
|
| 443 | + echo ' |
|
| 418 | 444 | <br><span class="smalltext">« ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' »</span>'; |
| 445 | + } |
|
| 419 | 446 | |
| 420 | 447 | echo ' |
| 421 | 448 | </div> |
@@ -423,13 +450,15 @@ discard block |
||
| 423 | 450 | <div class="post"> |
| 424 | 451 | <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>'; |
| 425 | 452 | |
| 426 | - if ($message['can_report'] || $context['can_send_pm']) |
|
| 427 | - echo ' |
|
| 453 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
| 454 | + echo ' |
|
| 428 | 455 | <div class="under_message">'; |
| 456 | + } |
|
| 429 | 457 | |
| 430 | - if ($message['can_report']) |
|
| 431 | - echo ' |
|
| 458 | + if ($message['can_report']) { |
|
| 459 | + echo ' |
|
| 432 | 460 | <a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>'; |
| 461 | + } |
|
| 433 | 462 | |
| 434 | 463 | echo ' |
| 435 | 464 | <ul class="quickbuttons">'; |
@@ -441,32 +470,36 @@ discard block |
||
| 441 | 470 | if (!$message['member']['is_guest']) |
| 442 | 471 | { |
| 443 | 472 | // Is there than more than one recipient you can reply to? |
| 444 | - if ($message['number_recipients'] > 1) |
|
| 445 | - echo ' |
|
| 473 | + if ($message['number_recipients'] > 1) { |
|
| 474 | + echo ' |
|
| 446 | 475 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>'; |
| 476 | + } |
|
| 447 | 477 | |
| 448 | 478 | echo ' |
| 449 | 479 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li> |
| 450 | 480 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
| 451 | 481 | } |
| 452 | 482 | // This is for "forwarding" - even if the member is gone. |
| 453 | - else |
|
| 454 | - echo ' |
|
| 483 | + else { |
|
| 484 | + echo ' |
|
| 455 | 485 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>'; |
| 486 | + } |
|
| 456 | 487 | } |
| 457 | 488 | echo ' |
| 458 | 489 | <li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>'; |
| 459 | 490 | |
| 460 | - if (empty($context['display_mode'])) |
|
| 461 | - echo ' |
|
| 491 | + if (empty($context['display_mode'])) { |
|
| 492 | + echo ' |
|
| 462 | 493 | <li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;" class="input_check"></li>'; |
| 494 | + } |
|
| 463 | 495 | |
| 464 | 496 | echo ' |
| 465 | 497 | </ul>'; |
| 466 | 498 | |
| 467 | - if ($message['can_report'] || $context['can_send_pm']) |
|
| 468 | - echo ' |
|
| 499 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
| 500 | + echo ' |
|
| 469 | 501 | </div>'; |
| 502 | + } |
|
| 470 | 503 | |
| 471 | 504 | // Are there any custom profile fields for above the signature? |
| 472 | 505 | if (!empty($message['custom_fields']['above_signature'])) |
@@ -475,9 +508,10 @@ discard block |
||
| 475 | 508 | <div class="custom_fields_above_signature"> |
| 476 | 509 | <ul class="nolist">'; |
| 477 | 510 | |
| 478 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
| 479 | - echo ' |
|
| 511 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
| 512 | + echo ' |
|
| 480 | 513 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 514 | + } |
|
| 481 | 515 | |
| 482 | 516 | echo ' |
| 483 | 517 | </ul> |
@@ -485,9 +519,10 @@ discard block |
||
| 485 | 519 | } |
| 486 | 520 | |
| 487 | 521 | // Show the member's signature? |
| 488 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
| 489 | - echo ' |
|
| 522 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
| 523 | + echo ' |
|
| 490 | 524 | <div class="signature">', $message['member']['signature'], '</div>'; |
| 525 | + } |
|
| 491 | 526 | |
| 492 | 527 | // Are there any custom profile fields for below the signature? |
| 493 | 528 | if (!empty($message['custom_fields']['below_signature'])) |
@@ -496,9 +531,10 @@ discard block |
||
| 496 | 531 | <div class="custom_fields_below_signature"> |
| 497 | 532 | <ul class="nolist">'; |
| 498 | 533 | |
| 499 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
| 500 | - echo ' |
|
| 534 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
| 535 | + echo ' |
|
| 501 | 536 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 537 | + } |
|
| 502 | 538 | |
| 503 | 539 | echo ' |
| 504 | 540 | </ul> |
@@ -523,19 +559,21 @@ discard block |
||
| 523 | 559 | { |
| 524 | 560 | echo ' |
| 525 | 561 | <option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>'; |
| 526 | - foreach ($context['labels'] as $label) |
|
| 527 | - if (!isset($message['labels'][$label['id']])) |
|
| 562 | + foreach ($context['labels'] as $label) { |
|
| 563 | + if (!isset($message['labels'][$label['id']])) |
|
| 528 | 564 | echo ' |
| 529 | 565 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
| 566 | + } |
|
| 530 | 567 | } |
| 531 | 568 | // ... and are there any that can be removed? |
| 532 | 569 | if (!empty($message['labels']) && (count($message['labels']) > 1 || !isset($message['labels'][-1]))) |
| 533 | 570 | { |
| 534 | 571 | echo ' |
| 535 | 572 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
| 536 | - foreach ($message['labels'] as $label) |
|
| 537 | - echo ' |
|
| 573 | + foreach ($message['labels'] as $label) { |
|
| 574 | + echo ' |
|
| 538 | 575 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
| 576 | + } |
|
| 539 | 577 | } |
| 540 | 578 | echo ' |
| 541 | 579 | </select> |
@@ -555,13 +593,14 @@ discard block |
||
| 555 | 593 | </div>'; |
| 556 | 594 | } |
| 557 | 595 | |
| 558 | - if (empty($context['display_mode'])) |
|
| 559 | - echo ' |
|
| 596 | + if (empty($context['display_mode'])) { |
|
| 597 | + echo ' |
|
| 560 | 598 | |
| 561 | 599 | <div class="pagesection"> |
| 562 | 600 | <div class="floatleft">', $context['page_index'], '</div> |
| 563 | 601 | <div class="floatright"><input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button_submit"></div> |
| 564 | 602 | </div>'; |
| 603 | + } |
|
| 565 | 604 | |
| 566 | 605 | // Show a few buttons if we are in conversation mode and outputting the first message. |
| 567 | 606 | elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons'])) |
@@ -621,11 +660,12 @@ discard block |
||
| 621 | 660 | </tr> |
| 622 | 661 | </thead> |
| 623 | 662 | <tbody>'; |
| 624 | - if (!$context['show_delete']) |
|
| 625 | - echo ' |
|
| 663 | + if (!$context['show_delete']) { |
|
| 664 | + echo ' |
|
| 626 | 665 | <tr class="windowbg"> |
| 627 | 666 | <td colspan="5">', $txt['pm_alert_none'], '</td> |
| 628 | 667 | </tr>'; |
| 668 | + } |
|
| 629 | 669 | |
| 630 | 670 | while ($message = $context['get_pmessage']('subject')) |
| 631 | 671 | { |
@@ -678,9 +718,10 @@ discard block |
||
| 678 | 718 | |
| 679 | 719 | foreach ($context['labels'] as $label) |
| 680 | 720 | { |
| 681 | - if ($label['id'] != $context['current_label_id']) |
|
| 682 | - echo ' |
|
| 721 | + if ($label['id'] != $context['current_label_id']) { |
|
| 722 | + echo ' |
|
| 683 | 723 | <option value="add_', $label['id'], '"> ', $label['name'], '</option>'; |
| 724 | + } |
|
| 684 | 725 | } |
| 685 | 726 | |
| 686 | 727 | echo ' |
@@ -765,9 +806,10 @@ discard block |
||
| 765 | 806 | <dt class="between">', $txt['pm_search_post_age'], ':</dt> |
| 766 | 807 | <dd>', $txt['pm_search_between'], ' <input type="number" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999"> ', $txt['pm_search_between_and'], ' <input type="number" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd> |
| 767 | 808 | </dl>'; |
| 768 | - if (!$context['currently_using_labels']) |
|
| 769 | - echo ' |
|
| 809 | + if (!$context['currently_using_labels']) { |
|
| 810 | + echo ' |
|
| 770 | 811 | <input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button_submit">'; |
| 812 | + } |
|
| 771 | 813 | echo ' |
| 772 | 814 | <br class="clear_right"> |
| 773 | 815 | </div> |
@@ -787,12 +829,13 @@ discard block |
||
| 787 | 829 | <div id="advanced_panel_div"> |
| 788 | 830 | <ul id="searchLabelsExpand">'; |
| 789 | 831 | |
| 790 | - foreach ($context['search_labels'] as $label) |
|
| 791 | - echo ' |
|
| 832 | + foreach ($context['search_labels'] as $label) { |
|
| 833 | + echo ' |
|
| 792 | 834 | <li> |
| 793 | 835 | <label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', ' class="input_check"> |
| 794 | 836 | ', $label['name'], '</label> |
| 795 | 837 | </li>'; |
| 838 | + } |
|
| 796 | 839 | |
| 797 | 840 | echo ' |
| 798 | 841 | </ul> |
@@ -852,8 +895,8 @@ discard block |
||
| 852 | 895 | </div>'; |
| 853 | 896 | |
| 854 | 897 | // complete results ? |
| 855 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
| 856 | - echo ' |
|
| 898 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
| 899 | + echo ' |
|
| 857 | 900 | <table class="table_grid"> |
| 858 | 901 | <thead> |
| 859 | 902 | <tr class="title_bar"> |
@@ -863,6 +906,7 @@ discard block |
||
| 863 | 906 | </tr> |
| 864 | 907 | </thead> |
| 865 | 908 | <tbody>'; |
| 909 | + } |
|
| 866 | 910 | |
| 867 | 911 | // Print each message out... |
| 868 | 912 | foreach ($context['personal_messages'] as $message) |
@@ -882,11 +926,13 @@ discard block |
||
| 882 | 926 | |
| 883 | 927 | // Show the recipients. |
| 884 | 928 | // @todo This doesn't deal with the sent item searching quite right for bcc. |
| 885 | - if (!empty($message['recipients']['to'])) |
|
| 886 | - echo implode(', ', $message['recipients']['to']); |
|
| 929 | + if (!empty($message['recipients']['to'])) { |
|
| 930 | + echo implode(', ', $message['recipients']['to']); |
|
| 931 | + } |
|
| 887 | 932 | // Otherwise, we're just going to say "some people"... |
| 888 | - elseif ($context['folder'] != 'sent') |
|
| 889 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 933 | + elseif ($context['folder'] != 'sent') { |
|
| 934 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 935 | + } |
|
| 890 | 936 | |
| 891 | 937 | echo ' |
| 892 | 938 | </h3> |
@@ -900,14 +946,16 @@ discard block |
||
| 900 | 946 | $quote_button = create_button('quote.png', 'reply_quote', 'reply_quote', 'class="centericon"'); |
| 901 | 947 | $reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"'); |
| 902 | 948 | // You can only reply if they are not a guest... |
| 903 | - if (!$message['member']['is_guest']) |
|
| 904 | - echo ' |
|
| 949 | + if (!$message['member']['is_guest']) { |
|
| 950 | + echo ' |
|
| 905 | 951 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
| 906 | 952 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
| 953 | + } |
|
| 907 | 954 | // This is for "forwarding" - even if the member is gone. |
| 908 | - else |
|
| 909 | - echo ' |
|
| 955 | + else { |
|
| 956 | + echo ' |
|
| 910 | 957 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
| 958 | + } |
|
| 911 | 959 | } |
| 912 | 960 | |
| 913 | 961 | echo ' |
@@ -928,17 +976,19 @@ discard block |
||
| 928 | 976 | } |
| 929 | 977 | |
| 930 | 978 | // Finish off the page... |
| 931 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
| 932 | - echo ' |
|
| 979 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
| 980 | + echo ' |
|
| 933 | 981 | </tbody> |
| 934 | 982 | </table>'; |
| 983 | + } |
|
| 935 | 984 | |
| 936 | 985 | // No results? |
| 937 | - if (empty($context['personal_messages'])) |
|
| 938 | - echo ' |
|
| 986 | + if (empty($context['personal_messages'])) { |
|
| 987 | + echo ' |
|
| 939 | 988 | <div class="windowbg"> |
| 940 | 989 | <p class="centertext">', $txt['pm_search_none_found'], '</p> |
| 941 | 990 | </div>'; |
| 991 | + } |
|
| 942 | 992 | |
| 943 | 993 | echo ' |
| 944 | 994 | <div class="pagesection"> |
@@ -962,12 +1012,14 @@ discard block |
||
| 962 | 1012 | <h3 class="catbg">', $txt['pm_send_report'], '</h3> |
| 963 | 1013 | </div> |
| 964 | 1014 | <div class="windowbg">'; |
| 965 | - if (!empty($context['send_log']['sent'])) |
|
| 966 | - foreach ($context['send_log']['sent'] as $log_entry) |
|
| 1015 | + if (!empty($context['send_log']['sent'])) { |
|
| 1016 | + foreach ($context['send_log']['sent'] as $log_entry) |
|
| 967 | 1017 | echo '<span class="error">', $log_entry, '</span><br>'; |
| 968 | - if (!empty($context['send_log']['failed'])) |
|
| 969 | - foreach ($context['send_log']['failed'] as $log_entry) |
|
| 1018 | + } |
|
| 1019 | + if (!empty($context['send_log']['failed'])) { |
|
| 1020 | + foreach ($context['send_log']['failed'] as $log_entry) |
|
| 970 | 1021 | echo '<span class="error">', $log_entry, '</span><br>'; |
| 1022 | + } |
|
| 971 | 1023 | echo ' |
| 972 | 1024 | </div> |
| 973 | 1025 | <br>'; |
@@ -1015,12 +1067,13 @@ discard block |
||
| 1015 | 1067 | </dl> |
| 1016 | 1068 | </div>'; |
| 1017 | 1069 | |
| 1018 | - if (!empty($modSettings['drafts_pm_enabled'])) |
|
| 1019 | - echo ' |
|
| 1070 | + if (!empty($modSettings['drafts_pm_enabled'])) { |
|
| 1071 | + echo ' |
|
| 1020 | 1072 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
| 1021 | 1073 | sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), ' |
| 1022 | 1074 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
| 1023 | 1075 | </div>'; |
| 1076 | + } |
|
| 1024 | 1077 | |
| 1025 | 1078 | echo ' |
| 1026 | 1079 | <dl id="post_header">'; |
@@ -1075,9 +1128,10 @@ discard block |
||
| 1075 | 1128 | } |
| 1076 | 1129 | |
| 1077 | 1130 | // What about smileys? |
| 1078 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
| 1079 | - echo ' |
|
| 1131 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
| 1132 | + echo ' |
|
| 1080 | 1133 | <div id="smileyBox_message"></div>'; |
| 1134 | + } |
|
| 1081 | 1135 | |
| 1082 | 1136 | // Show BBC buttons, smileys and textbox. |
| 1083 | 1137 | echo ' |
@@ -1124,10 +1178,11 @@ discard block |
||
| 1124 | 1178 | <dt><strong>', $txt['subject'], '</strong></dt> |
| 1125 | 1179 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
| 1126 | 1180 | |
| 1127 | - foreach ($context['drafts'] as $draft) |
|
| 1128 | - echo ' |
|
| 1181 | + foreach ($context['drafts'] as $draft) { |
|
| 1182 | + echo ' |
|
| 1129 | 1183 | <dt>', $draft['link'], '</dt> |
| 1130 | 1184 | <dd>', $draft['poster_time'], '</dd>'; |
| 1185 | + } |
|
| 1131 | 1186 | echo ' |
| 1132 | 1187 | </dl> |
| 1133 | 1188 | </div>'; |
@@ -1233,8 +1288,8 @@ discard block |
||
| 1233 | 1288 | }'; |
| 1234 | 1289 | |
| 1235 | 1290 | // Code for showing and hiding drafts |
| 1236 | - if (!empty($context['drafts'])) |
|
| 1237 | - echo ' |
|
| 1291 | + if (!empty($context['drafts'])) { |
|
| 1292 | + echo ' |
|
| 1238 | 1293 | var oSwapDraftOptions = new smc_Toggle({ |
| 1239 | 1294 | bToggleEnabled: true, |
| 1240 | 1295 | bCurrentlyCollapsed: true, |
@@ -1256,13 +1311,14 @@ discard block |
||
| 1256 | 1311 | } |
| 1257 | 1312 | ] |
| 1258 | 1313 | });'; |
| 1314 | + } |
|
| 1259 | 1315 | |
| 1260 | 1316 | echo ' |
| 1261 | 1317 | </script>'; |
| 1262 | 1318 | |
| 1263 | 1319 | // Show the message you're replying to. |
| 1264 | - if ($context['reply']) |
|
| 1265 | - echo ' |
|
| 1320 | + if ($context['reply']) { |
|
| 1321 | + echo ' |
|
| 1266 | 1322 | <br> |
| 1267 | 1323 | <br> |
| 1268 | 1324 | <div class="cat_bar"> |
@@ -1276,6 +1332,7 @@ discard block |
||
| 1276 | 1332 | <hr> |
| 1277 | 1333 | ', $context['quoted_message']['body'], ' |
| 1278 | 1334 | </div><br class="clear">'; |
| 1335 | + } |
|
| 1279 | 1336 | |
| 1280 | 1337 | echo ' |
| 1281 | 1338 | <script> |
@@ -1286,22 +1343,24 @@ discard block |
||
| 1286 | 1343 | sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', |
| 1287 | 1344 | sToControlId: \'to_control\', |
| 1288 | 1345 | aToRecipients: ['; |
| 1289 | - foreach ($context['recipients']['to'] as $i => $member) |
|
| 1290 | - echo ' |
|
| 1346 | + foreach ($context['recipients']['to'] as $i => $member) { |
|
| 1347 | + echo ' |
|
| 1291 | 1348 | { |
| 1292 | 1349 | sItemId: ', JavaScriptEscape($member['id']), ', |
| 1293 | 1350 | sItemName: ', JavaScriptEscape($member['name']), ' |
| 1294 | 1351 | }', $i == count($context['recipients']['to']) - 1 ? '' : ','; |
| 1352 | + } |
|
| 1295 | 1353 | |
| 1296 | 1354 | echo ' |
| 1297 | 1355 | ], |
| 1298 | 1356 | aBccRecipients: ['; |
| 1299 | - foreach ($context['recipients']['bcc'] as $i => $member) |
|
| 1300 | - echo ' |
|
| 1357 | + foreach ($context['recipients']['bcc'] as $i => $member) { |
|
| 1358 | + echo ' |
|
| 1301 | 1359 | { |
| 1302 | 1360 | sItemId: ', JavaScriptEscape($member['id']), ', |
| 1303 | 1361 | sItemName: ', JavaScriptEscape($member['name']), ' |
| 1304 | 1362 | }', $i == count($context['recipients']['bcc']) - 1 ? '' : ','; |
| 1363 | + } |
|
| 1305 | 1364 | |
| 1306 | 1365 | echo ' |
| 1307 | 1366 | ], |
@@ -1388,26 +1447,28 @@ discard block |
||
| 1388 | 1447 | </th> |
| 1389 | 1448 | <th class="centertext table_icon">'; |
| 1390 | 1449 | |
| 1391 | - if (count($context['labels']) > 2) |
|
| 1392 | - echo ' |
|
| 1450 | + if (count($context['labels']) > 2) { |
|
| 1451 | + echo ' |
|
| 1393 | 1452 | <input type="checkbox" class="input_check" onclick="invertAll(this, this.form);">'; |
| 1453 | + } |
|
| 1394 | 1454 | |
| 1395 | 1455 | echo ' |
| 1396 | 1456 | </th> |
| 1397 | 1457 | </tr> |
| 1398 | 1458 | </thead> |
| 1399 | 1459 | <tbody>'; |
| 1400 | - if (count($context['labels']) < 2) |
|
| 1401 | - echo ' |
|
| 1460 | + if (count($context['labels']) < 2) { |
|
| 1461 | + echo ' |
|
| 1402 | 1462 | <tr class="windowbg"> |
| 1403 | 1463 | <td colspan="2">', $txt['pm_labels_no_exist'], '</td> |
| 1404 | 1464 | </tr>'; |
| 1405 | - else |
|
| 1465 | + } else |
|
| 1406 | 1466 | { |
| 1407 | 1467 | foreach ($context['labels'] as $label) |
| 1408 | 1468 | { |
| 1409 | - if ($label['id'] == -1) |
|
| 1410 | - continue; |
|
| 1469 | + if ($label['id'] == -1) { |
|
| 1470 | + continue; |
|
| 1471 | + } |
|
| 1411 | 1472 | |
| 1412 | 1473 | echo ' |
| 1413 | 1474 | <tr class="windowbg"> |
@@ -1422,12 +1483,13 @@ discard block |
||
| 1422 | 1483 | </tbody> |
| 1423 | 1484 | </table>'; |
| 1424 | 1485 | |
| 1425 | - if (!count($context['labels']) < 2) |
|
| 1426 | - echo ' |
|
| 1486 | + if (!count($context['labels']) < 2) { |
|
| 1487 | + echo ' |
|
| 1427 | 1488 | <div class="padding"> |
| 1428 | 1489 | <input type="submit" name="save" value="', $txt['save'], '" class="button_submit"> |
| 1429 | 1490 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button_submit you_sure"> |
| 1430 | 1491 | </div>'; |
| 1492 | + } |
|
| 1431 | 1493 | |
| 1432 | 1494 | echo ' |
| 1433 | 1495 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1482,9 +1544,10 @@ discard block |
||
| 1482 | 1544 | <dd> |
| 1483 | 1545 | <select name="id_admin"> |
| 1484 | 1546 | <option value="0">', $txt['pm_report_all_admins'], '</option>'; |
| 1485 | - foreach ($context['admins'] as $id => $name) |
|
| 1486 | - echo ' |
|
| 1547 | + foreach ($context['admins'] as $id => $name) { |
|
| 1548 | + echo ' |
|
| 1487 | 1549 | <option value="', $id, '">', $name, '</option>'; |
| 1550 | + } |
|
| 1488 | 1551 | echo ' |
| 1489 | 1552 | </select> |
| 1490 | 1553 | </dd>'; |
@@ -1546,9 +1609,10 @@ discard block |
||
| 1546 | 1609 | </th> |
| 1547 | 1610 | <th class="centertext table_icon">'; |
| 1548 | 1611 | |
| 1549 | - if (!empty($context['rules'])) |
|
| 1550 | - echo ' |
|
| 1612 | + if (!empty($context['rules'])) { |
|
| 1613 | + echo ' |
|
| 1551 | 1614 | <input type="checkbox" onclick="invertAll(this, this.form);" class="input_check">'; |
| 1615 | + } |
|
| 1552 | 1616 | |
| 1553 | 1617 | echo ' |
| 1554 | 1618 | </th> |
@@ -1556,13 +1620,14 @@ discard block |
||
| 1556 | 1620 | </thead> |
| 1557 | 1621 | <tbody>'; |
| 1558 | 1622 | |
| 1559 | - if (empty($context['rules'])) |
|
| 1560 | - echo ' |
|
| 1623 | + if (empty($context['rules'])) { |
|
| 1624 | + echo ' |
|
| 1561 | 1625 | <tr class="windowbg"> |
| 1562 | 1626 | <td colspan="2"> |
| 1563 | 1627 | ', $txt['pm_rules_none'], ' |
| 1564 | 1628 | </td> |
| 1565 | 1629 | </tr>'; |
| 1630 | + } |
|
| 1566 | 1631 | |
| 1567 | 1632 | foreach ($context['rules'] as $rule) |
| 1568 | 1633 | { |
@@ -1583,14 +1648,16 @@ discard block |
||
| 1583 | 1648 | <div class="righttext"> |
| 1584 | 1649 | <a class="button_link" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>'; |
| 1585 | 1650 | |
| 1586 | - if (!empty($context['rules'])) |
|
| 1587 | - echo ' |
|
| 1651 | + if (!empty($context['rules'])) { |
|
| 1652 | + echo ' |
|
| 1588 | 1653 | [<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]'; |
| 1654 | + } |
|
| 1589 | 1655 | |
| 1590 | - if (!empty($context['rules'])) |
|
| 1591 | - echo ' |
|
| 1656 | + if (!empty($context['rules'])) { |
|
| 1657 | + echo ' |
|
| 1592 | 1658 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1593 | 1659 | <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button_submit smalltext you_sure">'; |
| 1660 | + } |
|
| 1594 | 1661 | |
| 1595 | 1662 | echo ' |
| 1596 | 1663 | </div> |
@@ -1612,14 +1679,16 @@ discard block |
||
| 1612 | 1679 | var groups = new Array() |
| 1613 | 1680 | var labels = new Array()'; |
| 1614 | 1681 | |
| 1615 | - foreach ($context['groups'] as $id => $title) |
|
| 1616 | - echo ' |
|
| 1682 | + foreach ($context['groups'] as $id => $title) { |
|
| 1683 | + echo ' |
|
| 1617 | 1684 | groups[', $id, '] = "', addslashes($title), '";'; |
| 1685 | + } |
|
| 1618 | 1686 | |
| 1619 | - foreach ($context['labels'] as $label) |
|
| 1620 | - if ($label['id'] != -1) |
|
| 1687 | + foreach ($context['labels'] as $label) { |
|
| 1688 | + if ($label['id'] != -1) |
|
| 1621 | 1689 | echo ' |
| 1622 | 1690 | labels[', ($label['id']), '] = "', addslashes($label['name']), '";'; |
| 1691 | + } |
|
| 1623 | 1692 | |
| 1624 | 1693 | echo ' |
| 1625 | 1694 | function addCriteriaOption() |
@@ -1634,8 +1703,9 @@ discard block |
||
| 1634 | 1703 | |
| 1635 | 1704 | setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select> <span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value="" class="input_text"><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>'; |
| 1636 | 1705 | |
| 1637 | - foreach ($context['groups'] as $id => $group) |
|
| 1638 | - echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
| 1706 | + foreach ($context['groups'] as $id => $group) { |
|
| 1707 | + echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
| 1708 | + } |
|
| 1639 | 1709 | |
| 1640 | 1710 | echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\'); |
| 1641 | 1711 | } |
@@ -1652,9 +1722,10 @@ discard block |
||
| 1652 | 1722 | |
| 1653 | 1723 | setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select> <span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>'; |
| 1654 | 1724 | |
| 1655 | - foreach ($context['labels'] as $label) |
|
| 1656 | - if ($label['id'] != -1) |
|
| 1725 | + foreach ($context['labels'] as $label) { |
|
| 1726 | + if ($label['id'] != -1) |
|
| 1657 | 1727 | echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>'; |
| 1728 | + } |
|
| 1658 | 1729 | |
| 1659 | 1730 | echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\'); |
| 1660 | 1731 | } |
@@ -1768,18 +1839,20 @@ discard block |
||
| 1768 | 1839 | $isFirst = true; |
| 1769 | 1840 | foreach ($context['rule']['criteria'] as $k => $criteria) |
| 1770 | 1841 | { |
| 1771 | - if (!$isFirst && $criteria['t'] == '') |
|
| 1772 | - echo '<div id="removeonjs1">'; |
|
| 1773 | - elseif (!$isFirst) |
|
| 1774 | - echo '<br>'; |
|
| 1842 | + if (!$isFirst && $criteria['t'] == '') { |
|
| 1843 | + echo '<div id="removeonjs1">'; |
|
| 1844 | + } elseif (!$isFirst) { |
|
| 1845 | + echo '<br>'; |
|
| 1846 | + } |
|
| 1775 | 1847 | |
| 1776 | 1848 | echo ' |
| 1777 | 1849 | <select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();"> |
| 1778 | 1850 | <option value="">', $txt['pm_rule_criteria_pick'], ':</option>'; |
| 1779 | 1851 | |
| 1780 | - foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) |
|
| 1781 | - echo ' |
|
| 1852 | + foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) { |
|
| 1853 | + echo ' |
|
| 1782 | 1854 | <option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>'; |
| 1855 | + } |
|
| 1783 | 1856 | |
| 1784 | 1857 | echo ' |
| 1785 | 1858 | </select> |
@@ -1790,18 +1863,20 @@ discard block |
||
| 1790 | 1863 | <select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();"> |
| 1791 | 1864 | <option value="">', $txt['pm_rule_sel_group'], '</option>'; |
| 1792 | 1865 | |
| 1793 | - foreach ($context['groups'] as $id => $group) |
|
| 1794 | - echo ' |
|
| 1866 | + foreach ($context['groups'] as $id => $group) { |
|
| 1867 | + echo ' |
|
| 1795 | 1868 | <option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>'; |
| 1869 | + } |
|
| 1796 | 1870 | echo ' |
| 1797 | 1871 | </select> |
| 1798 | 1872 | </span>'; |
| 1799 | 1873 | |
| 1800 | 1874 | // If this is the dummy we add a means to hide for non js users. |
| 1801 | - if ($isFirst) |
|
| 1802 | - $isFirst = false; |
|
| 1803 | - elseif ($criteria['t'] == '') |
|
| 1804 | - echo '</div>'; |
|
| 1875 | + if ($isFirst) { |
|
| 1876 | + $isFirst = false; |
|
| 1877 | + } elseif ($criteria['t'] == '') { |
|
| 1878 | + echo '</div>'; |
|
| 1879 | + } |
|
| 1805 | 1880 | } |
| 1806 | 1881 | |
| 1807 | 1882 | echo ' |
@@ -1824,10 +1899,11 @@ discard block |
||
| 1824 | 1899 | $isFirst = true; |
| 1825 | 1900 | foreach ($context['rule']['actions'] as $k => $action) |
| 1826 | 1901 | { |
| 1827 | - if (!$isFirst && $action['t'] == '') |
|
| 1828 | - echo '<div id="removeonjs2">'; |
|
| 1829 | - elseif (!$isFirst) |
|
| 1830 | - echo '<br>'; |
|
| 1902 | + if (!$isFirst && $action['t'] == '') { |
|
| 1903 | + echo '<div id="removeonjs2">'; |
|
| 1904 | + } elseif (!$isFirst) { |
|
| 1905 | + echo '<br>'; |
|
| 1906 | + } |
|
| 1831 | 1907 | |
| 1832 | 1908 | echo ' |
| 1833 | 1909 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
@@ -1838,20 +1914,22 @@ discard block |
||
| 1838 | 1914 | <span id="labdiv', $k, '"> |
| 1839 | 1915 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
| 1840 | 1916 | <option value="">', $txt['pm_rule_sel_label'], '</option>'; |
| 1841 | - foreach ($context['labels'] as $label) |
|
| 1842 | - if ($label['id'] != -1) |
|
| 1917 | + foreach ($context['labels'] as $label) { |
|
| 1918 | + if ($label['id'] != -1) |
|
| 1843 | 1919 | echo ' |
| 1844 | 1920 | <option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>'; |
| 1921 | + } |
|
| 1845 | 1922 | |
| 1846 | 1923 | echo ' |
| 1847 | 1924 | </select> |
| 1848 | 1925 | </span>'; |
| 1849 | 1926 | |
| 1850 | - if ($isFirst) |
|
| 1851 | - $isFirst = false; |
|
| 1852 | - elseif ($action['t'] == '') |
|
| 1853 | - echo ' |
|
| 1927 | + if ($isFirst) { |
|
| 1928 | + $isFirst = false; |
|
| 1929 | + } elseif ($action['t'] == '') { |
|
| 1930 | + echo ' |
|
| 1854 | 1931 | </div>'; |
| 1932 | + } |
|
| 1855 | 1933 | } |
| 1856 | 1934 | |
| 1857 | 1935 | echo ' |
@@ -1875,22 +1953,25 @@ discard block |
||
| 1875 | 1953 | echo ' |
| 1876 | 1954 | <script>'; |
| 1877 | 1955 | |
| 1878 | - foreach ($context['rule']['criteria'] as $k => $c) |
|
| 1879 | - echo ' |
|
| 1956 | + foreach ($context['rule']['criteria'] as $k => $c) { |
|
| 1957 | + echo ' |
|
| 1880 | 1958 | updateRuleDef(', $k, ');'; |
| 1959 | + } |
|
| 1881 | 1960 | |
| 1882 | - foreach ($context['rule']['actions'] as $k => $c) |
|
| 1883 | - echo ' |
|
| 1961 | + foreach ($context['rule']['actions'] as $k => $c) { |
|
| 1962 | + echo ' |
|
| 1884 | 1963 | updateActionDef(', $k, ');'; |
| 1964 | + } |
|
| 1885 | 1965 | |
| 1886 | 1966 | echo ' |
| 1887 | 1967 | rebuildRuleDesc();'; |
| 1888 | 1968 | |
| 1889 | 1969 | // If this isn't a new rule and we have JS enabled remove the JS compatibility stuff. |
| 1890 | - if ($context['rid']) |
|
| 1891 | - echo ' |
|
| 1970 | + if ($context['rid']) { |
|
| 1971 | + echo ' |
|
| 1892 | 1972 | document.getElementById("removeonjs1").style.display = "none"; |
| 1893 | 1973 | document.getElementById("removeonjs2").style.display = "none";'; |
| 1974 | + } |
|
| 1894 | 1975 | |
| 1895 | 1976 | echo ' |
| 1896 | 1977 | document.getElementById("addonjs1").style.display = ""; |
@@ -1918,12 +1999,12 @@ discard block |
||
| 1918 | 1999 | </div>'; |
| 1919 | 2000 | |
| 1920 | 2001 | // No drafts? Just show an informative message. |
| 1921 | - if (empty($context['drafts'])) |
|
| 1922 | - echo ' |
|
| 2002 | + if (empty($context['drafts'])) { |
|
| 2003 | + echo ' |
|
| 1923 | 2004 | <div class="windowbg2 centertext"> |
| 1924 | 2005 | ', $txt['draft_none'], ' |
| 1925 | 2006 | </div>'; |
| 1926 | - else |
|
| 2007 | + } else |
|
| 1927 | 2008 | { |
| 1928 | 2009 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
| 1929 | 2010 | foreach ($context['drafts'] as $draft) |
@@ -73,8 +73,9 @@ discard block |
||
| 73 | 73 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 74 | 74 | { |
| 75 | 75 | $groups = array_merge(array($row['id_group'], $row['id_post_group']), (empty($row['additional_groups']) ? array() : explode(',', $row['additional_groups']))); |
| 76 | - if (!in_array(1, $groups) && count(array_intersect($groups, explode(',', $row['member_groups']))) == 0) |
|
| 77 | - continue; |
|
| 76 | + if (!in_array(1, $groups) && count(array_intersect($groups, explode(',', $row['member_groups']))) == 0) { |
|
| 77 | + continue; |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | $members[] = $row['id_member']; |
| 80 | 81 | $watched[$row['id_member']] = $row; |
@@ -82,8 +83,9 @@ discard block |
||
| 82 | 83 | |
| 83 | 84 | $smcFunc['db_free_result']($request); |
| 84 | 85 | |
| 85 | - if (empty($members)) |
|
| 86 | - return true; |
|
| 86 | + if (empty($members)) { |
|
| 87 | + return true; |
|
| 88 | + } |
|
| 87 | 89 | |
| 88 | 90 | $members = array_unique($members); |
| 89 | 91 | $prefs = getNotifyPrefs($members, '', true); |
@@ -105,20 +107,23 @@ discard block |
||
| 105 | 107 | $notify_types = !empty($prefs[$member]['msg_notify_type']) ? $prefs[$member]['msg_notify_type'] : 1; |
| 106 | 108 | |
| 107 | 109 | // Don't send a notification if the watching member ignored the member who made the action. |
| 108 | - if (!empty($data['pm_ignore_list']) && in_array($data['id_member_updated'], explode(',', $data['pm_ignore_list']))) |
|
| 109 | - continue; |
|
| 110 | - if (!in_array($type, array('reply', 'topic')) && $notify_types == 2 && $member != $data['id_member_started']) |
|
| 111 | - continue; |
|
| 112 | - elseif (in_array($type, array('reply', 'topic')) && $member == $posterOptions['id']) |
|
| 113 | - continue; |
|
| 114 | - elseif (!in_array($type, array('reply', 'topic')) && $notify_types == 3) |
|
| 115 | - continue; |
|
| 116 | - elseif ($notify_types == 4) |
|
| 117 | - continue; |
|
| 110 | + if (!empty($data['pm_ignore_list']) && in_array($data['id_member_updated'], explode(',', $data['pm_ignore_list']))) { |
|
| 111 | + continue; |
|
| 112 | + } |
|
| 113 | + if (!in_array($type, array('reply', 'topic')) && $notify_types == 2 && $member != $data['id_member_started']) { |
|
| 114 | + continue; |
|
| 115 | + } elseif (in_array($type, array('reply', 'topic')) && $member == $posterOptions['id']) { |
|
| 116 | + continue; |
|
| 117 | + } elseif (!in_array($type, array('reply', 'topic')) && $notify_types == 3) { |
|
| 118 | + continue; |
|
| 119 | + } elseif ($notify_types == 4) { |
|
| 120 | + continue; |
|
| 121 | + } |
|
| 118 | 122 | |
| 119 | 123 | if ($frequency > 2 || (!empty($frequency) && $data['sent']) || in_array($member, $done_members) |
| 120 | - || (!empty($this->_details['members_only']) && !in_array($member, $this->_details['members_only']))) |
|
| 121 | - continue; |
|
| 124 | + || (!empty($this->_details['members_only']) && !in_array($member, $this->_details['members_only']))) { |
|
| 125 | + continue; |
|
| 126 | + } |
|
| 122 | 127 | |
| 123 | 128 | // Watched topic? |
| 124 | 129 | if (!empty($data['id_topic']) && $type != 'topic' && !empty($prefs[$member])) |
@@ -128,10 +133,12 @@ discard block |
||
| 128 | 133 | |
| 129 | 134 | if ($type == 'reply') |
| 130 | 135 | { |
| 131 | - if (!empty($prefs[$member]['msg_receive_body'])) |
|
| 132 | - $message_type .= '_body'; |
|
| 133 | - if (!empty($frequency)) |
|
| 134 | - $message_type .= '_once'; |
|
| 136 | + if (!empty($prefs[$member]['msg_receive_body'])) { |
|
| 137 | + $message_type .= '_body'; |
|
| 138 | + } |
|
| 139 | + if (!empty($frequency)) { |
|
| 140 | + $message_type .= '_once'; |
|
| 141 | + } |
|
| 135 | 142 | } |
| 136 | 143 | |
| 137 | 144 | $content_type = 'topic'; |
@@ -144,12 +151,14 @@ discard block |
||
| 144 | 151 | $content_type = 'board'; |
| 145 | 152 | |
| 146 | 153 | $message_type = !empty($frequency) ? 'notify_boards_once' : 'notify_boards'; |
| 147 | - if (!empty($prefs[$member]['msg_receive_body'])) |
|
| 148 | - $message_type .= '_body'; |
|
| 154 | + if (!empty($prefs[$member]['msg_receive_body'])) { |
|
| 155 | + $message_type .= '_body'; |
|
| 156 | + } |
|
| 149 | 157 | } |
| 150 | 158 | // If neither of the above, this might be a redundent row due to the OR clause in our SQL query, skip |
| 151 | - else |
|
| 152 | - continue; |
|
| 159 | + else { |
|
| 160 | + continue; |
|
| 161 | + } |
|
| 153 | 162 | |
| 154 | 163 | if ($pref & 0x02) |
| 155 | 164 | { |
@@ -212,14 +221,15 @@ discard block |
||
| 212 | 221 | ); |
| 213 | 222 | |
| 214 | 223 | // Insert the alerts if any |
| 215 | - if (!empty($alert_rows)) |
|
| 216 | - $smcFunc['db_insert']('', |
|
| 224 | + if (!empty($alert_rows)) { |
|
| 225 | + $smcFunc['db_insert']('', |
|
| 217 | 226 | '{db_prefix}user_alerts', |
| 218 | 227 | array('alert_time' => 'int', 'id_member' => 'int', 'id_member_started' => 'int', 'member_name' => 'string', |
| 219 | 228 | 'content_type' => 'string', 'content_id' => 'int', 'content_action' => 'string', 'is_read' => 'int', 'extra' => 'string'), |
| 220 | 229 | $alert_rows, |
| 221 | 230 | array() |
| 222 | 231 | ); |
| 232 | + } |
|
| 223 | 233 | |
| 224 | 234 | return true; |
| 225 | 235 | } |
@@ -230,8 +240,9 @@ discard block |
||
| 230 | 240 | |
| 231 | 241 | foreach ($quotedMembers as $id => $member) |
| 232 | 242 | { |
| 233 | - if (!isset($prefs[$id]) || $id == $posterOptions['id'] || empty($prefs[$id]['msg_quote'])) |
|
| 234 | - continue; |
|
| 243 | + if (!isset($prefs[$id]) || $id == $posterOptions['id'] || empty($prefs[$id]['msg_quote'])) { |
|
| 244 | + continue; |
|
| 245 | + } |
|
| 235 | 246 | |
| 236 | 247 | $done_members[] = $id; |
| 237 | 248 | |
@@ -283,32 +294,35 @@ discard block |
||
| 283 | 294 | { |
| 284 | 295 | if (preg_match('/\[quote(.*)?\]/i', $block, $matches)) |
| 285 | 296 | { |
| 286 | - if ($quote_level == 0) |
|
| 287 | - $message .= '[quote' . $matches[1] . ']'; |
|
| 297 | + if ($quote_level == 0) { |
|
| 298 | + $message .= '[quote' . $matches[1] . ']'; |
|
| 299 | + } |
|
| 288 | 300 | $quote_level++; |
| 289 | - } |
|
| 290 | - elseif (preg_match('/\[\/quote\]/i', $block)) |
|
| 301 | + } elseif (preg_match('/\[\/quote\]/i', $block)) |
|
| 291 | 302 | { |
| 292 | - if ($quote_level <= 1) |
|
| 293 | - $message .= '[/quote]'; |
|
| 303 | + if ($quote_level <= 1) { |
|
| 304 | + $message .= '[/quote]'; |
|
| 305 | + } |
|
| 294 | 306 | if ($quote_level >= 1) |
| 295 | 307 | { |
| 296 | 308 | $quote_level--; |
| 297 | 309 | $message .= "\n"; |
| 298 | 310 | } |
| 311 | + } elseif ($quote_level <= 1) { |
|
| 312 | + $message .= $block; |
|
| 299 | 313 | } |
| 300 | - elseif ($quote_level <= 1) |
|
| 301 | - $message .= $block; |
|
| 302 | 314 | } |
| 303 | 315 | |
| 304 | 316 | preg_match_all('/\[quote.*?link=msg=([0-9]+).*?\]/i', $message, $matches); |
| 305 | 317 | |
| 306 | 318 | $id_msgs = $matches[1]; |
| 307 | - foreach ($id_msgs as $k => $id_msg) |
|
| 308 | - $id_msgs[$k] = (int) $id_msg; |
|
| 319 | + foreach ($id_msgs as $k => $id_msg) { |
|
| 320 | + $id_msgs[$k] = (int) $id_msg; |
|
| 321 | + } |
|
| 309 | 322 | |
| 310 | - if (empty($id_msgs)) |
|
| 311 | - return array(); |
|
| 323 | + if (empty($id_msgs)) { |
|
| 324 | + return array(); |
|
| 325 | + } |
|
| 312 | 326 | |
| 313 | 327 | // Get the messages |
| 314 | 328 | $request = $smcFunc['db_query']('', ' |
@@ -326,8 +340,9 @@ discard block |
||
| 326 | 340 | $members = array(); |
| 327 | 341 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 328 | 342 | { |
| 329 | - if ($posterOptions['id'] == $row['id_member']) |
|
| 330 | - continue; |
|
| 343 | + if ($posterOptions['id'] == $row['id_member']) { |
|
| 344 | + continue; |
|
| 345 | + } |
|
| 331 | 346 | |
| 332 | 347 | $members[$row['id_member']] = $row; |
| 333 | 348 | } |
@@ -341,10 +356,11 @@ discard block |
||
| 341 | 356 | |
| 342 | 357 | foreach ($members as $id => $member) |
| 343 | 358 | { |
| 344 | - if (!empty($prefs[$id]['msg_mention'])) |
|
| 345 | - $done_members[] = $id; |
|
| 346 | - else |
|
| 347 | - continue; |
|
| 359 | + if (!empty($prefs[$id]['msg_mention'])) { |
|
| 360 | + $done_members[] = $id; |
|
| 361 | + } else { |
|
| 362 | + continue; |
|
| 363 | + } |
|
| 348 | 364 | |
| 349 | 365 | // Alerts' emails are always instant |
| 350 | 366 | if ($prefs[$id]['msg_mention'] & 0x02) |
@@ -51,30 +51,33 @@ discard block |
||
| 51 | 51 | $ignored_members = explode(',', $row['pm_ignore_list']); |
| 52 | 52 | |
| 53 | 53 | // If the user is in group 1 anywhere, they can see everything anyway. |
| 54 | - if (in_array(1, $groups) || count(array_intersect($allowed, $groups)) != 0) |
|
| 55 | - $author = $row['id_member']; |
|
| 54 | + if (in_array(1, $groups) || count(array_intersect($allowed, $groups)) != 0) { |
|
| 55 | + $author = $row['id_member']; |
|
| 56 | + } |
|
| 56 | 57 | } |
| 57 | 58 | $smcFunc['db_free_result']($request); |
| 58 | - } |
|
| 59 | - else |
|
| 59 | + } else |
|
| 60 | 60 | { |
| 61 | 61 | // This isn't something we know natively how to support. Call the hooks, if they're dealing with it, return false, otherwise return the user id. |
| 62 | 62 | $hook_results = call_integration_hook('integrate_find_like_author', array($this->_details['content_type'], $this->_details['content_id'])); |
| 63 | - foreach ($hook_results as $result) |
|
| 64 | - if (!empty($result)) |
|
| 63 | + foreach ($hook_results as $result) { |
|
| 64 | + if (!empty($result)) |
|
| 65 | 65 | { |
| 66 | 66 | $author = $result; |
| 67 | + } |
|
| 67 | 68 | break; |
| 68 | 69 | } |
| 69 | 70 | } |
| 70 | 71 | |
| 71 | 72 | // If we didn't have a member... leave. |
| 72 | - if (empty($author)) |
|
| 73 | - return true; |
|
| 73 | + if (empty($author)) { |
|
| 74 | + return true; |
|
| 75 | + } |
|
| 74 | 76 | |
| 75 | 77 | // If the person who sent the notification is the person whose content it is, do nothing. |
| 76 | - if ($author == $this->_details['sender_id']) |
|
| 77 | - return true; |
|
| 78 | + if ($author == $this->_details['sender_id']) { |
|
| 79 | + return true; |
|
| 80 | + } |
|
| 78 | 81 | |
| 79 | 82 | // If the person who sent the notification is on this person's ignore list, do nothing. |
| 80 | 83 | if (!empty($ignored_members) && in_array($this->_details['sender_id'], $ignored_members)) { |
@@ -88,8 +91,9 @@ discard block |
||
| 88 | 91 | // As a result, the value should really just be non empty. |
| 89 | 92 | |
| 90 | 93 | // Check the value. If no value or it's empty, they didn't want alerts, oh well. |
| 91 | - if (empty($prefs[$author][$this->_details['content_type'] . '_like'])) |
|
| 92 | - return true; |
|
| 94 | + if (empty($prefs[$author][$this->_details['content_type'] . '_like'])) { |
|
| 95 | + return true; |
|
| 96 | + } |
|
| 93 | 97 | |
| 94 | 98 | // Don't spam the alerts: if there is an existing unread alert of the |
| 95 | 99 | // requested type for the target user from the sender, don't make a new one. |
@@ -109,8 +113,9 @@ discard block |
||
| 109 | 113 | ) |
| 110 | 114 | ); |
| 111 | 115 | |
| 112 | - if ($smcFunc['db_num_rows']($request) > 0) |
|
| 113 | - return true; |
|
| 116 | + if ($smcFunc['db_num_rows']($request) > 0) { |
|
| 117 | + return true; |
|
| 118 | + } |
|
| 114 | 119 | $smcFunc['db_free_result']($request); |
| 115 | 120 | |
| 116 | 121 | // Issue, update, move on. |
@@ -25,18 +25,20 @@ discard block |
||
| 25 | 25 | </div> |
| 26 | 26 | <div class="windowbg2 noup">'; |
| 27 | 27 | |
| 28 | - if (!empty($context['move_board'])) |
|
| 29 | - echo ' |
|
| 28 | + if (!empty($context['move_board'])) { |
|
| 29 | + echo ' |
|
| 30 | 30 | <div class="noticebox"> |
| 31 | 31 | ', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', ' |
| 32 | 32 | </div>'; |
| 33 | + } |
|
| 33 | 34 | |
| 34 | 35 | // No categories so show a label. |
| 35 | - if (empty($context['categories'])) |
|
| 36 | - echo ' |
|
| 36 | + if (empty($context['categories'])) { |
|
| 37 | + echo ' |
|
| 37 | 38 | <div class="windowbg centertext"> |
| 38 | 39 | ', $txt['mboards_no_cats'], ' |
| 39 | 40 | </div>'; |
| 41 | + } |
|
| 40 | 42 | |
| 41 | 43 | // Loop through every category, listing the boards in each as we go. |
| 42 | 44 | foreach ($context['categories'] as $category) |
@@ -54,9 +56,10 @@ discard block |
||
| 54 | 56 | <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> |
| 55 | 57 | <ul id="category_', $category['id'], '" class="nolist">'; |
| 56 | 58 | |
| 57 | - if (!empty($category['move_link'])) |
|
| 58 | - echo ' |
|
| 59 | + if (!empty($category['move_link'])) { |
|
| 60 | + echo ' |
|
| 59 | 61 | <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>'; |
| 62 | + } |
|
| 60 | 63 | |
| 61 | 64 | $recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>'; |
| 62 | 65 | $redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">'; |
@@ -81,9 +84,10 @@ discard block |
||
| 81 | 84 | echo ' |
| 82 | 85 | <li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; |
| 83 | 86 | |
| 84 | - foreach ($board['move_links'] as $link) |
|
| 85 | - echo ' |
|
| 87 | + foreach ($board['move_links'] as $link) { |
|
| 88 | + echo ' |
|
| 86 | 89 | <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>'; |
| 90 | + } |
|
| 87 | 91 | |
| 88 | 92 | echo ' |
| 89 | 93 | </li>'; |
@@ -132,9 +136,10 @@ discard block |
||
| 132 | 136 | <select name="cat_order">'; |
| 133 | 137 | |
| 134 | 138 | // Print every existing category into a select box. |
| 135 | - foreach ($context['category_order'] as $order) |
|
| 136 | - echo ' |
|
| 139 | + foreach ($context['category_order'] as $order) { |
|
| 140 | + echo ' |
|
| 137 | 141 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
| 142 | + } |
|
| 138 | 143 | echo ' |
| 139 | 144 | </select> |
| 140 | 145 | </dd>'; |
@@ -169,14 +174,15 @@ discard block |
||
| 169 | 174 | { |
| 170 | 175 | foreach ($context['custom_category_settings'] as $catset_id => $catset) |
| 171 | 176 | { |
| 172 | - if (!empty($catset['dt']) && !empty($catset['dd'])) |
|
| 173 | - echo ' |
|
| 177 | + if (!empty($catset['dt']) && !empty($catset['dd'])) { |
|
| 178 | + echo ' |
|
| 174 | 179 | <dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '"> |
| 175 | 180 | ', $catset['dt'], ' |
| 176 | 181 | </dt> |
| 177 | 182 | <dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '> |
| 178 | 183 | ', $catset['dd'], ' |
| 179 | 184 | </dd>'; |
| 185 | + } |
|
| 180 | 186 | } |
| 181 | 187 | } |
| 182 | 188 | |
@@ -184,21 +190,23 @@ discard block |
||
| 184 | 190 | echo ' |
| 185 | 191 | </dl>'; |
| 186 | 192 | |
| 187 | - if (isset($context['category']['is_new'])) |
|
| 188 | - echo ' |
|
| 193 | + if (isset($context['category']['is_new'])) { |
|
| 194 | + echo ' |
|
| 189 | 195 | <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit">'; |
| 190 | - else |
|
| 191 | - echo ' |
|
| 196 | + } else { |
|
| 197 | + echo ' |
|
| 192 | 198 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit"> |
| 193 | 199 | <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button_submit you_sure">'; |
| 200 | + } |
|
| 194 | 201 | echo ' |
| 195 | 202 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 196 | 203 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 197 | 204 | |
| 198 | 205 | // If this category is empty we don't bother with the next confirmation screen. |
| 199 | - if ($context['category']['is_empty']) |
|
| 200 | - echo ' |
|
| 206 | + if ($context['category']['is_empty']) { |
|
| 207 | + echo ' |
|
| 201 | 208 | <input type="hidden" name="empty" value="1">'; |
| 209 | + } |
|
| 202 | 210 | |
| 203 | 211 | echo ' |
| 204 | 212 | </div> |
@@ -225,9 +233,10 @@ discard block |
||
| 225 | 233 | <p>', $txt['mboards_delete_cat_contains'], ':</p> |
| 226 | 234 | <ul>'; |
| 227 | 235 | |
| 228 | - foreach ($context['category']['children'] as $child) |
|
| 229 | - echo ' |
|
| 236 | + foreach ($context['category']['children'] as $child) { |
|
| 237 | + echo ' |
|
| 230 | 238 | <li>', $child, '</li>'; |
| 239 | + } |
|
| 231 | 240 | |
| 232 | 241 | echo ' |
| 233 | 242 | </ul> |
@@ -241,10 +250,11 @@ discard block |
||
| 241 | 250 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>: |
| 242 | 251 | <select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>'; |
| 243 | 252 | |
| 244 | - foreach ($context['category_order'] as $cat) |
|
| 245 | - if ($cat['id'] != 0) |
|
| 253 | + foreach ($context['category_order'] as $cat) { |
|
| 254 | + if ($cat['id'] != 0) |
|
| 246 | 255 | echo ' |
| 247 | 256 | <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; |
| 257 | + } |
|
| 248 | 258 | |
| 249 | 259 | echo ' |
| 250 | 260 | </select> |
@@ -288,9 +298,10 @@ discard block |
||
| 288 | 298 | </dt> |
| 289 | 299 | <dd> |
| 290 | 300 | <select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">'; |
| 291 | - foreach ($context['categories'] as $category) |
|
| 292 | - echo ' |
|
| 301 | + foreach ($context['categories'] as $category) { |
|
| 302 | + echo ' |
|
| 293 | 303 | <option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; |
| 304 | + } |
|
| 294 | 305 | echo ' |
| 295 | 306 | </select> |
| 296 | 307 | </dd>'; |
@@ -317,9 +328,10 @@ discard block |
||
| 317 | 328 | echo ' |
| 318 | 329 | <select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '> |
| 319 | 330 | ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; |
| 320 | - foreach ($context['board_order'] as $order) |
|
| 321 | - echo ' |
|
| 331 | + foreach ($context['board_order'] as $order) { |
|
| 332 | + echo ' |
|
| 322 | 333 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
| 334 | + } |
|
| 323 | 335 | echo ' |
| 324 | 336 | </select> |
| 325 | 337 | </dd>'; |
@@ -348,13 +360,15 @@ discard block |
||
| 348 | 360 | <dd> |
| 349 | 361 | <select name="profile">'; |
| 350 | 362 | |
| 351 | - if (isset($context['board']['is_new'])) |
|
| 352 | - echo ' |
|
| 363 | + if (isset($context['board']['is_new'])) { |
|
| 364 | + echo ' |
|
| 353 | 365 | <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; |
| 366 | + } |
|
| 354 | 367 | |
| 355 | - foreach ($context['profiles'] as $id => $profile) |
|
| 356 | - echo ' |
|
| 368 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 369 | + echo ' |
|
| 357 | 370 | <option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 371 | + } |
|
| 358 | 372 | |
| 359 | 373 | echo ' |
| 360 | 374 | </select> |
@@ -367,8 +381,8 @@ discard block |
||
| 367 | 381 | </dt> |
| 368 | 382 | <dd>'; |
| 369 | 383 | |
| 370 | - if (!empty($modSettings['deny_boards_access'])) |
|
| 371 | - echo ' |
|
| 384 | + if (!empty($modSettings['deny_boards_access'])) { |
|
| 385 | + echo ' |
|
| 372 | 386 | <table> |
| 373 | 387 | <tr> |
| 374 | 388 | <td></td> |
@@ -376,10 +390,11 @@ discard block |
||
| 376 | 390 | <th>', $txt['permissions_option_off'], '</th> |
| 377 | 391 | <th>', $txt['permissions_option_deny'], '</th> |
| 378 | 392 | </tr>'; |
| 393 | + } |
|
| 379 | 394 | |
| 380 | 395 | // List all the membergroups so the user can choose who may access this board. |
| 381 | - foreach ($context['groups'] as $group) |
|
| 382 | - if (empty($modSettings['deny_boards_access'])) |
|
| 396 | + foreach ($context['groups'] as $group) { |
|
| 397 | + if (empty($modSettings['deny_boards_access'])) |
|
| 383 | 398 | echo ' |
| 384 | 399 | <label for="groups_', $group['id'], '"> |
| 385 | 400 | <input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), ' class="input_check"> |
@@ -387,8 +402,9 @@ discard block |
||
| 387 | 402 | ', $group['name'], ' |
| 388 | 403 | </span> |
| 389 | 404 | </label><br>'; |
| 390 | - else |
|
| 391 | - echo ' |
|
| 405 | + } |
|
| 406 | + else { |
|
| 407 | + echo ' |
|
| 392 | 408 | <tr> |
| 393 | 409 | <td> |
| 394 | 410 | <label for="groups_', $group['id'], '_a"> |
@@ -408,16 +424,17 @@ discard block |
||
| 408 | 424 | </td> |
| 409 | 425 | <td></td> |
| 410 | 426 | </tr>'; |
| 427 | + } |
|
| 411 | 428 | |
| 412 | - if (empty($modSettings['deny_boards_access'])) |
|
| 413 | - echo ' |
|
| 429 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 430 | + echo ' |
|
| 414 | 431 | <span class="select_all_box"> |
| 415 | 432 | <em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[\');"> |
| 416 | 433 | </span> |
| 417 | 434 | <br><br> |
| 418 | 435 | </dd>'; |
| 419 | - else |
|
| 420 | - echo ' |
|
| 436 | + } else { |
|
| 437 | + echo ' |
|
| 421 | 438 | <tr class="select_all_box"> |
| 422 | 439 | <td> |
| 423 | 440 | </td> |
@@ -436,6 +453,7 @@ discard block |
||
| 436 | 453 | </tr> |
| 437 | 454 | </table> |
| 438 | 455 | </dd>'; |
| 456 | + } |
|
| 439 | 457 | |
| 440 | 458 | // Options to choose moderators, specify as announcement board and choose whether to count posts here. |
| 441 | 459 | echo ' |
@@ -490,8 +508,8 @@ discard block |
||
| 490 | 508 | </dl> |
| 491 | 509 | </div>'; |
| 492 | 510 | |
| 493 | - if ($context['board']['redirect']) |
|
| 494 | - echo ' |
|
| 511 | + if ($context['board']['redirect']) { |
|
| 512 | + echo ' |
|
| 495 | 513 | <div id="reset_redirect_div"> |
| 496 | 514 | <dl class="settings"> |
| 497 | 515 | <dt> |
@@ -504,6 +522,7 @@ discard block |
||
| 504 | 522 | </dd> |
| 505 | 523 | </dl> |
| 506 | 524 | </div>'; |
| 525 | + } |
|
| 507 | 526 | } |
| 508 | 527 | |
| 509 | 528 | echo ' |
@@ -531,9 +550,10 @@ discard block |
||
| 531 | 550 | <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> |
| 532 | 551 | <option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>'; |
| 533 | 552 | |
| 534 | - foreach ($context['themes'] as $theme) |
|
| 535 | - echo ' |
|
| 553 | + foreach ($context['themes'] as $theme) { |
|
| 554 | + echo ' |
|
| 536 | 555 | <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
| 556 | + } |
|
| 537 | 557 | |
| 538 | 558 | echo ' |
| 539 | 559 | </select> |
@@ -562,14 +582,15 @@ discard block |
||
| 562 | 582 | |
| 563 | 583 | foreach ($context['custom_board_settings'] as $cbs_id => $cbs) |
| 564 | 584 | { |
| 565 | - if (!empty($cbs['dt']) && !empty($cbs['dd'])) |
|
| 566 | - echo ' |
|
| 585 | + if (!empty($cbs['dt']) && !empty($cbs['dd'])) { |
|
| 586 | + echo ' |
|
| 567 | 587 | <dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '"> |
| 568 | 588 | ', $cbs['dt'], ' |
| 569 | 589 | </dt> |
| 570 | 590 | <dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '> |
| 571 | 591 | ', $cbs['dd'], ' |
| 572 | 592 | </dd>'; |
| 593 | + } |
|
| 573 | 594 | } |
| 574 | 595 | |
| 575 | 596 | echo ' |
@@ -577,9 +598,10 @@ discard block |
||
| 577 | 598 | </div>'; |
| 578 | 599 | } |
| 579 | 600 | |
| 580 | - if (!empty($context['board']['is_recycle'])) |
|
| 581 | - echo ' |
|
| 601 | + if (!empty($context['board']['is_recycle'])) { |
|
| 602 | + echo ' |
|
| 582 | 603 | <div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>'; |
| 604 | + } |
|
| 583 | 605 | |
| 584 | 606 | echo ' |
| 585 | 607 | <input type="hidden" name="rid" value="', $context['redirect_location'], '"> |
@@ -587,21 +609,24 @@ discard block |
||
| 587 | 609 | <input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">'; |
| 588 | 610 | |
| 589 | 611 | // If this board has no children don't bother with the next confirmation screen. |
| 590 | - if ($context['board']['no_children']) |
|
| 591 | - echo ' |
|
| 612 | + if ($context['board']['no_children']) { |
|
| 613 | + echo ' |
|
| 592 | 614 | <input type="hidden" name="no_children" value="1">'; |
| 615 | + } |
|
| 593 | 616 | |
| 594 | - if (isset($context['board']['is_new'])) |
|
| 595 | - echo ' |
|
| 617 | + if (isset($context['board']['is_new'])) { |
|
| 618 | + echo ' |
|
| 596 | 619 | <input type="hidden" name="cur_cat" value="', $context['board']['category'], '"> |
| 597 | 620 | <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit">'; |
| 598 | - else |
|
| 599 | - echo ' |
|
| 621 | + } else { |
|
| 622 | + echo ' |
|
| 600 | 623 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit">'; |
| 624 | + } |
|
| 601 | 625 | |
| 602 | - if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) |
|
| 603 | - echo ' |
|
| 626 | + if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) { |
|
| 627 | + echo ' |
|
| 604 | 628 | <input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button_submit you_sure">'; |
| 629 | + } |
|
| 605 | 630 | echo ' |
| 606 | 631 | </div> |
| 607 | 632 | </form> |
@@ -622,12 +647,13 @@ discard block |
||
| 622 | 647 | sItemListContainerId: \'moderator_container\', |
| 623 | 648 | aListItems: ['; |
| 624 | 649 | |
| 625 | - foreach ($context['board']['moderators'] as $id_member => $member_name) |
|
| 626 | - echo ' |
|
| 650 | + foreach ($context['board']['moderators'] as $id_member => $member_name) { |
|
| 651 | + echo ' |
|
| 627 | 652 | { |
| 628 | 653 | sItemId: ', JavaScriptEscape($id_member), ', |
| 629 | 654 | sItemName: ', JavaScriptEscape($member_name), ' |
| 630 | 655 | }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; |
| 656 | + } |
|
| 631 | 657 | |
| 632 | 658 | echo ' |
| 633 | 659 | ] |
@@ -647,12 +673,13 @@ discard block |
||
| 647 | 673 | sItemListContainerId: \'moderator_group_container\', |
| 648 | 674 | aListItems: ['; |
| 649 | 675 | |
| 650 | - foreach ($context['board']['moderator_groups'] as $id_group => $group_name) |
|
| 651 | - echo ' |
|
| 676 | + foreach ($context['board']['moderator_groups'] as $id_group => $group_name) { |
|
| 677 | + echo ' |
|
| 652 | 678 | { |
| 653 | 679 | sItemId: ', JavaScriptEscape($id_group), ', |
| 654 | 680 | sItemName: ', JavaScriptEscape($group_name), ' |
| 655 | 681 | }', $id_group == $context['board']['last_moderator_group_id'] ? '' : ','; |
| 682 | + } |
|
| 656 | 683 | |
| 657 | 684 | echo ' |
| 658 | 685 | ] |
@@ -678,17 +705,19 @@ discard block |
||
| 678 | 705 | echo ' |
| 679 | 706 | document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; |
| 680 | 707 | |
| 681 | - if ($context['board']['redirect']) |
|
| 682 | - echo ' |
|
| 708 | + if ($context['board']['redirect']) { |
|
| 709 | + echo ' |
|
| 683 | 710 | document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; |
| 711 | + } |
|
| 684 | 712 | } |
| 685 | 713 | |
| 686 | 714 | // Include any JavaScript added by mods using the 'integrate_edit_board' hook. |
| 687 | 715 | if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions'])) |
| 688 | 716 | { |
| 689 | - foreach ($context['custom_refreshOptions'] as $refreshOption) |
|
| 690 | - echo ' |
|
| 717 | + foreach ($context['custom_refreshOptions'] as $refreshOption) { |
|
| 718 | + echo ' |
|
| 691 | 719 | ', $refreshOption; |
| 720 | + } |
|
| 692 | 721 | } |
| 693 | 722 | |
| 694 | 723 | echo ' |
@@ -717,9 +746,10 @@ discard block |
||
| 717 | 746 | <p>', $txt['mboards_delete_board_contains'], '</p> |
| 718 | 747 | <ul>'; |
| 719 | 748 | |
| 720 | - foreach ($context['children'] as $child) |
|
| 721 | - echo ' |
|
| 749 | + foreach ($context['children'] as $child) { |
|
| 750 | + echo ' |
|
| 722 | 751 | <li>', $child['node']['name'], '</li>'; |
| 752 | + } |
|
| 723 | 753 | |
| 724 | 754 | echo ' |
| 725 | 755 | </ul> |
@@ -733,10 +763,11 @@ discard block |
||
| 733 | 763 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>: |
| 734 | 764 | <select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>'; |
| 735 | 765 | |
| 736 | - foreach ($context['board_order'] as $board) |
|
| 737 | - if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
| 766 | + foreach ($context['board_order'] as $board) { |
|
| 767 | + if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
| 738 | 768 | echo ' |
| 739 | 769 | <option value="', $board['id'], '">', $board['name'], '</option>'; |
| 770 | + } |
|
| 740 | 771 | |
| 741 | 772 | echo ' |
| 742 | 773 | </select> |
@@ -51,11 +51,13 @@ discard block |
||
| 51 | 51 | <p>'; |
| 52 | 52 | |
| 53 | 53 | // Show just numbers...? |
| 54 | - if ($settings['display_who_viewing'] == 1) |
|
| 55 | - echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
| 54 | + if ($settings['display_who_viewing'] == 1) { |
|
| 55 | + echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
| 56 | + } |
|
| 56 | 57 | // Or show the actual people viewing the topic? |
| 57 | - else |
|
| 58 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
| 58 | + else { |
|
| 59 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
| 60 | + } |
|
| 59 | 61 | |
| 60 | 62 | // Now show how many guests are here too. |
| 61 | 63 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' |
@@ -93,10 +95,11 @@ discard block |
||
| 93 | 95 | <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> |
| 94 | 96 | <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; |
| 95 | 97 | |
| 96 | - if ($context['allow_results_view']) |
|
| 97 | - echo ' |
|
| 98 | + if ($context['allow_results_view']) { |
|
| 99 | + echo ' |
|
| 98 | 100 | ', $option['bar_ndt'], ' |
| 99 | 101 | <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; |
| 102 | + } |
|
| 100 | 103 | |
| 101 | 104 | echo ' |
| 102 | 105 | </dd>'; |
@@ -105,9 +108,10 @@ discard block |
||
| 105 | 108 | echo ' |
| 106 | 109 | </dl>'; |
| 107 | 110 | |
| 108 | - if ($context['allow_results_view']) |
|
| 109 | - echo ' |
|
| 111 | + if ($context['allow_results_view']) { |
|
| 112 | + echo ' |
|
| 110 | 113 | <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; |
| 114 | + } |
|
| 111 | 115 | } |
| 112 | 116 | // They are allowed to vote! Go to it! |
| 113 | 117 | else |
@@ -116,17 +120,19 @@ discard block |
||
| 116 | 120 | <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; |
| 117 | 121 | |
| 118 | 122 | // Show a warning if they are allowed more than one option. |
| 119 | - if ($context['poll']['allowed_warning']) |
|
| 120 | - echo ' |
|
| 123 | + if ($context['poll']['allowed_warning']) { |
|
| 124 | + echo ' |
|
| 121 | 125 | <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; |
| 126 | + } |
|
| 122 | 127 | |
| 123 | 128 | echo ' |
| 124 | 129 | <ul class="options">'; |
| 125 | 130 | |
| 126 | 131 | // Show each option with its button - a radio likely. |
| 127 | - foreach ($context['poll']['options'] as $option) |
|
| 128 | - echo ' |
|
| 132 | + foreach ($context['poll']['options'] as $option) { |
|
| 133 | + echo ' |
|
| 129 | 134 | <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; |
| 135 | + } |
|
| 130 | 136 | |
| 131 | 137 | echo ' |
| 132 | 138 | </ul> |
@@ -138,9 +144,10 @@ discard block |
||
| 138 | 144 | } |
| 139 | 145 | |
| 140 | 146 | // Is the clock ticking? |
| 141 | - if (!empty($context['poll']['expire_time'])) |
|
| 142 | - echo ' |
|
| 147 | + if (!empty($context['poll']['expire_time'])) { |
|
| 148 | + echo ' |
|
| 143 | 149 | <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>'; |
| 150 | + } |
|
| 144 | 151 | |
| 145 | 152 | echo ' |
| 146 | 153 | </div> |
@@ -170,11 +177,13 @@ discard block |
||
| 170 | 177 | <li> |
| 171 | 178 | <b class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></b>'; |
| 172 | 179 | |
| 173 | - if ($event['can_edit']) |
|
| 174 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 180 | + if ($event['can_edit']) { |
|
| 181 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 182 | + } |
|
| 175 | 183 | |
| 176 | - if ($event['can_export']) |
|
| 177 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 184 | + if ($event['can_export']) { |
|
| 185 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 186 | + } |
|
| 178 | 187 | |
| 179 | 188 | echo ' |
| 180 | 189 | <br>'; |
@@ -182,14 +191,14 @@ discard block |
||
| 182 | 191 | if (!empty($event['allday'])) |
| 183 | 192 | { |
| 184 | 193 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' – <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : ''; |
| 185 | - } |
|
| 186 | - else |
|
| 194 | + } else |
|
| 187 | 195 | { |
| 188 | 196 | // Display event info relative to user's local timezone |
| 189 | 197 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 190 | 198 | |
| 191 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
| 192 | - echo trim($event['end_date_local']) . ', '; |
|
| 199 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
| 200 | + echo trim($event['end_date_local']) . ', '; |
|
| 201 | + } |
|
| 193 | 202 | |
| 194 | 203 | echo trim($event['end_time_local']); |
| 195 | 204 | |
@@ -198,23 +207,27 @@ discard block |
||
| 198 | 207 | { |
| 199 | 208 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
| 200 | 209 | |
| 201 | - if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) |
|
| 202 | - echo trim($event['start_date_orig']), ', '; |
|
| 210 | + if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) { |
|
| 211 | + echo trim($event['start_date_orig']), ', '; |
|
| 212 | + } |
|
| 203 | 213 | |
| 204 | 214 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 205 | 215 | |
| 206 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
| 207 | - echo trim($event['end_date_orig']) . ', '; |
|
| 216 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
| 217 | + echo trim($event['end_date_orig']) . ', '; |
|
| 218 | + } |
|
| 208 | 219 | |
| 209 | 220 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
| 210 | 221 | } |
| 211 | 222 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
| 212 | - else |
|
| 213 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 223 | + else { |
|
| 224 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 225 | + } |
|
| 214 | 226 | } |
| 215 | 227 | |
| 216 | - if (!empty($event['location'])) |
|
| 217 | - echo '<br>', $event['location']; |
|
| 228 | + if (!empty($event['location'])) { |
|
| 229 | + echo '<br>', $event['location']; |
|
| 230 | + } |
|
| 218 | 231 | |
| 219 | 232 | echo ' |
| 220 | 233 | </li>'; |
@@ -252,8 +265,9 @@ discard block |
||
| 252 | 265 | $context['removableMessageIDs'] = array(); |
| 253 | 266 | |
| 254 | 267 | // Get all the messages... |
| 255 | - while ($message = $context['get_message']()) |
|
| 256 | - template_single_post($message); |
|
| 268 | + while ($message = $context['get_message']()) { |
|
| 269 | + template_single_post($message); |
|
| 270 | + } |
|
| 257 | 271 | |
| 258 | 272 | echo ' |
| 259 | 273 | </form> |
@@ -290,8 +304,9 @@ discard block |
||
| 290 | 304 | <div id="display_jump_to"> </div>'; |
| 291 | 305 | |
| 292 | 306 | // Show quickreply |
| 293 | - if ($context['can_reply']) |
|
| 294 | - template_quickreply(); |
|
| 307 | + if ($context['can_reply']) { |
|
| 308 | + template_quickreply(); |
|
| 309 | + } |
|
| 295 | 310 | |
| 296 | 311 | // User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device. |
| 297 | 312 | echo ' |
@@ -304,8 +319,8 @@ discard block |
||
| 304 | 319 | </div>'; |
| 305 | 320 | |
| 306 | 321 | // Show the moderation button & pop only if user can moderate |
| 307 | - if ($context['can_moderate_forum'] || $context['user']['is_mod']) |
|
| 308 | - echo ' |
|
| 322 | + if ($context['can_moderate_forum'] || $context['user']['is_mod']) { |
|
| 323 | + echo ' |
|
| 309 | 324 | <div id="mobile_moderation" class="popup_container"> |
| 310 | 325 | <div class="popup_window description"> |
| 311 | 326 | <div class="popup_heading">', $txt['mobile_moderation'], ' |
@@ -315,6 +330,7 @@ discard block |
||
| 315 | 330 | </div> |
| 316 | 331 | </div> |
| 317 | 332 | </div>'; |
| 333 | + } |
|
| 318 | 334 | |
| 319 | 335 | echo ' |
| 320 | 336 | <script>'; |
@@ -438,9 +454,10 @@ discard block |
||
| 438 | 454 | }); |
| 439 | 455 | }'; |
| 440 | 456 | |
| 441 | - if (!empty($context['ignoredMsgs'])) |
|
| 442 | - echo ' |
|
| 457 | + if (!empty($context['ignoredMsgs'])) { |
|
| 458 | + echo ' |
|
| 443 | 459 | ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; |
| 460 | + } |
|
| 444 | 461 | |
| 445 | 462 | echo ' |
| 446 | 463 | </script>'; |
@@ -457,8 +474,9 @@ discard block |
||
| 457 | 474 | |
| 458 | 475 | $ignoring = false; |
| 459 | 476 | |
| 460 | - if ($message['can_remove']) |
|
| 461 | - $context['removableMessageIDs'][] = $message['id']; |
|
| 477 | + if ($message['can_remove']) { |
|
| 478 | + $context['removableMessageIDs'][] = $message['id']; |
|
| 479 | + } |
|
| 462 | 480 | |
| 463 | 481 | // Are we ignoring this message? |
| 464 | 482 | if (!empty($message['is_ignored'])) |
@@ -484,9 +502,10 @@ discard block |
||
| 484 | 502 | <div class="custom_fields_above_member"> |
| 485 | 503 | <ul class="nolist">'; |
| 486 | 504 | |
| 487 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
| 488 | - echo ' |
|
| 505 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
| 506 | + echo ' |
|
| 489 | 507 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 508 | + } |
|
| 490 | 509 | |
| 491 | 510 | echo ' |
| 492 | 511 | </ul> |
@@ -497,9 +516,10 @@ discard block |
||
| 497 | 516 | <h4>'; |
| 498 | 517 | |
| 499 | 518 | // Show online and offline buttons? |
| 500 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
| 501 | - echo ' |
|
| 519 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
| 520 | + echo ' |
|
| 502 | 521 | ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : ''; |
| 522 | + } |
|
| 503 | 523 | |
| 504 | 524 | |
| 505 | 525 | // Show a link to the member's profile. |
@@ -512,51 +532,59 @@ discard block |
||
| 512 | 532 | |
| 513 | 533 | |
| 514 | 534 | // Show the user's avatar. |
| 515 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
| 516 | - echo ' |
|
| 535 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
| 536 | + echo ' |
|
| 517 | 537 | <li class="avatar"> |
| 518 | 538 | <a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a> |
| 519 | 539 | </li>'; |
| 540 | + } |
|
| 520 | 541 | |
| 521 | 542 | // Are there any custom fields below the avatar? |
| 522 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
| 523 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 543 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
| 544 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 524 | 545 | echo ' |
| 525 | 546 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 547 | + } |
|
| 526 | 548 | |
| 527 | 549 | // Show the post group icons, but not for guests. |
| 528 | - if (!$message['member']['is_guest']) |
|
| 529 | - echo ' |
|
| 550 | + if (!$message['member']['is_guest']) { |
|
| 551 | + echo ' |
|
| 530 | 552 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
| 553 | + } |
|
| 531 | 554 | |
| 532 | 555 | // Show the member's primary group (like 'Administrator') if they have one. |
| 533 | - if (!empty($message['member']['group'])) |
|
| 534 | - echo ' |
|
| 556 | + if (!empty($message['member']['group'])) { |
|
| 557 | + echo ' |
|
| 535 | 558 | <li class="membergroup">', $message['member']['group'], '</li>'; |
| 559 | + } |
|
| 536 | 560 | |
| 537 | 561 | // Show the member's custom title, if they have one. |
| 538 | - if (!empty($message['member']['title'])) |
|
| 539 | - echo ' |
|
| 562 | + if (!empty($message['member']['title'])) { |
|
| 563 | + echo ' |
|
| 540 | 564 | <li class="title">', $message['member']['title'], '</li>'; |
| 565 | + } |
|
| 541 | 566 | |
| 542 | 567 | // Don't show these things for guests. |
| 543 | 568 | if (!$message['member']['is_guest']) |
| 544 | 569 | { |
| 545 | 570 | |
| 546 | 571 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
| 547 | - if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) |
|
| 548 | - echo ' |
|
| 572 | + if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) { |
|
| 573 | + echo ' |
|
| 549 | 574 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
| 575 | + } |
|
| 550 | 576 | |
| 551 | 577 | // Show how many posts they have made. |
| 552 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 553 | - echo ' |
|
| 578 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 579 | + echo ' |
|
| 554 | 580 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
| 581 | + } |
|
| 555 | 582 | |
| 556 | 583 | // Show their personal text? |
| 557 | - if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) |
|
| 558 | - echo ' |
|
| 584 | + if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) { |
|
| 585 | + echo ' |
|
| 559 | 586 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
| 587 | + } |
|
| 560 | 588 | |
| 561 | 589 | // Any custom fields to show as icons? |
| 562 | 590 | if (!empty($message['custom_fields']['icons'])) |
@@ -565,9 +593,10 @@ discard block |
||
| 565 | 593 | <li class="im_icons"> |
| 566 | 594 | <ol>'; |
| 567 | 595 | |
| 568 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
| 569 | - echo ' |
|
| 596 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
| 597 | + echo ' |
|
| 570 | 598 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 599 | + } |
|
| 571 | 600 | |
| 572 | 601 | echo ' |
| 573 | 602 | </ol> |
@@ -582,19 +611,22 @@ discard block |
||
| 582 | 611 | <ol class="profile_icons">'; |
| 583 | 612 | |
| 584 | 613 | // Don't show an icon if they haven't specified a website. |
| 585 | - if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) |
|
| 586 | - echo ' |
|
| 614 | + if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) { |
|
| 615 | + echo ' |
|
| 587 | 616 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
| 617 | + } |
|
| 588 | 618 | |
| 589 | 619 | // Since we know this person isn't a guest, you *can* message them. |
| 590 | - if ($context['can_send_pm']) |
|
| 591 | - echo ' |
|
| 620 | + if ($context['can_send_pm']) { |
|
| 621 | + echo ' |
|
| 592 | 622 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
| 623 | + } |
|
| 593 | 624 | |
| 594 | 625 | // Show the email if necessary |
| 595 | - if (!empty($message['member']['email']) && $message['member']['show_email']) |
|
| 596 | - echo ' |
|
| 626 | + if (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
| 627 | + echo ' |
|
| 597 | 628 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
| 629 | + } |
|
| 598 | 630 | |
| 599 | 631 | echo ' |
| 600 | 632 | </ol> |
@@ -602,48 +634,56 @@ discard block |
||
| 602 | 634 | } |
| 603 | 635 | |
| 604 | 636 | // Any custom fields for standard placement? |
| 605 | - if (!empty($message['custom_fields']['standard'])) |
|
| 606 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
| 637 | + if (!empty($message['custom_fields']['standard'])) { |
|
| 638 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
| 607 | 639 | echo ' |
| 608 | 640 | <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
| 641 | + } |
|
| 609 | 642 | |
| 610 | 643 | } |
| 611 | 644 | // Otherwise, show the guest's email. |
| 612 | - elseif (!empty($message['member']['email']) && $message['member']['show_email']) |
|
| 613 | - echo ' |
|
| 645 | + elseif (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
| 646 | + echo ' |
|
| 614 | 647 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
| 648 | + } |
|
| 615 | 649 | |
| 616 | 650 | // Show the IP to this user for this post - because you can moderate? |
| 617 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
| 618 | - echo ' |
|
| 651 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
| 652 | + echo ' |
|
| 619 | 653 | <li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>'; |
| 654 | + } |
|
| 620 | 655 | |
| 621 | 656 | // Or, should we show it because this is you? |
| 622 | - elseif ($message['can_see_ip']) |
|
| 623 | - echo ' |
|
| 657 | + elseif ($message['can_see_ip']) { |
|
| 658 | + echo ' |
|
| 624 | 659 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
| 660 | + } |
|
| 625 | 661 | |
| 626 | 662 | // Okay, are you at least logged in? Then we can show something about why IPs are logged... |
| 627 | - elseif (!$context['user']['is_guest']) |
|
| 628 | - echo ' |
|
| 663 | + elseif (!$context['user']['is_guest']) { |
|
| 664 | + echo ' |
|
| 629 | 665 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
| 666 | + } |
|
| 630 | 667 | |
| 631 | 668 | // Otherwise, you see NOTHING! |
| 632 | - else |
|
| 633 | - echo ' |
|
| 669 | + else { |
|
| 670 | + echo ' |
|
| 634 | 671 | <li class="poster_ip">', $txt['logged'], '</li>'; |
| 672 | + } |
|
| 635 | 673 | |
| 636 | 674 | // Are we showing the warning status? |
| 637 | 675 | // Don't show these things for guests. |
| 638 | - if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) |
|
| 639 | - echo ' |
|
| 676 | + if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) { |
|
| 677 | + echo ' |
|
| 640 | 678 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span> ', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
| 679 | + } |
|
| 641 | 680 | |
| 642 | 681 | // Are there any custom fields to show at the bottom of the poster info? |
| 643 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
| 644 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 682 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
| 683 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 645 | 684 | echo ' |
| 646 | 685 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 686 | + } |
|
| 647 | 687 | |
| 648 | 688 | // Poster info ends. |
| 649 | 689 | echo ' |
@@ -672,9 +712,10 @@ discard block |
||
| 672 | 712 | echo ' |
| 673 | 713 | <span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '','" id="modified_', $message['id'], '">'; |
| 674 | 714 | |
| 675 | - if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
|
| 676 | - echo |
|
| 715 | + if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) { |
|
| 716 | + echo |
|
| 677 | 717 | $message['modified']['last_edit_text']; |
| 718 | + } |
|
| 678 | 719 | |
| 679 | 720 | echo ' |
| 680 | 721 | </span> |
@@ -683,22 +724,24 @@ discard block |
||
| 683 | 724 | </div>'; |
| 684 | 725 | |
| 685 | 726 | // Ignoring this user? Hide the post. |
| 686 | - if ($ignoring) |
|
| 687 | - echo ' |
|
| 727 | + if ($ignoring) { |
|
| 728 | + echo ' |
|
| 688 | 729 | <div id="msg_', $message['id'], '_ignored_prompt"> |
| 689 | 730 | ', $txt['ignoring_user'], ' |
| 690 | 731 | <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
| 691 | 732 | </div>'; |
| 733 | + } |
|
| 692 | 734 | |
| 693 | 735 | // Show the post itself, finally! |
| 694 | 736 | echo ' |
| 695 | 737 | <div class="post">'; |
| 696 | 738 | |
| 697 | - if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) |
|
| 698 | - echo ' |
|
| 739 | + if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { |
|
| 740 | + echo ' |
|
| 699 | 741 | <div class="approve_post"> |
| 700 | 742 | ', $txt['post_awaiting_approval'], ' |
| 701 | 743 | </div>'; |
| 744 | + } |
|
| 702 | 745 | echo ' |
| 703 | 746 | <div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div> |
| 704 | 747 | </div>'; |
@@ -715,9 +758,9 @@ discard block |
||
| 715 | 758 | foreach ($message['attachment'] as $attachment) |
| 716 | 759 | { |
| 717 | 760 | // Do we want this attachment to not be showed here? |
| 718 | - if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) |
|
| 719 | - continue; |
|
| 720 | - elseif (!$div_output) |
|
| 761 | + if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) { |
|
| 762 | + continue; |
|
| 763 | + } elseif (!$div_output) |
|
| 721 | 764 | { |
| 722 | 765 | $div_output = true; |
| 723 | 766 | |
@@ -733,9 +776,10 @@ discard block |
||
| 733 | 776 | <fieldset> |
| 734 | 777 | <legend>', $txt['attach_awaiting_approve']; |
| 735 | 778 | |
| 736 | - if ($context['can_approve']) |
|
| 737 | - echo ' |
|
| 779 | + if ($context['can_approve']) { |
|
| 780 | + echo ' |
|
| 738 | 781 | [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; |
| 782 | + } |
|
| 739 | 783 | |
| 740 | 784 | echo ' |
| 741 | 785 | </legend>'; |
@@ -749,12 +793,13 @@ discard block |
||
| 749 | 793 | echo ' |
| 750 | 794 | <div class="attachments_top">'; |
| 751 | 795 | |
| 752 | - if ($attachment['thumbnail']['has_thumb']) |
|
| 753 | - echo ' |
|
| 796 | + if ($attachment['thumbnail']['has_thumb']) { |
|
| 797 | + echo ' |
|
| 754 | 798 | <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>'; |
| 755 | - else |
|
| 756 | - echo ' |
|
| 799 | + } else { |
|
| 800 | + echo ' |
|
| 757 | 801 | <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">'; |
| 802 | + } |
|
| 758 | 803 | |
| 759 | 804 | echo ' |
| 760 | 805 | </div>'; |
@@ -764,9 +809,10 @@ discard block |
||
| 764 | 809 | <div class="attachments_bot"> |
| 765 | 810 | <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*"> ' . $attachment['name'] . '</a> '; |
| 766 | 811 | |
| 767 | - if (!$attachment['is_approved'] && $context['can_approve']) |
|
| 768 | - echo ' |
|
| 812 | + if (!$attachment['is_approved'] && $context['can_approve']) { |
|
| 813 | + echo ' |
|
| 769 | 814 | [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] '; |
| 815 | + } |
|
| 770 | 816 | echo ' |
| 771 | 817 | <br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), ' |
| 772 | 818 | </div>'; |
@@ -775,33 +821,38 @@ discard block |
||
| 775 | 821 | </div>'; |
| 776 | 822 | |
| 777 | 823 | // Next attachment line ? |
| 778 | - if (++$i % $attachments_per_line === 0) |
|
| 779 | - echo ' |
|
| 824 | + if (++$i % $attachments_per_line === 0) { |
|
| 825 | + echo ' |
|
| 780 | 826 | <br>'; |
| 827 | + } |
|
| 781 | 828 | } |
| 782 | 829 | |
| 783 | 830 | // If we had unapproved attachments clean up. |
| 784 | - if ($last_approved_state == 0) |
|
| 785 | - echo ' |
|
| 831 | + if ($last_approved_state == 0) { |
|
| 832 | + echo ' |
|
| 786 | 833 | </fieldset>'; |
| 834 | + } |
|
| 787 | 835 | |
| 788 | 836 | // Only do this if we output a div above - otherwise it'll break things |
| 789 | - if ($div_output) |
|
| 790 | - echo ' |
|
| 837 | + if ($div_output) { |
|
| 838 | + echo ' |
|
| 791 | 839 | </div>'; |
| 840 | + } |
|
| 792 | 841 | } |
| 793 | 842 | |
| 794 | 843 | // And stuff below the attachments. |
| 795 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
| 796 | - echo ' |
|
| 844 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
| 845 | + echo ' |
|
| 797 | 846 | <div class="under_message">'; |
| 847 | + } |
|
| 798 | 848 | |
| 799 | 849 | // Maybe they want to report this post to the moderator(s)? |
| 800 | - if ($context['can_report_moderator']) |
|
| 801 | - echo ' |
|
| 850 | + if ($context['can_report_moderator']) { |
|
| 851 | + echo ' |
|
| 802 | 852 | <ul class="floatright smalltext"> |
| 803 | 853 | <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li> |
| 804 | 854 | </ul>'; |
| 855 | + } |
|
| 805 | 856 | |
| 806 | 857 | // What about likes? |
| 807 | 858 | if (!empty($modSettings['enable_likes'])) |
@@ -842,78 +893,91 @@ discard block |
||
| 842 | 893 | <ul class="quickbuttons">'; |
| 843 | 894 | |
| 844 | 895 | // Can they quote? if so they can select and quote as well! |
| 845 | - if ($context['can_quote']) |
|
| 846 | - echo ' |
|
| 896 | + if ($context['can_quote']) { |
|
| 897 | + echo ' |
|
| 847 | 898 | <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li> |
| 848 | 899 | <li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>'; |
| 900 | + } |
|
| 849 | 901 | |
| 850 | 902 | // Can the user modify the contents of this post? Show the modify inline image. |
| 851 | - if ($message['can_modify']) |
|
| 852 | - echo ' |
|
| 903 | + if ($message['can_modify']) { |
|
| 904 | + echo ' |
|
| 853 | 905 | <li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>'; |
| 906 | + } |
|
| 854 | 907 | |
| 855 | - if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
| 856 | - echo ' |
|
| 908 | + if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
| 909 | + echo ' |
|
| 857 | 910 | <li class="post_options">', $txt['post_options']; |
| 911 | + } |
|
| 858 | 912 | |
| 859 | 913 | echo ' |
| 860 | 914 | <ul>'; |
| 861 | 915 | |
| 862 | 916 | // Can the user modify the contents of this post? |
| 863 | - if ($message['can_modify']) |
|
| 864 | - echo ' |
|
| 917 | + if ($message['can_modify']) { |
|
| 918 | + echo ' |
|
| 865 | 919 | <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>'; |
| 920 | + } |
|
| 866 | 921 | |
| 867 | 922 | // How about... even... remove it entirely?! |
| 868 | - if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) |
|
| 869 | - echo ' |
|
| 923 | + if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) { |
|
| 924 | + echo ' |
|
| 870 | 925 | <li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'], '</a></li>'; |
| 871 | - elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) |
|
| 872 | - echo ' |
|
| 926 | + } elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) { |
|
| 927 | + echo ' |
|
| 873 | 928 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
| 929 | + } |
|
| 874 | 930 | |
| 875 | 931 | // What about splitting it off the rest of the topic? |
| 876 | - if ($context['can_split'] && !empty($context['real_num_replies'])) |
|
| 877 | - echo ' |
|
| 932 | + if ($context['can_split'] && !empty($context['real_num_replies'])) { |
|
| 933 | + echo ' |
|
| 878 | 934 | <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>'; |
| 935 | + } |
|
| 879 | 936 | |
| 880 | 937 | // Can we issue a warning because of this post? Remember, we can't give guests warnings. |
| 881 | - if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) |
|
| 882 | - echo ' |
|
| 938 | + if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) { |
|
| 939 | + echo ' |
|
| 883 | 940 | <li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>'; |
| 941 | + } |
|
| 884 | 942 | |
| 885 | 943 | // Can we restore topics? |
| 886 | - if ($context['can_restore_msg']) |
|
| 887 | - echo ' |
|
| 944 | + if ($context['can_restore_msg']) { |
|
| 945 | + echo ' |
|
| 888 | 946 | <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>'; |
| 947 | + } |
|
| 889 | 948 | |
| 890 | 949 | // Maybe we can approve it, maybe we should? |
| 891 | - if ($message['can_approve']) |
|
| 892 | - echo ' |
|
| 950 | + if ($message['can_approve']) { |
|
| 951 | + echo ' |
|
| 893 | 952 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>'; |
| 953 | + } |
|
| 894 | 954 | |
| 895 | 955 | // Maybe we can unapprove it? |
| 896 | - if ($message['can_unapprove']) |
|
| 897 | - echo ' |
|
| 956 | + if ($message['can_unapprove']) { |
|
| 957 | + echo ' |
|
| 898 | 958 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>'; |
| 959 | + } |
|
| 899 | 960 | |
| 900 | 961 | echo ' |
| 901 | 962 | </ul> |
| 902 | 963 | </li>'; |
| 903 | 964 | |
| 904 | 965 | // Show a checkbox for quick moderation? |
| 905 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) |
|
| 906 | - echo ' |
|
| 966 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { |
|
| 967 | + echo ' |
|
| 907 | 968 | <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; |
| 969 | + } |
|
| 908 | 970 | |
| 909 | - if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
| 910 | - echo ' |
|
| 971 | + if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
| 972 | + echo ' |
|
| 911 | 973 | </ul>'; |
| 974 | + } |
|
| 912 | 975 | } |
| 913 | 976 | |
| 914 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
| 915 | - echo ' |
|
| 977 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
| 978 | + echo ' |
|
| 916 | 979 | </div>'; |
| 980 | + } |
|
| 917 | 981 | |
| 918 | 982 | echo ' |
| 919 | 983 | </div> |
@@ -926,9 +990,10 @@ discard block |
||
| 926 | 990 | <div class="custom_fields_above_signature"> |
| 927 | 991 | <ul class="nolist">'; |
| 928 | 992 | |
| 929 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
| 930 | - echo ' |
|
| 993 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
| 994 | + echo ' |
|
| 931 | 995 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 996 | + } |
|
| 932 | 997 | |
| 933 | 998 | echo ' |
| 934 | 999 | </ul> |
@@ -936,9 +1001,10 @@ discard block |
||
| 936 | 1001 | } |
| 937 | 1002 | |
| 938 | 1003 | // Show the member's signature? |
| 939 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
| 940 | - echo ' |
|
| 1004 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
| 1005 | + echo ' |
|
| 941 | 1006 | <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>'; |
| 1007 | + } |
|
| 942 | 1008 | |
| 943 | 1009 | |
| 944 | 1010 | // Are there any custom profile fields for below the signature? |
@@ -948,9 +1014,10 @@ discard block |
||
| 948 | 1014 | <div class="custom_fields_below_signature"> |
| 949 | 1015 | <ul class="nolist">'; |
| 950 | 1016 | |
| 951 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
| 952 | - echo ' |
|
| 1017 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
| 1018 | + echo ' |
|
| 953 | 1019 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
| 1020 | + } |
|
| 954 | 1021 | |
| 955 | 1022 | echo ' |
| 956 | 1023 | </ul> |
@@ -998,8 +1065,8 @@ discard block |
||
| 998 | 1065 | <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">'; |
| 999 | 1066 | |
| 1000 | 1067 | // Guests just need more. |
| 1001 | - if ($context['user']['is_guest']) |
|
| 1002 | - echo ' |
|
| 1068 | + if ($context['user']['is_guest']) { |
|
| 1069 | + echo ' |
|
| 1003 | 1070 | <dl id="post_header"> |
| 1004 | 1071 | <dt> |
| 1005 | 1072 | ', $txt['name'], ': |
@@ -1014,6 +1081,7 @@ discard block |
||
| 1014 | 1081 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required> |
| 1015 | 1082 | </dd> |
| 1016 | 1083 | </dl>'; |
| 1084 | + } |
|
| 1017 | 1085 | |
| 1018 | 1086 | echo ' |
| 1019 | 1087 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' |
@@ -1061,8 +1129,8 @@ discard block |
||
| 1061 | 1129 | <br class="clear">'; |
| 1062 | 1130 | |
| 1063 | 1131 | // draft autosave available and the user has it enabled? |
| 1064 | - if (!empty($context['drafts_autosave'])) |
|
| 1065 | - echo ' |
|
| 1132 | + if (!empty($context['drafts_autosave'])) { |
|
| 1133 | + echo ' |
|
| 1066 | 1134 | <script> |
| 1067 | 1135 | var oDraftAutoSave = new smf_DraftAutoSave({ |
| 1068 | 1136 | sSelf: \'oDraftAutoSave\', |
@@ -1074,10 +1142,12 @@ discard block |
||
| 1074 | 1142 | iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), ' |
| 1075 | 1143 | }); |
| 1076 | 1144 | </script>'; |
| 1145 | + } |
|
| 1077 | 1146 | |
| 1078 | - if ($context['show_spellchecking']) |
|
| 1079 | - echo ' |
|
| 1147 | + if ($context['show_spellchecking']) { |
|
| 1148 | + echo ' |
|
| 1080 | 1149 | <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>'; |
| 1150 | + } |
|
| 1081 | 1151 | |
| 1082 | 1152 | echo ' |
| 1083 | 1153 | <script> |
@@ -72,9 +72,10 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // Allow css/js files to be disable for this specific theme. |
| 74 | 74 | // Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference. |
| 75 | - if (!isset($settings['disable_files'])) |
|
| 76 | - $settings['disable_files'] = array(); |
|
| 77 | -} |
|
| 75 | + if (!isset($settings['disable_files'])) { |
|
| 76 | + $settings['disable_files'] = array(); |
|
| 77 | + } |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | /** |
| 80 | 81 | * The main sub template above the content. |
@@ -111,8 +112,9 @@ discard block |
||
| 111 | 112 | echo ' |
| 112 | 113 | <meta'; |
| 113 | 114 | |
| 114 | - foreach ($meta_tag as $meta_key => $meta_value) |
|
| 115 | - echo ' ', $meta_key, '="', $meta_value, '"'; |
|
| 115 | + foreach ($meta_tag as $meta_key => $meta_value) { |
|
| 116 | + echo ' ', $meta_key, '="', $meta_value, '"'; |
|
| 117 | + } |
|
| 116 | 118 | |
| 117 | 119 | echo '>'; |
| 118 | 120 | } |
@@ -123,14 +125,16 @@ discard block |
||
| 123 | 125 | <meta name="theme-color" content="#557EA0">'; |
| 124 | 126 | |
| 125 | 127 | // Please don't index these Mr Robot. |
| 126 | - if (!empty($context['robot_no_index'])) |
|
| 127 | - echo ' |
|
| 128 | + if (!empty($context['robot_no_index'])) { |
|
| 129 | + echo ' |
|
| 128 | 130 | <meta name="robots" content="noindex">'; |
| 131 | + } |
|
| 129 | 132 | |
| 130 | 133 | // Present a canonical url for search engines to prevent duplicate content in their indices. |
| 131 | - if (!empty($context['canonical_url'])) |
|
| 132 | - echo ' |
|
| 134 | + if (!empty($context['canonical_url'])) { |
|
| 135 | + echo ' |
|
| 133 | 136 | <link rel="canonical" href="', $context['canonical_url'], '">'; |
| 137 | + } |
|
| 134 | 138 | |
| 135 | 139 | // Show all the relative links, such as help, search, contents, and the like. |
| 136 | 140 | echo ' |
@@ -139,10 +143,11 @@ discard block |
||
| 139 | 143 | <link rel="search" href="' . $scripturl . '?action=search">' : ''); |
| 140 | 144 | |
| 141 | 145 | // If RSS feeds are enabled, advertise the presence of one. |
| 142 | - if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) |
|
| 143 | - echo ' |
|
| 146 | + if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) { |
|
| 147 | + echo ' |
|
| 144 | 148 | <link rel="alternate feed" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?action=.xml;type=rss2', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '"> |
| 145 | 149 | <link rel="alternate feed" type="application/atom+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?action=.xml;type=atom', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">'; |
| 150 | + } |
|
| 146 | 151 | |
| 147 | 152 | // If we're viewing a topic, these should be the previous and next topics, respectively. |
| 148 | 153 | if (!empty($context['links']['next'])) |
@@ -158,9 +163,10 @@ discard block |
||
| 158 | 163 | } |
| 159 | 164 | |
| 160 | 165 | // If we're in a board, or a topic for that matter, the index will be the board's index. |
| 161 | - if (!empty($context['current_board'])) |
|
| 162 | - echo ' |
|
| 166 | + if (!empty($context['current_board'])) { |
|
| 167 | + echo ' |
|
| 163 | 168 | <link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">'; |
| 169 | + } |
|
| 164 | 170 | |
| 165 | 171 | // Output any remaining HTML headers. (from mods, maybe?) |
| 166 | 172 | echo $context['html_headers']; |
@@ -191,8 +197,9 @@ discard block |
||
| 191 | 197 | <ul class="floatleft" id="top_info"> |
| 192 | 198 | <li> |
| 193 | 199 | <a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">'; |
| 194 | - if (!empty($context['user']['avatar'])) |
|
| 195 | - echo $context['user']['avatar']['image']; |
|
| 200 | + if (!empty($context['user']['avatar'])) { |
|
| 201 | + echo $context['user']['avatar']['image']; |
|
| 202 | + } |
|
| 196 | 203 | echo $context['user']['name'], '</a> |
| 197 | 204 | <div id="profile_menu" class="top_menu"></div> |
| 198 | 205 | </li>'; |
@@ -220,17 +227,18 @@ discard block |
||
| 220 | 227 | } |
| 221 | 228 | // Otherwise they're a guest. Ask them to either register or login. |
| 222 | 229 | else |
| 223 | - if (empty($maintenance)) |
|
| 224 | - echo ' |
|
| 230 | + if (empty($maintenance)) { |
|
| 231 | + echo ' |
|
| 225 | 232 | <ul class="floatleft welcome"> |
| 226 | 233 | <li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li> |
| 227 | 234 | </ul>'; |
| 228 | - else |
|
| 229 | - //In maintenance mode, only login is allowed and don't show OverlayDiv |
|
| 235 | + } else { |
|
| 236 | + //In maintenance mode, only login is allowed and don't show OverlayDiv |
|
| 230 | 237 | echo ' |
| 231 | 238 | <ul class="floatleft welcome"> |
| 232 | 239 | <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li> |
| 233 | 240 | </ul>'; |
| 241 | + } |
|
| 234 | 242 | |
| 235 | 243 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
| 236 | 244 | { |
@@ -238,9 +246,10 @@ discard block |
||
| 238 | 246 | <form id="languages_form" method="get" class="floatright"> |
| 239 | 247 | <select id="language_select" name="language" onchange="this.form.submit()">'; |
| 240 | 248 | |
| 241 | - foreach ($context['languages'] as $language) |
|
| 242 | - echo ' |
|
| 249 | + foreach ($context['languages'] as $language) { |
|
| 250 | + echo ' |
|
| 243 | 251 | <option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>'; |
| 252 | + } |
|
| 244 | 253 | |
| 245 | 254 | echo ' |
| 246 | 255 | </select> |
@@ -264,31 +273,36 @@ discard block |
||
| 264 | 273 | <option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>'; |
| 265 | 274 | |
| 266 | 275 | // Can't limit it to a specific topic if we are not in one |
| 267 | - if (!empty($context['current_topic'])) |
|
| 268 | - echo ' |
|
| 276 | + if (!empty($context['current_topic'])) { |
|
| 277 | + echo ' |
|
| 269 | 278 | <option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>'; |
| 279 | + } |
|
| 270 | 280 | |
| 271 | 281 | // Can't limit it to a specific board if we are not in one |
| 272 | - if (!empty($context['current_board'])) |
|
| 273 | - echo ' |
|
| 282 | + if (!empty($context['current_board'])) { |
|
| 283 | + echo ' |
|
| 274 | 284 | <option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>'; |
| 285 | + } |
|
| 275 | 286 | |
| 276 | 287 | // Can't search for members if we can't see the memberlist |
| 277 | - if (!empty($context['allow_memberlist'])) |
|
| 278 | - echo ' |
|
| 288 | + if (!empty($context['allow_memberlist'])) { |
|
| 289 | + echo ' |
|
| 279 | 290 | <option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>'; |
| 291 | + } |
|
| 280 | 292 | |
| 281 | 293 | echo ' |
| 282 | 294 | </select>'; |
| 283 | 295 | |
| 284 | 296 | // Search within current topic? |
| 285 | - if (!empty($context['current_topic'])) |
|
| 286 | - echo ' |
|
| 297 | + if (!empty($context['current_topic'])) { |
|
| 298 | + echo ' |
|
| 287 | 299 | <input type="hidden" name="sd_topic" value="', $context['current_topic'], '">'; |
| 300 | + } |
|
| 288 | 301 | // If we're on a certain board, limit it to this board ;). |
| 289 | - elseif (!empty($context['current_board'])) |
|
| 290 | - echo ' |
|
| 302 | + elseif (!empty($context['current_board'])) { |
|
| 303 | + echo ' |
|
| 291 | 304 | <input type="hidden" name="sd_brd" value="', $context['current_board'], '">'; |
| 305 | + } |
|
| 292 | 306 | |
| 293 | 307 | echo ' |
| 294 | 308 | <input type="submit" name="search2" value="', $txt['search'], '" class="button_submit"> |
@@ -318,12 +332,13 @@ discard block |
||
| 318 | 332 | ', $context['current_time'], ' |
| 319 | 333 | </div>'; |
| 320 | 334 | // Show a random news item? (or you could pick one from news_lines...) |
| 321 | - if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) |
|
| 322 | - echo ' |
|
| 335 | + if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) { |
|
| 336 | + echo ' |
|
| 323 | 337 | <div class="news"> |
| 324 | 338 | <h2>', $txt['news'], ': </h2> |
| 325 | 339 | <p>', $context['random_news_line'], '</p> |
| 326 | 340 | </div>'; |
| 341 | + } |
|
| 327 | 342 | |
| 328 | 343 | echo ' |
| 329 | 344 | <hr class="clear"> |
@@ -386,9 +401,10 @@ discard block |
||
| 386 | 401 | </ul>'; |
| 387 | 402 | |
| 388 | 403 | // Show the load time? |
| 389 | - if ($context['show_load_time']) |
|
| 390 | - echo ' |
|
| 404 | + if ($context['show_load_time']) { |
|
| 405 | + echo ' |
|
| 391 | 406 | <p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>'; |
| 407 | + } |
|
| 392 | 408 | |
| 393 | 409 | echo ' |
| 394 | 410 | </div>'; |
@@ -418,19 +434,21 @@ discard block |
||
| 418 | 434 | global $context, $shown_linktree, $scripturl, $txt; |
| 419 | 435 | |
| 420 | 436 | // If linktree is empty, just return - also allow an override. |
| 421 | - if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) |
|
| 422 | - return; |
|
| 437 | + if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) { |
|
| 438 | + return; |
|
| 439 | + } |
|
| 423 | 440 | |
| 424 | 441 | echo ' |
| 425 | 442 | <div class="navigate_section"> |
| 426 | 443 | <ul>'; |
| 427 | 444 | |
| 428 | - if ($context['user']['is_logged']) |
|
| 429 | - echo ' |
|
| 445 | + if ($context['user']['is_logged']) { |
|
| 446 | + echo ' |
|
| 430 | 447 | <li class="unread_links"> |
| 431 | 448 | <a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a> |
| 432 | 449 | <a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a> |
| 433 | 450 | </li>'; |
| 451 | + } |
|
| 434 | 452 | |
| 435 | 453 | // Each tree item has a URL and name. Some may have extra_before and extra_after. |
| 436 | 454 | foreach ($context['linktree'] as $link_num => $tree) |
@@ -441,25 +459,29 @@ discard block |
||
| 441 | 459 | // Don't show a separator for the first one. |
| 442 | 460 | // Better here. Always points to the next level when the linktree breaks to a second line. |
| 443 | 461 | // Picked a better looking HTML entity, and added support for RTL plus a span for styling. |
| 444 | - if ($link_num != 0) |
|
| 445 | - echo ' |
|
| 462 | + if ($link_num != 0) { |
|
| 463 | + echo ' |
|
| 446 | 464 | <span class="dividers">', $context['right_to_left'] ? ' ◄ ' : ' ► ', '</span>'; |
| 465 | + } |
|
| 447 | 466 | |
| 448 | 467 | // Show something before the link? |
| 449 | - if (isset($tree['extra_before'])) |
|
| 450 | - echo $tree['extra_before'], ' '; |
|
| 468 | + if (isset($tree['extra_before'])) { |
|
| 469 | + echo $tree['extra_before'], ' '; |
|
| 470 | + } |
|
| 451 | 471 | |
| 452 | 472 | // Show the link, including a URL if it should have one. |
| 453 | - if (isset($tree['url'])) |
|
| 454 | - echo ' |
|
| 473 | + if (isset($tree['url'])) { |
|
| 474 | + echo ' |
|
| 455 | 475 | <a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>'; |
| 456 | - else |
|
| 457 | - echo ' |
|
| 476 | + } else { |
|
| 477 | + echo ' |
|
| 458 | 478 | <span>' . $tree['name'] . '</span>'; |
| 479 | + } |
|
| 459 | 480 | |
| 460 | 481 | // Show something after the link...? |
| 461 | - if (isset($tree['extra_after'])) |
|
| 462 | - echo ' ', $tree['extra_after']; |
|
| 482 | + if (isset($tree['extra_after'])) { |
|
| 483 | + echo ' ', $tree['extra_after']; |
|
| 484 | + } |
|
| 463 | 485 | |
| 464 | 486 | echo ' |
| 465 | 487 | </li>'; |
@@ -509,13 +531,14 @@ discard block |
||
| 509 | 531 | echo ' |
| 510 | 532 | <ul>'; |
| 511 | 533 | |
| 512 | - foreach ($childbutton['sub_buttons'] as $grandchildbutton) |
|
| 513 | - echo ' |
|
| 534 | + foreach ($childbutton['sub_buttons'] as $grandchildbutton) { |
|
| 535 | + echo ' |
|
| 514 | 536 | <li> |
| 515 | 537 | <a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '> |
| 516 | 538 | ', $grandchildbutton['title'], ' |
| 517 | 539 | </a> |
| 518 | 540 | </li>'; |
| 541 | + } |
|
| 519 | 542 | |
| 520 | 543 | echo ' |
| 521 | 544 | </ul>'; |
@@ -546,8 +569,9 @@ discard block |
||
| 546 | 569 | { |
| 547 | 570 | global $context, $txt; |
| 548 | 571 | |
| 549 | - if (!is_array($strip_options)) |
|
| 550 | - $strip_options = array(); |
|
| 572 | + if (!is_array($strip_options)) { |
|
| 573 | + $strip_options = array(); |
|
| 574 | + } |
|
| 551 | 575 | |
| 552 | 576 | // Create the buttons... |
| 553 | 577 | $buttons = array(); |
@@ -556,8 +580,9 @@ discard block |
||
| 556 | 580 | // As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!) |
| 557 | 581 | if (!isset($value['test']) || !empty($context[$value['test']])) |
| 558 | 582 | { |
| 559 | - if (!isset($value['id'])) |
|
| 560 | - $value['id'] = $key; |
|
| 583 | + if (!isset($value['id'])) { |
|
| 584 | + $value['id'] = $key; |
|
| 585 | + } |
|
| 561 | 586 | |
| 562 | 587 | $button = ' |
| 563 | 588 | <a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>'; |
@@ -570,13 +595,15 @@ discard block |
||
| 570 | 595 | <div class="overview">'; |
| 571 | 596 | foreach ($value['sub_buttons'] as $element) |
| 572 | 597 | { |
| 573 | - if (isset($element['test']) && empty($context[$element['test']])) |
|
| 574 | - continue; |
|
| 598 | + if (isset($element['test']) && empty($context[$element['test']])) { |
|
| 599 | + continue; |
|
| 600 | + } |
|
| 575 | 601 | |
| 576 | 602 | $button .= ' |
| 577 | 603 | <a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>'; |
| 578 | - if (isset($txt[$element['text'] . '_desc'])) |
|
| 579 | - $button .= '<br /><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
| 604 | + if (isset($txt[$element['text'] . '_desc'])) { |
|
| 605 | + $button .= '<br /><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
| 606 | + } |
|
| 580 | 607 | $button .= '</a>'; |
| 581 | 608 | } |
| 582 | 609 | $button .= ' |
@@ -590,8 +617,9 @@ discard block |
||
| 590 | 617 | } |
| 591 | 618 | |
| 592 | 619 | // No buttons? No button strip either. |
| 593 | - if (empty($buttons)) |
|
| 594 | - return; |
|
| 620 | + if (empty($buttons)) { |
|
| 621 | + return; |
|
| 622 | + } |
|
| 595 | 623 | |
| 596 | 624 | echo ' |
| 597 | 625 | <div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"' : ''), '> |
@@ -14,8 +14,9 @@ discard block |
||
| 14 | 14 | // This won't be dedicated without this - this must exist in each gateway! |
| 15 | 15 | // SMF Payment Gateway: paypal |
| 16 | 16 | |
| 17 | -if (!defined('SMF')) |
|
| 17 | +if (!defined('SMF')) { |
|
| 18 | 18 | die('No direct access...'); |
| 19 | +} |
|
| 19 | 20 | |
| 20 | 21 | /** |
| 21 | 22 | * Class for returning available form data for this gateway |
@@ -118,8 +119,7 @@ discard block |
||
| 118 | 119 | { |
| 119 | 120 | $return_data['hidden']['p3'] = 1; |
| 120 | 121 | $return_data['hidden']['t3'] = strtoupper(substr($period, 0, 1)); |
| 121 | - } |
|
| 122 | - else |
|
| 122 | + } else |
|
| 123 | 123 | { |
| 124 | 124 | preg_match('~(\d*)(\w)~', $sub_data['real_length'], $match); |
| 125 | 125 | $unit = $match[1]; |
@@ -130,14 +130,15 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // If it's repeatable do some javascript to respect this idea. |
| 133 | - if (!empty($sub_data['repeatable'])) |
|
| 134 | - $return_data['javascript'] = ' |
|
| 133 | + if (!empty($sub_data['repeatable'])) { |
|
| 134 | + $return_data['javascript'] = ' |
|
| 135 | 135 | document.write(\'<label for="do_paypal_recur"><input type="checkbox" name="do_paypal_recur" id="do_paypal_recur" checked onclick="switchPaypalRecur();" class="input_check">' . $txt['paid_make_recurring'] . '</label><br>\'); |
| 136 | 136 | |
| 137 | 137 | function switchPaypalRecur() |
| 138 | 138 | { |
| 139 | 139 | document.getElementById("paypal_cmd").value = document.getElementById("do_paypal_recur").checked ? "_xclick-subscriptions" : "_xclick"; |
| 140 | 140 | }'; |
| 141 | + } |
|
| 141 | 142 | |
| 142 | 143 | return $return_data; |
| 143 | 144 | } |
@@ -160,20 +161,24 @@ discard block |
||
| 160 | 161 | global $modSettings; |
| 161 | 162 | |
| 162 | 163 | // Has the user set up an email address? |
| 163 | - if ((empty($modSettings['paidsubs_test']) && empty($modSettings['paypal_email'])) || (!empty($modSettings['paidsubs_test']) && empty($modSettings['paypal_sandbox_email']))) |
|
| 164 | - return false; |
|
| 164 | + if ((empty($modSettings['paidsubs_test']) && empty($modSettings['paypal_email'])) || (!empty($modSettings['paidsubs_test']) && empty($modSettings['paypal_sandbox_email']))) { |
|
| 165 | + return false; |
|
| 166 | + } |
|
| 165 | 167 | // Check the correct transaction types are even here. |
| 166 | - if ((!isset($_POST['txn_type']) && !isset($_POST['payment_status'])) || (!isset($_POST['business']) && !isset($_POST['receiver_email']))) |
|
| 167 | - return false; |
|
| 168 | + if ((!isset($_POST['txn_type']) && !isset($_POST['payment_status'])) || (!isset($_POST['business']) && !isset($_POST['receiver_email']))) { |
|
| 169 | + return false; |
|
| 170 | + } |
|
| 168 | 171 | // Correct email address? |
| 169 | - if (!isset($_POST['business'])) |
|
| 170 | - $_POST['business'] = $_POST['receiver_email']; |
|
| 172 | + if (!isset($_POST['business'])) { |
|
| 173 | + $_POST['business'] = $_POST['receiver_email']; |
|
| 174 | + } |
|
| 171 | 175 | |
| 172 | 176 | // Are we testing? |
| 173 | - if (empty($modSettings['paidsubs_test']) && strtolower($modSettings['paypal_sandbox_email']) != strtolower($_POST['business']) && (empty($modSettings['paypal_additional_emails']) || !in_array(strtolower($_POST['business']), explode(',', strtolower($modSettings['paypal_additional_emails']))))) |
|
| 174 | - return false; |
|
| 175 | - elseif (strtolower($modSettings['paypal_email']) != strtolower($_POST['business']) && (empty($modSettings['paypal_additional_emails']) || !in_array(strtolower($_POST['business']), explode(',', $modSettings['paypal_additional_emails'])))) |
|
| 176 | - return false; |
|
| 177 | + if (empty($modSettings['paidsubs_test']) && strtolower($modSettings['paypal_sandbox_email']) != strtolower($_POST['business']) && (empty($modSettings['paypal_additional_emails']) || !in_array(strtolower($_POST['business']), explode(',', strtolower($modSettings['paypal_additional_emails']))))) { |
|
| 178 | + return false; |
|
| 179 | + } elseif (strtolower($modSettings['paypal_email']) != strtolower($_POST['business']) && (empty($modSettings['paypal_additional_emails']) || !in_array(strtolower($_POST['business']), explode(',', $modSettings['paypal_additional_emails'])))) { |
|
| 180 | + return false; |
|
| 181 | + } |
|
| 177 | 182 | return true; |
| 178 | 183 | } |
| 179 | 184 | |
@@ -192,15 +197,17 @@ discard block |
||
| 192 | 197 | global $modSettings, $txt; |
| 193 | 198 | |
| 194 | 199 | // Put this to some default value. |
| 195 | - if (!isset($_POST['txn_type'])) |
|
| 196 | - $_POST['txn_type'] = ''; |
|
| 200 | + if (!isset($_POST['txn_type'])) { |
|
| 201 | + $_POST['txn_type'] = ''; |
|
| 202 | + } |
|
| 197 | 203 | |
| 198 | 204 | // Build the request string - starting with the minimum requirement. |
| 199 | 205 | $requestString = 'cmd=_notify-validate'; |
| 200 | 206 | |
| 201 | 207 | // Now my dear, add all the posted bits in the order we got them |
| 202 | - foreach ($_POST as $k => $v) |
|
| 203 | - $requestString .= '&' . $k . '=' . urlencode($v); |
|
| 208 | + foreach ($_POST as $k => $v) { |
|
| 209 | + $requestString .= '&' . $k . '=' . urlencode($v); |
|
| 210 | + } |
|
| 204 | 211 | |
| 205 | 212 | // Can we use curl? |
| 206 | 213 | if (function_exists('curl_init') && $curl = curl_init((!empty($modSettings['paidsubs_test']) ? 'https://www.sandbox.' : 'https://www.') . 'paypal.com/cgi-bin/webscr')) |
@@ -240,14 +247,16 @@ discard block |
||
| 240 | 247 | $header .= 'Connection: close' . "\r\n\r\n"; |
| 241 | 248 | |
| 242 | 249 | // Open the connection. |
| 243 | - if (!empty($modSettings['paidsubs_test'])) |
|
| 244 | - $fp = fsockopen('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); |
|
| 245 | - else |
|
| 246 | - $fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30); |
|
| 250 | + if (!empty($modSettings['paidsubs_test'])) { |
|
| 251 | + $fp = fsockopen('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); |
|
| 252 | + } else { |
|
| 253 | + $fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30); |
|
| 254 | + } |
|
| 247 | 255 | |
| 248 | 256 | // Did it work? |
| 249 | - if (!$fp) |
|
| 250 | - generateSubscriptionError($txt['paypal_could_not_connect']); |
|
| 257 | + if (!$fp) { |
|
| 258 | + generateSubscriptionError($txt['paypal_could_not_connect']); |
|
| 259 | + } |
|
| 251 | 260 | |
| 252 | 261 | // Put the data to the port. |
| 253 | 262 | fputs($fp, $header . $requestString); |
@@ -256,8 +265,9 @@ discard block |
||
| 256 | 265 | while (!feof($fp)) |
| 257 | 266 | { |
| 258 | 267 | $this->return_data = fgets($fp, 1024); |
| 259 | - if (strcmp(trim($this->return_data), 'VERIFIED') === 0) |
|
| 260 | - break; |
|
| 268 | + if (strcmp(trim($this->return_data), 'VERIFIED') === 0) { |
|
| 269 | + break; |
|
| 270 | + } |
|
| 261 | 271 | } |
| 262 | 272 | |
| 263 | 273 | // Clean up. |
@@ -265,28 +275,34 @@ discard block |
||
| 265 | 275 | } |
| 266 | 276 | |
| 267 | 277 | // If this isn't verified then give up... |
| 268 | - if (strcmp(trim($this->return_data), 'VERIFIED') !== 0) |
|
| 269 | - exit; |
|
| 278 | + if (strcmp(trim($this->return_data), 'VERIFIED') !== 0) { |
|
| 279 | + exit; |
|
| 280 | + } |
|
| 270 | 281 | |
| 271 | 282 | // Check that this is intended for us. |
| 272 | - if (strtolower($modSettings['paypal_email']) != strtolower($_POST['business']) && (empty($modSettings['paypal_additional_emails']) || !in_array(strtolower($_POST['business']), explode(',', strtolower($modSettings['paypal_additional_emails']))))) |
|
| 273 | - exit; |
|
| 283 | + if (strtolower($modSettings['paypal_email']) != strtolower($_POST['business']) && (empty($modSettings['paypal_additional_emails']) || !in_array(strtolower($_POST['business']), explode(',', strtolower($modSettings['paypal_additional_emails']))))) { |
|
| 284 | + exit; |
|
| 285 | + } |
|
| 274 | 286 | |
| 275 | 287 | // Is this a subscription - and if so is it a secondary payment that we need to process? |
| 276 | 288 | // If so, make sure we get it in the expected format. Seems PayPal sometimes sends it without urlencoding. |
| 277 | - if (!empty($_POST['item_number']) && strpos($_POST['item_number'], ' ') !== false) |
|
| 278 | - $_POST['item_number'] = str_replace(' ', '+', $_POST['item_number']); |
|
| 279 | - if ($this->isSubscription() && (empty($_POST['item_number']) || strpos($_POST['item_number'], '+') === false)) |
|
| 280 | - // Calculate the subscription it relates to! |
|
| 289 | + if (!empty($_POST['item_number']) && strpos($_POST['item_number'], ' ') !== false) { |
|
| 290 | + $_POST['item_number'] = str_replace(' ', '+', $_POST['item_number']); |
|
| 291 | + } |
|
| 292 | + if ($this->isSubscription() && (empty($_POST['item_number']) || strpos($_POST['item_number'], '+') === false)) { |
|
| 293 | + // Calculate the subscription it relates to! |
|
| 281 | 294 | $this->_findSubscription(); |
| 295 | + } |
|
| 282 | 296 | |
| 283 | 297 | // Verify the currency! |
| 284 | - if (strtolower($_POST['mc_currency']) !== strtolower($modSettings['paid_currency_code'])) |
|
| 285 | - exit; |
|
| 298 | + if (strtolower($_POST['mc_currency']) !== strtolower($modSettings['paid_currency_code'])) { |
|
| 299 | + exit; |
|
| 300 | + } |
|
| 286 | 301 | |
| 287 | 302 | // Can't exist if it doesn't contain anything. |
| 288 | - if (empty($_POST['item_number'])) |
|
| 289 | - exit; |
|
| 303 | + if (empty($_POST['item_number'])) { |
|
| 304 | + exit; |
|
| 305 | + } |
|
| 290 | 306 | |
| 291 | 307 | // Return the id_sub and id_member |
| 292 | 308 | return explode('+', $_POST['item_number']); |
@@ -299,10 +315,11 @@ discard block |
||
| 299 | 315 | */ |
| 300 | 316 | public function isRefund() |
| 301 | 317 | { |
| 302 | - if ($_POST['payment_status'] === 'Refunded' || $_POST['payment_status'] === 'Reversed' || $_POST['txn_type'] === 'Refunded' || ($_POST['txn_type'] === 'reversal' && $_POST['payment_status'] === 'Completed')) |
|
| 303 | - return true; |
|
| 304 | - else |
|
| 305 | - return false; |
|
| 318 | + if ($_POST['payment_status'] === 'Refunded' || $_POST['payment_status'] === 'Reversed' || $_POST['txn_type'] === 'Refunded' || ($_POST['txn_type'] === 'reversal' && $_POST['payment_status'] === 'Completed')) { |
|
| 319 | + return true; |
|
| 320 | + } else { |
|
| 321 | + return false; |
|
| 322 | + } |
|
| 306 | 323 | } |
| 307 | 324 | |
| 308 | 325 | /** |
@@ -312,10 +329,11 @@ discard block |
||
| 312 | 329 | */ |
| 313 | 330 | public function isSubscription() |
| 314 | 331 | { |
| 315 | - if (substr($_POST['txn_type'], 0, 14) === 'subscr_payment' && $_POST['payment_status'] === 'Completed') |
|
| 316 | - return true; |
|
| 317 | - else |
|
| 318 | - return false; |
|
| 332 | + if (substr($_POST['txn_type'], 0, 14) === 'subscr_payment' && $_POST['payment_status'] === 'Completed') { |
|
| 333 | + return true; |
|
| 334 | + } else { |
|
| 335 | + return false; |
|
| 336 | + } |
|
| 319 | 337 | } |
| 320 | 338 | |
| 321 | 339 | /** |
@@ -325,10 +343,11 @@ discard block |
||
| 325 | 343 | */ |
| 326 | 344 | public function isPayment() |
| 327 | 345 | { |
| 328 | - if ($_POST['payment_status'] === 'Completed' && $_POST['txn_type'] === 'web_accept') |
|
| 329 | - return true; |
|
| 330 | - else |
|
| 331 | - return false; |
|
| 346 | + if ($_POST['payment_status'] === 'Completed' && $_POST['txn_type'] === 'web_accept') { |
|
| 347 | + return true; |
|
| 348 | + } else { |
|
| 349 | + return false; |
|
| 350 | + } |
|
| 332 | 351 | } |
| 333 | 352 | |
| 334 | 353 | /** |
@@ -341,10 +360,11 @@ discard block |
||
| 341 | 360 | // subscr_cancel is sent when the user cancels, subscr_eot is sent when the subscription reaches final payment |
| 342 | 361 | // Neither require us to *do* anything as per performCancel(). |
| 343 | 362 | // subscr_eot, if sent, indicates an end of payments term. |
| 344 | - if (substr($_POST['txn_type'], 0, 13) === 'subscr_cancel' || substr($_POST['txn_type'], 0, 10) === 'subscr_eot') |
|
| 345 | - return true; |
|
| 346 | - else |
|
| 347 | - return false; |
|
| 363 | + if (substr($_POST['txn_type'], 0, 13) === 'subscr_cancel' || substr($_POST['txn_type'], 0, 10) === 'subscr_eot') { |
|
| 364 | + return true; |
|
| 365 | + } else { |
|
| 366 | + return false; |
|
| 367 | + } |
|
| 348 | 368 | } |
| 349 | 369 | |
| 350 | 370 | /** |
@@ -409,8 +429,9 @@ discard block |
||
| 409 | 429 | global $smcFunc; |
| 410 | 430 | |
| 411 | 431 | // Assume we have this? |
| 412 | - if (empty($_POST['subscr_id'])) |
|
| 413 | - return false; |
|
| 432 | + if (empty($_POST['subscr_id'])) { |
|
| 433 | + return false; |
|
| 434 | + } |
|
| 414 | 435 | |
| 415 | 436 | // Do we have this in the database? |
| 416 | 437 | $request = $smcFunc['db_query']('', ' |
@@ -439,11 +460,12 @@ discard block |
||
| 439 | 460 | 'payer_email' => $_POST['payer_email'], |
| 440 | 461 | ) |
| 441 | 462 | ); |
| 442 | - if ($smcFunc['db_num_rows']($request) === 0) |
|
| 443 | - return false; |
|
| 463 | + if ($smcFunc['db_num_rows']($request) === 0) { |
|
| 464 | + return false; |
|
| 465 | + } |
|
| 466 | + } else { |
|
| 467 | + return false; |
|
| 444 | 468 | } |
| 445 | - else |
|
| 446 | - return false; |
|
| 447 | 469 | } |
| 448 | 470 | list ($member_id, $subscription_id) = $smcFunc['db_fetch_row']($request); |
| 449 | 471 | $_POST['item_number'] = $member_id . '+' . $subscription_id; |
@@ -22,22 +22,24 @@ discard block |
||
| 22 | 22 | <script>'; |
| 23 | 23 | |
| 24 | 24 | // When using Go Back due to fatal_error, allow the form to be re-submitted with changes. |
| 25 | - if (isBrowser('is_firefox')) |
|
| 26 | - echo ' |
|
| 25 | + if (isBrowser('is_firefox')) { |
|
| 26 | + echo ' |
|
| 27 | 27 | window.addEventListener("pageshow", reActivate, false);'; |
| 28 | + } |
|
| 28 | 29 | |
| 29 | 30 | // Start with message icons - and any missing from this theme. |
| 30 | 31 | echo ' |
| 31 | 32 | var icon_urls = {'; |
| 32 | - foreach ($context['icons'] as $icon) |
|
| 33 | - echo ' |
|
| 33 | + foreach ($context['icons'] as $icon) { |
|
| 34 | + echo ' |
|
| 34 | 35 | \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; |
| 36 | + } |
|
| 35 | 37 | echo ' |
| 36 | 38 | };'; |
| 37 | 39 | |
| 38 | 40 | // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. |
| 39 | - if ($context['make_poll']) |
|
| 40 | - echo ' |
|
| 41 | + if ($context['make_poll']) { |
|
| 42 | + echo ' |
|
| 41 | 43 | var pollOptionNum = 0, pollTabIndex; |
| 42 | 44 | var pollOptionId = ', $context['last_choice_id'], '; |
| 43 | 45 | function addPollOption() |
@@ -56,11 +58,13 @@ discard block |
||
| 56 | 58 | |
| 57 | 59 | setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('" class="input_text"></dd><p id="pollMoreOptions"></p>'), '); |
| 58 | 60 | }'; |
| 61 | + } |
|
| 59 | 62 | |
| 60 | 63 | // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. |
| 61 | - if ($context['make_event']) |
|
| 62 | - echo ' |
|
| 64 | + if ($context['make_event']) { |
|
| 65 | + echo ' |
|
| 63 | 66 | var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; |
| 67 | + } |
|
| 64 | 68 | |
| 65 | 69 | // End of the javascript, start the form and display the link tree. |
| 66 | 70 | echo ' |
@@ -80,9 +84,10 @@ discard block |
||
| 80 | 84 | </div> |
| 81 | 85 | </div><br>'; |
| 82 | 86 | |
| 83 | - if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) |
|
| 84 | - echo ' |
|
| 87 | + if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { |
|
| 88 | + echo ' |
|
| 85 | 89 | <input type="hidden" name="eventid" value="', $context['event']['id'], '">'; |
| 90 | + } |
|
| 86 | 91 | |
| 87 | 92 | // Start the main table. |
| 88 | 93 | echo ' |
@@ -117,18 +122,20 @@ discard block |
||
| 117 | 122 | } |
| 118 | 123 | |
| 119 | 124 | // If it's locked, show a message to warn the replier. |
| 120 | - if (!empty($context['locked'])) |
|
| 121 | - echo ' |
|
| 125 | + if (!empty($context['locked'])) { |
|
| 126 | + echo ' |
|
| 122 | 127 | <p class="errorbox"> |
| 123 | 128 | ', $txt['topic_locked_no_reply'], ' |
| 124 | 129 | </p>'; |
| 130 | + } |
|
| 125 | 131 | |
| 126 | - if (!empty($modSettings['drafts_post_enabled'])) |
|
| 127 | - echo ' |
|
| 132 | + if (!empty($modSettings['drafts_post_enabled'])) { |
|
| 133 | + echo ' |
|
| 128 | 134 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
| 129 | 135 | sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), ' |
| 130 | 136 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
| 131 | 137 | </div>'; |
| 138 | + } |
|
| 132 | 139 | |
| 133 | 140 | // The post header... important stuff |
| 134 | 141 | echo ' |
@@ -180,9 +187,10 @@ discard block |
||
| 180 | 187 | { |
| 181 | 188 | echo ' |
| 182 | 189 | <optgroup label="', $category['name'], '">'; |
| 183 | - foreach ($category['boards'] as $board) |
|
| 184 | - echo ' |
|
| 190 | + foreach ($category['boards'] as $board) { |
|
| 191 | + echo ' |
|
| 185 | 192 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], ' </option>'; |
| 193 | + } |
|
| 186 | 194 | echo ' |
| 187 | 195 | </optgroup>'; |
| 188 | 196 | } |
@@ -218,9 +226,10 @@ discard block |
||
| 218 | 226 | <span class="label">', $txt['calendar_timezone'], '</span> |
| 219 | 227 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
| 220 | 228 | |
| 221 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
| 222 | - echo ' |
|
| 229 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
| 230 | + echo ' |
|
| 223 | 231 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
| 232 | + } |
|
| 224 | 233 | |
| 225 | 234 | echo ' |
| 226 | 235 | </select> |
@@ -286,14 +295,15 @@ discard block |
||
| 286 | 295 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check"> |
| 287 | 296 | </dd>'; |
| 288 | 297 | |
| 289 | - if ($context['poll_options']['guest_vote_enabled']) |
|
| 290 | - echo ' |
|
| 298 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
| 299 | + echo ' |
|
| 291 | 300 | <dt> |
| 292 | 301 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
| 293 | 302 | </dt> |
| 294 | 303 | <dd> |
| 295 | 304 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', ' class="input_check"> |
| 296 | 305 | </dd>'; |
| 306 | + } |
|
| 297 | 307 | |
| 298 | 308 | echo ' |
| 299 | 309 | <dt> |
@@ -314,8 +324,8 @@ discard block |
||
| 314 | 324 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
| 315 | 325 | |
| 316 | 326 | // If we're editing and displaying edit details, show a box where they can say why |
| 317 | - if (isset($context['editing']) && $modSettings['show_modify']) |
|
| 318 | - echo ' |
|
| 327 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
| 328 | + echo ' |
|
| 319 | 329 | <dl> |
| 320 | 330 | <dt class="clear"> |
| 321 | 331 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -324,20 +334,23 @@ discard block |
||
| 324 | 334 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text"> |
| 325 | 335 | </dd> |
| 326 | 336 | </dl>'; |
| 337 | + } |
|
| 327 | 338 | |
| 328 | 339 | // If this message has been edited in the past - display when it was. |
| 329 | - if (isset($context['last_modified'])) |
|
| 330 | - echo ' |
|
| 340 | + if (isset($context['last_modified'])) { |
|
| 341 | + echo ' |
|
| 331 | 342 | <div class="padding smalltext"> |
| 332 | 343 | ', $context['last_modified_text'], ' |
| 333 | 344 | </div>'; |
| 345 | + } |
|
| 334 | 346 | |
| 335 | 347 | // If the admin has enabled the hiding of the additional options - show a link and image for it. |
| 336 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
| 337 | - echo ' |
|
| 348 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
| 349 | + echo ' |
|
| 338 | 350 | <div id="postAdditionalOptionsHeader"> |
| 339 | 351 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
| 340 | 352 | </div>'; |
| 353 | + } |
|
| 341 | 354 | |
| 342 | 355 | echo ' |
| 343 | 356 | <div id="postAdditionalOptions">'; |
@@ -369,19 +382,21 @@ discard block |
||
| 369 | 382 | <input type="hidden" name="attach_del[]" value="0"> |
| 370 | 383 | ', $txt['uncheck_unwatchd_attach'], ': |
| 371 | 384 | </dd>'; |
| 372 | - foreach ($context['current_attachments'] as $attachment) |
|
| 373 | - echo ' |
|
| 385 | + foreach ($context['current_attachments'] as $attachment) { |
|
| 386 | + echo ' |
|
| 374 | 387 | <dd class="smalltext"> |
| 375 | 388 | <label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', ' class="input_check"> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), |
| 376 | 389 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label> |
| 377 | 390 | </dd>'; |
| 391 | + } |
|
| 378 | 392 | |
| 379 | 393 | echo ' |
| 380 | 394 | </dl>'; |
| 381 | 395 | |
| 382 | - if (!empty($context['files_in_session_warning'])) |
|
| 383 | - echo ' |
|
| 396 | + if (!empty($context['files_in_session_warning'])) { |
|
| 397 | + echo ' |
|
| 384 | 398 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
| 399 | + } |
|
| 385 | 400 | } |
| 386 | 401 | |
| 387 | 402 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -434,8 +449,8 @@ discard block |
||
| 434 | 449 | ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '">'); |
| 435 | 450 | |
| 436 | 451 | // Show more boxes if they aren't approaching that limit. |
| 437 | - if ($context['num_allowed_attachments'] > 1) |
|
| 438 | - echo ' |
|
| 452 | + if ($context['num_allowed_attachments'] > 1) { |
|
| 453 | + echo ' |
|
| 439 | 454 | <script> |
| 440 | 455 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
| 441 | 456 | var current_attachment = 1; |
@@ -456,9 +471,10 @@ discard block |
||
| 456 | 471 | </div> |
| 457 | 472 | </div> |
| 458 | 473 | </dd>'; |
| 459 | - else |
|
| 460 | - echo ' |
|
| 474 | + } else { |
|
| 475 | + echo ' |
|
| 461 | 476 | </dd>'; |
| 477 | + } |
|
| 462 | 478 | |
| 463 | 479 | // Add any template changes for an alternative upload system here. |
| 464 | 480 | call_integration_hook('integrate_upload_template'); |
@@ -467,21 +483,25 @@ discard block |
||
| 467 | 483 | <dd class="smalltext">'; |
| 468 | 484 | |
| 469 | 485 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
| 470 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
| 471 | - echo ' |
|
| 486 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
| 487 | + echo ' |
|
| 472 | 488 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
| 489 | + } |
|
| 473 | 490 | |
| 474 | - if (!empty($context['attachment_restrictions'])) |
|
| 475 | - echo ' |
|
| 491 | + if (!empty($context['attachment_restrictions'])) { |
|
| 492 | + echo ' |
|
| 476 | 493 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
| 494 | + } |
|
| 477 | 495 | |
| 478 | - if ($context['num_allowed_attachments'] == 0) |
|
| 479 | - echo ' |
|
| 496 | + if ($context['num_allowed_attachments'] == 0) { |
|
| 497 | + echo ' |
|
| 480 | 498 | ', $txt['attach_limit_nag'], '<br>'; |
| 499 | + } |
|
| 481 | 500 | |
| 482 | - if (!$context['can_post_attachment_unapproved']) |
|
| 483 | - echo ' |
|
| 501 | + if (!$context['can_post_attachment_unapproved']) { |
|
| 502 | + echo ' |
|
| 484 | 503 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
| 504 | + } |
|
| 485 | 505 | |
| 486 | 506 | echo ' |
| 487 | 507 | </dd> |
@@ -504,10 +524,11 @@ discard block |
||
| 504 | 524 | <dt><strong>', $txt['subject'], '</strong></dt> |
| 505 | 525 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
| 506 | 526 | |
| 507 | - foreach ($context['drafts'] as $draft) |
|
| 508 | - echo ' |
|
| 527 | + foreach ($context['drafts'] as $draft) { |
|
| 528 | + echo ' |
|
| 509 | 529 | <dt>', $draft['link'], '</dt> |
| 510 | 530 | <dd>', $draft['poster_time'], '</dd>'; |
| 531 | + } |
|
| 511 | 532 | echo ' |
| 512 | 533 | </dl> |
| 513 | 534 | </div>'; |
@@ -532,9 +553,10 @@ discard block |
||
| 532 | 553 | ', template_control_richedit_buttons($context['post_box_name']); |
| 533 | 554 | |
| 534 | 555 | // Option to delete an event if user is editing one. |
| 535 | - if ($context['make_event'] && !$context['event']['new']) |
|
| 536 | - echo ' |
|
| 556 | + if ($context['make_event'] && !$context['event']['new']) { |
|
| 557 | + echo ' |
|
| 537 | 558 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">'; |
| 559 | + } |
|
| 538 | 560 | |
| 539 | 561 | echo ' |
| 540 | 562 | </span> |
@@ -543,9 +565,10 @@ discard block |
||
| 543 | 565 | <br class="clear">'; |
| 544 | 566 | |
| 545 | 567 | // Assuming this isn't a new topic pass across the last message id. |
| 546 | - if (isset($context['topic_last_message'])) |
|
| 547 | - echo ' |
|
| 568 | + if (isset($context['topic_last_message'])) { |
|
| 569 | + echo ' |
|
| 548 | 570 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
| 571 | + } |
|
| 549 | 572 | |
| 550 | 573 | echo ' |
| 551 | 574 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -687,9 +710,10 @@ discard block |
||
| 687 | 710 | |
| 688 | 711 | newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">« <strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \' »</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';'; |
| 689 | 712 | |
| 690 | - if ($context['can_quote']) |
|
| 691 | - echo ' |
|
| 713 | + if ($context['can_quote']) { |
|
| 714 | + echo ' |
|
| 692 | 715 | newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';'; |
| 716 | + } |
|
| 693 | 717 | |
| 694 | 718 | echo ' |
| 695 | 719 | newPostsHTML += \'<br class="clear">\'; |
@@ -732,8 +756,8 @@ discard block |
||
| 732 | 756 | }'; |
| 733 | 757 | |
| 734 | 758 | // Code for showing and hiding additional options. |
| 735 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
| 736 | - echo ' |
|
| 759 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
| 760 | + echo ' |
|
| 737 | 761 | var oSwapAdditionalOptions = new smc_Toggle({ |
| 738 | 762 | bToggleEnabled: true, |
| 739 | 763 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -761,10 +785,11 @@ discard block |
||
| 761 | 785 | } |
| 762 | 786 | ] |
| 763 | 787 | });'; |
| 788 | + } |
|
| 764 | 789 | |
| 765 | 790 | // Code for showing and hiding drafts |
| 766 | - if (!empty($context['drafts'])) |
|
| 767 | - echo ' |
|
| 791 | + if (!empty($context['drafts'])) { |
|
| 792 | + echo ' |
|
| 768 | 793 | var oSwapDraftOptions = new smc_Toggle({ |
| 769 | 794 | bToggleEnabled: true, |
| 770 | 795 | bCurrentlyCollapsed: true, |
@@ -786,6 +811,7 @@ discard block |
||
| 786 | 811 | } |
| 787 | 812 | ] |
| 788 | 813 | });'; |
| 814 | + } |
|
| 789 | 815 | |
| 790 | 816 | echo ' |
| 791 | 817 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -806,8 +832,9 @@ discard block |
||
| 806 | 832 | foreach ($context['previous_posts'] as $post) |
| 807 | 833 | { |
| 808 | 834 | $ignoring = false; |
| 809 | - if (!empty($post['is_ignored'])) |
|
| 810 | - $ignored_posts[] = $ignoring = $post['id']; |
|
| 835 | + if (!empty($post['is_ignored'])) { |
|
| 836 | + $ignored_posts[] = $ignoring = $post['id']; |
|
| 837 | + } |
|
| 811 | 838 | |
| 812 | 839 | echo ' |
| 813 | 840 | <div class="windowbg"> |
@@ -990,10 +1017,10 @@ discard block |
||
| 990 | 1017 | <div id="temporary_posting_area" style="display: none;"></div> |
| 991 | 1018 | <script>'; |
| 992 | 1019 | |
| 993 | - if ($context['close_window']) |
|
| 994 | - echo ' |
|
| 1020 | + if ($context['close_window']) { |
|
| 1021 | + echo ' |
|
| 995 | 1022 | window.close();'; |
| 996 | - else |
|
| 1023 | + } else |
|
| 997 | 1024 | { |
| 998 | 1025 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;). |
| 999 | 1026 | echo ' |
@@ -1047,11 +1074,12 @@ discard block |
||
| 1047 | 1074 | </p> |
| 1048 | 1075 | <ul>'; |
| 1049 | 1076 | |
| 1050 | - foreach ($context['groups'] as $group) |
|
| 1051 | - echo ' |
|
| 1077 | + foreach ($context['groups'] as $group) { |
|
| 1078 | + echo ' |
|
| 1052 | 1079 | <li> |
| 1053 | 1080 | <label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em> |
| 1054 | 1081 | </li>'; |
| 1082 | + } |
|
| 1055 | 1083 | |
| 1056 | 1084 | echo ' |
| 1057 | 1085 | <li> |