@@ -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' : '', '> ', $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">'; |
@@ -358,11 +362,12 @@ discard block |
||
358 | 362 | if (empty($setting) || !is_array($setting)) |
359 | 363 | { |
360 | 364 | // Insert a separator (unless this is the first item in the list) |
361 | - if ($i !== $first_option_key) |
|
362 | - echo ' |
|
365 | + if ($i !== $first_option_key) { |
|
366 | + echo ' |
|
363 | 367 | </dl> |
364 | 368 | <hr> |
365 | 369 | <dl class="settings">'; |
370 | + } |
|
366 | 371 | |
367 | 372 | // Should we give a name to this section? |
368 | 373 | if (is_string($setting) && !empty($setting)) |
@@ -371,9 +376,9 @@ discard block |
||
371 | 376 | echo ' |
372 | 377 | <dt><strong>' . $setting . '</strong></dt> |
373 | 378 | <dd></dd>'; |
379 | + } else { |
|
380 | + $titled_section = false; |
|
374 | 381 | } |
375 | - else |
|
376 | - $titled_section = false; |
|
377 | 382 | |
378 | 383 | continue; |
379 | 384 | } |
@@ -382,8 +387,8 @@ discard block |
||
382 | 387 | <dt>'; |
383 | 388 | |
384 | 389 | // Show the change option box? |
385 | - if ($context['theme_options_reset']) |
|
386 | - echo ' |
|
390 | + if ($context['theme_options_reset']) { |
|
391 | + echo ' |
|
387 | 392 | <span class="floatleft"> |
388 | 393 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
389 | 394 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -391,14 +396,16 @@ discard block |
||
391 | 396 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
392 | 397 | </select> |
393 | 398 | </span>'; |
399 | + } |
|
394 | 400 | |
395 | 401 | echo ' |
396 | 402 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
397 | 403 | |
398 | - if (isset($setting['description'])) |
|
399 | - echo ' |
|
404 | + if (isset($setting['description'])) { |
|
405 | + echo ' |
|
400 | 406 | <br> |
401 | 407 | <span class="smalltext">', $setting['description'], '</span>'; |
408 | + } |
|
402 | 409 | echo ' |
403 | 410 | </dt>'; |
404 | 411 | |
@@ -440,13 +447,11 @@ discard block |
||
440 | 447 | |
441 | 448 | echo ' |
442 | 449 | <input type="number"', $min . $max . $step; |
443 | - } |
|
444 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
450 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
445 | 451 | { |
446 | 452 | echo' |
447 | 453 | <input type="url"'; |
448 | - } |
|
449 | - else |
|
454 | + } else |
|
450 | 455 | { |
451 | 456 | echo ' |
452 | 457 | <input type="text"'; |
@@ -490,8 +495,8 @@ discard block |
||
490 | 495 | <br>'; |
491 | 496 | |
492 | 497 | // @todo Why can't I edit the default theme popup. |
493 | - if ($context['theme_settings']['theme_id'] != 1) |
|
494 | - echo ' |
|
498 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
499 | + echo ' |
|
495 | 500 | <div class="cat_bar"> |
496 | 501 | <h3 class="catbg config_hd"> |
497 | 502 | ', $txt['theme_edit'], ' |
@@ -507,6 +512,7 @@ discard block |
||
507 | 512 | </li> |
508 | 513 | </ul> |
509 | 514 | </div>'; |
515 | + } |
|
510 | 516 | |
511 | 517 | echo ' |
512 | 518 | <div class="cat_bar"> |
@@ -560,9 +566,10 @@ discard block |
||
560 | 566 | <dd> |
561 | 567 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
562 | 568 | |
563 | - foreach ($context['theme_variants'] as $key => $variant) |
|
564 | - echo ' |
|
569 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
570 | + echo ' |
|
565 | 571 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
572 | + } |
|
566 | 573 | |
567 | 574 | echo ' |
568 | 575 | </select> |
@@ -598,11 +605,12 @@ discard block |
||
598 | 605 | if (empty($setting) || !is_array($setting)) |
599 | 606 | { |
600 | 607 | // We don't need a separator before the first list element |
601 | - if ($i !== $first_setting_key) |
|
602 | - echo ' |
|
608 | + if ($i !== $first_setting_key) { |
|
609 | + echo ' |
|
603 | 610 | </dl> |
604 | 611 | <hr> |
605 | 612 | <dl class="settings">'; |
613 | + } |
|
606 | 614 | |
607 | 615 | // Add a fake heading? |
608 | 616 | if (is_string($setting) && !empty($setting)) |
@@ -611,9 +619,9 @@ discard block |
||
611 | 619 | echo ' |
612 | 620 | <dt><strong>' . $setting . '</strong></dt> |
613 | 621 | <dd></dd>'; |
622 | + } else { |
|
623 | + $titled_section = false; |
|
614 | 624 | } |
615 | - else |
|
616 | - $titled_section = false; |
|
617 | 625 | |
618 | 626 | continue; |
619 | 627 | } |
@@ -622,9 +630,10 @@ discard block |
||
622 | 630 | <dt> |
623 | 631 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
624 | 632 | |
625 | - if (isset($setting['description'])) |
|
626 | - echo '<br> |
|
633 | + if (isset($setting['description'])) { |
|
634 | + echo '<br> |
|
627 | 635 | <span class="smalltext">', $setting['description'], '</span>'; |
636 | + } |
|
628 | 637 | |
629 | 638 | echo ' |
630 | 639 | </dt>'; |
@@ -645,9 +654,10 @@ discard block |
||
645 | 654 | <dd> |
646 | 655 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
647 | 656 | |
648 | - foreach ($setting['options'] as $value => $label) |
|
649 | - echo ' |
|
657 | + foreach ($setting['options'] as $value => $label) { |
|
658 | + echo ' |
|
650 | 659 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
660 | + } |
|
651 | 661 | |
652 | 662 | echo ' |
653 | 663 | </select> |
@@ -676,13 +686,11 @@ discard block |
||
676 | 686 | |
677 | 687 | echo ' |
678 | 688 | <input type="number"', $min . $max . $step; |
679 | - } |
|
680 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
689 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
681 | 690 | { |
682 | 691 | echo' |
683 | 692 | <input type="url"'; |
684 | - } |
|
685 | - else |
|
693 | + } else |
|
686 | 694 | { |
687 | 695 | echo ' |
688 | 696 | <input type="text"'; |
@@ -839,21 +847,23 @@ discard block |
||
839 | 847 | <div class="windowbg">'; |
840 | 848 | |
841 | 849 | // Oops! there was an error :( |
842 | - if (!empty($context['error_message'])) |
|
843 | - echo ' |
|
850 | + if (!empty($context['error_message'])) { |
|
851 | + echo ' |
|
844 | 852 | <p> |
845 | 853 | ', $context['error_message'], ' |
846 | 854 | </p>'; |
855 | + } |
|
847 | 856 | |
848 | 857 | // Not much to show except a link back... |
849 | - else |
|
850 | - echo ' |
|
858 | + else { |
|
859 | + echo ' |
|
851 | 860 | <p> |
852 | 861 | <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'], ' |
853 | 862 | </p> |
854 | 863 | <p> |
855 | 864 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
856 | 865 | </p>'; |
866 | + } |
|
857 | 867 | |
858 | 868 | echo ' |
859 | 869 | </div><!-- .windowbg --> |
@@ -920,11 +930,12 @@ discard block |
||
920 | 930 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
921 | 931 | <span class="floatright">'; |
922 | 932 | |
923 | - if ($template['can_copy']) |
|
924 | - echo ' |
|
933 | + if ($template['can_copy']) { |
|
934 | + echo ' |
|
925 | 935 | <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>'; |
926 | - else |
|
927 | - echo $txt['themeadmin_edit_no_copy']; |
|
936 | + } else { |
|
937 | + echo $txt['themeadmin_edit_no_copy']; |
|
938 | + } |
|
928 | 939 | |
929 | 940 | echo ' |
930 | 941 | </span> |
@@ -947,11 +958,12 @@ discard block |
||
947 | 958 | echo ' |
948 | 959 | <div id="admincenter">'; |
949 | 960 | |
950 | - if (!empty($context['browse_title'])) |
|
951 | - echo ' |
|
961 | + if (!empty($context['browse_title'])) { |
|
962 | + echo ' |
|
952 | 963 | <div class="cat_bar"> |
953 | 964 | <h3 class="catbg">', $context['browse_title'], '</h3> |
954 | 965 | </div>'; |
966 | + } |
|
955 | 967 | |
956 | 968 | echo ' |
957 | 969 | <table class="table_grid tborder"> |
@@ -971,16 +983,15 @@ discard block |
||
971 | 983 | <tr class="windowbg"> |
972 | 984 | <td>'; |
973 | 985 | |
974 | - if ($file['is_editable']) |
|
975 | - echo ' |
|
986 | + if ($file['is_editable']) { |
|
987 | + echo ' |
|
976 | 988 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
977 | - |
|
978 | - elseif ($file['is_directory']) |
|
979 | - echo ' |
|
989 | + } elseif ($file['is_directory']) { |
|
990 | + echo ' |
|
980 | 991 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
981 | - |
|
982 | - else |
|
983 | - echo $file['filename']; |
|
992 | + } else { |
|
993 | + echo $file['filename']; |
|
994 | + } |
|
984 | 995 | |
985 | 996 | echo ' |
986 | 997 | </td> |
@@ -1002,11 +1013,12 @@ discard block |
||
1002 | 1013 | { |
1003 | 1014 | global $context, $settings, $scripturl, $txt; |
1004 | 1015 | |
1005 | - if ($context['session_error']) |
|
1006 | - echo ' |
|
1016 | + if ($context['session_error']) { |
|
1017 | + echo ' |
|
1007 | 1018 | <div class="errorbox"> |
1008 | 1019 | ', $txt['error_session_timeout'], ' |
1009 | 1020 | </div>'; |
1021 | + } |
|
1010 | 1022 | |
1011 | 1023 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
1012 | 1024 | echo ' |
@@ -1069,17 +1081,18 @@ discard block |
||
1069 | 1081 | try |
1070 | 1082 | { |
1071 | 1083 | '; |
1072 | - if (isBrowser('is_ie')) |
|
1073 | - echo ' |
|
1084 | + if (isBrowser('is_ie')) { |
|
1085 | + echo ' |
|
1074 | 1086 | var sheets = frames["css_preview_box"].document.styleSheets; |
1075 | 1087 | for (var j = 0; j < sheets.length; j++) |
1076 | 1088 | { |
1077 | 1089 | if (sheets[j].id == "css_preview_box") |
1078 | 1090 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
1079 | 1091 | }'; |
1080 | - else |
|
1081 | - echo ' |
|
1092 | + } else { |
|
1093 | + echo ' |
|
1082 | 1094 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
1095 | + } |
|
1083 | 1096 | echo ' |
1084 | 1097 | } |
1085 | 1098 | catch (e) |
@@ -1131,9 +1144,10 @@ discard block |
||
1131 | 1144 | </div> |
1132 | 1145 | <div class="windowbg">'; |
1133 | 1146 | |
1134 | - if (!$context['allow_save']) |
|
1135 | - echo ' |
|
1147 | + if (!$context['allow_save']) { |
|
1148 | + echo ' |
|
1136 | 1149 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1150 | + } |
|
1137 | 1151 | |
1138 | 1152 | echo ' |
1139 | 1153 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1147,9 +1161,10 @@ discard block |
||
1147 | 1161 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1148 | 1162 | |
1149 | 1163 | // Hopefully it exists. |
1150 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1151 | - echo ' |
|
1164 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1165 | + echo ' |
|
1152 | 1166 | <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'], '">'; |
1167 | + } |
|
1153 | 1168 | |
1154 | 1169 | echo ' |
1155 | 1170 | </form> |
@@ -1163,18 +1178,20 @@ discard block |
||
1163 | 1178 | { |
1164 | 1179 | global $context, $scripturl, $txt; |
1165 | 1180 | |
1166 | - if ($context['session_error']) |
|
1167 | - echo ' |
|
1181 | + if ($context['session_error']) { |
|
1182 | + echo ' |
|
1168 | 1183 | <div class="errorbox"> |
1169 | 1184 | ', $txt['error_session_timeout'], ' |
1170 | 1185 | </div>'; |
1186 | + } |
|
1171 | 1187 | |
1172 | - if (isset($context['parse_error'])) |
|
1173 | - echo ' |
|
1188 | + if (isset($context['parse_error'])) { |
|
1189 | + echo ' |
|
1174 | 1190 | <div class="errorbox"> |
1175 | 1191 | ', $txt['themeadmin_edit_error'], ' |
1176 | 1192 | <div><pre>', $context['parse_error'], '</pre></div> |
1177 | 1193 | </div>'; |
1194 | + } |
|
1178 | 1195 | |
1179 | 1196 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1180 | 1197 | echo ' |
@@ -1185,16 +1202,18 @@ discard block |
||
1185 | 1202 | </div> |
1186 | 1203 | <div class="windowbg">'; |
1187 | 1204 | |
1188 | - if (!$context['allow_save']) |
|
1189 | - echo ' |
|
1205 | + if (!$context['allow_save']) { |
|
1206 | + echo ' |
|
1190 | 1207 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1208 | + } |
|
1191 | 1209 | |
1192 | - foreach ($context['file_parts'] as $part) |
|
1193 | - echo ' |
|
1210 | + foreach ($context['file_parts'] as $part) { |
|
1211 | + echo ' |
|
1194 | 1212 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
1195 | 1213 | <div class="centertext"> |
1196 | 1214 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
1197 | 1215 | </div>'; |
1216 | + } |
|
1198 | 1217 | |
1199 | 1218 | echo ' |
1200 | 1219 | <div class="padding righttext"> |
@@ -1203,9 +1222,10 @@ discard block |
||
1203 | 1222 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1204 | 1223 | |
1205 | 1224 | // Hopefully it exists. |
1206 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1207 | - echo ' |
|
1225 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1226 | + echo ' |
|
1208 | 1227 | <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'], '">'; |
1228 | + } |
|
1209 | 1229 | |
1210 | 1230 | echo ' |
1211 | 1231 | </div><!-- .righttext --> |
@@ -1221,18 +1241,20 @@ discard block |
||
1221 | 1241 | { |
1222 | 1242 | global $context, $scripturl, $txt; |
1223 | 1243 | |
1224 | - if ($context['session_error']) |
|
1225 | - echo ' |
|
1244 | + if ($context['session_error']) { |
|
1245 | + echo ' |
|
1226 | 1246 | <div class="errorbox"> |
1227 | 1247 | ', $txt['error_session_timeout'], ' |
1228 | 1248 | </div>'; |
1249 | + } |
|
1229 | 1250 | |
1230 | 1251 | // Is this file writeable? |
1231 | - if (!$context['allow_save']) |
|
1232 | - echo ' |
|
1252 | + if (!$context['allow_save']) { |
|
1253 | + echo ' |
|
1233 | 1254 | <div class="errorbox"> |
1234 | 1255 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
1235 | 1256 | </div>'; |
1257 | + } |
|
1236 | 1258 | |
1237 | 1259 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1238 | 1260 | echo ' |
@@ -1248,9 +1270,10 @@ discard block |
||
1248 | 1270 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1249 | 1271 | |
1250 | 1272 | // Hopefully it exists. |
1251 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1252 | - echo ' |
|
1273 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1274 | + echo ' |
|
1253 | 1275 | <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'], '">'; |
1276 | + } |
|
1254 | 1277 | |
1255 | 1278 | echo ' |
1256 | 1279 | </div><!-- .windowbg --> |
@@ -3078,8 +3078,7 @@ |
||
3078 | 3078 | <div class="roundframe"> |
3079 | 3079 | <div> |
3080 | 3080 | ', !empty($context['tfa_backup']) ? ' |
3081 | - <div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : |
|
3082 | - ($modSettings['tfa_mode'] == 2 ? ' |
|
3081 | + <div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? ' |
|
3083 | 3082 | <div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), ' |
3084 | 3083 | <div class="smalltext">', $txt['tfa_desc'], '</div> |
3085 | 3084 | <div class="floatleft"> |
@@ -18,23 +18,25 @@ discard block |
||
18 | 18 | global $context; |
19 | 19 | |
20 | 20 | // Prevent Chrome from auto completing fields when viewing/editing other members profiles |
21 | - if (isBrowser('is_chrome') && !$context['user']['is_owner']) |
|
22 | - echo ' |
|
21 | + if (isBrowser('is_chrome') && !$context['user']['is_owner']) { |
|
22 | + echo ' |
|
23 | 23 | <script> |
24 | 24 | disableAutoComplete(); |
25 | 25 | </script>'; |
26 | + } |
|
26 | 27 | |
27 | 28 | // If an error occurred while trying to save previously, give the user a clue! |
28 | 29 | echo ' |
29 | 30 | ', template_error_message(); |
30 | 31 | |
31 | 32 | // If the profile was update successfully, let the user know this. |
32 | - if (!empty($context['profile_updated'])) |
|
33 | - echo ' |
|
33 | + if (!empty($context['profile_updated'])) { |
|
34 | + echo ' |
|
34 | 35 | <div class="infobox"> |
35 | 36 | ', $context['profile_updated'], ' |
36 | 37 | </div>'; |
37 | -} |
|
38 | + } |
|
39 | + } |
|
38 | 40 | |
39 | 41 | /** |
40 | 42 | * Template for any HTML needed below the profile (closing off divs/tables, etc.) |
@@ -102,8 +104,7 @@ discard block |
||
102 | 104 | if (empty($context['unread_alerts'])) |
103 | 105 | { |
104 | 106 | template_alerts_all_read(); |
105 | - } |
|
106 | - else |
|
107 | + } else |
|
107 | 108 | { |
108 | 109 | foreach ($context['unread_alerts'] as $id_alert => $details) |
109 | 110 | { |
@@ -164,10 +165,11 @@ discard block |
||
164 | 165 | <div class="custom_fields_above_name"> |
165 | 166 | <ul>'; |
166 | 167 | |
167 | - foreach ($context['print_custom_fields']['above_member'] as $field) |
|
168 | - if (!empty($field['output_html'])) |
|
168 | + foreach ($context['print_custom_fields']['above_member'] as $field) { |
|
169 | + if (!empty($field['output_html'])) |
|
169 | 170 | echo ' |
170 | 171 | <li>', $field['output_html'], '</li>'; |
172 | + } |
|
171 | 173 | |
172 | 174 | echo ' |
173 | 175 | </ul> |
@@ -179,20 +181,22 @@ discard block |
||
179 | 181 | <div class="username clear"> |
180 | 182 | <h4>'; |
181 | 183 | |
182 | - if (!empty($context['print_custom_fields']['before_member'])) |
|
183 | - foreach ($context['print_custom_fields']['before_member'] as $field) |
|
184 | + if (!empty($context['print_custom_fields']['before_member'])) { |
|
185 | + foreach ($context['print_custom_fields']['before_member'] as $field) |
|
184 | 186 | if (!empty($field['output_html'])) |
185 | 187 | echo ' |
186 | 188 | <span>', $field['output_html'], '</span>'; |
189 | + } |
|
187 | 190 | |
188 | 191 | echo ' |
189 | 192 | ', $context['member']['name']; |
190 | 193 | |
191 | - if (!empty($context['print_custom_fields']['after_member'])) |
|
192 | - foreach ($context['print_custom_fields']['after_member'] as $field) |
|
194 | + if (!empty($context['print_custom_fields']['after_member'])) { |
|
195 | + foreach ($context['print_custom_fields']['after_member'] as $field) |
|
193 | 196 | if (!empty($field['output_html'])) |
194 | 197 | echo ' |
195 | 198 | <span>', $field['output_html'], '</span>'; |
199 | + } |
|
196 | 200 | |
197 | 201 | |
198 | 202 | echo ' |
@@ -208,10 +212,11 @@ discard block |
||
208 | 212 | <div class="custom_fields_below_avatar"> |
209 | 213 | <ul>'; |
210 | 214 | |
211 | - foreach ($context['print_custom_fields']['below_avatar'] as $field) |
|
212 | - if (!empty($field['output_html'])) |
|
215 | + foreach ($context['print_custom_fields']['below_avatar'] as $field) { |
|
216 | + if (!empty($field['output_html'])) |
|
213 | 217 | echo ' |
214 | 218 | <li>', $field['output_html'], '</li>'; |
219 | + } |
|
215 | 220 | |
216 | 221 | echo ' |
217 | 222 | </ul> |
@@ -223,22 +228,25 @@ discard block |
||
223 | 228 | <ul class="clear">'; |
224 | 229 | |
225 | 230 | // Email is only visible if it's your profile or you have the moderate_forum permission |
226 | - if ($context['member']['show_email']) |
|
227 | - echo ' |
|
231 | + if ($context['member']['show_email']) { |
|
232 | + echo ' |
|
228 | 233 | <li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>'; |
234 | + } |
|
229 | 235 | |
230 | 236 | // Don't show an icon if they haven't specified a website. |
231 | - if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) |
|
232 | - echo ' |
|
237 | + if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) { |
|
238 | + echo ' |
|
233 | 239 | <li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
240 | + } |
|
234 | 241 | |
235 | 242 | // Are there any custom profile fields as icons? |
236 | 243 | if (!empty($context['print_custom_fields']['icons'])) |
237 | 244 | { |
238 | - foreach ($context['print_custom_fields']['icons'] as $field) |
|
239 | - if (!empty($field['output_html'])) |
|
245 | + foreach ($context['print_custom_fields']['icons'] as $field) { |
|
246 | + if (!empty($field['output_html'])) |
|
240 | 247 | echo ' |
241 | 248 | <li class="custom_field">', $field['output_html'], '</li>'; |
249 | + } |
|
242 | 250 | } |
243 | 251 | |
244 | 252 | echo ' |
@@ -247,24 +255,27 @@ discard block |
||
247 | 255 | ', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : ''; |
248 | 256 | |
249 | 257 | // Can they add this member as a buddy? |
250 | - if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) |
|
251 | - echo ' |
|
258 | + if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) { |
|
259 | + echo ' |
|
252 | 260 | <br> |
253 | 261 | <a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>'; |
262 | + } |
|
254 | 263 | |
255 | 264 | echo ' |
256 | 265 | </span>'; |
257 | 266 | |
258 | - if (!$context['user']['is_owner'] && $context['can_send_pm']) |
|
259 | - echo ' |
|
267 | + if (!$context['user']['is_owner'] && $context['can_send_pm']) { |
|
268 | + echo ' |
|
260 | 269 | <a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>'; |
270 | + } |
|
261 | 271 | |
262 | 272 | echo ' |
263 | 273 | <a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>'; |
264 | 274 | |
265 | - if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) |
|
266 | - echo ' |
|
275 | + if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) { |
|
276 | + echo ' |
|
267 | 277 | <a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>'; |
278 | + } |
|
268 | 279 | |
269 | 280 | echo ' |
270 | 281 | <a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>'; |
@@ -276,10 +287,11 @@ discard block |
||
276 | 287 | <div class="custom_fields_bottom"> |
277 | 288 | <ul class="nolist">'; |
278 | 289 | |
279 | - foreach ($context['print_custom_fields']['bottom_poster'] as $field) |
|
280 | - if (!empty($field['output_html'])) |
|
290 | + foreach ($context['print_custom_fields']['bottom_poster'] as $field) { |
|
291 | + if (!empty($field['output_html'])) |
|
281 | 292 | echo ' |
282 | 293 | <li>', $field['output_html'], '</li>'; |
294 | + } |
|
283 | 295 | |
284 | 296 | echo ' |
285 | 297 | </ul> |
@@ -292,15 +304,17 @@ discard block |
||
292 | 304 | <div id="detailedinfo"> |
293 | 305 | <dl class="settings">'; |
294 | 306 | |
295 | - if ($context['user']['is_owner'] || $context['user']['is_admin']) |
|
296 | - echo ' |
|
307 | + if ($context['user']['is_owner'] || $context['user']['is_admin']) { |
|
308 | + echo ' |
|
297 | 309 | <dt>', $txt['username'], ': </dt> |
298 | 310 | <dd>', $context['member']['username'], '</dd>'; |
311 | + } |
|
299 | 312 | |
300 | - if (!isset($context['disabled_fields']['posts'])) |
|
301 | - echo ' |
|
313 | + if (!isset($context['disabled_fields']['posts'])) { |
|
314 | + echo ' |
|
302 | 315 | <dt>', $txt['profile_posts'], ': </dt> |
303 | 316 | <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>'; |
317 | + } |
|
304 | 318 | |
305 | 319 | if ($context['member']['show_email']) |
306 | 320 | { |
@@ -309,15 +323,17 @@ discard block |
||
309 | 323 | <dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>'; |
310 | 324 | } |
311 | 325 | |
312 | - if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) |
|
313 | - echo ' |
|
326 | + if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) { |
|
327 | + echo ' |
|
314 | 328 | <dt>', $txt['custom_title'], ': </dt> |
315 | 329 | <dd>', $context['member']['title'], '</dd>'; |
330 | + } |
|
316 | 331 | |
317 | - if (!empty($context['member']['blurb'])) |
|
318 | - echo ' |
|
332 | + if (!empty($context['member']['blurb'])) { |
|
333 | + echo ' |
|
319 | 334 | <dt>', $txt['personal_text'], ': </dt> |
320 | 335 | <dd>', $context['member']['blurb'], '</dd>'; |
336 | + } |
|
321 | 337 | |
322 | 338 | echo ' |
323 | 339 | <dt>', $txt['age'], ':</dt> |
@@ -331,19 +347,21 @@ discard block |
||
331 | 347 | { |
332 | 348 | $fields = array(); |
333 | 349 | |
334 | - foreach ($context['print_custom_fields']['standard'] as $field) |
|
335 | - if (!empty($field['output_html'])) |
|
350 | + foreach ($context['print_custom_fields']['standard'] as $field) { |
|
351 | + if (!empty($field['output_html'])) |
|
336 | 352 | $fields[] = $field; |
353 | + } |
|
337 | 354 | |
338 | 355 | if (count($fields) > 0) |
339 | 356 | { |
340 | 357 | echo ' |
341 | 358 | <dl class="settings">'; |
342 | 359 | |
343 | - foreach ($fields as $field) |
|
344 | - echo ' |
|
360 | + foreach ($fields as $field) { |
|
361 | + echo ' |
|
345 | 362 | <dt>', $field['name'], ':</dt> |
346 | 363 | <dd>', $field['output_html'], '</dd>'; |
364 | + } |
|
347 | 365 | |
348 | 366 | echo ' |
349 | 367 | </dl>'; |
@@ -363,9 +381,10 @@ discard block |
||
363 | 381 | <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>'; |
364 | 382 | |
365 | 383 | // Can we provide information on what this means? |
366 | - if (!empty($context['warning_status'])) |
|
367 | - echo ' |
|
384 | + if (!empty($context['warning_status'])) { |
|
385 | + echo ' |
|
368 | 386 | <span class="smalltext">(', $context['warning_status'], ')</span>'; |
387 | + } |
|
369 | 388 | |
370 | 389 | echo ' |
371 | 390 | </dd>'; |
@@ -376,9 +395,10 @@ discard block |
||
376 | 395 | { |
377 | 396 | |
378 | 397 | // If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves. |
379 | - if (!empty($context['activate_message'])) |
|
380 | - echo ' |
|
398 | + if (!empty($context['activate_message'])) { |
|
399 | + echo ' |
|
381 | 400 | <dt class="clear"><span class="alert">', $context['activate_message'], '</span> (<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="' . $txt['profileConfirm'] . '"' : ''), '>', $context['activate_link_text'], '</a>)</dt>'; |
401 | + } |
|
382 | 402 | |
383 | 403 | // If the current member is banned, show a message and possibly a link to the ban. |
384 | 404 | if (!empty($context['member']['bans'])) |
@@ -390,10 +410,11 @@ discard block |
||
390 | 410 | <dt class="clear" id="ban_info" style="display: none;"> |
391 | 411 | <strong>', $txt['user_banned_by_following'], ':</strong>'; |
392 | 412 | |
393 | - foreach ($context['member']['bans'] as $ban) |
|
394 | - echo ' |
|
413 | + foreach ($context['member']['bans'] as $ban) { |
|
414 | + echo ' |
|
395 | 415 | <br> |
396 | 416 | <span class="smalltext">', $ban['explanation'], '</span>'; |
417 | + } |
|
397 | 418 | |
398 | 419 | echo ' |
399 | 420 | </dt>'; |
@@ -407,30 +428,34 @@ discard block |
||
407 | 428 | // If the person looking is allowed, they can check the members IP address and hostname. |
408 | 429 | if ($context['can_see_ip']) |
409 | 430 | { |
410 | - if (!empty($context['member']['ip'])) |
|
411 | - echo ' |
|
431 | + if (!empty($context['member']['ip'])) { |
|
432 | + echo ' |
|
412 | 433 | <dt>', $txt['ip'], ': </dt> |
413 | 434 | <dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>'; |
435 | + } |
|
414 | 436 | |
415 | - if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) |
|
416 | - echo ' |
|
437 | + if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) { |
|
438 | + echo ' |
|
417 | 439 | <dt>', $txt['hostname'], ': </dt> |
418 | 440 | <dd>', $context['member']['hostname'], '</dd>'; |
441 | + } |
|
419 | 442 | } |
420 | 443 | |
421 | 444 | echo ' |
422 | 445 | <dt>', $txt['local_time'], ':</dt> |
423 | 446 | <dd>', $context['member']['local_time'], '</dd>'; |
424 | 447 | |
425 | - if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) |
|
426 | - echo ' |
|
448 | + if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) { |
|
449 | + echo ' |
|
427 | 450 | <dt>', $txt['language'], ':</dt> |
428 | 451 | <dd>', $context['member']['language'], '</dd>'; |
452 | + } |
|
429 | 453 | |
430 | - if ($context['member']['show_last_login']) |
|
431 | - echo ' |
|
454 | + if ($context['member']['show_last_login']) { |
|
455 | + echo ' |
|
432 | 456 | <dt>', $txt['lastLoggedIn'], ': </dt> |
433 | 457 | <dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>'; |
458 | + } |
|
434 | 459 | |
435 | 460 | echo ' |
436 | 461 | </dl>'; |
@@ -442,10 +467,11 @@ discard block |
||
442 | 467 | <div class="custom_fields_above_signature"> |
443 | 468 | <ul class="nolist">'; |
444 | 469 | |
445 | - foreach ($context['print_custom_fields']['above_signature'] as $field) |
|
446 | - if (!empty($field['output_html'])) |
|
470 | + foreach ($context['print_custom_fields']['above_signature'] as $field) { |
|
471 | + if (!empty($field['output_html'])) |
|
447 | 472 | echo ' |
448 | 473 | <li>', $field['output_html'], '</li>'; |
474 | + } |
|
449 | 475 | |
450 | 476 | echo ' |
451 | 477 | </ul> |
@@ -453,12 +479,13 @@ discard block |
||
453 | 479 | } |
454 | 480 | |
455 | 481 | // Show the users signature. |
456 | - if ($context['signature_enabled'] && !empty($context['member']['signature'])) |
|
457 | - echo ' |
|
482 | + if ($context['signature_enabled'] && !empty($context['member']['signature'])) { |
|
483 | + echo ' |
|
458 | 484 | <div class="signature"> |
459 | 485 | <h5>', $txt['signature'], ':</h5> |
460 | 486 | ', $context['member']['signature'], ' |
461 | 487 | </div>'; |
488 | + } |
|
462 | 489 | |
463 | 490 | // Are there any custom profile fields for below the signature? |
464 | 491 | if (!empty($context['print_custom_fields']['below_signature'])) |
@@ -467,10 +494,11 @@ discard block |
||
467 | 494 | <div class="custom_fields_below_signature"> |
468 | 495 | <ul class="nolist">'; |
469 | 496 | |
470 | - foreach ($context['print_custom_fields']['below_signature'] as $field) |
|
471 | - if (!empty($field['output_html'])) |
|
497 | + foreach ($context['print_custom_fields']['below_signature'] as $field) { |
|
498 | + if (!empty($field['output_html'])) |
|
472 | 499 | echo ' |
473 | 500 | <li>', $field['output_html'], '</li>'; |
501 | + } |
|
474 | 502 | |
475 | 503 | echo ' |
476 | 504 | </ul> |
@@ -516,62 +544,70 @@ discard block |
||
516 | 544 | </div> |
517 | 545 | <div class="list_posts">'; |
518 | 546 | |
519 | - if (!$post['approved']) |
|
520 | - echo ' |
|
547 | + if (!$post['approved']) { |
|
548 | + echo ' |
|
521 | 549 | <div class="approve_post"> |
522 | 550 | <em>', $txt['post_awaiting_approval'], '</em> |
523 | 551 | </div>'; |
552 | + } |
|
524 | 553 | |
525 | 554 | echo ' |
526 | 555 | ', $post['body'], ' |
527 | 556 | </div>'; |
528 | 557 | |
529 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
530 | - echo ' |
|
558 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
559 | + echo ' |
|
531 | 560 | <div class="floatright"> |
532 | 561 | <ul class="quickbuttons">'; |
562 | + } |
|
533 | 563 | |
534 | 564 | // If they *can* reply? |
535 | - if ($post['can_reply']) |
|
536 | - echo ' |
|
565 | + if ($post['can_reply']) { |
|
566 | + echo ' |
|
537 | 567 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
568 | + } |
|
538 | 569 | |
539 | 570 | // If they *can* quote? |
540 | - if ($post['can_quote']) |
|
541 | - echo ' |
|
571 | + if ($post['can_quote']) { |
|
572 | + echo ' |
|
542 | 573 | <li><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
574 | + } |
|
543 | 575 | |
544 | 576 | // How about... even... remove it entirely?! |
545 | - if ($post['can_delete']) |
|
546 | - echo ' |
|
577 | + if ($post['can_delete']) { |
|
578 | + echo ' |
|
547 | 579 | <li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
580 | + } |
|
548 | 581 | |
549 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
550 | - echo ' |
|
582 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
583 | + echo ' |
|
551 | 584 | </ul> |
552 | 585 | </div><!-- .floatright -->'; |
586 | + } |
|
553 | 587 | |
554 | 588 | echo ' |
555 | 589 | </div><!-- $post[css_class] -->'; |
556 | 590 | } |
591 | + } else { |
|
592 | + template_show_list('attachments'); |
|
557 | 593 | } |
558 | - else |
|
559 | - template_show_list('attachments'); |
|
560 | 594 | |
561 | 595 | // No posts? Just end with a informative message. |
562 | - if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) |
|
563 | - echo ' |
|
596 | + if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) { |
|
597 | + echo ' |
|
564 | 598 | <div class="windowbg2"> |
565 | 599 | ', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), ' |
566 | 600 | </div>'; |
601 | + } |
|
567 | 602 | |
568 | 603 | // Show more page numbers. |
569 | - if (!empty($context['page_index'])) |
|
570 | - echo ' |
|
604 | + if (!empty($context['page_index'])) { |
|
605 | + echo ' |
|
571 | 606 | <div class="pagesection"> |
572 | 607 | <div class="pagelinks">', $context['page_index'], '</div> |
573 | 608 | </div>'; |
574 | -} |
|
609 | + } |
|
610 | + } |
|
575 | 611 | |
576 | 612 | /** |
577 | 613 | * Template for showing alerts within the alerts popup |
@@ -581,11 +617,12 @@ discard block |
||
581 | 617 | global $context, $txt, $scripturl; |
582 | 618 | |
583 | 619 | // Do we have an update message? |
584 | - if (!empty($context['update_message'])) |
|
585 | - echo ' |
|
620 | + if (!empty($context['update_message'])) { |
|
621 | + echo ' |
|
586 | 622 | <div class="infobox"> |
587 | 623 | ', $context['update_message'], '. |
588 | 624 | </div>'; |
625 | + } |
|
589 | 626 | |
590 | 627 | echo ' |
591 | 628 | <div class="cat_bar"> |
@@ -594,13 +631,12 @@ discard block |
||
594 | 631 | </h3> |
595 | 632 | </div>'; |
596 | 633 | |
597 | - if (empty($context['alerts'])) |
|
598 | - echo ' |
|
634 | + if (empty($context['alerts'])) { |
|
635 | + echo ' |
|
599 | 636 | <div class="information"> |
600 | 637 | ', $txt['alerts_none'], ' |
601 | 638 | </div>'; |
602 | - |
|
603 | - else |
|
639 | + } else |
|
604 | 640 | { |
605 | 641 | // Start the form. |
606 | 642 | echo ' |
@@ -662,12 +698,12 @@ discard block |
||
662 | 698 | </div>' : ''; |
663 | 699 | |
664 | 700 | // No drafts? Just show an informative message. |
665 | - if (empty($context['drafts'])) |
|
666 | - echo ' |
|
701 | + if (empty($context['drafts'])) { |
|
702 | + echo ' |
|
667 | 703 | <div class="windowbg2 centertext"> |
668 | 704 | ', $txt['draft_none'], ' |
669 | 705 | </div>'; |
670 | - else |
|
706 | + } else |
|
671 | 707 | { |
672 | 708 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
673 | 709 | foreach ($context['drafts'] as $draft) |
@@ -679,13 +715,15 @@ discard block |
||
679 | 715 | <h5> |
680 | 716 | <strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> '; |
681 | 717 | |
682 | - if (!empty($draft['sticky'])) |
|
683 | - echo ' |
|
718 | + if (!empty($draft['sticky'])) { |
|
719 | + echo ' |
|
684 | 720 | <span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>'; |
721 | + } |
|
685 | 722 | |
686 | - if (!empty($draft['locked'])) |
|
687 | - echo ' |
|
723 | + if (!empty($draft['locked'])) { |
|
724 | + echo ' |
|
688 | 725 | <span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>'; |
726 | + } |
|
689 | 727 | |
690 | 728 | echo ' |
691 | 729 | </h5> |
@@ -718,13 +756,13 @@ discard block |
||
718 | 756 | { |
719 | 757 | global $context, $scripturl, $txt; |
720 | 758 | |
721 | - if (!empty($context['saved_successful'])) |
|
722 | - echo ' |
|
759 | + if (!empty($context['saved_successful'])) { |
|
760 | + echo ' |
|
723 | 761 | <div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>'; |
724 | - |
|
725 | - elseif (!empty($context['saved_failed'])) |
|
726 | - echo ' |
|
762 | + } elseif (!empty($context['saved_failed'])) { |
|
763 | + echo ' |
|
727 | 764 | <div class="errorbox">', $context['saved_failed'], '</div>'; |
765 | + } |
|
728 | 766 | |
729 | 767 | echo ' |
730 | 768 | <div id="edit_buddies"> |
@@ -739,14 +777,16 @@ discard block |
||
739 | 777 | <th scope="col" class="quarter_table">', $txt['name'], '</th> |
740 | 778 | <th scope="col">', $txt['status'], '</th>'; |
741 | 779 | |
742 | - if (allowedTo('moderate_forum')) |
|
743 | - echo ' |
|
780 | + if (allowedTo('moderate_forum')) { |
|
781 | + echo ' |
|
744 | 782 | <th scope="col">', $txt['email'], '</th>'; |
783 | + } |
|
745 | 784 | |
746 | - if (!empty($context['custom_pf'])) |
|
747 | - foreach ($context['custom_pf'] as $column) |
|
785 | + if (!empty($context['custom_pf'])) { |
|
786 | + foreach ($context['custom_pf'] as $column) |
|
748 | 787 | echo ' |
749 | 788 | <th scope="col">', $column['label'], '</th>'; |
789 | + } |
|
750 | 790 | |
751 | 791 | echo ' |
752 | 792 | <th scope="col">', $txt['remove'], '</th> |
@@ -755,13 +795,14 @@ discard block |
||
755 | 795 | <tbody>'; |
756 | 796 | |
757 | 797 | // If they don't have any buddies don't list them! |
758 | - if (empty($context['buddies'])) |
|
759 | - echo ' |
|
798 | + if (empty($context['buddies'])) { |
|
799 | + echo ' |
|
760 | 800 | <tr class="windowbg"> |
761 | 801 | <td colspan="', allowedTo('moderate_forum') ? '10' : '9', '"> |
762 | 802 | <strong>', $txt['no_buddies'], '</strong> |
763 | 803 | </td> |
764 | 804 | </tr>'; |
805 | + } |
|
765 | 806 | |
766 | 807 | // Now loop through each buddy showing info on each. |
767 | 808 | else |
@@ -775,17 +816,19 @@ discard block |
||
775 | 816 | <a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a> |
776 | 817 | </td>'; |
777 | 818 | |
778 | - if ($buddy['show_email']) |
|
779 | - echo ' |
|
819 | + if ($buddy['show_email']) { |
|
820 | + echo ' |
|
780 | 821 | <td> |
781 | 822 | <a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a> |
782 | 823 | </td>'; |
824 | + } |
|
783 | 825 | |
784 | 826 | // Show the custom profile fields for this user. |
785 | - if (!empty($context['custom_pf'])) |
|
786 | - foreach ($context['custom_pf'] as $key => $column) |
|
827 | + if (!empty($context['custom_pf'])) { |
|
828 | + foreach ($context['custom_pf'] as $key => $column) |
|
787 | 829 | echo ' |
788 | 830 | <td class="lefttext">', $buddy['options'][$key], '</td>'; |
831 | + } |
|
789 | 832 | |
790 | 833 | echo ' |
791 | 834 | <td> |
@@ -818,9 +861,10 @@ discard block |
||
818 | 861 | </dl> |
819 | 862 | </div>'; |
820 | 863 | |
821 | - if (!empty($context['token_check'])) |
|
822 | - echo ' |
|
864 | + if (!empty($context['token_check'])) { |
|
865 | + echo ' |
|
823 | 866 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
867 | + } |
|
824 | 868 | |
825 | 869 | echo ' |
826 | 870 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -846,12 +890,13 @@ discard block |
||
846 | 890 | { |
847 | 891 | global $context, $scripturl, $txt; |
848 | 892 | |
849 | - if (!empty($context['saved_successful'])) |
|
850 | - echo ' |
|
893 | + if (!empty($context['saved_successful'])) { |
|
894 | + echo ' |
|
851 | 895 | <div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>'; |
852 | - elseif (!empty($context['saved_failed'])) |
|
853 | - echo ' |
|
896 | + } elseif (!empty($context['saved_failed'])) { |
|
897 | + echo ' |
|
854 | 898 | <div class="errorbox">', $context['saved_failed'], '</div>'; |
899 | + } |
|
855 | 900 | |
856 | 901 | echo ' |
857 | 902 | <div id="edit_buddies"> |
@@ -866,9 +911,10 @@ discard block |
||
866 | 911 | <th scope="col" class="quarter_table">', $txt['name'], '</th> |
867 | 912 | <th scope="col">', $txt['status'], '</th>'; |
868 | 913 | |
869 | - if (allowedTo('moderate_forum')) |
|
870 | - echo ' |
|
914 | + if (allowedTo('moderate_forum')) { |
|
915 | + echo ' |
|
871 | 916 | <th scope="col">', $txt['email'], '</th>'; |
917 | + } |
|
872 | 918 | |
873 | 919 | echo ' |
874 | 920 | <th scope="col">', $txt['ignore_remove'], '</th> |
@@ -877,13 +923,14 @@ discard block |
||
877 | 923 | <tbody>'; |
878 | 924 | |
879 | 925 | // If they don't have anyone on their ignore list, don't list it! |
880 | - if (empty($context['ignore_list'])) |
|
881 | - echo ' |
|
926 | + if (empty($context['ignore_list'])) { |
|
927 | + echo ' |
|
882 | 928 | <tr class="windowbg"> |
883 | 929 | <td colspan="', allowedTo('moderate_forum') ? '4' : '3', '"> |
884 | 930 | <strong>', $txt['no_ignore'], '</strong> |
885 | 931 | </td> |
886 | 932 | </tr>'; |
933 | + } |
|
887 | 934 | |
888 | 935 | // Now loop through each buddy showing info on each. |
889 | 936 | foreach ($context['ignore_list'] as $member) |
@@ -895,11 +942,12 @@ discard block |
||
895 | 942 | <a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a> |
896 | 943 | </td>'; |
897 | 944 | |
898 | - if ($member['show_email']) |
|
899 | - echo ' |
|
945 | + if ($member['show_email']) { |
|
946 | + echo ' |
|
900 | 947 | <td> |
901 | 948 | <a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a> |
902 | 949 | </td>'; |
950 | + } |
|
903 | 951 | echo ' |
904 | 952 | <td> |
905 | 953 | <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['ignore_remove'], '"></span></a> |
@@ -929,9 +977,10 @@ discard block |
||
929 | 977 | </dl> |
930 | 978 | </div>'; |
931 | 979 | |
932 | - if (!empty($context['token_check'])) |
|
933 | - echo ' |
|
980 | + if (!empty($context['token_check'])) { |
|
981 | + echo ' |
|
934 | 982 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
983 | + } |
|
935 | 984 | |
936 | 985 | echo ' |
937 | 986 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -977,9 +1026,10 @@ discard block |
||
977 | 1026 | <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>'; |
978 | 1027 | |
979 | 1028 | // Second address detected? |
980 | - if (!empty($context['last_ip2'])) |
|
981 | - echo ' |
|
1029 | + if (!empty($context['last_ip2'])) { |
|
1030 | + echo ' |
|
982 | 1031 | , <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>'; |
1032 | + } |
|
983 | 1033 | |
984 | 1034 | echo ' |
985 | 1035 | </dd>'; |
@@ -1045,9 +1095,10 @@ discard block |
||
1045 | 1095 | </div> |
1046 | 1096 | <div class="windowbg2 noup">'; |
1047 | 1097 | |
1048 | - foreach ($context['whois_servers'] as $server) |
|
1049 | - echo ' |
|
1098 | + foreach ($context['whois_servers'] as $server) { |
|
1099 | + echo ' |
|
1050 | 1100 | <a href="', $server['url'], '" target="_blank"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>'; |
1101 | + } |
|
1051 | 1102 | echo ' |
1052 | 1103 | </div> |
1053 | 1104 | <br>'; |
@@ -1058,10 +1109,10 @@ discard block |
||
1058 | 1109 | <div class="cat_bar"> |
1059 | 1110 | <h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3> |
1060 | 1111 | </div>'; |
1061 | - if (empty($context['ips'])) |
|
1062 | - echo ' |
|
1112 | + if (empty($context['ips'])) { |
|
1113 | + echo ' |
|
1063 | 1114 | <p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>'; |
1064 | - else |
|
1115 | + } else |
|
1065 | 1116 | { |
1066 | 1117 | echo ' |
1067 | 1118 | <table class="table_grid"> |
@@ -1074,12 +1125,13 @@ discard block |
||
1074 | 1125 | <tbody>'; |
1075 | 1126 | |
1076 | 1127 | // Loop through each of the members and display them. |
1077 | - foreach ($context['ips'] as $ip => $memberlist) |
|
1078 | - echo ' |
|
1128 | + foreach ($context['ips'] as $ip => $memberlist) { |
|
1129 | + echo ' |
|
1079 | 1130 | <tr class="windowbg"> |
1080 | 1131 | <td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td> |
1081 | 1132 | <td>', implode(', ', $memberlist), '</td> |
1082 | 1133 | </tr>'; |
1134 | + } |
|
1083 | 1135 | |
1084 | 1136 | echo ' |
1085 | 1137 | </tbody> |
@@ -1125,8 +1177,7 @@ discard block |
||
1125 | 1177 | { |
1126 | 1178 | echo ' |
1127 | 1179 | <div class="information">', $txt['showPermissions_all'], '</div>'; |
1128 | - } |
|
1129 | - else |
|
1180 | + } else |
|
1130 | 1181 | { |
1131 | 1182 | echo ' |
1132 | 1183 | <div class="information">',$txt['showPermissions_help'], '</div> |
@@ -1141,9 +1192,10 @@ discard block |
||
1141 | 1192 | <div class="windowbg smalltext"> |
1142 | 1193 | ', $txt['showPermissions_restricted_boards_desc'], ':<br>'; |
1143 | 1194 | |
1144 | - foreach ($context['no_access_boards'] as $no_access_board) |
|
1145 | - echo ' |
|
1195 | + foreach ($context['no_access_boards'] as $no_access_board) { |
|
1196 | + echo ' |
|
1146 | 1197 | <a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', '; |
1198 | + } |
|
1147 | 1199 | echo ' |
1148 | 1200 | </div>'; |
1149 | 1201 | } |
@@ -1175,12 +1227,13 @@ discard block |
||
1175 | 1227 | </td> |
1176 | 1228 | <td class="smalltext">'; |
1177 | 1229 | |
1178 | - if ($permission['is_denied']) |
|
1179 | - echo ' |
|
1230 | + if ($permission['is_denied']) { |
|
1231 | + echo ' |
|
1180 | 1232 | <span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>'; |
1181 | - else |
|
1182 | - echo ' |
|
1233 | + } else { |
|
1234 | + echo ' |
|
1183 | 1235 | ', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']); |
1236 | + } |
|
1184 | 1237 | |
1185 | 1238 | echo ' |
1186 | 1239 | </td> |
@@ -1191,10 +1244,10 @@ discard block |
||
1191 | 1244 | </table> |
1192 | 1245 | </div><!-- .tborder --> |
1193 | 1246 | <br>'; |
1194 | - } |
|
1195 | - else |
|
1196 | - echo ' |
|
1247 | + } else { |
|
1248 | + echo ' |
|
1197 | 1249 | <p class="windowbg2">', $txt['showPermissions_none_general'], '</p>'; |
1250 | + } |
|
1198 | 1251 | |
1199 | 1252 | // Board permission section. |
1200 | 1253 | echo ' |
@@ -1204,14 +1257,16 @@ discard block |
||
1204 | 1257 | <a id="board_permissions"></a>', $txt['showPermissions_select'], ': |
1205 | 1258 | <select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();"> |
1206 | 1259 | <option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], ' </option>'; |
1207 | - if (!empty($context['boards'])) |
|
1208 | - echo ' |
|
1260 | + if (!empty($context['boards'])) { |
|
1261 | + echo ' |
|
1209 | 1262 | <option value="" disabled>---------------------------</option>'; |
1263 | + } |
|
1210 | 1264 | |
1211 | 1265 | // Fill the box with any local permission boards. |
1212 | - foreach ($context['boards'] as $board) |
|
1213 | - echo ' |
|
1266 | + foreach ($context['boards'] as $board) { |
|
1267 | + echo ' |
|
1214 | 1268 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>'; |
1269 | + } |
|
1215 | 1270 | |
1216 | 1271 | echo ' |
1217 | 1272 | </select> |
@@ -1242,8 +1297,7 @@ discard block |
||
1242 | 1297 | { |
1243 | 1298 | echo ' |
1244 | 1299 | <span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>'; |
1245 | - } |
|
1246 | - else |
|
1300 | + } else |
|
1247 | 1301 | { |
1248 | 1302 | echo ' |
1249 | 1303 | ', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']); |
@@ -1255,10 +1309,10 @@ discard block |
||
1255 | 1309 | echo ' |
1256 | 1310 | </tbody> |
1257 | 1311 | </table>'; |
1258 | - } |
|
1259 | - else |
|
1260 | - echo ' |
|
1312 | + } else { |
|
1313 | + echo ' |
|
1261 | 1314 | <p class="windowbg2">', $txt['showPermissions_none_board'], '</p>'; |
1315 | + } |
|
1262 | 1316 | echo ' |
1263 | 1317 | </div><!-- #permissions -->'; |
1264 | 1318 | } |
@@ -1299,9 +1353,10 @@ discard block |
||
1299 | 1353 | </div>'; |
1300 | 1354 | |
1301 | 1355 | // If they haven't post at all, don't draw the graph. |
1302 | - if (empty($context['posts_by_time'])) |
|
1303 | - echo ' |
|
1356 | + if (empty($context['posts_by_time'])) { |
|
1357 | + echo ' |
|
1304 | 1358 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
1359 | + } |
|
1305 | 1360 | // Otherwise do! |
1306 | 1361 | else |
1307 | 1362 | { |
@@ -1339,11 +1394,10 @@ discard block |
||
1339 | 1394 | </h3> |
1340 | 1395 | </div>'; |
1341 | 1396 | |
1342 | - if (empty($context['popular_boards'])) |
|
1343 | - echo ' |
|
1397 | + if (empty($context['popular_boards'])) { |
|
1398 | + echo ' |
|
1344 | 1399 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
1345 | - |
|
1346 | - else |
|
1400 | + } else |
|
1347 | 1401 | { |
1348 | 1402 | echo ' |
1349 | 1403 | <dl class="stats">'; |
@@ -1373,10 +1427,10 @@ discard block |
||
1373 | 1427 | </h3> |
1374 | 1428 | </div>'; |
1375 | 1429 | |
1376 | - if (empty($context['board_activity'])) |
|
1377 | - echo ' |
|
1430 | + if (empty($context['board_activity'])) { |
|
1431 | + echo ' |
|
1378 | 1432 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
1379 | - else |
|
1433 | + } else |
|
1380 | 1434 | { |
1381 | 1435 | echo ' |
1382 | 1436 | <dl class="stats">'; |
@@ -1427,41 +1481,46 @@ discard block |
||
1427 | 1481 | <h3 class="catbg profile_hd">'; |
1428 | 1482 | |
1429 | 1483 | // Don't say "Profile" if this isn't the profile... |
1430 | - if (!empty($context['profile_header_text'])) |
|
1431 | - echo ' |
|
1484 | + if (!empty($context['profile_header_text'])) { |
|
1485 | + echo ' |
|
1432 | 1486 | ', $context['profile_header_text']; |
1433 | - else |
|
1434 | - echo ' |
|
1487 | + } else { |
|
1488 | + echo ' |
|
1435 | 1489 | ', $txt['profile']; |
1490 | + } |
|
1436 | 1491 | |
1437 | 1492 | echo ' |
1438 | 1493 | </h3> |
1439 | 1494 | </div>'; |
1440 | 1495 | |
1441 | 1496 | // Have we some description? |
1442 | - if ($context['page_desc']) |
|
1443 | - echo ' |
|
1497 | + if ($context['page_desc']) { |
|
1498 | + echo ' |
|
1444 | 1499 | <p class="information">', $context['page_desc'], '</p>'; |
1500 | + } |
|
1445 | 1501 | |
1446 | 1502 | echo ' |
1447 | 1503 | <div class="roundframe">'; |
1448 | 1504 | |
1449 | 1505 | // Any bits at the start? |
1450 | - if (!empty($context['profile_prehtml'])) |
|
1451 | - echo ' |
|
1506 | + if (!empty($context['profile_prehtml'])) { |
|
1507 | + echo ' |
|
1452 | 1508 | <div>', $context['profile_prehtml'], '</div>'; |
1509 | + } |
|
1453 | 1510 | |
1454 | - if (!empty($context['profile_fields'])) |
|
1455 | - echo ' |
|
1511 | + if (!empty($context['profile_fields'])) { |
|
1512 | + echo ' |
|
1456 | 1513 | <dl class="settings">'; |
1514 | + } |
|
1457 | 1515 | |
1458 | 1516 | // Start the big old loop 'of love. |
1459 | 1517 | $lastItem = 'hr'; |
1460 | 1518 | foreach ($context['profile_fields'] as $key => $field) |
1461 | 1519 | { |
1462 | 1520 | // We add a little hack to be sure we never get more than one hr in a row! |
1463 | - if ($lastItem == 'hr' && $field['type'] == 'hr') |
|
1464 | - continue; |
|
1521 | + if ($lastItem == 'hr' && $field['type'] == 'hr') { |
|
1522 | + continue; |
|
1523 | + } |
|
1465 | 1524 | |
1466 | 1525 | $lastItem = $field['type']; |
1467 | 1526 | if ($field['type'] == 'hr') |
@@ -1470,48 +1529,50 @@ discard block |
||
1470 | 1529 | </dl> |
1471 | 1530 | <hr> |
1472 | 1531 | <dl class="settings">'; |
1473 | - } |
|
1474 | - elseif ($field['type'] == 'callback') |
|
1532 | + } elseif ($field['type'] == 'callback') |
|
1475 | 1533 | { |
1476 | 1534 | if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func'])) |
1477 | 1535 | { |
1478 | 1536 | $callback_func = 'template_profile_' . $field['callback_func']; |
1479 | 1537 | $callback_func(); |
1480 | 1538 | } |
1481 | - } |
|
1482 | - else |
|
1539 | + } else |
|
1483 | 1540 | { |
1484 | 1541 | echo ' |
1485 | 1542 | <dt> |
1486 | 1543 | <strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>'; |
1487 | 1544 | |
1488 | 1545 | // Does it have any subtext to show? |
1489 | - if (!empty($field['subtext'])) |
|
1490 | - echo ' |
|
1546 | + if (!empty($field['subtext'])) { |
|
1547 | + echo ' |
|
1491 | 1548 | <br> |
1492 | 1549 | <span class="smalltext">', $field['subtext'], '</span>'; |
1550 | + } |
|
1493 | 1551 | |
1494 | 1552 | echo ' |
1495 | 1553 | </dt> |
1496 | 1554 | <dd>'; |
1497 | 1555 | |
1498 | 1556 | // Want to put something infront of the box? |
1499 | - if (!empty($field['preinput'])) |
|
1500 | - echo ' |
|
1557 | + if (!empty($field['preinput'])) { |
|
1558 | + echo ' |
|
1501 | 1559 | ', $field['preinput']; |
1560 | + } |
|
1502 | 1561 | |
1503 | 1562 | // What type of data are we showing? |
1504 | - if ($field['type'] == 'label') |
|
1505 | - echo ' |
|
1563 | + if ($field['type'] == 'label') { |
|
1564 | + echo ' |
|
1506 | 1565 | ', $field['value']; |
1566 | + } |
|
1507 | 1567 | |
1508 | 1568 | // Maybe it's a text box - very likely! |
1509 | 1569 | elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url'))) |
1510 | 1570 | { |
1511 | - if ($field['type'] == 'int' || $field['type'] == 'float') |
|
1512 | - $type = 'number'; |
|
1513 | - else |
|
1514 | - $type = $field['type']; |
|
1571 | + if ($field['type'] == 'int' || $field['type'] == 'float') { |
|
1572 | + $type = 'number'; |
|
1573 | + } else { |
|
1574 | + $type = $field['type']; |
|
1575 | + } |
|
1515 | 1576 | $step = $field['type'] == 'float' ? ' step="0.1"' : ''; |
1516 | 1577 | |
1517 | 1578 | |
@@ -1519,10 +1580,11 @@ discard block |
||
1519 | 1580 | <input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' ', $step, '>'; |
1520 | 1581 | } |
1521 | 1582 | // You "checking" me out? ;) |
1522 | - elseif ($field['type'] == 'check') |
|
1523 | - echo ' |
|
1583 | + elseif ($field['type'] == 'check') { |
|
1584 | + echo ' |
|
1524 | 1585 | <input type="hidden" name="', $key, '" value="0"> |
1525 | 1586 | <input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>'; |
1587 | + } |
|
1526 | 1588 | |
1527 | 1589 | // Always fun - select boxes! |
1528 | 1590 | elseif ($field['type'] == 'select') |
@@ -1533,14 +1595,16 @@ discard block |
||
1533 | 1595 | if (isset($field['options'])) |
1534 | 1596 | { |
1535 | 1597 | // Is this some code to generate the options? |
1536 | - if (!is_array($field['options'])) |
|
1537 | - $field['options'] = $field['options'](); |
|
1598 | + if (!is_array($field['options'])) { |
|
1599 | + $field['options'] = $field['options'](); |
|
1600 | + } |
|
1538 | 1601 | |
1539 | 1602 | // Assuming we now have some! |
1540 | - if (is_array($field['options'])) |
|
1541 | - foreach ($field['options'] as $value => $name) |
|
1603 | + if (is_array($field['options'])) { |
|
1604 | + foreach ($field['options'] as $value => $name) |
|
1542 | 1605 | echo ' |
1543 | 1606 | <option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
1607 | + } |
|
1544 | 1608 | } |
1545 | 1609 | |
1546 | 1610 | echo ' |
@@ -1548,25 +1612,28 @@ discard block |
||
1548 | 1612 | } |
1549 | 1613 | |
1550 | 1614 | // Something to end with? |
1551 | - if (!empty($field['postinput'])) |
|
1552 | - echo ' |
|
1615 | + if (!empty($field['postinput'])) { |
|
1616 | + echo ' |
|
1553 | 1617 | ', $field['postinput']; |
1618 | + } |
|
1554 | 1619 | |
1555 | 1620 | echo ' |
1556 | 1621 | </dd>'; |
1557 | 1622 | } |
1558 | 1623 | } |
1559 | 1624 | |
1560 | - if (!empty($context['profile_fields'])) |
|
1561 | - echo ' |
|
1625 | + if (!empty($context['profile_fields'])) { |
|
1626 | + echo ' |
|
1562 | 1627 | </dl>'; |
1628 | + } |
|
1563 | 1629 | |
1564 | 1630 | // Are there any custom profile fields - if so print them! |
1565 | 1631 | if (!empty($context['custom_fields'])) |
1566 | 1632 | { |
1567 | - if ($lastItem != 'hr') |
|
1568 | - echo ' |
|
1633 | + if ($lastItem != 'hr') { |
|
1634 | + echo ' |
|
1569 | 1635 | <hr>'; |
1636 | + } |
|
1570 | 1637 | |
1571 | 1638 | echo ' |
1572 | 1639 | <dl class="settings">'; |
@@ -1589,13 +1656,14 @@ discard block |
||
1589 | 1656 | } |
1590 | 1657 | |
1591 | 1658 | // Any closing HTML? |
1592 | - if (!empty($context['profile_posthtml'])) |
|
1593 | - echo ' |
|
1659 | + if (!empty($context['profile_posthtml'])) { |
|
1660 | + echo ' |
|
1594 | 1661 | <div>', $context['profile_posthtml'], '</div>'; |
1662 | + } |
|
1595 | 1663 | |
1596 | 1664 | // Only show the password box if it's actually needed. |
1597 | - if ($context['require_password']) |
|
1598 | - echo ' |
|
1665 | + if ($context['require_password']) { |
|
1666 | + echo ' |
|
1599 | 1667 | <dl class="settings"> |
1600 | 1668 | <dt> |
1601 | 1669 | <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br> |
@@ -1605,18 +1673,21 @@ discard block |
||
1605 | 1673 | <input type="password" name="oldpasswrd" id="oldpasswrd" size="20"> |
1606 | 1674 | </dd> |
1607 | 1675 | </dl>'; |
1676 | + } |
|
1608 | 1677 | |
1609 | 1678 | // The button shouldn't say "Change profile" unless we're changing the profile... |
1610 | - if (!empty($context['submit_button_text'])) |
|
1611 | - echo ' |
|
1679 | + if (!empty($context['submit_button_text'])) { |
|
1680 | + echo ' |
|
1612 | 1681 | <input type="submit" name="save" value="', $context['submit_button_text'], '" class="button">'; |
1613 | - else |
|
1614 | - echo ' |
|
1682 | + } else { |
|
1683 | + echo ' |
|
1615 | 1684 | <input type="submit" name="save" value="', $txt['change_profile'], '" class="button">'; |
1685 | + } |
|
1616 | 1686 | |
1617 | - if (!empty($context['token_check'])) |
|
1618 | - echo ' |
|
1687 | + if (!empty($context['token_check'])) { |
|
1688 | + echo ' |
|
1619 | 1689 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
1690 | + } |
|
1620 | 1691 | |
1621 | 1692 | echo ' |
1622 | 1693 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1626,10 +1697,11 @@ discard block |
||
1626 | 1697 | </form>'; |
1627 | 1698 | |
1628 | 1699 | // Any final spellchecking stuff? |
1629 | - if (!empty($context['show_spellchecking'])) |
|
1630 | - echo ' |
|
1700 | + if (!empty($context['show_spellchecking'])) { |
|
1701 | + echo ' |
|
1631 | 1702 | <form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value=""></form>'; |
1632 | -} |
|
1703 | + } |
|
1704 | + } |
|
1633 | 1705 | |
1634 | 1706 | /** |
1635 | 1707 | * Personal Message settings. |
@@ -1666,10 +1738,11 @@ discard block |
||
1666 | 1738 | <select name="pm_receive_from" id="pm_receive_from"> |
1667 | 1739 | <option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>'; |
1668 | 1740 | |
1669 | - if (!empty($modSettings['enable_buddylist'])) |
|
1670 | - echo ' |
|
1741 | + if (!empty($modSettings['enable_buddylist'])) { |
|
1742 | + echo ' |
|
1671 | 1743 | <option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option> |
1672 | 1744 | <option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>'; |
1745 | + } |
|
1673 | 1746 | |
1674 | 1747 | echo ' |
1675 | 1748 | <option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option> |
@@ -1712,11 +1785,12 @@ discard block |
||
1712 | 1785 | if (empty($setting) || !is_array($setting)) |
1713 | 1786 | { |
1714 | 1787 | // Insert a separator (unless this is the first item in the list) |
1715 | - if ($i !== $first_option_key) |
|
1716 | - echo ' |
|
1788 | + if ($i !== $first_option_key) { |
|
1789 | + echo ' |
|
1717 | 1790 | </dl> |
1718 | 1791 | <hr> |
1719 | 1792 | <dl class="settings">'; |
1793 | + } |
|
1720 | 1794 | |
1721 | 1795 | // Should we give a name to this section? |
1722 | 1796 | if (is_string($setting) && !empty($setting)) |
@@ -1725,52 +1799,57 @@ discard block |
||
1725 | 1799 | echo ' |
1726 | 1800 | <dt><strong>' . $setting . '</strong></dt> |
1727 | 1801 | <dd></dd>'; |
1802 | + } else { |
|
1803 | + $titled_section = false; |
|
1728 | 1804 | } |
1729 | - else |
|
1730 | - $titled_section = false; |
|
1731 | 1805 | |
1732 | 1806 | continue; |
1733 | 1807 | } |
1734 | 1808 | |
1735 | 1809 | // Is this disabled? |
1736 | - if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) |
|
1737 | - continue; |
|
1738 | - elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) |
|
1739 | - continue; |
|
1740 | - elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) |
|
1741 | - continue; |
|
1742 | - elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) |
|
1743 | - continue; |
|
1744 | - elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) |
|
1745 | - continue; |
|
1746 | - elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) |
|
1747 | - continue; |
|
1748 | - elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) |
|
1749 | - continue; |
|
1810 | + if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) { |
|
1811 | + continue; |
|
1812 | + } elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) { |
|
1813 | + continue; |
|
1814 | + } elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) { |
|
1815 | + continue; |
|
1816 | + } elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) { |
|
1817 | + continue; |
|
1818 | + } elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) { |
|
1819 | + continue; |
|
1820 | + } elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) { |
|
1821 | + continue; |
|
1822 | + } elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) { |
|
1823 | + continue; |
|
1824 | + } |
|
1750 | 1825 | |
1751 | 1826 | // Some of these may not be set... Set to defaults here |
1752 | 1827 | $opts = array('topics_per_page', 'messages_per_page', 'display_quick_mod'); |
1753 | - if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']])) |
|
1754 | - $context['member']['options'][$setting['id']] = 0; |
|
1828 | + if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']])) { |
|
1829 | + $context['member']['options'][$setting['id']] = 0; |
|
1830 | + } |
|
1755 | 1831 | |
1756 | - if (!isset($setting['type']) || $setting['type'] == 'bool') |
|
1757 | - $setting['type'] = 'checkbox'; |
|
1758 | - elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') |
|
1759 | - $setting['type'] = 'number'; |
|
1760 | - elseif ($setting['type'] == 'string') |
|
1761 | - $setting['type'] = 'text'; |
|
1832 | + if (!isset($setting['type']) || $setting['type'] == 'bool') { |
|
1833 | + $setting['type'] = 'checkbox'; |
|
1834 | + } elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') { |
|
1835 | + $setting['type'] = 'number'; |
|
1836 | + } elseif ($setting['type'] == 'string') { |
|
1837 | + $setting['type'] = 'text'; |
|
1838 | + } |
|
1762 | 1839 | |
1763 | - if (isset($setting['options'])) |
|
1764 | - $setting['type'] = 'list'; |
|
1840 | + if (isset($setting['options'])) { |
|
1841 | + $setting['type'] = 'list'; |
|
1842 | + } |
|
1765 | 1843 | |
1766 | 1844 | echo ' |
1767 | 1845 | <dt> |
1768 | 1846 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
1769 | 1847 | |
1770 | - if (isset($setting['description'])) |
|
1771 | - echo ' |
|
1848 | + if (isset($setting['description'])) { |
|
1849 | + echo ' |
|
1772 | 1850 | <br> |
1773 | 1851 | <span class="smalltext">', $setting['description'], '</span>'; |
1852 | + } |
|
1774 | 1853 | echo ' |
1775 | 1854 | </dt> |
1776 | 1855 | <dd>'; |
@@ -1808,13 +1887,11 @@ discard block |
||
1808 | 1887 | |
1809 | 1888 | echo ' |
1810 | 1889 | <input type="number"', $min . $max . $step; |
1811 | - } |
|
1812 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
1890 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
1813 | 1891 | { |
1814 | 1892 | echo' |
1815 | 1893 | <input type="url"'; |
1816 | - } |
|
1817 | - else |
|
1894 | + } else |
|
1818 | 1895 | { |
1819 | 1896 | echo ' |
1820 | 1897 | <input type="text"'; |
@@ -1855,8 +1932,8 @@ discard block |
||
1855 | 1932 | <dl class="settings">'; |
1856 | 1933 | |
1857 | 1934 | // Allow notification on announcements to be disabled? |
1858 | - if (!empty($modSettings['allow_disableAnnounce'])) |
|
1859 | - echo ' |
|
1935 | + if (!empty($modSettings['allow_disableAnnounce'])) { |
|
1936 | + echo ' |
|
1860 | 1937 | <dt> |
1861 | 1938 | <label for="notify_announcements">', $txt['notify_important_email'], '</label> |
1862 | 1939 | </dt> |
@@ -1864,15 +1941,17 @@ discard block |
||
1864 | 1941 | <input type="hidden" name="notify_announcements" value="0"> |
1865 | 1942 | <input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', '> |
1866 | 1943 | </dd>'; |
1944 | + } |
|
1867 | 1945 | |
1868 | - if (!empty($modSettings['enable_ajax_alerts'])) |
|
1869 | - echo ' |
|
1946 | + if (!empty($modSettings['enable_ajax_alerts'])) { |
|
1947 | + echo ' |
|
1870 | 1948 | <dt> |
1871 | 1949 | <label for="notify_send_body">', $txt['notify_alert_timeout'], '</label> |
1872 | 1950 | </dt> |
1873 | 1951 | <dd> |
1874 | 1952 | <input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '"> |
1875 | 1953 | </dd>'; |
1954 | + } |
|
1876 | 1955 | |
1877 | 1956 | echo ' |
1878 | 1957 | </dl> |
@@ -1902,9 +1981,10 @@ discard block |
||
1902 | 1981 | <td colspan="3">'; |
1903 | 1982 | $label = $txt['alert_opt_' . $opts[1]]; |
1904 | 1983 | $label_pos = isset($opts['label']) ? $opts['label'] : ''; |
1905 | - if ($label_pos == 'before') |
|
1906 | - echo ' |
|
1984 | + if ($label_pos == 'before') { |
|
1985 | + echo ' |
|
1907 | 1986 | <label for="opt_', $opts[1], '">', $label, '</label>'; |
1987 | + } |
|
1908 | 1988 | |
1909 | 1989 | $this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0; |
1910 | 1990 | switch ($opts[0]) |
@@ -1916,17 +1996,19 @@ discard block |
||
1916 | 1996 | case 'select': |
1917 | 1997 | echo ' |
1918 | 1998 | <select name="opt_', $opts[1], '" id="opt_', $opts[1], '">'; |
1919 | - foreach ($opts['opts'] as $k => $v) |
|
1920 | - echo ' |
|
1999 | + foreach ($opts['opts'] as $k => $v) { |
|
2000 | + echo ' |
|
1921 | 2001 | <option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>'; |
2002 | + } |
|
1922 | 2003 | echo ' |
1923 | 2004 | </select>'; |
1924 | 2005 | break; |
1925 | 2006 | } |
1926 | 2007 | |
1927 | - if ($label_pos == 'after') |
|
1928 | - echo ' |
|
2008 | + if ($label_pos == 'after') { |
|
2009 | + echo ' |
|
1929 | 2010 | <label for="opt_', $opts[1], '">', $label, '</label>'; |
2011 | + } |
|
1930 | 2012 | |
1931 | 2013 | echo ' |
1932 | 2014 | </td> |
@@ -2042,11 +2124,12 @@ discard block |
||
2042 | 2124 | <p class="information">', $txt['groupMembership_info'], '</p>'; |
2043 | 2125 | |
2044 | 2126 | // Do we have an update message? |
2045 | - if (!empty($context['update_message'])) |
|
2046 | - echo ' |
|
2127 | + if (!empty($context['update_message'])) { |
|
2128 | + echo ' |
|
2047 | 2129 | <div class="infobox"> |
2048 | 2130 | ', $context['update_message'], '. |
2049 | 2131 | </div>'; |
2132 | + } |
|
2050 | 2133 | |
2051 | 2134 | echo ' |
2052 | 2135 | <div id="groups">'; |
@@ -2068,8 +2151,7 @@ discard block |
||
2068 | 2151 | </div> |
2069 | 2152 | </div> |
2070 | 2153 | </div><!-- .groupmembership -->'; |
2071 | - } |
|
2072 | - else |
|
2154 | + } else |
|
2073 | 2155 | { |
2074 | 2156 | echo ' |
2075 | 2157 | <div class="title_bar"> |
@@ -2081,27 +2163,30 @@ discard block |
||
2081 | 2163 | echo ' |
2082 | 2164 | <div class="windowbg" id="primdiv_', $group['id'], '">'; |
2083 | 2165 | |
2084 | - if ($context['can_edit_primary']) |
|
2085 | - echo ' |
|
2166 | + if ($context['can_edit_primary']) { |
|
2167 | + echo ' |
|
2086 | 2168 | <input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '"', $group['is_primary'] ? ' checked' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');"', $group['can_be_primary'] ? '' : ' disabled', '>'; |
2169 | + } |
|
2087 | 2170 | |
2088 | 2171 | echo ' |
2089 | 2172 | <label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>'; |
2090 | 2173 | |
2091 | 2174 | // Can they leave their group? |
2092 | - if ($group['can_leave']) |
|
2093 | - echo ' |
|
2175 | + if ($group['can_leave']) { |
|
2176 | + echo ' |
|
2094 | 2177 | <a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">' . $txt['leave_group'] . '</a>'; |
2178 | + } |
|
2095 | 2179 | |
2096 | 2180 | echo ' |
2097 | 2181 | </div><!-- .windowbg -->'; |
2098 | 2182 | } |
2099 | 2183 | |
2100 | - if ($context['can_edit_primary']) |
|
2101 | - echo ' |
|
2184 | + if ($context['can_edit_primary']) { |
|
2185 | + echo ' |
|
2102 | 2186 | <div class="padding righttext"> |
2103 | 2187 | <input type="submit" value="', $txt['make_primary'], '" class="button"> |
2104 | 2188 | </div>'; |
2189 | + } |
|
2105 | 2190 | |
2106 | 2191 | // Any groups they can join? |
2107 | 2192 | if (!empty($context['groups']['available'])) |
@@ -2117,15 +2202,16 @@ discard block |
||
2117 | 2202 | <div class="windowbg"> |
2118 | 2203 | <strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), ''; |
2119 | 2204 | |
2120 | - if ($group['type'] == 3) |
|
2121 | - echo ' |
|
2205 | + if ($group['type'] == 3) { |
|
2206 | + echo ' |
|
2122 | 2207 | <a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '" class="button floatright">', $txt['join_group'], '</a>'; |
2123 | - elseif ($group['type'] == 2 && $group['pending']) |
|
2124 | - echo ' |
|
2208 | + } elseif ($group['type'] == 2 && $group['pending']) { |
|
2209 | + echo ' |
|
2125 | 2210 | <span class="floatright">', $txt['approval_pending'], '</span>'; |
2126 | - elseif ($group['type'] == 2) |
|
2127 | - echo ' |
|
2211 | + } elseif ($group['type'] == 2) { |
|
2212 | + echo ' |
|
2128 | 2213 | <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>'; |
2214 | + } |
|
2129 | 2215 | |
2130 | 2216 | echo ' |
2131 | 2217 | </div><!-- .windowbg -->'; |
@@ -2148,9 +2234,10 @@ discard block |
||
2148 | 2234 | |
2149 | 2235 | prevDiv.className = "windowbg"; |
2150 | 2236 | }'; |
2151 | - if (isset($context['groups']['member'][$context['primary_group']])) |
|
2152 | - echo ' |
|
2237 | + if (isset($context['groups']['member'][$context['primary_group']])) { |
|
2238 | + echo ' |
|
2153 | 2239 | highlightSelected("primdiv_' . $context['primary_group'] . '");'; |
2240 | + } |
|
2154 | 2241 | echo ' |
2155 | 2242 | </script>'; |
2156 | 2243 | } |
@@ -2158,9 +2245,10 @@ discard block |
||
2158 | 2245 | echo ' |
2159 | 2246 | </div><!-- #groups -->'; |
2160 | 2247 | |
2161 | - if (!empty($context['token_check'])) |
|
2162 | - echo ' |
|
2248 | + if (!empty($context['token_check'])) { |
|
2249 | + echo ' |
|
2163 | 2250 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
2251 | + } |
|
2164 | 2252 | |
2165 | 2253 | echo ' |
2166 | 2254 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2208,14 +2296,15 @@ discard block |
||
2208 | 2296 | |
2209 | 2297 | foreach ($category['boards'] as $board) |
2210 | 2298 | { |
2211 | - if ($i == $limit) |
|
2212 | - echo ' |
|
2299 | + if ($i == $limit) { |
|
2300 | + echo ' |
|
2213 | 2301 | </ul> |
2214 | 2302 | </li> |
2215 | 2303 | </ul> |
2216 | 2304 | <ul class="ignoreboards floatright"> |
2217 | 2305 | <li class="category"> |
2218 | 2306 | <ul>'; |
2307 | + } |
|
2219 | 2308 | |
2220 | 2309 | echo ' |
2221 | 2310 | <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
@@ -2261,10 +2350,11 @@ discard block |
||
2261 | 2350 | |
2262 | 2351 | // Work out the starting color. |
2263 | 2352 | $context['current_color'] = $context['colors'][0]; |
2264 | - foreach ($context['colors'] as $limit => $color) |
|
2265 | - if ($context['member']['warning'] >= $limit) |
|
2353 | + foreach ($context['colors'] as $limit => $color) { |
|
2354 | + if ($context['member']['warning'] >= $limit) |
|
2266 | 2355 | $context['current_color'] = $color; |
2267 | -} |
|
2356 | + } |
|
2357 | + } |
|
2268 | 2358 | |
2269 | 2359 | // Show all warnings of a user? |
2270 | 2360 | function template_viewWarning() |
@@ -2303,14 +2393,15 @@ discard block |
||
2303 | 2393 | </dd>'; |
2304 | 2394 | |
2305 | 2395 | // There's some impact of this? |
2306 | - if (!empty($context['level_effects'][$context['current_level']])) |
|
2307 | - echo ' |
|
2396 | + if (!empty($context['level_effects'][$context['current_level']])) { |
|
2397 | + echo ' |
|
2308 | 2398 | <dt> |
2309 | 2399 | <strong>', $txt['profile_viewwarning_impact'], ':</strong> |
2310 | 2400 | </dt> |
2311 | 2401 | <dd> |
2312 | 2402 | ', $context['level_effects'][$context['current_level']], ' |
2313 | 2403 | </dd>'; |
2404 | + } |
|
2314 | 2405 | |
2315 | 2406 | echo ' |
2316 | 2407 | </dl> |
@@ -2348,10 +2439,11 @@ discard block |
||
2348 | 2439 | |
2349 | 2440 | // Otherwise see what we can do...'; |
2350 | 2441 | |
2351 | - foreach ($context['notification_templates'] as $k => $type) |
|
2352 | - echo ' |
|
2442 | + foreach ($context['notification_templates'] as $k => $type) { |
|
2443 | + echo ' |
|
2353 | 2444 | if (index == ', $k, ') |
2354 | 2445 | document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";'; |
2446 | + } |
|
2355 | 2447 | |
2356 | 2448 | echo ' |
2357 | 2449 | } |
@@ -2361,10 +2453,11 @@ discard block |
||
2361 | 2453 | // Also set the right effect. |
2362 | 2454 | effectText = "";'; |
2363 | 2455 | |
2364 | - foreach ($context['level_effects'] as $limit => $text) |
|
2365 | - echo ' |
|
2456 | + foreach ($context['level_effects'] as $limit => $text) { |
|
2457 | + echo ' |
|
2366 | 2458 | if (slideAmount >= ', $limit, ') |
2367 | 2459 | effectText = "', $text, '";'; |
2460 | + } |
|
2368 | 2461 | |
2369 | 2462 | echo ' |
2370 | 2463 | setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\'); |
@@ -2379,32 +2472,35 @@ discard block |
||
2379 | 2472 | </h3> |
2380 | 2473 | </div>'; |
2381 | 2474 | |
2382 | - if (!$context['user']['is_owner']) |
|
2383 | - echo ' |
|
2475 | + if (!$context['user']['is_owner']) { |
|
2476 | + echo ' |
|
2384 | 2477 | <p class="information">', $txt['profile_warning_desc'], '</p>'; |
2478 | + } |
|
2385 | 2479 | |
2386 | 2480 | echo ' |
2387 | 2481 | <div class="windowbg"> |
2388 | 2482 | <dl class="settings">'; |
2389 | 2483 | |
2390 | - if (!$context['user']['is_owner']) |
|
2391 | - echo ' |
|
2484 | + if (!$context['user']['is_owner']) { |
|
2485 | + echo ' |
|
2392 | 2486 | <dt> |
2393 | 2487 | <strong>', $txt['profile_warning_name'], ':</strong> |
2394 | 2488 | </dt> |
2395 | 2489 | <dd> |
2396 | 2490 | <strong>', $context['member']['name'], '</strong> |
2397 | 2491 | </dd>'; |
2492 | + } |
|
2398 | 2493 | |
2399 | 2494 | echo ' |
2400 | 2495 | <dt> |
2401 | 2496 | <strong>', $txt['profile_warning_level'], ':</strong>'; |
2402 | 2497 | |
2403 | 2498 | // Is there only so much they can apply? |
2404 | - if ($context['warning_limit']) |
|
2405 | - echo ' |
|
2499 | + if ($context['warning_limit']) { |
|
2500 | + echo ' |
|
2406 | 2501 | <br> |
2407 | 2502 | <span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>'; |
2503 | + } |
|
2408 | 2504 | |
2409 | 2505 | echo ' |
2410 | 2506 | </dt> |
@@ -2459,9 +2555,10 @@ discard block |
||
2459 | 2555 | <option value="-1">', $txt['profile_warning_notify_template'], '</option> |
2460 | 2556 | <option value="-1" disabled>------------------------------</option>'; |
2461 | 2557 | |
2462 | - foreach ($context['notification_templates'] as $id_template => $template) |
|
2463 | - echo ' |
|
2558 | + foreach ($context['notification_templates'] as $id_template => $template) { |
|
2559 | + echo ' |
|
2464 | 2560 | <option value="', $id_template, '">', $template['title'], '</option>'; |
2561 | + } |
|
2465 | 2562 | |
2466 | 2563 | echo ' |
2467 | 2564 | </select> |
@@ -2474,9 +2571,10 @@ discard block |
||
2474 | 2571 | </dl> |
2475 | 2572 | <div class="righttext">'; |
2476 | 2573 | |
2477 | - if (!empty($context['token_check'])) |
|
2478 | - echo ' |
|
2574 | + if (!empty($context['token_check'])) { |
|
2575 | + echo ' |
|
2479 | 2576 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
2577 | + } |
|
2480 | 2578 | |
2481 | 2579 | echo ' |
2482 | 2580 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2492,8 +2590,8 @@ discard block |
||
2492 | 2590 | echo ' |
2493 | 2591 | <script>'; |
2494 | 2592 | |
2495 | - if (!$context['user']['is_owner']) |
|
2496 | - echo ' |
|
2593 | + if (!$context['user']['is_owner']) { |
|
2594 | + echo ' |
|
2497 | 2595 | modifyWarnNotify(); |
2498 | 2596 | $(document).ready(function() { |
2499 | 2597 | $("#preview_button").click(function() { |
@@ -2532,6 +2630,7 @@ discard block |
||
2532 | 2630 | }); |
2533 | 2631 | return false; |
2534 | 2632 | }'; |
2633 | + } |
|
2535 | 2634 | |
2536 | 2635 | echo ' |
2537 | 2636 | </script>'; |
@@ -2554,16 +2653,18 @@ discard block |
||
2554 | 2653 | </div>'; |
2555 | 2654 | |
2556 | 2655 | // If deleting another account give them a lovely info box. |
2557 | - if (!$context['user']['is_owner']) |
|
2558 | - echo ' |
|
2656 | + if (!$context['user']['is_owner']) { |
|
2657 | + echo ' |
|
2559 | 2658 | <p class="information">', $txt['deleteAccount_desc'], '</p>'; |
2659 | + } |
|
2560 | 2660 | echo ' |
2561 | 2661 | <div class="windowbg2">'; |
2562 | 2662 | |
2563 | 2663 | // If they are deleting their account AND the admin needs to approve it - give them another piece of info ;) |
2564 | - if ($context['needs_approval']) |
|
2565 | - echo ' |
|
2664 | + if ($context['needs_approval']) { |
|
2665 | + echo ' |
|
2566 | 2666 | <div class="errorbox">', $txt['deleteAccount_approval'], '</div>'; |
2667 | + } |
|
2567 | 2668 | |
2568 | 2669 | // If the user is deleting their own account warn them first - and require a password! |
2569 | 2670 | if ($context['user']['is_owner']) |
@@ -2575,9 +2676,10 @@ discard block |
||
2575 | 2676 | <input type="password" name="oldpasswrd" size="20"> |
2576 | 2677 | <input type="submit" value="', $txt['yes'], '" class="button">'; |
2577 | 2678 | |
2578 | - if (!empty($context['token_check'])) |
|
2579 | - echo ' |
|
2679 | + if (!empty($context['token_check'])) { |
|
2680 | + echo ' |
|
2580 | 2681 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
2682 | + } |
|
2581 | 2683 | |
2582 | 2684 | echo ' |
2583 | 2685 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2607,10 +2709,11 @@ discard block |
||
2607 | 2709 | <option value="topics">', $txt['deleteAccount_topics'], '</option> |
2608 | 2710 | </select>'; |
2609 | 2711 | |
2610 | - if ($context['show_perma_delete']) |
|
2611 | - echo ' |
|
2712 | + if ($context['show_perma_delete']) { |
|
2713 | + echo ' |
|
2612 | 2714 | <br> |
2613 | 2715 | <label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1">', $txt['deleteAccount_permanent'], ':</label>'; |
2716 | + } |
|
2614 | 2717 | |
2615 | 2718 | echo ' |
2616 | 2719 | </div>'; |
@@ -2623,9 +2726,10 @@ discard block |
||
2623 | 2726 | <div> |
2624 | 2727 | <input type="submit" value="', $txt['delete'], '" class="button">'; |
2625 | 2728 | |
2626 | - if (!empty($context['token_check'])) |
|
2627 | - echo ' |
|
2729 | + if (!empty($context['token_check'])) { |
|
2730 | + echo ' |
|
2628 | 2731 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
2732 | + } |
|
2629 | 2733 | |
2630 | 2734 | echo ' |
2631 | 2735 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2651,8 +2755,8 @@ discard block |
||
2651 | 2755 | <hr>'; |
2652 | 2756 | |
2653 | 2757 | // Only show the password box if it's actually needed. |
2654 | - if ($context['require_password']) |
|
2655 | - echo ' |
|
2758 | + if ($context['require_password']) { |
|
2759 | + echo ' |
|
2656 | 2760 | <dl class="settings"> |
2657 | 2761 | <dt> |
2658 | 2762 | <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br> |
@@ -2662,13 +2766,15 @@ discard block |
||
2662 | 2766 | <input type="password" name="oldpasswrd" size="20"> |
2663 | 2767 | </dd> |
2664 | 2768 | </dl>'; |
2769 | + } |
|
2665 | 2770 | |
2666 | 2771 | echo ' |
2667 | 2772 | <div class="righttext">'; |
2668 | 2773 | |
2669 | - if (!empty($context['token_check'])) |
|
2670 | - echo ' |
|
2774 | + if (!empty($context['token_check'])) { |
|
2775 | + echo ' |
|
2671 | 2776 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
2777 | + } |
|
2672 | 2778 | |
2673 | 2779 | echo ' |
2674 | 2780 | <input type="submit" value="', $txt['change_profile'], '" class="button"> |
@@ -2695,9 +2801,10 @@ discard block |
||
2695 | 2801 | <ul id="list_errors">'; |
2696 | 2802 | |
2697 | 2803 | // Cycle through each error and display an error message. |
2698 | - foreach ($context['post_errors'] as $error) |
|
2699 | - echo ' |
|
2804 | + foreach ($context['post_errors'] as $error) { |
|
2805 | + echo ' |
|
2700 | 2806 | <li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>'; |
2807 | + } |
|
2701 | 2808 | |
2702 | 2809 | echo ' |
2703 | 2810 | </ul>'; |
@@ -2723,12 +2830,13 @@ discard block |
||
2723 | 2830 | <select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 && !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>'; |
2724 | 2831 | |
2725 | 2832 | // Fill the select box with all primary member groups that can be assigned to a member. |
2726 | - foreach ($context['member_groups'] as $member_group) |
|
2727 | - if (!empty($member_group['can_be_primary'])) |
|
2833 | + foreach ($context['member_groups'] as $member_group) { |
|
2834 | + if (!empty($member_group['can_be_primary'])) |
|
2728 | 2835 | echo ' |
2729 | 2836 | <option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '> |
2730 | 2837 | ', $member_group['name'], ' |
2731 | 2838 | </option>'; |
2839 | + } |
|
2732 | 2840 | echo ' |
2733 | 2841 | </select> |
2734 | 2842 | </dd> |
@@ -2740,10 +2848,11 @@ discard block |
||
2740 | 2848 | <input type="hidden" name="additional_groups[]" value="0">'; |
2741 | 2849 | |
2742 | 2850 | // For each membergroup show a checkbox so members can be assigned to more than one group. |
2743 | - foreach ($context['member_groups'] as $member_group) |
|
2744 | - if ($member_group['can_be_additional']) |
|
2851 | + foreach ($context['member_groups'] as $member_group) { |
|
2852 | + if ($member_group['can_be_additional']) |
|
2745 | 2853 | echo ' |
2746 | 2854 | <label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked' : '', '> ', $member_group['name'], '</label><br>'; |
2855 | + } |
|
2747 | 2856 | echo ' |
2748 | 2857 | </span> |
2749 | 2858 | <a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;" class="toggle_down">', $txt['additional_membergroups_show'], '</a> |
@@ -2803,9 +2912,10 @@ discard block |
||
2803 | 2912 | <span class="smalltext">', $txt['sig_info'], '</span><br> |
2804 | 2913 | <br>'; |
2805 | 2914 | |
2806 | - if ($context['show_spellchecking']) |
|
2807 | - echo ' |
|
2915 | + if ($context['show_spellchecking']) { |
|
2916 | + echo ' |
|
2808 | 2917 | <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button">'; |
2918 | + } |
|
2809 | 2919 | |
2810 | 2920 | echo ' |
2811 | 2921 | </dt> |
@@ -2813,17 +2923,20 @@ discard block |
||
2813 | 2923 | <textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br>'; |
2814 | 2924 | |
2815 | 2925 | // If there is a limit at all! |
2816 | - if (!empty($context['signature_limits']['max_length'])) |
|
2817 | - echo ' |
|
2926 | + if (!empty($context['signature_limits']['max_length'])) { |
|
2927 | + echo ' |
|
2818 | 2928 | <span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>'; |
2929 | + } |
|
2819 | 2930 | |
2820 | - if (!empty($context['show_preview_button'])) |
|
2821 | - echo ' |
|
2931 | + if (!empty($context['show_preview_button'])) { |
|
2932 | + echo ' |
|
2822 | 2933 | <input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button">'; |
2934 | + } |
|
2823 | 2935 | |
2824 | - if ($context['signature_warning']) |
|
2825 | - echo ' |
|
2936 | + if ($context['signature_warning']) { |
|
2937 | + echo ' |
|
2826 | 2938 | <span class="smalltext">', $context['signature_warning'], '</span>'; |
2939 | + } |
|
2827 | 2940 | |
2828 | 2941 | // Some javascript used to count how many characters have been used so far in the signature. |
2829 | 2942 | echo ' |
@@ -2868,9 +2981,10 @@ discard block |
||
2868 | 2981 | <select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">'; |
2869 | 2982 | |
2870 | 2983 | // This lists all the file categories. |
2871 | - foreach ($context['avatars'] as $avatar) |
|
2872 | - echo ' |
|
2984 | + foreach ($context['avatars'] as $avatar) { |
|
2985 | + echo ' |
|
2873 | 2986 | <option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>'; |
2987 | + } |
|
2874 | 2988 | echo ' |
2875 | 2989 | </select> |
2876 | 2990 | </div> |
@@ -2927,16 +3041,17 @@ discard block |
||
2927 | 3041 | <div id="avatar_gravatar"> |
2928 | 3042 | <img src="' . $context['member']['avatar']['href'] . '" alt="" />'; |
2929 | 3043 | |
2930 | - if (empty($modSettings['gravatarAllowExtraEmail'])) |
|
2931 | - echo ' |
|
3044 | + if (empty($modSettings['gravatarAllowExtraEmail'])) { |
|
3045 | + echo ' |
|
2932 | 3046 | <div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>'; |
2933 | - else |
|
3047 | + } else |
|
2934 | 3048 | { |
2935 | 3049 | // Depending on other stuff, the stored value here might have some odd things in it from other areas. |
2936 | - if ($context['member']['avatar']['external'] == $context['member']['email']) |
|
2937 | - $textbox_value = ''; |
|
2938 | - else |
|
2939 | - $textbox_value = $context['member']['avatar']['external']; |
|
3050 | + if ($context['member']['avatar']['external'] == $context['member']['email']) { |
|
3051 | + $textbox_value = ''; |
|
3052 | + } else { |
|
3053 | + $textbox_value = $context['member']['avatar']['external']; |
|
3054 | + } |
|
2940 | 3055 | |
2941 | 3056 | echo ' |
2942 | 3057 | <div class="smalltext">', $txt['gravatar_alternateEmail'], '</div> |
@@ -3008,8 +3123,9 @@ discard block |
||
3008 | 3123 | $h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0; |
3009 | 3124 | |
3010 | 3125 | $suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : ''); |
3011 | - if (empty($suffix)) |
|
3012 | - return; |
|
3126 | + if (empty($suffix)) { |
|
3127 | + return; |
|
3128 | + } |
|
3013 | 3129 | |
3014 | 3130 | echo ' |
3015 | 3131 | <div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>'; |
@@ -3034,9 +3150,10 @@ discard block |
||
3034 | 3150 | <select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;">'; |
3035 | 3151 | |
3036 | 3152 | // Help the user by showing a list of common time formats. |
3037 | - foreach ($context['easy_timeformats'] as $time_format) |
|
3038 | - echo ' |
|
3153 | + foreach ($context['easy_timeformats'] as $time_format) { |
|
3154 | + echo ' |
|
3039 | 3155 | <option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>'; |
3156 | + } |
|
3040 | 3157 | echo ' |
3041 | 3158 | </select><br> |
3042 | 3159 | <input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30"> |
@@ -3073,9 +3190,10 @@ discard block |
||
3073 | 3190 | <dd> |
3074 | 3191 | <select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">'; |
3075 | 3192 | |
3076 | - foreach ($context['smiley_sets'] as $set) |
|
3077 | - echo ' |
|
3193 | + foreach ($context['smiley_sets'] as $set) { |
|
3194 | + echo ' |
|
3078 | 3195 | <option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>'; |
3196 | + } |
|
3079 | 3197 | echo ' |
3080 | 3198 | </select> |
3081 | 3199 | <img id="smileypr" class="centericon" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.png', '" alt=":)"> |
@@ -3126,10 +3244,11 @@ discard block |
||
3126 | 3244 | <img src="', $context['tfa_qr_url'], '" alt=""> |
3127 | 3245 | </div>'; |
3128 | 3246 | |
3129 | - if (!empty($context['from_ajax'])) |
|
3130 | - echo ' |
|
3247 | + if (!empty($context['from_ajax'])) { |
|
3248 | + echo ' |
|
3131 | 3249 | <br> |
3132 | 3250 | <a href="javascript:self.close();"></a>'; |
3251 | + } |
|
3133 | 3252 | |
3134 | 3253 | echo ' |
3135 | 3254 | </div> |
@@ -3168,15 +3287,16 @@ discard block |
||
3168 | 3287 | <div class="smalltext">', $txt['tfa_profile_desc'], '</div> |
3169 | 3288 | </dt> |
3170 | 3289 | <dd>'; |
3171 | - if (!$context['tfa_enabled'] && $context['user']['is_owner']) |
|
3172 | - echo ' |
|
3290 | + if (!$context['tfa_enabled'] && $context['user']['is_owner']) { |
|
3291 | + echo ' |
|
3173 | 3292 | <a href="', !empty($modSettings['force_ssl']) && $modSettings['force_ssl'] < 2 ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>'; |
3174 | - elseif (!$context['tfa_enabled']) |
|
3175 | - echo ' |
|
3293 | + } elseif (!$context['tfa_enabled']) { |
|
3294 | + echo ' |
|
3176 | 3295 | ', $txt['tfa_profile_disabled']; |
3177 | - else |
|
3178 | - echo ' |
|
3296 | + } else { |
|
3297 | + echo ' |
|
3179 | 3298 | ', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable'); |
3299 | + } |
|
3180 | 3300 | echo ' |
3181 | 3301 | </dd>'; |
3182 | 3302 | } |
@@ -26,9 +26,10 @@ discard block |
||
26 | 26 | </h3> |
27 | 27 | </div>'; |
28 | 28 | |
29 | - if ($context['ban']['is_new']) |
|
30 | - echo ' |
|
29 | + if ($context['ban']['is_new']) { |
|
30 | + echo ' |
|
31 | 31 | <div class="information noup">', $txt['ban_add_notes'], '</div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | // If there were errors creating the ban, show them. |
34 | 35 | if (!empty($context['error_messages'])) |
@@ -38,9 +39,10 @@ discard block |
||
38 | 39 | <strong>', $txt['ban_errors_detected'], '</strong> |
39 | 40 | <ul>'; |
40 | 41 | |
41 | - foreach ($context['error_messages'] as $error) |
|
42 | - echo ' |
|
42 | + foreach ($context['error_messages'] as $error) { |
|
43 | + echo ' |
|
43 | 44 | <li class="error">', $error, '</li>'; |
45 | + } |
|
44 | 46 | |
45 | 47 | echo ' |
46 | 48 | </ul> |
@@ -57,8 +59,8 @@ discard block |
||
57 | 59 | <input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60"> |
58 | 60 | </dd>'; |
59 | 61 | |
60 | - if (isset($context['ban']['reason'])) |
|
61 | - echo ' |
|
62 | + if (isset($context['ban']['reason'])) { |
|
63 | + echo ' |
|
62 | 64 | <dt> |
63 | 65 | <strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br> |
64 | 66 | <span class="smalltext">', $txt['ban_reason_desc'], '</span> |
@@ -66,9 +68,10 @@ discard block |
||
66 | 68 | <dd> |
67 | 69 | <textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea> |
68 | 70 | </dd>'; |
71 | + } |
|
69 | 72 | |
70 | - if (isset($context['ban']['notes'])) |
|
71 | - echo ' |
|
73 | + if (isset($context['ban']['notes'])) { |
|
74 | + echo ' |
|
72 | 75 | <dt> |
73 | 76 | <strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br> |
74 | 77 | <span class="smalltext">', $txt['ban_notes_desc'], '</span> |
@@ -76,6 +79,7 @@ discard block |
||
76 | 79 | <dd> |
77 | 80 | <textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea> |
78 | 81 | </dd>'; |
82 | + } |
|
79 | 83 | |
80 | 84 | echo ' |
81 | 85 | </dl> |
@@ -115,8 +119,8 @@ discard block |
||
115 | 119 | <input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
116 | 120 | </dd>'; |
117 | 121 | |
118 | - if (empty($modSettings['disableHostnameLookup'])) |
|
119 | - echo ' |
|
122 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
123 | + echo ' |
|
120 | 124 | <dt> |
121 | 125 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '> |
122 | 126 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -124,6 +128,7 @@ discard block |
||
124 | 128 | <dd> |
125 | 129 | <input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
126 | 130 | </dd>'; |
131 | + } |
|
127 | 132 | |
128 | 133 | echo ' |
129 | 134 | <dt> |
@@ -153,14 +158,15 @@ discard block |
||
153 | 158 | <dl class="settings">'; |
154 | 159 | |
155 | 160 | $count = 0; |
156 | - foreach ($ban_ips as $ip) |
|
157 | - echo ' |
|
161 | + foreach ($ban_ips as $ip) { |
|
162 | + echo ' |
|
158 | 163 | <dt> |
159 | 164 | <input type="checkbox" id="suggestions_', $key, '_', $count, '" name="ban_suggestions[', $key, '][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '"> |
160 | 165 | </dt> |
161 | 166 | <dd> |
162 | 167 | <label for="suggestions_', $key, '_', $count++, '">', $ip, '</label> |
163 | 168 | </dd>'; |
169 | + } |
|
164 | 170 | |
165 | 171 | echo ' |
166 | 172 | </dl>'; |
@@ -202,8 +208,8 @@ discard block |
||
202 | 208 | addLoadEvent(fUpdateStatus);'; |
203 | 209 | |
204 | 210 | // Auto suggest only needed for adding new bans, not editing |
205 | - if ($context['ban']['is_new'] && empty($_REQUEST['u'])) |
|
206 | - echo ' |
|
211 | + if ($context['ban']['is_new'] && empty($_REQUEST['u'])) { |
|
212 | + echo ' |
|
207 | 213 | var oAddMemberSuggest = new smc_AutoSuggest({ |
208 | 214 | sSelf: \'oAddMemberSuggest\', |
209 | 215 | sSessionId: smf_session_id, |
@@ -221,6 +227,7 @@ discard block |
||
221 | 227 | return true; |
222 | 228 | } |
223 | 229 | oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');'; |
230 | + } |
|
224 | 231 | |
225 | 232 | echo ' |
226 | 233 | function confirmBan(aForm) |
@@ -269,8 +276,8 @@ discard block |
||
269 | 276 | <input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
270 | 277 | </dd>'; |
271 | 278 | |
272 | - if (empty($modSettings['disableHostnameLookup'])) |
|
273 | - echo ' |
|
279 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
280 | + echo ' |
|
274 | 281 | <dt> |
275 | 282 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '> |
276 | 283 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -278,6 +285,7 @@ discard block |
||
278 | 285 | <dd> |
279 | 286 | <input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
280 | 287 | </dd>'; |
288 | + } |
|
281 | 289 | |
282 | 290 | echo ' |
283 | 291 | <dt> |
@@ -55,9 +55,10 @@ discard block |
||
55 | 55 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
56 | 56 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
57 | 57 | |
58 | - if ($context['allow_protected']) |
|
59 | - echo ' |
|
58 | + if ($context['allow_protected']) { |
|
59 | + echo ' |
|
60 | 60 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
61 | + } |
|
61 | 62 | |
62 | 63 | echo ' |
63 | 64 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -67,14 +68,15 @@ discard block |
||
67 | 68 | </dd>'; |
68 | 69 | } |
69 | 70 | |
70 | - if ($context['post_group'] || $context['undefined_group']) |
|
71 | - echo ' |
|
71 | + if ($context['post_group'] || $context['undefined_group']) { |
|
72 | + echo ' |
|
72 | 73 | <dt id="min_posts_text"> |
73 | 74 | <strong>', $txt['membergroups_min_posts'], ':</strong> |
74 | 75 | </dt> |
75 | 76 | <dd> |
76 | 77 | <input type="number" name="min_posts" id="min_posts_input" size="5"> |
77 | 78 | </dd>'; |
79 | + } |
|
78 | 80 | |
79 | 81 | if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups'])) |
80 | 82 | { |
@@ -92,9 +94,10 @@ discard block |
||
92 | 94 | <option value="-1">', $txt['membergroups_guests'], '</option> |
93 | 95 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
94 | 96 | |
95 | - foreach ($context['groups'] as $group) |
|
96 | - echo ' |
|
97 | + foreach ($context['groups'] as $group) { |
|
98 | + echo ' |
|
97 | 99 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
100 | + } |
|
98 | 101 | |
99 | 102 | echo ' |
100 | 103 | </select> |
@@ -105,9 +108,10 @@ discard block |
||
105 | 108 | <option value="-1">', $txt['membergroups_guests'], '</option> |
106 | 109 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
107 | 110 | |
108 | - foreach ($context['groups'] as $group) |
|
109 | - echo ' |
|
111 | + foreach ($context['groups'] as $group) { |
|
112 | + echo ' |
|
110 | 113 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
114 | + } |
|
111 | 115 | |
112 | 116 | echo ' |
113 | 117 | </select> |
@@ -183,8 +187,8 @@ discard block |
||
183 | 187 | <input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30"> |
184 | 188 | </dd>'; |
185 | 189 | |
186 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
187 | - echo ' |
|
190 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
191 | + echo ' |
|
188 | 192 | |
189 | 193 | <dt id="group_desc_text"> |
190 | 194 | <label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label> |
@@ -192,6 +196,7 @@ discard block |
||
192 | 196 | <dd> |
193 | 197 | <textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea> |
194 | 198 | </dd>'; |
199 | + } |
|
195 | 200 | |
196 | 201 | // Group type... |
197 | 202 | if ($context['group']['allow_post_group']) |
@@ -205,9 +210,10 @@ discard block |
||
205 | 210 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
206 | 211 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
207 | 212 | |
208 | - if ($context['group']['allow_protected']) |
|
209 | - echo ' |
|
213 | + if ($context['group']['allow_protected']) { |
|
214 | + echo ' |
|
210 | 215 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
216 | + } |
|
211 | 217 | |
212 | 218 | echo ' |
213 | 219 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -217,8 +223,8 @@ discard block |
||
217 | 223 | </dd>'; |
218 | 224 | } |
219 | 225 | |
220 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
221 | - echo ' |
|
226 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
227 | + echo ' |
|
222 | 228 | <dt id="group_moderators_text"> |
223 | 229 | <label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label> |
224 | 230 | </dt> |
@@ -236,6 +242,7 @@ discard block |
||
236 | 242 | <option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option> |
237 | 243 | </select> |
238 | 244 | </dd>'; |
245 | + } |
|
239 | 246 | |
240 | 247 | // Can they inherit permissions? |
241 | 248 | if ($context['group']['id'] > 1 && $context['group']['id'] != 3) |
@@ -252,9 +259,10 @@ discard block |
||
252 | 259 | <option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>'; |
253 | 260 | |
254 | 261 | // For all the inheritable groups show an option. |
255 | - foreach ($context['inheritable_groups'] as $id => $group) |
|
256 | - echo ' |
|
262 | + foreach ($context['inheritable_groups'] as $id => $group) { |
|
263 | + echo ' |
|
257 | 264 | <option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>'; |
265 | + } |
|
258 | 266 | |
259 | 267 | echo ' |
260 | 268 | </select> |
@@ -262,8 +270,8 @@ discard block |
||
262 | 270 | </dd>'; |
263 | 271 | } |
264 | 272 | |
265 | - if ($context['group']['allow_post_group']) |
|
266 | - echo ' |
|
273 | + if ($context['group']['allow_post_group']) { |
|
274 | + echo ' |
|
267 | 275 | |
268 | 276 | <dt id="min_posts_text"> |
269 | 277 | <label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label> |
@@ -271,6 +279,7 @@ discard block |
||
271 | 279 | <dd> |
272 | 280 | <input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6"> |
273 | 281 | </dd>'; |
282 | + } |
|
274 | 283 | |
275 | 284 | echo ' |
276 | 285 | <dt> |
@@ -313,9 +322,10 @@ discard block |
||
313 | 322 | } |
314 | 323 | |
315 | 324 | // No? Hide the entire control. |
316 | - else |
|
317 | - echo ' |
|
325 | + else { |
|
326 | + echo ' |
|
318 | 327 | <input type="hidden" name="icon_image" value="">'; |
328 | + } |
|
319 | 329 | |
320 | 330 | echo ' |
321 | 331 | <dt> |
@@ -327,8 +337,8 @@ discard block |
||
327 | 337 | </dd>'; |
328 | 338 | |
329 | 339 | // Force 2FA for this membergroup? |
330 | - if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) |
|
331 | - echo ' |
|
340 | + if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) { |
|
341 | + echo ' |
|
332 | 342 | <dt> |
333 | 343 | <label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br> |
334 | 344 | <span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span> |
@@ -336,6 +346,7 @@ discard block |
||
336 | 346 | <dd> |
337 | 347 | <input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '> |
338 | 348 | </dd>'; |
349 | + } |
|
339 | 350 | |
340 | 351 | if (!empty($context['categories'])) |
341 | 352 | { |
@@ -346,11 +357,11 @@ discard block |
||
346 | 357 | </dt> |
347 | 358 | <dd>'; |
348 | 359 | |
349 | - if (!empty($context['can_manage_boards'])) |
|
350 | - echo $txt['membergroups_can_manage_access']; |
|
351 | - |
|
352 | - else |
|
353 | - template_add_edit_group_boards_list(); |
|
360 | + if (!empty($context['can_manage_boards'])) { |
|
361 | + echo $txt['membergroups_can_manage_access']; |
|
362 | + } else { |
|
363 | + template_add_edit_group_boards_list(); |
|
364 | + } |
|
354 | 365 | |
355 | 366 | echo ' |
356 | 367 | </dd>'; |
@@ -379,20 +390,21 @@ discard block |
||
379 | 390 | sItemListContainerId: \'moderator_container\', |
380 | 391 | aListItems: ['; |
381 | 392 | |
382 | - foreach ($context['group']['moderators'] as $id_member => $member_name) |
|
383 | - echo ' |
|
393 | + foreach ($context['group']['moderators'] as $id_member => $member_name) { |
|
394 | + echo ' |
|
384 | 395 | { |
385 | 396 | sItemId: ', JavaScriptEscape($id_member), ', |
386 | 397 | sItemName: ', JavaScriptEscape($member_name), ' |
387 | 398 | }', $id_member == $context['group']['last_moderator_id'] ? '' : ','; |
399 | + } |
|
388 | 400 | |
389 | 401 | echo ' |
390 | 402 | ] |
391 | 403 | }); |
392 | 404 | </script>'; |
393 | 405 | |
394 | - if ($context['group']['allow_post_group']) |
|
395 | - echo ' |
|
406 | + if ($context['group']['allow_post_group']) { |
|
407 | + echo ' |
|
396 | 408 | <script> |
397 | 409 | function swapPostGroup(isChecked) |
398 | 410 | { |
@@ -440,7 +452,8 @@ discard block |
||
440 | 452 | |
441 | 453 | swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', '); |
442 | 454 | </script>'; |
443 | -} |
|
455 | + } |
|
456 | + } |
|
444 | 457 | |
445 | 458 | /** |
446 | 459 | * The template for determining which boards a group has access to. |
@@ -458,13 +471,13 @@ discard block |
||
458 | 471 | |
459 | 472 | foreach ($context['categories'] as $category) |
460 | 473 | { |
461 | - if (empty($modSettings['deny_boards_access'])) |
|
462 | - echo ' |
|
474 | + if (empty($modSettings['deny_boards_access'])) { |
|
475 | + echo ' |
|
463 | 476 | <li class="category"> |
464 | 477 | <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a> |
465 | 478 | <ul style="width:100%">'; |
466 | - else |
|
467 | - echo ' |
|
479 | + } else { |
|
480 | + echo ' |
|
468 | 481 | <li class="category"> |
469 | 482 | <strong>', $category['name'], '</strong> |
470 | 483 | <span class="select_all_box"> |
@@ -477,16 +490,17 @@ discard block |
||
477 | 490 | </select> |
478 | 491 | </span> |
479 | 492 | <ul style="width:100%" id="boards_list_', $category['id'], '">'; |
493 | + } |
|
480 | 494 | |
481 | 495 | foreach ($category['boards'] as $board) |
482 | 496 | { |
483 | - if (empty($modSettings['deny_boards_access'])) |
|
484 | - echo ' |
|
497 | + if (empty($modSettings['deny_boards_access'])) { |
|
498 | + echo ' |
|
485 | 499 | <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
486 | 500 | <input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label> |
487 | 501 | </li>'; |
488 | - else |
|
489 | - echo ' |
|
502 | + } else { |
|
503 | + echo ' |
|
490 | 504 | <li class="board" style="width:100%"> |
491 | 505 | <span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span> |
492 | 506 | <span style="width:50%;float:right"> |
@@ -495,6 +509,7 @@ discard block |
||
495 | 509 | <input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', '> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label> |
496 | 510 | </span> |
497 | 511 | </li>'; |
512 | + } |
|
498 | 513 | } |
499 | 514 | |
500 | 515 | echo ' |
@@ -505,14 +520,14 @@ discard block |
||
505 | 520 | echo ' |
506 | 521 | </ul>'; |
507 | 522 | |
508 | - if (empty($modSettings['deny_boards_access'])) |
|
509 | - echo ' |
|
523 | + if (empty($modSettings['deny_boards_access'])) { |
|
524 | + echo ' |
|
510 | 525 | <br class="clear"><br> |
511 | 526 | <input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');"> |
512 | 527 | <label for="checkall_check"><em>', $txt['check_all'], '</em></label> |
513 | 528 | </fieldset>'; |
514 | - else |
|
515 | - echo ' |
|
529 | + } else { |
|
530 | + echo ' |
|
516 | 531 | <br class="clear"> |
517 | 532 | <span class="select_all_box"> |
518 | 533 | <em>', $txt['all'], ': </em> |
@@ -528,15 +543,17 @@ discard block |
||
528 | 543 | }); |
529 | 544 | }); |
530 | 545 | </script>'; |
546 | + } |
|
531 | 547 | |
532 | - if ($collapse) |
|
533 | - echo ' |
|
548 | + if ($collapse) { |
|
549 | + echo ' |
|
534 | 550 | <a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a> |
535 | 551 | <script> |
536 | 552 | document.getElementById("visible_boards_link").style.display = ""; |
537 | 553 | document.getElementById("visible_boards").style.display = "none"; |
538 | 554 | </script>'; |
539 | -} |
|
555 | + } |
|
556 | + } |
|
540 | 557 | |
541 | 558 | /** |
542 | 559 | * Templatine for viewing the members of a group. |
@@ -561,14 +578,15 @@ discard block |
||
561 | 578 | </dd>'; |
562 | 579 | |
563 | 580 | // Any description to show? |
564 | - if (!empty($context['group']['description'])) |
|
565 | - echo ' |
|
581 | + if (!empty($context['group']['description'])) { |
|
582 | + echo ' |
|
566 | 583 | <dt> |
567 | 584 | <strong>' . $txt['membergroups_members_description'] . ':</strong> |
568 | 585 | </dt> |
569 | 586 | <dd> |
570 | 587 | ', $context['group']['description'], ' |
571 | 588 | </dd>'; |
589 | + } |
|
572 | 590 | |
573 | 591 | echo ' |
574 | 592 | <dt> |
@@ -582,8 +600,9 @@ discard block |
||
582 | 600 | if (!empty($context['group']['moderators'])) |
583 | 601 | { |
584 | 602 | $moderators = array(); |
585 | - foreach ($context['group']['moderators'] as $moderator) |
|
586 | - $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
603 | + foreach ($context['group']['moderators'] as $moderator) { |
|
604 | + $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
605 | + } |
|
587 | 606 | |
588 | 607 | echo ' |
589 | 608 | <dt> |
@@ -608,9 +627,10 @@ discard block |
||
608 | 627 | <tr class="title_bar"> |
609 | 628 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
610 | 629 | |
611 | - if ($context['can_send_email']) |
|
612 | - echo ' |
|
630 | + if ($context['can_send_email']) { |
|
631 | + echo ' |
|
613 | 632 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
633 | + } |
|
614 | 634 | |
615 | 635 | echo ' |
616 | 636 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th> |
@@ -619,19 +639,21 @@ discard block |
||
619 | 639 | <a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a> |
620 | 640 | </th>'; |
621 | 641 | |
622 | - if (!empty($context['group']['assignable'])) |
|
623 | - echo ' |
|
642 | + if (!empty($context['group']['assignable'])) { |
|
643 | + echo ' |
|
624 | 644 | <th style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>'; |
645 | + } |
|
625 | 646 | echo ' |
626 | 647 | </tr> |
627 | 648 | </thead> |
628 | 649 | <tbody>'; |
629 | 650 | |
630 | - if (empty($context['members'])) |
|
631 | - echo ' |
|
651 | + if (empty($context['members'])) { |
|
652 | + echo ' |
|
632 | 653 | <tr class="windowbg"> |
633 | 654 | <td colspan="6">', $txt['membergroups_members_no_members'], '</td> |
634 | 655 | </tr>'; |
656 | + } |
|
635 | 657 | |
636 | 658 | foreach ($context['members'] as $member) |
637 | 659 | { |
@@ -652,9 +674,10 @@ discard block |
||
652 | 674 | <td>', $member['registered'], '</td> |
653 | 675 | <td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>'; |
654 | 676 | |
655 | - if (!empty($context['group']['assignable'])) |
|
656 | - echo ' |
|
677 | + if (!empty($context['group']['assignable'])) { |
|
678 | + echo ' |
|
657 | 679 | <td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>'; |
680 | + } |
|
658 | 681 | echo ' |
659 | 682 | </tr>'; |
660 | 683 | } |
@@ -663,11 +686,12 @@ discard block |
||
663 | 686 | </tbody> |
664 | 687 | </table>'; |
665 | 688 | |
666 | - if (!empty($context['group']['assignable'])) |
|
667 | - echo ' |
|
689 | + if (!empty($context['group']['assignable'])) { |
|
690 | + echo ' |
|
668 | 691 | <div class="floatright"> |
669 | 692 | <input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button "> |
670 | 693 | </div>'; |
694 | + } |
|
671 | 695 | |
672 | 696 | echo ' |
673 | 697 | <div class="pagesection flow_hidden"> |
@@ -701,8 +725,8 @@ discard block |
||
701 | 725 | </form> |
702 | 726 | </div><!-- #admincenter -->'; |
703 | 727 | |
704 | - if (!empty($context['group']['assignable'])) |
|
705 | - echo ' |
|
728 | + if (!empty($context['group']['assignable'])) { |
|
729 | + echo ' |
|
706 | 730 | <script> |
707 | 731 | var oAddMemberSuggest = new smc_AutoSuggest({ |
708 | 732 | sSelf: \'oAddMemberSuggest\', |
@@ -718,7 +742,8 @@ discard block |
||
718 | 742 | sItemListContainerId: \'toAddItemContainer\' |
719 | 743 | }); |
720 | 744 | </script>'; |
721 | -} |
|
745 | + } |
|
746 | + } |
|
722 | 747 | |
723 | 748 | /** |
724 | 749 | * Allow the moderator to enter a reason to each user being rejected. |
@@ -738,8 +763,8 @@ discard block |
||
738 | 763 | <dl class="settings">'; |
739 | 764 | |
740 | 765 | // Loop through and print out a reason box for each... |
741 | - foreach ($context['group_requests'] as $request) |
|
742 | - echo ' |
|
766 | + foreach ($context['group_requests'] as $request) { |
|
767 | + echo ' |
|
743 | 768 | <dt> |
744 | 769 | <strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong> |
745 | 770 | </dt> |
@@ -747,6 +772,7 @@ discard block |
||
747 | 772 | <input type="hidden" name="groupr[]" value="', $request['id'], '"> |
748 | 773 | <textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="min-width: 80%; max-width: 99%;"></textarea> |
749 | 774 | </dd>'; |
775 | + } |
|
750 | 776 | |
751 | 777 | echo ' |
752 | 778 | </dl> |
@@ -13,8 +13,9 @@ discard block |
||
13 | 13 | * @version 2.1 Beta 4 |
14 | 14 | */ |
15 | 15 | |
16 | -if (!defined('SMF')) |
|
16 | +if (!defined('SMF')) { |
|
17 | 17 | die('No direct access...'); |
18 | +} |
|
18 | 19 | |
19 | 20 | /** |
20 | 21 | * Downloads an avatar or attachment based on $_GET['attach'], and increments the download count. |
@@ -40,11 +41,11 @@ discard block |
||
40 | 41 | |
41 | 42 | if (!empty($modSettings['enableCompressedOutput']) && !headers_sent() && ob_get_length() == 0) |
42 | 43 | { |
43 | - if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler') |
|
44 | - $modSettings['enableCompressedOutput'] = 0; |
|
45 | - |
|
46 | - else |
|
47 | - ob_start('ob_gzhandler'); |
|
44 | + if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler') { |
|
45 | + $modSettings['enableCompressedOutput'] = 0; |
|
46 | + } else { |
|
47 | + ob_start('ob_gzhandler'); |
|
48 | + } |
|
48 | 49 | } |
49 | 50 | |
50 | 51 | if (empty($modSettings['enableCompressedOutput'])) |
@@ -76,8 +77,9 @@ discard block |
||
76 | 77 | } |
77 | 78 | |
78 | 79 | // Use cache when possible. |
79 | - if (($cache = cache_get_data('attachment_lookup_id-' . $attachId)) != null) |
|
80 | - list($file, $thumbFile) = $cache; |
|
80 | + if (($cache = cache_get_data('attachment_lookup_id-' . $attachId)) != null) { |
|
81 | + list($file, $thumbFile) = $cache; |
|
82 | + } |
|
81 | 83 | |
82 | 84 | // Get the info from the DB. |
83 | 85 | if (empty($file) || empty($thumbFile) && !empty($file['id_thumb'])) |
@@ -85,10 +87,9 @@ discard block |
||
85 | 87 | // Do we have a hook wanting to use our attachment system? We use $attachRequest to prevent accidental usage of $request. |
86 | 88 | $attachRequest = null; |
87 | 89 | call_integration_hook('integrate_download_request', array(&$attachRequest)); |
88 | - if (!is_null($attachRequest) && $smcFunc['db_is_resource']($attachRequest)) |
|
89 | - $request = $attachRequest; |
|
90 | - |
|
91 | - else |
|
90 | + if (!is_null($attachRequest) && $smcFunc['db_is_resource']($attachRequest)) { |
|
91 | + $request = $attachRequest; |
|
92 | + } else |
|
92 | 93 | { |
93 | 94 | // Make sure this attachment is on this board and load its info while we are at it. |
94 | 95 | $request = $smcFunc['db_query']('', ' |
@@ -181,13 +182,15 @@ discard block |
||
181 | 182 | } |
182 | 183 | |
183 | 184 | // Cache it. |
184 | - if (!empty($file) || !empty($thumbFile)) |
|
185 | - cache_put_data('attachment_lookup_id-' . $file['id_attach'], array($file, $thumbFile), mt_rand(850, 900)); |
|
185 | + if (!empty($file) || !empty($thumbFile)) { |
|
186 | + cache_put_data('attachment_lookup_id-' . $file['id_attach'], array($file, $thumbFile), mt_rand(850, 900)); |
|
187 | + } |
|
186 | 188 | } |
187 | 189 | |
188 | 190 | // Replace the normal file with its thumbnail if it has one! |
189 | - if (!empty($showThumb) && !empty($thumbFile)) |
|
190 | - $file = $thumbFile; |
|
191 | + if (!empty($showThumb) && !empty($thumbFile)) { |
|
192 | + $file = $thumbFile; |
|
193 | + } |
|
191 | 194 | |
192 | 195 | // No point in a nicer message, because this is supposed to be an attachment anyway... |
193 | 196 | if (!file_exists($file['filePath'])) |
@@ -237,8 +240,8 @@ discard block |
||
237 | 240 | } |
238 | 241 | |
239 | 242 | // Update the download counter (unless it's a thumbnail or resuming an incomplete download). |
240 | - if ($file['attachment_type'] != 3 && empty($showThumb) && $range === 0) |
|
241 | - $smcFunc['db_query']('', ' |
|
243 | + if ($file['attachment_type'] != 3 && empty($showThumb) && $range === 0) { |
|
244 | + $smcFunc['db_query']('', ' |
|
242 | 245 | UPDATE {db_prefix}attachments |
243 | 246 | SET downloads = downloads + 1 |
244 | 247 | WHERE id_attach = {int:id_attach}', |
@@ -246,12 +249,14 @@ discard block |
||
246 | 249 | 'id_attach' => $attachId, |
247 | 250 | ) |
248 | 251 | ); |
252 | + } |
|
249 | 253 | |
250 | 254 | // Send the attachment headers. |
251 | 255 | header('Pragma: '); |
252 | 256 | |
253 | - if (!isBrowser('gecko')) |
|
254 | - header('Content-Transfer-Encoding: binary'); |
|
257 | + if (!isBrowser('gecko')) { |
|
258 | + header('Content-Transfer-Encoding: binary'); |
|
259 | + } |
|
255 | 260 | |
256 | 261 | header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT'); |
257 | 262 | header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($file['filePath'])) . ' GMT'); |
@@ -260,18 +265,19 @@ discard block |
||
260 | 265 | header('ETag: ' . $eTag); |
261 | 266 | |
262 | 267 | // Make sure the mime type warrants an inline display. |
263 | - if (isset($_REQUEST['image']) && !empty($file['mime_type']) && strpos($file['mime_type'], 'image/') !== 0) |
|
264 | - unset($_REQUEST['image']); |
|
268 | + if (isset($_REQUEST['image']) && !empty($file['mime_type']) && strpos($file['mime_type'], 'image/') !== 0) { |
|
269 | + unset($_REQUEST['image']); |
|
270 | + } |
|
265 | 271 | |
266 | 272 | // Does this have a mime type? |
267 | - elseif (!empty($file['mime_type']) && (isset($_REQUEST['image']) || !in_array($file['fileext'], array('jpg', 'gif', 'jpeg', 'x-ms-bmp', 'png', 'psd', 'tiff', 'iff')))) |
|
268 | - header('Content-Type: ' . strtr($file['mime_type'], array('image/bmp' => 'image/x-ms-bmp'))); |
|
269 | - |
|
270 | - else |
|
273 | + elseif (!empty($file['mime_type']) && (isset($_REQUEST['image']) || !in_array($file['fileext'], array('jpg', 'gif', 'jpeg', 'x-ms-bmp', 'png', 'psd', 'tiff', 'iff')))) { |
|
274 | + header('Content-Type: ' . strtr($file['mime_type'], array('image/bmp' => 'image/x-ms-bmp'))); |
|
275 | + } else |
|
271 | 276 | { |
272 | 277 | header('Content-Type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream')); |
273 | - if (isset($_REQUEST['image'])) |
|
274 | - unset($_REQUEST['image']); |
|
278 | + if (isset($_REQUEST['image'])) { |
|
279 | + unset($_REQUEST['image']); |
|
280 | + } |
|
275 | 281 | } |
276 | 282 | |
277 | 283 | // Convert the file to UTF-8, cuz most browsers dig that. |
@@ -279,24 +285,22 @@ discard block |
||
279 | 285 | $disposition = !isset($_REQUEST['image']) ? 'attachment' : 'inline'; |
280 | 286 | |
281 | 287 | // Different browsers like different standards... |
282 | - if (isBrowser('firefox')) |
|
283 | - header('Content-Disposition: ' . $disposition . '; filename*=UTF-8\'\'' . rawurlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name))); |
|
284 | - |
|
285 | - elseif (isBrowser('opera')) |
|
286 | - header('Content-Disposition: ' . $disposition . '; filename="' . preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name) . '"'); |
|
287 | - |
|
288 | - elseif (isBrowser('ie')) |
|
289 | - header('Content-Disposition: ' . $disposition . '; filename="' . urlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)) . '"'); |
|
290 | - |
|
291 | - else |
|
292 | - header('Content-Disposition: ' . $disposition . '; filename="' . $utf8name . '"'); |
|
288 | + if (isBrowser('firefox')) { |
|
289 | + header('Content-Disposition: ' . $disposition . '; filename*=UTF-8\'\'' . rawurlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name))); |
|
290 | + } elseif (isBrowser('opera')) { |
|
291 | + header('Content-Disposition: ' . $disposition . '; filename="' . preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name) . '"'); |
|
292 | + } elseif (isBrowser('ie')) { |
|
293 | + header('Content-Disposition: ' . $disposition . '; filename="' . urlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)) . '"'); |
|
294 | + } else { |
|
295 | + header('Content-Disposition: ' . $disposition . '; filename="' . $utf8name . '"'); |
|
296 | + } |
|
293 | 297 | |
294 | 298 | // If this has an "image extension" - but isn't actually an image - then ensure it isn't cached cause of silly IE. |
295 | - if (!isset($_REQUEST['image']) && in_array($file['fileext'], array('gif', 'jpg', 'bmp', 'png', 'jpeg', 'tiff'))) |
|
296 | - header('Cache-Control: no-cache'); |
|
297 | - |
|
298 | - else |
|
299 | - header('Cache-Control: max-age=' . (525600 * 60) . ', private'); |
|
299 | + if (!isset($_REQUEST['image']) && in_array($file['fileext'], array('gif', 'jpg', 'bmp', 'png', 'jpeg', 'tiff'))) { |
|
300 | + header('Cache-Control: no-cache'); |
|
301 | + } else { |
|
302 | + header('Cache-Control: max-age=' . (525600 * 60) . ', private'); |
|
303 | + } |
|
300 | 304 | |
301 | 305 | // Multipart and resuming support |
302 | 306 | if (isset($_SERVER['HTTP_RANGE'])) |
@@ -304,9 +308,9 @@ discard block |
||
304 | 308 | header("HTTP/1.1 206 Partial Content"); |
305 | 309 | header("Content-Length: $new_length"); |
306 | 310 | header("Content-Range: bytes $range-$range_end/$size"); |
311 | + } else { |
|
312 | + header("Content-Length: " . $size); |
|
307 | 313 | } |
308 | - else |
|
309 | - header("Content-Length: " . $size); |
|
310 | 314 | |
311 | 315 | |
312 | 316 | // Try to buy some time... |
@@ -315,8 +319,9 @@ discard block |
||
315 | 319 | // For multipart/resumable downloads, send the requested chunk(s) of the file |
316 | 320 | if (isset($_SERVER['HTTP_RANGE'])) |
317 | 321 | { |
318 | - while (@ob_get_level() > 0) |
|
319 | - @ob_end_clean(); |
|
322 | + while (@ob_get_level() > 0) { |
|
323 | + @ob_end_clean(); |
|
324 | + } |
|
320 | 325 | |
321 | 326 | // 40 kilobytes is a good-ish amount |
322 | 327 | $chunksize = 40 * 1024; |
@@ -340,8 +345,9 @@ discard block |
||
340 | 345 | elseif ($size > 4194304) |
341 | 346 | { |
342 | 347 | // Forcibly end any output buffering going on. |
343 | - while (@ob_get_level() > 0) |
|
344 | - @ob_end_clean(); |
|
348 | + while (@ob_get_level() > 0) { |
|
349 | + @ob_end_clean(); |
|
350 | + } |
|
345 | 351 | |
346 | 352 | $fp = fopen($file['filePath'], 'rb'); |
347 | 353 | while (!feof($fp)) |
@@ -353,8 +359,9 @@ discard block |
||
353 | 359 | } |
354 | 360 | |
355 | 361 | // On some of the less-bright hosts, readfile() is disabled. It's just a faster, more byte safe, version of what's in the if. |
356 | - elseif (@readfile($file['filePath']) === null) |
|
357 | - echo file_get_contents($file['filePath']); |
|
362 | + elseif (@readfile($file['filePath']) === null) { |
|
363 | + echo file_get_contents($file['filePath']); |
|
364 | + } |
|
358 | 365 | |
359 | 366 | die(); |
360 | 367 | } |