Completed
Push — release-2.1 ( 9de5bf...1bbcf2 )
by Mathias
12s
created
Themes/default/Profile.template.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3078,8 +3078,7 @@
 block discarded – undo
3078 3078
 			<div class="roundframe">
3079 3079
 				<div>
3080 3080
 		', !empty($context['tfa_backup']) ? '
3081
-					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' :
3082
-			($modSettings['tfa_mode'] == 2 ? '
3081
+					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? '
3083 3082
 									<div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), '
3084 3083
 									<div class="smalltext">', $txt['tfa_desc'], '</div>
3085 3084
 									<div class="floatleft">
Please login to merge, or discard this patch.
Braces   +523 added lines, -402 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 '
@@ -158,38 +160,42 @@  discard block
 block discarded – undo
158 160
 	if (!empty($context['print_custom_fields']['above_member']))
159 161
 	{
160 162
 		$fields = '';
161
-		foreach ($context['print_custom_fields']['above_member'] as $field)
162
-			if (!empty($field['output_html']))
163
+		foreach ($context['print_custom_fields']['above_member'] as $field) {
164
+					if (!empty($field['output_html']))
163 165
 				$fields .= '
164 166
 					<li>' . $field['output_html'] . '</li>';
167
+		}
165 168
 
166
-		if (!empty($fields))
167
-			echo '
169
+		if (!empty($fields)) {
170
+					echo '
168 171
 			<div class="custom_fields_above_name">
169 172
 				<ul>', $fields, '
170 173
 				</ul>
171 174
 			</div>
172 175
 			<br>';
176
+		}
173 177
 	}
174 178
 
175 179
 	echo '
176 180
 			<div class="username clear">
177 181
 				<h4>';
178 182
 
179
-	if (!empty($context['print_custom_fields']['before_member']))
180
-		foreach ($context['print_custom_fields']['before_member'] as $field)
183
+	if (!empty($context['print_custom_fields']['before_member'])) {
184
+			foreach ($context['print_custom_fields']['before_member'] as $field)
181 185
 			if (!empty($field['output_html']))
182 186
 				echo '
183 187
 					<span>', $field['output_html'], '</span>';
188
+	}
184 189
 
185 190
 	echo '
186 191
 					', $context['member']['name'];
187 192
 
188
-	if (!empty($context['print_custom_fields']['after_member']))
189
-		foreach ($context['print_custom_fields']['after_member'] as $field)
193
+	if (!empty($context['print_custom_fields']['after_member'])) {
194
+			foreach ($context['print_custom_fields']['after_member'] as $field)
190 195
 			if (!empty($field['output_html']))
191 196
 				echo '
192 197
 					<span>', $field['output_html'], '</span>';
198
+	}
193 199
 
194 200
 
195 201
 	echo '
@@ -202,40 +208,45 @@  discard block
 block discarded – undo
202 208
 	if (!empty($context['print_custom_fields']['below_avatar']))
203 209
 	{
204 210
 		$fields = '';
205
-		foreach ($context['print_custom_fields']['below_avatar'] as $field)
206
-			if (!empty($field['output_html']))
211
+		foreach ($context['print_custom_fields']['below_avatar'] as $field) {
212
+					if (!empty($field['output_html']))
207 213
 				$fields .= '
208 214
 					<li>' . $field['output_html'] . '</li>';
215
+		}
209 216
 
210
-		if (!empty($fields))
211
-			echo '
217
+		if (!empty($fields)) {
218
+					echo '
212 219
 			<div class="custom_fields_below_avatar">
213 220
 				<ul>', $fields, '
214 221
 				</ul>
215 222
 			</div>
216 223
 			<br>';
224
+		}
217 225
 	}
218 226
 
219 227
 	echo '
220 228
 			<ul class="clear">';
221 229
 
222 230
 	// Email is only visible if it's your profile or you have the moderate_forum permission
223
-	if ($context['member']['show_email'])
224
-		echo '
231
+	if ($context['member']['show_email']) {
232
+			echo '
225 233
 				<li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>';
234
+	}
226 235
 
227 236
 	// 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 '
237
+	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) {
238
+			echo '
230 239
 				<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" rel="noopener">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
240
+	}
231 241
 
232 242
 	// Are there any custom profile fields as icons?
233 243
 	if (!empty($context['print_custom_fields']['icons']))
234 244
 	{
235
-		foreach ($context['print_custom_fields']['icons'] as $field)
236
-			if (!empty($field['output_html']))
245
+		foreach ($context['print_custom_fields']['icons'] as $field) {
246
+					if (!empty($field['output_html']))
237 247
 				echo '
238 248
 				<li class="custom_field">', $field['output_html'], '</li>';
249
+		}
239 250
 	}
240 251
 
241 252
 	echo '
@@ -244,24 +255,27 @@  discard block
 block discarded – undo
244 255
 				', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : '';
245 256
 
246 257
 	// Can they add this member as a buddy?
247
-	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
248
-		echo '
258
+	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) {
259
+			echo '
249 260
 				<br>
250 261
 				<a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
262
+	}
251 263
 
252 264
 	echo '
253 265
 			</span>';
254 266
 
255
-	if (!$context['user']['is_owner'] && $context['can_send_pm'])
256
-		echo '
267
+	if (!$context['user']['is_owner'] && $context['can_send_pm']) {
268
+			echo '
257 269
 			<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>';
270
+	}
258 271
 
259 272
 	echo '
260 273
 			<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>';
261 274
 
262
-	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled']))
263
-		echo '
275
+	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) {
276
+			echo '
264 277
 			<a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>';
278
+	}
265 279
 
266 280
 	echo '
267 281
 			<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>';
@@ -270,18 +284,20 @@  discard block
 block discarded – undo
270 284
 	if (!empty($context['print_custom_fields']['bottom_poster']))
271 285
 	{
272 286
 		$fields = '';
273
-		foreach ($context['print_custom_fields']['bottom_poster'] as $field)
274
-			if (!empty($field['output_html']))
287
+		foreach ($context['print_custom_fields']['bottom_poster'] as $field) {
288
+					if (!empty($field['output_html']))
275 289
 				$fields .= '
276 290
 					<li>' . $field['output_html'] . '</li>';
291
+		}
277 292
 
278
-		if (!empty($fields))
279
-			echo '
293
+		if (!empty($fields)) {
294
+					echo '
280 295
 			<div class="custom_fields_bottom">
281 296
 				<ul class="nolist">', $fields, '
282 297
 				</ul>
283 298
 			</div>
284 299
 			<br>';
300
+		}
285 301
 	}
286 302
 
287 303
 	echo '
@@ -290,30 +306,35 @@  discard block
 block discarded – undo
290 306
 		<div id="detailedinfo">
291 307
 			<dl class="settings">';
292 308
 
293
-	if ($context['user']['is_owner'] || $context['user']['is_admin'])
294
-		echo '
309
+	if ($context['user']['is_owner'] || $context['user']['is_admin']) {
310
+			echo '
295 311
 				<dt>', $txt['username'], ': </dt>
296 312
 				<dd>', $context['member']['username'], '</dd>';
313
+	}
297 314
 
298
-	if (!isset($context['disabled_fields']['posts']))
299
-		echo '
315
+	if (!isset($context['disabled_fields']['posts'])) {
316
+			echo '
300 317
 				<dt>', $txt['profile_posts'], ': </dt>
301 318
 				<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
319
+	}
302 320
 
303
-	if ($context['member']['show_email'])
304
-		echo '
321
+	if ($context['member']['show_email']) {
322
+			echo '
305 323
 				<dt>', $txt['email'], ': </dt>
306 324
 				<dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>';
325
+	}
307 326
 
308
-	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
309
-		echo '
327
+	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) {
328
+			echo '
310 329
 				<dt>', $txt['custom_title'], ': </dt>
311 330
 				<dd>', $context['member']['title'], '</dd>';
331
+	}
312 332
 
313
-	if (!empty($context['member']['blurb']))
314
-		echo '
333
+	if (!empty($context['member']['blurb'])) {
334
+			echo '
315 335
 				<dt>', $txt['personal_text'], ': </dt>
316 336
 				<dd>', $context['member']['blurb'], '</dd>';
337
+	}
317 338
 
318 339
 	echo '
319 340
 				<dt>', $txt['age'], ':</dt>
@@ -327,19 +348,21 @@  discard block
 block discarded – undo
327 348
 	{
328 349
 		$fields = array();
329 350
 
330
-		foreach ($context['print_custom_fields']['standard'] as $field)
331
-			if (!empty($field['output_html']))
351
+		foreach ($context['print_custom_fields']['standard'] as $field) {
352
+					if (!empty($field['output_html']))
332 353
 				$fields[] = $field;
354
+		}
333 355
 
334 356
 		if (count($fields) > 0)
335 357
 		{
336 358
 			echo '
337 359
 			<dl class="settings">';
338 360
 
339
-			foreach ($fields as $field)
340
-				echo '
361
+			foreach ($fields as $field) {
362
+							echo '
341 363
 				<dt>', $field['name'], ':</dt>
342 364
 				<dd>', $field['output_html'], '</dd>';
365
+			}
343 366
 
344 367
 			echo '
345 368
 			</dl>';
@@ -359,9 +382,10 @@  discard block
 block discarded – undo
359 382
 					<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>';
360 383
 
361 384
 		// Can we provide information on what this means?
362
-		if (!empty($context['warning_status']))
363
-			echo '
385
+		if (!empty($context['warning_status'])) {
386
+					echo '
364 387
 					<span class="smalltext">(', $context['warning_status'], ')</span>';
388
+		}
365 389
 
366 390
 		echo '
367 391
 				</dd>';
@@ -372,11 +396,12 @@  discard block
 block discarded – undo
372 396
 	{
373 397
 
374 398
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
375
-		if (!empty($context['activate_message']))
376
-			echo '
399
+		if (!empty($context['activate_message'])) {
400
+					echo '
377 401
 				<dt class="clear">
378 402
 					<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>)
379 403
 				</dt>';
404
+		}
380 405
 
381 406
 		// If the current member is banned, show a message and possibly a link to the ban.
382 407
 		if (!empty($context['member']['bans']))
@@ -388,10 +413,11 @@  discard block
 block discarded – undo
388 413
 				<dt class="clear" id="ban_info" style="display: none;">
389 414
 					<strong>', $txt['user_banned_by_following'], ':</strong>';
390 415
 
391
-			foreach ($context['member']['bans'] as $ban)
392
-				echo '
416
+			foreach ($context['member']['bans'] as $ban) {
417
+							echo '
393 418
 					<br>
394 419
 					<span class="smalltext">', $ban['explanation'], '</span>';
420
+			}
395 421
 
396 422
 			echo '
397 423
 				</dt>';
@@ -405,30 +431,34 @@  discard block
 block discarded – undo
405 431
 	// If the person looking is allowed, they can check the members IP address and hostname.
406 432
 	if ($context['can_see_ip'])
407 433
 	{
408
-		if (!empty($context['member']['ip']))
409
-		echo '
434
+		if (!empty($context['member']['ip'])) {
435
+				echo '
410 436
 				<dt>', $txt['ip'], ': </dt>
411 437
 				<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
438
+		}
412 439
 
413
-		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
414
-			echo '
440
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) {
441
+					echo '
415 442
 				<dt>', $txt['hostname'], ': </dt>
416 443
 				<dd>', $context['member']['hostname'], '</dd>';
444
+		}
417 445
 	}
418 446
 
419 447
 	echo '
420 448
 				<dt>', $txt['local_time'], ':</dt>
421 449
 				<dd>', $context['member']['local_time'], '</dd>';
422 450
 
423
-	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
424
-		echo '
451
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) {
452
+			echo '
425 453
 				<dt>', $txt['language'], ':</dt>
426 454
 				<dd>', $context['member']['language'], '</dd>';
455
+	}
427 456
 
428
-	if ($context['member']['show_last_login'])
429
-		echo '
457
+	if ($context['member']['show_last_login']) {
458
+			echo '
430 459
 				<dt>', $txt['lastLoggedIn'], ': </dt>
431 460
 				<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
461
+	}
432 462
 
433 463
 	echo '
434 464
 			</dl>';
@@ -437,42 +467,47 @@  discard block
 block discarded – undo
437 467
 	if (!empty($context['print_custom_fields']['above_signature']))
438 468
 	{
439 469
 		$fields = '';
440
-		foreach ($context['print_custom_fields']['above_signature'] as $field)
441
-			if (!empty($field['output_html']))
470
+		foreach ($context['print_custom_fields']['above_signature'] as $field) {
471
+					if (!empty($field['output_html']))
442 472
 				echo '
443 473
 					<li>', $field['output_html'], '</li>';
474
+		}
444 475
 
445
-		if (!empty($fields))
446
-			echo '
476
+		if (!empty($fields)) {
477
+					echo '
447 478
 			<div class="custom_fields_above_signature">
448 479
 				<ul class="nolist">', $fields, '
449 480
 				</ul>
450 481
 			</div>';
482
+		}
451 483
 	}
452 484
 
453 485
 	// Show the users signature.
454
-	if ($context['signature_enabled'] && !empty($context['member']['signature']))
455
-		echo '
486
+	if ($context['signature_enabled'] && !empty($context['member']['signature'])) {
487
+			echo '
456 488
 			<div class="signature">
457 489
 				<h5>', $txt['signature'], ':</h5>
458 490
 				', $context['member']['signature'], '
459 491
 			</div>';
492
+	}
460 493
 
461 494
 	// Are there any custom profile fields for below the signature?
462 495
 	if (!empty($context['print_custom_fields']['below_signature']))
463 496
 	{
464 497
 		$fields = '';
465
-		foreach ($context['print_custom_fields']['below_signature'] as $field)
466
-			if (!empty($field['output_html']))
498
+		foreach ($context['print_custom_fields']['below_signature'] as $field) {
499
+					if (!empty($field['output_html']))
467 500
 				echo '
468 501
 					<li>', $field['output_html'], '</li>';
502
+		}
469 503
 
470
-		if (!empty($fields))
471
-			echo '
504
+		if (!empty($fields)) {
505
+					echo '
472 506
 			<div class="custom_fields_below_signature">
473 507
 				<ul class="nolist">', $fields, '
474 508
 				</ul>
475 509
 			</div>';
510
+		}
476 511
 	}
477 512
 
478 513
 	echo '
@@ -514,62 +549,70 @@  discard block
 block discarded – undo
514 549
 			</div>
515 550
 			<div class="list_posts">';
516 551
 
517
-			if (!$post['approved'])
518
-				echo '
552
+			if (!$post['approved']) {
553
+							echo '
519 554
 				<div class="approve_post">
520 555
 					<em>', $txt['post_awaiting_approval'], '</em>
521 556
 				</div>';
557
+			}
522 558
 
523 559
 			echo '
524 560
 				', $post['body'], '
525 561
 			</div>';
526 562
 
527
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
528
-				echo '
563
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
564
+							echo '
529 565
 			<div class="floatright">
530 566
 				<ul class="quickbuttons">';
567
+			}
531 568
 
532 569
 			// If they *can* reply?
533
-			if ($post['can_reply'])
534
-				echo '
570
+			if ($post['can_reply']) {
571
+							echo '
535 572
 					<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
573
+			}
536 574
 
537 575
 			// If they *can* quote?
538
-			if ($post['can_quote'])
539
-				echo '
576
+			if ($post['can_quote']) {
577
+							echo '
540 578
 					<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>';
579
+			}
541 580
 
542 581
 			// How about... even... remove it entirely?!
543
-			if ($post['can_delete'])
544
-				echo '
582
+			if ($post['can_delete']) {
583
+							echo '
545 584
 					<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>';
585
+			}
546 586
 
547
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
548
-				echo '
587
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
588
+							echo '
549 589
 				</ul>
550 590
 			</div><!-- .floatright -->';
591
+			}
551 592
 
552 593
 			echo '
553 594
 		</div><!-- $post[css_class] -->';
554 595
 		}
