Completed
Push — release-2.1 ( 7b96a2...1c7fb5 )
by Michael
22:46 queued 15:04
created
Themes/default/Profile.template.php 1 patch
Braces   +465 added lines, -346 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.)
@@ -102,8 +104,7 @@  discard block
 block discarded – undo
102 104
 	if (empty($context['unread_alerts']))
103 105
 	{
104 106
 		template_alerts_all_read();
105
-	}
106
-	else
107
+	} else
107 108
 	{
108 109
 		foreach ($context['unread_alerts'] as $id_alert => $details)
109 110
 		{
@@ -164,10 +165,11 @@  discard block
 block discarded – undo
164 165
 			<div class="custom_fields_above_name">
165 166
 				<ul >';
166 167
 
167
-		foreach ($context['print_custom_fields']['above_member'] as $field)
168
-			if (!empty($field['output_html']))
168
+		foreach ($context['print_custom_fields']['above_member'] as $field) {
169
+					if (!empty($field['output_html']))
169 170
 				echo '
170 171
 					<li>', $field['output_html'], '</li>';
172
+		}
171 173
 
172 174
 		echo '
173 175
 				</ul>
@@ -188,10 +190,11 @@  discard block
 block discarded – undo
188 190
 			<div class="custom_fields_below_avatar">
189 191
 				<ul >';
190 192
 
191
-		foreach ($context['print_custom_fields']['below_avatar'] as $field)
192
-			if (!empty($field['output_html']))
193
+		foreach ($context['print_custom_fields']['below_avatar'] as $field) {
194
+					if (!empty($field['output_html']))
193 195
 				echo '
194 196
 					<li>', $field['output_html'], '</li>';
197
+		}
195 198
 
196 199
 		echo '
197 200
 				</ul>
@@ -202,22 +205,25 @@  discard block
 block discarded – undo
202 205
 		echo '
203 206
 			<ul class="clear">';
204 207
 	// Email is only visible if it's your profile or you have the moderate_forum permission
205
-	if ($context['member']['show_email'])
206
-		echo '
208
+	if ($context['member']['show_email']) {
209
+			echo '
207 210
 				<li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>';
211
+	}
208 212
 
209 213
 	// Don't show an icon if they haven't specified a website.
210
-	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
211
-		echo '
214
+	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) {
215
+			echo '
212 216
 				<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
217
+	}
213 218
 
214 219
 	// Are there any custom profile fields as icons?
215 220
 	if (!empty($context['print_custom_fields']['icons']))
216 221
 	{
217
-		foreach ($context['print_custom_fields']['icons'] as $field)
218
-			if (!empty($field['output_html']))
222
+		foreach ($context['print_custom_fields']['icons'] as $field) {
223
+					if (!empty($field['output_html']))
219 224
 				echo '
220 225
 					<li class="custom_field">', $field['output_html'], '</li>';
226
+		}
221 227
 	}
222 228
 
223 229
 	echo '
@@ -225,23 +231,26 @@  discard block
 block discarded – undo
225 231
 			<span id="userstatus">', $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>' : '';
226 232
 
227 233
 	// Can they add this member as a buddy?
228
-	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
229
-		echo '
234
+	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) {
235
+			echo '
230 236
 				<br><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
237
+	}
231 238
 
232 239
 	echo '
233 240
 			</span>';
234 241
 
235
-	if (!$context['user']['is_owner'] && $context['can_send_pm'])
236
-		echo '
242
+	if (!$context['user']['is_owner'] && $context['can_send_pm']) {
243
+			echo '
237 244
 			<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>';
245
+	}
238 246
 
239 247
 	echo '
240 248
 			<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>';
241 249
 
242
-	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled']))
243
-		echo '
250
+	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) {
251
+			echo '
244 252
 			<a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>';
253
+	}
245 254
 
246 255
 	echo '
247 256
 			<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>';
@@ -253,10 +262,11 @@  discard block
 block discarded – undo
253 262
 			<div class="custom_fields_bottom">
254 263
 				<ul class="nolist">';
255 264
 
256
-		foreach ($context['print_custom_fields']['bottom_poster'] as $field)
257
-			if (!empty($field['output_html']))
265
+		foreach ($context['print_custom_fields']['bottom_poster'] as $field) {
266
+					if (!empty($field['output_html']))
258 267
 				echo '
259 268
 					<li>', $field['output_html'], '</li>';
269
+		}
260 270
 
261 271
 		echo '
262 272
 				</ul>
@@ -270,15 +280,17 @@  discard block
 block discarded – undo
270 280
 		<div id="detailedinfo">
271 281
 			<dl class="settings">';
272 282
 
273
-	if ($context['user']['is_owner'] || $context['user']['is_admin'])
274
-		echo '
283
+	if ($context['user']['is_owner'] || $context['user']['is_admin']) {
284
+			echo '
275 285
 				<dt>', $txt['username'], ': </dt>
276 286
 				<dd>', $context['member']['username'], '</dd>';
287
+	}
277 288
 
278
-	if (!isset($context['disabled_fields']['posts']))
279
-		echo '
289
+	if (!isset($context['disabled_fields']['posts'])) {
290
+			echo '
280 291
 				<dt>', $txt['profile_posts'], ': </dt>
281 292
 				<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
293
+	}
282 294
 
283 295
 	if ($context['member']['show_email'])
284 296
 	{
@@ -287,15 +299,17 @@  discard block
 block discarded – undo
287 299
 				<dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>';
288 300
 	}
289 301
 
290
-	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
291
-		echo '
302
+	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) {
303
+			echo '
292 304
 				<dt>', $txt['custom_title'], ': </dt>
293 305
 				<dd>', $context['member']['title'], '</dd>';
306
+	}
294 307
 
295
-	if (!empty($context['member']['blurb']))
296
-		echo '
308
+	if (!empty($context['member']['blurb'])) {
309
+			echo '
297 310
 				<dt>', $txt['personal_text'], ': </dt>
298 311
 				<dd>', $context['member']['blurb'], '</dd>';
312
+	}
299 313
 
300 314
 	echo '
301 315
 				<dt>', $txt['age'], ':</dt>
@@ -309,19 +323,21 @@  discard block
 block discarded – undo
