Completed
Push — release-2.1 ( ea440e...a0999c )
by Mathias
18:38
created
Sources/RepairBoards.php 2 patches
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 					LEFT JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
233 233
 				WHERE t.id_topic IS NULL
234 234
 				GROUP BY m.id_topic, m.id_board',
235
-			'fix_processing' => function ($row) use ($smcFunc)
235
+			'fix_processing' => function($row) use ($smcFunc)
236 236
 			{
237 237
 				global $salvageBoardID;
238 238
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 			// Remove all topics that have zero messages in the messages table.
319 319
 			'fix_collect' => array(
320 320
 				'index' => 'id_topic',
321
-				'process' => function ($topics) use ($smcFunc)
321
+				'process' => function($topics) use ($smcFunc)
322 322
 				{
323 323
 					$smcFunc['db_query']('', '
324 324
 						DELETE FROM {db_prefix}topics
@@ -356,21 +356,21 @@  discard block
 block discarded – undo
356 356
 				  AND p.id_poll IS NULL
357 357
 				GROUP BY o.id_poll, t.id_topic, t.id_board, t.id_member_started, m.member_name
358 358
 				  ',
359
-			'fix_processing' => function ($row) use ($smcFunc, $txt)
359
+			'fix_processing' => function($row) use ($smcFunc, $txt)
360 360
 			{
361 361
 				global $salvageBoardID;
362 362
 
363 363
 				$row['poster_name'] = !empty($row['poster_name']) ? $row['poster_name'] : $txt['guest'];
364 364
 				$row['id_poster'] = !empty($row['id_poster']) ? $row['id_poster'] : 0;
365 365
 
366
-				if(empty($row['id_board']))
366
+				if (empty($row['id_board']))
367 367
 				{
368 368
 					// Only if we don't have a reasonable idea of where to put it.
369 369
 					createSalvageArea();
370
-					$row['id_board'] = (int)$salvageBoardID;
370
+					$row['id_board'] = (int) $salvageBoardID;
371 371
 				}
372 372
 
373
-				if(empty($row['id_topic'])) {
373
+				if (empty($row['id_topic'])) {
374 374
 					$newMessageID = $smcFunc['db_insert']('',
375 375
 						'{db_prefix}messages',
376 376
 						array(
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 					LEFT JOIN {db_prefix}topics AS t ON (t.id_poll = p.id_poll)
493 493
 				WHERE p.id_poll BETWEEN {STEP_LOW} AND {STEP_HIGH}
494 494
 					AND t.id_poll IS NULL',
495
-			'fix_processing' => function ($row) use ($smcFunc, $txt)
495
+			'fix_processing' => function($row) use ($smcFunc, $txt)
496 496
 			{
497 497
 				global $salvageBoardID;
498 498
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
606 606
 				GROUP BY t.id_topic, t.id_first_msg, t.id_last_msg, t.approved, mf.approved
607 607
 				ORDER BY t.id_topic',
608
-			'fix_processing' => function ($row) use ($smcFunc)
608
+			'fix_processing' => function($row) use ($smcFunc)
609 609
 			{
610 610
 				$row['firstmsg_approved'] = (int) $row['firstmsg_approved'];
611 611
 				$row['myid_first_msg'] = (int) $row['myid_first_msg'];
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 					)
635 635
 				);
636 636
 			},
637
-			'message_function' => function ($row) use ($txt, &$context)
637
+			'message_function' => function($row) use ($txt, &$context)
638 638
 			{
639 639
 				// A pretend error?
640 640
 				if ($row['id_first_msg'] == $row['myid_first_msg'] && $row['id_last_msg'] == $row['myid_last_msg'] && $row['approved'] == $row['firstmsg_approved'])
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
669 669
 				GROUP BY t.id_topic, t.num_replies, mf.approved
670 670
 				ORDER BY t.id_topic',
671
-			'fix_processing' => function ($row)
671
+			'fix_processing' => function($row)
672 672
 		{
673 673
 
674 674
 				global $smcFunc;
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 				);
690 690
 
691 691
 		},
692
-			'message_function' => function ($row)
692
+			'message_function' => function($row)
693 693
 		{
694 694
 
695 695
 				global $txt, $context;
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 				GROUP BY t.id_topic, t.unapproved_posts
723 723
 				HAVING unapproved_posts != COUNT(mu.id_msg)
724 724
 				ORDER BY t.id_topic',
725
-			'fix_processing' => function ($row)
725
+			'fix_processing' => function($row)
726 726
 		{
727 727
 
728 728
 				global $smcFunc;
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 				WHERE b.id_board IS NULL
765 765
 					AND t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
766 766
 				GROUP BY t.id_board',
767
-			'fix_processing' => function ($row)
767
+			'fix_processing' => function($row)
768 768
 		{
769 769
 
770 770
 				global $smcFunc, $salvageCatID, $txt;
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 				ORDER BY b.id_cat, b.id_board',
814 814
 			'fix_collect' => array(
815 815
 				'index' => 'id_cat',
816
-				'process' => function ($cats)
816
+				'process' => function($cats)
817 817
 				{
818 818
 					global $smcFunc, $salvageCatID;
819 819
 					createSalvageArea();
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
 			// Last step-make sure all non-guest posters still exist.
850 850
 			'fix_collect' => array(
851 851
 				'index' => 'id_msg',
852
-				'process' => function ($msgs)
852
+				'process' => function($msgs)
853 853
 		{
854 854
 
855 855
 					global $smcFunc;
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 				ORDER BY b.id_parent, b.id_board',
879 879
 			'fix_collect' => array(
880 880
 				'index' => 'id_parent',
881
-				'process' => function ($parents)
881
+				'process' => function($parents)
882 882
 				{
883 883
 					global $smcFunc, $salvageBoardID, $salvageCatID;
884 884
 					createSalvageArea();
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 					AND p.id_poll IS NULL',
913 913
 			'fix_collect' => array(
914 914
 				'index' => 'id_poll',
915
-				'process' => function ($polls)
915
+				'process' => function($polls)
916 916
 		{
917 917
 
918 918
 					global $smcFunc;
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 				ORDER BY cal.id_topic',
947 947
 			'fix_collect' => array(
948 948
 				'index' => 'id_topic',
949
-				'process' => function ($events)
949
+				'process' => function($events)
950 950
 		{
951 951
 
952 952
 					global $smcFunc;
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
 					AND lt.id_member BETWEEN {STEP_LOW} AND {STEP_HIGH}',
979 979
 			'fix_collect' => array(
980 980
 				'index' => 'id_topic',
981
-				'process' => function ($topics)
981
+				'process' => function($topics)
982 982
 		{
983 983
 
984 984
 					global $smcFunc;
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 				GROUP BY lt.id_member',
1011 1011
 			'fix_collect' => array(
1012 1012
 				'index' => 'id_member',
1013
-				'process' => function ($members)
1013
+				'process' => function($members)
1014 1014
 		{
1015 1015
 
1016 1016
 					global $smcFunc;
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 				GROUP BY lb.id_board',
1043 1043
 			'fix_collect' => array(
1044 1044
 				'index' => 'id_board',
1045
-				'process' => function ($boards)
1045
+				'process' => function($boards)
1046 1046
 		{
1047 1047
 
1048 1048
 					global $smcFunc;
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 				GROUP BY lb.id_member',
1075 1075
 			'fix_collect' => array(
1076 1076
 				'index' => 'id_member',
1077
-				'process' => function ($members) use ($smcFunc)
1077
+				'process' => function($members) use ($smcFunc)
1078 1078
 				{
1079 1079
 					$smcFunc['db_query']('', '
1080 1080
 						DELETE FROM {db_prefix}log_boards
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 				GROUP BY lmr.id_board',
1104 1104
 			'fix_collect' => array(
1105 1105
 				'index' => 'id_board',
1106
-				'process' => function ($boards) use ($smcFunc)
1106
+				'process' => function($boards) use ($smcFunc)
1107 1107
 				{
1108 1108
 					$smcFunc['db_query']('', '
1109 1109
 						DELETE FROM {db_prefix}log_mark_read
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 				GROUP BY lmr.id_member',
1133 1133
 			'fix_collect' => array(
1134 1134
 				'index' => 'id_member',
1135
-				'process' => function ($members) use ($smcFunc)
1135
+				'process' => function($members) use ($smcFunc)
1136 1136
 				{
1137 1137
 					$smcFunc['db_query']('', '
1138 1138
 						DELETE FROM {db_prefix}log_mark_read
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 				GROUP BY pmr.id_pm',
1162 1162
 			'fix_collect' => array(
1163 1163
 				'index' => 'id_pm',
1164
-				'process' => function ($pms) use ($smcFunc)
1164
+				'process' => function($pms) use ($smcFunc)
1165 1165
 				{
1166 1166
 					$smcFunc['db_query']('', '
1167 1167
 						DELETE FROM {db_prefix}pm_recipients
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 				GROUP BY pmr.id_member',
1192 1192
 			'fix_collect' => array(
1193 1193
 				'index' => 'id_member',
1194
-				'process' => function ($members)
1194
+				'process' => function($members)
1195 1195
 		{
1196 1196
 
1197 1197
 					global $smcFunc;
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 					AND mem.id_member IS NULL',
1224 1224
 			'fix_collect' => array(
1225 1225
 				'index' => 'id_pm',
1226
-				'process' => function ($guestMessages)
1226
+				'process' => function($guestMessages)
1227 1227
 		{
1228 1228
 
1229 1229
 					global $smcFunc;
@@ -1255,7 +1255,7 @@  discard block
 block discarded – undo
1255 1255
 				GROUP BY ln.id_member',
1256 1256
 			'fix_collect' => array(
1257 1257
 				'index' => 'id_member',
1258
-				'process' => function ($members) use ($smcFunc)
1258
+				'process' => function($members) use ($smcFunc)
1259 1259
 				{
1260 1260
 					$smcFunc['db_query']('', '
1261 1261
 						DELETE FROM {db_prefix}log_notify
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
 					LEFT JOIN {db_prefix}log_search_subjects AS lss ON (lss.id_topic = t.id_topic)
1283 1283
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
1284 1284
 					AND lss.id_topic IS NULL',
1285
-			'fix_full_processing' => function ($result)
1285
+			'fix_full_processing' => function($result)
1286 1286
 		{
1287 1287
 
1288 1288
 				global $smcFunc;
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
 					);
1315 1315
 
1316 1316
 		},
1317
-			'message_function' => function ($row)
1317
+			'message_function' => function($row)
1318 1318
 		{
1319 1319
 
1320 1320
 				global $txt, $context;
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 					AND t.id_topic IS NULL',
1345 1345
 			'fix_collect' => array(
1346 1346
 				'index' => 'id_topic',
1347
-				'process' => function ($deleteTopics)
1347
+				'process' => function($deleteTopics)
1348 1348
 		{
1349 1349
 
1350 1350
 					global $smcFunc;
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 					AND mem.id_member IS NULL',
1377 1377
 			'fix_collect' => array(
1378 1378
 				'index' => 'id_member',
1379
-				'process' => function ($members)
1379
+				'process' => function($members)
1380 1380
 		{
1381 1381
 
1382 1382
 					global $smcFunc;
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 					AND p.id_poll IS NULL',
1408 1408
 			'fix_collect' => array(
1409 1409
 				'index' => 'id_poll',
1410
-				'process' => function ($polls)
1410
+				'process' => function($polls)
1411 1411
 		{
1412 1412
 
1413 1413
 					global $smcFunc;
@@ -1438,7 +1438,7 @@  discard block
 block discarded – undo
1438 1438
 					AND lrc.id_report IS NULL',
1439 1439
 			'fix_collect' => array(
1440 1440
 				'index' => 'id_report',
1441
-				'process' => function ($reports)
1441
+				'process' => function($reports)
1442 1442
 		{
1443 1443
 
1444 1444
 					global $smcFunc;
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
 					AND lr.id_report IS NULL',
1470 1470
 			'fix_collect' => array(
1471 1471
 				'index' => 'id_report',
1472
-				'process' => function ($reports)
1472
+				'process' => function($reports)
1473 1473
 				{
1474 1474
 					global $smcFunc;
1475 1475
 					$smcFunc['db_query']('', '
@@ -1499,7 +1499,7 @@  discard block
 block discarded – undo
1499 1499
 				GROUP BY lgr.id_member',
1500 1500
 			'fix_collect' => array(
1501 1501
 				'index' => 'id_member',
1502
-				'process' => function ($members)
1502
+				'process' => function($members)
1503 1503
 				{
1504 1504
 					global $smcFunc;
1505 1505
 					$smcFunc['db_query']('', '
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 				GROUP BY lgr.id_group',
1530 1530
 			'fix_collect' => array(
1531 1531
 				'index' => 'id_group',
1532
-				'process' => function ($groups)
1532
+				'process' => function($groups)
1533 1533
 				{
1534 1534
 					global $smcFunc;
1535 1535
 					$smcFunc['db_query']('', '
Please login to merge, or discard this patch.
Braces   +119 added lines, -85 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@  discard block
 block discarded – undo
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
  * Finds or repairs errors in the database to fix possible problems.
@@ -50,8 +51,9 @@  discard block
 block discarded – undo
50 51
 	);
51 52
 
52 53
 	// Start displaying errors without fixing them.
53
-	if (isset($_GET['fixErrors']))
54
-		checkSession('get');
54
+	if (isset($_GET['fixErrors'])) {
55
+			checkSession('get');
56
+	}
55 57
 
56 58
 	// Will want this.
57 59
 	loadForumTests();
@@ -69,11 +71,11 @@  discard block
 block discarded – undo
69 71
 			$_SESSION['repairboards_to_fix'] = $context['to_fix'];
70 72
 			$_SESSION['repairboards_to_fix2'] = null;
71 73
 
72
-			if (empty($context['repair_errors']))
73
-				$context['repair_errors'][] = '???';
74
+			if (empty($context['repair_errors'])) {
75
+							$context['repair_errors'][] = '???';
76
+			}
74 77
 		}
75
-	}
76
-	else
78
+	} else
77 79
 	{
78 80
 		$context['error_search'] = false;
79 81
 		$context['to_fix'] = isset($_SESSION['repairboards_to_fix']) ? $_SESSION['repairboards_to_fix'] : array();
@@ -120,16 +122,19 @@  discard block
 block discarded – undo
120 122
 
121 123
 	// More time, I need more time!
122 124
 	@set_time_limit(600);
123
-	if (function_exists('apache_reset_timeout'))
124
-		@apache_reset_timeout();
125
+	if (function_exists('apache_reset_timeout')) {
126
+			@apache_reset_timeout();
127
+	}
125 128
 
126 129
 	// Errr, wait.  How much time has this taken already?
127
-	if (!$force && (time() - $time_start) < 3)
128
-		return;
130
+	if (!$force && (time() - $time_start) < 3) {
131
+			return;
132
+	}
129 133
 
130 134
 	// Restore the query cache if interested.
131
-	if (!empty($db_temp_cache))
132
-		$db_cache = $db_temp_cache;
135
+	if (!empty($db_temp_cache)) {
136
+			$db_cache = $db_temp_cache;
137
+	}
133 138
 
134 139
 	$context['continue_get_data'] = '?action=admin;area=repairboards' . (isset($_GET['fixErrors']) ? ';fixErrors' : '') . ';step=' . $_GET['step'] . ';substep=' . $_GET['substep'] . ';' . $context['session_var'] . '=' . $context['session_id'];
135 140
 	$context['page_title'] = $txt['not_done_title'];
@@ -138,10 +143,11 @@  discard block
 block discarded – undo
138 143
 	$context['sub_template'] = 'not_done';
139 144
 
140 145
 	// Change these two if more steps are added!
141
-	if (empty($max_substep))
142
-		$context['continue_percent'] = round(($_GET['step'] * 100) / $context['total_steps']);
143
-	else
144
-		$context['continue_percent'] = round((($_GET['step'] + ($_GET['substep'] / $max_substep)) * 100) / $context['total_steps']);
146
+	if (empty($max_substep)) {
147
+			$context['continue_percent'] = round(($_GET['step'] * 100) / $context['total_steps']);
148
+	} else {
149
+			$context['continue_percent'] = round((($_GET['step'] + ($_GET['substep'] / $max_substep)) * 100) / $context['total_steps']);
150
+	}
145 151
 
146 152
 	// Never more than 100%!
147 153
 	$context['continue_percent'] = min($context['continue_percent'], 100);
@@ -612,8 +618,9 @@  discard block
 block discarded – undo
612 618
 				$row['myid_last_msg'] = (int) $row['myid_last_msg'];
613 619
 
614 620
 				// Not really a problem?
615
-				if ($row['id_first_msg'] == $row['myid_first_msg'] && $row['id_last_msg'] == $row['myid_last_msg'] && $row['approved'] == $row['firstmsg_approved'])
616
-					return false;
621
+				if ($row['id_first_msg'] == $row['myid_first_msg'] && $row['id_last_msg'] == $row['myid_last_msg'] && $row['approved'] == $row['firstmsg_approved']) {
622
+									return false;
623
+				}
617 624
 
618 625
 				$memberStartedID = (int) getMsgMemberID($row['myid_first_msg']);
619 626
 				$memberUpdatedID = (int) getMsgMemberID($row['myid_last_msg']);
@@ -637,15 +644,19 @@  discard block
 block discarded – undo
637 644
 			'message_function' => function ($row) use ($txt, &$context)
638 645
 			{
639 646
 				// A pretend error?
640
-				if ($row['id_first_msg'] == $row['myid_first_msg'] && $row['id_last_msg'] == $row['myid_last_msg'] && $row['approved'] == $row['firstmsg_approved'])
641
-					return false;
647
+				if ($row['id_first_msg'] == $row['myid_first_msg'] && $row['id_last_msg'] == $row['myid_last_msg'] && $row['approved'] == $row['firstmsg_approved']) {
648
+									return false;
649
+				}
642 650
 
643
-				if ($row['id_first_msg'] != $row['myid_first_msg'])
644
-					$context['repair_errors'][] = sprintf($txt['repair_stats_topics_1'], $row['id_topic'], $row['id_first_msg']);
645
-				if ($row['id_last_msg'] != $row['myid_last_msg'])
646
-					$context['repair_errors'][] = sprintf($txt['repair_stats_topics_2'], $row['id_topic'], $row['id_last_msg']);
647
-				if ($row['approved'] != $row['firstmsg_approved'])
648
-					$context['repair_errors'][] = sprintf($txt['repair_stats_topics_5'], $row['id_topic']);
651
+				if ($row['id_first_msg'] != $row['myid_first_msg']) {
652
+									$context['repair_errors'][] = sprintf($txt['repair_stats_topics_1'], $row['id_topic'], $row['id_first_msg']);
653
+				}
654
+				if ($row['id_last_msg'] != $row['myid_last_msg']) {
655
+									$context['repair_errors'][] = sprintf($txt['repair_stats_topics_2'], $row['id_topic'], $row['id_last_msg']);
656
+				}
657
+				if ($row['approved'] != $row['firstmsg_approved']) {
658
+									$context['repair_errors'][] = sprintf($txt['repair_stats_topics_5'], $row['id_topic']);
659
+				}
649 660
 
650 661
 				return true;
651 662
 			},
@@ -675,8 +686,9 @@  discard block
 block discarded – undo
675 686
 				$row['my_num_replies'] = (int) $row['my_num_replies'];
676 687
 
677 688
 				// Not really a problem?
678
-				if ($row['my_num_replies'] == $row['num_replies'])
679
-					return false;
689
+				if ($row['my_num_replies'] == $row['num_replies']) {
690
+									return false;
691
+				}
680 692
 
681 693
 				$smcFunc['db_query']('', '
682 694
 					UPDATE {db_prefix}topics
@@ -695,11 +707,13 @@  discard block
 block discarded – undo
695 707
 				global $txt, $context;
696 708
 
697 709
 				// Just joking?
698
-				if ($row['my_num_replies'] == $row['num_replies'])
699
-					return false;
710
+				if ($row['my_num_replies'] == $row['num_replies']) {
711
+									return false;
712
+				}
700 713
 
701
-				if ($row['num_replies'] != $row['my_num_replies'])
702
-					$context['repair_errors'][] = sprintf($txt['repair_stats_topics_3'], $row['id_topic'], $row['num_replies']);
714
+				if ($row['num_replies'] != $row['my_num_replies']) {
715
+									$context['repair_errors'][] = sprintf($txt['repair_stats_topics_3'], $row['id_topic'], $row['num_replies']);
716
+				}
703 717
 
704 718
 				return true;
705 719
 
@@ -1290,8 +1304,9 @@  discard block
 block discarded – undo
1290 1304
 				$inserts = array();
1291 1305
 				while ($row = $smcFunc['db_fetch_assoc']($result))
1292 1306
 				{
1293
-					foreach (text2words($row['subject']) as $word)
1294
-						$inserts[] = array($word, $row['id_topic']);
1307
+					foreach (text2words($row['subject']) as $word) {
1308
+											$inserts[] = array($word, $row['id_topic']);
1309
+					}
1295 1310
 					if (count($inserts) > 500)
1296 1311
 					{
1297 1312
 						$smcFunc['db_insert']('ignore',
@@ -1305,13 +1320,14 @@  discard block
 block discarded – undo
1305 1320
 
1306 1321
 				}
1307 1322
 
1308
-				if (!empty($inserts))
1309
-					$smcFunc['db_insert']('ignore',
1323
+				if (!empty($inserts)) {
1324
+									$smcFunc['db_insert']('ignore',
1310 1325
 						'{db_prefix}log_search_subjects',
1311 1326
 						array('word' => 'string', 'id_topic' => 'int'),
1312 1327
 						$inserts,
1313 1328
 						array('word', 'id_topic')
1314 1329
 					);
1330
+				}
1315 1331
 
1316 1332
 		},
1317 1333
 			'message_function' => function ($row)
@@ -1581,8 +1597,9 @@  discard block
 block discarded – undo
1581 1597
 		$current_step++;
1582 1598
 
1583 1599
 		// Already done this?
1584
-		if ($_GET['step'] > $current_step)
1585
-			continue;
1600
+		if ($_GET['step'] > $current_step) {
1601
+					continue;
1602
+		}
1586 1603
 
1587 1604
 		// If we're fixing it but it ain't broke why try?
1588 1605
 		if ($do_fix && !in_array($error_type, $to_fix))
@@ -1611,14 +1628,16 @@  discard block
 block discarded – undo
1611 1628
 		while (!$done)
1612 1629
 		{
1613 1630
 			// Make sure there's at least one ID to test.
1614
-			if (isset($test['substeps']) && empty($step_max))
1615
-				break;
1631
+			if (isset($test['substeps']) && empty($step_max)) {
1632
+							break;
1633
+			}
1616 1634
 
1617 1635
 			// What is the testing query (Changes if we are testing or fixing)
1618
-			if (!$do_fix)
1619
-				$test_query = 'check_query';
1620
-			else
1621
-				$test_query = isset($test['fix_query']) ? 'fix_query' : 'check_query';
1636
+			if (!$do_fix) {
1637
+							$test_query = 'check_query';
1638
+			} else {
1639
+							$test_query = isset($test['fix_query']) ? 'fix_query' : 'check_query';
1640
+			}
1622 1641
 
1623 1642
 			// Do the test...
1624 1643
 			$request = $smcFunc['db_query']('',
@@ -1628,10 +1647,11 @@  discard block
 block discarded – undo
1628 1647
 			);
1629 1648
 
1630 1649
 			// Does it need a fix?
1631
-			if (!empty($test['check_type']) && $test['check_type'] == 'count')
1632
-				list ($needs_fix) = $smcFunc['db_fetch_row']($request);
1633
-			else
1634
-				$needs_fix = $smcFunc['db_num_rows']($request);
1650
+			if (!empty($test['check_type']) && $test['check_type'] == 'count') {
1651
+							list ($needs_fix) = $smcFunc['db_fetch_row']($request);
1652
+			} else {
1653
+							$needs_fix = $smcFunc['db_num_rows']($request);
1654
+			}
1635 1655
 
1636 1656
 			$total_queries++;
1637 1657
 
@@ -1643,8 +1663,9 @@  discard block
 block discarded – undo
1643 1663
 					// Assume need to fix.
1644 1664
 					$found_errors = true;
1645 1665
 
1646
-					if (isset($test['message']))
1647
-						$context['repair_errors'][] = $txt[$test['message']];
1666
+					if (isset($test['message'])) {
1667
+											$context['repair_errors'][] = $txt[$test['message']];
1668
+					}
1648 1669
 
1649 1670
 					// One per row!
1650 1671
 					elseif (isset($test['messages']))
@@ -1654,10 +1675,11 @@  discard block
 block discarded – undo
1654 1675
 							$variables = $test['messages'];
1655 1676
 							foreach ($variables as $k => $v)
1656 1677
 							{
1657
-								if ($k == 0 && isset($txt[$v]))
1658
-									$variables[$k] = $txt[$v];
1659
-								elseif ($k > 0 && isset($row[$v]))
1660
-									$variables[$k] = $row[$v];
1678
+								if ($k == 0 && isset($txt[$v])) {
1679
+																	$variables[$k] = $txt[$v];
1680
+								} elseif ($k > 0 && isset($row[$v])) {
1681
+																	$variables[$k] = $row[$v];
1682
+								}
1661 1683
 							}
1662 1684
 							$context['repair_errors'][] = call_user_func_array('sprintf', $variables);
1663 1685
 						}
@@ -1668,13 +1690,15 @@  discard block
 block discarded – undo
1668 1690
 					{
1669 1691
 						// Find out if there are actually errors.
1670 1692
 						$found_errors = false;
1671
-						while ($row = $smcFunc['db_fetch_assoc']($request))
1672
-							$found_errors |= $test['message_function']($row);
1693
+						while ($row = $smcFunc['db_fetch_assoc']($request)) {
1694
+													$found_errors |= $test['message_function']($row);
1695
+						}
1673 1696
 					}
1674 1697
 
1675 1698
 					// Actually have something to fix?
1676
-					if ($found_errors)
1677
-						$to_fix[] = $error_type;
1699
+					if ($found_errors) {
1700
+											$to_fix[] = $error_type;
1701
+					}
1678 1702
 				}
1679 1703
 
1680 1704
 				// We want to fix, we need to fix - so work out what exactly to do!
@@ -1684,8 +1708,9 @@  discard block
 block discarded – undo
1684 1708
 					if (isset($test['fix_collect']))
1685 1709
 					{
1686 1710
 						$ids = array();
1687
-						while ($row = $smcFunc['db_fetch_assoc']($request))
1688
-							$ids[] = $row[$test['fix_collect']['index']];
1711
+						while ($row = $smcFunc['db_fetch_assoc']($request)) {
1712
+													$ids[] = $row[$test['fix_collect']['index']];
1713
+						}
1689 1714
 						if (!empty($ids))
1690 1715
 						{
1691 1716
 							// Fix it!
@@ -1694,30 +1719,34 @@  discard block
 block discarded – undo
1694 1719
 					}
1695 1720
 
1696 1721
 					// Simply executing a fix it query?
1697
-					elseif (isset($test['fix_it_query']))
1698
-						$smcFunc['db_query']('',
1722
+					elseif (isset($test['fix_it_query'])) {
1723
+											$smcFunc['db_query']('',
1699 1724
 							$test['fix_it_query'],
1700 1725
 							array(
1701 1726
 							)
1702 1727
 						);
1728
+					}
1703 1729
 
1704 1730
 					// Do we have some processing to do?
1705 1731
 					elseif (isset($test['fix_processing']))
1706 1732
 					{
1707
-						while ($row = $smcFunc['db_fetch_assoc']($request))
1708
-							$test['fix_processing']($row);
1733
+						while ($row = $smcFunc['db_fetch_assoc']($request)) {
1734
+													$test['fix_processing']($row);
1735
+						}
1709 1736
 					}
1710 1737
 
1711 1738
 					// What about the full set of processing?
1712
-					elseif (isset($test['fix_full_processing']))
1713
-						$test['fix_full_processing']($request);
1739
+					elseif (isset($test['fix_full_processing'])) {
1740
+											$test['fix_full_processing']($request);
1741
+					}
1714 1742
 
1715 1743
 					// Do we have other things we need to fix as a result?
1716 1744
 					if (!empty($test['force_fix']))
1717 1745
 					{
1718
-						foreach ($test['force_fix'] as $item)
1719
-							if (!in_array($item, $to_fix))
1746
+						foreach ($test['force_fix'] as $item) {
1747
+													if (!in_array($item, $to_fix))
1720 1748
 								$to_fix[] = $item;
1749
+						}
1721 1750
 					}
1722 1751
 				}
1723 1752
 			}
@@ -1735,16 +1764,17 @@  discard block
 block discarded – undo
1735 1764
 				if ($_GET['substep'] <= $step_max)
1736 1765
 				{
1737 1766
 					pauseRepairProcess($to_fix, $error_type, $step_max);
1767
+				} else {
1768
+									$done = true;
1738 1769
 				}
1739
-				else
1740
-					$done = true;
1770
+			} else {
1771
+							$done = true;
1741 1772
 			}
1742
-			else
1743
-				$done = true;
1744 1773
 
1745 1774
 			// Don't allow more than 1000 queries at a time.
1746
-			if ($total_queries >= 1000)
1747
-				pauseRepairProcess($to_fix, $error_type, $step_max, true);
1775
+			if ($total_queries >= 1000) {
1776
+							pauseRepairProcess($to_fix, $error_type, $step_max, true);
1777
+			}
1748 1778
 		}
1749 1779
 
1750 1780
 		// Keep going.
@@ -1757,8 +1787,9 @@  discard block
 block discarded – undo
1757 1787
 		if ($do_fix)
1758 1788
 		{
1759 1789
 			$key = array_search($error_type, $to_fix);
1760
-			if ($key !== false && isset($to_fix[$key]))
1761
-				unset($to_fix[$key]);
1790
+			if ($key !== false && isset($to_fix[$key])) {
1791
+							unset($to_fix[$key]);
1792
+			}
1762 1793
 		}
1763 1794
 
1764 1795
 		// Are we done?
@@ -1781,10 +1812,11 @@  discard block
 block discarded – undo
1781 1812
 	static $createOnce = false;
1782 1813
 
1783 1814
 	// Have we already created it?
1784
-	if ($createOnce)
1785
-		return;
1786
-	else
1787
-		$createOnce = true;
1815
+	if ($createOnce) {
1816
+			return;
1817
+	} else {
1818
+			$createOnce = true;
1819
+	}
1788 1820
 
1789 1821
 	// Back to the forum's default language.
1790 1822
 	loadLanguage('Admin', $language);
@@ -1799,8 +1831,9 @@  discard block
 block discarded – undo
1799 1831
 			'cat_name' => $txt['salvaged_category_name'],
1800 1832
 		)
1801 1833
 	);
1802
-	if ($smcFunc['db_num_rows']($result) != 0)
1803
-		list ($salvageCatID) = $smcFunc['db_fetch_row']($result);
1834
+	if ($smcFunc['db_num_rows']($result) != 0) {
1835
+			list ($salvageCatID) = $smcFunc['db_fetch_row']($result);
1836
+	}
1804 1837
 	$smcFunc['db_free_result']($result);
1805 1838
 
1806 1839
 	if (empty($salvageCatID))
@@ -1832,8 +1865,9 @@  discard block
 block discarded – undo
1832 1865
 			'board_name' => $txt['salvaged_board_name'],
1833 1866
 		)
1834 1867
 	);
1835
-	if ($smcFunc['db_num_rows']($result) != 0)
1836
-		list ($salvageBoardID) = $smcFunc['db_fetch_row']($result);
1868
+	if ($smcFunc['db_num_rows']($result) != 0) {
1869
+			list ($salvageBoardID) = $smcFunc['db_fetch_row']($result);
1870
+	}
1837 1871
 	$smcFunc['db_free_result']($result);
1838 1872
 
1839 1873
 	if (empty($salvageBoardID))
Please login to merge, or discard this patch.
Sources/Admin.php 1 patch
Braces   +75 added lines, -52 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@  discard block
 block discarded – undo
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
  * The main admin handling function.<br>
@@ -444,8 +445,9 @@  discard block
 block discarded – undo
444 445
 		foreach ($admin_includes as $include)
445 446
 		{
446 447
 			$include = strtr(trim($include), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir, '$themedir' => $settings['theme_dir']));
447
-			if (file_exists($include))
448
-				require_once($include);
448
+			if (file_exists($include)) {
449
+							require_once($include);
450
+			}
449 451
 		}
450 452
 	}
451 453
 
@@ -457,24 +459,27 @@  discard block
 block discarded – undo
457 459
 	unset($admin_areas);
458 460
 
459 461
 	// Nothing valid?
460
-	if ($admin_include_data == false)
461
-		fatal_lang_error('no_access', false);
462
+	if ($admin_include_data == false) {
463
+			fatal_lang_error('no_access', false);
464
+	}
462 465
 
463 466
 	// Build the link tree.
464 467
 	$context['linktree'][] = array(
465 468
 		'url' => $scripturl . '?action=admin',
466 469
 		'name' => $txt['admin_center'],
467 470
 	);
468
-	if (isset($admin_include_data['current_area']) && $admin_include_data['current_area'] != 'index')
469
-		$context['linktree'][] = array(
471
+	if (isset($admin_include_data['current_area']) && $admin_include_data['current_area'] != 'index') {
472
+			$context['linktree'][] = array(
470 473
 			'url' => $scripturl . '?action=admin;area=' . $admin_include_data['current_area'] . ';' . $context['session_var'] . '=' . $context['session_id'],
471 474
 			'name' => $admin_include_data['label'],
472 475
 		);
473
-	if (!empty($admin_include_data['current_subsection']) && $admin_include_data['subsections'][$admin_include_data['current_subsection']][0] != $admin_include_data['label'])
474
-		$context['linktree'][] = array(
476
+	}
477
+	if (!empty($admin_include_data['current_subsection']) && $admin_include_data['subsections'][$admin_include_data['current_subsection']][0] != $admin_include_data['label']) {
478
+			$context['linktree'][] = array(
475 479
 			'url' => $scripturl . '?action=admin;area=' . $admin_include_data['current_area'] . ';sa=' . $admin_include_data['current_subsection'] . ';' . $context['session_var'] . '=' . $context['session_id'],
476 480
 			'name' => $admin_include_data['subsections'][$admin_include_data['current_subsection']][0],
477 481
 		);
482
+	}
478 483
 
479 484
 	// Make a note of the Unique ID for this menu.
480 485
 	$context['admin_menu_id'] = $context['max_menu_id'];
@@ -484,16 +489,18 @@  discard block
 block discarded – undo
484 489
 	$context['admin_area'] = $admin_include_data['current_area'];
485 490
 
486 491
 	// Now - finally - call the right place!
487
-	if (isset($admin_include_data['file']))
488
-		require_once($sourcedir . '/' . $admin_include_data['file']);
492
+	if (isset($admin_include_data['file'])) {
493
+			require_once($sourcedir . '/' . $admin_include_data['file']);
494
+	}
489 495
 
490 496
 	// Get the right callable.
491 497
 	$call = call_helper($admin_include_data['function'], true);
492 498
 
493 499
 	// Is it valid?
494
-	if (!empty($call))
495
-		call_user_func($call);
496
-}
500
+	if (!empty($call)) {
501
+			call_user_func($call);
502
+	}
503
+	}
497 504
 
498 505
 /**
499 506
  * The main administration section.
@@ -547,13 +554,14 @@  discard block
 block discarded – undo
547 554
 
548 555
 	$context['sub_template'] = $context['admin_area'] == 'credits' ? 'credits' : 'admin';
549 556
 	$context['page_title'] = $context['admin_area'] == 'credits' ? $txt['support_credits_title'] : $txt['admin_center'];
550
-	if ($context['admin_area'] != 'credits')
551
-		$context[$context['admin_menu_name']]['tab_data'] = array(
557
+	if ($context['admin_area'] != 'credits') {
558
+			$context[$context['admin_menu_name']]['tab_data'] = array(
552 559
 			'title' => $txt['admin_center'],
553 560
 			'help' => '',
554 561
 			'description' => '<strong>' . $txt['hello_guest'] . ' ' . $context['user']['name'] . '!</strong>
555 562
 						' . sprintf($txt['admin_main_welcome'], $txt['admin_center'], $txt['help'], $txt['help']),
556 563
 		);
564
+	}
557 565
 
558 566
 	// Lastly, fill in the blanks in the support resources paragraphs.
559 567
 	$txt['support_resources_p1'] = sprintf($txt['support_resources_p1'],
@@ -571,9 +579,10 @@  discard block
 block discarded – undo
571 579
 		'https://www.simplemachines.org/redirect/customize_support'
572 580
 	);
573 581
 
574
-	if ($context['admin_area'] == 'admin')
575
-		loadJavaScriptFile('admin.js', array('defer' => false), 'smf_admin');
576
-}
582
+	if ($context['admin_area'] == 'admin') {
583
+			loadJavaScriptFile('admin.js', array('defer' => false), 'smf_admin');
584
+	}
585
+	}
577 586
 
578 587
 /**
579 588
  * Get one of the admin information files from Simple Machines.
@@ -584,8 +593,9 @@  discard block
 block discarded – undo
584 593
 
585 594
 	setMemoryLimit('32M');
586 595
 
587
-	if (empty($_REQUEST['filename']) || !is_string($_REQUEST['filename']))
588
-		fatal_lang_error('no_access', false);
596
+	if (empty($_REQUEST['filename']) || !is_string($_REQUEST['filename'])) {
597
+			fatal_lang_error('no_access', false);
598
+	}
589 599
 
590 600
 	// Strip off the forum cache part or we won't find it...
591 601
 	$_REQUEST['filename'] = str_replace($modSettings['browser_cache'], '', $_REQUEST['filename']);
@@ -600,27 +610,30 @@  discard block
 block discarded – undo
600 610
 		)
601 611
 	);
602 612
 
603
-	if ($smcFunc['db_num_rows']($request) == 0)
604
-		fatal_lang_error('admin_file_not_found', true, array($_REQUEST['filename']), 404);
613
+	if ($smcFunc['db_num_rows']($request) == 0) {
614
+			fatal_lang_error('admin_file_not_found', true, array($_REQUEST['filename']), 404);
615
+	}
605 616
 
606 617
 	list ($file_data, $filetype) = $smcFunc['db_fetch_row']($request);
607 618
 	$smcFunc['db_free_result']($request);
608 619
 
609 620
 	// @todo Temp
610 621
 	// Figure out if sesc is still being used.
611
-	if (strpos($file_data, ';sesc=') !== false && $filetype == 'text/javascript')
612
-		$file_data = '
622
+	if (strpos($file_data, ';sesc=') !== false && $filetype == 'text/javascript') {
623
+			$file_data = '
613 624
 if (!(\'smfForum_sessionvar\' in window))
614 625
 	window.smfForum_sessionvar = \'sesc\';
615 626
 ' . strtr($file_data, array(';sesc=' => ';\' + window.smfForum_sessionvar + \'='));
627
+	}
616 628
 
617 629
 	$context['template_layers'] = array();
618 630
 	// Lets make sure we aren't going to output anything nasty.
619 631
 	@ob_end_clean();
620
-	if (!empty($modSettings['enableCompressedOutput']))
621
-		@ob_start('ob_gzhandler');
622
-	else
623
-		@ob_start();
632
+	if (!empty($modSettings['enableCompressedOutput'])) {
633
+			@ob_start('ob_gzhandler');
634
+	} else {
635
+			@ob_start();
636
+	}
624 637
 
625 638
 	// Make sure they know what type of file we are.
626 639
 	header('Content-Type: ' . $filetype);
@@ -660,11 +673,12 @@  discard block
 block discarded – undo
660 673
 		updateAdminPreferences();
661 674
 	}
662 675
 
663
-	if (trim($context['search_term']) == '')
664
-		$context['search_results'] = array();
665
-	else
666
-		call_helper($subActions[$context['search_type']]);
667
-}
676
+	if (trim($context['search_term']) == '') {
677
+			$context['search_results'] = array();
678
+	} else {
679
+			call_helper($subActions[$context['search_type']]);
680
+	}
681
+	}
668 682
 
669 683
 /**
670 684
  * A complicated but relatively quick internal search.
@@ -728,8 +742,9 @@  discard block
 block discarded – undo
728 742
 
729 743
 	loadLanguage(implode('+', $language_files));
730 744
 
731
-	foreach ($include_files as $file)
732
-		require_once($sourcedir . '/' . $file . '.php');
745
+	foreach ($include_files as $file) {
746
+			require_once($sourcedir . '/' . $file . '.php');
747
+	}
733 748
 
734 749
 	/* This is the huge array that defines everything... it's a huge array of items formatted as follows:
735 750
 		0 = Language index (Can be array of indexes) to search through for this setting.
@@ -753,11 +768,12 @@  discard block
 block discarded – undo
753 768
 		foreach ($section['areas'] as $menu_key => $menu_item)
754 769
 		{
755 770
 			$search_data['sections'][] = array($menu_item['label'], 'area=' . $menu_key);
756
-			if (!empty($menu_item['subsections']))
757
-				foreach ($menu_item['subsections'] as $key => $sublabel)
771
+			if (!empty($menu_item['subsections'])) {
772
+							foreach ($menu_item['subsections'] as $key => $sublabel)
758 773
 				{
759 774
 					if (isset($sublabel['label']))
760 775
 						$search_data['sections'][] = array($sublabel['label'], 'area=' . $menu_key . ';sa=' . $key);
776
+			}
761 777
 				}
762 778
 		}
763 779
 	}
@@ -767,9 +783,10 @@  discard block
 block discarded – undo
767 783
 		// Get a list of their variables.
768 784
 		$config_vars = $setting_area[0](true);
769 785
 
770
-		foreach ($config_vars as $var)
771
-			if (!empty($var[1]) && !in_array($var[0], array('permissions', 'switch', 'desc')))
786
+		foreach ($config_vars as $var) {
787
+					if (!empty($var[1]) && !in_array($var[0], array('permissions', 'switch', 'desc')))
772 788
 				$search_data['settings'][] = array($var[(isset($var[2]) && in_array($var[2], array('file', 'db'))) ? 0 : 1], $setting_area[1], 'alttxt' => (isset($var[2]) && in_array($var[2], array('file', 'db'))) || isset($var[3]) ? (in_array($var[2], array('file', 'db')) ? $var[1] : $var[3]) : '');
789
+		}
773 790
 	}
774 791
 
775 792
 	$context['page_title'] = $txt['admin_search_results'];
@@ -782,8 +799,9 @@  discard block
 block discarded – undo
782 799
 		foreach ($data as $item)
783 800
 		{
784 801
 			$found = false;
785
-			if (!is_array($item[0]))
786
-				$item[0] = array($item[0]);
802
+			if (!is_array($item[0])) {
803
+							$item[0] = array($item[0]);
804
+			}
787 805
 			foreach ($item[0] as $term)
788 806
 			{
789 807
 				if (stripos($term, $search_term) !== false || (isset($txt[$term]) && stripos($txt[$term], $search_term) !== false) || (isset($txt['setting_' . $term]) && stripos($txt['setting_' . $term], $search_term) !== false))
@@ -841,8 +859,9 @@  discard block
 block discarded – undo
841 859
 	$postVars = explode(' ', $context['search_term']);
842 860
 
843 861
 	// Encode the search data.
844
-	foreach ($postVars as $k => $v)
845
-		$postVars[$k] = urlencode($v);
862
+	foreach ($postVars as $k => $v) {
863
+			$postVars[$k] = urlencode($v);
864
+	}
846 865
 
847 866
 	// This is what we will send.
848 867
 	$postVars = implode('+', $postVars);
@@ -854,8 +873,9 @@  discard block
 block discarded – undo
854 873
 	$search_results = fetch_web_data($context['doc_apiurl'] . '?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=' . $postVars);
855 874
 
856 875
 	// If we didn't get any xml back we are in trouble - perhaps the doc site is overloaded?
857
-	if (!$search_results || preg_match('~<' . '\?xml\sversion="\d+\.\d+"\?' . '>\s*(<api>.+?</api>)~is', $search_results, $matches) != true)
858
-		fatal_lang_error('cannot_connect_doc_site');
876
+	if (!$search_results || preg_match('~<' . '\?xml\sversion="\d+\.\d+"\?' . '>\s*(<api>.+?</api>)~is', $search_results, $matches) != true) {
877
+			fatal_lang_error('cannot_connect_doc_site');
878
+	}
859 879
 
860 880
 	$search_results = $matches[1];
861 881
 
@@ -867,8 +887,9 @@  discard block
 block discarded – undo
867 887
 	$results = new xmlArray($search_results, false);
868 888
 
869 889
 	// Move through the api layer.
870
-	if (!$results->exists('api'))
871
-		fatal_lang_error('cannot_connect_doc_site');
890
+	if (!$results->exists('api')) {
891
+			fatal_lang_error('cannot_connect_doc_site');
892
+	}
872 893
 
873 894
 	// Are there actually some results?
874 895
 	if ($results->exists('api/query/search/p'))
@@ -904,8 +925,9 @@  discard block
 block discarded – undo
904 925
 	);
905 926
 
906 927
 	// If it's not got a sa set it must have come here for first time, pretend error log should be reversed.
907
-	if (!isset($_REQUEST['sa']))
908
-		$_REQUEST['desc'] = true;
928
+	if (!isset($_REQUEST['sa'])) {
929
+			$_REQUEST['desc'] = true;
930
+	}
909 931
 
910 932
 	// Setup some tab stuff.
911 933
 	$context[$context['admin_menu_name']]['tab_data'] = array(
@@ -955,9 +977,10 @@  discard block
 block discarded – undo
955 977
 	unset($_SESSION['admin_time']);
956 978
 
957 979
 	// Clean any admin tokens as well.
958
-	foreach ($_SESSION['token'] as $key => $token)
959
-		if (strpos($key, '-admin') !== false)
980
+	foreach ($_SESSION['token'] as $key => $token) {
981
+			if (strpos($key, '-admin') !== false)
960 982
 			unset($_SESSION['token'][$key]);
983
+	}
961 984
 
962 985
 	redirectexit();
963 986
 }
Please login to merge, or discard this patch.
Themes/default/Printpage.template.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -144,11 +144,12 @@  discard block
 block discarded – undo
144 144
 				<div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>';
145 145
 
146 146
 		$options = 1;
147
-		foreach ($context['poll']['options'] as $option)
148
-			echo '
147
+		foreach ($context['poll']['options'] as $option) {
148
+					echo '
149 149
 					<div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong>
150 150
 						', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', '
151 151
 					</div>';
152
+		}
152 153
 
153 154
 		echo '
154 155
 			</div>';
@@ -170,9 +171,10 @@  discard block
 block discarded – undo
170 171
 			echo '
171 172
 				<hr>';
172 173
 
173
-			foreach ($context['printattach'][$post['id_msg']] as $attach)
174
-				echo '
174
+			foreach ($context['printattach'][$post['id_msg']] as $attach) {
175
+							echo '
175 176
 					<img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">';
177
+			}
176 178
 		}
177 179
 
178 180
 		echo '
@@ -207,12 +209,13 @@  discard block
 block discarded – undo
207 209
 		<div class="print_options">';
208 210
 
209 211
 	// Which option is set, text or text&images
210
-	if (isset($_REQUEST['images']))
211
-		echo '
212
+	if (isset($_REQUEST['images'])) {
213
+			echo '
212 214
 			<a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>';
213
-	else
214
-		echo '
215
+	} else {
216
+			echo '
215 217
 			<strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>';
218
+	}
216 219
 
217 220
 	echo '
218 221
 		</div><!-- .print_options -->';
Please login to merge, or discard this patch.
Themes/default/Poll.template.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 				<h3 class="catbg">', $context['page_title'], '</h3>
47 47
 			</div>';
48 48
 
49
-	if (!empty($context['poll_error']['messages']))
50
-		echo '
49
+	if (!empty($context['poll_error']['messages'])) {
50
+			echo '
51 51
 			<div class="errorbox">
52 52
 				<dl class="poll_error">
53 53
 					<dt>
@@ -58,6 +58,7 @@  discard block
 block discarded – undo
58 58
 					</dt>
59 59
 				</dl>
60 60
 			</div>';
61
+	}
61 62
 
62 63
 	echo '
63 64
 			<div>
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
 								<input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" size="80" maxlength="255">';
80 81
 
81 82
 		// Does this option have a vote count yet, or is it new?
82
-		if ($choice['votes'] != -1)
83
-			echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
83
+		if ($choice['votes'] != -1) {
84
+					echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
85
+		}
84 86
 
85 87
 		echo '
86 88
 							</dd>';
@@ -118,14 +120,15 @@  discard block
 block discarded – undo
118 120
 								<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '>
119 121
 							</dd>';
120 122
 
121
-		if ($context['poll']['guest_vote_allowed'])
122
-			echo '
123
+		if ($context['poll']['guest_vote_allowed']) {
124
+					echo '
123 125
 							<dt>
124 126
 								<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
125 127
 							</dt>
126 128
 							<dd>
127 129
 								<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', '>
128 130
 							</dd>';
131
+		}
129 132
 	}
130 133
 
131 134
 	echo '
@@ -141,12 +144,13 @@  discard block
 block discarded – undo
141 144
 					</fieldset>';
142 145
 
143 146
 	// If this is an edit, we can allow them to reset the vote counts.
144
-	if ($context['is_edit'])
145
-		echo '
147
+	if ($context['is_edit']) {
148
+			echo '
146 149
 					<fieldset id="poll_reset">
147 150
 						<legend>', $txt['reset_votes'], '</legend>
148 151
 						<input type="checkbox" name="resetVoteCount" value="on"> ' . $txt['reset_votes_check'] . '
149 152
 					</fieldset>';
153
+	}
150 154
 	echo '
151 155
 					<input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button">
152 156
 				</div><!-- .roundframe -->
Please login to merge, or discard this patch.
Themes/default/Stats.template.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -44,10 +44,11 @@  discard block
 block discarded – undo
44 44
 				<dt>', $txt['users_online_today'], ':</dt>
45 45
 				<dd>', $context['online_today'], '</dd>';
46 46
 
47
-	if (!empty($modSettings['hitStats']))
48
-		echo '
47
+	if (!empty($modSettings['hitStats'])) {
48
+			echo '
49 49
 				<dt>', $txt['num_hits'], ':</dt>
50 50
 				<dd>', $context['num_hits'], '</dd>';
51
+	}
51 52
 
52 53
 	echo '
53 54
 			</dl>
@@ -71,17 +72,19 @@  discard block
 block discarded – undo
71 72
 				<dt>', $txt['gender_stats'], ':</dt>
72 73
 				<dd>';
73 74
 
74
-		foreach ($context['gender'] as $g => $n)
75
-			echo $g, ': ', $n, '<br>';
75
+		foreach ($context['gender'] as $g => $n) {
76
+					echo $g, ': ', $n, '<br>';
77
+		}
76 78
 
77 79
 		echo '
78 80
 				</dd>';
79 81
 	}
80 82
 
81
-	if (!empty($modSettings['hitStats']))
82
-		echo '
83
+	if (!empty($modSettings['hitStats'])) {
84
+			echo '
83 85
 				<dt>', $txt['average_hits'], ':</dt>
84 86
 				<dd>', $context['average_hits'], '</dd>';
87
+	}
85 88
 
86 89
 	echo '
87 90
 			</dl>';
@@ -105,14 +108,15 @@  discard block
 block discarded – undo
105 108
 					</dt>
106 109
 					<dd class="statsbar">';
107 110
 
108
-			if (!empty($item['percent']))
109
-				echo '
111
+			if (!empty($item['percent'])) {
112
+							echo '
110 113
 						<div class="bar" style="width: ', $item['percent'], '%;">
111 114
 							<span class="righttext">', $item['num'], '</span>
112 115
 						</div>';
113
-			else
114
-				echo '
116
+			} else {
117
+							echo '
115 118
 						<div class="bar empty"><span class="righttext">', $item['num'], '</span></div>';
119
+			}
116 120
 
117 121
 			echo '
118 122
 					</dd>';
@@ -144,9 +148,10 @@  discard block
 block discarded – undo
144 148
 					<th>', $txt['stats_new_members'], '</th>
145 149
 					<th>', $txt['most_online'], '</th>';
146 150
 
147
-		if (!empty($modSettings['hitStats']))
148
-			echo '
151
+		if (!empty($modSettings['hitStats'])) {
152
+					echo '
149 153
 					<th>', $txt['page_views'], '</th>';
154
+		}
150 155
 
151 156
 		echo '
152 157
 				</tr>
@@ -165,9 +170,10 @@  discard block
 block discarded – undo
165 170
 					<th>', $year['new_members'], '</th>
166 171
 					<th>', $year['most_members_online'], '</th>';
167 172
 
168
-			if (!empty($modSettings['hitStats']))
169
-				echo '
173
+			if (!empty($modSettings['hitStats'])) {
174
+							echo '
170 175
 					<th>', $year['hits'], '</th>';
176
+			}
171 177
 
172 178
 			echo '
173 179
 				</tr>';
@@ -184,9 +190,10 @@  discard block
 block discarded – undo
184 190
 					<th>', $month['new_members'], '</th>
185 191
 					<th>', $month['most_members_online'], '</th>';
186 192
 
187
-				if (!empty($modSettings['hitStats']))
188
-					echo '
193
+				if (!empty($modSettings['hitStats'])) {
194
+									echo '
189 195
 					<th>', $month['hits'], '</th>';
196
+				}
190 197
 
191 198
 				echo '
192 199
 				</tr>';
@@ -203,9 +210,10 @@  discard block
 block discarded – undo
203 210
 					<td>', $day['new_members'], '</td>
204 211
 					<td>', $day['most_members_online'], '</td>';
205 212
 
206
-						if (!empty($modSettings['hitStats']))
207
-							echo '
213
+						if (!empty($modSettings['hitStats'])) {
214
+													echo '
208 215
 					<td>', $day['hits'], '</td>';
216
+						}
209 217
 
210 218
 						echo '
211 219
 				</tr>';
Please login to merge, or discard this patch.
Themes/default/Admin.template.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -945,7 +945,7 @@
 block discarded – undo
945 945
 				}
946 946
 
947 947
 				echo isset($config_var['postinput']) ? '
948
-											' . $config_var['postinput'] : '','
948
+											' . $config_var['postinput'] : '', '
949 949
 									</dd>';
950 950
 			}
951 951
 		}
Please login to merge, or discard this patch.
Braces   +179 added lines, -128 removed lines patch added patch discarded remove patch
@@ -65,9 +65,10 @@  discard block
 block discarded – undo
65 65
 										', implode(', ', $context['administrators']);
66 66
 
67 67
 	// If we have lots of admins... don't show them all.
68
-	if (!empty($context['more_admins_link']))
69
-		echo '
68
+	if (!empty($context['more_admins_link'])) {
69
+			echo '
70 70
 										(', $context['more_admins_link'], ')';
71
+	}
71 72
 
72 73
 	echo '
73 74
 									</div><!-- #version_details -->
@@ -84,17 +85,19 @@  discard block
 block discarded – undo
84 85
 		foreach ($area['areas'] as $item_id => $item)
85 86
 		{
86 87
 			// No point showing the 'home' page here, we're already on it!
87
-			if ($area_id == 'forum' && $item_id == 'index')
88
-				continue;
88
+			if ($area_id == 'forum' && $item_id == 'index') {
89
+							continue;
90
+			}
89 91
 
90 92
 			$url = isset($item['url']) ? $item['url'] : $scripturl . '?action=admin;area=' . $item_id . (!empty($context[$context['admin_menu_name']]['extra_parameters']) ? $context[$context['admin_menu_name']]['extra_parameters'] : '');
91 93
 
92
-			if (!empty($item['icon_file']))
93
-				echo '
94
+			if (!empty($item['icon_file'])) {
95
+							echo '
94 96
 							<a href="', $url, '" class="admin_group', !empty($item['inactive']) ? ' inactive' : '', '"><img class="large_admin_menu_icon_file" src="', $item['icon_file'], '" alt="">', $item['label'], '</a>';
95
-			else
96
-				echo '
97
+			} else {
98
+							echo '
97 99
 							<a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>';
100
+			}
98 101
 		}
99 102
 
100 103
 		echo '
@@ -105,10 +108,11 @@  discard block
 block discarded – undo
105 108
 					</div><!-- #admincenter -->';
106 109
 
107 110
 	// The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization.
108
-	if (empty($modSettings['disable_smf_js']))
109
-		echo '
111
+	if (empty($modSettings['disable_smf_js'])) {
112
+			echo '
110 113
 					<script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
111 114
 					<script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
115
+	}
112 116
 
113 117
 	// This sets the announcements and current versions themselves ;).
114 118
 	echo '
@@ -187,9 +191,10 @@  discard block
 block discarded – undo
187 191
 								<em>', $version['version'], '</em>';
188 192
 
189 193
 		// more details for this item, show them a link
190
-		if ($context['can_admin'] && isset($version['more']))
191
-			echo
194
+		if ($context['can_admin'] && isset($version['more'])) {
195
+					echo
192 196
 								' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>';
197
+		}
193 198
 		echo '
194 199
 								<br>';
195 200
 	}
@@ -220,21 +225,23 @@  discard block
 block discarded – undo
220 225
 
221 226
 	foreach ($context['credits'] as $section)
222 227
 	{
223
-		if (isset($section['pretext']))
224
-			echo '
228
+		if (isset($section['pretext'])) {
229
+					echo '
225 230
 								<p>', $section['pretext'], '</p>
226 231
 								<hr>';
232
+		}
227 233
 
228 234
 		echo '
229 235
 								<dl>';
230 236
 
231 237
 		foreach ($section['groups'] as $group)
232 238
 		{
233
-			if (isset($group['title']))
234
-				echo '
239
+			if (isset($group['title'])) {
240
+							echo '
235 241
 									<dt>
236 242
 										<strong>', $group['title'], ':</strong>
237 243
 									</dt>';
244
+			}
238 245
 
239 246
 			echo '
240 247
 									<dd>', implode(', ', $group['members']), '</dd>';
@@ -243,10 +250,11 @@  discard block
 block discarded – undo
243 250
 		echo '
244 251
 								</dl>';
245 252
 
246
-		if (isset($section['posttext']))
247
-			echo '
253
+		if (isset($section['posttext'])) {
254
+					echo '
248 255
 								<hr>
249 256
 								<p>', $section['posttext'], '</p>';
257
+		}
250 258
 	}
251 259
 
252 260
 	echo '
@@ -262,9 +270,10 @@  discard block
 block discarded – undo
262 270
 						smfSupportVersions.forum = "', $context['forum_version'], '";';
263 271
 
264 272
 	// Don't worry, none of this is logged, it's just used to give information that might be of use.
265
-	foreach ($context['current_versions'] as $variable => $version)
266
-		echo '
273
+	foreach ($context['current_versions'] as $variable => $version) {
274
+			echo '
267 275
 						smfSupportVersions.', $variable, ' = "', $version['version'], '";';
276
+	}
268 277
 
269 278
 	// Now we just have to include the script and wait ;).
270 279
 	echo '
@@ -361,8 +370,8 @@  discard block
 block discarded – undo
361 370
 								<tbody>';
362 371
 
363 372
 	// Loop through every source file displaying its version - using javascript.
364
-	foreach ($context['file_versions'] as $filename => $version)
365
-		echo '
373
+	foreach ($context['file_versions'] as $filename => $version) {
374
+			echo '
366 375
 									<tr class="windowbg">
367 376
 										<td class="half_table">
368 377
 											', $filename, '
@@ -374,6 +383,7 @@  discard block
 block discarded – undo
374 383
 											<em id="currentSources', $filename, '">??</em>
375 384
 										</td>
376 385
 									</tr>';
386
+	}
377 387
 
378 388
 	// Default template files.
379 389
 	echo '
@@ -399,8 +409,8 @@  discard block
 block discarded – undo
399 409
 							<table id="Default" class="table_grid">
400 410
 								<tbody>';
401 411
 
402
-	foreach ($context['default_template_versions'] as $filename => $version)
403
-		echo '
412
+	foreach ($context['default_template_versions'] as $filename => $version) {
413
+			echo '
404 414
 									<tr class="windowbg">
405 415
 										<td class="half_table">
406 416
 											', $filename, '
@@ -412,6 +422,7 @@  discard block
 block discarded – undo
412 422
 											<em id="currentDefault', $filename, '">??</em>
413 423
 										</td>
414 424
 									</tr>';
425
+	}
415 426
 
416 427
 	// Now the language files...
417 428
 	echo '
@@ -439,8 +450,8 @@  discard block
 block discarded – undo
439 450
 
440 451
 	foreach ($context['default_language_versions'] as $language => $files)
441 452
 	{
442
-		foreach ($files as $filename => $version)
443
-			echo '
453
+		foreach ($files as $filename => $version) {
454
+					echo '
444 455
 									<tr class="windowbg">
445 456
 										<td class="half_table">
446 457
 											', $filename, '.<em>', $language, '</em>.php
@@ -452,6 +463,7 @@  discard block
 block discarded – undo
452 463
 											<em id="current', $filename, '.', $language, '">??</em>
453 464
 										</td>
454 465
 									</tr>';
466
+		}
455 467
 	}
456 468
 
457 469
 	echo '
@@ -481,8 +493,8 @@  discard block
 block discarded – undo
481 493
 							<table id="Templates" class="table_grid">
482 494
 								<tbody>';
483 495
 
484
-		foreach ($context['template_versions'] as $filename => $version)
485
-			echo '
496
+		foreach ($context['template_versions'] as $filename => $version) {
497
+					echo '
486 498
 									<tr class="windowbg">
487 499
 										<td class="half_table">
488 500
 											', $filename, '
@@ -494,6 +506,7 @@  discard block
 block discarded – undo
494 506
 											<em id="currentTemplates', $filename, '">??</em>
495 507
 										</td>
496 508
 									</tr>';
509
+		}
497 510
 
498 511
 		echo '
499 512
 								</tbody>
@@ -523,8 +536,8 @@  discard block
 block discarded – undo
523 536
 							<table id="Tasks" class="table_grid">
524 537
 								<tbody>';
525 538
 
526
-		foreach ($context['tasks_versions'] as $filename => $version)
527
-			echo '
539
+		foreach ($context['tasks_versions'] as $filename => $version) {
540
+					echo '
528 541
 									<tr class="windowbg">
529 542
 										<td class="half_table">
530 543
 											', $filename, '
@@ -536,6 +549,7 @@  discard block
 block discarded – undo
536 549
 											<em id="currentTasks', $filename, '">??</em>
537 550
 										</td>
538 551
 									</tr>';
552
+		}
539 553
 
540 554
 		echo '
541 555
 								</tbody>
@@ -577,9 +591,10 @@  discard block
 block discarded – undo
577 591
 {
578 592
 	global $context, $scripturl, $txt, $modSettings;
579 593
 
580
-	if (!empty($context['saved_successful']))
581
-		echo '
594
+	if (!empty($context['saved_successful'])) {
595
+			echo '
582 596
 					<div class="infobox">', $txt['settings_saved'], '</div>';
597
+	}
583 598
 
584 599
 	// First section is for adding/removing words from the censored list.
585 600
 	echo '
@@ -594,11 +609,12 @@  discard block
 block discarded – undo
594 609
 								<p>', $txt['admin_censored_where'], '</p>';
595 610
 
596 611
 	// Show text boxes for censoring [bad   ] => [good  ].
597
-	foreach ($context['censored_words'] as $vulgar => $proper)
598
-		echo '
612
+	foreach ($context['censored_words'] as $vulgar => $proper) {
613
+			echo '
599 614
 								<div class="block">
600 615
 									<input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> =&gt; <input type="text" name="censor_proper[]" value="', $proper, '" size="30">
601 616
 								</div>';
617
+	}
602 618
 
603 619
 	// Now provide a way to censor more words.
604 620
 	echo '
@@ -673,19 +689,21 @@  discard block
 block discarded – undo
673 689
 						<div class="windowbg2 noup">
674 690
 							', $txt['not_done_reason'];
675 691
 
676
-	if (!empty($context['continue_percent']))
677
-		echo '
692
+	if (!empty($context['continue_percent'])) {
693
+			echo '
678 694
 							<div class="progress_bar">
679 695
 								<div class="full_bar">', $context['continue_percent'], '%</div>
680 696
 								<div class="green_percent" style="width: ', $context['continue_percent'], '%;"></div>
681 697
 							</div>';
698
+	}
682 699
 
683
-	if (!empty($context['substep_enabled']))
684
-		echo '
700
+	if (!empty($context['substep_enabled'])) {
701
+			echo '
685 702
 							<div class="progress_bar">
686 703
 								<div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div>
687 704
 								<div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;"></div>
688 705
 							</div>';
706
+	}
689 707
 
690 708
 	echo '
691 709
 							<form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">
@@ -720,35 +738,40 @@  discard block
 block discarded – undo
720 738
 {
721 739
 	global $context, $txt, $scripturl;
722 740
 
723
-	if (!empty($context['saved_successful']))
724
-		echo '
741
+	if (!empty($context['saved_successful'])) {
742
+			echo '
725 743
 					<div class="infobox">', $txt['settings_saved'], '</div>';
726
-	elseif (!empty($context['saved_failed']))
727
-		echo '
744
+	} elseif (!empty($context['saved_failed'])) {
745
+			echo '
728 746
 					<div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>';
747
+	}
729 748
 
730
-	if (!empty($context['settings_pre_javascript']))
731
-		echo '
749
+	if (!empty($context['settings_pre_javascript'])) {
750
+			echo '
732 751
 					<script>', $context['settings_pre_javascript'], '</script>';
752
+	}
733 753
 
734
-	if (!empty($context['settings_insert_above']))
735
-		echo $context['settings_insert_above'];
754
+	if (!empty($context['settings_insert_above'])) {
755
+			echo $context['settings_insert_above'];
756
+	}
736 757
 
737 758
 	echo '
738 759
 					<div id="admincenter">
739 760
 						<form id="admin_form_wrapper" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>';
740 761
 
741 762
 	// Is there a custom title?
742
-	if (isset($context['settings_title']))
743
-		echo '
763
+	if (isset($context['settings_title'])) {
764
+			echo '
744 765
 							<div class="cat_bar">
745 766
 								<h3 class="catbg">', $context['settings_title'], '</h3>
746 767
 							</div>';
768
+	}
747 769
 
748 770
 	// Have we got a message to display?
749
-	if (!empty($context['settings_message']))
750
-		echo '
771
+	if (!empty($context['settings_message'])) {
772
+			echo '
751 773
 							<div class="information">', $context['settings_message'], '</div>';
774
+	}
752 775
 
753 776
 	// Now actually loop through all the variables.
754 777
 	$is_open = false;
@@ -801,8 +824,9 @@  discard block
 block discarded – undo
801 824
 		// Hang about? Are you pulling my leg - a callback?!
802 825
 		if (is_array($config_var) && $config_var['type'] == 'callback')
803 826
 		{
804
-			if (function_exists('template_callback_' . $config_var['name']))
805
-				call_user_func('template_callback_' . $config_var['name']);
827
+			if (function_exists('template_callback_' . $config_var['name'])) {
828
+							call_user_func('template_callback_' . $config_var['name']);
829
+			}
806 830
 
807 831
 			continue;
808 832
 		}
@@ -832,9 +856,10 @@  discard block
 block discarded – undo
832 856
 				$text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time');
833 857
 
834 858
 				// Show the [?] button.
835
-				if ($config_var['help'])
836
-					echo '
859
+				if ($config_var['help']) {
860
+									echo '
837 861
 										<a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ';
862
+				}
838 863
 
839 864
 				echo '
840 865
 										<a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span>
@@ -843,23 +868,26 @@  discard block
 block discarded – undo
843 868
 										$config_var['preinput'];
844 869
 
845 870
 				// Show a check box.
846
-				if ($config_var['type'] == 'check')
847
-					echo '
871
+				if ($config_var['type'] == 'check') {
872
+									echo '
848 873
 										<input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">';
874
+				}
849 875
 				// Escape (via htmlspecialchars.) the text box.
850
-				elseif ($config_var['type'] == 'password')
851
-					echo '
876
+				elseif ($config_var['type'] == 'password') {
877
+									echo '
852 878
 										<input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;"><br>
853 879
 										<input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>';
880
+				}
854 881
 				// Show a selection box.
855 882
 				elseif ($config_var['type'] == 'select')
856 883
 				{
857 884
 					echo '
858 885
 										<select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), (!empty($config_var['multiple']) && !empty($config_var['size']) ? ' size="' . $config_var['size'] . '"' : ''), '>';
859 886
 
860
-					foreach ($config_var['data'] as $option)
861
-						echo '
887
+					foreach ($config_var['data'] as $option) {
888
+											echo '
862 889
 											<option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected' : ''), '>', $option[1], '</option>';
890
+					}
863 891
 					echo '
864 892
 										</select>';
865 893
 				}
@@ -876,16 +904,18 @@  discard block
 block discarded – undo
876 904
 
877 905
 					foreach ($context['board_list'] as $id_cat => $cat)
878 906
 					{
879
-						if (!$first)
880
-							echo '
907
+						if (!$first) {
908
+													echo '
881 909
 											<hr>';
910
+						}
882 911
 						echo '
883 912
 											<strong>', $cat['name'], '</strong>
884 913
 											<ul>';
885 914
 
886
-						foreach ($cat['boards'] as $id_board => $brd)
887
-							echo '
915
+						foreach ($cat['boards'] as $id_board => $brd) {
916
+													echo '
888 917
 												<li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat('&nbsp; &nbsp;', $brd['child_level']) : '', $brd['name'], '</label></li>';
918
+						}
889 919
 
890 920
 						echo '
891 921
 											</ul>';
@@ -895,12 +925,14 @@  discard block
 block discarded – undo
895 925
 										</fieldset>';
896 926
 				}
897 927
 				// Text area?
898
-				elseif ($config_var['type'] == 'large_text')
899
-					echo '
928
+				elseif ($config_var['type'] == 'large_text') {
929
+									echo '
900 930
 										<textarea rows="', (!empty($config_var['size']) ? $config_var['size'] : (!empty($config_var['rows']) ? $config_var['rows'] : 4)), '" cols="', (!empty($config_var['cols']) ? $config_var['cols'] : 30), '" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>';
931
+				}
901 932
 				// Permission group?
902
-				elseif ($config_var['type'] == 'permissions')
903
-					theme_inline_permissions($config_var['name']);
933
+				elseif ($config_var['type'] == 'permissions') {
934
+									theme_inline_permissions($config_var['name']);
935
+				}
904 936
 
905 937
 				// BBC selection?
906 938
 				elseif ($config_var['type'] == 'bbc')
@@ -912,22 +944,24 @@  discard block
 block discarded – undo
912 944
 
913 945
 					foreach ($context['bbc_columns'] as $bbcColumn)
914 946
 					{
915
-						foreach ($bbcColumn as $bbcTag)
916
-							echo '
947
+						foreach ($bbcColumn as $bbcTag) {
948
+													echo '
917 949
 												<li class="list_bbc floatleft">
918 950
 													<input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked' : '', '> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', '
919 951
 												</li>';
952
+						}
920 953
 					}
921 954
 					echo '					</ul>
922 955
 											<input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked' : '', '> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label>
923 956
 										</fieldset>';
924 957
 				}
925 958
 				// A simple message?
926
-				elseif ($config_var['type'] == 'var_message')
927
-					echo '
959
+				elseif ($config_var['type'] == 'var_message') {
960
+									echo '
928 961
 										<div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>
929 962
 											', $config_var['var_message'], '
930 963
 										</div>';
964
+				}
931 965
 				// Assume it must be a text box
932 966
 				else
933 967
 				{
@@ -952,62 +986,70 @@  discard block
 block discarded – undo
952 986
 											' . $config_var['postinput'] : '','
953 987
 									</dd>';
954 988
 			}
955
-		}
956
-		else
989
+		} else
957 990
 		{
958 991
 			// Just show a separator.
959
-			if ($config_var == '')
960
-				echo '
992
+			if ($config_var == '') {
993
+							echo '
961 994
 								</dl>
962 995
 								<hr>
963 996
 								<dl class="settings">';
964
-			else
965
-				echo '
997
+			} else {
998
+							echo '
966 999
 									<dd>
967 1000
 										<strong>' . $config_var . '</strong>
968 1001
 									</dd>';
1002
+			}
969 1003
 		}
970 1004
 	}
971 1005
 
972
-	if ($is_open)
973
-		echo '
1006
+	if ($is_open) {
1007
+			echo '
974 1008
 								</dl>';
1009
+	}
975 1010
 
976
-	if (empty($context['settings_save_dont_show']))
977
-		echo '
1011
+	if (empty($context['settings_save_dont_show'])) {
1012
+			echo '
978 1013
 								<input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">';
1014
+	}
979 1015
 
980
-	if ($is_open)
981
-		echo '
1016
+	if ($is_open) {
1017
+			echo '
982 1018
 							</div><!-- .windowbg2 -->';
1019
+	}
983 1020
 
984 1021
 
985 1022
 	// At least one token has to be used!
986
-	if (isset($context['admin-ssc_token']))
987
-		echo '
1023
+	if (isset($context['admin-ssc_token'])) {
1024
+			echo '
988 1025
 							<input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">';
1026
+	}
989 1027
 
990
-	if (isset($context['admin-dbsc_token']))
991
-		echo '
1028
+	if (isset($context['admin-dbsc_token'])) {
1029
+			echo '
992 1030
 							<input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">';
1031
+	}
993 1032
 
994
-	if (isset($context['admin-mp_token']))
995
-		echo '
1033
+	if (isset($context['admin-mp_token'])) {
1034
+			echo '
996 1035
 							<input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">';
1036
+	}
997 1037
 
998 1038
 	echo '
999 1039
 							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1000 1040
 						</form>
1001 1041
 					</div><!-- #admincenter -->';
1002 1042
 
1003
-	if (!empty($context['settings_post_javascript']))
1004
-		echo '
1043
+	if (!empty($context['settings_post_javascript'])) {
1044
+			echo '
1005 1045
 					<script>
1006 1046
 						', $context['settings_post_javascript'], '
1007 1047
 					</script>';
1048
+	}
1008 1049
 
1009
-	if (!empty($context['settings_insert_below']))
1010
-		echo $context['settings_insert_below'];
1050
+	if (!empty($context['settings_insert_below'])) {
1051
+			echo $context['settings_insert_below'];
1052
+	}
1011 1053
 
1012 1054
 	// We may have added a board listing. If we did, we need to make it work.
1013 1055
 	addInlineJavascript('
@@ -1030,9 +1072,10 @@  discard block
 block discarded – undo
1030 1072
 {
1031 1073
 	global $context, $txt;
1032 1074
 
1033
-	if (!empty($context['saved_successful']))
1034
-		echo '
1075
+	if (!empty($context['saved_successful'])) {
1076
+			echo '
1035 1077
 					<div class="infobox">', $txt['settings_saved'], '</div>';
1078
+	}
1036 1079
 
1037 1080
 	// Standard fields.
1038 1081
 	template_show_list('standard_profile_fields');
@@ -1066,11 +1109,12 @@  discard block
 block discarded – undo
1066 1109
 	{
1067 1110
 		loadLanguage('Errors');
1068 1111
 
1069
-		if (isset($txt['custom_option_' . $_GET['msg']]))
1070
-			echo '
1112
+		if (isset($txt['custom_option_' . $_GET['msg']])) {
1113
+					echo '
1071 1114
 					<div class="errorbox">',
1072 1115
 						$txt['custom_option_' . $_GET['msg']], '
1073 1116
 					</div>';
1117
+		}
1074 1118
 	}
1075 1119
 
1076 1120
 	echo '
@@ -1137,9 +1181,10 @@  discard block
 block discarded – undo
1137 1181
 										<dd>
1138 1182
 											<select name="placement" id="placement">';
1139 1183
 
1140
-	foreach ($context['cust_profile_fields_placement'] as $order => $name)
1141
-		echo '
1184
+	foreach ($context['cust_profile_fields_placement'] as $order => $name) {
1185
+			echo '
1142 1186
 												<option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>';
1187
+	}
1143 1188
 
1144 1189
 	echo '
1145 1190
 											</select>
@@ -1163,9 +1208,10 @@  discard block
 block discarded – undo
1163 1208
 										<dd>
1164 1209
 											<select name="field_type" id="field_type" onchange="updateInputBoxes();">';
1165 1210
 
1166
-	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type)
1167
-		echo '
1211
+	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) {
1212
+			echo '
1168 1213
 												<option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>';
1214
+	}
1169 1215
 
1170 1216
 	echo '
1171 1217
 											</select>
@@ -1197,9 +1243,10 @@  discard block
 block discarded – undo
1197 1243
 										</dt>
1198 1244
 										<dd id="options_dd">';
1199 1245
 
1200
-	foreach ($context['field']['options'] as $k => $option)
1201
-		echo '
1246
+	foreach ($context['field']['options'] as $k => $option) {
1247
+			echo '
1202 1248
 											', $k == 0 ? '' : '<br>', '<input type="radio" name="default_select" value="', $k, '"', $context['field']['default_select'] == $option ? ' checked' : '', '><input type="text" name="select_option[', $k, ']" value="', $option, '">';
1249
+	}
1203 1250
 
1204 1251
 	echo '
1205 1252
 											<span id="addopt"></span>
@@ -1263,9 +1310,10 @@  discard block
 block discarded – undo
1263 1310
 								</fieldset>
1264 1311
 								<input type="submit" name="save" value="', $txt['save'], '" class="button">';
1265 1312
 
1266
-	if ($context['fid'])
1267
-		echo '
1313
+	if ($context['fid']) {
1314
+			echo '
1268 1315
 								<input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">';
1316
+	}
1269 1317
 
1270 1318
 	echo '
1271 1319
 							</div><!-- .windowbg2 -->
@@ -1312,8 +1360,7 @@  discard block
 block discarded – undo
1312 1360
 							<p class="centertext">
1313 1361
 								<strong>', $txt['admin_search_results_none'], '</strong>
1314 1362
 							</p>';
1315
-	}
1316
-	else
1363
+	} else
1317 1364
 	{
1318 1365
 		echo '
1319 1366
 							<ol class="search_results">';
@@ -1340,9 +1387,10 @@  discard block
 block discarded – undo
1340 1387
 								<li>
1341 1388
 									<a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']';
1342 1389
 
1343
-				if ($result['help'])
1344
-					echo '
1390
+				if ($result['help']) {
1391
+									echo '
1345 1392
 									<p class="double_height">', $result['help'], '</p>';
1393
+				}
1346 1394
 
1347 1395
 				echo '
1348 1396
 								</li>';
@@ -1382,10 +1430,11 @@  discard block
 block discarded – undo
1382 1430
 									<strong>', $txt['setup_verification_answer'], '</strong>
1383 1431
 								</dd>';
1384 1432
 
1385
-		if (!empty($context['qa_by_lang'][$lang_id]))
1386
-			foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1433
+		if (!empty($context['qa_by_lang'][$lang_id])) {
1434
+					foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1387 1435
 			{
1388 1436
 				$question = $context['question_answers'][$q_id];
1437
+		}
1389 1438
 
1390 1439
 				echo '
1391 1440
 								<dt>
@@ -1393,9 +1442,10 @@  discard block
 block discarded – undo
1393 1442
 								</dt>
1394 1443
 								<dd>';
1395 1444
 
1396
-				foreach ($question['answers'] as $answer)
1397
-					echo '
1445
+				foreach ($question['answers'] as $answer) {
1446
+									echo '
1398 1447
 									<input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">';
1448
+				}
1399 1449
 
1400 1450
 				echo '
1401 1451
 									<div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div>
@@ -1434,11 +1484,12 @@  discard block
 block discarded – undo
1434 1484
 							', $txt['errors_found'], ':
1435 1485
 							<ul>';
1436 1486
 
1437
-			foreach ($context['repair_errors'] as $error)
1438
-				echo '
1487
+			foreach ($context['repair_errors'] as $error) {
1488
+							echo '
1439 1489
 								<li>
1440 1490
 									', $error, '
1441 1491
 								</li>';
1492
+			}
1442 1493
 
1443 1494
 			echo '
1444 1495
 							</ul>
@@ -1448,16 +1499,15 @@  discard block
 block discarded – undo
1448 1499
 							<p class="padding">
1449 1500
 								<strong><a href="', $scripturl, '?action=admin;area=repairboards;fixErrors;', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=admin;area=maintain">', $txt['no'], '</a></strong>
1450 1501
 							</p>';
1451
-		}
1452
-		else
1453
-			echo '
1502
+		} else {
1503
+					echo '
1454 1504
 							<p>', $txt['maintain_no_errors'], '</p>
1455 1505
 							<p class="padding">
1456 1506
 								<a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
1457 1507
 							</p>';
1508
+		}
1458 1509
 
1459
-	}
1460
-	else
1510
+	} else
1461 1511
 	{
1462 1512
 		if (!empty($context['redirect_to_recount']))
1463 1513
 		{
@@ -1469,8 +1519,7 @@  discard block
 block discarded – undo
1469 1519
 								<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1470 1520
 								<input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '">
1471 1521
 							</form>';
1472
-		}
1473
-		else
1522
+		} else
1474 1523
 		{
1475 1524
 			echo '
1476 1525
 							<p>', $txt['errors_fixed'], '</p>
@@ -1561,9 +1610,10 @@  discard block
 block discarded – undo
1561 1610
 								<tr class="windowbg">
1562 1611
 									<td class="equal_table">', $key, '</td>';
1563 1612
 
1564
-				foreach ($setting as $key_lm => $value)
1565
-					echo '
1613
+				foreach ($setting as $key_lm => $value) {
1614
+									echo '
1566 1615
 									<td class="equal_table">', $value, '</td>';
1616
+				}
1567 1617
 
1568 1618
 				echo '
1569 1619
 								</tr>';
@@ -1623,8 +1673,8 @@  discard block
 block discarded – undo
1623 1673
 {
1624 1674
 	global $context, $txt;
1625 1675
 
1626
-	if ($context['user']['is_admin'])
1627
-		echo '
1676
+	if ($context['user']['is_admin']) {
1677
+			echo '
1628 1678
 								<span class="floatright admin_search">
1629 1679
 									<span class="generic_icons filter centericon"></span>
1630 1680
 									<input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';">
@@ -1635,6 +1685,7 @@  discard block
 block discarded – undo
1635 1685
 									</select>
1636 1686
 									<input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button">
1637 1687
 								</span>';
1638
-}
1688
+	}
1689
+	}
1639 1690
 
1640 1691
 ?>
1641 1692
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/ManageNews.template.php 1 patch
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,9 +18,10 @@  discard block
 block discarded – undo
18 18
 	global $context, $txt, $scripturl;
19 19
 
20 20
 	// Are we done sending the newsletter?
21
-	if (!empty($context['newsletter_sent']))
22
-		echo '
21
+	if (!empty($context['newsletter_sent'])) {
22
+			echo '
23 23
 	<div class="infobox">', $txt['admin_news_newsletter_' . $context['newsletter_sent']], '</div>';
24
+	}
24 25
 
25 26
 	echo '
26 27
 	<div id="admincenter">
@@ -39,9 +40,10 @@  discard block
 block discarded – undo
39 40
 					</dt>
40 41
 					<dd>';
41 42
 
42
-	foreach ($context['groups'] as $group)
43
-		echo '
43
+	foreach ($context['groups'] as $group) {
44
+			echo '
44 45
 						<label for="groups_', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>';
46
+	}
45 47
 
46 48
 	echo '
47 49
 						<br>
@@ -82,9 +84,10 @@  discard block
 block discarded – undo
82 84
 						</dt>
83 85
 						<dd>';
84 86
 
85
-	foreach ($context['groups'] as $group)
86
-		echo '
87
+	foreach ($context['groups'] as $group) {
88
+			echo '
87 89
 							<label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>';
90
+	}
88 91
 
89 92
 	echo '
90 93
 							<br>
@@ -230,9 +233,10 @@  discard block
 block discarded – undo
230 233
 				<div id="bbcBox_message"></div>';
231 234
 
232 235
 	// What about smileys?
233
-	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
234
-		echo '
236
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) {
237
+			echo '
235 238
 				<div id="smileyBox_message"></div>';
239
+	}
236 240
 
237 241
 	// Show BBC buttons, smileys and textbox.
238 242
 	echo '
@@ -253,9 +257,10 @@  discard block
 block discarded – undo
253 257
 			<input type="hidden" name="email_force" value="', $context['email_force'], '">
254 258
 			<input type="hidden" name="total_emails" value="', $context['total_emails'], '">';
255 259
 
256
-	foreach ($context['recipients'] as $key => $values)
257
-		echo '
260
+	foreach ($context['recipients'] as $key => $values) {
261
+			echo '
258 262
 			<input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">';
263
+	}
259 264
 
260 265
 	echo '
261 266
 			<script>';
@@ -413,9 +418,10 @@  discard block
 block discarded – undo
413 418
 				<input type="hidden" name="parse_html" value="', $context['parse_html'], '">';
414 419
 
415 420
 	// All the things we must remember!
416
-	foreach ($context['recipients'] as $key => $values)
417
-		echo '
421
+	foreach ($context['recipients'] as $key => $values) {
422
+			echo '
418 423
 				<input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">';
424
+	}
419 425
 
420 426
 	echo '
421 427
 			</div><!-- .windowbg -->
@@ -448,9 +454,10 @@  discard block
 block discarded – undo
448 454
 {
449 455
 	global $context, $txt;
450 456
 
451
-	if (!empty($context['saved_successful']))
452
-		echo '
457
+	if (!empty($context['saved_successful'])) {
458
+			echo '
453 459
 			<div class="infobox">', $txt['settings_saved'], '</div>';
460
+	}
454 461
 
455 462
 	template_show_list('news_lists');
456 463
 }
Please login to merge, or discard this patch.
Themes/default/ManageMembers.template.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
 				</thead>
149 149
 				<tbody>';
150 150
 
151
-	foreach ($context['membergroups'] as $membergroup)
152
-		echo '
151
+	foreach ($context['membergroups'] as $membergroup) {
152
+			echo '
153 153
 					<tr class="windowbg">
154 154
 						<td>', $membergroup['name'], '</td>
155 155
 						<td class="centercol">
@@ -159,6 +159,7 @@  discard block
 block discarded – undo
159 159
 							', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked>' : '', '
160 160
 						</td>
161 161
 					</tr>';
162
+	}
162 163
 
163 164
 	echo '
164 165
 					<tr class="windowbg">
@@ -185,8 +186,8 @@  discard block
 block discarded – undo
185 186
 				</thead>
186 187
 				<tbody>';
187 188
 
188
-	foreach ($context['postgroups'] as $postgroup)
189
-		echo '
189
+	foreach ($context['postgroups'] as $postgroup) {
190
+			echo '
190 191
 					<tr class="windowbg">
191 192
 						<td>
192 193
 							', $postgroup['name'], '
@@ -195,6 +196,7 @@  discard block
 block discarded – undo
195 196
 							<input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked>
196 197
 						</td>
197 198
 					</tr>';
199
+	}
198 200
 
199 201
 	echo '
200 202
 					<tr class="windowbg">
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3096,8 +3096,7 @@
 block discarded – undo
3096 3096
 			<div class="roundframe">
3097 3097
 				<div>
3098 3098
 		', !empty($context['tfa_backup']) ? '
3099
-					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' :
3100
-			($modSettings['tfa_mode'] == 2 ? '
3099
+					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? '
3101 3100
 									<div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), '
3102 3101
 									<div class="smalltext">', $txt['tfa_desc'], '</div>
3103 3102
 									<div class="floatleft">
Please login to merge, or discard this patch.
Braces   +508 added lines, -392 removed lines patch added patch discarded remove patch
@@ -18,23 +18,25 @@  discard block
 block discarded – undo
18 18
 	global $context;
19 19
 
20 20
 	// Prevent Chrome from auto completing fields when viewing/editing other members profiles
21
-	if (isBrowser('is_chrome') && !$context['user']['is_owner'])
22
-		echo '
21
+	if (isBrowser('is_chrome') && !$context['user']['is_owner']) {
22
+			echo '
23 23
 			<script>
24 24
 				disableAutoComplete();
25 25
 			</script>';
26
+	}
26 27
 
27 28
 	// If an error occurred while trying to save previously, give the user a clue!
28 29
 	echo '
29 30
 			', template_error_message();
30 31
 
31 32
 	// If the profile was update successfully, let the user know this.
32
-	if (!empty($context['profile_updated']))
33
-		echo '
33
+	if (!empty($context['profile_updated'])) {
34
+			echo '
34 35
 			<div class="infobox">
35 36
 				', $context['profile_updated'], '
36 37
 			</div>';
37
-}
38
+	}
39
+	}
38 40
 
39 41
 /**
40 42
  * Template for any HTML needed below the profile (closing off divs/tables, etc.)
@@ -99,19 +101,19 @@  discard block
 block discarded – undo
99 101
 		</div>
100 102
 		<div class="alerts_unread">';
101 103
 
102
-	if (empty($context['unread_alerts']))
103
-		template_alerts_all_read();
104
-
105
-	else
104
+	if (empty($context['unread_alerts'])) {
105
+			template_alerts_all_read();
106
+	} else
106 107
 	{
107
-		foreach ($context['unread_alerts'] as $id_alert => $details)
108
-			echo '
108
+		foreach ($context['unread_alerts'] as $id_alert => $details) {
109
+					echo '
109 110
 			<div class="unread">
110 111
 				', !empty($details['sender']) ? $details['sender']['avatar']['image'] : '', '
111 112
 				<div class="details">
112 113
 					', !empty($details['icon']) ? $details['icon'] : '', '<span>', $details['text'], '</span> - ', $details['time'], '
113 114
 				</div>
114 115
 			</div>';
116
+		}
115 117
 	}
116 118
 
117 119
 	echo '
@@ -161,10 +163,11 @@  discard block
 block discarded – undo
161 163
 			<div class="custom_fields_above_name">
162 164
 				<ul>';
163 165
 
164
-		foreach ($context['print_custom_fields']['above_member'] as $field)
165
-			if (!empty($field['output_html']))
166
+		foreach ($context['print_custom_fields']['above_member'] as $field) {
167
+					if (!empty($field['output_html']))
166 168
 				echo '
167 169
 					<li>', $field['output_html'], '</li>';
170
+		}
168 171
 
169 172
 		echo '
170 173
 				</ul>
@@ -176,20 +179,22 @@  discard block
 block discarded – undo
176 179
 			<div class="username clear">
177 180
 				<h4>';
178 181
 
179
-	if (!empty($context['print_custom_fields']['before_member']))
180
-		foreach ($context['print_custom_fields']['before_member'] as $field)
182
+	if (!empty($context['print_custom_fields']['before_member'])) {
183
+			foreach ($context['print_custom_fields']['before_member'] as $field)
181 184
 			if (!empty($field['output_html']))
182 185
 				echo '
183 186
 					<span>', $field['output_html'], '</span>';
187
+	}
184 188
 
185 189
 	echo '
186 190
 					', $context['member']['name'];
187 191
 
188
-	if (!empty($context['print_custom_fields']['after_member']))
189
-		foreach ($context['print_custom_fields']['after_member'] as $field)
192
+	if (!empty($context['print_custom_fields']['after_member'])) {
193
+			foreach ($context['print_custom_fields']['after_member'] as $field)
190 194
 			if (!empty($field['output_html']))
191 195
 				echo '
192 196
 					<span>', $field['output_html'], '</span>';
197
+	}
193 198
 
194 199
 
195 200
 	echo '
@@ -205,10 +210,11 @@  discard block
 block discarded – undo
205 210
 			<div class="custom_fields_below_avatar">
206 211
 				<ul>';
207 212
 
208
-		foreach ($context['print_custom_fields']['below_avatar'] as $field)
209
-			if (!empty($field['output_html']))
213
+		foreach ($context['print_custom_fields']['below_avatar'] as $field) {
214
+					if (!empty($field['output_html']))
210 215
 				echo '
211 216
 					<li>', $field['output_html'], '</li>';
217
+		}
212 218
 
213 219
 		echo '
214 220
 				</ul>
@@ -220,22 +226,25 @@  discard block
 block discarded – undo
220 226
 			<ul class="clear">';
221 227
 
222 228
 	// Email is only visible if it's your profile or you have the moderate_forum permission
223
-	if ($context['member']['show_email'])
224
-		echo '
229
+	if ($context['member']['show_email']) {
230
+			echo '
225 231
 				<li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>';
232
+	}
226 233
 
227 234
 	// Don't show an icon if they haven't specified a website.
228
-	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
229
-		echo '
235
+	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) {
236
+			echo '
230 237
 				<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
238
+	}
231 239
 
232 240
 	// Are there any custom profile fields as icons?
233 241
 	if (!empty($context['print_custom_fields']['icons']))
234 242
 	{
235
-		foreach ($context['print_custom_fields']['icons'] as $field)
236
-			if (!empty($field['output_html']))
243
+		foreach ($context['print_custom_fields']['icons'] as $field) {
244
+					if (!empty($field['output_html']))
237 245
 				echo '
238 246
 				<li class="custom_field">', $field['output_html'], '</li>';
247
+		}
239 248
 	}
240 249
 
241 250
 	echo '
@@ -244,24 +253,27 @@  discard block
 block discarded – undo
244 253
 				', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : '';
245 254
 
246 255
 	// Can they add this member as a buddy?
247
-	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
248
-		echo '
256
+	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) {
257
+			echo '
249 258
 				<br>
250 259
 				<a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
260
+	}
251 261
 
252 262
 	echo '
253 263
 			</span>';
254 264
 
255
-	if (!$context['user']['is_owner'] && $context['can_send_pm'])
256
-		echo '
265
+	if (!$context['user']['is_owner'] && $context['can_send_pm']) {
266
+			echo '
257 267
 			<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>';
268
+	}
258 269
 
259 270
 	echo '
260 271
 			<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>';
261 272
 
262
-	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled']))
263
-		echo '
273
+	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) {
274
+			echo '
264 275
 			<a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>';
276
+	}
265 277
 
266 278
 	echo '
267 279
 			<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>';
@@ -273,10 +285,11 @@  discard block
 block discarded – undo
273 285
 			<div class="custom_fields_bottom">
274 286
 				<ul class="nolist">';
275 287
 
276
-		foreach ($context['print_custom_fields']['bottom_poster'] as $field)
277
-			if (!empty($field['output_html']))
288
+		foreach ($context['print_custom_fields']['bottom_poster'] as $field) {
289
+					if (!empty($field['output_html']))
278 290
 				echo '
279 291
 					<li>', $field['output_html'], '</li>';
292
+		}
280 293
 
281 294
 		echo '
282 295
 				</ul>
@@ -289,30 +302,35 @@  discard block
 block discarded – undo
289 302
 		<div id="detailedinfo">
290 303
 			<dl class="settings">';
291 304
 
292
-	if ($context['user']['is_owner'] || $context['user']['is_admin'])
293
-		echo '
305
+	if ($context['user']['is_owner'] || $context['user']['is_admin']) {
306
+			echo '
294 307
 				<dt>', $txt['username'], ': </dt>
295 308
 				<dd>', $context['member']['username'], '</dd>';
309
+	}
296 310
 
297
-	if (!isset($context['disabled_fields']['posts']))
298
-		echo '
311
+	if (!isset($context['disabled_fields']['posts'])) {
312
+			echo '
299 313
 				<dt>', $txt['profile_posts'], ': </dt>
300 314
 				<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
315
+	}
301 316
 
302
-	if ($context['member']['show_email'])
303
-		echo '
317
+	if ($context['member']['show_email']) {
318
+			echo '
304 319
 				<dt>', $txt['email'], ': </dt>
305 320
 				<dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>';
321
+	}
306 322
 
307
-	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
308
-		echo '
323
+	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) {
324
+			echo '
309 325
 				<dt>', $txt['custom_title'], ': </dt>
310 326
 				<dd>', $context['member']['title'], '</dd>';
327
+	}
311 328
 
312
-	if (!empty($context['member']['blurb']))
313
-		echo '
329
+	if (!empty($context['member']['blurb'])) {
330
+			echo '
314 331
 				<dt>', $txt['personal_text'], ': </dt>
315 332
 				<dd>', $context['member']['blurb'], '</dd>';
333
+	}
316 334
 
317 335
 	echo '
318 336
 				<dt>', $txt['age'], ':</dt>
@@ -326,19 +344,21 @@  discard block
 block discarded – undo
326 344
 	{
327 345
 		$fields = array();
328 346
 
329
-		foreach ($context['print_custom_fields']['standard'] as $field)
330
-			if (!empty($field['output_html']))
347
+		foreach ($context['print_custom_fields']['standard'] as $field) {
348
+					if (!empty($field['output_html']))
331 349
 				$fields[] = $field;
350
+		}
332 351
 
333 352
 		if (count($fields) > 0)
334 353
 		{
335 354
 			echo '
336 355
 			<dl class="settings">';
337 356
 
338
-			foreach ($fields as $field)
339
-				echo '
357
+			foreach ($fields as $field) {
358
+							echo '
340 359
 				<dt>', $field['name'], ':</dt>
341 360
 				<dd>', $field['output_html'], '</dd>';
361
+			}
342 362
 
343 363
 			echo '
344 364
 			</dl>';
@@ -358,9 +378,10 @@  discard block
 block discarded – undo
358 378
 					<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>';
359 379
 
360 380
 		// Can we provide information on what this means?
361
-		if (!empty($context['warning_status']))
362
-			echo '
381
+		if (!empty($context['warning_status'])) {
382
+					echo '
363 383
 					<span class="smalltext">(', $context['warning_status'], ')</span>';
384
+		}
364 385
 
365 386
 		echo '
366 387
 				</dd>';
@@ -371,11 +392,12 @@  discard block
 block discarded – undo
371 392
 	{
372 393
 
373 394
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
374
-		if (!empty($context['activate_message']))
375
-			echo '
395
+		if (!empty($context['activate_message'])) {
396
+					echo '
376 397
 				<dt class="clear">
377 398
 					<span class="alert">', $context['activate_message'], '</span> (<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="' . $txt['profileConfirm'] . '"' : ''), '>', $context['activate_link_text'], '</a>)
378 399
 				</dt>';
400
+		}
379 401
 
380 402
 		// If the current member is banned, show a message and possibly a link to the ban.
381 403
 		if (!empty($context['member']['bans']))
@@ -387,10 +409,11 @@  discard block
 block discarded – undo
387 409
 				<dt class="clear" id="ban_info" style="display: none;">
388 410
 					<strong>', $txt['user_banned_by_following'], ':</strong>';
389 411
 
390
-			foreach ($context['member']['bans'] as $ban)
391
-				echo '
412
+			foreach ($context['member']['bans'] as $ban) {
413
+							echo '
392 414
 					<br>
393 415
 					<span class="smalltext">', $ban['explanation'], '</span>';
416
+			}
394 417
 
395 418
 			echo '
396 419
 				</dt>';
@@ -404,30 +427,34 @@  discard block
 block discarded – undo
404 427
 	// If the person looking is allowed, they can check the members IP address and hostname.
405 428
 	if ($context['can_see_ip'])
406 429
 	{
407
-		if (!empty($context['member']['ip']))
408
-		echo '
430
+		if (!empty($context['member']['ip'])) {
431
+				echo '
409 432
 				<dt>', $txt['ip'], ': </dt>
410 433
 				<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
434
+		}
411 435
 
412
-		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
413
-			echo '
436
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) {
437
+					echo '
414 438
 				<dt>', $txt['hostname'], ': </dt>
415 439
 				<dd>', $context['member']['hostname'], '</dd>';
440
+		}
416 441
 	}
417 442
 
418 443
 	echo '
419 444
 				<dt>', $txt['local_time'], ':</dt>
420 445
 				<dd>', $context['member']['local_time'], '</dd>';
421 446
 
422
-	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
423
-		echo '
447
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) {
448
+			echo '
424 449
 				<dt>', $txt['language'], ':</dt>
425 450
 				<dd>', $context['member']['language'], '</dd>';
451
+	}
426 452
 
427
-	if ($context['member']['show_last_login'])
428
-		echo '
453
+	if ($context['member']['show_last_login']) {
454
+			echo '
429 455
 				<dt>', $txt['lastLoggedIn'], ': </dt>
430 456
 				<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
457
+	}
431 458
 
432 459
 	echo '
433 460
 			</dl>';
@@ -439,10 +466,11 @@  discard block
 block discarded – undo
439 466
 			<div class="custom_fields_above_signature">
440 467
 				<ul class="nolist">';
441 468
 
442
-		foreach ($context['print_custom_fields']['above_signature'] as $field)
443
-			if (!empty($field['output_html']))
469
+		foreach ($context['print_custom_fields']['above_signature'] as $field) {
470
+					if (!empty($field['output_html']))
444 471
 				echo '
445 472
 					<li>', $field['output_html'], '</li>';
473
+		}
446 474
 
447 475
 		echo '
448 476
 				</ul>
@@ -450,12 +478,13 @@  discard block
 block discarded – undo
450 478
 	}
451 479
 
452 480
 	// Show the users signature.
453
-	if ($context['signature_enabled'] && !empty($context['member']['signature']))
454
-		echo '
481
+	if ($context['signature_enabled'] && !empty($context['member']['signature'])) {
482
+			echo '
455 483
 			<div class="signature">
456 484
 				<h5>', $txt['signature'], ':</h5>
457 485
 				', $context['member']['signature'], '
458 486
 			</div>';
487
+	}
459 488
 
460 489
 	// Are there any custom profile fields for below the signature?
461 490
 	if (!empty($context['print_custom_fields']['below_signature']))
@@ -464,10 +493,11 @@  discard block
 block discarded – undo
464 493
 			<div class="custom_fields_below_signature">
465 494
 				<ul class="nolist">';
466 495
 
467
-		foreach ($context['print_custom_fields']['below_signature'] as $field)
468
-			if (!empty($field['output_html']))
496
+		foreach ($context['print_custom_fields']['below_signature'] as $field) {
497
+					if (!empty($field['output_html']))
469 498
 				echo '
470 499
 					<li>', $field['output_html'], '</li>';
500
+		}
471 501
 
472 502
 		echo '
473 503
 				</ul>
@@ -513,62 +543,70 @@  discard block
 block discarded – undo
513 543
 			</div>
514 544
 			<div class="list_posts">';
515 545
 
516
-			if (!$post['approved'])
517
-				echo '
546
+			if (!$post['approved']) {
547
+							echo '
518 548
 				<div class="approve_post">
519 549
 					<em>', $txt['post_awaiting_approval'], '</em>
520 550
 				</div>';
551
+			}
521 552
 
522 553
 			echo '
523 554
 				', $post['body'], '
524 555
 			</div>';
525 556
 
526
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
527
-				echo '
557
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
558
+							echo '
528 559
 			<div class="floatright">
529 560
 				<ul class="quickbuttons">';
561
+			}
530 562
 
531 563
 			// If they *can* reply?
532
-			if ($post['can_reply'])
533
-				echo '
564
+			if ($post['can_reply']) {
565
+							echo '
534 566
 					<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
567
+			}
535 568
 
536 569
 			// If they *can* quote?
537
-			if ($post['can_quote'])
538
-				echo '
570
+			if ($post['can_quote']) {
571
+							echo '
539 572
 					<li><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
573
+			}
540 574
 
541 575
 			// How about... even... remove it entirely?!
542
-			if ($post['can_delete'])
543
-				echo '
576
+			if ($post['can_delete']) {
577
+							echo '
544 578
 					<li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
579
+			}
545 580
 
546
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
547
-				echo '
581
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
582
+							echo '
548 583
 				</ul>
549 584
 			</div><!-- .floatright -->';
585
+			}
550 586
 
551 587
 			echo '
552 588
 		</div><!-- $post[css_class] -->';
553 589
 		}
590
+	} else {
591
+			template_show_list('attachments');
554 592
 	}
555
-	else
556
-		template_show_list('attachments');
557 593
 
558 594
 	// No posts? Just end with a informative message.
559
-	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
560
-		echo '
595
+	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) {
596
+			echo '
561 597
 		<div class="windowbg2">
562 598
 			', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
563 599
 		</div>';
600
+	}
564 601
 
565 602
 	// Show more page numbers.
566
-	if (!empty($context['page_index']))
567
-		echo '
603
+	if (!empty($context['page_index'])) {
604
+			echo '
568 605
 		<div class="pagesection">
569 606
 			<div class="pagelinks">', $context['page_index'], '</div>
570 607
 		</div>';
571
-}
608
+	}
609
+	}
572 610
 
573 611
 /**
574 612
  * Template for showing alerts within the alerts popup
@@ -578,11 +616,12 @@  discard block
 block discarded – undo
578 616
 	global $context, $txt, $scripturl;
579 617
 
580 618
 	// Do we have an update message?
581
-	if (!empty($context['update_message']))
582
-		echo '
619
+	if (!empty($context['update_message'])) {
620
+			echo '
583 621
 		<div class="infobox">
584 622
 			', $context['update_message'], '.
585 623
 		</div>';
624
+	}
586 625
 
587 626
 	echo '
588 627
 		<div class="cat_bar">
@@ -591,13 +630,12 @@  discard block
 block discarded – undo
591 630
 			</h3>
592 631
 		</div>';
593 632
 
594
-	if (empty($context['alerts']))
595
-		echo '
633
+	if (empty($context['alerts'])) {
634
+			echo '
596 635
 		<div class="information">
597 636
 			', $txt['alerts_none'], '
598 637
 		</div>';
599
-
600
-	else
638
+	} else
601 639
 	{
602 640
 		// Start the form.
603 641
 		echo '
@@ -659,12 +697,12 @@  discard block
 block discarded – undo
659 697
 		</div>' : '';
660 698
 
661 699
 	// No drafts? Just show an informative message.
662
-	if (empty($context['drafts']))
663
-		echo '
700
+	if (empty($context['drafts'])) {
701
+			echo '
664 702
 		<div class="windowbg2 centertext">
665 703
 			', $txt['draft_none'], '
666 704
 		</div>';
667
-	else
705
+	} else
668 706
 	{
669 707
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
670 708
 		foreach ($context['drafts'] as $draft)
@@ -676,13 +714,15 @@  discard block
 block discarded – undo
676 714
 				<h5>
677 715
 					<strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
678 716
 
679
-			if (!empty($draft['sticky']))
680
-				echo '
717
+			if (!empty($draft['sticky'])) {
718
+							echo '
681 719
 					<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
720
+			}
682 721
 
683
-			if (!empty($draft['locked']))
684
-				echo '
722
+			if (!empty($draft['locked'])) {
723
+							echo '
685 724
 					<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
725
+			}
686 726
 
687 727
 			echo '
688 728
 				</h5>
@@ -715,13 +755,13 @@  discard block
 block discarded – undo
715 755
 {
716 756
 	global $context, $scripturl, $txt;
717 757
 
718
-	if (!empty($context['saved_successful']))
719
-		echo '
758
+	if (!empty($context['saved_successful'])) {
759
+			echo '
720 760
 	<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
721
-
722
-	elseif (!empty($context['saved_failed']))
723
-		echo '
761
+	} elseif (!empty($context['saved_failed'])) {
762
+			echo '
724 763
 	<div class="errorbox">', $context['saved_failed'], '</div>';
764
+	}
725 765
 
726 766
 	echo '
727 767
 	<div id="edit_buddies">
@@ -736,14 +776,16 @@  discard block
 block discarded – undo
736 776
 					<th scope="col" class="quarter_table">', $txt['name'], '</th>
737 777
 					<th scope="col">', $txt['status'], '</th>';
738 778
 
739
-	if (allowedTo('moderate_forum'))
740
-		echo '
779
+	if (allowedTo('moderate_forum')) {
780
+			echo '
741 781
 					<th scope="col">', $txt['email'], '</th>';
782
+	}
742 783
 
743
-	if (!empty($context['custom_pf']))
744
-		foreach ($context['custom_pf'] as $column)
784
+	if (!empty($context['custom_pf'])) {
785
+			foreach ($context['custom_pf'] as $column)
745 786
 				echo '
746 787
 					<th scope="col">', $column['label'], '</th>';
788
+	}
747 789
 
748 790
 	echo '
749 791
 					<th scope="col">', $txt['remove'], '</th>
@@ -752,13 +794,14 @@  discard block
 block discarded – undo
752 794
 			<tbody>';
753 795
 
754 796
 	// If they don't have any buddies don't list them!
755
-	if (empty($context['buddies']))
756
-		echo '
797
+	if (empty($context['buddies'])) {
798
+			echo '
757 799
 				<tr class="windowbg">
758 800
 					<td colspan="', allowedTo('moderate_forum') ? '10' : '9', '">
759 801
 						<strong>', $txt['no_buddies'], '</strong>
760 802
 					</td>
761 803
 				</tr>';
804
+	}
762 805
 
763 806
 		// Now loop through each buddy showing info on each.
764 807
 	else
@@ -772,17 +815,19 @@  discard block
 block discarded – undo
772 815
 						<a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a>
773 816
 					</td>';
774 817
 
775
-			if ($buddy['show_email'])
776
-				echo '
818
+			if ($buddy['show_email']) {
819
+							echo '
777 820
 					<td>
778 821
 						<a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a>
779 822
 					</td>';
823
+			}
780 824
 
781 825
 			// Show the custom profile fields for this user.
782
-			if (!empty($context['custom_pf']))
783
-				foreach ($context['custom_pf'] as $key => $column)
826
+			if (!empty($context['custom_pf'])) {
827
+							foreach ($context['custom_pf'] as $key => $column)
784 828
 					echo '
785 829
 					<td class="lefttext">', $buddy['options'][$key], '</td>';
830
+			}
786 831
 
787 832
 			echo '
788 833
 					<td>
@@ -815,9 +860,10 @@  discard block
 block discarded – undo
815 860
 			</dl>
816 861
 		</div>';
817 862
 
818
-	if (!empty($context['token_check']))
819
-		echo '
863
+	if (!empty($context['token_check'])) {
864
+			echo '
820 865
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
866
+	}
821 867
 
822 868
 	echo '
823 869
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -843,13 +889,13 @@  discard block
 block discarded – undo
843 889
 {
844 890
 	global $context, $scripturl, $txt;
845 891
 
846
-	if (!empty($context['saved_successful']))
847
-		echo '
892
+	if (!empty($context['saved_successful'])) {
893
+			echo '
848 894
 	<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
849
-
850
-	elseif (!empty($context['saved_failed']))
851
-		echo '
895
+	} elseif (!empty($context['saved_failed'])) {
896
+			echo '
852 897
 	<div class="errorbox">', $context['saved_failed'], '</div>';
898
+	}
853 899
 
854 900
 	echo '
855 901
 	<div id="edit_buddies">
@@ -864,9 +910,10 @@  discard block
 block discarded – undo
864 910
 					<th scope="col" class="quarter_table">', $txt['name'], '</th>
865 911
 					<th scope="col">', $txt['status'], '</th>';
866 912
 
867
-	if (allowedTo('moderate_forum'))
868
-		echo '
913
+	if (allowedTo('moderate_forum')) {
914
+			echo '
869 915
 					<th scope="col">', $txt['email'], '</th>';
916
+	}
870 917
 
871 918
 	echo '
872 919
 					<th scope="col">', $txt['ignore_remove'], '</th>
@@ -875,13 +922,14 @@  discard block
 block discarded – undo
875 922
 			<tbody>';
876 923
 
877 924
 	// If they don't have anyone on their ignore list, don't list it!
878
-	if (empty($context['ignore_list']))
879
-		echo '
925
+	if (empty($context['ignore_list'])) {
926
+			echo '
880 927
 				<tr class="windowbg">
881 928
 					<td colspan="', allowedTo('moderate_forum') ? '4' : '3', '">
882 929
 						<strong>', $txt['no_ignore'], '</strong>
883 930
 					</td>
884 931
 				</tr>';
932
+	}
885 933
 
886 934
 	// Now loop through each buddy showing info on each.
887 935
 	foreach ($context['ignore_list'] as $member)
@@ -893,11 +941,12 @@  discard block
 block discarded – undo
893 941
 						<a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a>
894 942
 					</td>';
895 943
 
896
-		if ($member['show_email'])
897
-			echo '
944
+		if ($member['show_email']) {
945
+					echo '
898 946
 					<td>
899 947
 						<a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a>
900 948
 					</td>';
949
+		}
901 950
 		echo '
902 951
 					<td>
903 952
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['ignore_remove'], '"></span></a>
@@ -927,9 +976,10 @@  discard block
 block discarded – undo
927 976
 			</dl>
928 977
 		</div>';
929 978
 
930
-	if (!empty($context['token_check']))
931
-		echo '
979
+	if (!empty($context['token_check'])) {
980
+			echo '
932 981
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
982
+	}
933 983
 
934 984
 	echo '
935 985
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -975,9 +1025,10 @@  discard block
 block discarded – undo
975 1025
 					<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
976 1026
 
977 1027
 	// Second address detected?
978
-	if (!empty($context['last_ip2']))
979
-		echo '
1028
+	if (!empty($context['last_ip2'])) {
1029
+			echo '
980 1030
 					, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
1031
+	}
981 1032
 
982 1033
 	echo '
983 1034
 				</dd>';
@@ -1043,9 +1094,10 @@  discard block
 block discarded – undo
1043 1094
 		</div>
1044 1095
 		<div class="windowbg2 noup">';
1045 1096
 
1046
-		foreach ($context['whois_servers'] as $server)
1047
-			echo '
1097
+		foreach ($context['whois_servers'] as $server) {
1098
+					echo '
1048 1099
 			<a href="', $server['url'], '" target="_blank"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>';
1100
+		}
1049 1101
 		echo '
1050 1102
 		</div>
1051 1103
 		<br>';
@@ -1057,13 +1109,12 @@  discard block
 block discarded – undo
1057 1109
 			<h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
1058 1110
 		</div>';
1059 1111
 
1060
-	if (empty($context['ips']))
1061
-		echo '
1112
+	if (empty($context['ips'])) {
1113
+			echo '
1062 1114
 		<p class="windowbg2 description">
1063 1115
 			<em>', $txt['no_members_from_ip'], '</em>
1064 1116
 		</p>';
1065
-
1066
-	else
1117
+	} else
1067 1118
 	{
1068 1119
 		echo '
1069 1120
 		<table class="table_grid">
@@ -1076,12 +1127,13 @@  discard block
 block discarded – undo
1076 1127
 			<tbody>';
1077 1128
 
1078 1129
 		// Loop through each of the members and display them.
1079
-		foreach ($context['ips'] as $ip => $memberlist)
1080
-			echo '
1130
+		foreach ($context['ips'] as $ip => $memberlist) {
1131
+					echo '
1081 1132
 				<tr class="windowbg">
1082 1133
 					<td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
1083 1134
 					<td>', implode(', ', $memberlist), '</td>
1084 1135
 				</tr>';
1136
+		}
1085 1137
 
1086 1138
 		echo '
1087 1139
 			</tbody>
@@ -1123,11 +1175,10 @@  discard block
 block discarded – undo
1123 1175
 			</h3>
1124 1176
 		</div>';
1125 1177
 
1126
-	if ($context['member']['has_all_permissions'])
1127
-		echo '
1178
+	if ($context['member']['has_all_permissions']) {
1179
+			echo '
1128 1180
 		<div class="information">', $txt['showPermissions_all'], '</div>';
1129
-
1130
-	else
1181
+	} else
1131 1182
 	{
1132 1183
 		echo '
1133 1184
 		<div class="information">',$txt['showPermissions_help'], '</div>
@@ -1142,9 +1193,10 @@  discard block
 block discarded – undo
1142 1193
 			<div class="windowbg smalltext">
1143 1194
 				', $txt['showPermissions_restricted_boards_desc'], ':<br>';
1144 1195
 
1145
-			foreach ($context['no_access_boards'] as $no_access_board)
1146
-				echo '
1196
+			foreach ($context['no_access_boards'] as $no_access_board) {
1197
+							echo '
1147 1198
 				<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
1199
+			}
1148 1200
 			echo '
1149 1201
 			</div>';
1150 1202
 		}
@@ -1176,12 +1228,13 @@  discard block
 block discarded – undo
1176 1228
 							</td>
1177 1229
 							<td class="smalltext">';
1178 1230
 
1179
-				if ($permission['is_denied'])
1180
-					echo '
1231
+				if ($permission['is_denied']) {
1232
+									echo '
1181 1233
 								<span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>';
1182
-				else
1183
-					echo '
1234
+				} else {
1235
+									echo '
1184 1236
 								', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
1237
+				}
1185 1238
 
1186 1239
 				echo '
1187 1240
 							</td>
@@ -1192,10 +1245,10 @@  discard block
 block discarded – undo
1192 1245
 				</table>
1193 1246
 			</div><!-- .tborder -->
1194 1247
 			<br>';
1195
-		}
1196
-		else
1197
-			echo '
1248
+		} else {
1249
+					echo '
1198 1250
 			<p class="windowbg2">', $txt['showPermissions_none_general'], '</p>';
1251
+		}
1199 1252
 
1200 1253
 		// Board permission section.
1201 1254
 		echo '
@@ -1206,14 +1259,16 @@  discard block
 block discarded – undo
1206 1259
 						<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
1207 1260
 							<option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], '</option>';
1208 1261
 
1209
-		if (!empty($context['boards']))
1210
-			echo '
1262
+		if (!empty($context['boards'])) {
1263
+					echo '
1211 1264
 							<option value="" disabled>---------------------------</option>';
1265
+		}
1212 1266
 
1213 1267
 		// Fill the box with any local permission boards.
1214
-		foreach ($context['boards'] as $board)
1215
-			echo '
1268
+		foreach ($context['boards'] as $board) {
1269
+					echo '
1216 1270
 							<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
1271
+		}
1217 1272
 
1218 1273
 		echo '
1219 1274
 						</select>
@@ -1242,13 +1297,13 @@  discard block
 block discarded – undo
1242 1297
 						</td>
1243 1298
 						<td class="smalltext">';
1244 1299
 
1245
-				if ($permission['is_denied'])
1246
-					echo '
1300
+				if ($permission['is_denied']) {
1301
+									echo '
1247 1302
 							<span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>';
1248
-
1249
-				else
1250
-					echo '
1303
+				} else {
1304
+									echo '
1251 1305
 							', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
1306
+				}
1252 1307
 
1253 1308
 				echo '
1254 1309
 						</td>
@@ -1257,10 +1312,10 @@  discard block
 block discarded – undo
1257 1312
 			echo '
1258 1313
 				</tbody>
1259 1314
 			</table>';
1260
-		}
1261
-		else
1262
-			echo '
1315
+		} else {
1316
+					echo '
1263 1317
 			<p class="windowbg2">', $txt['showPermissions_none_board'], '</p>';
1318
+		}
1264 1319
 	echo '
1265 1320
 		</div><!-- #permissions -->';
1266 1321
 	}
@@ -1301,9 +1356,10 @@  discard block
 block discarded – undo
1301 1356
 			</div>';
1302 1357
 
1303 1358
 	// If they haven't post at all, don't draw the graph.
1304
-	if (empty($context['posts_by_time']))
1305
-		echo '
1359
+	if (empty($context['posts_by_time'])) {
1360
+			echo '
1306 1361
 			<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1362
+	}
1307 1363
 
1308 1364
 	// Otherwise do!
1309 1365
 	else
@@ -1312,8 +1368,8 @@  discard block
 block discarded – undo
1312 1368
 			<ul class="activity_stats flow_hidden">';
1313 1369
 
1314 1370
 		// The labels.
1315
-		foreach ($context['posts_by_time'] as $time_of_day)
1316
-			echo '
1371
+		foreach ($context['posts_by_time'] as $time_of_day) {
1372
+					echo '
1317 1373
 				<li', $time_of_day['is_last'] ? ' class="last"' : '', '>
1318 1374
 					<div class="bar" style="padding-top: ', ((int) (100 - $time_of_day['relative_percent'])), 'px;" title="', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '">
1319 1375
 						<div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
@@ -1322,6 +1378,7 @@  discard block
 block discarded – undo
1322 1378
 					</div>
1323 1379
 					<span class="stats_hour">', $time_of_day['hour_format'], '</span>
1324 1380
 				</li>';
1381
+		}
1325 1382
 
1326 1383
 		echo '
1327 1384
 			</ul>';
@@ -1340,11 +1397,10 @@  discard block
 block discarded – undo
1340 1397
 					</h3>
1341 1398
 				</div>';
1342 1399
 
1343
-	if (empty($context['popular_boards']))
1344
-		echo '
1400
+	if (empty($context['popular_boards'])) {
1401
+			echo '
1345 1402
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1346
-
1347
-	else
1403
+	} else
1348 1404
 	{
1349 1405
 		echo '
1350 1406
 				<dl class="stats">';
@@ -1374,10 +1430,10 @@  discard block
 block discarded – undo
1374 1430
 					</h3>
1375 1431
 				</div>';
1376 1432
 
1377
-	if (empty($context['board_activity']))
1378
-		echo '
1433
+	if (empty($context['board_activity'])) {
1434
+			echo '
1379 1435
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1380
-	else
1436
+	} else
1381 1437
 	{
1382 1438
 		echo '
1383 1439
 				<dl class="stats">';
@@ -1428,90 +1484,97 @@  discard block
 block discarded – undo
1428 1484
 				<h3 class="catbg profile_hd">';
1429 1485
 
1430 1486
 		// Don't say "Profile" if this isn't the profile...
1431
-		if (!empty($context['profile_header_text']))
1432
-			echo '
1487
+		if (!empty($context['profile_header_text'])) {
1488
+					echo '
1433 1489
 					', $context['profile_header_text'];
1434
-		else
1435
-			echo '
1490
+		} else {
1491
+					echo '
1436 1492
 					', $txt['profile'];
1493
+		}
1437 1494
 
1438 1495
 		echo '
1439 1496
 				</h3>
1440 1497
 			</div>';
1441 1498
 
1442 1499
 	// Have we some description?
1443
-	if ($context['page_desc'])
1444
-		echo '
1500
+	if ($context['page_desc']) {
1501
+			echo '
1445 1502
 			<p class="information">', $context['page_desc'], '</p>';
1503
+	}
1446 1504
 
1447 1505
 	echo '
1448 1506
 			<div class="roundframe">';
1449 1507
 
1450 1508
 	// Any bits at the start?
1451
-	if (!empty($context['profile_prehtml']))
1452
-		echo '
1509
+	if (!empty($context['profile_prehtml'])) {
1510
+			echo '
1453 1511
 				<div>', $context['profile_prehtml'], '</div>';
1512
+	}
1454 1513
 
1455
-	if (!empty($context['profile_fields']))
1456
-		echo '
1514
+	if (!empty($context['profile_fields'])) {
1515
+			echo '
1457 1516
 				<dl class="settings">';
1517
+	}
1458 1518
 
1459 1519
 	// Start the big old loop 'of love.
1460 1520
 	$lastItem = 'hr';
1461 1521
 	foreach ($context['profile_fields'] as $key => $field)
1462 1522
 	{
1463 1523
 		// We add a little hack to be sure we never get more than one hr in a row!
1464
-		if ($lastItem == 'hr' && $field['type'] == 'hr')
1465
-			continue;
1524
+		if ($lastItem == 'hr' && $field['type'] == 'hr') {
1525
+					continue;
1526
+		}
1466 1527
 
1467 1528
 		$lastItem = $field['type'];
1468
-		if ($field['type'] == 'hr')
1469
-			echo '
1529
+		if ($field['type'] == 'hr') {
1530
+					echo '
1470 1531
 				</dl>
1471 1532
 				<hr>
1472 1533
 				<dl class="settings">';
1473
-
1474
-		elseif ($field['type'] == 'callback')
1534
+		} elseif ($field['type'] == 'callback')
1475 1535
 		{
1476 1536
 			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
1477 1537
 			{
1478 1538
 				$callback_func = 'template_profile_' . $field['callback_func'];
1479 1539
 				$callback_func();
1480 1540
 			}
1481
-		}
1482
-		else
1541
+		} else
1483 1542
 		{
1484 1543
 			echo '
1485 1544
 					<dt>
1486 1545
 						<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
1487 1546
 
1488 1547
 			// Does it have any subtext to show?
1489
-			if (!empty($field['subtext']))
1490
-				echo '
1548
+			if (!empty($field['subtext'])) {
1549
+							echo '
1491 1550
 						<br>
1492 1551
 						<span class="smalltext">', $field['subtext'], '</span>';
1552
+			}
1493 1553
 
1494 1554
 			echo '
1495 1555
 					</dt>
1496 1556
 					<dd>';
1497 1557
 
1498 1558
 			// Want to put something infront of the box?
1499
-			if (!empty($field['preinput']))
1500
-				echo '
1559
+			if (!empty($field['preinput'])) {
1560
+							echo '
1501 1561
 						', $field['preinput'];
1562
+			}
1502 1563
 
1503 1564
 			// What type of data are we showing?
1504
-			if ($field['type'] == 'label')
1505
-				echo '
1565
+			if ($field['type'] == 'label') {
1566
+							echo '
1506 1567
 						', $field['value'];
1568
+			}
1507 1569
 
1508 1570
 			// Maybe it's a text box - very likely!
1509 1571
 			elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url')))
1510 1572
 			{
1511
-				if ($field['type'] == 'int' || $field['type'] == 'float')
1512
-					$type = 'number';
1513
-				else
1514
-					$type = $field['type'];
1573
+				if ($field['type'] == 'int' || $field['type'] == 'float') {
1574
+									$type = 'number';
1575
+				} else {
1576
+									$type = $field['type'];
1577
+				}
1515 1578
 				$step = $field['type'] == 'float' ? ' step="0.1"' : '';
1516 1579
 
1517 1580
 
@@ -1519,10 +1582,11 @@  discard block
 block discarded – undo
1519 1582
 						<input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' ', $step, '>';
1520 1583
 			}
1521 1584
 			// You "checking" me out? ;)
1522
-			elseif ($field['type'] == 'check')
1523
-				echo '
1585
+			elseif ($field['type'] == 'check') {
1586
+							echo '
1524 1587
 						<input type="hidden" name="', $key, '" value="0">
1525 1588
 						<input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>';
1589
+			}
1526 1590
 
1527 1591
 			// Always fun - select boxes!
1528 1592
 			elseif ($field['type'] == 'select')
@@ -1533,14 +1597,16 @@  discard block
 block discarded – undo
1533 1597
 				if (isset($field['options']))
1534 1598
 				{
1535 1599
 					// Is this some code to generate the options?
1536
-					if (!is_array($field['options']))
1537
-						$field['options'] = $field['options']();
1600
+					if (!is_array($field['options'])) {
1601
+											$field['options'] = $field['options']();
1602
+					}
1538 1603
 
1539 1604
 					// Assuming we now have some!
1540
-					if (is_array($field['options']))
1541
-						foreach ($field['options'] as $value => $name)
1605
+					if (is_array($field['options'])) {
1606
+											foreach ($field['options'] as $value => $name)
1542 1607
 							echo '
1543 1608
 							<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
1609
+					}
1544 1610
 				}
1545 1611
 
1546 1612
 				echo '
@@ -1548,31 +1614,34 @@  discard block
 block discarded – undo
1548 1614
 			}
1549 1615
 
1550 1616
 			// Something to end with?
1551
-			if (!empty($field['postinput']))
1552
-				echo '
1617
+			if (!empty($field['postinput'])) {
1618
+							echo '
1553 1619
 						', $field['postinput'];
1620
+			}
1554 1621
 
1555 1622
 			echo '
1556 1623
 					</dd>';
1557 1624
 		}
1558 1625
 	}
1559 1626
 
1560
-	if (!empty($context['profile_fields']))
1561
-		echo '
1627
+	if (!empty($context['profile_fields'])) {
1628
+			echo '
1562 1629
 				</dl>';
1630
+	}
1563 1631
 
1564 1632
 	// Are there any custom profile fields - if so print them!
1565 1633
 	if (!empty($context['custom_fields']))
1566 1634
 	{
1567
-		if ($lastItem != 'hr')
1568
-			echo '
1635
+		if ($lastItem != 'hr') {
1636
+					echo '
1569 1637
 				<hr>';
1638
+		}
1570 1639
 
1571 1640
 		echo '
1572 1641
 				<dl class="settings">';
1573 1642
 
1574
-		foreach ($context['custom_fields'] as $field)
1575
-			echo '
1643
+		foreach ($context['custom_fields'] as $field) {
1644
+					echo '
1576 1645
 					<dt>
1577 1646
 						<strong>', $field['name'], ': </strong><br>
1578 1647
 						<span class="smalltext">', $field['desc'], '</span>
@@ -1580,6 +1649,7 @@  discard block
 block discarded – undo
1580 1649
 					<dd>
1581 1650
 						', $field['input_html'], '
1582 1651
 					</dd>';
1652
+		}
1583 1653
 
1584 1654
 		echo '
1585 1655
 				</dl>';
@@ -1587,13 +1657,14 @@  discard block
 block discarded – undo
1587 1657
 	}
1588 1658
 
1589 1659
 	// Any closing HTML?
1590
-	if (!empty($context['profile_posthtml']))
1591
-		echo '
1660
+	if (!empty($context['profile_posthtml'])) {
1661
+			echo '
1592 1662
 				<div>', $context['profile_posthtml'], '</div>';
1663
+	}
1593 1664
 
1594 1665
 	// Only show the password box if it's actually needed.
1595
-	if ($context['require_password'])
1596
-		echo '
1666
+	if ($context['require_password']) {
1667
+			echo '
1597 1668
 				<dl class="settings">
1598 1669
 					<dt>
1599 1670
 						<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br>
@@ -1603,18 +1674,21 @@  discard block
 block discarded – undo
1603 1674
 						<input type="password" name="oldpasswrd" id="oldpasswrd" size="20">
1604 1675
 					</dd>
1605 1676
 				</dl>';
1677
+	}
1606 1678
 
1607 1679
 	// The button shouldn't say "Change profile" unless we're changing the profile...
1608
-	if (!empty($context['submit_button_text']))
1609
-		echo '
1680
+	if (!empty($context['submit_button_text'])) {
1681
+			echo '
1610 1682
 				<input type="submit" name="save" value="', $context['submit_button_text'], '" class="button">';
1611
-	else
1612
-		echo '
1683
+	} else {
1684
+			echo '
1613 1685
 				<input type="submit" name="save" value="', $txt['change_profile'], '" class="button">';
1686
+	}
1614 1687
 
1615
-	if (!empty($context['token_check']))
1616
-		echo '
1688
+	if (!empty($context['token_check'])) {
1689
+			echo '
1617 1690
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
1691
+	}
1618 1692
 
1619 1693
 	echo '
1620 1694
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1624,10 +1698,11 @@  discard block
 block discarded – undo
1624 1698
 		</form>';
1625 1699
 
1626 1700
 	// Any final spellchecking stuff?
1627
-	if (!empty($context['show_spellchecking']))
1628
-		echo '
1701
+	if (!empty($context['show_spellchecking'])) {
1702
+			echo '
1629 1703
 		<form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value=""></form>';
1630
-}
1704
+	}
1705
+	}
1631 1706
 
1632 1707
 /**
1633 1708
  * Personal Message settings.
@@ -1664,10 +1739,11 @@  discard block
 block discarded – undo
1664 1739
 						<select name="pm_receive_from" id="pm_receive_from">
1665 1740
 							<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
1666 1741
 
1667
-	if (!empty($modSettings['enable_buddylist']))
1668
-		echo '
1742
+	if (!empty($modSettings['enable_buddylist'])) {
1743
+			echo '
1669 1744
 							<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option>
1670 1745
 							<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
1746
+	}
1671 1747
 
1672 1748
 	echo '
1673 1749
 							<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option>
@@ -1710,11 +1786,12 @@  discard block
 block discarded – undo
1710 1786
 		if (empty($setting) || !is_array($setting))
1711 1787
 		{
1712 1788
 			// Insert a separator (unless this is the first item in the list)
1713
-			if ($i !== $first_option_key)
1714
-				echo '
1789
+			if ($i !== $first_option_key) {
1790
+							echo '
1715 1791
 				</dl>
1716 1792
 				<hr>
1717 1793
 				<dl class="settings">';
1794
+			}
1718 1795
 
1719 1796
 			// Should we give a name to this section?
1720 1797
 			if (is_string($setting) && !empty($setting))
@@ -1723,69 +1800,67 @@  discard block
 block discarded – undo
1723 1800
 				echo '
1724 1801
 					<dt><strong>' . $setting . '</strong></dt>
1725 1802
 					<dd></dd>';
1803
+			} else {
1804
+							$titled_section = false;
1726 1805
 			}
1727
-			else
1728
-				$titled_section = false;
1729 1806
 
1730 1807
 			continue;
1731 1808
 		}
1732 1809
 
1733 1810
 		// Is this disabled?
1734
-		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled']))
1735
-			continue;
1736
-
1737
-		elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage']))
1738
-			continue;
1739
-
1740
-		elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored']))
1741
-			continue;
1742
-
1743
-		elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist']))
1744
-			continue;
1745
-
1746
-		elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg']))
1747
-			continue;
1748
-
1749
-		elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1750
-			continue;
1751
-
1752
-		elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1753
-			continue;
1811
+		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) {
1812
+					continue;
1813
+		} elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) {
1814
+					continue;
1815
+		} elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) {
1816
+					continue;
1817
+		} elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) {
1818
+					continue;
1819
+		} elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) {
1820
+					continue;
1821
+		} elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1822
+					continue;
1823
+		} elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1824
+					continue;
1825
+		}
1754 1826
 
1755 1827
 		// Some of these may not be set...  Set to defaults here
1756 1828
 		$opts = array('topics_per_page', 'messages_per_page', 'display_quick_mod');
1757
-		if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']]))
1758
-			$context['member']['options'][$setting['id']] = 0;
1759
-
1760
-		if (!isset($setting['type']) || $setting['type'] == 'bool')
1761
-			$setting['type'] = 'checkbox';
1762
-
1763
-		elseif ($setting['type'] == 'int' || $setting['type'] == 'integer')
1764
-			$setting['type'] = 'number';
1829
+		if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']])) {
1830
+					$context['member']['options'][$setting['id']] = 0;
1831
+		}
1765 1832
 
1766
-		elseif ($setting['type'] == 'string')
1767
-			$setting['type'] = 'text';
1833
+		if (!isset($setting['type']) || $setting['type'] == 'bool') {
1834
+					$setting['type'] = 'checkbox';
1835
+		} elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') {
1836
+					$setting['type'] = 'number';
1837
+		} elseif ($setting['type'] == 'string') {
1838
+					$setting['type'] = 'text';
1839
+		}
1768 1840
 
1769
-		if (isset($setting['options']))
1770
-			$setting['type'] = 'list';
1841
+		if (isset($setting['options'])) {
1842
+					$setting['type'] = 'list';
1843
+		}
1771 1844
 
1772 1845
 		echo '
1773 1846
 					<dt>
1774 1847
 						<label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>';
1775 1848
 
1776
-		if (isset($setting['description']))
1777
-			echo '
1849
+		if (isset($setting['description'])) {
1850
+					echo '
1778 1851
 						<br>
1779 1852
 						<span class="smalltext">', $setting['description'], '</span>';
1853
+		}
1780 1854
 		echo '
1781 1855
 					</dt>
1782 1856
 					<dd>';
1783 1857
 
1784 1858
 		// Display checkbox options
1785
-		if ($setting['type'] == 'checkbox')
1786
-			echo '
1859
+		if ($setting['type'] == 'checkbox') {
1860
+					echo '
1787 1861
 						<input type="hidden" name="default_options[' . $setting['id'] . ']" value="0">
1788 1862
 						<input type="checkbox" name="default_options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($context['member']['options'][$setting['id']]) ? ' checked' : '', ' value="1">';
1863
+		}
1789 1864
 
1790 1865
 		// How about selection lists, we all love them
1791 1866
 		elseif ($setting['type'] == 'list')
@@ -1793,9 +1868,10 @@  discard block
 block discarded – undo
1793 1868
 			echo '
1794 1869
 						<select name="default_options[', $setting['id'], ']" id="', $setting['id'], '"', '>';
1795 1870
 
1796
-			foreach ($setting['options'] as $value => $label)
1797
-				echo '
1871
+			foreach ($setting['options'] as $value => $label) {
1872
+							echo '
1798 1873
 							<option value="', $value, '"', $value == $context['member']['options'][$setting['id']] ? ' selected' : '', '>', $label, '</option>';
1874
+			}
1799 1875
 
1800 1876
 			echo '
1801 1877
 						</select>';
@@ -1811,14 +1887,13 @@  discard block
 block discarded – undo
1811 1887
 
1812 1888
 				echo '
1813 1889
 						<input type="number"', $min . $max . $step;
1814
-			}
1815
-			elseif (isset($setting['type']) && $setting['type'] == 'url')
1816
-				echo'
1890
+			} elseif (isset($setting['type']) && $setting['type'] == 'url') {
1891
+							echo'
1817 1892
 						<input type="url"';
1818
-
1819
-			else
1820
-				echo '
1893
+			} else {
1894
+							echo '
1821 1895
 						<input type="text"';
1896
+			}
1822 1897
 
1823 1898
 			echo ' name="default_options[', $setting['id'], ']" id="', $setting['id'], '" value="', isset($context['member']['options'][$setting['id']]) ? $context['member']['options'][$setting['id']] : $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', '>';
1824 1899
 		}
@@ -1855,8 +1930,8 @@  discard block
 block discarded – undo
1855 1930
 				<dl class="settings">';
1856 1931
 
1857 1932
 	// Allow notification on announcements to be disabled?
1858
-	if (!empty($modSettings['allow_disableAnnounce']))
1859
-		echo '
1933
+	if (!empty($modSettings['allow_disableAnnounce'])) {
1934
+			echo '
1860 1935
 					<dt>
1861 1936
 						<label for="notify_announcements">', $txt['notify_important_email'], '</label>
1862 1937
 					</dt>
@@ -1864,15 +1939,17 @@  discard block
 block discarded – undo
1864 1939
 						<input type="hidden" name="notify_announcements" value="0">
1865 1940
 						<input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', '>
1866 1941
 					</dd>';
1942
+	}
1867 1943
 
1868
-	if (!empty($modSettings['enable_ajax_alerts']))
1869
-		echo '
1944
+	if (!empty($modSettings['enable_ajax_alerts'])) {
1945
+			echo '
1870 1946
 					<dt>
1871 1947
 						<label for="notify_send_body">', $txt['notify_alert_timeout'], '</label>
1872 1948
 					</dt>
1873 1949
 					<dd>
1874 1950
 						<input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '">
1875 1951
 					</dd>';
1952
+	}
1876 1953
 
1877 1954
 	echo '
1878 1955
 				</dl>
@@ -1904,9 +1981,10 @@  discard block
 block discarded – undo
1904 1981
 
1905 1982
 				$label = $txt['alert_opt_' . $opts[1]];
1906 1983
 				$label_pos = isset($opts['label']) ? $opts['label'] : '';
1907
-				if ($label_pos == 'before')
1908
-					echo '
1984
+				if ($label_pos == 'before') {
1985
+									echo '
1909 1986
 						<label for="opt_', $opts[1], '">', $label, '</label>';
1987
+				}
1910 1988
 
1911 1989
 				$this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0;
1912 1990
 				switch ($opts[0])
@@ -1920,17 +1998,19 @@  discard block
 block discarded – undo
1920 1998
 						echo '
1921 1999
 						<select name="opt_', $opts[1], '" id="opt_', $opts[1], '">';
1922 2000
 
1923
-						foreach ($opts['opts'] as $k => $v)
1924
-							echo '
2001
+						foreach ($opts['opts'] as $k => $v) {
2002
+													echo '
1925 2003
 							<option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>';
2004
+						}
1926 2005
 						echo '
1927 2006
 						</select>';
1928 2007
 						break;
1929 2008
 				}
1930 2009
 
1931
-				if ($label_pos == 'after')
1932
-					echo '
2010
+				if ($label_pos == 'after') {
2011
+									echo '
1933 2012
 						<label for="opt_', $opts[1], '">', $label, '</label>';
2013
+				}
1934 2014
 
1935 2015
 				echo '
1936 2016
 					</td>
@@ -2047,11 +2127,12 @@  discard block
 block discarded – undo
2047 2127
 			<p class="information">', $txt['groupMembership_info'], '</p>';
2048 2128
 
2049 2129
 	// Do we have an update message?
2050
-	if (!empty($context['update_message']))
2051
-		echo '
2130
+	if (!empty($context['update_message'])) {
2131
+			echo '
2052 2132
 			<div class="infobox">
2053 2133
 				', $context['update_message'], '.
2054 2134
 			</div>';
2135
+	}
2055 2136
 
2056 2137
 	echo '
2057 2138
 			<div id="groups">';
@@ -2073,8 +2154,7 @@  discard block
 block discarded – undo
2073 2154
 						</div>
2074 2155
 					</div>
2075 2156
 				</div><!-- .groupmembership -->';
2076
-	}
2077
-	else
2157
+	} else
2078 2158
 	{
2079 2159
 		echo '
2080 2160
 				<div class="title_bar">
@@ -2086,27 +2166,30 @@  discard block
 block discarded – undo
2086 2166
 			echo '
2087 2167
 				<div class="windowbg" id="primdiv_', $group['id'], '">';
2088 2168
 
2089
-				if ($context['can_edit_primary'])
2090
-					echo '
2169
+				if ($context['can_edit_primary']) {
2170
+									echo '
2091 2171
 					<input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '"', $group['is_primary'] ? ' checked' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');"', $group['can_be_primary'] ? '' : ' disabled', '>';
2172
+				}
2092 2173
 
2093 2174
 				echo '
2094 2175
 					<label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>';
2095 2176
 
2096 2177
 				// Can they leave their group?
2097
-				if ($group['can_leave'])
2098
-					echo '
2178
+				if ($group['can_leave']) {
2179
+									echo '
2099 2180
 					<a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">' . $txt['leave_group'] . '</a>';
2181
+				}
2100 2182
 
2101 2183
 				echo '
2102 2184
 				</div><!-- .windowbg -->';
2103 2185
 		}
2104 2186
 
2105
-		if ($context['can_edit_primary'])
2106
-			echo '
2187
+		if ($context['can_edit_primary']) {
2188
+					echo '
2107 2189
 				<div class="padding righttext">
2108 2190
 					<input type="submit" value="', $txt['make_primary'], '" class="button">
2109 2191
 				</div>';
2192
+		}
2110 2193
 
2111 2194
 		// Any groups they can join?
2112 2195
 		if (!empty($context['groups']['available']))
@@ -2122,17 +2205,16 @@  discard block
 block discarded – undo
2122 2205
 				<div class="windowbg">
2123 2206
 					<strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '';
2124 2207
 
2125
-				if ($group['type'] == 3)
2126
-					echo '
2208
+				if ($group['type'] == 3) {
2209
+									echo '
2127 2210
 					<a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '" class="button floatright">', $txt['join_group'], '</a>';
2128
-
2129
-				elseif ($group['type'] == 2 && $group['pending'])
2130
-					echo '
2211
+				} elseif ($group['type'] == 2 && $group['pending']) {
2212
+									echo '
2131 2213
 					<span class="floatright">', $txt['approval_pending'], '</span>';
2132
-
2133
-				elseif ($group['type'] == 2)
2134
-					echo '
2214
+				} elseif ($group['type'] == 2) {
2215
+									echo '
2135 2216
 					<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
2217
+				}
2136 2218
 
2137 2219
 				echo '
2138 2220
 				</div><!-- .windowbg -->';
@@ -2155,9 +2237,10 @@  discard block
 block discarded – undo
2155 2237
 
2156 2238
 						prevDiv.className = "windowbg";
2157 2239
 					}';
2158
-		if (isset($context['groups']['member'][$context['primary_group']]))
2159
-			echo '
2240
+		if (isset($context['groups']['member'][$context['primary_group']])) {
2241
+					echo '
2160 2242
 					highlightSelected("primdiv_' . $context['primary_group'] . '");';
2243
+		}
2161 2244
 
2162 2245
 		echo '
2163 2246
 				</script>';
@@ -2166,9 +2249,10 @@  discard block
 block discarded – undo
2166 2249
 	echo '
2167 2250
 			</div><!-- #groups -->';
2168 2251
 
2169
-	if (!empty($context['token_check']))
2170
-		echo '
2252
+	if (!empty($context['token_check'])) {
2253
+			echo '
2171 2254
 			<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2255
+	}
2172 2256
 
2173 2257
 	echo '
2174 2258
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2216,14 +2300,15 @@  discard block
 block discarded – undo
2216 2300
 
2217 2301
 		foreach ($category['boards'] as $board)
2218 2302
 		{
2219
-			if ($i == $limit)
2220
-				echo '
2303
+			if ($i == $limit) {
2304
+							echo '
2221 2305
 						</ul>
2222 2306
 					</li>
2223 2307
 				</ul>
2224 2308
 				<ul class="ignoreboards floatright">
2225 2309
 					<li class="category">
2226 2310
 						<ul>';
2311
+			}
2227 2312
 
2228 2313
 			echo '
2229 2314
 							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
@@ -2269,10 +2354,11 @@  discard block
 block discarded – undo
2269 2354
 
2270 2355
 	// Work out the starting color.
2271 2356
 	$context['current_color'] = $context['colors'][0];
2272
-	foreach ($context['colors'] as $limit => $color)
2273
-		if ($context['member']['warning'] >= $limit)
2357
+	foreach ($context['colors'] as $limit => $color) {
2358
+			if ($context['member']['warning'] >= $limit)
2274 2359
 			$context['current_color'] = $color;
2275
-}
2360
+	}
2361
+	}
2276 2362
 
2277 2363
 // Show all warnings of a user?
2278 2364
 function template_viewWarning()
@@ -2311,14 +2397,15 @@  discard block
 block discarded – undo
2311 2397
 				</dd>';
2312 2398
 
2313 2399
 	// There's some impact of this?
2314
-	if (!empty($context['level_effects'][$context['current_level']]))
2315
-		echo '
2400
+	if (!empty($context['level_effects'][$context['current_level']])) {
2401
+			echo '
2316 2402
 				<dt>
2317 2403
 					<strong>', $txt['profile_viewwarning_impact'], ':</strong>
2318 2404
 				</dt>
2319 2405
 				<dd>
2320 2406
 					', $context['level_effects'][$context['current_level']], '
2321 2407
 				</dd>';
2408
+	}
2322 2409
 
2323 2410
 	echo '
2324 2411
 			</dl>
@@ -2356,10 +2443,11 @@  discard block
 block discarded – undo
2356 2443
 
2357 2444
 			// Otherwise see what we can do...';
2358 2445
 
2359
-	foreach ($context['notification_templates'] as $k => $type)
2360
-		echo '
2446
+	foreach ($context['notification_templates'] as $k => $type) {
2447
+			echo '
2361 2448
 			if (index == ', $k, ')
2362 2449
 				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
2450
+	}
2363 2451
 
2364 2452
 	echo '
2365 2453
 		}
@@ -2369,10 +2457,11 @@  discard block
 block discarded – undo
2369 2457
 			// Also set the right effect.
2370 2458
 			effectText = "";';
2371 2459
 
2372
-	foreach ($context['level_effects'] as $limit => $text)
2373
-		echo '
2460
+	foreach ($context['level_effects'] as $limit => $text) {
2461
+			echo '
2374 2462
 			if (slideAmount >= ', $limit, ')
2375 2463
 				effectText = "', $text, '";';
2464
+	}
2376 2465
 
2377 2466
 	echo '
2378 2467
 			setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\');
@@ -2387,32 +2476,35 @@  discard block
 block discarded – undo
2387 2476
 			</h3>
2388 2477
 		</div>';
2389 2478
 
2390
-	if (!$context['user']['is_owner'])
2391
-		echo '
2479
+	if (!$context['user']['is_owner']) {
2480
+			echo '
2392 2481
 		<p class="information">', $txt['profile_warning_desc'], '</p>';
2482
+	}
2393 2483
 
2394 2484
 	echo '
2395 2485
 		<div class="windowbg">
2396 2486
 			<dl class="settings">';
2397 2487
 
2398
-	if (!$context['user']['is_owner'])
2399
-		echo '
2488
+	if (!$context['user']['is_owner']) {
2489
+			echo '
2400 2490
 				<dt>
2401 2491
 					<strong>', $txt['profile_warning_name'], ':</strong>
2402 2492
 				</dt>
2403 2493
 				<dd>
2404 2494
 					<strong>', $context['member']['name'], '</strong>
2405 2495
 				</dd>';
2496
+	}
2406 2497
 
2407 2498
 	echo '
2408 2499
 				<dt>
2409 2500
 					<strong>', $txt['profile_warning_level'], ':</strong>';
2410 2501
 
2411 2502
 	// Is there only so much they can apply?
2412
-	if ($context['warning_limit'])
2413
-		echo '
2503
+	if ($context['warning_limit']) {
2504
+			echo '
2414 2505
 					<br>
2415 2506
 					<span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
2507
+	}
2416 2508
 
2417 2509
 	echo '
2418 2510
 				</dt>
@@ -2467,9 +2559,10 @@  discard block
 block discarded – undo
2467 2559
 						<option value="-1">', $txt['profile_warning_notify_template'], '</option>
2468 2560
 						<option value="-1" disabled>------------------------------</option>';
2469 2561
 
2470
-		foreach ($context['notification_templates'] as $id_template => $template)
2471
-			echo '
2562
+		foreach ($context['notification_templates'] as $id_template => $template) {
2563
+					echo '
2472 2564
 						<option value="', $id_template, '">', $template['title'], '</option>';
2565
+		}
2473 2566
 
2474 2567
 		echo '
2475 2568
 					</select>
@@ -2482,9 +2575,10 @@  discard block
 block discarded – undo
2482 2575
 			</dl>
2483 2576
 			<div class="righttext">';
2484 2577
 
2485
-	if (!empty($context['token_check']))
2486
-		echo '
2578
+	if (!empty($context['token_check'])) {
2579
+			echo '
2487 2580
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2581
+	}
2488 2582
 
2489 2583
 	echo '
2490 2584
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2500,8 +2594,8 @@  discard block
 block discarded – undo
2500 2594
 	echo '
2501 2595
 	<script>';
2502 2596
 
2503
-	if (!$context['user']['is_owner'])
2504
-		echo '
2597
+	if (!$context['user']['is_owner']) {
2598
+			echo '
2505 2599
 		modifyWarnNotify();
2506 2600
 		$(document).ready(function() {
2507 2601
 			$("#preview_button").click(function() {
@@ -2540,6 +2634,7 @@  discard block
 block discarded – undo
2540 2634
 			});
2541 2635
 			return false;
2542 2636
 		}';
2637
+	}
2543 2638
 
2544 2639
 	echo '
2545 2640
 	</script>';
@@ -2562,17 +2657,19 @@  discard block
 block discarded – undo
2562 2657
 			</div>';
2563 2658
 
2564 2659
 	// If deleting another account give them a lovely info box.
2565
-	if (!$context['user']['is_owner'])
2566
-		echo '
2660
+	if (!$context['user']['is_owner']) {
2661
+			echo '
2567 2662
 			<p class="information">', $txt['deleteAccount_desc'], '</p>';
2663
+	}
2568 2664
 
2569 2665
 	echo '
2570 2666
 			<div class="windowbg2">';
2571 2667
 
2572 2668
 	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
2573
-	if ($context['needs_approval'])
2574
-		echo '
2669
+	if ($context['needs_approval']) {
2670
+			echo '
2575 2671
 				<div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
2672
+	}
2576 2673
 
2577 2674
 	// If the user is deleting their own account warn them first - and require a password!
2578 2675
 	if ($context['user']['is_owner'])
@@ -2584,9 +2681,10 @@  discard block
 block discarded – undo
2584 2681
 					<input type="password" name="oldpasswrd" size="20">
2585 2682
 					<input type="submit" value="', $txt['yes'], '" class="button">';
2586 2683
 
2587
-		if (!empty($context['token_check']))
2588
-			echo '
2684
+		if (!empty($context['token_check'])) {
2685
+					echo '
2589 2686
 					<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2687
+		}
2590 2688
 
2591 2689
 		echo '
2592 2690
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2616,10 +2714,11 @@  discard block
 block discarded – undo
2616 2714
 						<option value="topics">', $txt['deleteAccount_topics'], '</option>
2617 2715
 					</select>';
2618 2716
 
2619
-			if ($context['show_perma_delete'])
2620
-				echo '
2717
+			if ($context['show_perma_delete']) {
2718
+							echo '
2621 2719
 					<br>
2622 2720
 					<label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1">', $txt['deleteAccount_permanent'], ':</label>';
2721
+			}
2623 2722
 
2624 2723
 			echo '
2625 2724
 				</div>';
@@ -2632,9 +2731,10 @@  discard block
 block discarded – undo
2632 2731
 				<div>
2633 2732
 					<input type="submit" value="', $txt['delete'], '" class="button">';
2634 2733
 
2635
-		if (!empty($context['token_check']))
2636
-			echo '
2734
+		if (!empty($context['token_check'])) {
2735
+					echo '
2637 2736
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2737
+		}
2638 2738
 
2639 2739
 		echo '
2640 2740
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2660,8 +2760,8 @@  discard block
 block discarded – undo
2660 2760
 					<hr>';
2661 2761
 
2662 2762
 	// Only show the password box if it's actually needed.
2663
-	if ($context['require_password'])
2664
-		echo '
2763
+	if ($context['require_password']) {
2764
+			echo '
2665 2765
 					<dl class="settings">
2666 2766
 						<dt>
2667 2767
 							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br>
@@ -2671,13 +2771,15 @@  discard block
 block discarded – undo
2671 2771
 							<input type="password" name="oldpasswrd" size="20">
2672 2772
 						</dd>
2673 2773
 					</dl>';
2774
+	}
2674 2775
 
2675 2776
 	echo '
2676 2777
 					<div class="righttext">';
2677 2778
 
2678
-	if (!empty($context['token_check']))
2679
-		echo '
2779
+	if (!empty($context['token_check'])) {
2780
+			echo '
2680 2781
 						<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2782
+	}
2681 2783
 
2682 2784
 	echo '
2683 2785
 						<input type="submit" value="', $txt['change_profile'], '" class="button">
@@ -2704,9 +2806,10 @@  discard block
 block discarded – undo
2704 2806
 			<ul id="list_errors">';
2705 2807
 
2706 2808
 		// Cycle through each error and display an error message.
2707
-		foreach ($context['post_errors'] as $error)
2708
-			echo '
2809
+		foreach ($context['post_errors'] as $error) {
2810
+					echo '
2709 2811
 				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
2812
+		}
2710 2813
 
2711 2814
 		echo '
2712 2815
 			</ul>';
@@ -2732,12 +2835,13 @@  discard block
 block discarded – undo
2732 2835
 								<select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 &amp;&amp; !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>';
2733 2836
 
2734 2837
 	// Fill the select box with all primary member groups that can be assigned to a member.
2735
-	foreach ($context['member_groups'] as $member_group)
2736
-		if (!empty($member_group['can_be_primary']))
2838
+	foreach ($context['member_groups'] as $member_group) {
2839
+			if (!empty($member_group['can_be_primary']))
2737 2840
 			echo '
2738 2841
 									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '>
2739 2842
 										', $member_group['name'], '
2740 2843
 									</option>';
2844
+	}
2741 2845
 
2742 2846
 	echo '
2743 2847
 								</select>
@@ -2750,10 +2854,11 @@  discard block
 block discarded – undo
2750 2854
 									<input type="hidden" name="additional_groups[]" value="0">';
2751 2855
 
2752 2856
 	// For each membergroup show a checkbox so members can be assigned to more than one group.
2753
-	foreach ($context['member_groups'] as $member_group)
2754
-		if ($member_group['can_be_additional'])
2857
+	foreach ($context['member_groups'] as $member_group) {
2858
+			if ($member_group['can_be_additional'])
2755 2859
 			echo '
2756 2860
 									<label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked' : '', '> ', $member_group['name'], '</label><br>';
2861
+	}
2757 2862
 
2758 2863
 	echo '
2759 2864
 								</span>
@@ -2813,9 +2918,10 @@  discard block
 block discarded – undo
2813 2918
 								<span class="smalltext">', $txt['sig_info'], '</span><br>
2814 2919
 								<br>';
2815 2920
 
2816
-	if ($context['show_spellchecking'])
2817
-		echo '
2921
+	if ($context['show_spellchecking']) {
2922
+			echo '
2818 2923
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button">';
2924
+	}
2819 2925
 
2820 2926
 	echo '
2821 2927
 							</dt>
@@ -2823,17 +2929,20 @@  discard block
 block discarded – undo
2823 2929
 								<textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br>';
2824 2930
 
2825 2931
 	// If there is a limit at all!
2826
-	if (!empty($context['signature_limits']['max_length']))
2827
-		echo '
2932
+	if (!empty($context['signature_limits']['max_length'])) {
2933
+			echo '
2828 2934
 								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>';
2935
+	}
2829 2936
 
2830
-	if (!empty($context['show_preview_button']))
2831
-		echo '
2937
+	if (!empty($context['show_preview_button'])) {
2938
+			echo '
2832 2939
 								<input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button">';
2940
+	}
2833 2941
 
2834
-	if ($context['signature_warning'])
2835
-		echo '
2942
+	if ($context['signature_warning']) {
2943
+			echo '
2836 2944
 								<span class="smalltext">', $context['signature_warning'], '</span>';
2945
+	}
2837 2946
 
2838 2947
 	// Some javascript used to count how many characters have been used so far in the signature.
2839 2948
 	echo '
@@ -2878,9 +2987,10 @@  discard block
 block discarded – undo
2878 2987
 										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
2879 2988
 
2880 2989
 		// This lists all the file categories.
2881
-		foreach ($context['avatars'] as $avatar)
2882
-			echo '
2990
+		foreach ($context['avatars'] as $avatar) {
2991
+					echo '
2883 2992
 											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>';
2993
+		}
2884 2994
 
2885 2995
 		echo '
2886 2996
 										</select>
@@ -2912,20 +3022,22 @@  discard block
 block discarded – undo
2912 3022
 	}
2913 3023
 
2914 3024
 	// If the user can link to an off server avatar, show them a box to input the address.
2915
-	if (!empty($context['member']['avatar']['allow_external']))
2916
-		echo '
3025
+	if (!empty($context['member']['avatar']['allow_external'])) {
3026
+			echo '
2917 3027
 								<div id="avatar_external">
2918 3028
 									<div class="smalltext">', $txt['avatar_by_url'], '</div>', !empty($modSettings['avatar_action_too_large']) && $modSettings['avatar_action_too_large'] == 'option_download_and_resize' ? template_max_size('external') : '', '
2919 3029
 									<input type="text" name="userpicpersonal" size="45" value="', ((stristr($context['member']['avatar']['external'], 'http://') || stristr($context['member']['avatar']['external'], 'https://')) ? $context['member']['avatar']['external'] : 'http://'), '" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'external\');" onchange="if (typeof(previewExternalAvatar) != \'undefined\') previewExternalAvatar(this.value);">
2920 3030
 								</div>';
3031
+	}
2921 3032
 
2922 3033
 	// If the user is able to upload avatars to the server show them an upload box.
2923
-	if (!empty($context['member']['avatar']['allow_upload']))
2924
-		echo '
3034
+	if (!empty($context['member']['avatar']['allow_upload'])) {
3035
+			echo '
2925 3036
 								<div id="avatar_upload">
2926 3037
 									<input type="file" size="44" name="attachment" id="avatar_upload_box" value="" onchange="readfromUpload(this)"  onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'upload\');" accept="image/gif, image/jpeg, image/jpg, image/png">', template_max_size('upload'), '
2927 3038
 									', (!empty($context['member']['avatar']['id_attach']) ? '<br><img src="' . $context['member']['avatar']['href'] . (strpos($context['member']['avatar']['href'], '?') === false ? '?' : '&amp;') . 'time=' . time() . '" alt="" id="attached_image"><input type="hidden" name="id_attach" value="' . $context['member']['avatar']['id_attach'] . '">' : ''), '
2928 3039
 								</div>';
3040
+	}
2929 3041
 
2930 3042
 	// if the user is able to use Gravatar avatars show then the image preview
2931 3043
 	if (!empty($context['member']['avatar']['allow_gravatar']))
@@ -2934,16 +3046,17 @@  discard block
 block discarded – undo
2934 3046
 								<div id="avatar_gravatar">
2935 3047
 									<img src="' . $context['member']['avatar']['href'] . '" alt="">';
2936 3048
 
2937
-		if (empty($modSettings['gravatarAllowExtraEmail']))
2938
-			echo '
3049
+		if (empty($modSettings['gravatarAllowExtraEmail'])) {
3050
+					echo '
2939 3051
 									<div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>';
2940
-		else
3052
+		} else
2941 3053
 		{
2942 3054
 			// Depending on other stuff, the stored value here might have some odd things in it from other areas.
2943
-			if ($context['member']['avatar']['external'] == $context['member']['email'])
2944
-				$textbox_value = '';
2945
-			else
2946
-				$textbox_value = $context['member']['avatar']['external'];
3055
+			if ($context['member']['avatar']['external'] == $context['member']['email']) {
3056
+							$textbox_value = '';
3057
+			} else {
3058
+							$textbox_value = $context['member']['avatar']['external'];
3059
+			}
2947 3060
 
2948 3061
 			echo '
2949 3062
 									<div class="smalltext">', $txt['gravatar_alternateEmail'], '</div>
@@ -3015,8 +3128,9 @@  discard block
 block discarded – undo
3015 3128
 	$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
3016 3129
 
3017 3130
 	$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
3018
-	if (empty($suffix))
3019
-		return;
3131
+	if (empty($suffix)) {
3132
+			return;
3133
+	}
3020 3134
 
3021 3135
 	echo '
3022 3136
 								<div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>';
@@ -3041,9 +3155,10 @@  discard block
 block discarded – undo
3041 3155
 								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;">';
3042 3156
 
3043 3157
 	// Help the user by showing a list of common time formats.
3044
-	foreach ($context['easy_timeformats'] as $time_format)
3045
-		echo '
3158
+	foreach ($context['easy_timeformats'] as $time_format) {
3159
+			echo '
3046 3160
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3161
+	}
3047 3162
 
3048 3163
 	echo '
3049 3164
 								</select><br>
@@ -3081,9 +3196,10 @@  discard block
 block discarded – undo
3081 3196
 							<dd>
3082 3197
 								<select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">';
3083 3198
 
3084
-	foreach ($context['smiley_sets'] as $set)
3085
-		echo '
3199
+	foreach ($context['smiley_sets'] as $set) {
3200
+			echo '
3086 3201
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>';
3202
+	}
3087 3203
 
3088 3204
 	echo '
3089 3205
 								</select>
@@ -3135,10 +3251,11 @@  discard block
 block discarded – undo
3135 3251
 										<img src="', $context['tfa_qr_url'], '" alt="">
3136 3252
 									</div>';
3137 3253
 
3138
-	if (!empty($context['from_ajax']))
3139
-		echo '
3254
+	if (!empty($context['from_ajax'])) {
3255
+			echo '
3140 3256
 					<br>
3141 3257
 					<a href="javascript:self.close();"></a>';
3258
+	}
3142 3259
 
3143 3260
 	echo '
3144 3261
 				</div>
@@ -3178,17 +3295,16 @@  discard block
 block discarded – undo
3178 3295
 							</dt>
3179 3296
 							<dd>';
3180 3297
 
3181
-	if (!$context['tfa_enabled'] && $context['user']['is_owner'])
3182
-		echo '
3298
+	if (!$context['tfa_enabled'] && $context['user']['is_owner']) {
3299
+			echo '
3183 3300
 								<a href="', !empty($modSettings['force_ssl']) && $modSettings['force_ssl'] < 2 ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>';
3184
-
3185
-	elseif (!$context['tfa_enabled'])
3186
-		echo '
3301
+	} elseif (!$context['tfa_enabled']) {
3302
+			echo '
3187 3303
 								', $txt['tfa_profile_disabled'];
3188
-
3189
-	else
3190
-		echo '
3304
+	} else {
3305
+			echo '
3191 3306
 								', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable');
3307
+	}
3192 3308
 
3193 3309
 	echo '
3194 3310
 							</dd>';
Please login to merge, or discard this patch.