596
+	} else {
597
+			template_show_list('attachments');
555 598
 	}
556
-	else
557
-		template_show_list('attachments');
558 599
 
559 600
 	// No posts? Just end with a informative message.
560
-	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
561
-		echo '
601
+	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) {
602
+			echo '
562 603
 		<div class="windowbg2">
563 604
 			', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
564 605
 		</div>';
606
+	}
565 607
 
566 608
 	// Show more page numbers.
567
-	if (!empty($context['page_index']))
568
-		echo '
609
+	if (!empty($context['page_index'])) {
610
+			echo '
569 611
 		<div class="pagesection">
570 612
 			<div class="pagelinks">', $context['page_index'], '</div>
571 613
 		</div>';
572
-}
614
+	}
615
+	}
573 616
 
574 617
 /**
575 618
  * Template for showing alerts within the alerts popup
@@ -579,11 +622,12 @@  discard block
 block discarded – undo
579 622
 	global $context, $txt, $scripturl;
580 623
 
581 624
 	// Do we have an update message?
582
-	if (!empty($context['update_message']))
583
-		echo '
625
+	if (!empty($context['update_message'])) {
626
+			echo '
584 627
 		<div class="infobox">
585 628
 			', $context['update_message'], '.
586 629
 		</div>';
630
+	}
587 631
 
588 632
 	echo '
589 633
 		<div class="cat_bar">
@@ -592,13 +636,12 @@  discard block
 block discarded – undo
592 636
 			</h3>
593 637
 		</div>';
594 638
 
595
-	if (empty($context['alerts']))
596
-		echo '
639
+	if (empty($context['alerts'])) {
640
+			echo '
597 641
 		<div class="information">
598 642
 			', $txt['alerts_none'], '
599 643
 		</div>';
600
-
601
-	else
644
+	} else
602 645
 	{
603 646
 		// Start the form.
604 647
 		echo '
@@ -660,12 +703,12 @@  discard block
 block discarded – undo
660 703
 		</div>' : '';
661 704
 
662 705
 	// No drafts? Just show an informative message.
663
-	if (empty($context['drafts']))
664
-		echo '
706
+	if (empty($context['drafts'])) {
707
+			echo '
665 708
 		<div class="windowbg2 centertext">
666 709
 			', $txt['draft_none'], '
667 710
 		</div>';
668
-	else
711
+	} else
669 712
 	{
670 713
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
671 714
 		foreach ($context['drafts'] as $draft)
@@ -677,13 +720,15 @@  discard block
 block discarded – undo
677 720
 				<h5>
678 721
 					<strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
679 722
 
680
-			if (!empty($draft['sticky']))
681
-				echo '
723
+			if (!empty($draft['sticky'])) {
724
+							echo '
682 725
 					<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
726
+			}
683 727
 
684
-			if (!empty($draft['locked']))
685
-				echo '
728
+			if (!empty($draft['locked'])) {
729
+							echo '
686 730
 					<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
731
+			}
687 732
 
688 733
 			echo '
689 734
 				</h5>
@@ -716,13 +761,13 @@  discard block
 block discarded – undo
716 761
 {
717 762
 	global $context, $scripturl, $txt;
718 763
 
719
-	if (!empty($context['saved_successful']))
720
-		echo '
764
+	if (!empty($context['saved_successful'])) {
765
+			echo '
721 766
 	<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
722
-
723
-	elseif (!empty($context['saved_failed']))
724
-		echo '
767
+	} elseif (!empty($context['saved_failed'])) {
768
+			echo '
725 769
 	<div class="errorbox">', $context['saved_failed'], '</div>';
770
+	}
726 771
 
727 772
 	echo '
728 773
 	<div id="edit_buddies">
@@ -737,14 +782,16 @@  discard block
 block discarded – undo
737 782
 					<th scope="col" class="quarter_table">', $txt['name'], '</th>
738 783
 					<th scope="col">', $txt['status'], '</th>';
739 784
 
740
-	if (allowedTo('moderate_forum'))
741
-		echo '
785
+	if (allowedTo('moderate_forum')) {
786
+			echo '
742 787
 					<th scope="col">', $txt['email'], '</th>';
788
+	}
743 789
 
744
-	if (!empty($context['custom_pf']))
745
-		foreach ($context['custom_pf'] as $column)
790
+	if (!empty($context['custom_pf'])) {
791
+			foreach ($context['custom_pf'] as $column)
746 792
 				echo '
747 793
 					<th scope="col">', $column['label'], '</th>';
794
+	}
748 795
 
749 796
 	echo '
750 797
 					<th scope="col">', $txt['remove'], '</th>
@@ -753,13 +800,14 @@  discard block
 block discarded – undo
753 800
 			<tbody>';
754 801
 
755 802
 	// If they don't have any buddies don't list them!
756
-	if (empty($context['buddies']))
757
-		echo '
803
+	if (empty($context['buddies'])) {
804
+			echo '
758 805
 				<tr class="windowbg">
759 806
 					<td colspan="', allowedTo('moderate_forum') ? '10' : '9', '">
760 807
 						<strong>', $txt['no_buddies'], '</strong>
761 808
 					</td>
762 809
 				</tr>';
810
+	}
763 811
 
764 812
 		// Now loop through each buddy showing info on each.
765 813
 	else
@@ -773,17 +821,19 @@  discard block
 block discarded – undo
773 821
 						<a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a>
774 822
 					</td>';
775 823
 
776
-			if ($buddy['show_email'])
777
-				echo '
824
+			if ($buddy['show_email']) {
825
+							echo '
778 826
 					<td>
779 827
 						<a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a>
780 828
 					</td>';
829
+			}
781 830
 
782 831
 			// Show the custom profile fields for this user.
783
-			if (!empty($context['custom_pf']))
784
-				foreach ($context['custom_pf'] as $key => $column)
832
+			if (!empty($context['custom_pf'])) {
833
+							foreach ($context['custom_pf'] as $key => $column)
785 834
 					echo '
786 835
 					<td class="lefttext">', $buddy['options'][$key], '</td>';
836
+			}
787 837
 
788 838
 			echo '
789 839
 					<td>
@@ -816,9 +866,10 @@  discard block
 block discarded – undo
816 866
 			</dl>
817 867
 		</div>';
818 868
 
819
-	if (!empty($context['token_check']))
820
-		echo '
869
+	if (!empty($context['token_check'])) {
870
+			echo '
821 871
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
872
+	}
822 873
 
823 874
 	echo '
824 875
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -844,13 +895,13 @@  discard block
 block discarded – undo
844 895
 {
845 896
 	global $context, $scripturl, $txt;
846 897
 
847
-	if (!empty($context['saved_successful']))
848
-		echo '
898
+	if (!empty($context['saved_successful'])) {
899
+			echo '
849 900
 	<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
850
-
851
-	elseif (!empty($context['saved_failed']))
852
-		echo '
901
+	} elseif (!empty($context['saved_failed'])) {
902
+			echo '
853 903
 	<div class="errorbox">', $context['saved_failed'], '</div>';
904
+	}
854 905
 
855 906
 	echo '
856 907
 	<div id="edit_buddies">
@@ -865,9 +916,10 @@  discard block
 block discarded – undo
865 916
 					<th scope="col" class="quarter_table">', $txt['name'], '</th>
866 917
 					<th scope="col">', $txt['status'], '</th>';
867 918
 
868
-	if (allowedTo('moderate_forum'))
869
-		echo '
919
+	if (allowedTo('moderate_forum')) {
920
+			echo '
870 921
 					<th scope="col">', $txt['email'], '</th>';
922
+	}
871 923
 
872 924
 	echo '
873 925
 					<th scope="col">', $txt['ignore_remove'], '</th>
@@ -876,13 +928,14 @@  discard block
 block discarded – undo
876 928
 			<tbody>';
877 929
 
878 930
 	// If they don't have anyone on their ignore list, don't list it!
879
-	if (empty($context['ignore_list']))
880
-		echo '
931
+	if (empty($context['ignore_list'])) {
932
+			echo '
881 933
 				<tr class="windowbg">
882 934
 					<td colspan="', allowedTo('moderate_forum') ? '4' : '3', '">
883 935
 						<strong>', $txt['no_ignore'], '</strong>
884 936
 					</td>
885 937
 				</tr>';
938
+	}
886 939
 
887 940
 	// Now loop through each buddy showing info on each.
888 941
 	foreach ($context['ignore_list'] as $member)
@@ -894,11 +947,12 @@  discard block
 block discarded – undo
894 947
 						<a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a>
895 948
 					</td>';
896 949
 
897
-		if ($member['show_email'])
898
-			echo '
950
+		if ($member['show_email']) {
951
+					echo '
899 952
 					<td>
900 953
 						<a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a>
901 954
 					</td>';
955
+		}
902 956
 		echo '
903 957
 					<td>
904 958
 						<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>
@@ -928,9 +982,10 @@  discard block
 block discarded – undo
928 982
 			</dl>
929 983
 		</div>';
930 984
 
931
-	if (!empty($context['token_check']))
932
-		echo '
985
+	if (!empty($context['token_check'])) {
986
+			echo '
933 987
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
988
+	}
934 989
 
935 990
 	echo '
936 991
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -976,9 +1031,10 @@  discard block
 block discarded – undo
976 1031
 					<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
977 1032
 
978 1033
 	// Second address detected?
979
-	if (!empty($context['last_ip2']))
980
-		echo '
1034
+	if (!empty($context['last_ip2'])) {
1035
+			echo '
981 1036
 					, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
1037
+	}
982 1038
 
983 1039
 	echo '
984 1040
 				</dd>';
@@ -1044,9 +1100,10 @@  discard block
 block discarded – undo
1044 1100
 		</div>
1045 1101
 		<div class="windowbg2 noup">';
1046 1102
 
1047
-		foreach ($context['whois_servers'] as $server)
1048
-			echo '
1103
+		foreach ($context['whois_servers'] as $server) {
1104
+					echo '
1049 1105
 			<a href="', $server['url'], '" target="_blank" rel="noopener"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>';
1106
+		}
1050 1107
 		echo '
1051 1108
 		</div>
1052 1109
 		<br>';
@@ -1058,13 +1115,12 @@  discard block
 block discarded – undo
1058 1115
 			<h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
1059 1116
 		</div>';
1060 1117
 
1061
-	if (empty($context['ips']))
1062
-		echo '
1118
+	if (empty($context['ips'])) {
1119
+			echo '
1063 1120
 		<p class="windowbg2 description">
1064 1121
 			<em>', $txt['no_members_from_ip'], '</em>
1065 1122
 		</p>';
1066
-
1067
-	else
1123
+	} else
1068 1124
 	{
1069 1125
 		echo '
1070 1126
 		<table class="table_grid">
@@ -1077,12 +1133,13 @@  discard block
 block discarded – undo
1077 1133
 			<tbody>';
1078 1134
 
1079 1135
 		// Loop through each of the members and display them.
1080
-		foreach ($context['ips'] as $ip => $memberlist)
1081
-			echo '
1136
+		foreach ($context['ips'] as $ip => $memberlist) {
1137
+					echo '
1082 1138
 				<tr class="windowbg">
1083 1139
 					<td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
1084 1140
 					<td>', implode(', ', $memberlist), '</td>
1085 1141
 				</tr>';
1142
+		}
1086 1143
 
1087 1144
 		echo '
1088 1145
 			</tbody>
@@ -1124,11 +1181,10 @@  discard block
 block discarded – undo
1124 1181
 			</h3>
1125 1182
 		</div>';
1126 1183
 
1127
-	if ($context['member']['has_all_permissions'])
1128
-		echo '
1184
+	if ($context['member']['has_all_permissions']) {
1185
+			echo '
1129 1186
 		<div class="information">', $txt['showPermissions_all'], '</div>';
1130
-
1131
-	else
1187
+	} else
1132 1188
 	{
1133 1189
 		echo '
1134 1190
 		<div class="information">',$txt['showPermissions_help'], '</div>
@@ -1143,9 +1199,10 @@  discard block
 block discarded – undo
1143 1199
 			<div class="windowbg smalltext">
1144 1200
 				', $txt['showPermissions_restricted_boards_desc'], ':<br>';
1145 1201
 
1146
-			foreach ($context['no_access_boards'] as $no_access_board)
1147
-				echo '
1202
+			foreach ($context['no_access_boards'] as $no_access_board) {
1203
+							echo '
1148 1204
 				<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
1205
+			}
1149 1206
 			echo '
1150 1207
 			</div>';
1151 1208
 		}
@@ -1177,12 +1234,13 @@  discard block
 block discarded – undo
1177 1234
 							</td>
1178 1235
 							<td class="smalltext">';
1179 1236
 
1180
-				if ($permission['is_denied'])
1181
-					echo '
1237
+				if ($permission['is_denied']) {
1238
+									echo '
1182 1239
 								<span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>';
1183
-				else
1184
-					echo '
1240
+				} else {
1241
+									echo '
1185 1242
 								', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
1243
+				}
1186 1244
 
1187 1245
 				echo '
1188 1246
 							</td>
@@ -1193,10 +1251,10 @@  discard block
 block discarded – undo
1193 1251
 				</table>
1194 1252
 			</div><!-- .tborder -->
1195 1253
 			<br>';
1196
-		}
1197
-		else
1198
-			echo '
1254
+		} else {
1255
+					echo '
1199 1256
 			<p class="windowbg2">', $txt['showPermissions_none_general'], '</p>';
1257
+		}
1200 1258
 
1201 1259
 		// Board permission section.
1202 1260
 		echo '
@@ -1207,14 +1265,16 @@  discard block
 block discarded – undo
1207 1265
 						<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
1208 1266
 							<option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], '</option>';
1209 1267
 
1210
-		if (!empty($context['boards']))
1211
-			echo '
1268
+		if (!empty($context['boards'])) {
1269
+					echo '
1212 1270
 							<option value="" disabled>---------------------------</option>';
1271
+		}
1213 1272
 
1214 1273
 		// Fill the box with any local permission boards.
1215
-		foreach ($context['boards'] as $board)
1216
-			echo '
1274
+		foreach ($context['boards'] as $board) {
1275
+					echo '
1217 1276
 							<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
1277
+		}
1218 1278
 
1219 1279
 		echo '
1220 1280
 						</select>
@@ -1243,13 +1303,13 @@  discard block
 block discarded – undo
1243 1303
 						</td>
1244 1304
 						<td class="smalltext">';
1245 1305
 
1246
-				if ($permission['is_denied'])
1247
-					echo '
1306
+				if ($permission['is_denied']) {
1307
+									echo '
1248 1308
 							<span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>';
1249
-
1250
-				else
1251
-					echo '
1309
+				} else {
1310
+									echo '
1252 1311
 							', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
1312
+				}
1253 1313
 
1254 1314
 				echo '
1255 1315
 						</td>
@@ -1258,10 +1318,10 @@  discard block
 block discarded – undo
1258 1318
 			echo '
1259 1319
 				</tbody>
1260 1320
 			</table>';
1261
-		}
1262
-		else
1263
-			echo '
1321
+		} else {
1322
+					echo '
1264 1323
 			<p class="windowbg2">', $txt['showPermissions_none_board'], '</p>';
1324
+		}
1265 1325
 	echo '
1266 1326
 		</div><!-- #permissions -->';
1267 1327
 	}
@@ -1302,9 +1362,10 @@  discard block
 block discarded – undo
1302 1362
 			</div>';
1303 1363
 
1304 1364
 	// If they haven't post at all, don't draw the graph.
1305
-	if (empty($context['posts_by_time']))
1306
-		echo '
1365
+	if (empty($context['posts_by_time'])) {
1366
+			echo '
1307 1367
 			<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1368
+	}
1308 1369
 
1309 1370
 	// Otherwise do!
1310 1371
 	else
@@ -1313,8 +1374,8 @@  discard block
 block discarded – undo
1313 1374
 			<ul class="activity_stats flow_hidden">';
1314 1375
 
1315 1376
 		// The labels.
1316
-		foreach ($context['posts_by_time'] as $time_of_day)
1317
-			echo '
1377
+		foreach ($context['posts_by_time'] as $time_of_day) {
1378
+					echo '
1318 1379
 				<li', $time_of_day['is_last'] ? ' class="last"' : '', '>
1319 1380
 					<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']), '">
1320 1381
 						<div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
@@ -1323,6 +1384,7 @@  discard block
 block discarded – undo
1323 1384
 					</div>
1324 1385
 					<span class="stats_hour">', $time_of_day['hour_format'], '</span>
1325 1386
 				</li>';
1387
+		}
1326 1388
 
1327 1389
 		echo '
1328 1390
 			</ul>';
@@ -1341,11 +1403,10 @@  discard block
 block discarded – undo
1341 1403
 					</h3>
1342 1404
 				</div>';
1343 1405
 
1344
-	if (empty($context['popular_boards']))
1345
-		echo '
1406
+	if (empty($context['popular_boards'])) {
1407
+			echo '
1346 1408
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1347
-
1348
-	else
1409
+	} else
1349 1410
 	{
1350 1411
 		echo '
1351 1412
 				<dl class="stats">';
@@ -1375,10 +1436,10 @@  discard block
 block discarded – undo
1375 1436
 					</h3>
1376 1437
 				</div>';
1377 1438
 
1378
-	if (empty($context['board_activity']))
1379
-		echo '
1439
+	if (empty($context['board_activity'])) {
1440
+			echo '
1380 1441
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1381
-	else
1442
+	} else
1382 1443
 	{
1383 1444
 		echo '
1384 1445
 				<dl class="stats">';
@@ -1429,90 +1490,97 @@  discard block
 block discarded – undo
1429 1490
 				<h3 class="catbg profile_hd">';
1430 1491
 
1431 1492
 		// Don't say "Profile" if this isn't the profile...
1432
-		if (!empty($context['profile_header_text']))
1433
-			echo '
1493
+		if (!empty($context['profile_header_text'])) {
1494
+					echo '
1434 1495
 					', $context['profile_header_text'];
1435
-		else
1436
-			echo '
1496
+		} else {
1497
+					echo '
1437 1498
 					', $txt['profile'];
1499
+		}
1438 1500
 
1439 1501
 		echo '
1440 1502
 				</h3>
1441 1503
 			</div>';
1442 1504
 
1443 1505
 	// Have we some description?
1444
-	if ($context['page_desc'])
1445
-		echo '
1506
+	if ($context['page_desc']) {
1507
+			echo '
1446 1508
 			<p class="information">', $context['page_desc'], '</p>';
1509
+	}
1447 1510
 
1448 1511
 	echo '
1449 1512
 			<div class="roundframe">';
1450 1513
 
1451 1514
 	// Any bits at the start?
1452
-	if (!empty($context['profile_prehtml']))
1453
-		echo '
1515
+	if (!empty($context['profile_prehtml'])) {
1516
+			echo '
1454 1517
 				<div>', $context['profile_prehtml'], '</div>';
1518
+	}
1455 1519
 
1456
-	if (!empty($context['profile_fields']))
1457
-		echo '
1520
+	if (!empty($context['profile_fields'])) {
1521
+			echo '
1458 1522
 				<dl class="settings">';
1523
+	}
1459 1524
 
1460 1525
 	// Start the big old loop 'of love.
1461 1526
 	$lastItem = 'hr';
1462 1527
 	foreach ($context['profile_fields'] as $key => $field)
1463 1528
 	{
1464 1529
 		// We add a little hack to be sure we never get more than one hr in a row!
1465
-		if ($lastItem == 'hr' && $field['type'] == 'hr')
1466
-			continue;
1530
+		if ($lastItem == 'hr' && $field['type'] == 'hr') {
1531
+					continue;
1532
+		}
1467 1533
 
1468 1534
 		$lastItem = $field['type'];
1469
-		if ($field['type'] == 'hr')
1470
-			echo '
1535
+		if ($field['type'] == 'hr') {
1536
+					echo '
1471 1537
 				</dl>
1472 1538
 				<hr>
1473 1539
 				<dl class="settings">';
1474
-
1475
-		elseif ($field['type'] == 'callback')
1540
+		} elseif ($field['type'] == 'callback')
1476 1541
 		{
1477 1542
 			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
1478 1543
 			{
1479 1544
 				$callback_func = 'template_profile_' . $field['callback_func'];
1480 1545
 				$callback_func();
1481 1546
 			}
1482
-		}
1483
-		else
1547
+		} else
1484 1548
 		{
1485 1549
 			echo '
1486 1550
 					<dt>
1487 1551
 						<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
1488 1552
 
1489 1553
 			// Does it have any subtext to show?
1490
-			if (!empty($field['subtext']))
1491
-				echo '
1554
+			if (!empty($field['subtext'])) {
1555
+							echo '
1492 1556
 						<br>
1493 1557
 						<span class="smalltext">', $field['subtext'], '</span>';
1558
+			}
1494 1559
 
1495 1560
 			echo '
1496 1561
 					</dt>
1497 1562
 					<dd>';
1498 1563
 
1499 1564
 			// Want to put something infront of the box?
1500
-			if (!empty($field['preinput']))
1501
-				echo '
1565
+			if (!empty($field['preinput'])) {
1566
+							echo '
1502 1567
 						', $field['preinput'];
1568
+			}
1503 1569
 
1504 1570
 			// What type of data are we showing?
1505
-			if ($field['type'] == 'label')
1506
-				echo '
1571
+			if ($field['type'] == 'label') {
1572
+							echo '
1507 1573
 						', $field['value'];
1574
+			}
1508 1575
 
1509 1576
 			// Maybe it's a text box - very likely!
1510 1577
 			elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url')))
1511 1578
 			{
1512
-				if ($field['type'] == 'int' || $field['type'] == 'float')
1513
-					$type = 'number';
1514
-				else
1515
-					$type = $field['type'];
1579
+				if ($field['type'] == 'int' || $field['type'] == 'float') {
1580
+									$type = 'number';
1581
+				} else {
1582
+									$type = $field['type'];
1583
+				}
1516 1584
 				$step = $field['type'] == 'float' ? ' step="0.1"' : '';
1517 1585
 
1518 1586
 
@@ -1520,10 +1588,11 @@  discard block
 block discarded – undo
1520 1588
 						<input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' ', $step, '>';
1521 1589
 			}
1522 1590
 			// You "checking" me out? ;)
1523
-			elseif ($field['type'] == 'check')
1524
-				echo '
1591
+			elseif ($field['type'] == 'check') {
1592
+							echo '
1525 1593
 						<input type="hidden" name="', $key, '" value="0">
1526 1594
 						<input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>';
1595
+			}
1527 1596
 
1528 1597
 			// Always fun - select boxes!
1529 1598
 			elseif ($field['type'] == 'select')
@@ -1534,14 +1603,16 @@  discard block
 block discarded – undo
1534 1603
 				if (isset($field['options']))
1535 1604
 				{
1536 1605
 					// Is this some code to generate the options?
1537
-					if (!is_array($field['options']))
1538
-						$field['options'] = $field['options']();
1606
+					if (!is_array($field['options'])) {
1607
+											$field['options'] = $field['options']();
1608
+					}
1539 1609
 
1540 1610
 					// Assuming we now have some!
1541
-					if (is_array($field['options']))
1542
-						foreach ($field['options'] as $value => $name)
1611
+					if (is_array($field['options'])) {
1612
+											foreach ($field['options'] as $value => $name)
1543 1613
 							echo '
1544 1614
 							<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
1615
+					}
1545 1616
 				}
1546 1617
 
1547 1618
 				echo '
@@ -1549,31 +1620,34 @@  discard block
 block discarded – undo
1549 1620
 			}
1550 1621
 
1551 1622
 			// Something to end with?
1552
-			if (!empty($field['postinput']))
1553
-				echo '
1623
+			if (!empty($field['postinput'])) {
1624
+							echo '
1554 1625
 						', $field['postinput'];
1626
+			}
1555 1627
 
1556 1628
 			echo '
1557 1629
 					</dd>';
1558 1630
 		}
1559 1631
 	}
1560 1632
 
1561
-	if (!empty($context['profile_fields']))
1562
-		echo '
1633
+	if (!empty($context['profile_fields'])) {
1634
+			echo '
1563 1635
 				</dl>';
1636
+	}
1564 1637
 
1565 1638
 	// Are there any custom profile fields - if so print them!
1566 1639
 	if (!empty($context['custom_fields']))
1567 1640
 	{
1568
-		if ($lastItem != 'hr')
1569
-			echo '
1641
+		if ($lastItem != 'hr') {
1642
+					echo '
1570 1643
 				<hr>';
1644
+		}
1571 1645
 
1572 1646
 		echo '
1573 1647
 				<dl class="settings">';
1574 1648
 
1575
-		foreach ($context['custom_fields'] as $field)
1576
-			echo '
1649
+		foreach ($context['custom_fields'] as $field) {
1650
+					echo '
1577 1651
 					<dt>
1578 1652
 						<strong>', $field['name'], ': </strong><br>
1579 1653
 						<span class="smalltext">', $field['desc'], '</span>
@@ -1581,6 +1655,7 @@  discard block
 block discarded – undo
1581 1655
 					<dd>
1582 1656
 						', $field['input_html'], '
1583 1657
 					</dd>';
1658
+		}
1584 1659
 
1585 1660
 		echo '
1586 1661
 				</dl>';
@@ -1588,13 +1663,14 @@  discard block
 block discarded – undo
1588 1663
 	}
1589 1664
 
1590 1665
 	// Any closing HTML?
1591
-	if (!empty($context['profile_posthtml']))
1592
-		echo '
1666
+	if (!empty($context['profile_posthtml'])) {
1667
+			echo '
1593 1668
 				<div>', $context['profile_posthtml'], '</div>';
1669
+	}
1594 1670
 
1595 1671
 	// Only show the password box if it's actually needed.
1596
-	if ($context['require_password'])
1597
-		echo '
1672
+	if ($context['require_password']) {
1673
+			echo '
1598 1674
 				<dl class="settings">
1599 1675
 					<dt>
1600 1676
 						<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br>
@@ -1604,18 +1680,21 @@  discard block
 block discarded – undo
1604 1680
 						<input type="password" name="oldpasswrd" id="oldpasswrd" size="20">
1605 1681
 					</dd>
1606 1682
 				</dl>';
1683
+	}
1607 1684
 
1608 1685
 	// The button shouldn't say "Change profile" unless we're changing the profile...
1609
-	if (!empty($context['submit_button_text']))
1610
-		echo '
1686
+	if (!empty($context['submit_button_text'])) {
1687
+			echo '
1611 1688
 				<input type="submit" name="save" value="', $context['submit_button_text'], '" class="button floatright">';
1612
-	else
1613
-		echo '
1689
+	} else {
1690
+			echo '
1614 1691
 				<input type="submit" name="save" value="', $txt['change_profile'], '" class="button floatright">';
1692
+	}
1615 1693
 
1616
-	if (!empty($context['token_check']))
1617
-		echo '
1694
+	if (!empty($context['token_check'])) {
1695
+			echo '
1618 1696
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
1697
+	}
1619 1698
 
1620 1699
 	echo '
1621 1700
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1625,10 +1704,11 @@  discard block
 block discarded – undo
1625 1704
 		</form>';
1626 1705
 
1627 1706
 	// Any final spellchecking stuff?
1628
-	if (!empty($context['show_spellchecking']))
1629
-		echo '
1707
+	if (!empty($context['show_spellchecking'])) {
1708
+			echo '
1630 1709
 		<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>';
1631
-}
1710
+	}
1711
+	}
1632 1712
 
1633 1713
 /**
1634 1714
  * Personal Message settings.
@@ -1665,10 +1745,11 @@  discard block
 block discarded – undo
1665 1745
 						<select name="pm_receive_from" id="pm_receive_from">
1666 1746
 							<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
1667 1747
 
1668
-	if (!empty($modSettings['enable_buddylist']))
1669
-		echo '
1748
+	if (!empty($modSettings['enable_buddylist'])) {
1749
+			echo '
1670 1750
 							<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option>
1671 1751
 							<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
1752
+	}
1672 1753
 
1673 1754
 	echo '
1674 1755
 							<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option>
@@ -1711,11 +1792,12 @@  discard block
 block discarded – undo
1711 1792
 		if (empty($setting) || !is_array($setting))
1712 1793
 		{
1713 1794
 			// Insert a separator (unless this is the first item in the list)
1714
-			if ($i !== $first_option_key)
1715
-				echo '
1795
+			if ($i !== $first_option_key) {
1796
+							echo '
1716 1797
 				</dl>
1717 1798
 				<hr>
1718 1799
 				<dl class="settings">';
1800
+			}
1719 1801
 
1720 1802
 			// Should we give a name to this section?
1721 1803
 			if (is_string($setting) && !empty($setting))
@@ -1724,69 +1806,67 @@  discard block
 block discarded – undo
1724 1806
 				echo '
1725 1807
 					<dt><strong>' . $setting . '</strong></dt>
1726 1808
 					<dd></dd>';
1809
+			} else {
1810
+							$titled_section = false;
1727 1811
 			}
1728
-			else
1729
-				$titled_section = false;
1730 1812
 
1731 1813
 			continue;
1732 1814
 		}
1733 1815
 
1734 1816
 		// Is this disabled?
1735
-		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled']))
1736
-			continue;
1737
-
1738
-		elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage']))
1739
-			continue;
1740
-
1741
-		elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored']))
1742
-			continue;
1743
-
1744
-		elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist']))
1745
-			continue;
1746
-
1747
-		elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg']))
1748
-			continue;
1749
-
1750
-		elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1751
-			continue;
1752
-
1753
-		elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1754
-			continue;
1817
+		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) {
1818
+					continue;
1819
+		} elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) {
1820
+					continue;
1821
+		} elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) {
1822
+					continue;
1823
+		} elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) {
1824
+					continue;
1825
+		} elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) {
1826
+					continue;
1827
+		} elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1828
+					continue;
1829
+		} elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1830
+					continue;
1831
+		}
1755 1832
 
1756 1833
 		// Some of these may not be set...  Set to defaults here
1757 1834
 		$opts = array('topics_per_page', 'messages_per_page', 'display_quick_mod');
1758
-		if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']]))
1759
-			$context['member']['options'][$setting['id']] = 0;
1760
-
1761
-		if (!isset($setting['type']) || $setting['type'] == 'bool')
1762
-			$setting['type'] = 'checkbox';
1763
-
1764
-		elseif ($setting['type'] == 'int' || $setting['type'] == 'integer')
1765
-			$setting['type'] = 'number';
1835
+		if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']])) {
1836
+					$context['member']['options'][$setting['id']] = 0;
1837
+		}
1766 1838
 
1767
-		elseif ($setting['type'] == 'string')
1768
-			$setting['type'] = 'text';
1839
+		if (!isset($setting['type']) || $setting['type'] == 'bool') {
1840
+					$setting['type'] = 'checkbox';
1841
+		} elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') {
1842
+					$setting['type'] = 'number';
1843
+		} elseif ($setting['type'] == 'string') {
1844
+					$setting['type'] = 'text';
1845
+		}
1769 1846
 
1770
-		if (isset($setting['options']))
1771
-			$setting['type'] = 'list';
1847
+		if (isset($setting['options'])) {
1848
+					$setting['type'] = 'list';
1849
+		}
1772 1850
 
1773 1851
 		echo '
1774 1852
 					<dt>
1775 1853
 						<label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>';
1776 1854
 
1777
-		if (isset($setting['description']))
1778
-			echo '
1855
+		if (isset($setting['description'])) {
1856
+					echo '
1779 1857
 						<br>
1780 1858
 						<span class="smalltext">', $setting['description'], '</span>';
1859
+		}
1781 1860
 		echo '
1782 1861
 					</dt>
1783 1862
 					<dd>';
1784 1863
 
1785 1864
 		// Display checkbox options
1786
-		if ($setting['type'] == 'checkbox')
1787
-			echo '
1865
+		if ($setting['type'] == 'checkbox') {
1866
+					echo '
1788 1867
 						<input type="hidden" name="default_options[' . $setting['id'] . ']" value="0">
1789 1868
 						<input type="checkbox" name="default_options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($context['member']['options'][$setting['id']]) ? ' checked' : '', ' value="1">';
1869
+		}
1790 1870
 
1791 1871
 		// How about selection lists, we all love them
1792 1872
 		elseif ($setting['type'] == 'list')
@@ -1794,9 +1874,10 @@  discard block
 block discarded – undo
1794 1874
 			echo '
1795 1875
 						<select name="default_options[', $setting['id'], ']" id="', $setting['id'], '"', '>';
1796 1876
 
1797
-			foreach ($setting['options'] as $value => $label)
1798
-				echo '
1877
+			foreach ($setting['options'] as $value => $label) {
1878
+							echo '
1799 1879
 							<option value="', $value, '"', $value == $context['member']['options'][$setting['id']] ? ' selected' : '', '>', $label, '</option>';
1880
+			}
1800 1881
 
1801 1882
 			echo '
1802 1883
 						</select>';
@@ -1812,14 +1893,13 @@  discard block
 block discarded – undo
1812 1893
 
1813 1894
 				echo '
1814 1895
 						<input type="number"', $min . $max . $step;
1815
-			}
1816
-			elseif (isset($setting['type']) && $setting['type'] == 'url')
1817
-				echo'
1896
+			} elseif (isset($setting['type']) && $setting['type'] == 'url') {
1897
+							echo'
1818 1898
 						<input type="url"';
1819
-
1820
-			else
1821
-				echo '
1899
+			} else {
1900
+							echo '
1822 1901
 						<input type="text"';
1902
+			}
1823 1903
 
1824 1904
 			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"' : '', '>';
1825 1905
 		}
@@ -1856,8 +1936,8 @@  discard block
 block discarded – undo
1856 1936
 				<dl class="settings">';
1857 1937
 
1858 1938
 	// Allow notification on announcements to be disabled?
1859
-	if (!empty($modSettings['allow_disableAnnounce']))
1860
-		echo '
1939
+	if (!empty($modSettings['allow_disableAnnounce'])) {
1940
+			echo '
1861 1941
 					<dt>
1862 1942
 						<label for="notify_announcements">', $txt['notify_important_email'], '</label>
1863 1943
 					</dt>
@@ -1865,15 +1945,17 @@  discard block
 block discarded – undo
1865 1945
 						<input type="hidden" name="notify_announcements" value="0">
1866 1946
 						<input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', '>
1867 1947
 					</dd>';
1948
+	}
1868 1949
 
1869
-	if (!empty($modSettings['enable_ajax_alerts']))
1870
-		echo '
1950
+	if (!empty($modSettings['enable_ajax_alerts'])) {
1951
+			echo '
1871 1952
 					<dt>
1872 1953
 						<label for="notify_send_body">', $txt['notify_alert_timeout'], '</label>
1873 1954
 					</dt>
1874 1955
 					<dd>
1875 1956
 						<input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '">
1876 1957
 					</dd>';
1958
+	}
1877 1959
 
1878 1960
 	echo '
1879 1961
 				</dl>
@@ -1905,9 +1987,10 @@  discard block
 block discarded – undo
1905 1987
 
1906 1988
 				$label = $txt['alert_opt_' . $opts[1]];
1907 1989
 				$label_pos = isset($opts['label']) ? $opts['label'] : '';
1908
-				if ($label_pos == 'before')
1909
-					echo '
1990
+				if ($label_pos == 'before') {
1991
+									echo '
1910 1992
 						<label for="opt_', $opts[1], '">', $label, '</label>';
1993
+				}
1911 1994
 
1912 1995
 				$this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0;
1913 1996
 				switch ($opts[0])
@@ -1921,17 +2004,19 @@  discard block
 block discarded – undo
1921 2004
 						echo '
1922 2005
 						<select name="opt_', $opts[1], '" id="opt_', $opts[1], '">';
1923 2006
 
1924
-						foreach ($opts['opts'] as $k => $v)
1925
-							echo '
2007
+						foreach ($opts['opts'] as $k => $v) {
2008
+													echo '
1926 2009
 							<option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>';
2010
+						}
1927 2011
 						echo '
1928 2012
 						</select>';
1929 2013
 						break;
1930 2014
 				}
1931 2015
 
1932
-				if ($label_pos == 'after')
1933
-					echo '
2016
+				if ($label_pos == 'after') {
2017
+									echo '
1934 2018
 						<label for="opt_', $opts[1], '">', $label, '</label>';
2019
+				}
1935 2020
 
1936 2021
 				echo '
1937 2022
 					</td>
@@ -2048,11 +2133,12 @@  discard block
 block discarded – undo
2048 2133
 			<p class="information">', $txt['groupMembership_info'], '</p>';
2049 2134
 
2050 2135
 	// Do we have an update message?
2051
-	if (!empty($context['update_message']))
2052
-		echo '
2136
+	if (!empty($context['update_message'])) {
2137
+			echo '
2053 2138
 			<div class="infobox">
2054 2139
 				', $context['update_message'], '.
2055 2140
 			</div>';
2141
+	}
2056 2142
 
2057 2143
 	echo '
2058 2144
 			<div id="groups">';
@@ -2074,8 +2160,7 @@  discard block
 block discarded – undo
2074 2160
 						</div>
2075 2161
 					</div>
2076 2162
 				</div><!-- .groupmembership -->';
2077
-	}
2078
-	else
2163
+	} else
2079 2164
 	{
2080 2165
 		echo '
2081 2166
 				<div class="title_bar">
@@ -2087,27 +2172,30 @@  discard block
 block discarded – undo
2087 2172
 			echo '
2088 2173
 				<div class="windowbg" id="primdiv_', $group['id'], '">';
2089 2174
 
2090
-				if ($context['can_edit_primary'])
2091
-					echo '
2175
+				if ($context['can_edit_primary']) {
2176
+									echo '
2092 2177
 					<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', '>';
2178
+				}
2093 2179
 
2094 2180
 				echo '
2095 2181
 					<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>';
2096 2182
 
2097 2183
 				// Can they leave their group?
2098
-				if ($group['can_leave'])
2099
-					echo '
2184
+				if ($group['can_leave']) {
2185
+									echo '
2100 2186
 					<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>';
2187
+				}
2101 2188
 
2102 2189
 				echo '
2103 2190
 				</div><!-- .windowbg -->';
2104 2191
 		}
2105 2192
 
2106
-		if ($context['can_edit_primary'])
2107
-			echo '
2193
+		if ($context['can_edit_primary']) {
2194
+					echo '
2108 2195
 				<div class="padding righttext">
2109 2196
 					<input type="submit" value="', $txt['make_primary'], '" class="button">
2110 2197
 				</div>';
2198
+		}
2111 2199
 
2112 2200
 		// Any groups they can join?
2113 2201
 		if (!empty($context['groups']['available']))
@@ -2123,17 +2211,16 @@  discard block
 block discarded – undo
2123 2211
 				<div class="windowbg">
2124 2212
 					<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>' : ''), '';
2125 2213
 
2126
-				if ($group['type'] == 3)
2127
-					echo '
2214
+				if ($group['type'] == 3) {
2215
+									echo '
2128 2216
 					<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>';
2129
-
2130
-				elseif ($group['type'] == 2 && $group['pending'])
2131
-					echo '
2217
+				} elseif ($group['type'] == 2 && $group['pending']) {
2218
+									echo '
2132 2219
 					<span class="floatright">', $txt['approval_pending'], '</span>';
2133
-
2134
-				elseif ($group['type'] == 2)
2135
-					echo '
2220
+				} elseif ($group['type'] == 2) {
2221
+									echo '
2136 2222
 					<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
2223
+				}
2137 2224
 
2138 2225
 				echo '
2139 2226
 				</div><!-- .windowbg -->';
@@ -2156,9 +2243,10 @@  discard block
 block discarded – undo
2156 2243
 
2157 2244
 						prevDiv.className = "windowbg";
2158 2245
 					}';
2159
-		if (isset($context['groups']['member'][$context['primary_group']]))
2160
-			echo '
2246
+		if (isset($context['groups']['member'][$context['primary_group']])) {
2247
+					echo '
2161 2248
 					highlightSelected("primdiv_' . $context['primary_group'] . '");';
2249
+		}
2162 2250
 
2163 2251
 		echo '
2164 2252
 				</script>';
@@ -2167,9 +2255,10 @@  discard block
 block discarded – undo
2167 2255
 	echo '
2168 2256
 			</div><!-- #groups -->';
2169 2257
 
2170
-	if (!empty($context['token_check']))
2171
-		echo '
2258
+	if (!empty($context['token_check'])) {
2259
+			echo '
2172 2260
 			<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2261
+	}
2173 2262
 
2174 2263
 	echo '
2175 2264
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2217,14 +2306,15 @@  discard block
 block discarded – undo
2217 2306
 
2218 2307
 		foreach ($category['boards'] as $board)
2219 2308
 		{
2220
-			if ($i == $limit)
2221
-				echo '
2309
+			if ($i == $limit) {
2310
+							echo '
2222 2311
 						</ul>
2223 2312
 					</li>
2224 2313
 				</ul>
2225 2314
 				<ul class="ignoreboards floatright">
2226 2315
 					<li class="category">
2227 2316
 						<ul>';
2317
+			}
2228 2318
 
2229 2319
 			echo '
2230 2320
 							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
@@ -2270,10 +2360,11 @@  discard block
 block discarded – undo
2270 2360
 
2271 2361
 	// Work out the starting color.
2272 2362
 	$context['current_color'] = $context['colors'][0];
2273
-	foreach ($context['colors'] as $limit => $color)
2274
-		if ($context['member']['warning'] >= $limit)
2363
+	foreach ($context['colors'] as $limit => $color) {
2364
+			if ($context['member']['warning'] >= $limit)
2275 2365
 			$context['current_color'] = $color;
2276
-}
2366
+	}
2367
+	}
2277 2368
 
2278 2369
 // Show all warnings of a user?
2279 2370
 function template_viewWarning()
@@ -2312,14 +2403,15 @@  discard block
 block discarded – undo
2312 2403
 				</dd>';
2313 2404
 
2314 2405
 	// There's some impact of this?
2315
-	if (!empty($context['level_effects'][$context['current_level']]))
2316
-		echo '
2406
+	if (!empty($context['level_effects'][$context['current_level']])) {
2407
+			echo '
2317 2408
 				<dt>
2318 2409
 					<strong>', $txt['profile_viewwarning_impact'], ':</strong>
2319 2410
 				</dt>
2320 2411
 				<dd>
2321 2412
 					', $context['level_effects'][$context['current_level']], '
2322 2413
 				</dd>';
2414
+	}
2323 2415
 
2324 2416
 	echo '
2325 2417
 			</dl>
@@ -2357,10 +2449,11 @@  discard block
 block discarded – undo
2357 2449
 
2358 2450
 			// Otherwise see what we can do...';
2359 2451
 
2360
-	foreach ($context['notification_templates'] as $k => $type)
2361
-		echo '
2452
+	foreach ($context['notification_templates'] as $k => $type) {
2453
+			echo '
2362 2454
 			if (index == ', $k, ')
2363 2455
 				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
2456
+	}
2364 2457
 
2365 2458
 	echo '
2366 2459
 		}
@@ -2370,10 +2463,11 @@  discard block
 block discarded – undo
2370 2463
 			// Also set the right effect.
2371 2464
 			effectText = "";';
2372 2465
 
2373
-	foreach ($context['level_effects'] as $limit => $text)
2374
-		echo '
2466
+	foreach ($context['level_effects'] as $limit => $text) {
2467
+			echo '
2375 2468
 			if (slideAmount >= ', $limit, ')
2376 2469
 				effectText = "', $text, '";';
2470
+	}
2377 2471
 
2378 2472
 	echo '
2379 2473
 			setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\');
@@ -2388,32 +2482,35 @@  discard block
 block discarded – undo
2388 2482
 			</h3>
2389 2483
 		</div>';
2390 2484
 
2391
-	if (!$context['user']['is_owner'])
2392
-		echo '
2485
+	if (!$context['user']['is_owner']) {
2486
+			echo '
2393 2487
 		<p class="information">', $txt['profile_warning_desc'], '</p>';
2488
+	}
2394 2489
 
2395 2490
 	echo '
2396 2491
 		<div class="windowbg">
2397 2492
 			<dl class="settings">';
2398 2493
 
2399
-	if (!$context['user']['is_owner'])
2400
-		echo '
2494
+	if (!$context['user']['is_owner']) {
2495
+			echo '
2401 2496
 				<dt>
2402 2497
 					<strong>', $txt['profile_warning_name'], ':</strong>
2403 2498
 				</dt>
2404 2499
 				<dd>
2405 2500
 					<strong>', $context['member']['name'], '</strong>
2406 2501
 				</dd>';
2502
+	}
2407 2503
 
2408 2504
 	echo '
2409 2505
 				<dt>
2410 2506
 					<strong>', $txt['profile_warning_level'], ':</strong>';
2411 2507
 
2412 2508
 	// Is there only so much they can apply?
2413
-	if ($context['warning_limit'])
2414
-		echo '
2509
+	if ($context['warning_limit']) {
2510
+			echo '
2415 2511
 					<br>
2416 2512
 					<span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
2513
+	}
2417 2514
 
2418 2515
 	echo '
2419 2516
 				</dt>
@@ -2468,9 +2565,10 @@  discard block
 block discarded – undo
2468 2565
 						<option value="-1">', $txt['profile_warning_notify_template'], '</option>
2469 2566
 						<option value="-1" disabled>------------------------------</option>';
2470 2567
 
2471
-		foreach ($context['notification_templates'] as $id_template => $template)
2472
-			echo '
2568
+		foreach ($context['notification_templates'] as $id_template => $template) {
2569
+					echo '
2473 2570
 						<option value="', $id_template, '">', $template['title'], '</option>';
2571
+		}
2474 2572
 
2475 2573
 		echo '
2476 2574
 					</select>
@@ -2483,9 +2581,10 @@  discard block
 block discarded – undo
2483 2581
 			</dl>
2484 2582
 			<div class="righttext">';
2485 2583
 
2486
-	if (!empty($context['token_check']))
2487
-		echo '
2584
+	if (!empty($context['token_check'])) {
2585
+			echo '
2488 2586
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2587
+	}
2489 2588
 
2490 2589
 	echo '
2491 2590
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2501,8 +2600,8 @@  discard block
 block discarded – undo
2501 2600
 	echo '
2502 2601
 	<script>';
2503 2602
 
2504
-	if (!$context['user']['is_owner'])
2505
-		echo '
2603
+	if (!$context['user']['is_owner']) {
2604
+			echo '
2506 2605
 		modifyWarnNotify();
2507 2606
 		$(document).ready(function() {
2508 2607
 			$("#preview_button").click(function() {
@@ -2541,6 +2640,7 @@  discard block
 block discarded – undo
2541 2640
 			});
2542 2641
 			return false;
2543 2642
 		}';
2643
+	}
2544 2644
 
2545 2645
 	echo '
2546 2646
 	</script>';
@@ -2563,17 +2663,19 @@  discard block
 block discarded – undo
2563 2663
 			</div>';
2564 2664
 
2565 2665
 	// If deleting another account give them a lovely info box.
2566
-	if (!$context['user']['is_owner'])
2567
-		echo '
2666
+	if (!$context['user']['is_owner']) {
2667
+			echo '
2568 2668
 			<p class="information">', $txt['deleteAccount_desc'], '</p>';
2669
+	}
2569 2670
 
2570 2671
 	echo '
2571 2672
 			<div class="windowbg2">';
2572 2673
 
2573 2674
 	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
2574
-	if ($context['needs_approval'])
2575
-		echo '
2675
+	if ($context['needs_approval']) {
2676
+			echo '
2576 2677
 				<div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
2678
+	}
2577 2679
 
2578 2680
 	// If the user is deleting their own account warn them first - and require a password!
2579 2681
 	if ($context['user']['is_owner'])
@@ -2585,9 +2687,10 @@  discard block
 block discarded – undo
2585 2687
 					<input type="password" name="oldpasswrd" size="20">
2586 2688
 					<input type="submit" value="', $txt['yes'], '" class="button">';
2587 2689
 
2588
-		if (!empty($context['token_check']))
2589
-			echo '
2690
+		if (!empty($context['token_check'])) {
2691
+					echo '
2590 2692
 					<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2693
+		}
2591 2694
 
2592 2695
 		echo '
2593 2696
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2617,10 +2720,11 @@  discard block
 block discarded – undo
2617 2720
 						<option value="topics">', $txt['deleteAccount_topics'], '</option>
2618 2721
 					</select>';
2619 2722
 
2620
-			if ($context['show_perma_delete'])
2621
-				echo '
2723
+			if ($context['show_perma_delete']) {
2724
+							echo '
2622 2725
 					<br>
2623 2726
 					<label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1">', $txt['deleteAccount_permanent'], ':</label>';
2727
+			}
2624 2728
 
2625 2729
 			echo '
2626 2730
 				</div>';
@@ -2633,9 +2737,10 @@  discard block
 block discarded – undo
2633 2737
 				<div>
2634 2738
 					<input type="submit" value="', $txt['delete'], '" class="button">';
2635 2739
 
2636
-		if (!empty($context['token_check']))
2637
-			echo '
2740
+		if (!empty($context['token_check'])) {
2741
+					echo '
2638 2742
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2743
+		}
2639 2744
 
2640 2745
 		echo '
2641 2746
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2661,8 +2766,8 @@  discard block
 block discarded – undo
2661 2766
 					<hr>';
2662 2767
 
2663 2768
 	// Only show the password box if it's actually needed.
2664
-	if ($context['require_password'])
2665
-		echo '
2769
+	if ($context['require_password']) {
2770
+			echo '
2666 2771
 					<dl class="settings">
2667 2772
 						<dt>
2668 2773
 							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br>
@@ -2672,13 +2777,15 @@  discard block
 block discarded – undo
2672 2777
 							<input type="password" name="oldpasswrd" size="20">
2673 2778
 						</dd>
2674 2779
 					</dl>';
2780
+	}
2675 2781
 
2676 2782
 	echo '
2677 2783
 					<div class="righttext">';
2678 2784
 
2679
-	if (!empty($context['token_check']))
2680
-		echo '
2785
+	if (!empty($context['token_check'])) {
2786
+			echo '
2681 2787
 						<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2788
+	}
2682 2789
 
2683 2790
 	echo '
2684 2791
 						<input type="submit" value="', $txt['change_profile'], '" class="button">
@@ -2705,9 +2812,10 @@  discard block
 block discarded – undo
2705 2812
 			<ul id="list_errors">';
2706 2813
 
2707 2814
 		// Cycle through each error and display an error message.
2708
-		foreach ($context['post_errors'] as $error)
2709
-			echo '
2815
+		foreach ($context['post_errors'] as $error) {
2816
+					echo '
2710 2817
 				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
2818
+		}
2711 2819
 
2712 2820
 		echo '
2713 2821
 			</ul>';
@@ -2733,12 +2841,13 @@  discard block
 block discarded – undo
2733 2841
 								<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;"' : ''), '>';
2734 2842
 
2735 2843
 	// Fill the select box with all primary member groups that can be assigned to a member.
2736
-	foreach ($context['member_groups'] as $member_group)
2737
-		if (!empty($member_group['can_be_primary']))
2844
+	foreach ($context['member_groups'] as $member_group) {
2845
+			if (!empty($member_group['can_be_primary']))
2738 2846
 			echo '
2739 2847
 									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '>
2740 2848
 										', $member_group['name'], '
2741 2849
 									</option>';
2850
+	}
2742 2851
 
2743 2852
 	echo '
2744 2853
 								</select>
@@ -2751,10 +2860,11 @@  discard block
 block discarded – undo
2751 2860
 									<input type="hidden" name="additional_groups[]" value="0">';
2752 2861
 
2753 2862
 	// For each membergroup show a checkbox so members can be assigned to more than one group.
2754
-	foreach ($context['member_groups'] as $member_group)
2755
-		if ($member_group['can_be_additional'])
2863
+	foreach ($context['member_groups'] as $member_group) {
2864
+			if ($member_group['can_be_additional'])
2756 2865
 			echo '
2757 2866
 									<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>';
2867
+	}
2758 2868
 
2759 2869
 	echo '
2760 2870
 								</span>
@@ -2814,9 +2924,10 @@  discard block
 block discarded – undo
2814 2924
 								<span class="smalltext">', $txt['sig_info'], '</span><br>
2815 2925
 								<br>';
2816 2926
 
2817
-	if ($context['show_spellchecking'])
2818
-		echo '
2927
+	if ($context['show_spellchecking']) {
2928
+			echo '
2819 2929
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button">';
2930
+	}
2820 2931
 
2821 2932
 	echo '
2822 2933
 							</dt>
@@ -2824,17 +2935,20 @@  discard block
 block discarded – undo
2824 2935
 								<textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br>';
2825 2936
 
2826 2937
 	// If there is a limit at all!
2827
-	if (!empty($context['signature_limits']['max_length']))
2828
-		echo '
2938
+	if (!empty($context['signature_limits']['max_length'])) {
2939
+			echo '
2829 2940
 								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>';
2941
+	}
2830 2942
 
2831
-	if (!empty($context['show_preview_button']))
2832
-		echo '
2943
+	if (!empty($context['show_preview_button'])) {
2944
+			echo '
2833 2945
 								<input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button floatright">';
2946
+	}
2834 2947
 
2835
-	if ($context['signature_warning'])
2836
-		echo '
2948
+	if ($context['signature_warning']) {
2949
+			echo '
2837 2950
 								<span class="smalltext">', $context['signature_warning'], '</span>';
2951
+	}
2838 2952
 
2839 2953
 	// Some javascript used to count how many characters have been used so far in the signature.
2840 2954
 	echo '
@@ -2879,9 +2993,10 @@  discard block
 block discarded – undo
2879 2993
 										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
2880 2994
 
2881 2995
 		// This lists all the file categories.
2882
-		foreach ($context['avatars'] as $avatar)
2883
-			echo '
2996
+		foreach ($context['avatars'] as $avatar) {
2997
+					echo '
2884 2998
 											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>';
2999
+		}
2885 3000
 
2886 3001
 		echo '
2887 3002
 										</select>
@@ -2913,20 +3028,22 @@  discard block
 block discarded – undo
2913 3028
 	}
2914 3029
 
2915 3030
 	// If the user can link to an off server avatar, show them a box to input the address.
2916
-	if (!empty($context['member']['avatar']['allow_external']))
2917
-		echo '
3031
+	if (!empty($context['member']['avatar']['allow_external'])) {
3032
+			echo '
2918 3033
 								<div id="avatar_external">
2919 3034
 									<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') : '', '
2920 3035
 									<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);">
2921 3036
 								</div>';
3037
+	}
2922 3038
 
2923 3039
 	// If the user is able to upload avatars to the server show them an upload box.
2924
-	if (!empty($context['member']['avatar']['allow_upload']))
2925
-		echo '
3040
+	if (!empty($context['member']['avatar']['allow_upload'])) {
3041
+			echo '
2926 3042
 								<div id="avatar_upload">
2927 3043
 									<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'), '
2928 3044
 									', (!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'] . '">' : ''), '
2929 3045
 								</div>';
3046
+	}
2930 3047
 
2931 3048
 	// if the user is able to use Gravatar avatars show then the image preview
2932 3049
 	if (!empty($context['member']['avatar']['allow_gravatar']))
@@ -2935,16 +3052,17 @@  discard block
 block discarded – undo
2935 3052
 								<div id="avatar_gravatar">
2936 3053
 									<img src="' . $context['member']['avatar']['href'] . '" alt="">';
2937 3054
 
2938
-		if (empty($modSettings['gravatarAllowExtraEmail']))
2939
-			echo '
3055
+		if (empty($modSettings['gravatarAllowExtraEmail'])) {
3056
+					echo '
2940 3057
 									<div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>';
2941
-		else
3058
+		} else
2942 3059
 		{
2943 3060
 			// Depending on other stuff, the stored value here might have some odd things in it from other areas.
2944
-			if ($context['member']['avatar']['external'] == $context['member']['email'])
2945
-				$textbox_value = '';
2946
-			else
2947
-				$textbox_value = $context['member']['avatar']['external'];
3061
+			if ($context['member']['avatar']['external'] == $context['member']['email']) {
3062
+							$textbox_value = '';
3063
+			} else {
3064
+							$textbox_value = $context['member']['avatar']['external'];
3065
+			}
2948 3066
 
2949 3067
 			echo '
2950 3068
 									<div class="smalltext">', $txt['gravatar_alternateEmail'], '</div>
@@ -3016,8 +3134,9 @@  discard block
 block discarded – undo
3016 3134
 	$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
3017 3135
 
3018 3136
 	$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
3019
-	if (empty($suffix))
3020
-		return;
3137
+	if (empty($suffix)) {
3138
+			return;
3139
+	}
3021 3140
 
3022 3141
 	echo '
3023 3142
 								<div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>';
@@ -3042,9 +3161,10 @@  discard block
 block discarded – undo
3042 3161
 								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;">';
3043 3162
 
3044 3163
 	// Help the user by showing a list of common time formats.
3045
-	foreach ($context['easy_timeformats'] as $time_format)
3046
-		echo '
3164
+	foreach ($context['easy_timeformats'] as $time_format) {
3165
+			echo '
3047 3166
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3167
+	}
3048 3168
 
3049 3169
 	echo '
3050 3170
 								</select>
@@ -3082,9 +3202,10 @@  discard block
 block discarded – undo
3082 3202
 							<dd>
3083 3203
 								<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.png\';">';
3084 3204
 
3085
-	foreach ($context['smiley_sets'] as $set)
3086
-		echo '
3205
+	foreach ($context['smiley_sets'] as $set) {
3206
+			echo '
3087 3207
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>';
3208
+	}
3088 3209
 
3089 3210
 	echo '
3090 3211
 								</select>
@@ -3136,10 +3257,11 @@  discard block
 block discarded – undo
3136 3257
 										<img src="', $context['tfa_qr_url'], '" alt="">
3137 3258
 									</div>';
3138 3259
 
3139
-	if (!empty($context['from_ajax']))
3140
-		echo '
3260
+	if (!empty($context['from_ajax'])) {
3261
+			echo '
3141 3262
 					<br>
3142 3263
 					<a href="javascript:self.close();"></a>';
3264
+	}
3143 3265
 
3144 3266
 	echo '
3145 3267
 				</div>
@@ -3179,17 +3301,16 @@  discard block
 block discarded – undo
3179 3301
 							</dt>
3180 3302
 							<dd>';
3181 3303
 
3182
-	if (!$context['tfa_enabled'] && $context['user']['is_owner'])
3183
-		echo '
3304
+	if (!$context['tfa_enabled'] && $context['user']['is_owner']) {
3305
+			echo '
3184 3306
 								<a href="', !empty($modSettings['force_ssl']) ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>';
3185
-
3186
-	elseif (!$context['tfa_enabled'])
3187
-		echo '
3307
+	} elseif (!$context['tfa_enabled']) {
3308
+			echo '
3188 3309
 								', $txt['tfa_profile_disabled'];
3189
-
3190
-	else
3191
-		echo '
3310
+	} else {
3311
+			echo '
3192 3312
 								', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable');
3313
+	}
3193 3314
 
3194 3315
 	echo '
3195 3316
 							</dd>';
Please login to merge, or discard this patch.
Themes/default/Xml.template.php 1 patch
Braces   +50 added lines, -37 removed lines patch added patch discarded remove patch
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 		<subject is_first="', $context['message']['first_in_topic'] ? '1' : '0', '"><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>
74 74
 		<body><![CDATA[', $context['message']['body'], ']]></body>
75 75
 		<success><![CDATA[', $txt['quick_modify_message'], ']]></success>';
76
-	}
77
-	else
78
-		echo '
76
+	} else {
77
+			echo '
79 78
 		<error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '" in_body="', cleanXml($context['message']['error_in_body']) ? '1' : '0', '"><![CDATA[', implode('<br />', $context['message']['errors']), ']]></error>';
79
+	}
80 80
 	echo '
81 81
 	</message>
82 82
 </smf>';
@@ -101,13 +101,14 @@  discard block
 block discarded – undo
101 101
 		echo '
102 102
 		<modified><![CDATA[', empty($modified) ? '' : cleanXml('&#171; <em>' . $modified . '</em>&#187;'), ']]></modified>';
103 103
 
104
-		if (!empty($context['message']['subject']))
105
-			echo '
104
+		if (!empty($context['message']['subject'])) {
105
+					echo '
106 106
 		<subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>';
107
-	}
108
-	else
109
-		echo '
107
+		}
108
+	} else {
109
+			echo '
110 110
 		<error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '"><![CDATA[', cleanXml(implode('<br />', $context['message']['errors'])), ']]></error>';
111
+	}
111 112
 	echo '
112 113
 	</message>
113 114
 </smf>';
@@ -128,10 +129,11 @@  discard block
 block discarded – undo
128 129
 	</preview>
129 130
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '" topic_locked="', $context['locked'] ? '1' : '0', '">';
130 131
 
131
-	if (!empty($context['post_error']))
132
-		foreach ($context['post_error'] as $message)
132
+	if (!empty($context['post_error'])) {
133
+			foreach ($context['post_error'] as $message)
133 134
 			echo '
134 135
 		<error><![CDATA[', cleanXml($message), ']]></error>';
136
+	}
135 137
 
136 138
 	echo '
137 139
 		<caption name="guestname" class="', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? 'error' : '', '" />
@@ -148,14 +150,15 @@  discard block
 block discarded – undo
148 150
 		echo '
149 151
 	<new_posts>';
150 152
 
151
-		foreach ($context['previous_posts'] as $post)
152
-			echo '
153
+		foreach ($context['previous_posts'] as $post) {
154
+					echo '
153 155
 		<post id="', $post['id'], '">
154 156
 			<time><![CDATA[', $post['time'], ']]></time>
155 157
 			<poster><![CDATA[', cleanXml($post['poster']), ']]></poster>
156 158
 			<message><![CDATA[', cleanXml($post['message']), ']]></message>
157 159
 			<is_ignored>', $post['is_ignored'] ? '1' : '0', '</is_ignored>
158 160
 		</post>';
161
+		}
159 162
 
160 163
 		echo '
161 164
 	</new_posts>';
@@ -181,10 +184,11 @@  discard block
 block discarded – undo
181 184
 	</preview>
182 185
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">';
183 186
 
184
-	if (!empty($context['post_error']['messages']))
185
-		foreach ($context['post_error']['messages'] as $message)
187
+	if (!empty($context['post_error']['messages'])) {
188
+			foreach ($context['post_error']['messages'] as $message)
186 189
 			echo '
187 190
 		<error><![CDATA[', cleanXml($message), ']]></error>';
191
+	}
188 192
 
189 193
 	echo '
190 194
 		<caption name="to" class="', isset($context['post_error']['no_to']) ? 'error' : '', '" />
@@ -214,10 +218,11 @@  discard block
 block discarded – undo
214 218
 	</preview>
215 219
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">';
216 220
 
217
-	if (!empty($context['post_error']['messages']))
218
-		foreach ($context['post_error']['messages'] as $message)
221
+	if (!empty($context['post_error']['messages'])) {
222
+			foreach ($context['post_error']['messages'] as $message)
219 223
 			echo '
220 224
 		<error><![CDATA[', cleanXml($message), ']]></error>';
225
+	}
221 226
 
222 227
 	echo '
223 228
 	</errors>';
@@ -233,20 +238,23 @@  discard block
 block discarded – undo
233 238
 {
234 239
 	global $context, $modSettings;
235 240
 
236
-	if (empty($context['yearly']))
237
-		return;
241
+	if (empty($context['yearly'])) {
242
+			return;
243
+	}
238 244
 
239 245
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
240 246
 <smf>';
241
-	foreach ($context['yearly'] as $year)
242
-		foreach ($year['months'] as $month)
247
+	foreach ($context['yearly'] as $year) {
248
+			foreach ($year['months'] as $month)
243 249
 		{
244 250
 			echo '
245 251
 	<month id="', $month['date']['year'], $month['date']['month'], '">';
252
+	}
246 253
 
247
-			foreach ($month['days'] as $day)
248
-				echo '
254
+			foreach ($month['days'] as $day) {
255
+							echo '
249 256
 		<day date="', $day['year'], '-', $day['month'], '-', $day['day'], '" new_topics="', $day['new_topics'], '" new_posts="', $day['new_posts'], '" new_members="', $day['new_members'], '" most_members_online="', $day['most_members_online'], '"', empty($modSettings['hitStats']) ? '' : ' hits="' . $day['hits'] . '"', ' />';
257
+			}
250 258
 
251 259
 			echo '
252 260
 	</month>';
@@ -269,17 +277,18 @@  discard block
 block discarded – undo
269 277
 	<pageIndex section="selected" startFrom="', $context['selected']['start'], '"><![CDATA[', $context['selected']['page_index'], ']]></pageIndex>';
270 278
 	foreach ($context['changes'] as $change)
271 279
 	{
272
-		if ($change['type'] == 'remove')
273
-			echo '
280
+		if ($change['type'] == 'remove') {
281
+					echo '
274 282
 	<change id="', $change['id'], '" curAction="remove" section="', $change['section'], '" />';
275
-		else
276
-			echo '
283
+		} else {
284
+					echo '
277 285
 	<change id="', $change['id'], '" curAction="insert" section="', $change['section'], '">
278 286
 		<subject><![CDATA[', cleanXml($change['insert_value']['subject']), ']]></subject>
279 287
 		<time><![CDATA[', cleanXml($change['insert_value']['time']), ']]></time>
280 288
 		<body><![CDATA[', cleanXml($change['insert_value']['body']), ']]></body>
281 289
 		<poster><![CDATA[', cleanXml($change['insert_value']['poster']), ']]></poster>
282 290
 	</change>';
291
+		}
283 292
 	}
284 293
 	echo '
285 294
 </smf>';
@@ -310,10 +319,10 @@  discard block
 block discarded – undo
310 319
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
311 320
 <smf>';
312 321
 
313
-	if (empty($context['topics']))
314
-		echo '
322
+	if (empty($context['topics'])) {
323
+			echo '
315 324
 		<noresults>', $txt['search_no_results'], '</noresults>';
316
-	else
325
+	} else
317 326
 	{
318 327
 		echo '
319 328
 		<results>';
@@ -382,9 +391,10 @@  discard block
 block discarded – undo
382 391
 		echo '
383 392
 	<item type="category" id="', $category['id'], '"><![CDATA[', cleanXml($category['name']), ']]></item>';
384 393
 
385
-		foreach ($category['boards'] as $board)
386
-			echo '
394
+		foreach ($category['boards'] as $board) {
395
+					echo '
387 396
 	<item type="board" id="', $board['id'], '" childlevel="', $board['child_level'], '"><![CDATA[', cleanXml($board['name']), ']]></item>';
397
+		}
388 398
 	}
389 399
 	echo '
390 400
 </smf>';
@@ -400,9 +410,10 @@  discard block
 block discarded – undo
400 410
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
401 411
 <smf>';
402 412
 
403
-	foreach ($context['icons'] as $icon)
404
-		echo '
413
+	foreach ($context['icons'] as $icon) {
414
+			echo '
405 415
 	<icon value="', $icon['value'], '" url="', $icon['url'], '"><![CDATA[', cleanXml($icon['name']), ']]></icon>';
416
+	}
406 417
 
407 418
 	echo '
408 419
 </smf>';
@@ -452,16 +463,18 @@  discard block
 block discarded – undo
452 463
 	foreach ($xml_data as $key => $data)
453 464
 	{
454 465
 		// A group?
455
-		if (is_array($data) && isset($data['identifier']))
456
-			template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level);
466
+		if (is_array($data) && isset($data['identifier'])) {
467
+					template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level);
468
+		}
457 469
 		// An item...
458 470
 		elseif (is_array($data) && isset($data['value']))
459 471
 		{
460 472
 			echo "\n", str_repeat("\t", $level), '<', $child_ident;
461 473
 
462
-			if (!empty($data['attributes']))
463
-				foreach ($data['attributes'] as $k => $v)
474
+			if (!empty($data['attributes'])) {
475
+							foreach ($data['attributes'] as $k => $v)
464 476
 					echo ' ' . $k . '="' . $v . '"';
477
+			}
465 478
 			echo '><![CDATA[', cleanXml($data['value']), ']]></', $child_ident, '>';
466 479
 		}
467 480
 
Please login to merge, or discard this patch.
Themes/default/Likes.template.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 		<div class="windowbg">
32 32
 			<ul id="likes">';
33 33
 
34
-	foreach ($context['likers'] as $liker => $like_details)
35
-		echo '
34
+	foreach ($context['likers'] as $liker => $like_details) {
35
+			echo '
36 36
 				<li>
37 37
 					', $like_details['profile']['avatar']['image'], '
38 38
 					<span>
@@ -41,6 +41,7 @@  discard block
 block discarded – undo
41 41
 					</span>
42 42
 					<span class="floatright">', $like_details['time'], '</span>
43 43
 				</li>';
44
+	}
44 45
 
45 46
 	echo '
46 47
 			</ul>
@@ -61,11 +62,12 @@  discard block
 block discarded – undo
61 62
 	echo '
62 63
 	<ul class="floatleft">';
63 64
 
64
-	if (!empty($context['data']['can_like']))
65
-		echo '
65
+	if (!empty($context['data']['can_like'])) {
66
+			echo '
66 67
 		<li class="like_button" id="', $context['data']['type'], '_', $context['data']['id_content'], '_likes"', '>
67 68
 			<a href="', $scripturl, '?action=likes;ltype=', $context['data']['type'], ';sa=like;like=', $context['data']['id_content'], ';', $context['session_var'], '=', $context['session_id'], '" class="', $context['data']['type'], '_like"><span class="generic_icons ', $context['data']['already_liked'] ? 'unlike' : 'like', '"></span> ', $context['data']['already_liked'] ? $txt['unlike'] : $txt['like'], '</a>
68 69
 		</li>';
70
+	}
69 71
 
70 72
 	if (!empty($context['data']['count']))
71 73
 	{
Please login to merge, or discard this patch.
Themes/default/ManageBans.template.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -26,9 +26,10 @@  discard block
 block discarded – undo
26 26
 				</h3>
27 27
 			</div>';
28 28
 
29
-	if ($context['ban']['is_new'])
30
-		echo '
29
+	if ($context['ban']['is_new']) {
30
+			echo '
31 31
 			<div class="information noup">', $txt['ban_add_notes'], '</div>';
32
+	}
32 33
 
33 34
 	// If there were errors creating the ban, show them.
34 35
 	if (!empty($context['error_messages']))
@@ -38,9 +39,10 @@  discard block
 block discarded – undo
38 39
 				<strong>', $txt['ban_errors_detected'], '</strong>
39 40
 				<ul>';
40 41
 
41
-		foreach ($context['error_messages'] as $error)
42
-			echo '
42
+		foreach ($context['error_messages'] as $error) {
43
+					echo '
43 44
 					<li class="error">', $error, '</li>';
45
+		}
44 46
 
45 47
 		echo '
46 48
 				</ul>
@@ -57,8 +59,8 @@  discard block
 block discarded – undo
57 59
 						<input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60">
58 60
 					</dd>';
59 61
 
60
-	if (isset($context['ban']['reason']))
61
-		echo '
62
+	if (isset($context['ban']['reason'])) {
63
+			echo '
62 64
 					<dt>
63 65
 						<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br>
64 66
 						<span class="smalltext">', $txt['ban_reason_desc'], '</span>
@@ -66,9 +68,10 @@  discard block
 block discarded – undo
66 68
 					<dd>
67 69
 						<textarea name="reason" id="reason" cols="40" rows="3">', $context['ban']['reason'], '</textarea>
68 70
 					</dd>';
71
+	}
69 72
 
70
-	if (isset($context['ban']['notes']))
71
-		echo '
73
+	if (isset($context['ban']['notes'])) {
74
+			echo '
72 75
 					<dt>
73 76
 						<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br>
74 77
 						<span class="smalltext">', $txt['ban_notes_desc'], '</span>
@@ -76,6 +79,7 @@  discard block
 block discarded – undo
76 79
 					<dd>
77 80
 						<textarea name="notes" id="ban_notes" cols="40" rows="3">', $context['ban']['notes'], '</textarea>
78 81
 					</dd>';
82
+	}
79 83
 
80 84
 	echo '
81 85
 				</dl>
@@ -115,8 +119,8 @@  discard block
 block discarded – undo
115 119
 							<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;">
116 120
 						</dd>';
117 121
 
118
-		if (empty($modSettings['disableHostnameLookup']))
119
-			echo '
122
+		if (empty($modSettings['disableHostnameLookup'])) {
123
+					echo '
120 124
 						<dt>
121 125
 							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '>
122 126
 							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
@@ -124,6 +128,7 @@  discard block
 block discarded – undo
124 128
 						<dd>
125 129
 							<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;">
126 130
 						</dd>';
131
+		}
127 132
 
128 133
 		echo '
129 134
 						<dt>
@@ -153,14 +158,15 @@  discard block
 block discarded – undo
153 158
 					<dl class="settings">';
154 159
 
155 160
 					$count = 0;
156
-					foreach ($ban_ips as $ip)
157
-						echo '
161
+					foreach ($ban_ips as $ip) {
162
+											echo '
158 163
 						<dt>
159 164
 							<input type="checkbox" id="suggestions_', $key, '_', $count, '" name="ban_suggestions[', $key, '][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '">
160 165
 						</dt>
161 166
 						<dd>
162 167
 							<label for="suggestions_', $key, '_', $count++, '">', $ip, '</label>
163 168
 						</dd>';
169
+					}
164 170
 
165 171
 					echo '
166 172
 					</dl>';
@@ -202,8 +208,8 @@  discard block
 block discarded – undo
202 208
 		addLoadEvent(fUpdateStatus);';
203 209
 
204 210
 	// Auto suggest only needed for adding new bans, not editing
205
-	if ($context['ban']['is_new'] && empty($_REQUEST['u']))
206
-		echo '
211
+	if ($context['ban']['is_new'] && empty($_REQUEST['u'])) {
212
+			echo '
207 213
 		var oAddMemberSuggest = new smc_AutoSuggest({
208 214
 			sSelf: \'oAddMemberSuggest\',
209 215
 			sSessionId: smf_session_id,
@@ -221,6 +227,7 @@  discard block
 block discarded – undo
221 227
 			return true;
222 228
 		}
223 229
 		oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');';
230
+	}
224 231
 
225 232
 	echo '
226 233
 		function confirmBan(aForm)
@@ -269,8 +276,8 @@  discard block
 block discarded – undo
269 276
 							<input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;">
270 277
 						</dd>';
271 278
 
272
-	if (empty($modSettings['disableHostnameLookup']))
273
-		echo '
279
+	if (empty($modSettings['disableHostnameLookup'])) {
280
+			echo '
274 281
 						<dt>
275 282
 							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '>
276 283
 							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
@@ -278,6 +285,7 @@  discard block
 block discarded – undo
278 285
 						<dd>
279 286
 							<input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;">
280 287
 						</dd>';
288
+	}
281 289
 
282 290
 	echo '
283 291
 						<dt>
Please login to merge, or discard this patch.
Themes/default/ManageScheduledTasks.template.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,13 +20,12 @@  discard block
 block discarded – undo
20 20
 	// We completed some tasks?
21 21
 	if (!empty($context['tasks_were_run']))
22 22
 	{
23
-		if (empty($context['scheduled_errors']))
24
-			echo '
23
+		if (empty($context['scheduled_errors'])) {
24
+					echo '
25 25
 	<div class="infobox">
26 26
 		', $txt['scheduled_tasks_were_run'], '
27 27
 	</div>';
28
-
29
-		else
28
+		} else
30 29
 		{
31 30
 			echo '
32 31
 	<div class="errorbox" id="errors">
@@ -35,14 +34,15 @@  discard block
 block discarded – undo
35 34
 				<strong id="error_serious">', $txt['scheduled_tasks_were_run_errors'], '</strong>
36 35
 			</dt>';
37 36
 
38
-			foreach ($context['scheduled_errors'] as $task => $errors)
39
-				echo '
37
+			foreach ($context['scheduled_errors'] as $task => $errors) {
38
+							echo '
40 39
 			<dd class="error">
41 40
 				<strong>', isset($txt['scheduled_task_' . $task]) ? $txt['scheduled_task_' . $task] : $task, '</strong>
42 41
 				<ul>
43 42
 					<li>', implode('</li><li>', $errors), '</li>
44 43
 				</ul>
45 44
 			</dd>';
45
+			}
46 46
 
47 47
 			echo '
48 48
 		</dl>
Please login to merge, or discard this patch.
Themes/default/ManageLanguages.template.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -36,11 +36,12 @@  discard block
 block discarded – undo
36 36
 	}
37 37
 
38 38
 	// An error?
39
-	if (!empty($context['error_message']))
40
-		echo '
39
+	if (!empty($context['error_message'])) {
40
+			echo '
41 41
 	<div class="errorbox">
42 42
 		', $context['error_message'], '
43 43
 	</div>';
44
+	}
44 45
 
45 46
 	// Provide something of an introduction...
46 47
 	echo '
@@ -67,11 +68,12 @@  discard block
 block discarded – undo
67 68
 	// If the files are not writable, we might!
68 69
 	if (!empty($context['still_not_writable']))
69 70
 	{
70
-		if (!empty($context['package_ftp']['error']))
71
-			echo '
71
+		if (!empty($context['package_ftp']['error'])) {
72
+					echo '
72 73
 			<div class="errorbox">
73 74
 				', $context['package_ftp']['error'], '
74 75
 			</div>';
76
+		}
75 77
 
76 78
 		echo '
77 79
 			<div class="cat_bar">
@@ -150,11 +152,12 @@  discard block
 block discarded – undo
150 152
 			</div>';
151 153
 
152 154
 	// Not writable? Oops, show an error for ya.
153
-	if (!empty($context['lang_file_not_writable_message']))
154
-		echo '
155
+	if (!empty($context['lang_file_not_writable_message'])) {
156
+			echo '
155 157
 			<div class="errorbox">
156 158
 				', $context['lang_file_not_writable_message'], '
157 159
 			</div>';
160
+	}
158 161
 
159 162
 	// Show the language entries
160 163
 	echo '
@@ -199,9 +202,10 @@  discard block
 block discarded – undo
199 202
 				<input type="submit" name="save_main" value="', $txt['save'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled' : '', ' class="button">';
200 203
 
201 204
 	// Allow deleting entries. English can't be deleted though.
202
-	if ($context['lang_id'] != 'english')
203
-		echo '
205
+	if ($context['lang_id'] != 'english') {
206
+			echo '
204 207
 				<input type="submit" name="delete_main" value="', $txt['delete'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled' : '', ' onclick="confirm(\'', $txt['languages_delete_confirm'], '\');" class="button">';
208
+	}
205 209
 
206 210
 	echo '
207 211
 			</div><!-- .windowbg -->
@@ -223,9 +227,10 @@  discard block
 block discarded – undo
223 227
 		echo '
224 228
 					<optgroup label="', $theme['name'], '">';
225 229
 
226
-		foreach ($theme['files'] as $file)
227
-			echo '
230
+		foreach ($theme['files'] as $file) {
231
+					echo '
228 232
 						<option value="', $id_theme, '+', $file['id'], '"', $file['selected'] ? ' selected' : '', '> =&gt; ', $file['name'], '</option>';
233
+		}
229 234
 
230 235
 		echo '
231 236
 					</optgroup>';
@@ -240,11 +245,12 @@  discard block
 block discarded – undo
240 245
 			<br class="clear">';
241 246
 
242 247
 	// Is it not writable? Show an error.
243
-	if (!empty($context['entries_not_writable_message']))
244
-		echo '
248
+	if (!empty($context['entries_not_writable_message'])) {
249
+			echo '
245 250
 			<div class="errorbox">
246 251
 				', $context['entries_not_writable_message'], '
247 252
 			</div>';
253
+	}
248 254
 
249 255
 	// Already have some file entries?
250 256
 	if (!empty($context['file_entries']))
@@ -283,8 +289,8 @@  discard block
 block discarded – undo
283 289
 		}
284 290
 
285 291
 		// Odd number?
286
-		if (!empty($cached))
287
-			echo '
292
+		if (!empty($cached)) {
293
+					echo '
288 294
 
289 295
 					<dt>
290 296
 						<span class="smalltext">', $cached['key'], '</span>
@@ -297,6 +303,7 @@  discard block
 block discarded – undo
297 303
 					</dt>
298 304
 					<dd>
299 305
 					</dd>';
306
+		}
300 307
 
301 308
 		echo '
302 309
 				</dl>
@@ -331,12 +338,13 @@  discard block
 block discarded – undo
331 338
 					<input type="text" name="smf_add" size="40" value="', !empty($context['smf_search_term']) ? $context['smf_search_term'] : '', '">';
332 339
 
333 340
 	// Do we have some errors? Too bad. Display a little error box.
334
-	if (!empty($context['smf_error']))
335
-		echo '
341
+	if (!empty($context['smf_error'])) {
342
+			echo '
336 343
 					<div>
337 344
 						<br>
338 345
 						<p class="errorbox">', $txt['add_language_error_' . $context['smf_error']], '</p>
339 346
 					</div>';
347
+	}
340 348
 
341 349
 	echo '
342 350
 				</fieldset>
Please login to merge, or discard this patch.
Themes/default/Post.template.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
 									</div><!-- .attached_BBC -->
418 418
 									<div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
419 419
 									<div class="attach-ui">
420
-										<a data-dz-remove class="button cancel">', $txt['modify_cancel'] ,'</a>
421
-										<a class="button upload">', $txt['upload'] ,'</a>
420
+										<a data-dz-remove class="button cancel">', $txt['modify_cancel'], '</a>
421
+										<a class="button upload">', $txt['upload'], '</a>
422 422
 									</div>
423 423
 								</div><!-- .attach-info -->
424 424
 							</div><!-- #au-template -->
@@ -433,10 +433,10 @@  discard block
 block discarded – undo
433 433
 							</dt>
434 434
 							<dd class="smalltext fallback">
435 435
 								<div id="attachUpload" class="descbox">
436
-									<h5>', $txt['attach_drop_zone'] ,'</h5>
437
-									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a>
438
-									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a>
439
-									<a class="button fileinput-button">', $txt['attach_add'] ,'</a>
436
+									<h5>', $txt['attach_drop_zone'], '</h5>
437
+									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a>
438
+									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a>
439
+									<a class="button fileinput-button">', $txt['attach_add'], '</a>
440 440
 									<div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
441 441
 									<div class="fallback">
442 442
 										<input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	// Option to delete an event if user is editing one.
542 542
 	if ($context['make_event'] && !$context['event']['new'])
543 543
 		echo '
544
-						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
544
+						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button you_sure">';
545 545
 
546 546
 	echo '
547 547
 					</span>
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 			});';
796 796
 
797 797
 	echo '
798
-			var oEditorID = "', $context['post_box_name'] ,'";
798
+			var oEditorID = "', $context['post_box_name'], '";
799 799
 			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
800 800
 		</script>';
801 801
 
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 			if ($context['can_quote'])
828 828
 				echo '
829 829
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
830
-						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>
830
+						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>
831 831
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
832 832
 					</ul>';
833 833
 
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 	<head>
912 912
 		<meta charset="', $context['character_set'], '">
913 913
 		<title>', $txt['spell_check'], '</title>
914
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
914
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
915 915
 		<style>
916 916
 			body, td {
917 917
 				font-size: small;
@@ -941,8 +941,8 @@  discard block
 block discarded – undo
941 941
 			var spell_formname = window.opener.spell_formname;
942 942
 			var spell_fieldname = window.opener.spell_fieldname;
943 943
 		</script>
944
-		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script>
945
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
944
+		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script>
945
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
946 946
 		<script>
947 947
 			', $context['spell_js'], '
948 948
 		</script>
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
 	<head>
987 987
 		<meta charset="', $context['character_set'], '">
988 988
 		<title>', $txt['retrieving_quote'], '</title>
989
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
989
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
990 990
 	</head>
991 991
 	<body>
992 992
 		', $txt['retrieving_quote'], '
Please login to merge, or discard this patch.
Braces   +105 added lines, -71 removed lines patch added patch discarded remove patch
@@ -22,24 +22,26 @@  discard block
 block discarded – undo
22 22
 		<script>';
23 23
 
24 24
 	// When using Go Back due to fatal_error, allow the form to be re-submitted with changes.
25
-	if (isBrowser('is_firefox'))
26
-		echo '
25
+	if (isBrowser('is_firefox')) {
26
+			echo '
27 27
 			window.addEventListener("pageshow", reActivate, false);';
28
+	}
28 29
 
29 30
 	// Start with message icons - and any missing from this theme.
30 31
 	echo '
31 32
 			var icon_urls = {';
32 33
 
33
-	foreach ($context['icons'] as $icon)
34
-		echo '
34
+	foreach ($context['icons'] as $icon) {
35
+			echo '
35 36
 				\'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ',';
37
+	}
36 38
 
37 39
 	echo '
38 40
 			};';
39 41
 
40 42
 	// If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations.
41
-	if ($context['make_poll'])
42
-		echo '
43
+	if ($context['make_poll']) {
44
+			echo '
43 45
 			var pollOptionNum = 0, pollTabIndex;
44 46
 			var pollOptionId = ', $context['last_choice_id'], ';
45 47
 			function addPollOption()
@@ -58,11 +60,13 @@  discard block
 block discarded – undo
58 60
 
59 61
 				setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('"></dd><p id="pollMoreOptions"></p>'), ');
60 62
 			}';
63
+	}
61 64
 
62 65
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.
63
-	if ($context['make_event'])
64
-		echo '
66
+	if ($context['make_event']) {
67
+			echo '
65 68
 			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];';
69
+	}
66 70
 
67 71
 	// End of the javascript, start the form and display the link tree.
68 72
 	echo '
@@ -83,9 +87,10 @@  discard block
 block discarded – undo
83 87
 			</div>
84 88
 			<br>';
85 89
 
86
-	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board'])))
87
-		echo '
90
+	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) {
91
+			echo '
88 92
 			<input type="hidden" name="eventid" value="', $context['event']['id'], '">';
93
+	}
89 94
 
90 95
 	// Start the main table.
91 96
 	echo '
@@ -110,26 +115,29 @@  discard block
 block discarded – undo
110 115
 					</div>';
111 116
 
112 117
 	// If this won't be approved let them know!
113
-	if (!$context['becomes_approved'])
114
-		echo '
118
+	if (!$context['becomes_approved']) {
119
+			echo '
115 120
 					<div class="noticebox">
116 121
 						<em>', $txt['wait_for_approval'], '</em>
117 122
 						<input type="hidden" name="not_approved" value="1">
118 123
 					</div>';
124
+	}
119 125
 
120 126
 	// If it's locked, show a message to warn the replier.
121
-	if (!empty($context['locked']))
122
-	echo '
127
+	if (!empty($context['locked'])) {
128
+		echo '
123 129
 					<div class="errorbox">
124 130
 						', $txt['topic_locked_no_reply'], '
125 131
 					</div>';
132
+	}
126 133
 
127
-	if (!empty($modSettings['drafts_post_enabled']))
128
-		echo '
134
+	if (!empty($modSettings['drafts_post_enabled'])) {
135
+			echo '
129 136
 					<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
130 137
 						sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), '
131 138
 						', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
132 139
 					</div>';
140
+	}
133 141
 
134 142
 	// The post header... important stuff
135 143
 	echo '
@@ -139,14 +147,15 @@  discard block
 block discarded – undo
139 147
 	// Mod & theme authors can use the 'integrate_post_end' hook to modify or add to these (see Post.php)
140 148
 	if (!empty($context['posting_fields']) && is_array($context['posting_fields']))
141 149
 	{
142
-		foreach ($context['posting_fields'] as $pfid => $pf)
143
-			echo '
150
+		foreach ($context['posting_fields'] as $pfid => $pf) {
151
+					echo '
144 152
 						<dt class="clear', !is_numeric($pfid) ? ' pf_' . $pfid : '', '">
145 153
 							', $pf['dt'], '
146 154
 						</dt>
147 155
 						<dd', !is_numeric($pfid) ? ' class="pf_' . $pfid . '"' : '', '>
148 156
 							', preg_replace('~<(input|select|textarea|button|area|a|object)\b~', '<$1 tabindex="' . $context['tabindex']++ . '"', $pf['dd']), '
149 157
 						</dd>';
158
+		}
150 159
 	}
151 160
 
152 161
 	echo '
@@ -180,9 +189,10 @@  discard block
 block discarded – undo
180 189
 				echo '
181 190
 										<optgroup label="', $category['name'], '">';
182 191
 
183
-				foreach ($category['boards'] as $board)
184
-					echo '
192
+				foreach ($category['boards'] as $board) {
193
+									echo '
185 194
 											<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
195
+				}
186 196
 				echo '
187 197
 										</optgroup>';
188 198
 			}
@@ -218,9 +228,10 @@  discard block
 block discarded – undo
218 228
 									<span class="label">', $txt['calendar_timezone'], '</span>
219 229
 									<select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>';
220 230
 
221
-		foreach ($context['all_timezones'] as $tz => $tzname)
222
-			echo '
231
+		foreach ($context['all_timezones'] as $tz => $tzname) {
232
+					echo '
223 233
 										<option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>';
234
+		}
224 235
 
225 236
 		echo '
226 237
 									</select>
@@ -249,14 +260,15 @@  discard block
 block discarded – undo
249 260
 								</dd>';
250 261
 
251 262
 		// Loop through all the choices and print them out.
252
-		foreach ($context['choices'] as $choice)
253
-			echo '
263
+		foreach ($context['choices'] as $choice) {
264
+					echo '
254 265
 								<dt>
255 266
 									<label for="options-', $choice['id'], '">', $txt['option'], ' ', $choice['number'], '</label>:
256 267
 								</dt>
257 268
 								<dd>
258 269
 									<input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="255">
259 270
 								</dd>';
271
+		}
260 272
 
261 273
 		echo '
262 274
 								<p id="pollMoreOptions"></p>
@@ -286,14 +298,15 @@  discard block
 block discarded – undo
286 298
 									<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '>
287 299
 								</dd>';
288 300
 
289
-		if ($context['poll_options']['guest_vote_enabled'])
290
-			echo '
301
+		if ($context['poll_options']['guest_vote_enabled']) {
302
+					echo '
291 303
 								<dt>
292 304
 									<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
293 305
 								</dt>
294 306
 								<dd>
295 307
 									<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '>
296 308
 								</dd>';
309
+		}
297 310
 
298 311
 		echo '
299 312
 								<dt>
@@ -314,8 +327,8 @@  discard block
 block discarded – undo
314 327
 					', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
315 328
 
316 329
 	// If we're editing and displaying edit details, show a box where they can say why
317
-	if (isset($context['editing']) && $modSettings['show_modify'])
318
-		echo '
330
+	if (isset($context['editing']) && $modSettings['show_modify']) {
331
+			echo '
319 332
 					<dl>
320 333
 						<dt class="clear">
321 334
 							<span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span>
@@ -324,20 +337,23 @@  discard block
 block discarded – undo
324 337
 							<input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80">
325 338
 						</dd>
326 339
 					</dl>';
340
+	}
327 341
 
328 342
 	// If this message has been edited in the past - display when it was.
329
-	if (isset($context['last_modified']))
330
-		echo '
343
+	if (isset($context['last_modified'])) {
344
+			echo '
331 345
 					<div class="padding smalltext">
332 346
 						', $context['last_modified_text'], '
333 347
 					</div>';
348
+	}
334 349
 
335 350
 	// If the admin has enabled the hiding of the additional options - show a link and image for it.
336
-	if (!empty($modSettings['additional_options_collapsable']))
337
-		echo '
351
+	if (!empty($modSettings['additional_options_collapsable'])) {
352
+			echo '
338 353
 					<div id="postAdditionalOptionsHeader">
339 354
 						<strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong>
340 355
 					</div>';
356
+	}
341 357
 
342 358
 	echo '
343 359
 					<div id="postAdditionalOptions">';
@@ -370,19 +386,21 @@  discard block
 block discarded – undo
370 386
 								', $txt['uncheck_unwatchd_attach'], ':
371 387
 							</dd>';
372 388
 
373
-		foreach ($context['current_attachments'] as $attachment)
374
-			echo '
389
+		foreach ($context['current_attachments'] as $attachment) {
390
+					echo '
375 391
 							<dd class="smalltext">
376 392
 								<label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', '> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
377 393
 								!empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1024) / 1024), 0)) : '', '</label>
378 394
 							</dd>';
395
+		}
379 396
 
380 397
 		echo '
381 398
 						</dl>';
382 399
 
383
-		if (!empty($context['files_in_session_warning']))
384
-			echo '
400
+		if (!empty($context['files_in_session_warning'])) {
401
+					echo '
385 402
 						<div class="smalltext">', $context['files_in_session_warning'], '</div>';
403
+		}
386 404
 	}
387 405
 
388 406
 	// Is the user allowed to post any additional ones? If so give them the boxes to do it!
@@ -443,8 +461,8 @@  discard block
 block discarded – undo
443 461
 								', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1024 . '">');
444 462
 
445 463
 		// Show more boxes if they aren't approaching that limit.
446
-		if ($context['num_allowed_attachments'] > 1)
447
-			echo '
464
+		if ($context['num_allowed_attachments'] > 1) {
465
+					echo '
448 466
 										<script>
449 467
 											var allowed_attachments = ', $context['num_allowed_attachments'], ';
450 468
 											var current_attachment = 1;
@@ -464,6 +482,7 @@  discard block
 block discarded – undo
464 482
 										<a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a>
465 483
 									</div><!-- .fallback -->
466 484
 								</div><!-- #attachUpload -->';
485
+		}
467 486
 
468 487
 		echo '
469 488
 							</dd>';
@@ -475,21 +494,25 @@  discard block
 block discarded – undo
475 494
 							<dd class="smalltext">';
476 495
 
477 496
 		// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
478
-		if (!empty($modSettings['attachmentCheckExtensions']))
479
-			echo '
497
+		if (!empty($modSettings['attachmentCheckExtensions'])) {
498
+					echo '
480 499
 								', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>';
500
+		}
481 501
 
482
-		if (!empty($context['attachment_restrictions']))
483
-			echo '
502
+		if (!empty($context['attachment_restrictions'])) {
503
+					echo '
484 504
 								', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>';
505
+		}
485 506
 
486
-		if ($context['num_allowed_attachments'] == 0)
487
-			echo '
507
+		if ($context['num_allowed_attachments'] == 0) {
508
+					echo '
488 509
 								', $txt['attach_limit_nag'], '<br>';
510
+		}
489 511
 
490
-		if (!$context['can_post_attachment_unapproved'])
491
-			echo '
512
+		if (!$context['can_post_attachment_unapproved']) {
513
+					echo '
492 514
 								<span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>';
515
+		}
493 516
 
494 517
 		echo '
495 518
 							</dd>
@@ -513,24 +536,26 @@  discard block
 block discarded – undo
513 536
 							<dt><strong>', $txt['subject'], '</strong></dt>
514 537
 							<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
515 538
 
516
-		foreach ($context['drafts'] as $draft)
517
-			echo '
539
+		foreach ($context['drafts'] as $draft) {
540
+					echo '
518 541
 							<dt>', $draft['link'], '</dt>
519 542
 							<dd>', $draft['poster_time'], '</dd>';
543
+		}
520 544
 		echo '
521 545
 						</dl>
522 546
 					</div>';
523 547
 	}
524 548
 
525 549
 	// Is visual verification enabled?
526
-	if ($context['require_verification'])
527
-		echo '
550
+	if ($context['require_verification']) {
551
+			echo '
528 552
 					<div class="post_verification">
529 553
 						<span', !empty($context['post_error']['need_qr_verification']) ? ' class="error"' : '', '>
530 554
 							<strong>', $txt['verification'], ':</strong>
531 555
 						</span>
532 556
 						', template_control_verification($context['visual_verification_id'], 'all'), '
533 557
 					</div>';
558
+	}
534 559
 
535 560
 	// Finally, the submit buttons.
536 561
 	echo '
@@ -539,9 +564,10 @@  discard block
 block discarded – undo
539 564
 						', template_control_richedit_buttons($context['post_box_name']);
540 565
 
541 566
 	// Option to delete an event if user is editing one.
542
-	if ($context['make_event'] && !$context['event']['new'])
543
-		echo '
567
+	if ($context['make_event'] && !$context['event']['new']) {
568
+			echo '
544 569
 						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
570
+	}
545 571
 
546 572
 	echo '
547 573
 					</span>
@@ -550,9 +576,10 @@  discard block
 block discarded – undo
550 576
 			<br class="clear">';
551 577
 
552 578
 	// Assuming this isn't a new topic pass across the last message id.
553
-	if (isset($context['topic_last_message']))
554
-		echo '
579
+	if (isset($context['topic_last_message'])) {
580
+			echo '
555 581
 			<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">';
582
+	}
556 583
 
557 584
 	echo '
558 585
 			<input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '">
@@ -694,9 +721,10 @@  discard block
 block discarded – undo
694 721
 
695 722
 						newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \'&nbsp;&#187;</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';';
696 723
 
697
-	if ($context['can_quote'])
698
-		echo '
724
+	if ($context['can_quote']) {
725
+			echo '
699 726
 						newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';';
727
+	}
700 728
 
701 729
 	echo '
702 730
 						newPostsHTML += \'<br class="clear">\';
@@ -739,8 +767,8 @@  discard block
 block discarded – undo
739 767
 			}';
740 768
 
741 769
 	// Code for showing and hiding additional options.
742
-	if (!empty($modSettings['additional_options_collapsable']))
743
-		echo '
770
+	if (!empty($modSettings['additional_options_collapsable'])) {
771
+			echo '
744 772
 			var oSwapAdditionalOptions = new smc_Toggle({
745 773
 				bToggleEnabled: true,
746 774
 				bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ',
@@ -768,10 +796,11 @@  discard block
 block discarded – undo
768 796
 					}
769 797
 				]
770 798
 			});';
799
+	}
771 800
 
772 801
 	// Code for showing and hiding drafts
773
-	if (!empty($context['drafts']))
774
-		echo '
802
+	if (!empty($context['drafts'])) {
803
+			echo '
775 804
 			var oSwapDraftOptions = new smc_Toggle({
776 805
 				bToggleEnabled: true,
777 806
 				bCurrentlyCollapsed: true,
@@ -793,6 +822,7 @@  discard block
 block discarded – undo
793 822
 					}
794 823
 				]
795 824
 			});';
825
+	}
796 826
 
797 827
 	echo '
798 828
 			var oEditorID = "', $context['post_box_name'] ,'";
@@ -813,8 +843,9 @@  discard block
 block discarded – undo
813 843
 		foreach ($context['previous_posts'] as $post)
814 844
 		{
815 845
 			$ignoring = false;
816
-			if (!empty($post['is_ignored']))
817
-				$ignored_posts[] = $ignoring = $post['id'];
846
+			if (!empty($post['is_ignored'])) {
847
+							$ignored_posts[] = $ignoring = $post['id'];
848
+			}
818 849
 
819 850
 			echo '
820 851
 			<div class="windowbg">
@@ -824,22 +855,24 @@  discard block
 block discarded – undo
824 855
 					</h5>
825 856
 					&nbsp;-&nbsp;', $post['time'];
826 857
 
827
-			if ($context['can_quote'])
828
-				echo '
858
+			if ($context['can_quote']) {
859
+							echo '
829 860
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
830 861
 						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>
831 862
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
832 863
 					</ul>';
864
+			}
833 865
 
834 866
 			echo '
835 867
 					<br class="clear">';
836 868
 
837
-			if ($ignoring)
838
-				echo '
869
+			if ($ignoring) {
870
+							echo '
839 871
 					<div id="msg_', $post['id'], '_ignored_prompt" class="smalltext">
840 872
 						', $txt['ignoring_user'], '
841 873
 						<a href="#" id="msg_', $post['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
842 874
 					</div>';
875
+			}
843 876
 
844 877
 			echo '
845 878
 					<div class="list_posts smalltext" id="msg_', $post['id'], '_body" data-msgid="', $post['id'], '">', $post['message'], '</div>
@@ -993,10 +1026,10 @@  discard block
 block discarded – undo
993 1026
 		<div id="temporary_posting_area" style="display: none;"></div>
994 1027
 		<script>';
995 1028
 
996
-	if ($context['close_window'])
997
-		echo '
1029
+	if ($context['close_window']) {
1030
+			echo '
998 1031
 			window.close();';
999
-	else
1032
+	} else
1000 1033
 	{
1001 1034
 		// Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;)
1002 1035
 		echo '
@@ -1050,11 +1083,12 @@  discard block
 block discarded – undo
1050 1083
 				</p>
1051 1084
 				<ul>';
1052 1085
 
1053
-	foreach ($context['groups'] as $group)
1054
-		echo '
1086
+	foreach ($context['groups'] as $group) {
1087
+			echo '
1055 1088
 					<li>
1056 1089
 						<label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em>
1057 1090
 					</li>';
1091
+	}
1058 1092
 
1059 1093
 	echo '
1060 1094
 					<li>
Please login to merge, or discard this patch.
Themes/default/ManageSmileys.template.php 1 patch
Braces   +58 added lines, -44 removed lines patch added patch discarded remove patch
@@ -41,11 +41,12 @@  discard block
 block discarded – undo
41 41
 			</div>';
42 42
 
43 43
 	// If this is an existing set, and there are still un-added smileys - offer an import opportunity.
44
-	if (!empty($context['current_set']['can_import']))
45
-		echo '
44
+	if (!empty($context['current_set']['can_import'])) {
45
+			echo '
46 46
 			<div class="information">
47 47
 				', $context['current_set']['can_import'] == 1 ? sprintf($txt['smiley_set_import_single'], $context['current_set']['import_url']) : sprintf($txt['smiley_set_import_multiple'], $context['current_set']['can_import'], $context['current_set']['import_url']), '
48 48
 			</div>';
49
+	}
49 50
 
50 51
 	echo '
51 52
 			<div class="windowbg2 noup">
@@ -62,20 +63,20 @@  discard block
 block discarded – undo
62 63
 					<dd>
63 64
 						', $modSettings['smileys_url'], '/';
64 65
 
65
-	if ($context['current_set']['id'] == 'default')
66
-		echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
67
-
68
-	elseif (empty($context['smiley_set_dirs']))
69
-		echo '
66
+	if ($context['current_set']['id'] == 'default') {
67
+			echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
68
+	} elseif (empty($context['smiley_set_dirs'])) {
69
+			echo '
70 70
 						<input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> ';
71
-	else
71
+	} else
72 72
 	{
73 73
 		echo '
74 74
 						<select name="smiley_sets_path" id="smiley_sets_path">';
75 75
 
76
-		foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
77
-			echo '
76
+		foreach ($context['smiley_set_dirs'] as $smiley_set_dir) {
77
+					echo '
78 78
 							<option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>';
79
+		}
79 80
 		echo '
80 81
 						</select> ';
81 82
 	}
@@ -90,14 +91,15 @@  discard block
 block discarded – undo
90 91
 					</dd>';
91 92
 
92 93
 	// If this is a new smiley set they have the option to import smileys already in the directory.
93
-	if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
94
-		echo '
94
+	if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) {
95
+			echo '
95 96
 					<dt>
96 97
 						<strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong>
97 98
 					</dt>
98 99
 					<dd>
99 100
 						<input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1">
100 101
 					</dd>';
102
+	}
101 103
 
102 104
 	echo '
103 105
 				</dl>
@@ -131,9 +133,10 @@  discard block
 block discarded – undo
131 133
 					<dd>
132 134
 						<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">';
133 135
 
134
-	foreach ($context['smiley_sets'] as $smiley_set)
135
-		echo '
136
+	foreach ($context['smiley_sets'] as $smiley_set) {
137
+			echo '
136 138
 						<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
139
+	}
137 140
 
138 141
 	echo '
139 142
 						</select>)
@@ -149,17 +152,18 @@  discard block
 block discarded – undo
149 152
 					</dt>
150 153
 					<dd>';
151 154
 
152
-	if (empty($context['filenames']))
153
-		echo '
155
+	if (empty($context['filenames'])) {
156
+			echo '
154 157
 						<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">';
155
-	else
158
+	} else
156 159
 	{
157 160
 		echo '
158 161
 						<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">';
159 162
 
160
-		foreach ($context['filenames'] as $filename)
161
-			echo '
163
+		foreach ($context['filenames'] as $filename) {
164
+					echo '
162 165
 							<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
166
+		}
163 167
 		echo '
164 168
 						</select>';
165 169
 	}
@@ -228,9 +232,10 @@  discard block
 block discarded – undo
228 232
 						<dd>
229 233
 							', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">';
230 234
 
231
-	foreach ($context['smiley_sets'] as $smiley_set)
232
-		echo '
235
+	foreach ($context['smiley_sets'] as $smiley_set) {
236
+			echo '
233 237
 								<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
238
+	}
234 239
 
235 240
 	echo '
236 241
 							</select>
@@ -240,17 +245,18 @@  discard block
 block discarded – undo
240 245
 						</dt>
241 246
 						<dd>';
242 247
 
243
-	if (empty($context['filenames']))
244
-		echo '
248
+	if (empty($context['filenames'])) {
249
+			echo '
245 250
 							<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">';
246
-	else
251
+	} else
247 252
 	{
248 253
 		echo '
249 254
 							<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">';
250 255
 
251
-		foreach ($context['filenames'] as $filename)
252
-			echo '
256
+		foreach ($context['filenames'] as $filename) {
257
+					echo '
253 258
 								<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
259
+		}
254 260
 		echo '
255 261
 							</select>';
256 262
 	}
@@ -279,14 +285,15 @@  discard block
 block discarded – undo
279 285
 
280 286
 				<dl id="uploadMore" style="display: none;" class="settings">';
281 287
 
282
-	foreach ($context['smiley_sets'] as $smiley_set)
283
-		echo '
288
+	foreach ($context['smiley_sets'] as $smiley_set) {
289
+			echo '
284 290
 					<dt>
285 291
 						', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ':
286 292
 					</dt>
287 293
 					<dd>
288 294
 						<input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');">
289 295
 					</dd>';
296
+	}
290 297
 
291 298
 	echo '
292 299
 				</dl>
@@ -357,27 +364,30 @@  discard block
 block discarded – undo
357 364
 
358 365
 		foreach ($location['rows'] as $row)
359 366
 		{
360
-			if (!empty($context['move_smiley']))
361
-				echo '
367
+			if (!empty($context['move_smiley'])) {
368
+							echo '
362 369
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
370
+			}
363 371
 
364 372
 			foreach ($row as $smiley)
365 373
 			{
366
-				if (empty($context['move_smiley']))
367
-					echo '
374
+				if (empty($context['move_smiley'])) {
375
+									echo '
368 376
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '"></a>';
369
-				else
370
-					echo '
377
+				} else {
378
+									echo '
371 379
 				<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '" ', $smiley['selected'] ? 'class="selected_item"' : '', '>
372 380
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
381
+				}
373 382
 			}
374 383
 
375 384
 			echo '
376 385
 				<br>';
377 386
 		}
378
-		if (!empty($context['move_smiley']))
379
-			echo '
387
+		if (!empty($context['move_smiley'])) {
388
+					echo '
380 389
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
390
+		}
381 391
 		echo '
382 392
 			</div><!-- .windowbg2 -->
383 393
 			<input type="hidden" name="reorder" value="1">
@@ -414,14 +424,15 @@  discard block
 block discarded – undo
414 424
 			<div class="windowbg2">
415 425
 				<dl class="settings">';
416 426
 
417
-	if (!$context['new_icon'])
418
-		echo '
427
+	if (!$context['new_icon']) {
428
+			echo '
419 429
 					<dt>
420 430
 						<strong>', $txt['smiley_preview'], ': </strong>
421 431
 					</dt>
422 432
 					<dd>
423 433
 						<img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '">
424 434
 					</dd>';
435
+	}
425 436
 
426 437
 	echo '
427 438
 					<dt>
@@ -448,9 +459,10 @@  discard block
 block discarded – undo
448 459
 		echo '
449 460
 							<optgroup label="', $category['name'], '">';
450 461
 
451
-		foreach ($category['boards'] as $board)
452
-			echo '
462
+		foreach ($category['boards'] as $board) {
463
+					echo '
453 464
 								<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
465
+		}
454 466
 
455 467
 		echo '
456 468
 							</optgroup>';
@@ -467,19 +479,21 @@  discard block
 block discarded – undo
467 479
 							<option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>';
468 480
 
469 481
 	// Print the list of all the icons it can be put after...
470
-	foreach ($context['icons'] as $id => $data)
471
-		if (empty($context['icon']['id']) || $id != $context['icon']['id'])
482
+	foreach ($context['icons'] as $id => $data) {
483
+			if (empty($context['icon']['id']) || $id != $context['icon']['id'])
472 484
 			echo '
473 485
 							<option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
486
+	}
474 487
 
475 488
 	echo '
476 489
 						</select>
477 490
 					</dd>
478 491
 				</dl>';
479 492
 
480
-	if (!$context['new_icon'])
481
-		echo '
493
+	if (!$context['new_icon']) {
494
+			echo '
482 495
 				<input type="hidden" name="icon" value="', $context['icon']['id'], '">';
496
+	}
483 497
 
484 498
 	echo '
485 499
 				<input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button">
Please login to merge, or discard this patch.
Themes/default/ReportToMod.template.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,16 +62,17 @@
 block discarded – undo
62 62
 				<div id="error_box" class="errorbox">
63 63
 					<ul id="error_list">';
64 64
 
65
-		foreach ($context['post_errors'] as $key => $error)
66
-			echo '
65
+		foreach ($context['post_errors'] as $key => $error) {
66
+					echo '
67 67
 						<li id="error_', $key, '" class="error">', $error, '</li>';
68
+		}
68 69
 
69 70
 		echo '
70 71
 					</ul>';
71
-	}
72
-	else
73
-		echo '
72
+	} else {
73
+			echo '
74 74
 				<div style="display:none" id="error_box" class="errorbox">';
75
+	}
75 76
 
76 77
 	echo '
77 78
 				</div>';
Please login to merge, or discard this patch.