309 323
 	{
310 324
 		$fields = array();
311 325
 
312
-		foreach ($context['print_custom_fields']['standard'] as $field)
313
-			if (!empty($field['output_html']))
326
+		foreach ($context['print_custom_fields']['standard'] as $field) {
327
+					if (!empty($field['output_html']))
314 328
 				$fields[] = $field;
329
+		}
315 330
 
316 331
 		if (count($fields) > 0)
317 332
 		{
318 333
 			echo '
319 334
 				<dl class="settings">';
320 335
 
321
-			foreach ($fields as $field)
322
-				echo '
336
+			foreach ($fields as $field) {
337
+							echo '
323 338
 					<dt>', $field['name'], ':</dt>
324 339
 					<dd>', $field['output_html'], '</dd>';
340
+			}
325 341
 
326 342
 			echo '
327 343
 				</dl>';
@@ -341,9 +357,10 @@  discard block
 block discarded – undo
341 357
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>';
342 358
 
343 359
 		// Can we provide information on what this means?
344
-		if (!empty($context['warning_status']))
345
-			echo '
360
+		if (!empty($context['warning_status'])) {
361
+					echo '
346 362
 						<span class="smalltext">(', $context['warning_status'], ')</span>';
363
+		}
347 364
 
348 365
 		echo '
349 366
 					</dd>';
@@ -354,9 +371,10 @@  discard block
 block discarded – undo
354 371
 	{
355 372
 
356 373
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
357
-		if (!empty($context['activate_message']))
358
-			echo '
374
+		if (!empty($context['activate_message'])) {
375
+					echo '
359 376
 					<dt class="clear"><span class="alert">', $context['activate_message'], '</span>&nbsp;(<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="' . $txt['profileConfirm'] . '"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
377
+		}
360 378
 
361 379
 		// If the current member is banned, show a message and possibly a link to the ban.
362 380
 		if (!empty($context['member']['bans']))
@@ -366,9 +384,10 @@  discard block
 block discarded – undo
366 384
 					<dt class="clear" id="ban_info" style="display: none;">
367 385
 						<strong>', $txt['user_banned_by_following'], ':</strong>';
368 386
 
369
-			foreach ($context['member']['bans'] as $ban)
370
-				echo '
387
+			foreach ($context['member']['bans'] as $ban) {
388
+							echo '
371 389
 						<br><span class="smalltext">', $ban['explanation'], '</span>';
390
+			}
372 391
 
373 392
 			echo '
374 393
 					</dt>';
@@ -382,30 +401,34 @@  discard block
 block discarded – undo
382 401
 	// If the person looking is allowed, they can check the members IP address and hostname.
383 402
 	if ($context['can_see_ip'])
384 403
 	{
385
-		if (!empty($context['member']['ip']))
386
-		echo '
404
+		if (!empty($context['member']['ip'])) {
405
+				echo '
387 406
 					<dt>', $txt['ip'], ': </dt>
388 407
 					<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
408
+		}
389 409
 
390
-		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
391
-			echo '
410
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) {
411
+					echo '
392 412
 					<dt>', $txt['hostname'], ': </dt>
393 413
 					<dd>', $context['member']['hostname'], '</dd>';
414
+		}
394 415
 	}
395 416
 
396 417
 	echo '
397 418
 					<dt>', $txt['local_time'], ':</dt>
398 419
 					<dd>', $context['member']['local_time'], '</dd>';
399 420
 
400
-	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
401
-		echo '
421
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) {
422
+			echo '
402 423
 					<dt>', $txt['language'], ':</dt>
403 424
 					<dd>', $context['member']['language'], '</dd>';
425
+	}
404 426
 
405
-	if ($context['member']['show_last_login'])
406
-		echo '
427
+	if ($context['member']['show_last_login']) {
428
+			echo '
407 429
 					<dt>', $txt['lastLoggedIn'], ': </dt>
408 430
 					<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
431
+	}
409 432
 
410 433
 	echo '
411 434
 				</dl>';
@@ -417,10 +440,11 @@  discard block
 block discarded – undo
417 440
 				<div class="custom_fields_above_signature">
418 441
 					<ul class="nolist">';
419 442
 
420
-		foreach ($context['print_custom_fields']['above_signature'] as $field)
421
-			if (!empty($field['output_html']))
443
+		foreach ($context['print_custom_fields']['above_signature'] as $field) {
444
+					if (!empty($field['output_html']))
422 445
 				echo '
423 446
 						<li>', $field['output_html'], '</li>';
447
+		}
424 448
 
425 449
 		echo '
426 450
 					</ul>
@@ -428,12 +452,13 @@  discard block
 block discarded – undo
428 452
 	}
429 453
 
430 454
 	// Show the users signature.
431
-	if ($context['signature_enabled'] && !empty($context['member']['signature']))
432
-		echo '
455
+	if ($context['signature_enabled'] && !empty($context['member']['signature'])) {
456
+			echo '
433 457
 				<div class="signature">
434 458
 					<h5>', $txt['signature'], ':</h5>
435 459
 					', $context['member']['signature'], '
436 460
 				</div>';
461
+	}
437 462
 
438 463
 	// Are there any custom profile fields for below the signature?
439 464
 	if (!empty($context['print_custom_fields']['below_signature']))
@@ -442,10 +467,11 @@  discard block
 block discarded – undo
442 467
 				<div class="custom_fields_below_signature">
443 468
 					<ul class="nolist">';
444 469
 
445
-		foreach ($context['print_custom_fields']['below_signature'] as $field)
446
-			if (!empty($field['output_html']))
470
+		foreach ($context['print_custom_fields']['below_signature'] as $field) {
471
+					if (!empty($field['output_html']))
447 472
 				echo '
448 473
 						<li>', $field['output_html'], '</li>';
474
+		}
449 475
 
450 476
 		echo '
451 477
 					</ul>
@@ -490,62 +516,70 @@  discard block
 block discarded – undo
490 516
 				</div>
491 517
 				<div class="list_posts">';
492 518
 
493
-			if (!$post['approved'])
494
-				echo '
519
+			if (!$post['approved']) {
520
+							echo '
495 521
 					<div class="approve_post">
496 522
 						<em>', $txt['post_awaiting_approval'], '</em>
497 523
 					</div>';
524
+			}
498 525
 
499 526
 			echo '
500 527
 					', $post['body'], '
501 528
 				</div>';
502 529
 
503
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
504
-				echo '
530
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
531
+							echo '
505 532
 				<div class="floatright">
506 533
 					<ul class="quickbuttons">';
534
+			}
507 535
 
508 536
 			// If they *can* reply?
509
-			if ($post['can_reply'])
510
-				echo '
537
+			if ($post['can_reply']) {
538
+							echo '
511 539
 						<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
540
+			}
512 541
 
513 542
 			// If they *can* quote?
514
-			if ($post['can_quote'])
515
-				echo '
543
+			if ($post['can_quote']) {
544
+							echo '
516 545
 						<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>';
546
+			}
517 547
 
518 548
 			// How about... even... remove it entirely?!
519
-			if ($post['can_delete'])
520
-				echo '
549
+			if ($post['can_delete']) {
550
+							echo '
521 551
 						<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>';
552
+			}
522 553
 
523
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
524
-				echo '
554
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
555
+							echo '
525 556
 					</ul>
526 557
 				</div>';
558
+			}
527 559
 
528 560
 			echo '
529 561
 			</div>';
530 562
 		}
563
+	} else {
564
+			template_show_list('attachments');
531 565
 	}
532
-	else
533
-		template_show_list('attachments');
534 566
 
535 567
 	// No posts? Just end with a informative message.
536
-	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
537
-		echo '
568
+	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) {
569
+			echo '
538 570
 			<div class="windowbg2">
539 571
 				', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
540 572
 			</div>';
573
+	}
541 574
 
542 575
 	// Show more page numbers.
543
-	if (!empty($context['page_index']))
544
-		echo '
576
+	if (!empty($context['page_index'])) {
577
+			echo '
545 578
 		<div class="pagesection">
546 579
 			<div class="pagelinks">', $context['page_index'], '</div>
547 580
 		</div>';
548
-}
581
+	}
582
+	}
549 583
 
