@@ -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 | * Main dispatcher, the maintenance access point. |
@@ -95,14 +96,16 @@ discard block |
||
95 | 96 | call_integration_hook('integrate_manage_maintenance', array(&$subActions)); |
96 | 97 | |
97 | 98 | // Yep, sub-action time! |
98 | - if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) |
|
99 | - $subAction = $_REQUEST['sa']; |
|
100 | - else |
|
101 | - $subAction = 'routine'; |
|
99 | + if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) { |
|
100 | + $subAction = $_REQUEST['sa']; |
|
101 | + } else { |
|
102 | + $subAction = 'routine'; |
|
103 | + } |
|
102 | 104 | |
103 | 105 | // Doing something special? |
104 | - if (isset($_REQUEST['activity']) && isset($subActions[$subAction]['activities'][$_REQUEST['activity']])) |
|
105 | - $activity = $_REQUEST['activity']; |
|
106 | + if (isset($_REQUEST['activity']) && isset($subActions[$subAction]['activities'][$_REQUEST['activity']])) { |
|
107 | + $activity = $_REQUEST['activity']; |
|
108 | + } |
|
106 | 109 | |
107 | 110 | // Set a few things. |
108 | 111 | $context['page_title'] = $txt['maintain_title']; |
@@ -113,8 +116,9 @@ discard block |
||
113 | 116 | call_helper($subActions[$subAction]['function']); |
114 | 117 | |
115 | 118 | // Any special activity? |
116 | - if (isset($activity)) |
|
117 | - call_helper($subActions[$subAction]['activities'][$activity]); |
|
119 | + if (isset($activity)) { |
|
120 | + call_helper($subActions[$subAction]['activities'][$activity]); |
|
121 | + } |
|
118 | 122 | |
119 | 123 | // Create a maintenance token. Kinda hard to do it any other way. |
120 | 124 | createToken('admin-maint'); |
@@ -135,17 +139,19 @@ discard block |
||
135 | 139 | db_extend('packages'); |
136 | 140 | |
137 | 141 | $colData = $smcFunc['db_list_columns']('{db_prefix}messages', true); |
138 | - foreach ($colData as $column) |
|
139 | - if ($column['name'] == 'body') |
|
142 | + foreach ($colData as $column) { |
|
143 | + if ($column['name'] == 'body') |
|
140 | 144 | $body_type = $column['type']; |
145 | + } |
|
141 | 146 | |
142 | 147 | $context['convert_to'] = $body_type == 'text' ? 'mediumtext' : 'text'; |
143 | 148 | $context['convert_to_suggest'] = ($body_type != 'text' && !empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] < 65536); |
144 | 149 | } |
145 | 150 | |
146 | - if (isset($_GET['done']) && $_GET['done'] == 'convertentities') |
|
147 | - $context['maintenance_finished'] = $txt['entity_convert_title']; |
|
148 | -} |
|
151 | + if (isset($_GET['done']) && $_GET['done'] == 'convertentities') { |
|
152 | + $context['maintenance_finished'] = $txt['entity_convert_title']; |
|
153 | + } |
|
154 | + } |
|
149 | 155 | |
150 | 156 | /** |
151 | 157 | * Supporting function for the routine maintenance area. |
@@ -154,9 +160,10 @@ discard block |
||
154 | 160 | { |
155 | 161 | global $context, $txt; |
156 | 162 | |
157 | - if (isset($_GET['done']) && $_GET['done'] == 'recount') |
|
158 | - $context['maintenance_finished'] = $txt['maintain_recount']; |
|
159 | -} |
|
163 | + if (isset($_GET['done']) && $_GET['done'] == 'recount') { |
|
164 | + $context['maintenance_finished'] = $txt['maintain_recount']; |
|
165 | + } |
|
166 | + } |
|
160 | 167 | |
161 | 168 | /** |
162 | 169 | * Supporting function for the members maintenance area. |
@@ -187,8 +194,9 @@ discard block |
||
187 | 194 | } |
188 | 195 | $smcFunc['db_free_result']($result); |
189 | 196 | |
190 | - if (isset($_GET['done']) && $_GET['done'] == 'recountposts') |
|
191 | - $context['maintenance_finished'] = $txt['maintain_recountposts']; |
|
197 | + if (isset($_GET['done']) && $_GET['done'] == 'recountposts') { |
|
198 | + $context['maintenance_finished'] = $txt['maintain_recountposts']; |
|
199 | + } |
|
192 | 200 | |
193 | 201 | loadJavaScriptFile('suggest.js', array('defer' => false, 'minimize' => true), 'smf_suggest'); |
194 | 202 | } |
@@ -214,11 +222,12 @@ discard block |
||
214 | 222 | $context['categories'] = array(); |
215 | 223 | while ($row = $smcFunc['db_fetch_assoc']($result)) |
216 | 224 | { |
217 | - if (!isset($context['categories'][$row['id_cat']])) |
|
218 | - $context['categories'][$row['id_cat']] = array( |
|
225 | + if (!isset($context['categories'][$row['id_cat']])) { |
|
226 | + $context['categories'][$row['id_cat']] = array( |
|
219 | 227 | 'name' => $row['cat_name'], |
220 | 228 | 'boards' => array() |
221 | 229 | ); |
230 | + } |
|
222 | 231 | |
223 | 232 | $context['categories'][$row['id_cat']]['boards'][$row['id_board']] = array( |
224 | 233 | 'id' => $row['id_board'], |
@@ -231,11 +240,12 @@ discard block |
||
231 | 240 | require_once($sourcedir . '/Subs-Boards.php'); |
232 | 241 | sortCategories($context['categories']); |
233 | 242 | |
234 | - if (isset($_GET['done']) && $_GET['done'] == 'purgeold') |
|
235 | - $context['maintenance_finished'] = $txt['maintain_old']; |
|
236 | - elseif (isset($_GET['done']) && $_GET['done'] == 'massmove') |
|
237 | - $context['maintenance_finished'] = $txt['move_topics_maintenance']; |
|
238 | -} |
|
243 | + if (isset($_GET['done']) && $_GET['done'] == 'purgeold') { |
|
244 | + $context['maintenance_finished'] = $txt['maintain_old']; |
|
245 | + } elseif (isset($_GET['done']) && $_GET['done'] == 'massmove') { |
|
246 | + $context['maintenance_finished'] = $txt['move_topics_maintenance']; |
|
247 | + } |
|
248 | + } |
|
239 | 249 | |
240 | 250 | /** |
241 | 251 | * Find and fix all errors on the forum. |
@@ -343,15 +353,17 @@ discard block |
||
343 | 353 | // Show me your badge! |
344 | 354 | isAllowedTo('admin_forum'); |
345 | 355 | |
346 | - if ($db_type != 'mysql') |
|
347 | - return; |
|
356 | + if ($db_type != 'mysql') { |
|
357 | + return; |
|
358 | + } |
|
348 | 359 | |
349 | 360 | db_extend('packages'); |
350 | 361 | |
351 | 362 | $colData = $smcFunc['db_list_columns']('{db_prefix}messages', true); |
352 | - foreach ($colData as $column) |
|
353 | - if ($column['name'] == 'body') |
|
363 | + foreach ($colData as $column) { |
|
364 | + if ($column['name'] == 'body') |
|
354 | 365 | $body_type = $column['type']; |
366 | + } |
|
355 | 367 | |
356 | 368 | $context['convert_to'] = $body_type == 'text' ? 'mediumtext' : 'text'; |
357 | 369 | |
@@ -361,33 +373,36 @@ discard block |
||
361 | 373 | validateToken('admin-maint'); |
362 | 374 | |
363 | 375 | // Make it longer so we can do their limit. |
364 | - if ($body_type == 'text') |
|
365 | - $smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'mediumtext')); |
|
376 | + if ($body_type == 'text') { |
|
377 | + $smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'mediumtext')); |
|
378 | + } |
|
366 | 379 | // Shorten the column so we can have a bit (literally per record) less space occupied |
367 | - else |
|
368 | - $smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'text')); |
|
380 | + else { |
|
381 | + $smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'text')); |
|
382 | + } |
|
369 | 383 | |
370 | 384 | // 3rd party integrations may be interested in knowning about this. |
371 | 385 | call_integration_hook('integrate_convert_msgbody', array($body_type)); |
372 | 386 | |
373 | 387 | $colData = $smcFunc['db_list_columns']('{db_prefix}messages', true); |
374 | - foreach ($colData as $column) |
|
375 | - if ($column['name'] == 'body') |
|
388 | + foreach ($colData as $column) { |
|
389 | + if ($column['name'] == 'body') |
|
376 | 390 | $body_type = $column['type']; |
391 | + } |
|
377 | 392 | |
378 | 393 | $context['maintenance_finished'] = $txt[$context['convert_to'] . '_title']; |
379 | 394 | $context['convert_to'] = $body_type == 'text' ? 'mediumtext' : 'text'; |
380 | 395 | $context['convert_to_suggest'] = ($body_type != 'text' && !empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] < 65536); |
381 | 396 | |
382 | 397 | return; |
383 | - } |
|
384 | - elseif ($body_type != 'text' && (!isset($_POST['do_conversion']) || isset($_POST['cont']))) |
|
398 | + } elseif ($body_type != 'text' && (!isset($_POST['do_conversion']) || isset($_POST['cont']))) |
|
385 | 399 | { |
386 | 400 | checkSession(); |
387 | - if (empty($_REQUEST['start'])) |
|
388 | - validateToken('admin-maint'); |
|
389 | - else |
|
390 | - validateToken('admin-convertMsg'); |
|
401 | + if (empty($_REQUEST['start'])) { |
|
402 | + validateToken('admin-maint'); |
|
403 | + } else { |
|
404 | + validateToken('admin-convertMsg'); |
|
405 | + } |
|
391 | 406 | |
392 | 407 | $context['page_title'] = $txt['not_done_title']; |
393 | 408 | $context['continue_post_data'] = ''; |
@@ -419,8 +434,9 @@ discard block |
||
419 | 434 | 'increment' => $increment - 1, |
420 | 435 | ) |
421 | 436 | ); |
422 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
423 | - $id_msg_exceeding[] = $row['id_msg']; |
|
437 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
438 | + $id_msg_exceeding[] = $row['id_msg']; |
|
439 | + } |
|
424 | 440 | $smcFunc['db_free_result']($request); |
425 | 441 | |
426 | 442 | $_REQUEST['start'] += $increment; |
@@ -449,9 +465,9 @@ discard block |
||
449 | 465 | { |
450 | 466 | $query_msg = array_slice($id_msg_exceeding, 0, 100); |
451 | 467 | $context['exceeding_messages_morethan'] = sprintf($txt['exceeding_messages_morethan'], count($id_msg_exceeding)); |
468 | + } else { |
|
469 | + $query_msg = $id_msg_exceeding; |
|
452 | 470 | } |
453 | - else |
|
454 | - $query_msg = $id_msg_exceeding; |
|
455 | 471 | |
456 | 472 | $context['exceeding_messages'] = array(); |
457 | 473 | $request = $smcFunc['db_query']('', ' |
@@ -462,8 +478,9 @@ discard block |
||
462 | 478 | 'messages' => $query_msg, |
463 | 479 | ) |
464 | 480 | ); |
465 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
466 | - $context['exceeding_messages'][] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '">' . $row['subject'] . '</a>'; |
|
481 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
482 | + $context['exceeding_messages'][] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '">' . $row['subject'] . '</a>'; |
|
483 | + } |
|
467 | 484 | $smcFunc['db_free_result']($request); |
468 | 485 | } |
469 | 486 | } |
@@ -487,8 +504,9 @@ discard block |
||
487 | 504 | isAllowedTo('admin_forum'); |
488 | 505 | |
489 | 506 | // Check to see if UTF-8 is currently the default character set. |
490 | - if ($modSettings['global_character_set'] !== 'UTF-8') |
|
491 | - fatal_lang_error('entity_convert_only_utf8'); |
|
507 | + if ($modSettings['global_character_set'] !== 'UTF-8') { |
|
508 | + fatal_lang_error('entity_convert_only_utf8'); |
|
509 | + } |
|
492 | 510 | |
493 | 511 | // Some starting values. |
494 | 512 | $context['table'] = empty($_REQUEST['table']) ? 0 : (int) $_REQUEST['table']; |
@@ -550,13 +568,14 @@ discard block |
||
550 | 568 | // Make sure we keep stuff unique! |
551 | 569 | $primary_keys = array(); |
552 | 570 | |
553 | - if (function_exists('apache_reset_timeout')) |
|
554 | - @apache_reset_timeout(); |
|
571 | + if (function_exists('apache_reset_timeout')) { |
|
572 | + @apache_reset_timeout(); |
|
573 | + } |
|
555 | 574 | |
556 | 575 | // Get a list of text columns. |
557 | 576 | $columns = array(); |
558 | - if ($db_type == 'postgresql') |
|
559 | - $request = $smcFunc['db_query']('', ' |
|
577 | + if ($db_type == 'postgresql') { |
|
578 | + $request = $smcFunc['db_query']('', ' |
|
560 | 579 | SELECT column_name "Field", data_type "Type" |
561 | 580 | FROM information_schema.columns |
562 | 581 | WHERE table_name = {string:cur_table} |
@@ -565,21 +584,23 @@ discard block |
||
565 | 584 | 'cur_table' => $db_prefix.$cur_table, |
566 | 585 | ) |
567 | 586 | ); |
568 | - else |
|
569 | - $request = $smcFunc['db_query']('', ' |
|
587 | + } else { |
|
588 | + $request = $smcFunc['db_query']('', ' |
|
570 | 589 | SHOW FULL COLUMNS |
571 | 590 | FROM {db_prefix}{raw:cur_table}', |
572 | 591 | array( |
573 | 592 | 'cur_table' => $cur_table, |
574 | 593 | ) |
575 | 594 | ); |
576 | - while ($column_info = $smcFunc['db_fetch_assoc']($request)) |
|
577 | - if (strpos($column_info['Type'], 'text') !== false || strpos($column_info['Type'], 'char') !== false) |
|
595 | + } |
|
596 | + while ($column_info = $smcFunc['db_fetch_assoc']($request)) { |
|
597 | + if (strpos($column_info['Type'], 'text') !== false || strpos($column_info['Type'], 'char') !== false) |
|
578 | 598 | $columns[] = strtolower($column_info['Field']); |
599 | + } |
|
579 | 600 | |
580 | 601 | // Get the column with the (first) primary key. |
581 | - if ($db_type == 'postgresql') |
|
582 | - $request = $smcFunc['db_query']('', ' |
|
602 | + if ($db_type == 'postgresql') { |
|
603 | + $request = $smcFunc['db_query']('', ' |
|
583 | 604 | SELECT a.attname "Column_name", \'PRIMARY\' "Key_name", attnum "Seq_in_index" |
584 | 605 | FROM pg_index i |
585 | 606 | JOIN pg_attribute a ON a.attrelid = i.indrelid |
@@ -590,20 +611,22 @@ discard block |
||
590 | 611 | 'cur_table' => $db_prefix.$cur_table, |
591 | 612 | ) |
592 | 613 | ); |
593 | - else |
|
594 | - $request = $smcFunc['db_query']('', ' |
|
614 | + } else { |
|
615 | + $request = $smcFunc['db_query']('', ' |
|
595 | 616 | SHOW KEYS |
596 | 617 | FROM {db_prefix}{raw:cur_table}', |
597 | 618 | array( |
598 | 619 | 'cur_table' => $cur_table, |
599 | 620 | ) |
600 | 621 | ); |
622 | + } |
|
601 | 623 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
602 | 624 | { |
603 | 625 | if ($row['Key_name'] === 'PRIMARY') |
604 | 626 | { |
605 | - if ((empty($primary_key) || $row['Seq_in_index'] == 1) && !in_array(strtolower($row['Column_name']), $columns)) |
|
606 | - $primary_key = $row['Column_name']; |
|
627 | + if ((empty($primary_key) || $row['Seq_in_index'] == 1) && !in_array(strtolower($row['Column_name']), $columns)) { |
|
628 | + $primary_key = $row['Column_name']; |
|
629 | + } |
|
607 | 630 | |
608 | 631 | $primary_keys[] = $row['Column_name']; |
609 | 632 | } |
@@ -612,8 +635,9 @@ discard block |
||
612 | 635 | |
613 | 636 | // No primary key, no glory. |
614 | 637 | // Same for columns. Just to be sure we've work to do! |
615 | - if (empty($primary_key) || empty($columns)) |
|
616 | - continue; |
|
638 | + if (empty($primary_key) || empty($columns)) { |
|
639 | + continue; |
|
640 | + } |
|
617 | 641 | |
618 | 642 | // Get the maximum value for the primary key. |
619 | 643 | $request = $smcFunc['db_query']('', ' |
@@ -627,8 +651,9 @@ discard block |
||
627 | 651 | list($max_value) = $smcFunc['db_fetch_row']($request); |
628 | 652 | $smcFunc['db_free_result']($request); |
629 | 653 | |
630 | - if (empty($max_value)) |
|
631 | - continue; |
|
654 | + if (empty($max_value)) { |
|
655 | + continue; |
|
656 | + } |
|
632 | 657 | |
633 | 658 | while ($context['start'] <= $max_value) |
634 | 659 | { |
@@ -652,10 +677,11 @@ discard block |
||
652 | 677 | { |
653 | 678 | $insertion_variables = array(); |
654 | 679 | $changes = array(); |
655 | - foreach ($row as $column_name => $column_value) |
|
656 | - if ($column_name !== $primary_key && strpos($column_value, '&#') !== false) |
|
680 | + foreach ($row as $column_name => $column_value) { |
|
681 | + if ($column_name !== $primary_key && strpos($column_value, '&#') !== false) |
|
657 | 682 | { |
658 | 683 | $changes[] = $column_name . ' = {string:changes_' . $column_name . '}'; |
684 | + } |
|
659 | 685 | $insertion_variables['changes_' . $column_name] = preg_replace_callback('~&#(\d{1,5}|x[0-9a-fA-F]{1,4});~', 'fixchardb__callback', $column_value); |
660 | 686 | } |
661 | 687 | |
@@ -667,8 +693,8 @@ discard block |
||
667 | 693 | } |
668 | 694 | |
669 | 695 | // Update the row. |
670 | - if (!empty($changes)) |
|
671 | - $smcFunc['db_query']('', ' |
|
696 | + if (!empty($changes)) { |
|
697 | + $smcFunc['db_query']('', ' |
|
672 | 698 | UPDATE {db_prefix}' . $cur_table . ' |
673 | 699 | SET |
674 | 700 | ' . implode(', |
@@ -676,6 +702,7 @@ discard block |
||
676 | 702 | WHERE ' . implode(' AND ', $where), |
677 | 703 | $insertion_variables |
678 | 704 | ); |
705 | + } |
|
679 | 706 | } |
680 | 707 | $smcFunc['db_free_result']($request); |
681 | 708 | $context['start'] += 500; |
@@ -716,10 +743,11 @@ discard block |
||
716 | 743 | |
717 | 744 | checkSession('request'); |
718 | 745 | |
719 | - if (!isset($_SESSION['optimized_tables'])) |
|
720 | - validateToken('admin-maint'); |
|
721 | - else |
|
722 | - validateToken('admin-optimize', 'post', false); |
|
746 | + if (!isset($_SESSION['optimized_tables'])) { |
|
747 | + validateToken('admin-maint'); |
|
748 | + } else { |
|
749 | + validateToken('admin-optimize', 'post', false); |
|
750 | + } |
|
723 | 751 | |
724 | 752 | ignore_user_abort(true); |
725 | 753 | db_extend(); |
@@ -735,13 +763,15 @@ discard block |
||
735 | 763 | // Get a list of tables, as well as how many there are. |
736 | 764 | $temp_tables = $smcFunc['db_list_tables'](false, $real_prefix . '%'); |
737 | 765 | $tables = array(); |
738 | - foreach ($temp_tables as $table) |
|
739 | - $tables[] = array('table_name' => $table); |
|
766 | + foreach ($temp_tables as $table) { |
|
767 | + $tables[] = array('table_name' => $table); |
|
768 | + } |
|
740 | 769 | |
741 | 770 | // If there aren't any tables then I believe that would mean the world has exploded... |
742 | 771 | $context['num_tables'] = count($tables); |
743 | - if ($context['num_tables'] == 0) |
|
744 | - fatal_error('You appear to be running SMF in a flat file mode... fantastic!', false); |
|
772 | + if ($context['num_tables'] == 0) { |
|
773 | + fatal_error('You appear to be running SMF in a flat file mode... fantastic!', false); |
|
774 | + } |
|
745 | 775 | |
746 | 776 | $_REQUEST['start'] = empty($_REQUEST['start']) ? 0 : (int) $_REQUEST['start']; |
747 | 777 | |
@@ -752,8 +782,9 @@ discard block |
||
752 | 782 | $_SESSION['optimized_tables'] = !empty($_SESSION['optimized_tables']) ? $_SESSION['optimized_tables'] : array(); |
753 | 783 | for ($key = $_REQUEST['start']; $context['num_tables'] - 1; $key++) |
754 | 784 | { |
755 | - if (empty($tables[$key])) |
|
756 | - break; |
|
785 | + if (empty($tables[$key])) { |
|
786 | + break; |
|
787 | + } |
|
757 | 788 | |
758 | 789 | // Continue? |
759 | 790 | if (microtime(true) - $time_start > 10) |
@@ -767,8 +798,9 @@ discard block |
||
767 | 798 | createToken('admin-optimize'); |
768 | 799 | $context['continue_post_data'] = '<input type="hidden" name="' . $context['admin-optimize_token_var'] . '" value="' . $context['admin-optimize_token'] . '">'; |
769 | 800 | |
770 | - if (function_exists('apache_reset_timeout')) |
|
771 | - apache_reset_timeout(); |
|
801 | + if (function_exists('apache_reset_timeout')) { |
|
802 | + apache_reset_timeout(); |
|
803 | + } |
|
772 | 804 | |
773 | 805 | return; |
774 | 806 | } |
@@ -776,11 +808,12 @@ discard block |
||
776 | 808 | // Optimize the table! We use backticks here because it might be a custom table. |
777 | 809 | $data_freed = $smcFunc['db_optimize_table']($tables[$key]['table_name']); |
778 | 810 | |
779 | - if ($data_freed > 0) |
|
780 | - $_SESSION['optimized_tables'][] = array( |
|
811 | + if ($data_freed > 0) { |
|
812 | + $_SESSION['optimized_tables'][] = array( |
|
781 | 813 | 'name' => $tables[$key]['table_name'], |
782 | 814 | 'data_freed' => $data_freed, |
783 | 815 | ); |
816 | + } |
|
784 | 817 | } |
785 | 818 | |
786 | 819 | // Number of tables, etc... |
@@ -815,10 +848,11 @@ discard block |
||
815 | 848 | checkSession('request'); |
816 | 849 | |
817 | 850 | // validate the request or the loop |
818 | - if (!isset($_REQUEST['step'])) |
|
819 | - validateToken('admin-maint'); |
|
820 | - else |
|
821 | - validateToken('admin-boardrecount'); |
|
851 | + if (!isset($_REQUEST['step'])) { |
|
852 | + validateToken('admin-maint'); |
|
853 | + } else { |
|
854 | + validateToken('admin-boardrecount'); |
|
855 | + } |
|
822 | 856 | |
823 | 857 | $context['page_title'] = $txt['not_done_title']; |
824 | 858 | $context['continue_post_data'] = ''; |
@@ -839,8 +873,9 @@ discard block |
||
839 | 873 | $smcFunc['db_free_result']($request); |
840 | 874 | |
841 | 875 | $increment = min(max(50, ceil($max_topics / 4)), 2000); |
842 | - if (empty($_REQUEST['start'])) |
|
843 | - $_REQUEST['start'] = 0; |
|
876 | + if (empty($_REQUEST['start'])) { |
|
877 | + $_REQUEST['start'] = 0; |
|
878 | + } |
|
844 | 879 | |
845 | 880 | $total_steps = 8; |
846 | 881 | |
@@ -867,8 +902,8 @@ discard block |
||
867 | 902 | 'max_id' => $_REQUEST['start'] + $increment, |
868 | 903 | ) |
869 | 904 | ); |
870 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
871 | - $smcFunc['db_query']('', ' |
|
905 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
906 | + $smcFunc['db_query']('', ' |
|
872 | 907 | UPDATE {db_prefix}topics |
873 | 908 | SET num_replies = {int:num_replies} |
874 | 909 | WHERE id_topic = {int:id_topic}', |
@@ -877,6 +912,7 @@ discard block |
||
877 | 912 | 'id_topic' => $row['id_topic'], |
878 | 913 | ) |
879 | 914 | ); |
915 | + } |
|
880 | 916 | $smcFunc['db_free_result']($request); |
881 | 917 | |
882 | 918 | // Recount unapproved messages |
@@ -895,8 +931,8 @@ discard block |
||
895 | 931 | 'max_id' => $_REQUEST['start'] + $increment, |
896 | 932 | ) |
897 | 933 | ); |
898 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
899 | - $smcFunc['db_query']('', ' |
|
934 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
935 | + $smcFunc['db_query']('', ' |
|
900 | 936 | UPDATE {db_prefix}topics |
901 | 937 | SET unapproved_posts = {int:unapproved_posts} |
902 | 938 | WHERE id_topic = {int:id_topic}', |
@@ -905,6 +941,7 @@ discard block |
||
905 | 941 | 'id_topic' => $row['id_topic'], |
906 | 942 | ) |
907 | 943 | ); |
944 | + } |
|
908 | 945 | $smcFunc['db_free_result']($request); |
909 | 946 | |
910 | 947 | $_REQUEST['start'] += $increment; |
@@ -927,8 +964,8 @@ discard block |
||
927 | 964 | // Update the post count of each board. |
928 | 965 | if ($_REQUEST['step'] <= 1) |
929 | 966 | { |
930 | - if (empty($_REQUEST['start'])) |
|
931 | - $smcFunc['db_query']('', ' |
|
967 | + if (empty($_REQUEST['start'])) { |
|
968 | + $smcFunc['db_query']('', ' |
|
932 | 969 | UPDATE {db_prefix}boards |
933 | 970 | SET num_posts = {int:num_posts} |
934 | 971 | WHERE redirect = {string:redirect}', |
@@ -937,6 +974,7 @@ discard block |
||
937 | 974 | 'redirect' => '', |
938 | 975 | ) |
939 | 976 | ); |
977 | + } |
|
940 | 978 | |
941 | 979 | while ($_REQUEST['start'] < $max_topics) |
942 | 980 | { |
@@ -953,8 +991,8 @@ discard block |
||
953 | 991 | 'is_approved' => 1, |
954 | 992 | ) |
955 | 993 | ); |
956 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
957 | - $smcFunc['db_query']('', ' |
|
994 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
995 | + $smcFunc['db_query']('', ' |
|
958 | 996 | UPDATE {db_prefix}boards |
959 | 997 | SET num_posts = num_posts + {int:real_num_posts} |
960 | 998 | WHERE id_board = {int:id_board}', |
@@ -963,6 +1001,7 @@ discard block |
||
963 | 1001 | 'real_num_posts' => $row['real_num_posts'], |
964 | 1002 | ) |
965 | 1003 | ); |
1004 | + } |
|
966 | 1005 | $smcFunc['db_free_result']($request); |
967 | 1006 | |
968 | 1007 | $_REQUEST['start'] += $increment; |
@@ -985,14 +1024,15 @@ discard block |
||
985 | 1024 | // Update the topic count of each board. |
986 | 1025 | if ($_REQUEST['step'] <= 2) |
987 | 1026 | { |
988 | - if (empty($_REQUEST['start'])) |
|
989 | - $smcFunc['db_query']('', ' |
|
1027 | + if (empty($_REQUEST['start'])) { |
|
1028 | + $smcFunc['db_query']('', ' |
|
990 | 1029 | UPDATE {db_prefix}boards |
991 | 1030 | SET num_topics = {int:num_topics}', |
992 | 1031 | array( |
993 | 1032 | 'num_topics' => 0, |
994 | 1033 | ) |
995 | 1034 | ); |
1035 | + } |
|
996 | 1036 | |
997 | 1037 | while ($_REQUEST['start'] < $max_topics) |
998 | 1038 | { |
@@ -1009,8 +1049,8 @@ discard block |
||
1009 | 1049 | 'id_topic_max' => $_REQUEST['start'] + $increment, |
1010 | 1050 | ) |
1011 | 1051 | ); |
1012 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1013 | - $smcFunc['db_query']('', ' |
|
1052 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
1053 | + $smcFunc['db_query']('', ' |
|
1014 | 1054 | UPDATE {db_prefix}boards |
1015 | 1055 | SET num_topics = num_topics + {int:real_num_topics} |
1016 | 1056 | WHERE id_board = {int:id_board}', |
@@ -1019,6 +1059,7 @@ discard block |
||
1019 | 1059 | 'real_num_topics' => $row['real_num_topics'], |
1020 | 1060 | ) |
1021 | 1061 | ); |
1062 | + } |
|
1022 | 1063 | $smcFunc['db_free_result']($request); |
1023 | 1064 | |
1024 | 1065 | $_REQUEST['start'] += $increment; |
@@ -1041,14 +1082,15 @@ discard block |
||
1041 | 1082 | // Update the unapproved post count of each board. |
1042 | 1083 | if ($_REQUEST['step'] <= 3) |
1043 | 1084 | { |
1044 | - if (empty($_REQUEST['start'])) |
|
1045 | - $smcFunc['db_query']('', ' |
|
1085 | + if (empty($_REQUEST['start'])) { |
|
1086 | + $smcFunc['db_query']('', ' |
|
1046 | 1087 | UPDATE {db_prefix}boards |
1047 | 1088 | SET unapproved_posts = {int:unapproved_posts}', |
1048 | 1089 | array( |
1049 | 1090 | 'unapproved_posts' => 0, |
1050 | 1091 | ) |
1051 | 1092 | ); |
1093 | + } |
|
1052 | 1094 | |
1053 | 1095 | while ($_REQUEST['start'] < $max_topics) |
1054 | 1096 | { |
@@ -1065,8 +1107,8 @@ discard block |
||
1065 | 1107 | 'is_approved' => 0, |
1066 | 1108 | ) |
1067 | 1109 | ); |
1068 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1069 | - $smcFunc['db_query']('', ' |
|
1110 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
1111 | + $smcFunc['db_query']('', ' |
|
1070 | 1112 | UPDATE {db_prefix}boards |
1071 | 1113 | SET unapproved_posts = unapproved_posts + {int:unapproved_posts} |
1072 | 1114 | WHERE id_board = {int:id_board}', |
@@ -1075,6 +1117,7 @@ discard block |
||
1075 | 1117 | 'unapproved_posts' => $row['real_unapproved_posts'], |
1076 | 1118 | ) |
1077 | 1119 | ); |
1120 | + } |
|
1078 | 1121 | $smcFunc['db_free_result']($request); |
1079 | 1122 | |
1080 | 1123 | $_REQUEST['start'] += $increment; |
@@ -1097,14 +1140,15 @@ discard block |
||
1097 | 1140 | // Update the unapproved topic count of each board. |
1098 | 1141 | if ($_REQUEST['step'] <= 4) |
1099 | 1142 | { |
1100 | - if (empty($_REQUEST['start'])) |
|
1101 | - $smcFunc['db_query']('', ' |
|
1143 | + if (empty($_REQUEST['start'])) { |
|
1144 | + $smcFunc['db_query']('', ' |
|
1102 | 1145 | UPDATE {db_prefix}boards |
1103 | 1146 | SET unapproved_topics = {int:unapproved_topics}', |
1104 | 1147 | array( |
1105 | 1148 | 'unapproved_topics' => 0, |
1106 | 1149 | ) |
1107 | 1150 | ); |
1151 | + } |
|
1108 | 1152 | |
1109 | 1153 | while ($_REQUEST['start'] < $max_topics) |
1110 | 1154 | { |
@@ -1121,8 +1165,8 @@ discard block |
||
1121 | 1165 | 'id_topic_max' => $_REQUEST['start'] + $increment, |
1122 | 1166 | ) |
1123 | 1167 | ); |
1124 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1125 | - $smcFunc['db_query']('', ' |
|
1168 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
1169 | + $smcFunc['db_query']('', ' |
|
1126 | 1170 | UPDATE {db_prefix}boards |
1127 | 1171 | SET unapproved_topics = unapproved_topics + {int:real_unapproved_topics} |
1128 | 1172 | WHERE id_board = {int:id_board}', |
@@ -1131,6 +1175,7 @@ discard block |
||
1131 | 1175 | 'real_unapproved_topics' => $row['real_unapproved_topics'], |
1132 | 1176 | ) |
1133 | 1177 | ); |
1178 | + } |
|
1134 | 1179 | $smcFunc['db_free_result']($request); |
1135 | 1180 | |
1136 | 1181 | $_REQUEST['start'] += $increment; |
@@ -1164,8 +1209,9 @@ discard block |
||
1164 | 1209 | 'is_not_deleted' => 0, |
1165 | 1210 | ) |
1166 | 1211 | ); |
1167 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1168 | - updateMemberData($row['id_member'], array('instant_messages' => $row['real_num'])); |
|
1212 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
1213 | + updateMemberData($row['id_member'], array('instant_messages' => $row['real_num'])); |
|
1214 | + } |
|
1169 | 1215 | $smcFunc['db_free_result']($request); |
1170 | 1216 | |
1171 | 1217 | $request = $smcFunc['db_query']('', ' |
@@ -1180,8 +1226,9 @@ discard block |
||
1180 | 1226 | 'is_not_read' => 0, |
1181 | 1227 | ) |
1182 | 1228 | ); |
1183 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1184 | - updateMemberData($row['id_member'], array('unread_messages' => $row['real_num'])); |
|
1229 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
1230 | + updateMemberData($row['id_member'], array('unread_messages' => $row['real_num'])); |
|
1231 | + } |
|
1185 | 1232 | $smcFunc['db_free_result']($request); |
1186 | 1233 | |
1187 | 1234 | if (microtime(true) - $time_start > 3) |
@@ -1213,12 +1260,13 @@ discard block |
||
1213 | 1260 | ) |
1214 | 1261 | ); |
1215 | 1262 | $boards = array(); |
1216 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1217 | - $boards[$row['id_board']][] = $row['id_msg']; |
|
1263 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
1264 | + $boards[$row['id_board']][] = $row['id_msg']; |
|
1265 | + } |
|
1218 | 1266 | $smcFunc['db_free_result']($request); |
1219 | 1267 | |
1220 | - foreach ($boards as $board_id => $messages) |
|
1221 | - $smcFunc['db_query']('', ' |
|
1268 | + foreach ($boards as $board_id => $messages) { |
|
1269 | + $smcFunc['db_query']('', ' |
|
1222 | 1270 | UPDATE {db_prefix}messages |
1223 | 1271 | SET id_board = {int:id_board} |
1224 | 1272 | WHERE id_msg IN ({array_int:id_msg_array})', |
@@ -1227,6 +1275,7 @@ discard block |
||
1227 | 1275 | 'id_board' => $board_id, |
1228 | 1276 | ) |
1229 | 1277 | ); |
1278 | + } |
|
1230 | 1279 | |
1231 | 1280 | $_REQUEST['start'] += $increment; |
1232 | 1281 | |
@@ -1256,8 +1305,9 @@ discard block |
||
1256 | 1305 | ) |
1257 | 1306 | ); |
1258 | 1307 | $realBoardCounts = array(); |
1259 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1260 | - $realBoardCounts[$row['id_board']] = $row['local_last_msg']; |
|
1308 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
1309 | + $realBoardCounts[$row['id_board']] = $row['local_last_msg']; |
|
1310 | + } |
|
1261 | 1311 | $smcFunc['db_free_result']($request); |
1262 | 1312 | |
1263 | 1313 | $request = $smcFunc['db_query']('', ' |
@@ -1277,18 +1327,20 @@ discard block |
||
1277 | 1327 | krsort($resort_me); |
1278 | 1328 | |
1279 | 1329 | $lastModifiedMsg = array(); |
1280 | - foreach ($resort_me as $rows) |
|
1281 | - foreach ($rows as $row) |
|
1330 | + foreach ($resort_me as $rows) { |
|
1331 | + foreach ($rows as $row) |
|
1282 | 1332 | { |
1283 | 1333 | // The latest message is the latest of the current board and its children. |
1284 | 1334 | if (isset($lastModifiedMsg[$row['id_board']])) |
1285 | 1335 | $curLastModifiedMsg = max($row['local_last_msg'], $lastModifiedMsg[$row['id_board']]); |
1286 | - else |
|
1287 | - $curLastModifiedMsg = $row['local_last_msg']; |
|
1336 | + } |
|
1337 | + else { |
|
1338 | + $curLastModifiedMsg = $row['local_last_msg']; |
|
1339 | + } |
|
1288 | 1340 | |
1289 | 1341 | // If what is and what should be the latest message differ, an update is necessary. |
1290 | - if ($row['local_last_msg'] != $row['id_last_msg'] || $curLastModifiedMsg != $row['id_msg_updated']) |
|
1291 | - $smcFunc['db_query']('', ' |
|
1342 | + if ($row['local_last_msg'] != $row['id_last_msg'] || $curLastModifiedMsg != $row['id_msg_updated']) { |
|
1343 | + $smcFunc['db_query']('', ' |
|
1292 | 1344 | UPDATE {db_prefix}boards |
1293 | 1345 | SET id_last_msg = {int:id_last_msg}, id_msg_updated = {int:id_msg_updated} |
1294 | 1346 | WHERE id_board = {int:id_board}', |
@@ -1298,12 +1350,14 @@ discard block |
||
1298 | 1350 | 'id_board' => $row['id_board'], |
1299 | 1351 | ) |
1300 | 1352 | ); |
1353 | + } |
|
1301 | 1354 | |
1302 | 1355 | // Parent boards inherit the latest modified message of their children. |
1303 | - if (isset($lastModifiedMsg[$row['id_parent']])) |
|
1304 | - $lastModifiedMsg[$row['id_parent']] = max($row['local_last_msg'], $lastModifiedMsg[$row['id_parent']]); |
|
1305 | - else |
|
1306 | - $lastModifiedMsg[$row['id_parent']] = $row['local_last_msg']; |
|
1356 | + if (isset($lastModifiedMsg[$row['id_parent']])) { |
|
1357 | + $lastModifiedMsg[$row['id_parent']] = max($row['local_last_msg'], $lastModifiedMsg[$row['id_parent']]); |
|
1358 | + } else { |
|
1359 | + $lastModifiedMsg[$row['id_parent']] = $row['local_last_msg']; |
|
1360 | + } |
|
1307 | 1361 | } |
1308 | 1362 | |
1309 | 1363 | // Update all the basic statistics. |
@@ -1375,8 +1429,9 @@ discard block |
||
1375 | 1429 | require_once($sourcedir . '/Subs-Auth.php'); |
1376 | 1430 | $members = findMembers($_POST['to']); |
1377 | 1431 | |
1378 | - if (empty($members)) |
|
1379 | - fatal_lang_error('reattribute_cannot_find_member'); |
|
1432 | + if (empty($members)) { |
|
1433 | + fatal_lang_error('reattribute_cannot_find_member'); |
|
1434 | + } |
|
1380 | 1435 | |
1381 | 1436 | $memID = array_shift($members); |
1382 | 1437 | $memID = $memID['id']; |
@@ -1406,8 +1461,9 @@ discard block |
||
1406 | 1461 | validateToken('admin-maint'); |
1407 | 1462 | |
1408 | 1463 | $groups = array(); |
1409 | - foreach ($_POST['groups'] as $id => $dummy) |
|
1410 | - $groups[] = (int) $id; |
|
1464 | + foreach ($_POST['groups'] as $id => $dummy) { |
|
1465 | + $groups[] = (int) $id; |
|
1466 | + } |
|
1411 | 1467 | $time_limit = (time() - ($_POST['maxdays'] * 24 * 3600)); |
1412 | 1468 | $where_vars = array( |
1413 | 1469 | 'time_limit' => $time_limit, |
@@ -1416,9 +1472,9 @@ discard block |
||
1416 | 1472 | { |
1417 | 1473 | $where = 'mem.date_registered < {int:time_limit} AND mem.is_activated = {int:is_activated}'; |
1418 | 1474 | $where_vars['is_activated'] = 0; |
1475 | + } else { |
|
1476 | + $where = 'mem.last_login < {int:time_limit} AND (mem.last_login != 0 OR mem.date_registered < {int:time_limit})'; |
|
1419 | 1477 | } |
1420 | - else |
|
1421 | - $where = 'mem.last_login < {int:time_limit} AND (mem.last_login != 0 OR mem.date_registered < {int:time_limit})'; |
|
1422 | 1478 | |
1423 | 1479 | // Need to get *all* groups then work out which (if any) we avoid. |
1424 | 1480 | $request = $smcFunc['db_query']('', ' |
@@ -1437,8 +1493,7 @@ discard block |
||
1437 | 1493 | { |
1438 | 1494 | $where .= ' AND mem.id_post_group != {int:id_post_group_' . $row['id_group'] . '}'; |
1439 | 1495 | $where_vars['id_post_group_' . $row['id_group']] = $row['id_group']; |
1440 | - } |
|
1441 | - else |
|
1496 | + } else |
|
1442 | 1497 | { |
1443 | 1498 | $where .= ' AND mem.id_group != {int:id_group_' . $row['id_group'] . '} AND FIND_IN_SET({int:id_group_' . $row['id_group'] . '}, mem.additional_groups) = 0'; |
1444 | 1499 | $where_vars['id_group_' . $row['id_group']] = $row['id_group']; |
@@ -1465,8 +1520,9 @@ discard block |
||
1465 | 1520 | $members = array(); |
1466 | 1521 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
1467 | 1522 | { |
1468 | - if (!$row['is_mod'] || !in_array(3, $groups)) |
|
1469 | - $members[] = $row['id_member']; |
|
1523 | + if (!$row['is_mod'] || !in_array(3, $groups)) { |
|
1524 | + $members[] = $row['id_member']; |
|
1525 | + } |
|
1470 | 1526 | } |
1471 | 1527 | $smcFunc['db_free_result']($request); |
1472 | 1528 | |
@@ -1513,8 +1569,9 @@ discard block |
||
1513 | 1569 | ) |
1514 | 1570 | ); |
1515 | 1571 | |
1516 | - while ($row = $smcFunc['db_fetch_row']($request)) |
|
1517 | - $drafts[] = (int) $row[0]; |
|
1572 | + while ($row = $smcFunc['db_fetch_row']($request)) { |
|
1573 | + $drafts[] = (int) $row[0]; |
|
1574 | + } |
|
1518 | 1575 | $smcFunc['db_free_result']($request); |
1519 | 1576 | |
1520 | 1577 | // If we have old drafts, remove them |
@@ -1557,8 +1614,9 @@ discard block |
||
1557 | 1614 | $sticky = isset($_POST['move_type_sticky']) || isset($_GET['sticky']); |
1558 | 1615 | |
1559 | 1616 | // No boards then this is your stop. |
1560 | - if (empty($id_board_from) || empty($id_board_to)) |
|
1561 | - return; |
|
1617 | + if (empty($id_board_from) || empty($id_board_to)) { |
|
1618 | + return; |
|
1619 | + } |
|
1562 | 1620 | |
1563 | 1621 | // The big WHERE clause |
1564 | 1622 | $conditions = 'WHERE t.id_board = {int:id_board_from} |
@@ -1606,18 +1664,20 @@ discard block |
||
1606 | 1664 | ); |
1607 | 1665 | list ($total_topics) = $smcFunc['db_fetch_row']($request); |
1608 | 1666 | $smcFunc['db_free_result']($request); |
1667 | + } else { |
|
1668 | + $total_topics = (int) $_REQUEST['totaltopics']; |
|
1609 | 1669 | } |
1610 | - else |
|
1611 | - $total_topics = (int) $_REQUEST['totaltopics']; |
|
1612 | 1670 | |
1613 | 1671 | // Seems like we need this here. |
1614 | 1672 | $context['continue_get_data'] = '?action=admin;area=maintain;sa=topics;activity=massmove;id_board_from=' . $id_board_from . ';id_board_to=' . $id_board_to . ';totaltopics=' . $total_topics . ';max_days=' . $max_days; |
1615 | 1673 | |
1616 | - if ($locked) |
|
1617 | - $context['continue_get_data'] .= ';locked'; |
|
1674 | + if ($locked) { |
|
1675 | + $context['continue_get_data'] .= ';locked'; |
|
1676 | + } |
|
1618 | 1677 | |
1619 | - if ($sticky) |
|
1620 | - $context['continue_get_data'] .= ';sticky'; |
|
1678 | + if ($sticky) { |
|
1679 | + $context['continue_get_data'] .= ';sticky'; |
|
1680 | + } |
|
1621 | 1681 | |
1622 | 1682 | $context['continue_get_data'] .= ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']; |
1623 | 1683 | |
@@ -1638,8 +1698,9 @@ discard block |
||
1638 | 1698 | |
1639 | 1699 | // Get the ids. |
1640 | 1700 | $topics = array(); |
1641 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1642 | - $topics[] = $row['id_topic']; |
|
1701 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
1702 | + $topics[] = $row['id_topic']; |
|
1703 | + } |
|
1643 | 1704 | |
1644 | 1705 | // Just return if we don't have any topics left to move. |
1645 | 1706 | if (empty($topics)) |
@@ -1730,9 +1791,9 @@ discard block |
||
1730 | 1791 | // save it so we don't do this again for this task |
1731 | 1792 | list ($_SESSION['total_members']) = $smcFunc['db_fetch_row']($request); |
1732 | 1793 | $smcFunc['db_free_result']($request); |
1794 | + } else { |
|
1795 | + validateToken('admin-recountposts'); |
|
1733 | 1796 | } |
1734 | - else |
|
1735 | - validateToken('admin-recountposts'); |
|
1736 | 1797 | |
1737 | 1798 | // Lets get a group of members and determine their post count (from the boards that have post count enabled of course). |
1738 | 1799 | $request = $smcFunc['db_query']('', ' |
@@ -1778,8 +1839,9 @@ discard block |
||
1778 | 1839 | createToken('admin-recountposts'); |
1779 | 1840 | $context['continue_post_data'] = '<input type="hidden" name="' . $context['admin-recountposts_token_var'] . '" value="' . $context['admin-recountposts_token'] . '">'; |
1780 | 1841 | |
1781 | - if (function_exists('apache_reset_timeout')) |
|
1782 | - apache_reset_timeout(); |
|
1842 | + if (function_exists('apache_reset_timeout')) { |
|
1843 | + apache_reset_timeout(); |
|
1844 | + } |
|
1783 | 1845 | return; |
1784 | 1846 | } |
1785 | 1847 | |
@@ -1865,10 +1927,9 @@ discard block |
||
1865 | 1927 | checkSession('request'); |
1866 | 1928 | validateToken('admin-hook', 'request'); |
1867 | 1929 | |
1868 | - if ($_REQUEST['do'] == 'remove') |
|
1869 | - remove_integration_function($_REQUEST['hook'], urldecode($_REQUEST['function'])); |
|
1870 | - |
|
1871 | - else |
|
1930 | + if ($_REQUEST['do'] == 'remove') { |
|
1931 | + remove_integration_function($_REQUEST['hook'], urldecode($_REQUEST['function'])); |
|
1932 | + } else |
|
1872 | 1933 | { |
1873 | 1934 | $function_remove = urldecode($_REQUEST['function']) . (($_REQUEST['do'] == 'disable') ? '' : '!'); |
1874 | 1935 | $function_add = urldecode($_REQUEST['function']) . (($_REQUEST['do'] == 'disable') ? '!' : ''); |
@@ -1918,11 +1979,11 @@ discard block |
||
1918 | 1979 | // Show a nice icon to indicate this is an instance. |
1919 | 1980 | $instance = (!empty($data['instance']) ? '<span class="generic_icons news" title="' . $txt['hooks_field_function_method'] . '"></span> ' : ''); |
1920 | 1981 | |
1921 | - if (!empty($data['included_file'])) |
|
1922 | - return $instance . $txt['hooks_field_function'] . ': ' . $data['real_function'] . '<br>' . $txt['hooks_field_included_file'] . ': ' . $data['included_file']; |
|
1923 | - |
|
1924 | - else |
|
1925 | - return $instance . $data['real_function']; |
|
1982 | + if (!empty($data['included_file'])) { |
|
1983 | + return $instance . $txt['hooks_field_function'] . ': ' . $data['real_function'] . '<br>' . $txt['hooks_field_included_file'] . ': ' . $data['included_file']; |
|
1984 | + } else { |
|
1985 | + return $instance . $data['real_function']; |
|
1986 | + } |
|
1926 | 1987 | }, |
1927 | 1988 | ), |
1928 | 1989 | 'sort' => array( |
@@ -1987,11 +2048,12 @@ discard block |
||
1987 | 2048 | 'data' => array( |
1988 | 2049 | 'function' => function($data) use ($txt, $scripturl, $context) |
1989 | 2050 | { |
1990 | - if (!$data['hook_exists']) |
|
1991 | - return ' |
|
2051 | + if (!$data['hook_exists']) { |
|
2052 | + return ' |
|
1992 | 2053 | <a href="' . $scripturl . '?action=admin;area=maintain;sa=hooks;do=remove;hook=' . $data['hook_name'] . ';function=' . urlencode($data['function_name']) . $context['filter_url'] . ';' . $context['admin-hook_token_var'] . '=' . $context['admin-hook_token'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="' . $txt['quickmod_confirm'] . '" class="you_sure"> |
1993 | 2054 | <span class="generic_icons delete" title="' . $txt['hooks_button_remove'] . '"></span> |
1994 | 2055 | </a>'; |
2056 | + } |
|
1995 | 2057 | }, |
1996 | 2058 | 'class' => 'centertext', |
1997 | 2059 | ), |
@@ -2026,10 +2088,11 @@ discard block |
||
2026 | 2088 | { |
2027 | 2089 | if ($file != '.' && $file != '..') |
2028 | 2090 | { |
2029 | - if (is_dir($dir_path . '/' . $file)) |
|
2030 | - $files = array_merge($files, get_files_recursive($dir_path . '/' . $file)); |
|
2031 | - else |
|
2032 | - $files[] = array('dir' => $dir_path, 'name' => $file); |
|
2091 | + if (is_dir($dir_path . '/' . $file)) { |
|
2092 | + $files = array_merge($files, get_files_recursive($dir_path . '/' . $file)); |
|
2093 | + } else { |
|
2094 | + $files[] = array('dir' => $dir_path, 'name' => $file); |
|
2095 | + } |
|
2033 | 2096 | } |
2034 | 2097 | } |
2035 | 2098 | } |
@@ -2078,16 +2141,16 @@ discard block |
||
2078 | 2141 | // I need to know if there is at least one function called in this file. |
2079 | 2142 | $temp_data['include'][$hookParsedData['pureFunc']] = array('hook' => $hook, 'function' => $hookParsedData['pureFunc']); |
2080 | 2143 | unset($temp_hooks[$hook][$rawFunc]); |
2081 | - } |
|
2082 | - elseif (strpos(str_replace(' (', '(', $fc), 'function ' . trim($hookParsedData['pureFunc']) . '(') !== false) |
|
2144 | + } elseif (strpos(str_replace(' (', '(', $fc), 'function ' . trim($hookParsedData['pureFunc']) . '(') !== false) |
|
2083 | 2145 | { |
2084 | 2146 | $hook_status[$hook][$hookParsedData['pureFunc']] = $hookParsedData; |
2085 | 2147 | $hook_status[$hook][$hookParsedData['pureFunc']]['exists'] = true; |
2086 | 2148 | $hook_status[$hook][$hookParsedData['pureFunc']]['in_file'] = (!empty($file['name']) ? $file['name'] : (!empty($hookParsedData['hookFile']) ? $hookParsedData['hookFile'] : '')); |
2087 | 2149 | |
2088 | 2150 | // Does the hook has its own file? |
2089 | - if (!empty($hookParsedData['hookFile'])) |
|
2090 | - $temp_data['include'][$hookParsedData['pureFunc']] = array('hook' => $hook, 'function' => $hookParsedData['pureFunc']); |
|
2151 | + if (!empty($hookParsedData['hookFile'])) { |
|
2152 | + $temp_data['include'][$hookParsedData['pureFunc']] = array('hook' => $hook, 'function' => $hookParsedData['pureFunc']); |
|
2153 | + } |
|
2091 | 2154 | |
2092 | 2155 | // I want to remember all the functions called within this file (to check later if they are enabled or disabled and decide if the integrare_*_include of that file can be disabled too) |
2093 | 2156 | $temp_data['function'][$file['name']][$hookParsedData['pureFunc']] = $hookParsedData['enabled']; |
@@ -2114,15 +2177,17 @@ discard block |
||
2114 | 2177 | $sort = array(); |
2115 | 2178 | $hooks_filters = array(); |
2116 | 2179 | |
2117 | - foreach ($hooks as $hook => $functions) |
|
2118 | - $hooks_filters[] = '<option' . ($context['current_filter'] == $hook ? ' selected ' : '') . ' value="' . $hook . '">' . $hook . '</option>'; |
|
2180 | + foreach ($hooks as $hook => $functions) { |
|
2181 | + $hooks_filters[] = '<option' . ($context['current_filter'] == $hook ? ' selected ' : '') . ' value="' . $hook . '">' . $hook . '</option>'; |
|
2182 | + } |
|
2119 | 2183 | |
2120 | - if (!empty($hooks_filters)) |
|
2121 | - $context['insert_after_template'] .= ' |
|
2184 | + if (!empty($hooks_filters)) { |
|
2185 | + $context['insert_after_template'] .= ' |
|
2122 | 2186 | <script> |
2123 | 2187 | var hook_name_header = document.getElementById(\'header_list_integration_hooks_hook_name\'); |
2124 | 2188 | hook_name_header.innerHTML += ' . JavaScriptEscape('<select style="margin-left:15px;" onchange="window.location=(\'' . $scripturl . '?action=admin;area=maintain;sa=hooks\' + (this.value ? \';filter=\' + this.value : \'\'));"><option value="">' . $txt['hooks_reset_filter'] . '</option>' . implode('', $hooks_filters) . '</select>') . '; |
2125 | 2189 | </script>'; |
2190 | + } |
|
2126 | 2191 | |
2127 | 2192 | $temp_data = array(); |
2128 | 2193 | $id = 0; |
@@ -2164,10 +2229,11 @@ discard block |
||
2164 | 2229 | |
2165 | 2230 | foreach ($temp_data as $data) |
2166 | 2231 | { |
2167 | - if (++$counter < $start) |
|
2168 | - continue; |
|
2169 | - elseif ($counter == $start + $per_page) |
|
2170 | - break; |
|
2232 | + if (++$counter < $start) { |
|
2233 | + continue; |
|
2234 | + } elseif ($counter == $start + $per_page) { |
|
2235 | + break; |
|
2236 | + } |
|
2171 | 2237 | |
2172 | 2238 | $hooks_data[] = $data; |
2173 | 2239 | } |
@@ -2189,13 +2255,15 @@ discard block |
||
2189 | 2255 | $hooks_count = 0; |
2190 | 2256 | |
2191 | 2257 | $context['filter'] = false; |
2192 | - if (isset($_GET['filter'])) |
|
2193 | - $context['filter'] = $_GET['filter']; |
|
2258 | + if (isset($_GET['filter'])) { |
|
2259 | + $context['filter'] = $_GET['filter']; |
|
2260 | + } |
|
2194 | 2261 | |
2195 | 2262 | foreach ($hooks as $hook => $functions) |
2196 | 2263 | { |
2197 | - if (empty($context['filter']) || (!empty($context['filter']) && $context['filter'] == $hook)) |
|
2198 | - $hooks_count += count($functions); |
|
2264 | + if (empty($context['filter']) || (!empty($context['filter']) && $context['filter'] == $hook)) { |
|
2265 | + $hooks_count += count($functions); |
|
2266 | + } |
|
2199 | 2267 | } |
2200 | 2268 | |
2201 | 2269 | return $hooks_count; |
@@ -2216,8 +2284,9 @@ discard block |
||
2216 | 2284 | $integration_hooks = array(); |
2217 | 2285 | foreach ($modSettings as $key => $value) |
2218 | 2286 | { |
2219 | - if (!empty($value) && substr($key, 0, 10) === 'integrate_') |
|
2220 | - $integration_hooks[$key] = explode(',', $value); |
|
2287 | + if (!empty($value) && substr($key, 0, 10) === 'integrate_') { |
|
2288 | + $integration_hooks[$key] = explode(',', $value); |
|
2289 | + } |
|
2221 | 2290 | } |
2222 | 2291 | } |
2223 | 2292 | |
@@ -2248,8 +2317,9 @@ discard block |
||
2248 | 2317 | ); |
2249 | 2318 | |
2250 | 2319 | // Meh... |
2251 | - if (empty($rawData)) |
|
2252 | - return $hookData; |
|
2320 | + if (empty($rawData)) { |
|
2321 | + return $hookData; |
|
2322 | + } |
|
2253 | 2323 | |
2254 | 2324 | // For convenience purposes only! |
2255 | 2325 | $modFunc = $rawData; |
@@ -2260,11 +2330,11 @@ discard block |
||
2260 | 2330 | list ($hookData['hookFile'], $modFunc) = explode('|', $modFunc); |
2261 | 2331 | |
2262 | 2332 | // Does the file exists? who knows! |
2263 | - if (empty($settings['theme_dir'])) |
|
2264 | - $hookData['absPath'] = strtr(trim($hookData['hookFile']), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir)); |
|
2265 | - |
|
2266 | - else |
|
2267 | - $hookData['absPath'] = strtr(trim($hookData['hookFile']), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir, '$themedir' => $settings['theme_dir'])); |
|
2333 | + if (empty($settings['theme_dir'])) { |
|
2334 | + $hookData['absPath'] = strtr(trim($hookData['hookFile']), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir)); |
|
2335 | + } else { |
|
2336 | + $hookData['absPath'] = strtr(trim($hookData['hookFile']), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir, '$themedir' => $settings['theme_dir'])); |
|
2337 | + } |
|
2268 | 2338 | |
2269 | 2339 | $hookData['fileExists'] = file_exists($hookData['absPath']); |
2270 | 2340 | $hookData['hookFile'] = basename($hookData['hookFile']); |
@@ -2289,11 +2359,10 @@ discard block |
||
2289 | 2359 | { |
2290 | 2360 | list ($hookData['class'], $hookData['method']) = explode('::', $modFunc); |
2291 | 2361 | $hookData['pureFunc'] = $hookData['method']; |
2362 | + } else { |
|
2363 | + $hookData['pureFunc'] = $modFunc; |
|
2292 | 2364 | } |
2293 | 2365 | |
2294 | - else |
|
2295 | - $hookData['pureFunc'] = $modFunc; |
|
2296 | - |
|
2297 | 2366 | return $hookData; |
2298 | 2367 | } |
2299 | 2368 | |
@@ -2311,16 +2380,18 @@ discard block |
||
2311 | 2380 | function fixchardb__callback($matches) |
2312 | 2381 | { |
2313 | 2382 | global $smcFunc; |
2314 | - if (!isset($matches[1])) |
|
2315 | - return ''; |
|
2383 | + if (!isset($matches[1])) { |
|
2384 | + return ''; |
|
2385 | + } |
|
2316 | 2386 | |
2317 | 2387 | $num = $matches[1][0] === 'x' ? hexdec(substr($matches[1], 1)) : (int) $matches[1]; |
2318 | 2388 | |
2319 | 2389 | // it's to big for mb3? |
2320 | - if ($num > 0xFFFF && !$smcFunc['db_mb4']) |
|
2321 | - return $matches[0]; |
|
2322 | - else |
|
2323 | - return fixchar__callback($matches); |
|
2324 | -} |
|
2390 | + if ($num > 0xFFFF && !$smcFunc['db_mb4']) { |
|
2391 | + return $matches[0]; |
|
2392 | + } else { |
|
2393 | + return fixchar__callback($matches); |
|
2394 | + } |
|
2395 | + } |
|
2325 | 2396 | |
2326 | 2397 | ?> |
2327 | 2398 | \ No newline at end of file |
@@ -41,11 +41,12 @@ discard block |
||
41 | 41 | </div>'; |
42 | 42 | |
43 | 43 | // If this is an existing set, and there are still un-added smileys - offer an import opportunity. |
44 | - if (!empty($context['current_set']['can_import'])) |
|
45 | - echo ' |
|
44 | + if (!empty($context['current_set']['can_import'])) { |
|
45 | + echo ' |
|
46 | 46 | <div class="information noup"> |
47 | 47 | ', $context['current_set']['can_import'] == 1 ? sprintf($txt['smiley_set_import_single'], $context['current_set']['import_url']) : sprintf($txt['smiley_set_import_multiple'], $context['current_set']['can_import'], $context['current_set']['import_url']), ' |
48 | 48 | </div>'; |
49 | + } |
|
49 | 50 | |
50 | 51 | echo ' |
51 | 52 | <div class="windowbg noup"> |
@@ -62,20 +63,20 @@ discard block |
||
62 | 63 | <dd> |
63 | 64 | ', $modSettings['smileys_url'], '/'; |
64 | 65 | |
65 | - if ($context['current_set']['id'] == 'default') |
|
66 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
67 | - |
|
68 | - elseif (empty($context['smiley_set_dirs'])) |
|
69 | - echo ' |
|
66 | + if ($context['current_set']['id'] == 'default') { |
|
67 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
68 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
69 | + echo ' |
|
70 | 70 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> '; |
71 | - else |
|
71 | + } else |
|
72 | 72 | { |
73 | 73 | echo ' |
74 | 74 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
75 | 75 | |
76 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
77 | - echo ' |
|
76 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
77 | + echo ' |
|
78 | 78 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
79 | + } |
|
79 | 80 | echo ' |
80 | 81 | </select> '; |
81 | 82 | } |
@@ -90,14 +91,15 @@ discard block |
||
90 | 91 | </dd>'; |
91 | 92 | |
92 | 93 | // If this is a new smiley set they have the option to import smileys already in the directory. |
93 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
94 | - echo ' |
|
94 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
95 | + echo ' |
|
95 | 96 | <dt> |
96 | 97 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
97 | 98 | </dt> |
98 | 99 | <dd> |
99 | 100 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1"> |
100 | 101 | </dd>'; |
102 | + } |
|
101 | 103 | |
102 | 104 | echo ' |
103 | 105 | </dl> |
@@ -131,9 +133,10 @@ discard block |
||
131 | 133 | <dd> |
132 | 134 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">'; |
133 | 135 | |
134 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
135 | - echo ' |
|
136 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
137 | + echo ' |
|
136 | 138 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
139 | + } |
|
137 | 140 | |
138 | 141 | echo ' |
139 | 142 | </select>) |
@@ -149,17 +152,18 @@ discard block |
||
149 | 152 | </dt> |
150 | 153 | <dd>'; |
151 | 154 | |
152 | - if (empty($context['filenames'])) |
|
153 | - echo ' |
|
155 | + if (empty($context['filenames'])) { |
|
156 | + echo ' |
|
154 | 157 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">'; |
155 | - else |
|
158 | + } else |
|
156 | 159 | { |
157 | 160 | echo ' |
158 | 161 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
159 | 162 | |
160 | - foreach ($context['filenames'] as $filename) |
|
161 | - echo ' |
|
163 | + foreach ($context['filenames'] as $filename) { |
|
164 | + echo ' |
|
162 | 165 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
166 | + } |
|
163 | 167 | echo ' |
164 | 168 | </select>'; |
165 | 169 | } |
@@ -228,9 +232,10 @@ discard block |
||
228 | 232 | <dd> |
229 | 233 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
230 | 234 | |
231 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
232 | - echo ' |
|
235 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
236 | + echo ' |
|
233 | 237 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
238 | + } |
|
234 | 239 | |
235 | 240 | echo ' |
236 | 241 | </select> |
@@ -240,17 +245,18 @@ discard block |
||
240 | 245 | </dt> |
241 | 246 | <dd>'; |
242 | 247 | |
243 | - if (empty($context['filenames'])) |
|
244 | - echo ' |
|
248 | + if (empty($context['filenames'])) { |
|
249 | + echo ' |
|
245 | 250 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">'; |
246 | - else |
|
251 | + } else |
|
247 | 252 | { |
248 | 253 | echo ' |
249 | 254 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
250 | 255 | |
251 | - foreach ($context['filenames'] as $filename) |
|
252 | - echo ' |
|
256 | + foreach ($context['filenames'] as $filename) { |
|
257 | + echo ' |
|
253 | 258 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
259 | + } |
|
254 | 260 | echo ' |
255 | 261 | </select>'; |
256 | 262 | } |
@@ -279,14 +285,15 @@ discard block |
||
279 | 285 | |
280 | 286 | <dl id="uploadMore" style="display: none;" class="settings">'; |
281 | 287 | |
282 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
283 | - echo ' |
|
288 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
289 | + echo ' |
|
284 | 290 | <dt> |
285 | 291 | ', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ': |
286 | 292 | </dt> |
287 | 293 | <dd> |
288 | 294 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');"> |
289 | 295 | </dd>'; |
296 | + } |
|
290 | 297 | |
291 | 298 | echo ' |
292 | 299 | </dl> |
@@ -357,27 +364,30 @@ discard block |
||
357 | 364 | |
358 | 365 | foreach ($location['rows'] as $row) |
359 | 366 | { |
360 | - if (!empty($context['move_smiley'])) |
|
361 | - echo ' |
|
367 | + if (!empty($context['move_smiley'])) { |
|
368 | + echo ' |
|
362 | 369 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
370 | + } |
|
363 | 371 | |
364 | 372 | foreach ($row as $smiley) |
365 | 373 | { |
366 | - if (empty($context['move_smiley'])) |
|
367 | - echo ' |
|
374 | + if (empty($context['move_smiley'])) { |
|
375 | + echo ' |
|
368 | 376 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '"></a>'; |
369 | - else |
|
370 | - echo ' |
|
377 | + } else { |
|
378 | + echo ' |
|
371 | 379 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '" ', $smiley['selected'] ? 'class="selected_item"' : '', '> |
372 | 380 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
381 | + } |
|
373 | 382 | } |
374 | 383 | |
375 | 384 | echo ' |
376 | 385 | <br>'; |
377 | 386 | } |
378 | - if (!empty($context['move_smiley'])) |
|
379 | - echo ' |
|
387 | + if (!empty($context['move_smiley'])) { |
|
388 | + echo ' |
|
380 | 389 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
390 | + } |
|
381 | 391 | echo ' |
382 | 392 | </div><!-- .windowbg --> |
383 | 393 | <input type="hidden" name="reorder" value="1"> |
@@ -414,14 +424,15 @@ discard block |
||
414 | 424 | <div class="windowbg"> |
415 | 425 | <dl class="settings">'; |
416 | 426 | |
417 | - if (!$context['new_icon']) |
|
418 | - echo ' |
|
427 | + if (!$context['new_icon']) { |
|
428 | + echo ' |
|
419 | 429 | <dt> |
420 | 430 | <strong>', $txt['smiley_preview'], ': </strong> |
421 | 431 | </dt> |
422 | 432 | <dd> |
423 | 433 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
424 | 434 | </dd>'; |
435 | + } |
|
425 | 436 | |
426 | 437 | echo ' |
427 | 438 | <dt> |
@@ -448,9 +459,10 @@ discard block |
||
448 | 459 | echo ' |
449 | 460 | <optgroup label="', $category['name'], '">'; |
450 | 461 | |
451 | - foreach ($category['boards'] as $board) |
|
452 | - echo ' |
|
462 | + foreach ($category['boards'] as $board) { |
|
463 | + echo ' |
|
453 | 464 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
465 | + } |
|
454 | 466 | |
455 | 467 | echo ' |
456 | 468 | </optgroup>'; |
@@ -467,19 +479,21 @@ discard block |
||
467 | 479 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
468 | 480 | |
469 | 481 | // Print the list of all the icons it can be put after... |
470 | - foreach ($context['icons'] as $id => $data) |
|
471 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
482 | + foreach ($context['icons'] as $id => $data) { |
|
483 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
472 | 484 | echo ' |
473 | 485 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
486 | + } |
|
474 | 487 | |
475 | 488 | echo ' |
476 | 489 | </select> |
477 | 490 | </dd> |
478 | 491 | </dl>'; |
479 | 492 | |
480 | - if (!$context['new_icon']) |
|
481 | - echo ' |
|
493 | + if (!$context['new_icon']) { |
|
494 | + echo ' |
|
482 | 495 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
496 | + } |
|
483 | 497 | |
484 | 498 | echo ' |
485 | 499 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button"> |
@@ -25,18 +25,20 @@ discard block |
||
25 | 25 | </div> |
26 | 26 | <div class="windowbg">'; |
27 | 27 | |
28 | - if (!empty($context['move_board'])) |
|
29 | - echo ' |
|
28 | + if (!empty($context['move_board'])) { |
|
29 | + echo ' |
|
30 | 30 | <div class="noticebox"> |
31 | 31 | ', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', ' |
32 | 32 | </div>'; |
33 | + } |
|
33 | 34 | |
34 | 35 | // No categories so show a label. |
35 | - if (empty($context['categories'])) |
|
36 | - echo ' |
|
36 | + if (empty($context['categories'])) { |
|
37 | + echo ' |
|
37 | 38 | <div class="windowbg centertext"> |
38 | 39 | ', $txt['mboards_no_cats'], ' |
39 | 40 | </div>'; |
41 | + } |
|
40 | 42 | |
41 | 43 | // Loop through every category, listing the boards in each as we go. |
42 | 44 | foreach ($context['categories'] as $category) |
@@ -54,9 +56,10 @@ discard block |
||
54 | 56 | <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> |
55 | 57 | <ul id="category_', $category['id'], '" class="nolist">'; |
56 | 58 | |
57 | - if (!empty($category['move_link'])) |
|
58 | - echo ' |
|
59 | + if (!empty($category['move_link'])) { |
|
60 | + echo ' |
|
59 | 61 | <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>'; |
62 | + } |
|
60 | 63 | |
61 | 64 | $recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>'; |
62 | 65 | $redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">'; |
@@ -79,9 +82,10 @@ discard block |
||
79 | 82 | echo ' |
80 | 83 | <li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; |
81 | 84 | |
82 | - foreach ($board['move_links'] as $link) |
|
83 | - echo ' |
|
85 | + foreach ($board['move_links'] as $link) { |
|
86 | + echo ' |
|
84 | 87 | <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>'; |
88 | + } |
|
85 | 89 | |
86 | 90 | echo ' |
87 | 91 | </li>'; |
@@ -130,9 +134,10 @@ discard block |
||
130 | 134 | <select name="cat_order">'; |
131 | 135 | |
132 | 136 | // Print every existing category into a select box. |
133 | - foreach ($context['category_order'] as $order) |
|
134 | - echo ' |
|
137 | + foreach ($context['category_order'] as $order) { |
|
138 | + echo ' |
|
135 | 139 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
140 | + } |
|
136 | 141 | echo ' |
137 | 142 | </select> |
138 | 143 | </dd>'; |
@@ -167,14 +172,15 @@ discard block |
||
167 | 172 | { |
168 | 173 | foreach ($context['custom_category_settings'] as $catset_id => $catset) |
169 | 174 | { |
170 | - if (!empty($catset['dt']) && !empty($catset['dd'])) |
|
171 | - echo ' |
|
175 | + if (!empty($catset['dt']) && !empty($catset['dd'])) { |
|
176 | + echo ' |
|
172 | 177 | <dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '"> |
173 | 178 | ', $catset['dt'], ' |
174 | 179 | </dt> |
175 | 180 | <dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '> |
176 | 181 | ', $catset['dd'], ' |
177 | 182 | </dd>'; |
183 | + } |
|
178 | 184 | } |
179 | 185 | } |
180 | 186 | |
@@ -182,21 +188,23 @@ discard block |
||
182 | 188 | echo ' |
183 | 189 | </dl>'; |
184 | 190 | |
185 | - if (isset($context['category']['is_new'])) |
|
186 | - echo ' |
|
191 | + if (isset($context['category']['is_new'])) { |
|
192 | + echo ' |
|
187 | 193 | <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">'; |
188 | - else |
|
189 | - echo ' |
|
194 | + } else { |
|
195 | + echo ' |
|
190 | 196 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button"> |
191 | 197 | <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button you_sure">'; |
198 | + } |
|
192 | 199 | echo ' |
193 | 200 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
194 | 201 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
195 | 202 | |
196 | 203 | // If this category is empty we don't bother with the next confirmation screen. |
197 | - if ($context['category']['is_empty']) |
|
198 | - echo ' |
|
204 | + if ($context['category']['is_empty']) { |
|
205 | + echo ' |
|
199 | 206 | <input type="hidden" name="empty" value="1">'; |
207 | + } |
|
200 | 208 | |
201 | 209 | echo ' |
202 | 210 | </div><!-- .windowbg --> |
@@ -223,9 +231,10 @@ discard block |
||
223 | 231 | <p>', $txt['mboards_delete_cat_contains'], ':</p> |
224 | 232 | <ul>'; |
225 | 233 | |
226 | - foreach ($context['category']['children'] as $child) |
|
227 | - echo ' |
|
234 | + foreach ($context['category']['children'] as $child) { |
|
235 | + echo ' |
|
228 | 236 | <li>', $child, '</li>'; |
237 | + } |
|
229 | 238 | |
230 | 239 | echo ' |
231 | 240 | </ul> |
@@ -239,10 +248,11 @@ discard block |
||
239 | 248 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>: |
240 | 249 | <select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>'; |
241 | 250 | |
242 | - foreach ($context['category_order'] as $cat) |
|
243 | - if ($cat['id'] != 0) |
|
251 | + foreach ($context['category_order'] as $cat) { |
|
252 | + if ($cat['id'] != 0) |
|
244 | 253 | echo ' |
245 | 254 | <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; |
255 | + } |
|
246 | 256 | |
247 | 257 | echo ' |
248 | 258 | </select> |
@@ -285,9 +295,10 @@ discard block |
||
285 | 295 | <dd> |
286 | 296 | <select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">'; |
287 | 297 | |
288 | - foreach ($context['categories'] as $category) |
|
289 | - echo ' |
|
298 | + foreach ($context['categories'] as $category) { |
|
299 | + echo ' |
|
290 | 300 | <option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; |
301 | + } |
|
291 | 302 | echo ' |
292 | 303 | </select> |
293 | 304 | </dd>'; |
@@ -315,9 +326,10 @@ discard block |
||
315 | 326 | <select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '> |
316 | 327 | ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; |
317 | 328 | |
318 | - foreach ($context['board_order'] as $order) |
|
319 | - echo ' |
|
329 | + foreach ($context['board_order'] as $order) { |
|
330 | + echo ' |
|
320 | 331 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
332 | + } |
|
321 | 333 | echo ' |
322 | 334 | </select> |
323 | 335 | </dd>'; |
@@ -346,13 +358,15 @@ discard block |
||
346 | 358 | <dd> |
347 | 359 | <select name="profile">'; |
348 | 360 | |
349 | - if (isset($context['board']['is_new'])) |
|
350 | - echo ' |
|
361 | + if (isset($context['board']['is_new'])) { |
|
362 | + echo ' |
|
351 | 363 | <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; |
364 | + } |
|
352 | 365 | |
353 | - foreach ($context['profiles'] as $id => $profile) |
|
354 | - echo ' |
|
366 | + foreach ($context['profiles'] as $id => $profile) { |
|
367 | + echo ' |
|
355 | 368 | <option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
369 | + } |
|
356 | 370 | |
357 | 371 | echo ' |
358 | 372 | </select> |
@@ -365,8 +379,8 @@ discard block |
||
365 | 379 | </dt> |
366 | 380 | <dd>'; |
367 | 381 | |
368 | - if (!empty($modSettings['deny_boards_access'])) |
|
369 | - echo ' |
|
382 | + if (!empty($modSettings['deny_boards_access'])) { |
|
383 | + echo ' |
|
370 | 384 | <table> |
371 | 385 | <tr> |
372 | 386 | <td></td> |
@@ -374,10 +388,11 @@ discard block |
||
374 | 388 | <th>', $txt['permissions_option_off'], '</th> |
375 | 389 | <th>', $txt['permissions_option_deny'], '</th> |
376 | 390 | </tr>'; |
391 | + } |
|
377 | 392 | |
378 | 393 | // List all the membergroups so the user can choose who may access this board. |
379 | - foreach ($context['groups'] as $group) |
|
380 | - if (empty($modSettings['deny_boards_access'])) |
|
394 | + foreach ($context['groups'] as $group) { |
|
395 | + if (empty($modSettings['deny_boards_access'])) |
|
381 | 396 | echo ' |
382 | 397 | <label for="groups_', $group['id'], '"> |
383 | 398 | <input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '> |
@@ -385,8 +400,9 @@ discard block |
||
385 | 400 | ', $group['name'], ' |
386 | 401 | </span> |
387 | 402 | </label><br>'; |
388 | - else |
|
389 | - echo ' |
|
403 | + } |
|
404 | + else { |
|
405 | + echo ' |
|
390 | 406 | <tr> |
391 | 407 | <td> |
392 | 408 | <label for="groups_', $group['id'], '_a"> |
@@ -406,16 +422,17 @@ discard block |
||
406 | 422 | </td> |
407 | 423 | <td></td> |
408 | 424 | </tr>'; |
425 | + } |
|
409 | 426 | |
410 | - if (empty($modSettings['deny_boards_access'])) |
|
411 | - echo ' |
|
427 | + if (empty($modSettings['deny_boards_access'])) { |
|
428 | + echo ' |
|
412 | 429 | <span class="select_all_box"> |
413 | 430 | <em>', $txt['check_all'], '</em> <input type="checkbox" onclick="invertAll(this, this.form, \'groups[\');"> |
414 | 431 | </span> |
415 | 432 | <br><br> |
416 | 433 | </dd>'; |
417 | - else |
|
418 | - echo ' |
|
434 | + } else { |
|
435 | + echo ' |
|
419 | 436 | <tr class="select_all_box"> |
420 | 437 | <td> |
421 | 438 | </td> |
@@ -434,6 +451,7 @@ discard block |
||
434 | 451 | </tr> |
435 | 452 | </table> |
436 | 453 | </dd>'; |
454 | + } |
|
437 | 455 | |
438 | 456 | // Options to choose moderators, specify as announcement board and choose whether to count posts here. |
439 | 457 | echo ' |
@@ -488,8 +506,8 @@ discard block |
||
488 | 506 | </dl> |
489 | 507 | </div>'; |
490 | 508 | |
491 | - if ($context['board']['redirect']) |
|
492 | - echo ' |
|
509 | + if ($context['board']['redirect']) { |
|
510 | + echo ' |
|
493 | 511 | <div id="reset_redirect_div"> |
494 | 512 | <dl class="settings"> |
495 | 513 | <dt> |
@@ -502,6 +520,7 @@ discard block |
||
502 | 520 | </dd> |
503 | 521 | </dl> |
504 | 522 | </div>'; |
523 | + } |
|
505 | 524 | } |
506 | 525 | |
507 | 526 | echo ' |
@@ -529,9 +548,10 @@ discard block |
||
529 | 548 | <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> |
530 | 549 | <option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>'; |
531 | 550 | |
532 | - foreach ($context['themes'] as $theme) |
|
533 | - echo ' |
|
551 | + foreach ($context['themes'] as $theme) { |
|
552 | + echo ' |
|
534 | 553 | <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
554 | + } |
|
535 | 555 | |
536 | 556 | echo ' |
537 | 557 | </select> |
@@ -560,14 +580,15 @@ discard block |
||
560 | 580 | |
561 | 581 | foreach ($context['custom_board_settings'] as $cbs_id => $cbs) |
562 | 582 | { |
563 | - if (!empty($cbs['dt']) && !empty($cbs['dd'])) |
|
564 | - echo ' |
|
583 | + if (!empty($cbs['dt']) && !empty($cbs['dd'])) { |
|
584 | + echo ' |
|
565 | 585 | <dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '"> |
566 | 586 | ', $cbs['dt'], ' |
567 | 587 | </dt> |
568 | 588 | <dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '> |
569 | 589 | ', $cbs['dd'], ' |
570 | 590 | </dd>'; |
591 | + } |
|
571 | 592 | } |
572 | 593 | |
573 | 594 | echo ' |
@@ -575,9 +596,10 @@ discard block |
||
575 | 596 | </div>'; |
576 | 597 | } |
577 | 598 | |
578 | - if (!empty($context['board']['is_recycle'])) |
|
579 | - echo ' |
|
599 | + if (!empty($context['board']['is_recycle'])) { |
|
600 | + echo ' |
|
580 | 601 | <div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>'; |
602 | + } |
|
581 | 603 | |
582 | 604 | echo ' |
583 | 605 | <input type="hidden" name="rid" value="', $context['redirect_location'], '"> |
@@ -585,21 +607,24 @@ discard block |
||
585 | 607 | <input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">'; |
586 | 608 | |
587 | 609 | // If this board has no children don't bother with the next confirmation screen. |
588 | - if ($context['board']['no_children']) |
|
589 | - echo ' |
|
610 | + if ($context['board']['no_children']) { |
|
611 | + echo ' |
|
590 | 612 | <input type="hidden" name="no_children" value="1">'; |
613 | + } |
|
591 | 614 | |
592 | - if (isset($context['board']['is_new'])) |
|
593 | - echo ' |
|
615 | + if (isset($context['board']['is_new'])) { |
|
616 | + echo ' |
|
594 | 617 | <input type="hidden" name="cur_cat" value="', $context['board']['category'], '"> |
595 | 618 | <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
596 | - else |
|
597 | - echo ' |
|
619 | + } else { |
|
620 | + echo ' |
|
598 | 621 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
622 | + } |
|
599 | 623 | |
600 | - if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) |
|
601 | - echo ' |
|
624 | + if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) { |
|
625 | + echo ' |
|
602 | 626 | <input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button you_sure">'; |
627 | + } |
|
603 | 628 | echo ' |
604 | 629 | </div><!-- .windowbg --> |
605 | 630 | </form> |
@@ -620,12 +645,13 @@ discard block |
||
620 | 645 | sItemListContainerId: \'moderator_container\', |
621 | 646 | aListItems: ['; |
622 | 647 | |
623 | - foreach ($context['board']['moderators'] as $id_member => $member_name) |
|
624 | - echo ' |
|
648 | + foreach ($context['board']['moderators'] as $id_member => $member_name) { |
|
649 | + echo ' |
|
625 | 650 | { |
626 | 651 | sItemId: ', JavaScriptEscape($id_member), ', |
627 | 652 | sItemName: ', JavaScriptEscape($member_name), ' |
628 | 653 | }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; |
654 | + } |
|
629 | 655 | |
630 | 656 | echo ' |
631 | 657 | ] |
@@ -645,12 +671,13 @@ discard block |
||
645 | 671 | sItemListContainerId: \'moderator_group_container\', |
646 | 672 | aListItems: ['; |
647 | 673 | |
648 | - foreach ($context['board']['moderator_groups'] as $id_group => $group_name) |
|
649 | - echo ' |
|
674 | + foreach ($context['board']['moderator_groups'] as $id_group => $group_name) { |
|
675 | + echo ' |
|
650 | 676 | { |
651 | 677 | sItemId: ', JavaScriptEscape($id_group), ', |
652 | 678 | sItemName: ', JavaScriptEscape($group_name), ' |
653 | 679 | }', $id_group == $context['board']['last_moderator_group_id'] ? '' : ','; |
680 | + } |
|
654 | 681 | |
655 | 682 | echo ' |
656 | 683 | ] |
@@ -676,17 +703,19 @@ discard block |
||
676 | 703 | echo ' |
677 | 704 | document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; |
678 | 705 | |
679 | - if ($context['board']['redirect']) |
|
680 | - echo ' |
|
706 | + if ($context['board']['redirect']) { |
|
707 | + echo ' |
|
681 | 708 | document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; |
709 | + } |
|
682 | 710 | } |
683 | 711 | |
684 | 712 | // Include any JavaScript added by mods using the 'integrate_edit_board' hook. |
685 | 713 | if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions'])) |
686 | 714 | { |
687 | - foreach ($context['custom_refreshOptions'] as $refreshOption) |
|
688 | - echo ' |
|
715 | + foreach ($context['custom_refreshOptions'] as $refreshOption) { |
|
716 | + echo ' |
|
689 | 717 | ', $refreshOption; |
718 | + } |
|
690 | 719 | } |
691 | 720 | |
692 | 721 | echo ' |
@@ -715,9 +744,10 @@ discard block |
||
715 | 744 | <p>', $txt['mboards_delete_board_contains'], '</p> |
716 | 745 | <ul>'; |
717 | 746 | |
718 | - foreach ($context['children'] as $child) |
|
719 | - echo ' |
|
747 | + foreach ($context['children'] as $child) { |
|
748 | + echo ' |
|
720 | 749 | <li>', $child['node']['name'], '</li>'; |
750 | + } |
|
721 | 751 | |
722 | 752 | echo ' |
723 | 753 | </ul> |
@@ -731,10 +761,11 @@ discard block |
||
731 | 761 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>: |
732 | 762 | <select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>'; |
733 | 763 | |
734 | - foreach ($context['board_order'] as $board) |
|
735 | - if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
764 | + foreach ($context['board_order'] as $board) { |
|
765 | + if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
736 | 766 | echo ' |
737 | 767 | <option value="', $board['id'], '">', $board['name'], '</option>'; |
768 | + } |
|
738 | 769 | |
739 | 770 | echo ' |
740 | 771 | </select> |
@@ -28,14 +28,15 @@ discard block |
||
28 | 28 | <div id="confirm_buttons">'; |
29 | 29 | |
30 | 30 | // Age restriction in effect? |
31 | - if ($context['show_coppa']) |
|
32 | - echo ' |
|
31 | + if ($context['show_coppa']) { |
|
32 | + echo ' |
|
33 | 33 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br> |
34 | 34 | <br> |
35 | 35 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">'; |
36 | - else |
|
37 | - echo ' |
|
36 | + } else { |
|
37 | + echo ' |
|
38 | 38 | <input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button">'; |
39 | + } |
|
39 | 40 | |
40 | 41 | echo ' |
41 | 42 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -78,9 +79,10 @@ discard block |
||
78 | 79 | <ul>'; |
79 | 80 | |
80 | 81 | // Cycle through each error and display an error message. |
81 | - foreach ($context['registration_errors'] as $error) |
|
82 | - echo ' |
|
82 | + foreach ($context['registration_errors'] as $error) { |
|
83 | + echo ' |
|
83 | 84 | <li>', $error, '</li>'; |
85 | + } |
|
84 | 86 | |
85 | 87 | echo ' |
86 | 88 | </ul> |
@@ -149,14 +151,15 @@ discard block |
||
149 | 151 | echo ' |
150 | 152 | <dl class="register_form">'; |
151 | 153 | |
152 | - foreach ($context['custom_fields'] as $field) |
|
153 | - if ($field['show_reg'] > 1) |
|
154 | + foreach ($context['custom_fields'] as $field) { |
|
155 | + if ($field['show_reg'] > 1) |
|
154 | 156 | echo ' |
155 | 157 | <dt> |
156 | 158 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
157 | 159 | <span class="smalltext">', $field['desc'], '</span> |
158 | 160 | </dt> |
159 | 161 | <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>'; |
162 | + } |
|
160 | 163 | |
161 | 164 | echo ' |
162 | 165 | </dl>'; |
@@ -167,14 +170,15 @@ discard block |
||
167 | 170 | </div><!-- .roundframe -->'; |
168 | 171 | |
169 | 172 | // If we have either of these, show the extra group. |
170 | - if (!empty($context['profile_fields']) || !empty($context['custom_fields'])) |
|
171 | - echo ' |
|
173 | + if (!empty($context['profile_fields']) || !empty($context['custom_fields'])) { |
|
174 | + echo ' |
|
172 | 175 | <div class="title_bar"> |
173 | 176 | <h3 class="titlebg">', $txt['additional_information'], '</h3> |
174 | 177 | </div> |
175 | 178 | <div class="roundframe noup"> |
176 | 179 | <fieldset> |
177 | 180 | <dl class="register_form" id="custom_group">'; |
181 | + } |
|
178 | 182 | |
179 | 183 | if (!empty($context['profile_fields'])) |
180 | 184 | { |
@@ -188,41 +192,45 @@ discard block |
||
188 | 192 | $callback_func = 'template_profile_' . $field['callback_func']; |
189 | 193 | $callback_func(); |
190 | 194 | } |
191 | - } |
|
192 | - else |
|
195 | + } else |
|
193 | 196 | { |
194 | 197 | echo ' |
195 | 198 | <dt> |
196 | 199 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>'; |
197 | 200 | |
198 | 201 | // Does it have any subtext to show? |
199 | - if (!empty($field['subtext'])) |
|
200 | - echo ' |
|
202 | + if (!empty($field['subtext'])) { |
|
203 | + echo ' |
|
201 | 204 | <span class="smalltext">', $field['subtext'], '</span>'; |
205 | + } |
|
202 | 206 | |
203 | 207 | echo ' |
204 | 208 | </dt> |
205 | 209 | <dd>'; |
206 | 210 | |
207 | 211 | // Want to put something infront of the box? |
208 | - if (!empty($field['preinput'])) |
|
209 | - echo ' |
|
212 | + if (!empty($field['preinput'])) { |
|
213 | + echo ' |
|
210 | 214 | ', $field['preinput']; |
215 | + } |
|
211 | 216 | |
212 | 217 | // What type of data are we showing? |
213 | - if ($field['type'] == 'label') |
|
214 | - echo ' |
|
218 | + if ($field['type'] == 'label') { |
|
219 | + echo ' |
|
215 | 220 | ', $field['value']; |
221 | + } |
|
216 | 222 | |
217 | 223 | // Maybe it's a text box - very likely! |
218 | - elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'url'))) |
|
219 | - echo ' |
|
224 | + elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'url'))) { |
|
225 | + echo ' |
|
220 | 226 | <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>'; |
227 | + } |
|
221 | 228 | |
222 | 229 | // You "checking" me out? ;) |
223 | - elseif ($field['type'] == 'check') |
|
224 | - echo ' |
|
230 | + elseif ($field['type'] == 'check') { |
|
231 | + echo ' |
|
225 | 232 | <input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>'; |
233 | + } |
|
226 | 234 | |
227 | 235 | // Always fun - select boxes! |
228 | 236 | elseif ($field['type'] == 'select') |
@@ -233,14 +241,16 @@ discard block |
||
233 | 241 | if (isset($field['options'])) |
234 | 242 | { |
235 | 243 | // Is this some code to generate the options? |
236 | - if (!is_array($field['options'])) |
|
237 | - $field['options'] = eval($field['options']); |
|
244 | + if (!is_array($field['options'])) { |
|
245 | + $field['options'] = eval($field['options']); |
|
246 | + } |
|
238 | 247 | |
239 | 248 | // Assuming we now have some! |
240 | - if (is_array($field['options'])) |
|
241 | - foreach ($field['options'] as $value => $name) |
|
249 | + if (is_array($field['options'])) { |
|
250 | + foreach ($field['options'] as $value => $name) |
|
242 | 251 | echo ' |
243 | 252 | <option', is_numeric($value) ? ' value="" disabled' : ' value="' . $value . '"', $value === $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
253 | + } |
|
244 | 254 | } |
245 | 255 | |
246 | 256 | echo ' |
@@ -248,9 +258,10 @@ discard block |
||
248 | 258 | } |
249 | 259 | |
250 | 260 | // Something to end with? |
251 | - if (!empty($field['postinput'])) |
|
252 | - echo ' |
|
261 | + if (!empty($field['postinput'])) { |
|
262 | + echo ' |
|
253 | 263 | ', $field['postinput']; |
264 | + } |
|
254 | 265 | |
255 | 266 | echo ' |
256 | 267 | </dd>'; |
@@ -261,25 +272,27 @@ discard block |
||
261 | 272 | // Are there any custom fields? |
262 | 273 | if (!empty($context['custom_fields'])) |
263 | 274 | { |
264 | - foreach ($context['custom_fields'] as $field) |
|
265 | - if ($field['show_reg'] < 2) |
|
275 | + foreach ($context['custom_fields'] as $field) { |
|
276 | + if ($field['show_reg'] < 2) |
|
266 | 277 | echo ' |
267 | 278 | <dt> |
268 | 279 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
269 | 280 | <span class="smalltext">', $field['desc'], '</span> |
270 | 281 | </dt> |
271 | 282 | <dd>', $field['input_html'], '</dd>'; |
283 | + } |
|
272 | 284 | } |
273 | 285 | |
274 | 286 | // If we have either of these, close the list like a proper gent. |
275 | - if (!empty($context['profile_fields']) || !empty($context['custom_fields'])) |
|
276 | - echo ' |
|
287 | + if (!empty($context['profile_fields']) || !empty($context['custom_fields'])) { |
|
288 | + echo ' |
|
277 | 289 | </dl> |
278 | 290 | </fieldset> |
279 | 291 | </div><!-- .roundframe -->'; |
292 | + } |
|
280 | 293 | |
281 | - if ($context['visual_verification']) |
|
282 | - echo ' |
|
294 | + if ($context['visual_verification']) { |
|
295 | + echo ' |
|
283 | 296 | <div class="title_bar"> |
284 | 297 | <h3 class="titlebg">', $txt['verification'], '</h3> |
285 | 298 | </div> |
@@ -288,19 +301,21 @@ discard block |
||
288 | 301 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
289 | 302 | </fieldset> |
290 | 303 | </div>'; |
304 | + } |
|
291 | 305 | |
292 | 306 | echo ' |
293 | 307 | <div id="confirm_buttons" class="flow_auto">'; |
294 | 308 | |
295 | 309 | // Age restriction in effect? |
296 | - if (!$context['require_agreement'] && $context['show_coppa']) |
|
297 | - echo ' |
|
310 | + if (!$context['require_agreement'] && $context['show_coppa']) { |
|
311 | + echo ' |
|
298 | 312 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br> |
299 | 313 | <br> |
300 | 314 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">'; |
301 | - else |
|
302 | - echo ' |
|
315 | + } else { |
|
316 | + echo ' |
|
303 | 317 | <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button">'; |
318 | + } |
|
304 | 319 | |
305 | 320 | echo ' |
306 | 321 | </div> |
@@ -362,25 +377,28 @@ discard block |
||
362 | 377 | <p>', $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</p>'; |
363 | 378 | |
364 | 379 | // Can they send by post? |
365 | - if (!empty($context['coppa']['post'])) |
|
366 | - echo ' |
|
380 | + if (!empty($context['coppa']['post'])) { |
|
381 | + echo ' |
|
367 | 382 | <h4>1) ', $txt['coppa_send_by_post'], '</h4> |
368 | 383 | <div class="coppa_contact"> |
369 | 384 | ', $context['coppa']['post'], ' |
370 | 385 | </div>'; |
386 | + } |
|
371 | 387 | |
372 | 388 | // Can they send by fax?? |
373 | - if (!empty($context['coppa']['fax'])) |
|
374 | - echo ' |
|
389 | + if (!empty($context['coppa']['fax'])) { |
|
390 | + echo ' |
|
375 | 391 | <h4>', !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</h4> |
376 | 392 | <div class="coppa_contact"> |
377 | 393 | ', $context['coppa']['fax'], ' |
378 | 394 | </div>'; |
395 | + } |
|
379 | 396 | |
380 | 397 | // Offer an alternative Phone Number? |
381 | - if ($context['coppa']['phone']) |
|
382 | - echo ' |
|
398 | + if ($context['coppa']['phone']) { |
|
399 | + echo ' |
|
383 | 400 | <p>', $context['coppa']['phone'], '</p>'; |
401 | + } |
|
384 | 402 | |
385 | 403 | echo ' |
386 | 404 | </div><!-- #coppa -->'; |
@@ -445,19 +463,20 @@ discard block |
||
445 | 463 | <body style="margin: 1ex;"> |
446 | 464 | <div class="windowbg description" style="text-align: center;">'; |
447 | 465 | |
448 | - if (isBrowser('is_ie') || isBrowser('is_ie11')) |
|
449 | - echo ' |
|
466 | + if (isBrowser('is_ie') || isBrowser('is_ie11')) { |
|
467 | + echo ' |
|
450 | 468 | <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav"> |
451 | 469 | <param name="AutoStart" value="1"> |
452 | 470 | <param name="FileName" value="', $context['verification_sound_href'], '"> |
453 | 471 | </object>'; |
454 | - else |
|
455 | - echo ' |
|
472 | + } else { |
|
473 | + echo ' |
|
456 | 474 | <audio src="', $context['verification_sound_href'], '" controls> |
457 | 475 | <object type="audio/x-wav" data="', $context['verification_sound_href'], '"> |
458 | 476 | <a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a> |
459 | 477 | </object> |
460 | 478 | </audio>'; |
479 | + } |
|
461 | 480 | |
462 | 481 | echo ' |
463 | 482 | <br> |
@@ -485,11 +504,12 @@ discard block |
||
485 | 504 | </div> |
486 | 505 | <div id="register_screen" class="windowbg">'; |
487 | 506 | |
488 | - if (!empty($context['registration_done'])) |
|
489 | - echo ' |
|
507 | + if (!empty($context['registration_done'])) { |
|
508 | + echo ' |
|
490 | 509 | <div class="infobox"> |
491 | 510 | ', $context['registration_done'], ' |
492 | 511 | </div>'; |
512 | + } |
|
493 | 513 | |
494 | 514 | echo ' |
495 | 515 | <dl class="register_form" id="admin_register_form"> |
@@ -525,9 +545,10 @@ discard block |
||
525 | 545 | <dd> |
526 | 546 | <select name="group" id="group_select" tabindex="', $context['tabindex']++, '">'; |
527 | 547 | |
528 | - foreach ($context['member_groups'] as $id => $name) |
|
529 | - echo ' |
|
548 | + foreach ($context['member_groups'] as $id => $name) { |
|
549 | + echo ' |
|
530 | 550 | <option value="', $id, '">', $name, '</option>'; |
551 | + } |
|
531 | 552 | |
532 | 553 | echo ' |
533 | 554 | </select> |
@@ -535,8 +556,8 @@ discard block |
||
535 | 556 | } |
536 | 557 | |
537 | 558 | // If there is any field marked as required, show it here! |
538 | - if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) |
|
539 | - foreach ($context['custom_fields'] as $field) |
|
559 | + if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) { |
|
560 | + foreach ($context['custom_fields'] as $field) |
|
540 | 561 | if ($field['show_reg'] > 1) |
541 | 562 | echo ' |
542 | 563 | <dt> |
@@ -546,6 +567,7 @@ discard block |
||
546 | 567 | <dd> |
547 | 568 | ', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), ' |
548 | 569 | </dd>'; |
570 | + } |
|
549 | 571 | |
550 | 572 | echo ' |
551 | 573 | <dt> |
@@ -582,18 +604,19 @@ discard block |
||
582 | 604 | { |
583 | 605 | global $context, $scripturl, $txt; |
584 | 606 | |
585 | - if (!empty($context['saved_successful'])) |
|
586 | - echo ' |
|
607 | + if (!empty($context['saved_successful'])) { |
|
608 | + echo ' |
|
587 | 609 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
588 | - |
|
589 | - elseif (!empty($context['could_not_save'])) |
|
590 | - echo ' |
|
610 | + } elseif (!empty($context['could_not_save'])) { |
|
611 | + echo ' |
|
591 | 612 | <div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>'; |
613 | + } |
|
592 | 614 | |
593 | 615 | // Warning for if the file isn't writable. |
594 | - if (!empty($context['warning'])) |
|
595 | - echo ' |
|
616 | + if (!empty($context['warning'])) { |
|
617 | + echo ' |
|
596 | 618 | <div class="errorbox">', $context['warning'], '</div>'; |
619 | + } |
|
597 | 620 | |
598 | 621 | // Just a big box to edit the text file ;) |
599 | 622 | echo ' |
@@ -615,9 +638,10 @@ discard block |
||
615 | 638 | <strong>', $txt['admin_agreement_select_language'], ':</strong> |
616 | 639 | <select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">'; |
617 | 640 | |
618 | - foreach ($context['editable_agreements'] as $file => $name) |
|
619 | - echo ' |
|
641 | + foreach ($context['editable_agreements'] as $file => $name) { |
|
642 | + echo ' |
|
620 | 643 | <option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>'; |
644 | + } |
|
621 | 645 | |
622 | 646 | echo ' |
623 | 647 | </select> |
@@ -657,9 +681,10 @@ discard block |
||
657 | 681 | { |
658 | 682 | global $context, $scripturl, $txt; |
659 | 683 | |
660 | - if (!empty($context['saved_successful'])) |
|
661 | - echo ' |
|
684 | + if (!empty($context['saved_successful'])) { |
|
685 | + echo ' |
|
662 | 686 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
687 | + } |
|
663 | 688 | |
664 | 689 | echo ' |
665 | 690 | <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '"> |
@@ -29,9 +29,10 @@ discard block |
||
29 | 29 | <strong>', $txt['ban_errors_detected'], '</strong> |
30 | 30 | <ul>'; |
31 | 31 | |
32 | - foreach ($context['error_messages'] as $error) |
|
33 | - echo ' |
|
32 | + foreach ($context['error_messages'] as $error) { |
|
33 | + echo ' |
|
34 | 34 | <li class="error">', $error, '</li>'; |
35 | + } |
|
35 | 36 | |
36 | 37 | echo ' |
37 | 38 | </ul> |
@@ -45,9 +46,10 @@ discard block |
||
45 | 46 | </h3> |
46 | 47 | </div>'; |
47 | 48 | |
48 | - if ($context['ban']['is_new']) |
|
49 | - echo ' |
|
49 | + if ($context['ban']['is_new']) { |
|
50 | + echo ' |
|
50 | 51 | <div class="information noup">', $txt['ban_add_notes'], '</div>'; |
52 | + } |
|
51 | 53 | |
52 | 54 | echo ' |
53 | 55 | <div class="windowbg noup"> |
@@ -59,8 +61,8 @@ discard block |
||
59 | 61 | <input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60"> |
60 | 62 | </dd>'; |
61 | 63 | |
62 | - if (isset($context['ban']['reason'])) |
|
63 | - echo ' |
|
64 | + if (isset($context['ban']['reason'])) { |
|
65 | + echo ' |
|
64 | 66 | <dt> |
65 | 67 | <strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br> |
66 | 68 | <span class="smalltext">', $txt['ban_reason_desc'], '</span> |
@@ -68,9 +70,10 @@ discard block |
||
68 | 70 | <dd> |
69 | 71 | <textarea name="reason" id="reason" cols="40" rows="3">', $context['ban']['reason'], '</textarea> |
70 | 72 | </dd>'; |
73 | + } |
|
71 | 74 | |
72 | - if (isset($context['ban']['notes'])) |
|
73 | - echo ' |
|
75 | + if (isset($context['ban']['notes'])) { |
|
76 | + echo ' |
|
74 | 77 | <dt> |
75 | 78 | <strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br> |
76 | 79 | <span class="smalltext">', $txt['ban_notes_desc'], '</span> |
@@ -78,6 +81,7 @@ discard block |
||
78 | 81 | <dd> |
79 | 82 | <textarea name="notes" id="ban_notes" cols="40" rows="3">', $context['ban']['notes'], '</textarea> |
80 | 83 | </dd>'; |
84 | + } |
|
81 | 85 | |
82 | 86 | echo ' |
83 | 87 | </dl> |
@@ -117,8 +121,8 @@ discard block |
||
117 | 121 | <input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
118 | 122 | </dd>'; |
119 | 123 | |
120 | - if (empty($modSettings['disableHostnameLookup'])) |
|
121 | - echo ' |
|
124 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
125 | + echo ' |
|
122 | 126 | <dt> |
123 | 127 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '> |
124 | 128 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -126,6 +130,7 @@ discard block |
||
126 | 130 | <dd> |
127 | 131 | <input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
128 | 132 | </dd>'; |
133 | + } |
|
129 | 134 | |
130 | 135 | echo ' |
131 | 136 | <dt> |
@@ -155,14 +160,15 @@ discard block |
||
155 | 160 | <dl class="settings">'; |
156 | 161 | |
157 | 162 | $count = 0; |
158 | - foreach ($ban_ips as $ip) |
|
159 | - echo ' |
|
163 | + foreach ($ban_ips as $ip) { |
|
164 | + echo ' |
|
160 | 165 | <dt> |
161 | 166 | <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, '"> |
162 | 167 | </dt> |
163 | 168 | <dd> |
164 | 169 | <label for="suggestions_', $key, '_', $count++, '">', $ip, '</label> |
165 | 170 | </dd>'; |
171 | + } |
|
166 | 172 | |
167 | 173 | echo ' |
168 | 174 | </dl>'; |
@@ -204,8 +210,8 @@ discard block |
||
204 | 210 | addLoadEvent(fUpdateStatus);'; |
205 | 211 | |
206 | 212 | // Auto suggest only needed for adding new bans, not editing |
207 | - if ($context['ban']['is_new'] && empty($_REQUEST['u'])) |
|
208 | - echo ' |
|
213 | + if ($context['ban']['is_new'] && empty($_REQUEST['u'])) { |
|
214 | + echo ' |
|
209 | 215 | var oAddMemberSuggest = new smc_AutoSuggest({ |
210 | 216 | sSelf: \'oAddMemberSuggest\', |
211 | 217 | sSessionId: smf_session_id, |
@@ -223,6 +229,7 @@ discard block |
||
223 | 229 | return true; |
224 | 230 | } |
225 | 231 | oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');'; |
232 | + } |
|
226 | 233 | |
227 | 234 | echo ' |
228 | 235 | function confirmBan(aForm) |
@@ -271,8 +278,8 @@ discard block |
||
271 | 278 | <input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
272 | 279 | </dd>'; |
273 | 280 | |
274 | - if (empty($modSettings['disableHostnameLookup'])) |
|
275 | - echo ' |
|
281 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
282 | + echo ' |
|
276 | 283 | <dt> |
277 | 284 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '> |
278 | 285 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -280,6 +287,7 @@ discard block |
||
280 | 287 | <dd> |
281 | 288 | <input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
282 | 289 | </dd>'; |
290 | + } |
|
283 | 291 | |
284 | 292 | echo ' |
285 | 293 | <dt> |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | <div class="windowbg"> |
128 | 128 | <dl class="settings">'; |
129 | 129 | |
130 | - if (!empty($context['table_info'])) |
|
131 | - echo ' |
|
130 | + if (!empty($context['table_info'])) { |
|
131 | + echo ' |
|
132 | 132 | <dt> |
133 | 133 | <strong>', $txt['search_method_messages_table_space'], ':</strong> |
134 | 134 | </dt> |
@@ -141,6 +141,7 @@ discard block |
||
141 | 141 | <dd> |
142 | 142 | ', $context['table_info']['index_length'], ' |
143 | 143 | </dd>'; |
144 | + } |
|
144 | 145 | echo ' |
145 | 146 | </dl> |
146 | 147 | ', $context['double_index'] ? '<div class="noticebox"> |
@@ -163,17 +164,17 @@ discard block |
||
163 | 164 | <dd> |
164 | 165 | <span class="smalltext">'; |
165 | 166 | |
166 | - if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) |
|
167 | - echo ' |
|
167 | + if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) { |
|
168 | + echo ' |
|
168 | 169 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]'; |
169 | - |
|
170 | - elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) |
|
171 | - echo ' |
|
170 | + } elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) { |
|
171 | + echo ' |
|
172 | 172 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create']; |
173 | - else |
|
174 | - echo ' |
|
173 | + } else { |
|
174 | + echo ' |
|
175 | 175 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br> |
176 | 176 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length']; |
177 | + } |
|
177 | 178 | echo ' |
178 | 179 | </span> |
179 | 180 | </dd>'; |
@@ -187,26 +188,27 @@ discard block |
||
187 | 188 | <dd> |
188 | 189 | <span class="smalltext">'; |
189 | 190 | |
190 | - if ($context['custom_index']) |
|
191 | - echo ' |
|
191 | + if ($context['custom_index']) { |
|
192 | + echo ' |
|
192 | 193 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br> |
193 | 194 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
194 | - |
|
195 | - elseif ($context['partial_custom_index']) |
|
196 | - echo ' |
|
195 | + } elseif ($context['partial_custom_index']) { |
|
196 | + echo ' |
|
197 | 197 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br> |
198 | 198 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
199 | - else |
|
200 | - echo ' |
|
199 | + } else { |
|
200 | + echo ' |
|
201 | 201 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]'; |
202 | + } |
|
202 | 203 | echo ' |
203 | 204 | </span> |
204 | 205 | </dd>'; |
205 | 206 | |
206 | 207 | foreach ($context['search_apis'] as $api) |
207 | 208 | { |
208 | - if (empty($api['label']) || $api['has_template']) |
|
209 | - continue; |
|
209 | + if (empty($api['label']) || $api['has_template']) { |
|
210 | + continue; |
|
211 | + } |
|
210 | 212 | |
211 | 213 | echo ' |
212 | 214 | <dt> |
@@ -214,11 +216,12 @@ discard block |
||
214 | 216 | ', $api['label'], ' |
215 | 217 | </dt>'; |
216 | 218 | |
217 | - if ($api['desc']) |
|
218 | - echo ' |
|
219 | + if ($api['desc']) { |
|
220 | + echo ' |
|
219 | 221 | <dd> |
220 | 222 | <span class="smalltext">', $api['desc'], '</span> |
221 | 223 | </dd>'; |
224 | + } |
|
222 | 225 | } |
223 | 226 | |
224 | 227 | echo ' |
@@ -116,9 +116,10 @@ discard block |
||
116 | 116 | </div><!-- .windowbg --> |
117 | 117 | </div><!-- #manage_attachments -->'; |
118 | 118 | |
119 | - if (!empty($context['results'])) |
|
120 | - echo ' |
|
119 | + if (!empty($context['results'])) { |
|
120 | + echo ' |
|
121 | 121 | <div class="noticebox">', $context['results'], '</div>'; |
122 | + } |
|
122 | 123 | |
123 | 124 | echo ' |
124 | 125 | <div id="transfer" class="cat_bar"> |
@@ -133,9 +134,10 @@ discard block |
||
133 | 134 | <select name="from"> |
134 | 135 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
135 | 136 | |
136 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
137 | - echo ' |
|
137 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
138 | + echo ' |
|
138 | 139 | <option value="', $id, '">', $dir, '</option>'; |
140 | + } |
|
139 | 141 | |
140 | 142 | echo ' |
141 | 143 | </select> |
@@ -146,13 +148,14 @@ discard block |
||
146 | 148 | <option value="0">', $txt['attachment_transfer_auto_select'], '</option> |
147 | 149 | <option value="-1">', $txt['attachment_transfer_forum_root'], '</option>'; |
148 | 150 | |
149 | - if (!empty($context['base_dirs'])) |
|
150 | - foreach ($context['base_dirs'] as $id => $dir) |
|
151 | + if (!empty($context['base_dirs'])) { |
|
152 | + foreach ($context['base_dirs'] as $id => $dir) |
|
151 | 153 | echo ' |
152 | 154 | <option value="', $id, '">', $dir, '</option>'; |
153 | - else |
|
154 | - echo ' |
|
155 | + } else { |
|
156 | + echo ' |
|
155 | 157 | <option value="0" disabled>', $txt['attachment_transfer_no_base'], '</option>'; |
158 | + } |
|
156 | 159 | |
157 | 160 | echo ' |
158 | 161 | </select> |
@@ -162,18 +165,20 @@ discard block |
||
162 | 165 | <select name="to"> |
163 | 166 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
164 | 167 | |
165 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
166 | - echo ' |
|
168 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
169 | + echo ' |
|
167 | 170 | <option value="', $id, '">', $dir, '</option>'; |
171 | + } |
|
168 | 172 | |
169 | 173 | echo ' |
170 | 174 | </select> |
171 | 175 | </dd>'; |
172 | 176 | |
173 | - if (!empty($modSettings['attachmentDirFileLimit'])) |
|
174 | - echo ' |
|
177 | + if (!empty($modSettings['attachmentDirFileLimit'])) { |
|
178 | + echo ' |
|
175 | 179 | <dt>', $txt['attachment_transfer_empty'], '</dt> |
176 | 180 | <dd><input type="checkbox" name="empty_it"', $context['checked'] ? ' checked' : '', '></dd>'; |
181 | + } |
|
177 | 182 | |
178 | 183 | echo ' |
179 | 184 | </dl> |
@@ -209,8 +214,8 @@ discard block |
||
209 | 214 | global $context, $txt, $scripturl; |
210 | 215 | |
211 | 216 | // If we've completed just let them know! |
212 | - if ($context['completed']) |
|
213 | - echo ' |
|
217 | + if ($context['completed']) { |
|
218 | + echo ' |
|
214 | 219 | <div id="manage_attachments"> |
215 | 220 | <div class="cat_bar"> |
216 | 221 | <h3 class="catbg">', $txt['repair_attachments_complete'], '</h3> |
@@ -219,10 +224,11 @@ discard block |
||
219 | 224 | ', $txt['repair_attachments_complete_desc'], ' |
220 | 225 | </div> |
221 | 226 | </div>'; |
227 | + } |
|
222 | 228 | |
223 | 229 | // What about if no errors were even found? |
224 | - elseif (!$context['errors_found']) |
|
225 | - echo ' |
|
230 | + elseif (!$context['errors_found']) { |
|
231 | + echo ' |
|
226 | 232 | <div id="manage_attachments"> |
227 | 233 | <div class="cat_bar"> |
228 | 234 | <h3 class="catbg">', $txt['repair_attachments_complete'], '</h3> |
@@ -231,6 +237,7 @@ discard block |
||
231 | 237 | ', $txt['repair_attachments_no_errors'], ' |
232 | 238 | </div> |
233 | 239 | </div>'; |
240 | + } |
|
234 | 241 | |
235 | 242 | // Otherwise, I'm sad to say, we have a problem! |
236 | 243 | else |
@@ -245,11 +252,12 @@ discard block |
||
245 | 252 | <p>', $txt['repair_attachments_error_desc'], '</p>'; |
246 | 253 | |
247 | 254 | // Loop through each error reporting the status |
248 | - foreach ($context['repair_errors'] as $error => $number) |
|
249 | - if (!empty($number)) |
|
255 | + foreach ($context['repair_errors'] as $error => $number) { |
|
256 | + if (!empty($number)) |
|
250 | 257 | echo ' |
251 | 258 | <input type="checkbox" name="to_fix[]" id="', $error, '" value="', $error, '"> |
252 | 259 | <label for="', $error, '">', sprintf($txt['attach_repair_' . $error], $number), '</label><br>'; |
260 | + } |
|
253 | 261 | |
254 | 262 | echo ' |
255 | 263 | <br> |
@@ -268,8 +276,9 @@ discard block |
||
268 | 276 | { |
269 | 277 | global $modSettings; |
270 | 278 | |
271 | - if (!empty($modSettings['attachment_basedirectories'])) |
|
272 | - template_show_list('base_paths'); |
|
279 | + if (!empty($modSettings['attachment_basedirectories'])) { |
|
280 | + template_show_list('base_paths'); |
|
281 | + } |
|
273 | 282 | |
274 | 283 | template_show_list('attach_paths'); |
275 | 284 | } |
@@ -31,9 +31,10 @@ discard block |
||
31 | 31 | ', $txt['who_show1'], ' |
32 | 32 | <select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">'; |
33 | 33 | |
34 | - foreach ($context['show_methods'] as $value => $label) |
|
35 | - echo ' |
|
34 | + foreach ($context['show_methods'] as $value => $label) { |
|
35 | + echo ' |
|
36 | 36 | <option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>'; |
37 | + } |
|
37 | 38 | echo ' |
38 | 39 | </select> |
39 | 40 | <noscript> |
@@ -58,20 +59,22 @@ discard block |
||
58 | 59 | <td>'; |
59 | 60 | |
60 | 61 | // Guests can't be messaged. |
61 | - if (!$member['is_guest']) |
|
62 | - echo ' |
|
62 | + if (!$member['is_guest']) { |
|
63 | + echo ' |
|
63 | 64 | <span class="contact_info floatright"> |
64 | 65 | ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span>' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', ' |
65 | 66 | </span>'; |
67 | + } |
|
66 | 68 | |
67 | 69 | echo ' |
68 | 70 | <span class="member', $member['is_hidden'] ? ' hidden' : '', '"> |
69 | 71 | ', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt['profile_of'] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', ' |
70 | 72 | </span>'; |
71 | 73 | |
72 | - if (!empty($member['ip'])) |
|
73 | - echo ' |
|
74 | + if (!empty($member['ip'])) { |
|
75 | + echo ' |
|
74 | 76 | (<a href="' . $scripturl . '?action=', ($member['is_guest'] ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $member['id']), ';searchip=' . $member['ip'] . '">' . $member['ip'] . '</a>)'; |
77 | + } |
|
75 | 78 | |
76 | 79 | echo ' |
77 | 80 | </td> |
@@ -81,13 +84,14 @@ discard block |
||
81 | 84 | } |
82 | 85 | |
83 | 86 | // No members? |
84 | - if (empty($context['members'])) |
|
85 | - echo ' |
|
87 | + if (empty($context['members'])) { |
|
88 | + echo ' |
|
86 | 89 | <tr class="windowbg"> |
87 | 90 | <td colspan="3"> |
88 | 91 | ', $txt['who_no_online_' . ($context['show_by'] == 'guests' || $context['show_by'] == 'spiders' ? $context['show_by'] : 'members')], ' |
89 | 92 | </td> |
90 | 93 | </tr>'; |
94 | + } |
|
91 | 95 | |
92 | 96 | echo ' |
93 | 97 | </tbody> |
@@ -98,9 +102,10 @@ discard block |
||
98 | 102 | ', $txt['who_show1'], ' |
99 | 103 | <select name="show" onchange="document.forms.whoFilter.submit();">'; |
100 | 104 | |
101 | - foreach ($context['show_methods'] as $value => $label) |
|
102 | - echo ' |
|
105 | + foreach ($context['show_methods'] as $value => $label) { |
|
106 | + echo ' |
|
103 | 107 | <option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>'; |
108 | + } |
|
104 | 109 | echo ' |
105 | 110 | </select> |
106 | 111 | <noscript> |
@@ -129,17 +134,19 @@ discard block |
||
129 | 134 | |
130 | 135 | foreach ($context['credits'] as $section) |
131 | 136 | { |
132 | - if (isset($section['pretext'])) |
|
133 | - echo ' |
|
137 | + if (isset($section['pretext'])) { |
|
138 | + echo ' |
|
134 | 139 | <div class="windowbg"> |
135 | 140 | <p>', $section['pretext'], '</p> |
136 | 141 | </div>'; |
142 | + } |
|
137 | 143 | |
138 | - if (isset($section['title'])) |
|
139 | - echo ' |
|
144 | + if (isset($section['title'])) { |
|
145 | + echo ' |
|
140 | 146 | <div class="cat_bar"> |
141 | 147 | <h3 class="catbg">', $section['title'], '</h3> |
142 | 148 | </div>'; |
149 | + } |
|
143 | 150 | |
144 | 151 | echo ' |
145 | 152 | <div class="windowbg"> |
@@ -147,17 +154,18 @@ discard block |
||
147 | 154 | |
148 | 155 | foreach ($section['groups'] as $group) |
149 | 156 | { |
150 | - if (isset($group['title'])) |
|
151 | - echo ' |
|
157 | + if (isset($group['title'])) { |
|
158 | + echo ' |
|
152 | 159 | <dt> |
153 | 160 | <strong>', $group['title'], '</strong> |
154 | 161 | </dt> |
155 | 162 | <dd>'; |
163 | + } |
|
156 | 164 | |
157 | 165 | // Try to make this read nicely. |
158 | - if (count($group['members']) <= 2) |
|
159 | - echo implode(' ' . $txt['credits_and'] . ' ', $group['members']); |
|
160 | - else |
|
166 | + if (count($group['members']) <= 2) { |
|
167 | + echo implode(' ' . $txt['credits_and'] . ' ', $group['members']); |
|
168 | + } else |
|
161 | 169 | { |
162 | 170 | $last_peep = array_pop($group['members']); |
163 | 171 | echo implode(', ', $group['members']), ' ', $txt['credits_and'], ' ', $last_peep; |
@@ -170,9 +178,10 @@ discard block |
||
170 | 178 | echo ' |
171 | 179 | </dl>'; |
172 | 180 | |
173 | - if (isset($section['posttext'])) |
|
174 | - echo ' |
|
181 | + if (isset($section['posttext'])) { |
|
182 | + echo ' |
|
175 | 183 | <p class="posttext">', $section['posttext'], '</p>'; |
184 | + } |
|
176 | 185 | |
177 | 186 | echo ' |
178 | 187 | </div>'; |
@@ -187,26 +196,29 @@ discard block |
||
187 | 196 | </div> |
188 | 197 | <div class="windowbg">'; |
189 | 198 | |
190 | - if (!empty($context['credits_software_graphics']['graphics'])) |
|
191 | - echo ' |
|
199 | + if (!empty($context['credits_software_graphics']['graphics'])) { |
|
200 | + echo ' |
|
192 | 201 | <dl> |
193 | 202 | <dt><strong>', $txt['credits_graphics'], '</strong></dt> |
194 | 203 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['graphics']), '</dd> |
195 | 204 | </dl>'; |
205 | + } |
|
196 | 206 | |
197 | - if (!empty($context['credits_software_graphics']['software'])) |
|
198 | - echo ' |
|
207 | + if (!empty($context['credits_software_graphics']['software'])) { |
|
208 | + echo ' |
|
199 | 209 | <dl> |
200 | 210 | <dt><strong>', $txt['credits_software'], '</strong></dt> |
201 | 211 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['software']), '</dd> |
202 | 212 | </dl>'; |
213 | + } |
|
203 | 214 | |
204 | - if (!empty($context['credits_software_graphics']['fonts'])) |
|
205 | - echo ' |
|
215 | + if (!empty($context['credits_software_graphics']['fonts'])) { |
|
216 | + echo ' |
|
206 | 217 | <dl> |
207 | 218 | <dt><strong>', $txt['credits_fonts'], '</strong></dt> |
208 | 219 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['fonts']), '</dd> |
209 | 220 | </dl>'; |
221 | + } |
|
210 | 222 | echo ' |
211 | 223 | </div>'; |
212 | 224 | } |
@@ -222,14 +234,16 @@ discard block |
||
222 | 234 | <ul>'; |
223 | 235 | |
224 | 236 | // Display the credits. |
225 | - if (!empty($context['credits_modifications'])) |
|
226 | - echo ' |
|
237 | + if (!empty($context['credits_modifications'])) { |
|
238 | + echo ' |
|
227 | 239 | <li>', implode('</li><li>', $context['credits_modifications']), '</li>'; |
240 | + } |
|
228 | 241 | |
229 | 242 | // Legacy. |
230 | - if (!empty($context['copyrights']['mods'])) |
|
231 | - echo ' |
|
243 | + if (!empty($context['copyrights']['mods'])) { |
|
244 | + echo ' |
|
232 | 245 | <li>', implode('</li><li>', $context['copyrights']['mods']), '</li>'; |
246 | + } |
|
233 | 247 | |
234 | 248 | echo ' |
235 | 249 | </ul> |
@@ -54,18 +54,20 @@ discard block |
||
54 | 54 | <div class="windowbg" id="group_requests_panel"> |
55 | 55 | <ul>'; |
56 | 56 | |
57 | - foreach ($context['group_requests'] as $request) |
|
58 | - echo ' |
|
57 | + foreach ($context['group_requests'] as $request) { |
|
58 | + echo ' |
|
59 | 59 | <li class="smalltext"> |
60 | 60 | <a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], ' |
61 | 61 | </li>'; |
62 | + } |
|
62 | 63 | |
63 | 64 | // Don't have any watched users right now? |
64 | - if (empty($context['group_requests'])) |
|
65 | - echo ' |
|
65 | + if (empty($context['group_requests'])) { |
|
66 | + echo ' |
|
66 | 67 | <li> |
67 | 68 | <strong class="smalltext">', $txt['mc_group_requests_none'], '</strong> |
68 | 69 | </li>'; |
70 | + } |
|
69 | 71 | |
70 | 72 | echo ' |
71 | 73 | </ul> |
@@ -121,18 +123,20 @@ discard block |
||
121 | 123 | <div class="windowbg" id="watched_users_panel"> |
122 | 124 | <ul>'; |
123 | 125 | |
124 | - foreach ($context['watched_users'] as $user) |
|
125 | - echo ' |
|
126 | + foreach ($context['watched_users'] as $user) { |
|
127 | + echo ' |
|
126 | 128 | <li> |
127 | 129 | <span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span> |
128 | 130 | </li>'; |
131 | + } |
|
129 | 132 | |
130 | 133 | // Don't have any watched users right now? |
131 | - if (empty($context['watched_users'])) |
|
132 | - echo ' |
|
134 | + if (empty($context['watched_users'])) { |
|
135 | + echo ' |
|
133 | 136 | <li> |
134 | 137 | <strong class="smalltext">', $txt['mc_watched_users_none'], '</strong> |
135 | 138 | </li>'; |
139 | + } |
|
136 | 140 | |
137 | 141 | echo ' |
138 | 142 | </ul> |
@@ -188,18 +192,20 @@ discard block |
||
188 | 192 | <div class="windowbg" id="reported_posts_panel"> |
189 | 193 | <ul>'; |
190 | 194 | |
191 | - foreach ($context['reported_posts'] as $post) |
|
192 | - echo ' |
|
195 | + foreach ($context['reported_posts'] as $post) { |
|
196 | + echo ' |
|
193 | 197 | <li> |
194 | 198 | <span class="smalltext">', sprintf($txt['mc_post_report'], $post['report_link'], $post['author']['link']), '</span> |
195 | 199 | </li>'; |
200 | + } |
|
196 | 201 | |
197 | 202 | // Don't have any watched users right now? |
198 | - if (empty($context['reported_posts'])) |
|
199 | - echo ' |
|
203 | + if (empty($context['reported_posts'])) { |
|
204 | + echo ' |
|
200 | 205 | <li> |
201 | 206 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
202 | 207 | </li>'; |
208 | + } |
|
203 | 209 | |
204 | 210 | echo ' |
205 | 211 | </ul> |
@@ -255,18 +261,20 @@ discard block |
||
255 | 261 | <div class="windowbg" id="reported_users_panel"> |
256 | 262 | <ul>'; |
257 | 263 | |
258 | - foreach ($context['reported_users'] as $user) |
|
259 | - echo ' |
|
264 | + foreach ($context['reported_users'] as $user) { |
|
265 | + echo ' |
|
260 | 266 | <li> |
261 | 267 | <span class="smalltext">', $user['user']['link'], '</span> |
262 | 268 | </li>'; |
269 | + } |
|
263 | 270 | |
264 | 271 | // Don't have any watched users right now? |
265 | - if (empty($context['reported_users'])) |
|
266 | - echo ' |
|
272 | + if (empty($context['reported_users'])) { |
|
273 | + echo ' |
|
267 | 274 | <li> |
268 | 275 | <strong class="smalltext">', $txt['mc_reported_users_none'], '</strong> |
269 | 276 | </li>'; |
277 | + } |
|
270 | 278 | |
271 | 279 | echo ' |
272 | 280 | </ul> |
@@ -313,11 +321,12 @@ discard block |
||
313 | 321 | global $context, $txt, $scripturl; |
314 | 322 | |
315 | 323 | // Let them know the action was a success. |
316 | - if (!empty($context['report_post_action'])) |
|
317 | - echo ' |
|
324 | + if (!empty($context['report_post_action'])) { |
|
325 | + echo ' |
|
318 | 326 | <div class="infobox"> |
319 | 327 | ', $txt['report_action_' . $context['report_post_action']], ' |
320 | 328 | </div>'; |
329 | + } |
|
321 | 330 | |
322 | 331 | echo ' |
323 | 332 | <div id="modnotes"> |
@@ -333,11 +342,12 @@ discard block |
||
333 | 342 | <ul class="moderation_notes">'; |
334 | 343 | |
335 | 344 | // Cycle through the notes. |
336 | - foreach ($context['notes'] as $note) |
|
337 | - echo ' |
|
345 | + foreach ($context['notes'] as $note) { |
|
346 | + echo ' |
|
338 | 347 | <li class="smalltext"> |
339 | 348 | ', ($note['can_delete'] ? '<a href="' . $note['delete_href'] . ';' . $context['mod-modnote-del_token_var'] . '=' . $context['mod-modnote-del_token'] . '" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'], ' <strong>', $note['author']['link'], ':</strong> ', $note['text'], ' |
340 | 349 | </li>'; |
350 | + } |
|
341 | 351 | |
342 | 352 | echo ' |
343 | 353 | </ul> |
@@ -378,18 +388,19 @@ discard block |
||
378 | 388 | $remove_button = create_button('delete', 'remove_message', 'remove'); |
379 | 389 | |
380 | 390 | // No posts? |
381 | - if (empty($context['unapproved_items'])) |
|
382 | - echo ' |
|
391 | + if (empty($context['unapproved_items'])) { |
|
392 | + echo ' |
|
383 | 393 | <div class="windowbg"> |
384 | 394 | <p class="centertext"> |
385 | 395 | ', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], ' |
386 | 396 | </p> |
387 | 397 | </div>'; |
388 | - else |
|
389 | - echo ' |
|
398 | + } else { |
|
399 | + echo ' |
|
390 | 400 | <div class="pagesection floatleft"> |
391 | 401 | ', $context['page_index'], ' |
392 | 402 | </div>'; |
403 | + } |
|
393 | 404 | |
394 | 405 | foreach ($context['unapproved_items'] as $item) |
395 | 406 | { |
@@ -408,14 +419,16 @@ discard block |
||
408 | 419 | <span class="floatright"> |
409 | 420 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';approve=', $item['id'], '">', $approve_button, '</a>'; |
410 | 421 | |
411 | - if ($item['can_delete']) |
|
412 | - echo ' |
|
422 | + if ($item['can_delete']) { |
|
423 | + echo ' |
|
413 | 424 | ', $context['menu_separator'], ' |
414 | 425 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';delete=', $item['id'], '">', $remove_button, '</a>'; |
426 | + } |
|
415 | 427 | |
416 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
417 | - echo ' |
|
428 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
429 | + echo ' |
|
418 | 430 | <input type="checkbox" name="item[]" value="', $item['id'], '" checked> '; |
431 | + } |
|
419 | 432 | |
420 | 433 | echo ' |
421 | 434 | </span> |
@@ -425,8 +438,8 @@ discard block |
||
425 | 438 | echo ' |
426 | 439 | <div class="pagesection">'; |
427 | 440 | |
428 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
429 | - echo ' |
|
441 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
442 | + echo ' |
|
430 | 443 | <div class="floatright"> |
431 | 444 | <select name="do" onchange="if (this.value != 0 && confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();"> |
432 | 445 | <option value="0">', $txt['with_selected'], ':</option> |
@@ -438,12 +451,14 @@ discard block |
||
438 | 451 | <input type="submit" name="mc_go" value="', $txt['go'], '" class="button"> |
439 | 452 | </noscript> |
440 | 453 | </div>'; |
454 | + } |
|
441 | 455 | |
442 | - if (!empty($context['unapproved_items'])) |
|
443 | - echo ' |
|
456 | + if (!empty($context['unapproved_items'])) { |
|
457 | + echo ' |
|
444 | 458 | <div class="floatleft"> |
445 | 459 | <div class="pagelinks">', $context['page_index'], '</div> |
446 | 460 | </div>'; |
461 | + } |
|
447 | 462 | |
448 | 463 | echo ' |
449 | 464 | </div><!-- .pagesection --> |
@@ -464,8 +479,9 @@ discard block |
||
464 | 479 | |
465 | 480 | // We'll have a delete please bob. |
466 | 481 | // @todo Discuss this with the team and rewrite if required. |
467 | - if (empty($delete_button)) |
|
468 | - $delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"'); |
|
482 | + if (empty($delete_button)) { |
|
483 | + $delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"'); |
|
484 | + } |
|
469 | 485 | |
470 | 486 | $output_html = ' |
471 | 487 | <div> |
@@ -474,10 +490,11 @@ discard block |
||
474 | 490 | </div> |
475 | 491 | <div class="floatright">'; |
476 | 492 | |
477 | - if ($post['can_delete']) |
|
478 | - $output_html .= ' |
|
493 | + if ($post['can_delete']) { |
|
494 | + $output_html .= ' |
|
479 | 495 | <a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="' . $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a> |
480 | 496 | <input type="checkbox" name="delete[]" value="' . $post['id'] . '">'; |
497 | + } |
|
481 | 498 | |
482 | 499 | $output_html .= ' |
483 | 500 | </div> |
@@ -521,12 +538,12 @@ discard block |
||
521 | 538 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
522 | 539 | </div> |
523 | 540 | </form>'; |
524 | - } |
|
525 | - else |
|
526 | - echo ' |
|
541 | + } else { |
|
542 | + echo ' |
|
527 | 543 | <div class="windowbg"> |
528 | 544 | <div class="centertext">', $txt['mc_no_settings'], '</div> |
529 | 545 | </div>'; |
546 | + } |
|
530 | 547 | |
531 | 548 | echo ' |
532 | 549 | </div><!-- #modcenter -->'; |
@@ -622,13 +639,14 @@ discard block |
||
622 | 639 | </dd> |
623 | 640 | </dl>'; |
624 | 641 | |
625 | - if ($context['template_data']['can_edit_personal']) |
|
626 | - echo ' |
|
642 | + if ($context['template_data']['can_edit_personal']) { |
|
643 | + echo ' |
|
627 | 644 | <input type="checkbox" name="make_personal" id="make_personal"', $context['template_data']['personal'] ? ' checked' : '', '> |
628 | 645 | <label for="make_personal"> |
629 | 646 | <strong>', $txt['mc_warning_template_personal'], '</strong> |
630 | 647 | </label> |
631 | 648 | <p class="smalltext">', $txt['mc_warning_template_personal_desc'], '</p>'; |
649 | + } |
|
632 | 650 | |
633 | 651 | echo ' |
634 | 652 | <input type="submit" name="preview" id="preview_button" value="', $txt['preview'], '" class="button"> |