550 584
 /**
551 585
  * Template for showing alerts within the alerts popup
@@ -555,11 +589,12 @@  discard block
 block discarded – undo
555 589
 	global $context, $txt, $scripturl;
556 590
 
557 591
 	// Do we have an update message?
558
-	if (!empty($context['update_message']))
559
-		echo '
592
+	if (!empty($context['update_message'])) {
593
+			echo '
560 594
 		<div class="infobox">
561 595
 			', $context['update_message'], '.
562 596
 		</div>';
597
+	}
563 598
 
564 599
 	echo '
565 600
 		<div class="cat_bar">
@@ -568,13 +603,12 @@  discard block
 block discarded – undo
568 603
 			</h3>
569 604
 		</div>';
570 605
 
571
-	if (empty($context['alerts']))
572
-		echo '
606
+	if (empty($context['alerts'])) {
607
+			echo '
573 608
 		<div class="information">
574 609
 			', $txt['alerts_none'], '
575 610
 		</div>';
576
-
577
-	else
611
+	} else
578 612
 	{
579 613
 		// Start the form.
580 614
 		echo '
@@ -636,12 +670,12 @@  discard block
 block discarded – undo
636 670
 		</div>' : '';
637 671
 
638 672
 	// No drafts? Just show an informative message.
639
-	if (empty($context['drafts']))
640
-		echo '
673
+	if (empty($context['drafts'])) {
674
+			echo '
641 675
 		<div class="windowbg2 centertext">
642 676
 			', $txt['draft_none'], '
643 677
 		</div>';
644
-	else
678
+	} else
645 679
 	{
646 680
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
647 681
 		foreach ($context['drafts'] as $draft)
@@ -652,11 +686,13 @@  discard block
 block discarded – undo
652 686
 					<div class="topic_details">
653 687
 						<h5><strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
654 688
 
655
-			if (!empty($draft['sticky']))
656
-				echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
689
+			if (!empty($draft['sticky'])) {
690
+							echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
691
+			}
657 692
 
658
-			if (!empty($draft['locked']))
659
-				echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
693
+			if (!empty($draft['locked'])) {
694
+							echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
695
+			}
660 696
 
661 697
 			echo '
662 698
 						</h5>
@@ -689,12 +725,13 @@  discard block
 block discarded – undo
689 725
 {
690 726
 	global $context, $scripturl, $txt;
691 727
 
692
-	if (!empty($context['saved_successful']))
693
-		echo '
728
+	if (!empty($context['saved_successful'])) {
729
+			echo '
694 730
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
695
-	elseif (!empty($context['saved_failed']))
696
-		echo '
731
+	} elseif (!empty($context['saved_failed'])) {
732
+			echo '
697 733
 					<div class="errorbox">', $context['saved_failed'], '</div>';
734
+	}
698 735
 
699 736
 	echo '
700 737
 	<div id="edit_buddies">
@@ -708,24 +745,27 @@  discard block
 block discarded – undo
708 745
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
709 746
 				<th scope="col">', $txt['status'], '</th>';
710 747
 
711
-	if (allowedTo('moderate_forum'))
712
-		echo '
748
+	if (allowedTo('moderate_forum')) {
749
+			echo '
713 750
 				<th scope="col">', $txt['email'], '</th>';
751
+	}
714 752
 
715
-	if (!empty($context['custom_pf']))
716
-		foreach ($context['custom_pf'] as $column)
753
+	if (!empty($context['custom_pf'])) {
754
+			foreach ($context['custom_pf'] as $column)
717 755
 				echo '<th scope="col">', $column['label'], '</th>';
756
+	}
718 757
 
719 758
 	echo '
720 759
 				<th scope="col">', $txt['remove'], '</th>
721 760
 			</tr>';
722 761
 
723 762
 	// If they don't have any buddies don't list them!
724
-	if (empty($context['buddies']))
725
-		echo '
763
+	if (empty($context['buddies'])) {
764
+			echo '
726 765
 			<tr class="windowbg">
727 766
 				<td colspan="', allowedTo('moderate_forum') ? '10' : '9', '"><strong>', $txt['no_buddies'], '</strong></td>
728 767
 			</tr>';
768
+	}
729 769
 
730 770
 		// Now loop through each buddy showing info on each.
731 771
 	else
@@ -737,15 +777,17 @@  discard block
 block discarded – undo
737 777
 					<td>', $buddy['link'], '</td>
738 778
 					<td><a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a></td>';
739 779
 
740
-			if ($buddy['show_email'])
741
-				echo '
780
+			if ($buddy['show_email']) {
781
+							echo '
742 782
 					<td><a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a></td>';
783
+			}
743 784
 
744 785
 			// Show the custom profile fields for this user.
745
-			if (!empty($context['custom_pf']))
746
-				foreach ($context['custom_pf'] as $key => $column)
786
+			if (!empty($context['custom_pf'])) {
787
+							foreach ($context['custom_pf'] as $key => $column)
747 788
 					echo '
748 789
 						<td class="lefttext">', $buddy['options'][$key], '</td>';
790
+			}
749 791
 
750 792
 			echo '
751 793
 					<td><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['buddy_remove'], '"></span></a></td>
@@ -775,9 +817,10 @@  discard block
 block discarded – undo
775 817
 			</dl>
776 818
 		</div>';
777 819
 
778
-	if (!empty($context['token_check']))
779
-		echo '
820
+	if (!empty($context['token_check'])) {
821
+			echo '
780 822
 			<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
823
+	}
781 824
 
782 825
 	echo '
783 826
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -803,12 +846,13 @@  discard block
 block discarded – undo
803 846
 {
804 847
 	global $context, $scripturl, $txt;
805 848
 
806
-	if (!empty($context['saved_successful']))
807
-		echo '
849
+	if (!empty($context['saved_successful'])) {
850
+			echo '
808 851
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
809
-	elseif (!empty($context['saved_failed']))
810
-		echo '
852
+	} elseif (!empty($context['saved_failed'])) {
853
+			echo '
811 854
 					<div class="errorbox">', $context['saved_failed'], '</div>';
855
+	}
812 856
 
813 857
 	echo '
814 858
 	<div id="edit_buddies">
@@ -822,20 +866,22 @@  discard block
 block discarded – undo
822 866
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
823 867
 				<th scope="col">', $txt['status'], '</th>';
824 868
 
825
-	if (allowedTo('moderate_forum'))
826
-		echo '
869
+	if (allowedTo('moderate_forum')) {
870
+			echo '
827 871
 				<th scope="col">', $txt['email'], '</th>';
872
+	}
828 873
 
829 874
 	echo '
830 875
 				<th scope="col">', $txt['ignore_remove'], '</th>
831 876
 			</tr>';
832 877
 
833 878
 	// If they don't have anyone on their ignore list, don't list it!
834
-	if (empty($context['ignore_list']))
835
-		echo '
879
+	if (empty($context['ignore_list'])) {
880
+			echo '
836 881
 			<tr class="windowbg">
837 882
 				<td colspan="', allowedTo('moderate_forum') ? '4' : '3', '"><strong>', $txt['no_ignore'], '</strong></td>
838 883
 			</tr>';
884
+	}
839 885
 
840 886
 	// Now loop through each buddy showing info on each.
841 887
 	foreach ($context['ignore_list'] as $member)
@@ -845,9 +891,10 @@  discard block
 block discarded – undo
845 891
 				<td>', $member['link'], '</td>
846 892
 				<td><a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a></td>';
847 893
 
848
-		if ($member['show_email'])
849
-			echo '
894
+		if ($member['show_email']) {
895
+					echo '
850 896
 				<td><a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a></td>';
897
+		}
851 898
 		echo '
852 899
 				<td><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></td>
853 900
 			</tr>';
@@ -874,9 +921,10 @@  discard block
 block discarded – undo
874 921
 			</dl>
875 922
 		</div>';
876 923
 
877
-	if (!empty($context['token_check']))
878
-		echo '
924
+	if (!empty($context['token_check'])) {
925
+			echo '
879 926
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
927
+	}
880 928
 
881 929
 	echo '
882 930
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -921,9 +969,10 @@  discard block
 block discarded – undo
921 969
 					<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
922 970
 
923 971
 	// Second address detected?
924
-	if (!empty($context['last_ip2']))
925
-		echo '
972
+	if (!empty($context['last_ip2'])) {
973
+			echo '
926 974
 					, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
975
+	}
927 976
 
928 977
 	echo '
929 978
 				</dd>';
@@ -988,9 +1037,10 @@  discard block
 block discarded – undo
988 1037
 				<h3 class="catbg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
989 1038
 			</div>
990 1039
 			<div class="windowbg2 noup">';
991
-			foreach ($context['whois_servers'] as $server)
992
-			echo '
1040
+			foreach ($context['whois_servers'] as $server) {
1041
+						echo '
993 1042
 				<a href="', $server['url'], '" target="_blank"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>';
1043
+			}
994 1044
 			echo '
995 1045
 			</div>
996 1046
 			<br>';
@@ -1001,10 +1051,10 @@  discard block
 block discarded – undo
1001 1051
 		<div class="cat_bar">
1002 1052
 			<h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
1003 1053
 		</div>';
1004
-	if (empty($context['ips']))
1005
-		echo '
1054
+	if (empty($context['ips'])) {
1055
+			echo '
1006 1056
 		<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
1007
-	else
1057
+	} else
1008 1058
 	{
1009 1059
 		echo '
1010 1060
 		<table class="table_grid">
@@ -1017,12 +1067,13 @@  discard block
 block discarded – undo
1017 1067
 			<tbody>';
1018 1068
 
1019 1069
 		// Loop through each of the members and display them.
1020
-		foreach ($context['ips'] as $ip => $memberlist)
1021
-			echo '
1070
+		foreach ($context['ips'] as $ip => $memberlist) {
1071
+					echo '
1022 1072
 				<tr class="windowbg">
1023 1073
 					<td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
1024 1074
 					<td>', implode(', ', $memberlist), '</td>
1025 1075
 				</tr>';
1076
+		}
1026 1077
 
1027 1078
 		echo '
1028 1079
 			</tbody>
@@ -1068,8 +1119,7 @@  discard block
 block discarded – undo
1068 1119
 	{
1069 1120
 		echo '
1070 1121
 		<div class="information">', $txt['showPermissions_all'], '</div>';
1071
-	}
1072
-	else
1122
+	} else
1073 1123
 	{
1074 1124
 		echo '
1075 1125
 		<div class="information">',$txt['showPermissions_help'], '</div>
@@ -1083,9 +1133,10 @@  discard block
 block discarded – undo
1083 1133
 				</div>
1084 1134
 				<div class="windowbg smalltext">
1085 1135
 					', $txt['showPermissions_restricted_boards_desc'], ':<br>';
1086
-				foreach ($context['no_access_boards'] as $no_access_board)
1087
-					echo '
1136
+				foreach ($context['no_access_boards'] as $no_access_board) {
1137
+									echo '
1088 1138
 						<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
1139
+				}
1089 1140
 				echo '
1090 1141
 				</div>';
1091 1142
 		}
@@ -1117,12 +1168,13 @@  discard block
 block discarded – undo
1117 1168
 								</td>
1118 1169
 								<td class="smalltext">';
1119 1170
 
1120
-				if ($permission['is_denied'])
1121
-					echo '
1171
+				if ($permission['is_denied']) {
1172
+									echo '
1122 1173
 									<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1123
-				else
1124
-					echo '
1174
+				} else {
1175
+									echo '
1125 1176
 									', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
1177
+				}
1126 1178
 
1127 1179
 					echo '
1128 1180
 								</td>
@@ -1132,10 +1184,10 @@  discard block
 block discarded – undo
1132 1184
 						</tbody>
1133 1185
 					</table>
1134 1186
 				</div><br>';
1135
-		}
1136
-		else
1137
-			echo '
1187
+		} else {
1188
+					echo '
1138 1189
 			<p class="windowbg2">', $txt['showPermissions_none_general'], '</p>';
1190
+		}
1139 1191
 
1140 1192
 		// Board permission section.
1141 1193
 		echo '
@@ -1145,14 +1197,16 @@  discard block
 block discarded – undo
1145 1197
 						<a id="board_permissions"></a>', $txt['showPermissions_select'], ':
1146 1198
 						<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
1147 1199
 							<option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
1148
-				if (!empty($context['boards']))
1149
-					echo '
1200
+				if (!empty($context['boards'])) {
1201
+									echo '
1150 1202
 							<option value="" disabled>---------------------------</option>';
1203
+				}
1151 1204
 
1152 1205
 				// Fill the box with any local permission boards.
1153
-				foreach ($context['boards'] as $board)
1154
-					echo '
1206
+				foreach ($context['boards'] as $board) {
1207
+									echo '
1155 1208
 							<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
1209
+				}
1156 1210
 
1157 1211
 				echo '
1158 1212
 						</select>
@@ -1183,8 +1237,7 @@  discard block
 block discarded – undo
1183 1237
 				{
1184 1238
 					echo '
1185 1239
 							<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1186
-				}
1187
-				else
1240
+				} else
1188 1241
 				{
1189 1242
 					echo '
1190 1243
 							', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
@@ -1196,10 +1249,10 @@  discard block
 block discarded – undo
1196 1249
 			echo '
1197 1250
 				</tbody>
1198 1251
 			</table>';
1199
-		}
1200
-		else
1201
-			echo '
1252
+		} else {
1253
+					echo '
1202 1254
 			<p class="windowbg2">', $txt['showPermissions_none_board'], '</p>';
1255
+		}
1203 1256
 	echo '
1204 1257
 			</div>
1205 1258
 		</div>';
@@ -1241,9 +1294,10 @@  discard block
 block discarded – undo
1241 1294
 			</div>';
1242 1295
 
1243 1296
 	// If they haven't post at all, don't draw the graph.
1244
-	if (empty($context['posts_by_time']))
1245
-		echo '
1297
+	if (empty($context['posts_by_time'])) {
1298
+			echo '
1246 1299
 			<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1300
+	}
1247 1301
 	// Otherwise do!
1248 1302
 	else
1249 1303
 	{
@@ -1282,11 +1336,10 @@  discard block
 block discarded – undo
1282 1336
 					</h3>
1283 1337
 				</div>';
1284 1338
 
1285
-	if (empty($context['popular_boards']))
1286
-		echo '
1339
+	if (empty($context['popular_boards'])) {
1340
+			echo '
1287 1341
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1288
-
1289
-	else
1342
+	} else
1290 1343
 	{
1291 1344
 		echo '
1292 1345
 				<dl class="stats">';
@@ -1317,10 +1370,10 @@  discard block
 block discarded – undo
1317 1370
 					</h3>
1318 1371
 				</div>';
1319 1372
 
1320
-	if (empty($context['board_activity']))
1321
-		echo '
1373
+	if (empty($context['board_activity'])) {
1374
+			echo '
1322 1375
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1323
-	else
1376
+	} else
1324 1377
 	{
1325 1378
 		echo '
1326 1379
 				<dl class="stats">';
@@ -1368,41 +1421,46 @@  discard block
 block discarded – undo
1368 1421
 				<h3 class="catbg profile_hd">';
1369 1422
 
1370 1423
 		// Don't say "Profile" if this isn't the profile...
1371
-		if (!empty($context['profile_header_text']))
1372
-			echo '
1424
+		if (!empty($context['profile_header_text'])) {
1425
+					echo '
1373 1426
 					', $context['profile_header_text'];
1374
-		else
1375
-			echo '
1427
+		} else {
1428
+					echo '
1376 1429
 					', $txt['profile'];
1430
+		}
1377 1431
 
1378 1432
 		echo '
1379 1433
 				</h3>
1380 1434
 			</div>';
1381 1435
 
1382 1436
 	// Have we some description?
1383
-	if ($context['page_desc'])
1384
-		echo '
1437
+	if ($context['page_desc']) {
1438
+			echo '
1385 1439
 			<p class="information">', $context['page_desc'], '</p>';
1440
+	}
1386 1441
 
1387 1442
 	echo '
1388 1443
 			<div class="roundframe">';
1389 1444
 
1390 1445
 	// Any bits at the start?
1391
-	if (!empty($context['profile_prehtml']))
1392
-		echo '
1446
+	if (!empty($context['profile_prehtml'])) {
1447
+			echo '
1393 1448
 				<div>', $context['profile_prehtml'], '</div>';
1449
+	}
1394 1450
 
1395
-	if (!empty($context['profile_fields']))
1396
-		echo '
1451
+	if (!empty($context['profile_fields'])) {
1452
+			echo '
1397 1453
 				<dl class="settings">';
1454
+	}
1398 1455
 
1399 1456
 	// Start the big old loop 'of love.
1400 1457
 	$lastItem = 'hr';
1401 1458
 	foreach ($context['profile_fields'] as $key => $field)
1402 1459
 	{
1403 1460
 		// We add a little hack to be sure we never get more than one hr in a row!
1404
-		if ($lastItem == 'hr' && $field['type'] == 'hr')
1405
-			continue;
1461
+		if ($lastItem == 'hr' && $field['type'] == 'hr') {
1462
+					continue;
1463
+		}
1406 1464
 
1407 1465
 		$lastItem = $field['type'];
1408 1466
 		if ($field['type'] == 'hr')
@@ -1411,48 +1469,50 @@  discard block
 block discarded – undo
1411 1469
 				</dl>
1412 1470
 				<hr>
1413 1471
 				<dl class="settings">';
1414
-		}
1415
-		elseif ($field['type'] == 'callback')
1472
+		} elseif ($field['type'] == 'callback')
1416 1473
 		{
1417 1474
 			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
1418 1475
 			{
1419 1476
 				$callback_func = 'template_profile_' . $field['callback_func'];
1420 1477
 				$callback_func();
1421 1478
 			}
1422
-		}
1423
-		else
1479
+		} else
1424 1480
 		{
1425 1481
 			echo '
1426 1482
 					<dt>
1427 1483
 						<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
1428 1484
 
1429 1485
 			// Does it have any subtext to show?
1430
-			if (!empty($field['subtext']))
1431
-				echo '
1486
+			if (!empty($field['subtext'])) {
1487
+							echo '
1432 1488
 						<br>
1433 1489
 						<span class="smalltext">', $field['subtext'], '</span>';
1490
+			}
1434 1491
 
1435 1492
 			echo '
1436 1493
 					</dt>
1437 1494
 					<dd>';
1438 1495
 
1439 1496
 			// Want to put something infront of the box?
1440
-			if (!empty($field['preinput']))
1441
-				echo '
1497
+			if (!empty($field['preinput'])) {
1498
+							echo '
1442 1499
 						', $field['preinput'];
1500
+			}
1443 1501
 
1444 1502
 			// What type of data are we showing?
1445
-			if ($field['type'] == 'label')
1446
-				echo '
1503
+			if ($field['type'] == 'label') {
1504
+							echo '
1447 1505
 						', $field['value'];
1506
+			}
1448 1507
 
1449 1508
 			// Maybe it's a text box - very likely!
1450 1509
 			elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url')))
1451 1510
 			{
1452
-				if ($field['type'] == 'int' || $field['type'] == 'float')
1453
-					$type = 'number';
1454
-				else
1455
-					$type = $field['type'];
1511
+				if ($field['type'] == 'int' || $field['type'] == 'float') {
1512
+									$type = 'number';
1513
+				} else {
1514
+									$type = $field['type'];
1515
+				}
1456 1516
 				$step = $field['type'] == 'float' ? ' step="0.1"' : '';
1457 1517
 
1458 1518
 
@@ -1460,9 +1520,10 @@  discard block
 block discarded – undo
1460 1520
 						<input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' ', $step, '>';
1461 1521
 			}
1462 1522
 			// You "checking" me out? ;)
1463
-			elseif ($field['type'] == 'check')
1464
-				echo '
1523
+			elseif ($field['type'] == 'check') {
1524
+							echo '
1465 1525
 						<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>';
1526
+			}
1466 1527
 
1467 1528
 			// Always fun - select boxes!
1468 1529
 			elseif ($field['type'] == 'select')
@@ -1473,13 +1534,15 @@  discard block
 block discarded – undo
1473 1534
 				if (isset($field['options']))
1474 1535
 				{
1475 1536
 					// Is this some code to generate the options?
1476
-					if (!is_array($field['options']))
1477
-						$field['options'] = $field['options']();
1537
+					if (!is_array($field['options'])) {
1538
+											$field['options'] = $field['options']();
1539
+					}
1478 1540
 					// Assuming we now have some!
1479
-					if (is_array($field['options']))
1480
-						foreach ($field['options'] as $value => $name)
1541
+					if (is_array($field['options'])) {
1542
+											foreach ($field['options'] as $value => $name)
1481 1543
 							echo '
1482 1544
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
1545
+					}
1483 1546
 				}
1484 1547
 
1485 1548
 				echo '
@@ -1487,25 +1550,28 @@  discard block
 block discarded – undo
1487 1550
 			}
1488 1551
 
1489 1552
 			// Something to end with?
1490
-			if (!empty($field['postinput']))
1491
-				echo '
1553
+			if (!empty($field['postinput'])) {
1554
+							echo '
1492 1555
 							', $field['postinput'];
1556
+			}
1493 1557
 
1494 1558
 			echo '
1495 1559
 					</dd>';
1496 1560
 		}
1497 1561
 	}
1498 1562
 
1499
-	if (!empty($context['profile_fields']))
1500
-		echo '
1563
+	if (!empty($context['profile_fields'])) {
1564
+			echo '
1501 1565
 				</dl>';
1566
+	}
1502 1567
 
1503 1568
 	// Are there any custom profile fields - if so print them!
1504 1569
 	if (!empty($context['custom_fields']))
1505 1570
 	{
1506
-		if ($lastItem != 'hr')
1507
-			echo '
1571
+		if ($lastItem != 'hr') {
1572
+					echo '
1508 1573
 				<hr>';
1574
+		}
1509 1575
 
1510 1576
 		echo '
1511 1577
 				<dl class="settings">';
@@ -1528,13 +1594,14 @@  discard block
 block discarded – undo
1528 1594
 	}
1529 1595
 
1530 1596
 	// Any closing HTML?
1531
-	if (!empty($context['profile_posthtml']))
1532
-		echo '
1597
+	if (!empty($context['profile_posthtml'])) {
1598
+			echo '
1533 1599
 				<div>', $context['profile_posthtml'], '</div>';
1600
+	}
1534 1601
 
1535 1602
 	// Only show the password box if it's actually needed.
1536
-	if ($context['require_password'])
1537
-		echo '
1603
+	if ($context['require_password']) {
1604
+			echo '
1538 1605
 				<dl class="settings">
1539 1606
 					<dt>
1540 1607
 						<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br>
@@ -1544,18 +1611,21 @@  discard block
 block discarded – undo
1544 1611
 						<input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;">
1545 1612
 					</dd>
1546 1613
 				</dl>';
1614
+	}
1547 1615
 
1548 1616
 	// The button shouldn't say "Change profile" unless we're changing the profile...
1549
-	if (!empty($context['submit_button_text']))
1550
-		echo '
1617
+	if (!empty($context['submit_button_text'])) {
1618
+			echo '
1551 1619
 				<input type="submit" name="save" value="', $context['submit_button_text'], '" class="button">';
1552
-	else
1553
-		echo '
1620
+	} else {
1621
+			echo '
1554 1622
 				<input type="submit" name="save" value="', $txt['change_profile'], '" class="button">';
1623
+	}
1555 1624
 
1556
-	if (!empty($context['token_check']))
1557
-		echo '
1625
+	if (!empty($context['token_check'])) {
1626
+			echo '
1558 1627
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
1628
+	}
1559 1629
 
1560 1630
 	echo '
1561 1631
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1565,10 +1635,11 @@  discard block
 block discarded – undo
1565 1635
 		</form>';
1566 1636
 
1567 1637
 	// Any final spellchecking stuff?
1568
-	if (!empty($context['show_spellchecking']))
1569
-		echo '
1638
+	if (!empty($context['show_spellchecking'])) {
1639
+			echo '
1570 1640
 		<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>';
1571
-}
1641
+	}
1642
+	}
1572 1643
 
1573 1644
 /**
1574 1645
  * Personal Message settings.
@@ -1605,10 +1676,11 @@  discard block
 block discarded – undo
1605 1676
 										<select name="pm_receive_from" id="pm_receive_from">
1606 1677
 												<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
1607 1678
 
1608
-	if (!empty($modSettings['enable_buddylist']))
1609
-		echo '
1679
+	if (!empty($modSettings['enable_buddylist'])) {
1680
+			echo '
1610 1681
 												<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option>
1611 1682
 												<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
1683
+	}
1612 1684
 
1613 1685
 	echo '
1614 1686
 												<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option>
@@ -1651,11 +1723,12 @@  discard block
 block discarded – undo
1651 1723
 		if (empty($setting) || !is_array($setting))
1652 1724
 		{
1653 1725
 			// Insert a separator (unless this is the first item in the list)
1654
-			if ($i !== $first_option_key)
1655
-				echo '
1726
+			if ($i !== $first_option_key) {
1727
+							echo '
1656 1728
 				</dl>
1657 1729
 				<hr>
1658 1730
 				<dl class="settings">';
1731
+			}
1659 1732
 
1660 1733
 			// Should we give a name to this section?
1661 1734
 			if (is_string($setting) && !empty($setting))
@@ -1663,51 +1736,56 @@  discard block
 block discarded – undo
1663 1736
 				$titled_section = true;
1664 1737
 				echo '
1665 1738
 					<dt><strong>' . $setting . '</strong></dt><dd></dd>';
1739
+			} else {
1740
+							$titled_section = false;
1666 1741
 			}
1667
-			else
1668
-				$titled_section = false;
1669 1742
 
1670 1743
 			continue;
1671 1744
 		}
1672 1745
 
1673 1746
 		// Is this disabled?
1674
-		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled']))
1675
-			continue;
1676
-		elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage']))
1677
-			continue;
1678
-		elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored']))
1679
-			continue;
1680
-		elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist']))
1681
-			continue;
1682
-		elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg']))
1683
-			continue;
1684
-		elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1685
-			continue;
1686
-		elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1687
-			continue;
1747
+		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) {
1748
+					continue;
1749
+		} elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) {
1750
+					continue;
1751
+		} elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) {
1752
+					continue;
1753
+		} elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) {
1754
+					continue;
1755
+		} elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) {
1756
+					continue;
1757
+		} elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1758
+					continue;
1759
+		} elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1760
+					continue;
1761
+		}
1688 1762
 
1689 1763
 		// Some of these may not be set...  Set to defaults here
1690 1764
 		$opts = array('topics_per_page', 'messages_per_page', 'display_quick_mod');
1691
-		if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']]))
1692
-			$context['member']['options'][$setting['id']] = 0;
1765
+		if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']])) {
1766
+					$context['member']['options'][$setting['id']] = 0;
1767
+		}
1693 1768
 
1694
-		if (!isset($setting['type']) || $setting['type'] == 'bool')
1695
-			$setting['type'] = 'checkbox';
1696
-		elseif ($setting['type'] == 'int' || $setting['type'] == 'integer')
1697
-			$setting['type'] = 'number';
1698
-		elseif ($setting['type'] == 'string')
1699
-			$setting['type'] = 'text';
1769
+		if (!isset($setting['type']) || $setting['type'] == 'bool') {
1770
+					$setting['type'] = 'checkbox';
1771
+		} elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') {
1772
+					$setting['type'] = 'number';
1773
+		} elseif ($setting['type'] == 'string') {
1774
+					$setting['type'] = 'text';
1775
+		}
1700 1776
 
1701
-		if (isset($setting['options']))
1702
-			$setting['type'] = 'list';
1777
+		if (isset($setting['options'])) {
1778
+					$setting['type'] = 'list';
1779
+		}
1703 1780
 
1704 1781
 		echo '
1705 1782
 					<dt>
1706 1783
 						<label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>';
1707 1784
 
1708
-		if (isset($setting['description']))
1709
-			echo '
1785
+		if (isset($setting['description'])) {
1786
+					echo '
1710 1787
 						<br><span class="smalltext">', $setting['description'], '</span>';
1788
+		}
1711 1789
 		echo '
1712 1790
 					</dt>
1713 1791
 					<dd>';
@@ -1745,13 +1823,11 @@  discard block
 block discarded – undo
1745 1823
 
1746 1824
 				echo '
1747 1825
 						<input type="number"', $min . $max . $step;
1748
-			}
1749
-			else if (isset($setting['type']) && $setting['type'] == 'url')
1826
+			} else if (isset($setting['type']) && $setting['type'] == 'url')
1750 1827
 			{
1751 1828
 				echo'
1752 1829
 						<input type="url"';
1753
-			}
1754
-			else
1830
+			} else
1755 1831
 			{
1756 1832
 				echo '
1757 1833
 						<input type="text"';
@@ -1790,8 +1866,8 @@  discard block
 block discarded – undo
1790 1866
 				<dl class="settings">';
1791 1867
 
1792 1868
 	// Allow notification on announcements to be disabled?
1793
-	if (!empty($modSettings['allow_disableAnnounce']))
1794
-		echo '
1869
+	if (!empty($modSettings['allow_disableAnnounce'])) {
1870
+			echo '
1795 1871
 					<dt>
1796 1872
 						<label for="notify_announcements">', $txt['notify_important_email'], '</label>
1797 1873
 					</dt>
@@ -1799,9 +1875,10 @@  discard block
 block discarded – undo
1799 1875
 						<input type="hidden" name="notify_announcements" value="0">
1800 1876
 						<input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', '>
1801 1877
 					</dd>';
1878
+	}
1802 1879
 
1803
-	if (!empty($modSettings['enable_ajax_alerts']))
1804
-		echo '
1880
+	if (!empty($modSettings['enable_ajax_alerts'])) {
1881
+			echo '
1805 1882
 					<dt>
1806 1883
 						<label for="notify_send_body">', $txt['notify_alert_timeout'], '</label>
1807 1884
 					</dt>
@@ -1809,6 +1886,7 @@  discard block
 block discarded – undo
1809 1886
 						<input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '">
1810 1887
 					</dd>
1811 1888
 		';
1889
+	}
1812 1890
 
1813 1891
 	echo '
1814 1892
 				</dl>
@@ -1838,9 +1916,10 @@  discard block
 block discarded – undo
1838 1916
 					<td colspan="3">';
1839 1917
 				$label = $txt['alert_opt_' . $opts[1]];
1840 1918
 				$label_pos = isset($opts['label']) ? $opts['label'] : '';
1841
-				if ($label_pos == 'before')
1842
-					echo '
1919
+				if ($label_pos == 'before') {
1920
+									echo '
1843 1921
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1922
+				}
1844 1923
 
1845 1924
 				$this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0;
1846 1925
 				switch ($opts[0])
@@ -1852,17 +1931,19 @@  discard block
 block discarded – undo
1852 1931
 					case 'select':
1853 1932
 						echo '
1854 1933
 						<select name="opt_', $opts[1], '" id="opt_', $opts[1], '">';
1855
-						foreach ($opts['opts'] as $k => $v)
1856
-							echo '
1934
+						foreach ($opts['opts'] as $k => $v) {
1935
+													echo '
1857 1936
 							<option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>';
1937
+						}
1858 1938
 						echo '
1859 1939
 						</select>';
1860 1940
 						break;
1861 1941
 				}
1862 1942
 
1863
-				if ($label_pos == 'after')
1864
-					echo '
1943
+				if ($label_pos == 'after') {
1944
+									echo '
1865 1945
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1946
+				}
1866 1947
 
1867 1948
 				echo '
1868 1949
 					</td>
@@ -1976,11 +2057,12 @@  discard block
 block discarded – undo
1976 2057
 			<p class="information">', $txt['groupMembership_info'], '</p>';
1977 2058
 
1978 2059
 	// Do we have an update message?
1979
-	if (!empty($context['update_message']))
1980
-		echo '
2060
+	if (!empty($context['update_message'])) {
2061
+			echo '
1981 2062
 			<div class="infobox">
1982 2063
 				', $context['update_message'], '.
1983 2064
 			</div>';
2065
+	}
1984 2066
 
1985 2067
 	echo '
1986 2068
 		<div id="groups">';
@@ -2002,8 +2084,7 @@  discard block
 block discarded – undo
2002 2084
 					</div>
2003 2085
 				</div>
2004 2086
 			</div>';
2005
-	}
2006
-	else
2087
+	} else
2007 2088
 	{
2008 2089
 		echo '
2009 2090
 			<div class="title_bar">
@@ -2015,27 +2096,30 @@  discard block
 block discarded – undo
2015 2096
 			echo '
2016 2097
 					<div class="windowbg" id="primdiv_', $group['id'], '">';
2017 2098
 
2018
-				if ($context['can_edit_primary'])
2019
-					echo '
2099
+				if ($context['can_edit_primary']) {
2100
+									echo '
2020 2101
 						<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', '>';
2102
+				}
2021 2103
 
2022 2104
 				echo '
2023 2105
 						<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>';
2024 2106
 
2025 2107
 				// Can they leave their group?
2026
-				if ($group['can_leave'])
2027
-					echo '
2108
+				if ($group['can_leave']) {
2109
+									echo '
2028 2110
 						<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>';
2111
+				}
2029 2112
 
2030 2113
 				echo '
2031 2114
 					</div>';
2032 2115
 		}
2033 2116
 
2034
-		if ($context['can_edit_primary'])
2035
-			echo '
2117
+		if ($context['can_edit_primary']) {
2118
+					echo '
2036 2119
 			<div class="padding righttext">
2037 2120
 				<input type="submit" value="', $txt['make_primary'], '" class="button">
2038 2121
 			</div>';
2122
+		}
2039 2123
 
2040 2124
 		// Any groups they can join?
2041 2125
 		if (!empty($context['groups']['available']))
@@ -2051,15 +2135,16 @@  discard block
 block discarded – undo
2051 2135
 					<div class="windowbg">
2052 2136
 						<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>' : ''), '';
2053 2137
 
2054
-				if ($group['type'] == 3)
2055
-					echo '
2138
+				if ($group['type'] == 3) {
2139
+									echo '
2056 2140
 						<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>';
2057
-				elseif ($group['type'] == 2 && $group['pending'])
2058
-					echo '
2141
+				} elseif ($group['type'] == 2 && $group['pending']) {
2142
+									echo '
2059 2143
 						<span class="floatright">', $txt['approval_pending'], '</span>';
2060
-				elseif ($group['type'] == 2)
2061
-					echo '
2144
+				} elseif ($group['type'] == 2) {
2145
+									echo '
2062 2146
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
2147
+				}
2063 2148
 
2064 2149
 				echo '
2065 2150
 					</div>';
@@ -2082,9 +2167,10 @@  discard block
 block discarded – undo
2082 2167
 
2083 2168
 			prevDiv.className = "windowbg";
2084 2169
 		}';
2085
-		if (isset($context['groups']['member'][$context['primary_group']]))
2086
-			echo '
2170
+		if (isset($context['groups']['member'][$context['primary_group']])) {
2171
+					echo '
2087 2172
 		highlightSelected("primdiv_' . $context['primary_group'] . '");';
2173
+		}
2088 2174
 		echo '
2089 2175
 	</script>';
2090 2176
 	}
@@ -2092,9 +2178,10 @@  discard block
 block discarded – undo
2092 2178
 	echo '
2093 2179
 		</div>';
2094 2180
 
2095
-	if (!empty($context['token_check']))
2096
-		echo '
2181
+	if (!empty($context['token_check'])) {
2182
+			echo '
2097 2183
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2184
+	}
2098 2185
 
2099 2186
 	echo '
2100 2187
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2141,14 +2228,15 @@  discard block
 block discarded – undo
2141 2228
 
2142 2229
 		foreach ($category['boards'] as $board)
2143 2230
 		{
2144
-			if ($i == $limit)
2145
-				echo '
2231
+			if ($i == $limit) {
2232
+							echo '
2146 2233
 						</ul>
2147 2234
 					</li>
2148 2235
 				</ul>
2149 2236
 				<ul class="ignoreboards floatright">
2150 2237
 					<li class="category">
2151 2238
 						<ul>';
2239
+			}
2152 2240
 
2153 2241
 			echo '
2154 2242
 							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
@@ -2194,10 +2282,11 @@  discard block
 block discarded – undo
2194 2282
 
2195 2283
 	// Work out the starting color.
2196 2284
 	$context['current_color'] = $context['colors'][0];
2197
-	foreach ($context['colors'] as $limit => $color)
2198
-		if ($context['member']['warning'] >= $limit)
2285
+	foreach ($context['colors'] as $limit => $color) {
2286
+			if ($context['member']['warning'] >= $limit)
2199 2287
 			$context['current_color'] = $color;
2200
-}
2288
+	}
2289
+	}
2201 2290
 
2202 2291
 // Show all warnings of a user?
2203 2292
 function template_viewWarning()
@@ -2236,14 +2325,15 @@  discard block
 block discarded – undo
2236 2325
 				</dd>';
2237 2326
 
2238 2327
 		// There's some impact of this?
2239
-		if (!empty($context['level_effects'][$context['current_level']]))
2240
-			echo '
2328
+		if (!empty($context['level_effects'][$context['current_level']])) {
2329
+					echo '
2241 2330
 				<dt>
2242 2331
 					<strong>', $txt['profile_viewwarning_impact'], ':</strong>
2243 2332
 				</dt>
2244 2333
 				<dd>
2245 2334
 					', $context['level_effects'][$context['current_level']], '
2246 2335
 				</dd>';
2336
+		}
2247 2337
 
2248 2338
 		echo '
2249 2339
 			</dl>
@@ -2281,10 +2371,11 @@  discard block
 block discarded – undo
2281 2371
 
2282 2372
 			// Otherwise see what we can do...';
2283 2373
 
2284
-	foreach ($context['notification_templates'] as $k => $type)
2285
-		echo '
2374
+	foreach ($context['notification_templates'] as $k => $type) {
2375
+			echo '
2286 2376
 			if (index == ', $k, ')
2287 2377
 				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
2378
+	}
2288 2379
 
2289 2380
 	echo '
2290 2381
 		}
@@ -2294,10 +2385,11 @@  discard block
 block discarded – undo
2294 2385
 			// Also set the right effect.
2295 2386
 			effectText = "";';
2296 2387
 
2297
-	foreach ($context['level_effects'] as $limit => $text)
2298
-		echo '
2388
+	foreach ($context['level_effects'] as $limit => $text) {
2389
+			echo '
2299 2390
 			if (slideAmount >= ', $limit, ')
2300 2391
 				effectText = "', $text, '";';
2392
+	}
2301 2393
 
2302 2394
 	echo '
2303 2395
 			setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\');
@@ -2312,31 +2404,34 @@  discard block
 block discarded – undo
2312 2404
 			</h3>
2313 2405
 		</div>';
2314 2406
 
2315
-	if (!$context['user']['is_owner'])
2316
-		echo '
2407
+	if (!$context['user']['is_owner']) {
2408
+			echo '
2317 2409
 		<p class="information">', $txt['profile_warning_desc'], '</p>';
2410
+	}
2318 2411
 
2319 2412
 	echo '
2320 2413
 		<div class="windowbg">
2321 2414
 			<dl class="settings">';
2322 2415
 
2323
-	if (!$context['user']['is_owner'])
2324
-		echo '
2416
+	if (!$context['user']['is_owner']) {
2417
+			echo '
2325 2418
 				<dt>
2326 2419
 					<strong>', $txt['profile_warning_name'], ':</strong>
2327 2420
 				</dt>
2328 2421
 				<dd>
2329 2422
 					<strong>', $context['member']['name'], '</strong>
2330 2423
 				</dd>';
2424
+	}
2331 2425
 
2332 2426
 	echo '
2333 2427
 				<dt>
2334 2428
 					<strong>', $txt['profile_warning_level'], ':</strong>';
2335 2429
 
2336 2430
 	// Is there only so much they can apply?
2337
-	if ($context['warning_limit'])
2338
-		echo '
2431
+	if ($context['warning_limit']) {
2432
+			echo '
2339 2433
 					<br><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
2434
+	}
2340 2435
 
2341 2436
 	echo '
2342 2437
 				</dt>
@@ -2389,9 +2484,10 @@  discard block
 block discarded – undo
2389 2484
 						<option value="-1">', $txt['profile_warning_notify_template'], '</option>
2390 2485
 						<option value="-1" disabled>------------------------------</option>';
2391 2486
 
2392
-		foreach ($context['notification_templates'] as $id_template => $template)
2393
-			echo '
2487
+		foreach ($context['notification_templates'] as $id_template => $template) {
2488
+					echo '
2394 2489
 						<option value="', $id_template, '">', $template['title'], '</option>';
2490
+		}
2395 2491
 
2396 2492
 		echo '
2397 2493
 					</select>
@@ -2403,9 +2499,10 @@  discard block
 block discarded – undo
2403 2499
 			</dl>
2404 2500
 			<div class="righttext">';
2405 2501
 
2406
-	if (!empty($context['token_check']))
2407
-		echo '
2502
+	if (!empty($context['token_check'])) {
2503
+			echo '
2408 2504
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2505
+	}
2409 2506
 
2410 2507
 	echo '
2411 2508
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2421,8 +2518,8 @@  discard block
 block discarded – undo
2421 2518
 	echo '
2422 2519
 	<script>';
2423 2520
 
2424
-	if (!$context['user']['is_owner'])
2425
-		echo '
2521
+	if (!$context['user']['is_owner']) {
2522
+			echo '
2426 2523
 		modifyWarnNotify();
2427 2524
 		$(document).ready(function() {
2428 2525
 			$("#preview_button").click(function() {
@@ -2461,6 +2558,7 @@  discard block
 block discarded – undo
2461 2558
 			});
2462 2559
 			return false;
2463 2560
 		}';
2561
+	}
2464 2562
 
2465 2563
 	echo '
2466 2564
 	</script>';
@@ -2483,16 +2581,18 @@  discard block
 block discarded – undo
2483 2581
 			</div>';
2484 2582
 
2485 2583
 	// If deleting another account give them a lovely info box.
2486
-	if (!$context['user']['is_owner'])
2487
-		echo '
2584
+	if (!$context['user']['is_owner']) {
2585
+			echo '
2488 2586
 			<p class="information">', $txt['deleteAccount_desc'], '</p>';
2587
+	}
2489 2588
 	echo '
2490 2589
 			<div class="windowbg2">';
2491 2590
 
2492 2591
 	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
2493
-	if ($context['needs_approval'])
2494
-		echo '
2592
+	if ($context['needs_approval']) {
2593
+			echo '
2495 2594
 				<div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
2595
+	}
2496 2596
 
2497 2597
 	// If the user is deleting their own account warn them first - and require a password!
2498 2598
 	if ($context['user']['is_owner'])
@@ -2504,9 +2604,10 @@  discard block
 block discarded – undo
2504 2604
 					<input type="password" name="oldpasswrd" size="20">&nbsp;&nbsp;&nbsp;&nbsp;
2505 2605
 					<input type="submit" value="', $txt['yes'], '" class="button">';
2506 2606
 
2507
-		if (!empty($context['token_check']))
2508
-			echo '
2607
+		if (!empty($context['token_check'])) {
2608
+					echo '
2509 2609
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2610
+		}
2510 2611
 
2511 2612
 		echo '
2512 2613
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2532,9 +2633,10 @@  discard block
 block discarded – undo
2532 2633
 						<option value="topics">', $txt['deleteAccount_topics'], '</option>
2533 2634
 					</select>';
2534 2635
 
2535
-			if ($context['show_perma_delete'])
2536
-				echo '
2636
+			if ($context['show_perma_delete']) {
2637
+							echo '
2537 2638
 					<br><label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1">', $txt['deleteAccount_permanent'], ':</label>';
2639
+			}
2538 2640
 
2539 2641
 			echo '
2540 2642
 				</div>';
@@ -2547,9 +2649,10 @@  discard block
 block discarded – undo
2547 2649
 				<div>
2548 2650
 					<input type="submit" value="', $txt['delete'], '" class="button">';
2549 2651
 
2550
-		if (!empty($context['token_check']))
2551
-			echo '
2652
+		if (!empty($context['token_check'])) {
2653
+					echo '
2552 2654
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2655
+		}
2553 2656
 
2554 2657
 		echo '
2555 2658
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2575,8 +2678,8 @@  discard block
 block discarded – undo
2575 2678
 					<hr>';
2576 2679
 
2577 2680
 	// Only show the password box if it's actually needed.
2578
-	if ($context['require_password'])
2579
-		echo '
2681
+	if ($context['require_password']) {
2682
+			echo '
2580 2683
 					<dl class="settings">
2581 2684
 						<dt>
2582 2685
 							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br>
@@ -2586,13 +2689,15 @@  discard block
 block discarded – undo
2586 2689
 							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;">
2587 2690
 						</dd>
2588 2691
 					</dl>';
2692
+	}
2589 2693
 
2590 2694
 	echo '
2591 2695
 					<div class="righttext">';
2592 2696
 
2593
-		if (!empty($context['token_check']))
2594
-			echo '
2697
+		if (!empty($context['token_check'])) {
2698
+					echo '
2595 2699
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2700
+		}
2596 2701
 
2597 2702
 	echo '
2598 2703
 						<input type="submit" value="', $txt['change_profile'], '" class="button">
@@ -2619,9 +2724,10 @@  discard block
 block discarded – undo
2619 2724
 			<ul id="list_errors">';
2620 2725
 
2621 2726
 		// Cycle through each error and display an error message.
2622
-		foreach ($context['post_errors'] as $error)
2623
-			echo '
2727
+		foreach ($context['post_errors'] as $error) {
2728
+					echo '
2624 2729
 				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
2730
+		}
2625 2731
 
2626 2732
 		echo '
2627 2733
 			</ul>';
@@ -2647,12 +2753,13 @@  discard block
 block discarded – undo
2647 2753
 								<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;"' : ''), '>';
2648 2754
 
2649 2755
 		// Fill the select box with all primary member groups that can be assigned to a member.
2650
-		foreach ($context['member_groups'] as $member_group)
2651
-			if (!empty($member_group['can_be_primary']))
2756
+		foreach ($context['member_groups'] as $member_group) {
2757
+					if (!empty($member_group['can_be_primary']))
2652 2758
 				echo '
2653 2759
 									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '>
2654 2760
 										', $member_group['name'], '
2655 2761
 									</option>';
2762
+		}
2656 2763
 		echo '
2657 2764
 								</select>
2658 2765
 							</dd>
@@ -2664,10 +2771,11 @@  discard block
 block discarded – undo
2664 2771
 									<input type="hidden" name="additional_groups[]" value="0">';
2665 2772
 
2666 2773
 		// For each membergroup show a checkbox so members can be assigned to more than one group.
2667
-		foreach ($context['member_groups'] as $member_group)
2668
-			if ($member_group['can_be_additional'])
2774
+		foreach ($context['member_groups'] as $member_group) {
2775
+					if ($member_group['can_be_additional'])
2669 2776
 				echo '
2670 2777
 									<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>';
2778
+		}
2671 2779
 		echo '
2672 2780
 								</span>
2673 2781
 								<a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;" class="toggle_down">', $txt['additional_membergroups_show'], '</a>
@@ -2727,9 +2835,10 @@  discard block
 block discarded – undo
2727 2835
 								<span class="smalltext">', $txt['sig_info'], '</span><br>
2728 2836
 								<br>';
2729 2837
 
2730
-	if ($context['show_spellchecking'])
2731
-		echo '
2838
+	if ($context['show_spellchecking']) {
2839
+			echo '
2732 2840
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button">';
2841
+	}
2733 2842
 
2734 2843
 		echo '
2735 2844
 							</dt>
@@ -2737,17 +2846,20 @@  discard block
 block discarded – undo
2737 2846
 								<textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50" style="min-width: 50%; max-width: 99%;">', $context['member']['signature'], '</textarea><br>';
2738 2847
 
2739 2848
 	// If there is a limit at all!
2740
-	if (!empty($context['signature_limits']['max_length']))
2741
-		echo '
2849
+	if (!empty($context['signature_limits']['max_length'])) {
2850
+			echo '
2742 2851
 								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>';
2852
+	}
2743 2853
 
2744
-	if (!empty($context['show_preview_button']))
2745
-		echo '
2854
+	if (!empty($context['show_preview_button'])) {
2855
+			echo '
2746 2856
 								<input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button">';
2857
+	}
2747 2858
 
2748
-	if ($context['signature_warning'])
2749
-		echo '
2859
+	if ($context['signature_warning']) {
2860
+			echo '
2750 2861
 								<span class="smalltext">', $context['signature_warning'], '</span>';
2862
+	}
2751 2863
 
2752 2864
 	// Some javascript used to count how many characters have been used so far in the signature.
2753 2865
 	echo '
@@ -2791,9 +2903,10 @@  discard block
 block discarded – undo
2791 2903
 									<div>
2792 2904
 										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
2793 2905
 		// This lists all the file categories.
2794
-		foreach ($context['avatars'] as $avatar)
2795
-			echo '
2906
+		foreach ($context['avatars'] as $avatar) {
2907
+					echo '
2796 2908
 											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>';
2909
+		}
2797 2910
 		echo '
2798 2911
 										</select>
2799 2912
 									</div>
@@ -2848,16 +2961,17 @@  discard block
 block discarded – undo
2848 2961
 								<div id="avatar_gravatar">
2849 2962
 									<img src="' . $context['member']['avatar']['href'] . '" alt="" />';
2850 2963
 
2851
-		if (empty($modSettings['gravatarAllowExtraEmail']))
2852
-			echo '
2964
+		if (empty($modSettings['gravatarAllowExtraEmail'])) {
2965
+					echo '
2853 2966
 									<div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>';
2854
-		else
2967
+		} else
2855 2968
 		{
2856 2969
 			// Depending on other stuff, the stored value here might have some odd things in it from other areas.
2857
-			if ($context['member']['avatar']['external'] == $context['member']['email'])
2858
-				$textbox_value = '';
2859
-			else
2860
-				$textbox_value = $context['member']['avatar']['external'];
2970
+			if ($context['member']['avatar']['external'] == $context['member']['email']) {
2971
+							$textbox_value = '';
2972
+			} else {
2973
+							$textbox_value = $context['member']['avatar']['external'];
2974
+			}
2861 2975
 
2862 2976
 			echo '
2863 2977
 									<div class="smalltext">', $txt['gravatar_alternateEmail'], '</div>
@@ -2929,8 +3043,9 @@  discard block
 block discarded – undo
2929 3043
 	$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
2930 3044
 
2931 3045
 	$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
2932
-	if (empty($suffix))
2933
-		return;
3046
+	if (empty($suffix)) {
3047
+			return;
3048
+	}
2934 3049
 
2935 3050
 	echo '
2936 3051
 									<div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>';
@@ -2952,9 +3067,10 @@  discard block
 block discarded – undo
2952 3067
 							<dd>
2953 3068
 								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
2954 3069
 	// Help the user by showing a list of common time formats.
2955
-	foreach ($context['easy_timeformats'] as $time_format)
2956
-		echo '
3070
+	foreach ($context['easy_timeformats'] as $time_format) {
3071
+			echo '
2957 3072
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3073
+	}
2958 3074
 	echo '
2959 3075
 								</select><br>
2960 3076
 								<input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30">
@@ -2990,9 +3106,10 @@  discard block
 block discarded – undo
2990 3106
 							</dt>
2991 3107
 							<dd>
2992 3108
 								<select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">';
2993
-	foreach ($context['smiley_sets'] as $set)
2994
-		echo '
3109
+	foreach ($context['smiley_sets'] as $set) {
3110
+			echo '
2995 3111
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>';
3112
+	}
2996 3113
 	echo '
2997 3114
 								</select> <img id="smileypr" class="centericon" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.png', '" alt=":)"  style="padding-left: 20px;">
2998 3115
 							</dd>';
@@ -3043,10 +3160,11 @@  discard block
 block discarded – undo
3043 3160
 									</div>
3044 3161
 									<div class="clear"></div>';
3045 3162
 
3046
-	if (!empty($context['from_ajax']))
3047
-		echo '
3163
+	if (!empty($context['from_ajax'])) {
3164
+			echo '
3048 3165
 									<br>
3049 3166
 									<a href="javascript:self.close();"></a>';
3167
+	}
3050 3168
 
3051 3169
 	echo '
3052 3170
 								</div>
@@ -3085,15 +3203,16 @@  discard block
 block discarded – undo
3085 3203
 								<br><div class="smalltext">', $txt['tfa_profile_desc'], '</div>
3086 3204
 							</dt>
3087 3205
 							<dd>';
3088
-	if (!$context['tfa_enabled'] && $context['user']['is_owner'])
3089
-		echo '
3206
+	if (!$context['tfa_enabled'] && $context['user']['is_owner']) {
3207
+			echo '
3090 3208
 								<a href="', !empty($modSettings['force_ssl']) && $modSettings['force_ssl'] < 2 ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>';
3091
-	elseif (!$context['tfa_enabled'])
3092
-		echo '
3209
+	} elseif (!$context['tfa_enabled']) {
3210
+			echo '
3093 3211
 								', $txt['tfa_profile_disabled'];
3094
-	else
3095
-		echo '
3212
+	} else {
3213
+			echo '
3096 3214
 							', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable');
3215
+	}
3097 3216
 	echo '
3098 3217
 							</dd>';
3099 3218
 }
Please login to merge, or discard this patch.