Completed
Push — release-2.1 ( 67c86a...1ee551 )
by Michael
09:56
created
Sources/ReCaptcha/RequestMethod/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/ReCaptcha/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/tasks/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
avatars/Oxygen/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
avatars/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 	header('Location: ' . $boardurl);
13 13
 }
14 14
 // Can't find it... just forget it.
15
-else
15
+else {
16 16
 	exit;
17
+}
17 18
 
18 19
 ?>
19 20
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 1 patch
Braces   +461 added lines, -344 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" class="new_win">', ($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>
@@ -310,11 +324,12 @@  discard block
 block discarded – undo
310 324
 		echo '
311 325
 				<dl class="settings">';
312 326
 
313
-		foreach ($context['print_custom_fields']['standard'] as $field)
314
-			if (!empty($field['output_html']))
327
+		foreach ($context['print_custom_fields']['standard'] as $field) {
328
+					if (!empty($field['output_html']))
315 329
 				echo '
316 330
 					<dt>', $field['name'], ':</dt>
317 331
 					<dd>', $field['output_html'], '</dd>';
332
+		}
318 333
 
319 334
 		echo '
320 335
 				</dl>';
@@ -332,9 +347,10 @@  discard block
 block discarded – undo
332 347
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>';
333 348
 
334 349
 		// Can we provide information on what this means?
335
-		if (!empty($context['warning_status']))
336
-			echo '
350
+		if (!empty($context['warning_status'])) {
351
+					echo '
337 352
 						<span class="smalltext">(', $context['warning_status'], ')</span>';
353
+		}
338 354
 
339 355
 		echo '
340 356
 					</dd>';
@@ -345,9 +361,10 @@  discard block
 block discarded – undo
345 361
 	{
346 362
 
347 363
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
348
-		if (!empty($context['activate_message']))
349
-			echo '
364
+		if (!empty($context['activate_message'])) {
365
+					echo '
350 366
 					<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>';
367
+		}
351 368
 
352 369
 		// If the current member is banned, show a message and possibly a link to the ban.
353 370
 		if (!empty($context['member']['bans']))
@@ -357,9 +374,10 @@  discard block
 block discarded – undo
357 374
 					<dt class="clear" id="ban_info" style="display: none;">
358 375
 						<strong>', $txt['user_banned_by_following'], ':</strong>';
359 376
 
360
-			foreach ($context['member']['bans'] as $ban)
361
-				echo '
377
+			foreach ($context['member']['bans'] as $ban) {
378
+							echo '
362 379
 						<br><span class="smalltext">', $ban['explanation'], '</span>';
380
+			}
363 381
 
364 382
 			echo '
365 383
 					</dt>';
@@ -373,30 +391,34 @@  discard block
 block discarded – undo
373 391
 	// If the person looking is allowed, they can check the members IP address and hostname.
374 392
 	if ($context['can_see_ip'])
375 393
 	{
376
-		if (!empty($context['member']['ip']))
377
-		echo '
394
+		if (!empty($context['member']['ip'])) {
395
+				echo '
378 396
 					<dt>', $txt['ip'], ': </dt>
379 397
 					<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
398
+		}
380 399
 
381
-		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
382
-			echo '
400
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) {
401
+					echo '
383 402
 					<dt>', $txt['hostname'], ': </dt>
384 403
 					<dd>', $context['member']['hostname'], '</dd>';
404
+		}
385 405
 	}
386 406
 
387 407
 	echo '
388 408
 					<dt>', $txt['local_time'], ':</dt>
389 409
 					<dd>', $context['member']['local_time'], '</dd>';
390 410
 
391
-	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
392
-		echo '
411
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) {
412
+			echo '
393 413
 					<dt>', $txt['language'], ':</dt>
394 414
 					<dd>', $context['member']['language'], '</dd>';
415
+	}
395 416
 
396
-	if ($context['member']['show_last_login'])
397
-		echo '
417
+	if ($context['member']['show_last_login']) {
418
+			echo '
398 419
 					<dt>', $txt['lastLoggedIn'], ': </dt>
399 420
 					<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
421
+	}
400 422
 
401 423
 	echo '
402 424
 				</dl>';
@@ -408,10 +430,11 @@  discard block
 block discarded – undo
408 430
 				<div class="custom_fields_above_signature">
409 431
 					<ul class="nolist">';
410 432
 
411
-		foreach ($context['print_custom_fields']['above_signature'] as $field)
412
-			if (!empty($field['output_html']))
433
+		foreach ($context['print_custom_fields']['above_signature'] as $field) {
434
+					if (!empty($field['output_html']))
413 435
 				echo '
414 436
 						<li>', $field['output_html'], '</li>';
437
+		}
415 438
 
416 439
 		echo '
417 440
 					</ul>
@@ -419,12 +442,13 @@  discard block
 block discarded – undo
419 442
 	}
420 443
 
421 444
 	// Show the users signature.
422
-	if ($context['signature_enabled'] && !empty($context['member']['signature']))
423
-		echo '
445
+	if ($context['signature_enabled'] && !empty($context['member']['signature'])) {
446
+			echo '
424 447
 				<div class="signature">
425 448
 					<h5>', $txt['signature'], ':</h5>
426 449
 					', $context['member']['signature'], '
427 450
 				</div>';
451
+	}
428 452
 
429 453
 	// Are there any custom profile fields for below the signature?
430 454
 	if (!empty($context['print_custom_fields']['below_signature']))
@@ -433,10 +457,11 @@  discard block
 block discarded – undo
433 457
 				<div class="custom_fields_below_signature">
434 458
 					<ul class="nolist">';
435 459
 
436
-		foreach ($context['print_custom_fields']['below_signature'] as $field)
437
-			if (!empty($field['output_html']))
460
+		foreach ($context['print_custom_fields']['below_signature'] as $field) {
461
+					if (!empty($field['output_html']))
438 462
 				echo '
439 463
 						<li>', $field['output_html'], '</li>';
464
+		}
440 465
 
441 466
 		echo '
442 467
 					</ul>
@@ -481,62 +506,70 @@  discard block
 block discarded – undo
481 506
 				</div>
482 507
 				<div class="list_posts">';
483 508
 
484
-			if (!$post['approved'])
485
-				echo '
509
+			if (!$post['approved']) {
510
+							echo '
486 511
 					<div class="approve_post">
487 512
 						<em>', $txt['post_awaiting_approval'], '</em>
488 513
 					</div>';
514
+			}
489 515
 
490 516
 			echo '
491 517
 					', $post['body'], '
492 518
 				</div>';
493 519
 
494
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
495
-				echo '
520
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
521
+							echo '
496 522
 				<div class="floatright">
497 523
 					<ul class="quickbuttons">';
524
+			}
498 525
 
499 526
 			// If they *can* reply?
500
-			if ($post['can_reply'])
501
-				echo '
527
+			if ($post['can_reply']) {
528
+							echo '
502 529
 						<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
530
+			}
503 531
 
504 532
 			// If they *can* quote?
505
-			if ($post['can_quote'])
506
-				echo '
533
+			if ($post['can_quote']) {
534
+							echo '
507 535
 						<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>';
536
+			}
508 537
 
509 538
 			// How about... even... remove it entirely?!
510
-			if ($post['can_delete'])
511
-				echo '
539
+			if ($post['can_delete']) {
540
+							echo '
512 541
 						<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>';
542
+			}
513 543
 
514
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
515
-				echo '
544
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
545
+							echo '
516 546
 					</ul>
517 547
 				</div>';
548
+			}
518 549
 
519 550
 			echo '
520 551
 			</div>';
521 552
 		}
553
+	} else {
554
+			template_show_list('attachments');
522 555
 	}
523
-	else
524
-		template_show_list('attachments');
525 556
 
526 557
 	// No posts? Just end with a informative message.
527
-	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
528
-		echo '
558
+	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) {
559
+			echo '
529 560
 			<div class="windowbg2">
530 561
 				', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
531 562
 			</div>';
563
+	}
532 564
 
533 565
 	// Show more page numbers.
534
-	if (!empty($context['page_index']))
535
-		echo '
566
+	if (!empty($context['page_index'])) {
567
+			echo '
536 568
 		<div class="pagesection">
537 569
 			<div class="pagelinks">', $context['page_index'], '</div>
538 570
 		</div>';
539
-}
571
+	}
572
+	}
540 573
 
541 574
 /**
542 575
  * Template for showing alerts within the alerts popup
@@ -546,11 +579,12 @@  discard block
 block discarded – undo
546 579
 	global $context, $txt, $scripturl;
547 580
 
548 581
 	// Do we have an update message?
549
-	if (!empty($context['update_message']))
550
-		echo '
582
+	if (!empty($context['update_message'])) {
583
+			echo '
551 584
 		<div class="infobox">
552 585
 			', $context['update_message'], '.
553 586
 		</div>';
587
+	}
554 588
 
555 589
 	echo '
556 590
 		<div class="cat_bar">
@@ -559,13 +593,12 @@  discard block
 block discarded – undo
559 593
 			</h3>
560 594
 		</div>';
561 595
 
562
-	if (empty($context['alerts']))
563
-		echo '
596
+	if (empty($context['alerts'])) {
597
+			echo '
564 598
 		<div class="information">
565 599
 			', $txt['alerts_none'], '
566 600
 		</div>';
567
-
568
-	else
601
+	} else
569 602
 	{
570 603
 		// Start the form.
571 604
 		echo '
@@ -627,12 +660,12 @@  discard block
 block discarded – undo
627 660
 		</div>' : '';
628 661
 
629 662
 	// No drafts? Just show an informative message.
630
-	if (empty($context['drafts']))
631
-		echo '
663
+	if (empty($context['drafts'])) {
664
+			echo '
632 665
 		<div class="windowbg2 centertext">
633 666
 			', $txt['draft_none'], '
634 667
 		</div>';
635
-	else
668
+	} else
636 669
 	{
637 670
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
638 671
 		foreach ($context['drafts'] as $draft)
@@ -643,11 +676,13 @@  discard block
 block discarded – undo
643 676
 					<div class="topic_details">
644 677
 						<h5><strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
645 678
 
646
-			if (!empty($draft['sticky']))
647
-				echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
679
+			if (!empty($draft['sticky'])) {
680
+							echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
681
+			}
648 682
 
649
-			if (!empty($draft['locked']))
650
-				echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
683
+			if (!empty($draft['locked'])) {
684
+							echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
685
+			}
651 686
 
652 687
 			echo '
653 688
 						</h5>
@@ -680,12 +715,13 @@  discard block
 block discarded – undo
680 715
 {
681 716
 	global $context, $scripturl, $txt;
682 717
 
683
-	if (!empty($context['saved_successful']))
684
-		echo '
718
+	if (!empty($context['saved_successful'])) {
719
+			echo '
685 720
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
686
-	elseif (!empty($context['saved_failed']))
687
-		echo '
721
+	} elseif (!empty($context['saved_failed'])) {
722
+			echo '
688 723
 					<div class="errorbox">', $context['saved_failed'], '</div>';
724
+	}
689 725
 
690 726
 	echo '
691 727
 	<div id="edit_buddies">
@@ -699,24 +735,27 @@  discard block
 block discarded – undo
699 735
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
700 736
 				<th scope="col">', $txt['status'], '</th>';
701 737
 
702
-	if (allowedTo('moderate_forum'))
703
-		echo '
738
+	if (allowedTo('moderate_forum')) {
739
+			echo '
704 740
 				<th scope="col">', $txt['email'], '</th>';
741
+	}
705 742
 
706
-	if (!empty($context['custom_pf']))
707
-		foreach ($context['custom_pf'] as $column)
743
+	if (!empty($context['custom_pf'])) {
744
+			foreach ($context['custom_pf'] as $column)
708 745
 				echo '<th scope="col">', $column['label'], '</th>';
746
+	}
709 747
 
710 748
 	echo '
711 749
 				<th scope="col">', $txt['remove'], '</th>
712 750
 			</tr>';
713 751
 
714 752
 	// If they don't have any buddies don't list them!
715
-	if (empty($context['buddies']))
716
-		echo '
753
+	if (empty($context['buddies'])) {
754
+			echo '
717 755
 			<tr class="windowbg">
718 756
 				<td colspan="', allowedTo('moderate_forum') ? '10' : '9', '"><strong>', $txt['no_buddies'], '</strong></td>
719 757
 			</tr>';
758
+	}
720 759
 
721 760
 		// Now loop through each buddy showing info on each.
722 761
 	else
@@ -728,15 +767,17 @@  discard block
 block discarded – undo
728 767
 					<td>', $buddy['link'], '</td>
729 768
 					<td><a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a></td>';
730 769
 
731
-			if ($buddy['show_email'])
732
-				echo '
770
+			if ($buddy['show_email']) {
771
+							echo '
733 772
 					<td><a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a></td>';
773
+			}
734 774
 
735 775
 			// Show the custom profile fields for this user.
736
-			if (!empty($context['custom_pf']))
737
-				foreach ($context['custom_pf'] as $key => $column)
776
+			if (!empty($context['custom_pf'])) {
777
+							foreach ($context['custom_pf'] as $key => $column)
738 778
 					echo '
739 779
 						<td class="lefttext">', $buddy['options'][$key], '</td>';
780
+			}
740 781
 
741 782
 			echo '
742 783
 					<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>
@@ -766,9 +807,10 @@  discard block
 block discarded – undo
766 807
 			</dl>
767 808
 		</div>';
768 809
 
769
-	if (!empty($context['token_check']))
770
-		echo '
810
+	if (!empty($context['token_check'])) {
811
+			echo '
771 812
 			<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
813
+	}
772 814
 
773 815
 	echo '
774 816
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -794,12 +836,13 @@  discard block
 block discarded – undo
794 836
 {
795 837
 	global $context, $scripturl, $txt;
796 838
 
797
-	if (!empty($context['saved_successful']))
798
-		echo '
839
+	if (!empty($context['saved_successful'])) {
840
+			echo '
799 841
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
800
-	elseif (!empty($context['saved_failed']))
801
-		echo '
842
+	} elseif (!empty($context['saved_failed'])) {
843
+			echo '
802 844
 					<div class="errorbox">', $context['saved_failed'], '</div>';
845
+	}
803 846
 
804 847
 	echo '
805 848
 	<div id="edit_buddies">
@@ -813,20 +856,22 @@  discard block
 block discarded – undo
813 856
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
814 857
 				<th scope="col">', $txt['status'], '</th>';
815 858
 
816
-	if (allowedTo('moderate_forum'))
817
-		echo '
859
+	if (allowedTo('moderate_forum')) {
860
+			echo '
818 861
 				<th scope="col">', $txt['email'], '</th>';
862
+	}
819 863
 
820 864
 	echo '
821 865
 				<th scope="col">', $txt['ignore_remove'], '</th>
822 866
 			</tr>';
823 867
 
824 868
 	// If they don't have anyone on their ignore list, don't list it!
825
-	if (empty($context['ignore_list']))
826
-		echo '
869
+	if (empty($context['ignore_list'])) {
870
+			echo '
827 871
 			<tr class="windowbg">
828 872
 				<td colspan="', allowedTo('moderate_forum') ? '4' : '3', '"><strong>', $txt['no_ignore'], '</strong></td>
829 873
 			</tr>';
874
+	}
830 875
 
831 876
 	// Now loop through each buddy showing info on each.
832 877
 	foreach ($context['ignore_list'] as $member)
@@ -836,9 +881,10 @@  discard block
 block discarded – undo
836 881
 				<td>', $member['link'], '</td>
837 882
 				<td><a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a></td>';
838 883
 
839
-		if ($member['show_email'])
840
-			echo '
884
+		if ($member['show_email']) {
885
+					echo '
841 886
 				<td><a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a></td>';
887
+		}
842 888
 		echo '
843 889
 				<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>
844 890
 			</tr>';
@@ -865,9 +911,10 @@  discard block
 block discarded – undo
865 911
 			</dl>
866 912
 		</div>';
867 913
 
868
-	if (!empty($context['token_check']))
869
-		echo '
914
+	if (!empty($context['token_check'])) {
915
+			echo '
870 916
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
917
+	}
871 918
 
872 919
 	echo '
873 920
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -912,9 +959,10 @@  discard block
 block discarded – undo
912 959
 					<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
913 960
 
914 961
 	// Second address detected?
915
-	if (!empty($context['last_ip2']))
916
-		echo '
962
+	if (!empty($context['last_ip2'])) {
963
+			echo '
917 964
 					, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
965
+	}
918 966
 
919 967
 	echo '
920 968
 				</dd>';
@@ -979,9 +1027,10 @@  discard block
 block discarded – undo
979 1027
 				<h3 class="catbg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
980 1028
 			</div>
981 1029
 			<div class="windowbg2 noup">';
982
-			foreach ($context['whois_servers'] as $server)
983
-			echo '
1030
+			foreach ($context['whois_servers'] as $server) {
1031
+						echo '
984 1032
 				<a href="', $server['url'], '" target="_blank" class="new_win"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>';
1033
+			}
985 1034
 			echo '
986 1035
 			</div>
987 1036
 			<br>';
@@ -992,10 +1041,10 @@  discard block
 block discarded – undo
992 1041
 		<div class="cat_bar">
993 1042
 			<h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
994 1043
 		</div>';
995
-	if (empty($context['ips']))
996
-		echo '
1044
+	if (empty($context['ips'])) {
1045
+			echo '
997 1046
 		<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
998
-	else
1047
+	} else
999 1048
 	{
1000 1049
 		echo '
1001 1050
 		<table class="table_grid">
@@ -1008,12 +1057,13 @@  discard block
 block discarded – undo
1008 1057
 			<tbody>';
1009 1058
 
1010 1059
 		// Loop through each of the members and display them.
1011
-		foreach ($context['ips'] as $ip => $memberlist)
1012
-			echo '
1060
+		foreach ($context['ips'] as $ip => $memberlist) {
1061
+					echo '
1013 1062
 				<tr class="windowbg">
1014 1063
 					<td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
1015 1064
 					<td>', implode(', ', $memberlist), '</td>
1016 1065
 				</tr>';
1066
+		}
1017 1067
 
1018 1068
 		echo '
1019 1069
 			</tbody>
@@ -1059,8 +1109,7 @@  discard block
 block discarded – undo
1059 1109
 	{
1060 1110
 		echo '
1061 1111
 		<div class="information">', $txt['showPermissions_all'], '</div>';
1062
-	}
1063
-	else
1112
+	} else
1064 1113
 	{
1065 1114
 		echo '
1066 1115
 		<div class="information">',$txt['showPermissions_help'], '</div>
@@ -1074,9 +1123,10 @@  discard block
 block discarded – undo
1074 1123
 				</div>
1075 1124
 				<div class="windowbg smalltext">
1076 1125
 					', $txt['showPermissions_restricted_boards_desc'], ':<br>';
1077
-				foreach ($context['no_access_boards'] as $no_access_board)
1078
-					echo '
1126
+				foreach ($context['no_access_boards'] as $no_access_board) {
1127
+									echo '
1079 1128
 						<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
1129
+				}
1080 1130
 				echo '
1081 1131
 				</div>';
1082 1132
 		}
@@ -1108,12 +1158,13 @@  discard block
 block discarded – undo
1108 1158
 								</td>
1109 1159
 								<td class="smalltext">';
1110 1160
 
1111
-				if ($permission['is_denied'])
1112
-					echo '
1161
+				if ($permission['is_denied']) {
1162
+									echo '
1113 1163
 									<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1114
-				else
1115
-					echo '
1164
+				} else {
1165
+									echo '
1116 1166
 									', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
1167
+				}
1117 1168
 
1118 1169
 					echo '
1119 1170
 								</td>
@@ -1123,10 +1174,10 @@  discard block
 block discarded – undo
1123 1174
 						</tbody>
1124 1175
 					</table>
1125 1176
 				</div><br>';
1126
-		}
1127
-		else
1128
-			echo '
1177
+		} else {
1178
+					echo '
1129 1179
 			<p class="windowbg2">', $txt['showPermissions_none_general'], '</p>';
1180
+		}
1130 1181
 
1131 1182
 		// Board permission section.
1132 1183
 		echo '
@@ -1136,14 +1187,16 @@  discard block
 block discarded – undo
1136 1187
 						<a id="board_permissions"></a>', $txt['showPermissions_select'], ':
1137 1188
 						<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
1138 1189
 							<option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
1139
-				if (!empty($context['boards']))
1140
-					echo '
1190
+				if (!empty($context['boards'])) {
1191
+									echo '
1141 1192
 							<option value="" disabled>---------------------------</option>';
1193
+				}
1142 1194
 
1143 1195
 				// Fill the box with any local permission boards.
1144
-				foreach ($context['boards'] as $board)
1145
-					echo '
1196
+				foreach ($context['boards'] as $board) {
1197
+									echo '
1146 1198
 							<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
1199
+				}
1147 1200
 
1148 1201
 				echo '
1149 1202
 						</select>
@@ -1174,8 +1227,7 @@  discard block
 block discarded – undo
1174 1227
 				{
1175 1228
 					echo '
1176 1229
 							<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1177
-				}
1178
-				else
1230
+				} else
1179 1231
 				{
1180 1232
 					echo '
1181 1233
 							', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
@@ -1187,10 +1239,10 @@  discard block
 block discarded – undo
1187 1239
 			echo '
1188 1240
 				</tbody>
1189 1241
 			</table>';
1190
-		}
1191
-		else
1192
-			echo '
1242
+		} else {
1243
+					echo '
1193 1244
 			<p class="windowbg2">', $txt['showPermissions_none_board'], '</p>';
1245
+		}
1194 1246
 	echo '
1195 1247
 			</div>
1196 1248
 		</div>';
@@ -1232,9 +1284,10 @@  discard block
 block discarded – undo
1232 1284
 			</div>';
1233 1285
 
1234 1286
 	// If they haven't post at all, don't draw the graph.
1235
-	if (empty($context['posts_by_time']))
1236
-		echo '
1287
+	if (empty($context['posts_by_time'])) {
1288
+			echo '
1237 1289
 			<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1290
+	}
1238 1291
 	// Otherwise do!
1239 1292
 	else
1240 1293
 	{
@@ -1273,11 +1326,10 @@  discard block
 block discarded – undo
1273 1326
 					</h3>
1274 1327
 				</div>';
1275 1328
 
1276
-	if (empty($context['popular_boards']))
1277
-		echo '
1329
+	if (empty($context['popular_boards'])) {
1330
+			echo '
1278 1331
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1279
-
1280
-	else
1332
+	} else
1281 1333
 	{
1282 1334
 		echo '
1283 1335
 				<dl class="stats">';
@@ -1308,10 +1360,10 @@  discard block
 block discarded – undo
1308 1360
 					</h3>
1309 1361
 				</div>';
1310 1362
 
1311
-	if (empty($context['board_activity']))
1312
-		echo '
1363
+	if (empty($context['board_activity'])) {
1364
+			echo '
1313 1365
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1314
-	else
1366
+	} else
1315 1367
 	{
1316 1368
 		echo '
1317 1369
 				<dl class="stats">';
@@ -1359,41 +1411,46 @@  discard block
 block discarded – undo
1359 1411
 				<h3 class="catbg profile_hd">';
1360 1412
 
1361 1413
 		// Don't say "Profile" if this isn't the profile...
1362
-		if (!empty($context['profile_header_text']))
1363
-			echo '
1414
+		if (!empty($context['profile_header_text'])) {
1415
+					echo '
1364 1416
 					', $context['profile_header_text'];
1365
-		else
1366
-			echo '
1417
+		} else {
1418
+					echo '
1367 1419
 					', $txt['profile'];
1420
+		}
1368 1421
 
1369 1422
 		echo '
1370 1423
 				</h3>
1371 1424
 			</div>';
1372 1425
 
1373 1426
 	// Have we some description?
1374
-	if ($context['page_desc'])
1375
-		echo '
1427
+	if ($context['page_desc']) {
1428
+			echo '
1376 1429
 			<p class="information">', $context['page_desc'], '</p>';
1430
+	}
1377 1431
 
1378 1432
 	echo '
1379 1433
 			<div class="roundframe">';
1380 1434
 
1381 1435
 	// Any bits at the start?
1382
-	if (!empty($context['profile_prehtml']))
1383
-		echo '
1436
+	if (!empty($context['profile_prehtml'])) {
1437
+			echo '
1384 1438
 				<div>', $context['profile_prehtml'], '</div>';
1439
+	}
1385 1440
 
1386
-	if (!empty($context['profile_fields']))
1387
-		echo '
1441
+	if (!empty($context['profile_fields'])) {
1442
+			echo '
1388 1443
 				<dl class="settings">';
1444
+	}
1389 1445
 
1390 1446
 	// Start the big old loop 'of love.
1391 1447
 	$lastItem = 'hr';
1392 1448
 	foreach ($context['profile_fields'] as $key => $field)
1393 1449
 	{
1394 1450
 		// We add a little hack to be sure we never get more than one hr in a row!
1395
-		if ($lastItem == 'hr' && $field['type'] == 'hr')
1396
-			continue;
1451
+		if ($lastItem == 'hr' && $field['type'] == 'hr') {
1452
+					continue;
1453
+		}
1397 1454
 
1398 1455
 		$lastItem = $field['type'];
1399 1456
 		if ($field['type'] == 'hr')
@@ -1402,48 +1459,50 @@  discard block
 block discarded – undo
1402 1459
 				</dl>
1403 1460
 				<hr>
1404 1461
 				<dl class="settings">';
1405
-		}
1406
-		elseif ($field['type'] == 'callback')
1462
+		} elseif ($field['type'] == 'callback')
1407 1463
 		{
1408 1464
 			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
1409 1465
 			{
1410 1466
 				$callback_func = 'template_profile_' . $field['callback_func'];
1411 1467
 				$callback_func();
1412 1468
 			}
1413
-		}
1414
-		else
1469
+		} else
1415 1470
 		{
1416 1471
 			echo '
1417 1472
 					<dt>
1418 1473
 						<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
1419 1474
 
1420 1475
 			// Does it have any subtext to show?
1421
-			if (!empty($field['subtext']))
1422
-				echo '
1476
+			if (!empty($field['subtext'])) {
1477
+							echo '
1423 1478
 						<br>
1424 1479
 						<span class="smalltext">', $field['subtext'], '</span>';
1480
+			}
1425 1481
 
1426 1482
 			echo '
1427 1483
 					</dt>
1428 1484
 					<dd>';
1429 1485
 
1430 1486
 			// Want to put something infront of the box?
1431
-			if (!empty($field['preinput']))
1432
-				echo '
1487
+			if (!empty($field['preinput'])) {
1488
+							echo '
1433 1489
 						', $field['preinput'];
1490
+			}
1434 1491
 
1435 1492
 			// What type of data are we showing?
1436
-			if ($field['type'] == 'label')
1437
-				echo '
1493
+			if ($field['type'] == 'label') {
1494
+							echo '
1438 1495
 						', $field['value'];
1496
+			}
1439 1497
 
1440 1498
 			// Maybe it's a text box - very likely!
1441 1499
 			elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url')))
1442 1500
 			{
1443
-				if ($field['type'] == 'int' || $field['type'] == 'float')
1444
-					$type = 'number';
1445
-				else
1446
-					$type = $field['type'];
1501
+				if ($field['type'] == 'int' || $field['type'] == 'float') {
1502
+									$type = 'number';
1503
+				} else {
1504
+									$type = $field['type'];
1505
+				}
1447 1506
 				$step = $field['type'] == 'float' ? ' step="0.1"' : '';
1448 1507
 
1449 1508
 
@@ -1451,9 +1510,10 @@  discard block
 block discarded – undo
1451 1510
 						<input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '"', $step, '>';
1452 1511
 			}
1453 1512
 			// You "checking" me out? ;)
1454
-			elseif ($field['type'] == 'check')
1455
-				echo '
1513
+			elseif ($field['type'] == 'check') {
1514
+							echo '
1456 1515
 						<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" class="input_check" ', $field['input_attr'], '>';
1516
+			}
1457 1517
 
1458 1518
 			// Always fun - select boxes!
1459 1519
 			elseif ($field['type'] == 'select')
@@ -1464,13 +1524,15 @@  discard block
 block discarded – undo
1464 1524
 				if (isset($field['options']))
1465 1525
 				{
1466 1526
 					// Is this some code to generate the options?
1467
-					if (!is_array($field['options']))
1468
-						$field['options'] = $field['options']();
1527
+					if (!is_array($field['options'])) {
1528
+											$field['options'] = $field['options']();
1529
+					}
1469 1530
 					// Assuming we now have some!
1470
-					if (is_array($field['options']))
1471
-						foreach ($field['options'] as $value => $name)
1531
+					if (is_array($field['options'])) {
1532
+											foreach ($field['options'] as $value => $name)
1472 1533
 							echo '
1473 1534
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
1535
+					}
1474 1536
 				}
1475 1537
 
1476 1538
 				echo '
@@ -1478,25 +1540,28 @@  discard block
 block discarded – undo
1478 1540
 			}
1479 1541
 
1480 1542
 			// Something to end with?
1481
-			if (!empty($field['postinput']))
1482
-				echo '
1543
+			if (!empty($field['postinput'])) {
1544
+							echo '
1483 1545
 							', $field['postinput'];
1546
+			}
1484 1547
 
1485 1548
 			echo '
1486 1549
 					</dd>';
1487 1550
 		}
1488 1551
 	}
1489 1552
 
1490
-	if (!empty($context['profile_fields']))
1491
-		echo '
1553
+	if (!empty($context['profile_fields'])) {
1554
+			echo '
1492 1555
 				</dl>';
1556
+	}
1493 1557
 
1494 1558
 	// Are there any custom profile fields - if so print them!
1495 1559
 	if (!empty($context['custom_fields']))
1496 1560
 	{
1497
-		if ($lastItem != 'hr')
1498
-			echo '
1561
+		if ($lastItem != 'hr') {
1562
+					echo '
1499 1563
 				<hr>';
1564
+		}
1500 1565
 
1501 1566
 		echo '
1502 1567
 				<dl class="settings">';
@@ -1519,13 +1584,14 @@  discard block
 block discarded – undo
1519 1584
 	}
1520 1585
 
1521 1586
 	// Any closing HTML?
1522
-	if (!empty($context['profile_posthtml']))
1523
-		echo '
1587
+	if (!empty($context['profile_posthtml'])) {
1588
+			echo '
1524 1589
 				<div>', $context['profile_posthtml'], '</div>';
1590
+	}
1525 1591
 
1526 1592
 	// Only show the password box if it's actually needed.
1527
-	if ($context['require_password'])
1528
-		echo '
1593
+	if ($context['require_password']) {
1594
+			echo '
1529 1595
 				<dl class="settings">
1530 1596
 					<dt>
1531 1597
 						<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br>
@@ -1535,18 +1601,21 @@  discard block
 block discarded – undo
1535 1601
 						<input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password">
1536 1602
 					</dd>
1537 1603
 				</dl>';
1604
+	}
1538 1605
 
1539 1606
 	// The button shouldn't say "Change profile" unless we're changing the profile...
1540
-	if (!empty($context['submit_button_text']))
1541
-		echo '
1607
+	if (!empty($context['submit_button_text'])) {
1608
+			echo '
1542 1609
 				<input type="submit" name="save" value="', $context['submit_button_text'], '" class="button_submit">';
1543
-	else
1544
-		echo '
1610
+	} else {
1611
+			echo '
1545 1612
 				<input type="submit" name="save" value="', $txt['change_profile'], '" class="button_submit">';
1613
+	}
1546 1614
 
1547
-	if (!empty($context['token_check']))
1548
-		echo '
1615
+	if (!empty($context['token_check'])) {
1616
+			echo '
1549 1617
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
1618
+	}
1550 1619
 
1551 1620
 	echo '
1552 1621
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1556,10 +1625,11 @@  discard block
 block discarded – undo
1556 1625
 		</form>';
1557 1626
 
1558 1627
 	// Any final spellchecking stuff?
1559
-	if (!empty($context['show_spellchecking']))
1560
-		echo '
1628
+	if (!empty($context['show_spellchecking'])) {
1629
+			echo '
1561 1630
 		<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>';
1562
-}
1631
+	}
1632
+	}
1563 1633
 
1564 1634
 /**
1565 1635
  * Personal Message settings.
@@ -1596,10 +1666,11 @@  discard block
 block discarded – undo
1596 1666
 										<select name="pm_receive_from" id="pm_receive_from">
1597 1667
 												<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
1598 1668
 
1599
-	if (!empty($modSettings['enable_buddylist']))
1600
-		echo '
1669
+	if (!empty($modSettings['enable_buddylist'])) {
1670
+			echo '
1601 1671
 												<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option>
1602 1672
 												<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
1673
+	}
1603 1674
 
1604 1675
 	echo '
1605 1676
 												<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option>
@@ -1641,11 +1712,12 @@  discard block
 block discarded – undo
1641 1712
 		if (empty($setting) || !is_array($setting))
1642 1713
 		{
1643 1714
 			// Insert a separator (unless this is the first item in the list)
1644
-			if ($i !== $first_option_key)
1645
-				echo '
1715
+			if ($i !== $first_option_key) {
1716
+							echo '
1646 1717
 				</dl>
1647 1718
 				<hr>
1648 1719
 				<dl class="settings">';
1720
+			}
1649 1721
 
1650 1722
 			// Should we give a name to this section?
1651 1723
 			if (is_string($setting) && !empty($setting))
@@ -1653,48 +1725,52 @@  discard block
 block discarded – undo
1653 1725
 				$titled_section = true;
1654 1726
 				echo '
1655 1727
 					<dt><b>' . $setting . '</b></dt><dd></dd>';
1728
+			} else {
1729
+							$titled_section = false;
1656 1730
 			}
1657
-			else
1658
-				$titled_section = false;
1659 1731
 
1660 1732
 			continue;
1661 1733
 		}
1662 1734
 
1663 1735
 		// Is this disabled?
1664
-		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled']))
1665
-			continue;
1666
-		elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage']))
1667
-			continue;
1668
-		elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored']))
1669
-			continue;
1670
-		elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist']))
1671
-			continue;
1672
-		elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg']))
1673
-			continue;
1674
-		elseif ($setting['id'] == 'topics_per_page' && !empty($modSettings['disableCustomPerPage']))
1675
-			continue;
1676
-		elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1677
-			continue;
1678
-		elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1679
-			continue;
1736
+		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) {
1737
+					continue;
1738
+		} elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) {
1739
+					continue;
1740
+		} elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) {
1741
+					continue;
1742
+		} elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) {
1743
+					continue;
1744
+		} elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) {
1745
+					continue;
1746
+		} elseif ($setting['id'] == 'topics_per_page' && !empty($modSettings['disableCustomPerPage'])) {
1747
+					continue;
1748
+		} elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1749
+					continue;
1750
+		} elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1751
+					continue;
1752
+		}
1680 1753
 
1681
-		if (!isset($setting['type']) || $setting['type'] == 'bool')
1682
-			$setting['type'] = 'checkbox';
1683
-		elseif ($setting['type'] == 'int' || $setting['type'] == 'integer')
1684
-			$setting['type'] = 'number';
1685
-		elseif ($setting['type'] == 'string')
1686
-			$setting['type'] = 'text';
1754
+		if (!isset($setting['type']) || $setting['type'] == 'bool') {
1755
+					$setting['type'] = 'checkbox';
1756
+		} elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') {
1757
+					$setting['type'] = 'number';
1758
+		} elseif ($setting['type'] == 'string') {
1759
+					$setting['type'] = 'text';
1760
+		}
1687 1761
 
1688
-		if (isset($setting['options']))
1689
-			$setting['type'] = 'list';
1762
+		if (isset($setting['options'])) {
1763
+					$setting['type'] = 'list';
1764
+		}
1690 1765
 
1691 1766
 		echo '
1692 1767
 					<dt>
1693 1768
 						<label for="', $setting['id'], '">', !$titled_section ? '<b>' : '', $setting['label'], !$titled_section ? '</b>' : '', '</label>';
1694 1769
 
1695
-		if (isset($setting['description']))
1696
-			echo '
1770
+		if (isset($setting['description'])) {
1771
+					echo '
1697 1772
 						<br><span class="smalltext">', $setting['description'], '</span>';
1773
+		}
1698 1774
 		echo '
1699 1775
 					</dt>
1700 1776
 					<dd>';
@@ -1732,13 +1808,11 @@  discard block
 block discarded – undo
1732 1808
 
1733 1809
 				echo '
1734 1810
 						<input type="number"', $min . $max . $step;
1735
-			}
1736
-			else if (isset($setting['type']) && $setting['type'] == 'url')
1811
+			} else if (isset($setting['type']) && $setting['type'] == 'url')
1737 1812
 			{
1738 1813
 				echo'
1739 1814
 						<input type="url"';
1740
-			}
1741
-			else
1815
+			} else
1742 1816
 			{
1743 1817
 				echo '
1744 1818
 						<input type="text"';
@@ -1777,8 +1851,8 @@  discard block
 block discarded – undo
1777 1851
 				<dl class="settings">';
1778 1852
 
1779 1853
 	// Allow notification on announcements to be disabled?
1780
-	if (!empty($modSettings['allow_disableAnnounce']))
1781
-		echo '
1854
+	if (!empty($modSettings['allow_disableAnnounce'])) {
1855
+			echo '
1782 1856
 					<dt>
1783 1857
 						<label for="notify_announcements">', $txt['notify_important_email'], '</label>
1784 1858
 					</dt>
@@ -1786,9 +1860,10 @@  discard block
 block discarded – undo
1786 1860
 						<input type="hidden" name="notify_announcements" value="0">
1787 1861
 						<input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', ' class="input_check">
1788 1862
 					</dd>';
1863
+	}
1789 1864
 
1790
-	if (!empty($modSettings['enable_ajax_alerts']))
1791
-		echo '
1865
+	if (!empty($modSettings['enable_ajax_alerts'])) {
1866
+			echo '
1792 1867
 					<dt>
1793 1868
 						<label for="notify_send_body">', $txt['notify_alert_timeout'], '</label>
1794 1869
 					</dt>
@@ -1796,6 +1871,7 @@  discard block
 block discarded – undo
1796 1871
 						<input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '" class="input_text">
1797 1872
 					</dd>
1798 1873
 		';
1874
+	}
1799 1875
 
1800 1876
 	echo '
1801 1877
 				</dl>
@@ -1825,9 +1901,10 @@  discard block
 block discarded – undo
1825 1901
 					<td colspan="3">';
1826 1902
 				$label = $txt['alert_opt_' . $opts[1]];
1827 1903
 				$label_pos = isset($opts['label']) ? $opts['label'] : '';
1828
-				if ($label_pos == 'before')
1829
-					echo '
1904
+				if ($label_pos == 'before') {
1905
+									echo '
1830 1906
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1907
+				}
1831 1908
 
1832 1909
 				$this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0;
1833 1910
 				switch ($opts[0])
@@ -1839,17 +1916,19 @@  discard block
 block discarded – undo
1839 1916
 					case 'select':
1840 1917
 						echo '
1841 1918
 						<select name="opt_', $opts[1], '" id="opt_', $opts[1], '">';
1842
-						foreach ($opts['opts'] as $k => $v)
1843
-							echo '
1919
+						foreach ($opts['opts'] as $k => $v) {
1920
+													echo '
1844 1921
 							<option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>';
1922
+						}
1845 1923
 						echo '
1846 1924
 						</select>';
1847 1925
 						break;
1848 1926
 				}
1849 1927
 
1850
-				if ($label_pos == 'after')
1851
-					echo '
1928
+				if ($label_pos == 'after') {
1929
+									echo '
1852 1930
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1931
+				}
1853 1932
 
1854 1933
 				echo '
1855 1934
 					</td>
@@ -1963,11 +2042,12 @@  discard block
 block discarded – undo
1963 2042
 			<p class="information">', $txt['groupMembership_info'], '</p>';
1964 2043
 
1965 2044
 	// Do we have an update message?
1966
-	if (!empty($context['update_message']))
1967
-		echo '
2045
+	if (!empty($context['update_message'])) {
2046
+			echo '
1968 2047
 			<div class="infobox">
1969 2048
 				', $context['update_message'], '.
1970 2049
 			</div>';
2050
+	}
1971 2051
 
1972 2052
 	echo '
1973 2053
 		<div id="groups">';
@@ -1989,8 +2069,7 @@  discard block
 block discarded – undo
1989 2069
 					</div>
1990 2070
 				</div>
1991 2071
 			</div>';
1992
-	}
1993
-	else
2072
+	} else
1994 2073
 	{
1995 2074
 		echo '
1996 2075
 			<div class="title_bar">
@@ -2002,27 +2081,30 @@  discard block
 block discarded – undo
2002 2081
 			echo '
2003 2082
 					<div class="windowbg" id="primdiv_', $group['id'], '">';
2004 2083
 
2005
-				if ($context['can_edit_primary'])
2006
-					echo '
2084
+				if ($context['can_edit_primary']) {
2085
+									echo '
2007 2086
 						<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', ' class="input_radio">';
2087
+				}
2008 2088
 
2009 2089
 				echo '
2010 2090
 						<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>';
2011 2091
 
2012 2092
 				// Can they leave their group?
2013
-				if ($group['can_leave'])
2014
-					echo '
2093
+				if ($group['can_leave']) {
2094
+									echo '
2015 2095
 						<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>';
2096
+				}
2016 2097
 
2017 2098
 				echo '
2018 2099
 					</div>';
2019 2100
 		}
2020 2101
 
2021
-		if ($context['can_edit_primary'])
2022
-			echo '
2102
+		if ($context['can_edit_primary']) {
2103
+					echo '
2023 2104
 			<div class="padding righttext">
2024 2105
 				<input type="submit" value="', $txt['make_primary'], '" class="button_submit">
2025 2106
 			</div>';
2107
+		}
2026 2108
 
2027 2109
 		// Any groups they can join?
2028 2110
 		if (!empty($context['groups']['available']))
@@ -2038,15 +2120,16 @@  discard block
 block discarded – undo
2038 2120
 					<div class="windowbg">
2039 2121
 						<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>' : ''), '';
2040 2122
 
2041
-				if ($group['type'] == 3)
2042
-					echo '
2123
+				if ($group['type'] == 3) {
2124
+									echo '
2043 2125
 						<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>';
2044
-				elseif ($group['type'] == 2 && $group['pending'])
2045
-					echo '
2126
+				} elseif ($group['type'] == 2 && $group['pending']) {
2127
+									echo '
2046 2128
 						<span class="floatright">', $txt['approval_pending'], '</span>';
2047
-				elseif ($group['type'] == 2)
2048
-					echo '
2129
+				} elseif ($group['type'] == 2) {
2130
+									echo '
2049 2131
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
2132
+				}
2050 2133
 
2051 2134
 				echo '
2052 2135
 					</div>';
@@ -2069,9 +2152,10 @@  discard block
 block discarded – undo
2069 2152
 
2070 2153
 			prevDiv.className = "windowbg";
2071 2154
 		}';
2072
-		if (isset($context['groups']['member'][$context['primary_group']]))
2073
-			echo '
2155
+		if (isset($context['groups']['member'][$context['primary_group']])) {
2156
+					echo '
2074 2157
 		highlightSelected("primdiv_' . $context['primary_group'] . '");';
2158
+		}
2075 2159
 		echo '
2076 2160
 	</script>';
2077 2161
 	}
@@ -2079,9 +2163,10 @@  discard block
 block discarded – undo
2079 2163
 	echo '
2080 2164
 		</div>';
2081 2165
 
2082
-	if (!empty($context['token_check']))
2083
-		echo '
2166
+	if (!empty($context['token_check'])) {
2167
+			echo '
2084 2168
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2169
+	}
2085 2170
 
2086 2171
 	echo '
2087 2172
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2128,14 +2213,15 @@  discard block
 block discarded – undo
2128 2213
 
2129 2214
 		foreach ($category['boards'] as $board)
2130 2215
 		{
2131
-			if ($i == $limit)
2132
-				echo '
2216
+			if ($i == $limit) {
2217
+							echo '
2133 2218
 						</ul>
2134 2219
 					</li>
2135 2220
 				</ul>
2136 2221
 				<ul class="ignoreboards floatright">
2137 2222
 					<li class="category">
2138 2223
 						<ul>';
2224
+			}
2139 2225
 
2140 2226
 			echo '
2141 2227
 							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
@@ -2181,10 +2267,11 @@  discard block
 block discarded – undo
2181 2267
 
2182 2268
 	// Work out the starting color.
2183 2269
 	$context['current_color'] = $context['colors'][0];
2184
-	foreach ($context['colors'] as $limit => $color)
2185
-		if ($context['member']['warning'] >= $limit)
2270
+	foreach ($context['colors'] as $limit => $color) {
2271
+			if ($context['member']['warning'] >= $limit)
2186 2272
 			$context['current_color'] = $color;
2187
-}
2273
+	}
2274
+	}
2188 2275
 
2189 2276
 // Show all warnings of a user?
2190 2277
 function template_viewWarning()
@@ -2223,14 +2310,15 @@  discard block
 block discarded – undo
2223 2310
 				</dd>';
2224 2311
 
2225 2312
 		// There's some impact of this?
2226
-		if (!empty($context['level_effects'][$context['current_level']]))
2227
-			echo '
2313
+		if (!empty($context['level_effects'][$context['current_level']])) {
2314
+					echo '
2228 2315
 				<dt>
2229 2316
 					<strong>', $txt['profile_viewwarning_impact'], ':</strong>
2230 2317
 				</dt>
2231 2318
 				<dd>
2232 2319
 					', $context['level_effects'][$context['current_level']], '
2233 2320
 				</dd>';
2321
+		}
2234 2322
 
2235 2323
 		echo '
2236 2324
 			</dl>
@@ -2268,10 +2356,11 @@  discard block
 block discarded – undo
2268 2356
 
2269 2357
 			// Otherwise see what we can do...';
2270 2358
 
2271
-	foreach ($context['notification_templates'] as $k => $type)
2272
-		echo '
2359
+	foreach ($context['notification_templates'] as $k => $type) {
2360
+			echo '
2273 2361
 			if (index == ', $k, ')
2274 2362
 				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
2363
+	}
2275 2364
 
2276 2365
 	echo '
2277 2366
 		}
@@ -2281,10 +2370,11 @@  discard block
 block discarded – undo
2281 2370
 			// Also set the right effect.
2282 2371
 			effectText = "";';
2283 2372
 
2284
-	foreach ($context['level_effects'] as $limit => $text)
2285
-		echo '
2373
+	foreach ($context['level_effects'] as $limit => $text) {
2374
+			echo '
2286 2375
 			if (slideAmount >= ', $limit, ')
2287 2376
 				effectText = "', $text, '";';
2377
+	}
2288 2378
 
2289 2379
 	echo '
2290 2380
 			setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\');
@@ -2299,31 +2389,34 @@  discard block
 block discarded – undo
2299 2389
 			</h3>
2300 2390
 		</div>';
2301 2391
 
2302
-	if (!$context['user']['is_owner'])
2303
-		echo '
2392
+	if (!$context['user']['is_owner']) {
2393
+			echo '
2304 2394
 		<p class="information">', $txt['profile_warning_desc'], '</p>';
2395
+	}
2305 2396
 
2306 2397
 	echo '
2307 2398
 		<div class="windowbg">
2308 2399
 			<dl class="settings">';
2309 2400
 
2310
-	if (!$context['user']['is_owner'])
2311
-		echo '
2401
+	if (!$context['user']['is_owner']) {
2402
+			echo '
2312 2403
 				<dt>
2313 2404
 					<strong>', $txt['profile_warning_name'], ':</strong>
2314 2405
 				</dt>
2315 2406
 				<dd>
2316 2407
 					<strong>', $context['member']['name'], '</strong>
2317 2408
 				</dd>';
2409
+	}
2318 2410
 
2319 2411
 	echo '
2320 2412
 				<dt>
2321 2413
 					<strong>', $txt['profile_warning_level'], ':</strong>';
2322 2414
 
2323 2415
 	// Is there only so much they can apply?
2324
-	if ($context['warning_limit'])
2325
-		echo '
2416
+	if ($context['warning_limit']) {
2417
+			echo '
2326 2418
 					<br><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
2419
+	}
2327 2420
 
2328 2421
 	echo '
2329 2422
 				</dt>
@@ -2376,9 +2469,10 @@  discard block
 block discarded – undo
2376 2469
 						<option value="-1">', $txt['profile_warning_notify_template'], '</option>
2377 2470
 						<option value="-1" disabled>------------------------------</option>';
2378 2471
 
2379
-		foreach ($context['notification_templates'] as $id_template => $template)
2380
-			echo '
2472
+		foreach ($context['notification_templates'] as $id_template => $template) {
2473
+					echo '
2381 2474
 						<option value="', $id_template, '">', $template['title'], '</option>';
2475
+		}
2382 2476
 
2383 2477
 		echo '
2384 2478
 					</select>
@@ -2390,9 +2484,10 @@  discard block
 block discarded – undo
2390 2484
 			</dl>
2391 2485
 			<div class="righttext">';
2392 2486
 
2393
-	if (!empty($context['token_check']))
2394
-		echo '
2487
+	if (!empty($context['token_check'])) {
2488
+			echo '
2395 2489
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2490
+	}
2396 2491
 
2397 2492
 	echo '
2398 2493
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2408,8 +2503,8 @@  discard block
 block discarded – undo
2408 2503
 	echo '
2409 2504
 	<script>';
2410 2505
 
2411
-	if (!$context['user']['is_owner'])
2412
-		echo '
2506
+	if (!$context['user']['is_owner']) {
2507
+			echo '
2413 2508
 		modifyWarnNotify();
2414 2509
 		$(document).ready(function() {
2415 2510
 			$("#preview_button").click(function() {
@@ -2448,6 +2543,7 @@  discard block
 block discarded – undo
2448 2543
 			});
2449 2544
 			return false;
2450 2545
 		}';
2546
+	}
2451 2547
 
2452 2548
 	echo '
2453 2549
 	</script>';
@@ -2470,16 +2566,18 @@  discard block
 block discarded – undo
2470 2566
 			</div>';
2471 2567
 
2472 2568
 	// If deleting another account give them a lovely info box.
2473
-	if (!$context['user']['is_owner'])
2474
-		echo '
2569
+	if (!$context['user']['is_owner']) {
2570
+			echo '
2475 2571
 			<p class="information">', $txt['deleteAccount_desc'], '</p>';
2572
+	}
2476 2573
 	echo '
2477 2574
 			<div class="windowbg2">';
2478 2575
 
2479 2576
 	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
2480
-	if ($context['needs_approval'])
2481
-		echo '
2577
+	if ($context['needs_approval']) {
2578
+			echo '
2482 2579
 				<div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
2580
+	}
2483 2581
 
2484 2582
 	// If the user is deleting their own account warn them first - and require a password!
2485 2583
 	if ($context['user']['is_owner'])
@@ -2491,9 +2589,10 @@  discard block
 block discarded – undo
2491 2589
 					<input type="password" name="oldpasswrd" size="20" class="input_password">&nbsp;&nbsp;&nbsp;&nbsp;
2492 2590
 					<input type="submit" value="', $txt['yes'], '" class="button_submit">';
2493 2591
 
2494
-		if (!empty($context['token_check']))
2495
-			echo '
2592
+		if (!empty($context['token_check'])) {
2593
+					echo '
2496 2594
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2595
+		}
2497 2596
 
2498 2597
 		echo '
2499 2598
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2519,9 +2618,10 @@  discard block
 block discarded – undo
2519 2618
 						<option value="topics">', $txt['deleteAccount_topics'], '</option>
2520 2619
 					</select>';
2521 2620
 
2522
-			if ($context['show_perma_delete'])
2523
-				echo '
2621
+			if ($context['show_perma_delete']) {
2622
+							echo '
2524 2623
 					<br><label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1" class="input_check">', $txt['deleteAccount_permanent'], ':</label>';
2624
+			}
2525 2625
 
2526 2626
 			echo '
2527 2627
 				</div>';
@@ -2534,9 +2634,10 @@  discard block
 block discarded – undo
2534 2634
 				<div>
2535 2635
 					<input type="submit" value="', $txt['delete'], '" class="button_submit">';
2536 2636
 
2537
-		if (!empty($context['token_check']))
2538
-			echo '
2637
+		if (!empty($context['token_check'])) {
2638
+					echo '
2539 2639
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2640
+		}
2540 2641
 
2541 2642
 		echo '
2542 2643
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2562,8 +2663,8 @@  discard block
 block discarded – undo
2562 2663
 					<hr>';
2563 2664
 
2564 2665
 	// Only show the password box if it's actually needed.
2565
-	if ($context['require_password'])
2566
-		echo '
2666
+	if ($context['require_password']) {
2667
+			echo '
2567 2668
 					<dl class="settings">
2568 2669
 						<dt>
2569 2670
 							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br>
@@ -2573,13 +2674,15 @@  discard block
 block discarded – undo
2573 2674
 							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password">
2574 2675
 						</dd>
2575 2676
 					</dl>';
2677
+	}
2576 2678
 
2577 2679
 	echo '
2578 2680
 					<div class="righttext">';
2579 2681
 
2580
-		if (!empty($context['token_check']))
2581
-			echo '
2682
+		if (!empty($context['token_check'])) {
2683
+					echo '
2582 2684
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2685
+		}
2583 2686
 
2584 2687
 	echo '
2585 2688
 						<input type="submit" value="', $txt['change_profile'], '" class="button_submit">
@@ -2606,9 +2709,10 @@  discard block
 block discarded – undo
2606 2709
 			<ul id="list_errors">';
2607 2710
 
2608 2711
 		// Cycle through each error and display an error message.
2609
-		foreach ($context['post_errors'] as $error)
2610
-			echo '
2712
+		foreach ($context['post_errors'] as $error) {
2713
+					echo '
2611 2714
 				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
2715
+		}
2612 2716
 
2613 2717
 		echo '
2614 2718
 			</ul>';
@@ -2634,12 +2738,13 @@  discard block
 block discarded – undo
2634 2738
 								<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;"' : ''), '>';
2635 2739
 
2636 2740
 		// Fill the select box with all primary member groups that can be assigned to a member.
2637
-		foreach ($context['member_groups'] as $member_group)
2638
-			if (!empty($member_group['can_be_primary']))
2741
+		foreach ($context['member_groups'] as $member_group) {
2742
+					if (!empty($member_group['can_be_primary']))
2639 2743
 				echo '
2640 2744
 									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '>
2641 2745
 										', $member_group['name'], '
2642 2746
 									</option>';
2747
+		}
2643 2748
 		echo '
2644 2749
 								</select>
2645 2750
 							</dd>
@@ -2651,10 +2756,11 @@  discard block
 block discarded – undo
2651 2756
 									<input type="hidden" name="additional_groups[]" value="0">';
2652 2757
 
2653 2758
 		// For each membergroup show a checkbox so members can be assigned to more than one group.
2654
-		foreach ($context['member_groups'] as $member_group)
2655
-			if ($member_group['can_be_additional'])
2759
+		foreach ($context['member_groups'] as $member_group) {
2760
+					if ($member_group['can_be_additional'])
2656 2761
 				echo '
2657 2762
 									<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' : '', ' class="input_check"> ', $member_group['name'], '</label><br>';
2763
+		}
2658 2764
 		echo '
2659 2765
 								</span>
2660 2766
 								<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>
@@ -2714,9 +2820,10 @@  discard block
 block discarded – undo
2714 2820
 								<span class="smalltext">', $txt['sig_info'], '</span><br>
2715 2821
 								<br>';
2716 2822
 
2717
-	if ($context['show_spellchecking'])
2718
-		echo '
2823
+	if ($context['show_spellchecking']) {
2824
+			echo '
2719 2825
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button_submit">';
2826
+	}
2720 2827
 
2721 2828
 		echo '
2722 2829
 							</dt>
@@ -2724,17 +2831,20 @@  discard block
 block discarded – undo
2724 2831
 								<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>';
2725 2832
 
2726 2833
 	// If there is a limit at all!
2727
-	if (!empty($context['signature_limits']['max_length']))
2728
-		echo '
2834
+	if (!empty($context['signature_limits']['max_length'])) {
2835
+			echo '
2729 2836
 								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>';
2837
+	}
2730 2838
 
2731
-	if (!empty($context['show_preview_button']))
2732
-		echo '
2839
+	if (!empty($context['show_preview_button'])) {
2840
+			echo '
2733 2841
 								<input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button_submit">';
2842
+	}
2734 2843
 
2735
-	if ($context['signature_warning'])
2736
-		echo '
2844
+	if ($context['signature_warning']) {
2845
+			echo '
2737 2846
 								<span class="smalltext">', $context['signature_warning'], '</span>';
2847
+	}
2738 2848
 
2739 2849
 	// Some javascript used to count how many characters have been used so far in the signature.
2740 2850
 	echo '
@@ -2778,9 +2888,10 @@  discard block
 block discarded – undo
2778 2888
 									<div>
2779 2889
 										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
2780 2890
 		// This lists all the file categories.
2781
-		foreach ($context['avatars'] as $avatar)
2782
-			echo '
2891
+		foreach ($context['avatars'] as $avatar) {
2892
+					echo '
2783 2893
 											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>';
2894
+		}
2784 2895
 		echo '
2785 2896
 										</select>
2786 2897
 									</div>
@@ -2835,16 +2946,17 @@  discard block
 block discarded – undo
2835 2946
 								<div id="avatar_gravatar">
2836 2947
 									<img src="' . $context['member']['avatar']['href'] . '" alt="" />';
2837 2948
 
2838
-		if (empty($modSettings['gravatarAllowExtraEmail']))
2839
-			echo '
2949
+		if (empty($modSettings['gravatarAllowExtraEmail'])) {
2950
+					echo '
2840 2951
 									<div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>';
2841
-		else
2952
+		} else
2842 2953
 		{
2843 2954
 			// Depending on other stuff, the stored value here might have some odd things in it from other areas.
2844
-			if ($context['member']['avatar']['external'] == $context['member']['email'])
2845
-				$textbox_value = '';
2846
-			else
2847
-				$textbox_value = $context['member']['avatar']['external'];
2955
+			if ($context['member']['avatar']['external'] == $context['member']['email']) {
2956
+							$textbox_value = '';
2957
+			} else {
2958
+							$textbox_value = $context['member']['avatar']['external'];
2959
+			}
2848 2960
 
2849 2961
 			echo '
2850 2962
 									<div class="smalltext">', $txt['gravatar_alternateEmail'], '</div>
@@ -2916,8 +3028,9 @@  discard block
 block discarded – undo
2916 3028
 	$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
2917 3029
 
2918 3030
 	$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
2919
-	if (empty($suffix))
2920
-		return;
3031
+	if (empty($suffix)) {
3032
+			return;
3033
+	}
2921 3034
 
2922 3035
 	echo '
2923 3036
 									<div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>';
@@ -2939,9 +3052,10 @@  discard block
 block discarded – undo
2939 3052
 							<dd>
2940 3053
 								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
2941 3054
 	// Help the user by showing a list of common time formats.
2942
-	foreach ($context['easy_timeformats'] as $time_format)
2943
-		echo '
3055
+	foreach ($context['easy_timeformats'] as $time_format) {
3056
+			echo '
2944 3057
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3058
+	}
2945 3059
 	echo '
2946 3060
 								</select><br>
2947 3061
 								<input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30" class="input_text">
@@ -2977,9 +3091,10 @@  discard block
 block discarded – undo
2977 3091
 							</dt>
2978 3092
 							<dd>
2979 3093
 								<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\';">';
2980
-	foreach ($context['smiley_sets'] as $set)
2981
-		echo '
3094
+	foreach ($context['smiley_sets'] as $set) {
3095
+			echo '
2982 3096
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>';
3097
+	}
2983 3098
 	echo '
2984 3099
 								</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;">
2985 3100
 							</dd>';
@@ -3030,10 +3145,11 @@  discard block
 block discarded – undo
3030 3145
 									</div>
3031 3146
 									<div class="clear"></div>';
3032 3147
 
3033
-	if (!empty($context['from_ajax']))
3034
-		echo '
3148
+	if (!empty($context['from_ajax'])) {
3149
+			echo '
3035 3150
 									<br>
3036 3151
 									<a href="javascript:self.close();"></a>';
3152
+	}
3037 3153
 
3038 3154
 	echo '
3039 3155
 								</div>
@@ -3072,15 +3188,16 @@  discard block
 block discarded – undo
3072 3188
 								<br /><div class="smalltext">', $txt['tfa_profile_desc'], '</div>
3073 3189
 							</dt>
3074 3190
 							<dd>';
3075
-	if (!$context['tfa_enabled'] && $context['user']['is_owner'])
3076
-		echo '
3191
+	if (!$context['tfa_enabled'] && $context['user']['is_owner']) {
3192
+			echo '
3077 3193
 								<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>';
3078
-	elseif (!$context['tfa_enabled'])
3079
-		echo '
3194
+	} elseif (!$context['tfa_enabled']) {
3195
+			echo '
3080 3196
 								', $txt['tfa_profile_disabled'];
3081
-	else
3082
-		echo '
3197
+	} else {
3198
+			echo '
3083 3199
 							', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable');
3200
+	}
3084 3201
 	echo '
3085 3202
 							</dd>';
3086 3203
 }
Please login to merge, or discard this patch.
Themes/default/Themes.template.php 1 patch
Braces   +103 added lines, -80 removed lines patch added patch discarded remove patch
@@ -54,9 +54,10 @@  discard block
 block discarded – undo
54 54
 					<dd>
55 55
 						<div id="known_themes_list">';
56 56
 
57
-	foreach ($context['themes'] as $theme)
58
-		echo '
57
+	foreach ($context['themes'] as $theme) {
58
+			echo '
59 59
 							<label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>';
60
+	}
60 61
 
61 62
 		echo '
62 63
 						</div>
@@ -73,9 +74,10 @@  discard block
 block discarded – undo
73 74
 						<select name="options[theme_guests]" id="theme_guests">';
74 75
 
75 76
 	// Put an option for each theme in the select box.
76
-	foreach ($context['themes'] as $theme)
77
-		echo '
77
+	foreach ($context['themes'] as $theme) {
78
+			echo '
78 79
 							<option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';
80
+	}
79 81
 
80 82
 	echo '
81 83
 						</select>
@@ -90,9 +92,10 @@  discard block
 block discarded – undo
90 92
 							<option value="0">', $txt['theme_forum_default'], '</option>';
91 93
 
92 94
 	// Same thing, this time for changing the theme of everyone.
93
-	foreach ($context['themes'] as $theme)
94
-		echo '
95
+	foreach ($context['themes'] as $theme) {
96
+			echo '
95 97
 							<option value="', $theme['id'], '">', $theme['name'], '</option>';
98
+	}
96 99
 
97 100
 	echo '
98 101
 						</select>
@@ -189,11 +192,12 @@  discard block
 block discarded – undo
189 192
 	global $context, $scripturl, $txt;
190 193
 
191 194
 	// Show a nice confirmation message.
192
-	if (isset($_GET['done']))
193
-		echo '
195
+	if (isset($_GET['done'])) {
196
+			echo '
194 197
 	<div class="infobox">
195 198
 		', $txt['theme_confirmed_' . $_GET['done']], '
196 199
 	</div>';
200
+	}
197 201
 
198 202
 	echo '
199 203
 	<div id="admincenter">';
@@ -356,11 +360,12 @@  discard block
 block discarded – undo
356 360
 		if (empty($setting) || !is_array($setting))
357 361
 		{
358 362
 			// Insert a separator (unless this is the first item in the list)
359
-			if ($i !== $first_option_key)
360
-				echo '
363
+			if ($i !== $first_option_key) {
364
+							echo '
361 365
 				</dl>
362 366
 				<hr>
363 367
 				<dl class="settings">';
368
+			}
364 369
 
365 370
 			// Should we give a name to this section?
366 371
 			if (is_string($setting) && !empty($setting))
@@ -368,9 +373,9 @@  discard block
 block discarded – undo
368 373
 				$titled_section = true;
369 374
 				echo '
370 375
 					<dt><b>' . $setting . '</b></dt><dd></dd>';
376
+			} else {
377
+							$titled_section = false;
371 378
 			}
372
-			else
373
-				$titled_section = false;
374 379
 
375 380
 			continue;
376 381
 		}
@@ -379,19 +384,21 @@  discard block
 block discarded – undo
379 384
 					<dt ', $context['theme_options_reset'] ? 'style="width:50%"' : '', '>';
380 385
 
381 386
 		// Show the change option box ?
382
-		if ($context['theme_options_reset'])
383
-			echo '
387
+		if ($context['theme_options_reset']) {
388
+					echo '
384 389
 						<span class="floatleft"><select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;">
385 390
 							<option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option>
386 391
 							<option value="1">', $txt['themeadmin_reset_options_change'], '</option>
387 392
 							<option value="2">', $txt['themeadmin_reset_options_default'], '</option>
388 393
 						</select>&nbsp;</span>';
394
+		}
389 395
 
390 396
 		echo '
391 397
 						<label for="options_', $setting['id'], '">', !$titled_section ? '<b>' : '', $setting['label'], !$titled_section ? '</b>' : '', '</label>';
392
-		if (isset($setting['description']))
393
-			echo '
398
+		if (isset($setting['description'])) {
399
+					echo '
394 400
 						<br><span class="smalltext">', $setting['description'], '</span>';
401
+		}
395 402
 		echo '
396 403
 					</dt>';
397 404
 
@@ -433,13 +440,11 @@  discard block
 block discarded – undo
433 440
 
434 441
 				echo '
435 442
 						<input type="number"', $min . $max . $step;
436
-			}
437
-			else if (isset($setting['type']) && $setting['type'] == 'url')
443
+			} else if (isset($setting['type']) && $setting['type'] == 'url')
438 444
 			{
439 445
 				echo'
440 446
 						<input type="url"';
441
-			}
442
-			else
447
+			} else
443 448
 			{
444 449
 				echo '
445 450
 						<input type="text"';
@@ -483,8 +488,8 @@  discard block
 block discarded – undo
483 488
 			<br>';
484 489
 
485 490
 	// @todo Why can't I edit the default theme popup.
486
-	if ($context['theme_settings']['theme_id'] != 1)
487
-		echo '
491
+	if ($context['theme_settings']['theme_id'] != 1) {
492
+			echo '
488 493
 			<div class="cat_bar">
489 494
 				<h3 class="catbg config_hd">
490 495
 					', $txt['theme_edit'], '
@@ -500,6 +505,7 @@  discard block
 block discarded – undo
500 505
 					</li>
501 506
 				</ul>
502 507
 			</div>';
508
+	}
503 509
 
504 510
 	echo '
505 511
 			<div class="cat_bar">
@@ -553,9 +559,10 @@  discard block
 block discarded – undo
553 559
 					<dd>
554 560
 						<select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">';
555 561
 
556
-		foreach ($context['theme_variants'] as $key => $variant)
557
-			echo '
562
+		foreach ($context['theme_variants'] as $key => $variant) {
563
+					echo '
558 564
 							<option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>';
565
+		}
559 566
 
560 567
 		echo '
561 568
 						</select>
@@ -590,11 +597,12 @@  discard block
 block discarded – undo
590 597
 		if (empty($setting) || !is_array($setting))
591 598
 		{
592 599
 			// We don't need a separator before the first list element
593
-			if ($i !== $first_setting_key)
594
-				echo '
600
+			if ($i !== $first_setting_key) {
601
+							echo '
595 602
 				</dl>
596 603
 				<hr>
597 604
 				<dl class="settings">';
605
+			}
598 606
 
599 607
 			// Add a fake heading?
600 608
 			if (is_string($setting) && !empty($setting))
@@ -602,9 +610,9 @@  discard block
 block discarded – undo
602 610
 				$titled_section = true;
603 611
 				echo '
604 612
 					<dt><b>' . $setting . '</b></dt><dd></dd>';
613
+			} else {
614
+							$titled_section = false;
605 615
 			}
606
-			else
607
-				$titled_section = false;
608 616
 
609 617
 			continue;
610 618
 		}
@@ -613,9 +621,10 @@  discard block
 block discarded – undo
613 621
 					<dt>
614 622
 						<label for="', $setting['id'], '">', !$titled_section ? '<b>' : '', $setting['label'], !$titled_section ? '</b>' : '', '</label>:';
615 623
 
616
-		if (isset($setting['description']))
617
-			echo '<br>
624
+		if (isset($setting['description'])) {
625
+					echo '<br>
618 626
 						<span class="smalltext">', $setting['description'], '</span>';
627
+		}
619 628
 
620 629
 		echo '
621 630
 					</dt>';
@@ -636,9 +645,10 @@  discard block
 block discarded – undo
636 645
 					<dd>
637 646
 						<select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">';
638 647
 
639
-			foreach ($setting['options'] as $value => $label)
640
-				echo '
648
+			foreach ($setting['options'] as $value => $label) {
649
+							echo '
641 650
 							<option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>';
651
+			}
642 652
 
643 653
 			echo '
644 654
 						</select>
@@ -667,13 +677,11 @@  discard block
 block discarded – undo
667 677
 
668 678
 				echo '
669 679
 						<input type="number"', $min . $max . $step;
670
-			}
671
-			else if (isset($setting['type']) && $setting['type'] == 'url')
680
+			} else if (isset($setting['type']) && $setting['type'] == 'url')
672 681
 			{
673 682
 				echo'
674 683
 						<input type="url"';
675
-			}
676
-			else
684
+			} else
677 685
 			{
678 686
 				echo '
679 687
 						<input type="text"';
@@ -826,21 +834,23 @@  discard block
 block discarded – undo
826 834
 		<div class="windowbg">';
827 835
 
828 836
 	// Oops! there was an error :(
829
-	if (!empty($context['error_message']))
830
-		echo '
837
+	if (!empty($context['error_message'])) {
838
+			echo '
831 839
 			<p>
832 840
 				', $context['error_message'], '
833 841
 			</p>';
842
+	}
834 843
 
835 844
 	// Not much to show except a link back...
836
-	else
837
-		echo '
845
+	else {
846
+			echo '
838 847
 			<p>
839 848
 				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], '
840 849
 			</p>
841 850
 			<p>
842 851
 				<a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a>
843 852
 			</p>';
853
+	}
844 854
 
845 855
 	echo '
846 856
 		</div>
@@ -907,10 +917,11 @@  discard block
 block discarded – undo
907 917
 					<span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span>
908 918
 					<span class="floatright">';
909 919
 
910
-		if ($template['can_copy'])
911
-			echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
912
-		else
913
-			echo $txt['themeadmin_edit_no_copy'];
920
+		if ($template['can_copy']) {
921
+					echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
922
+		} else {
923
+					echo $txt['themeadmin_edit_no_copy'];
924
+		}
914 925
 
915 926
 		echo '
916 927
 					</span>
@@ -933,11 +944,12 @@  discard block
 block discarded – undo
933 944
 	echo '
934 945
 	<div id="admincenter">';
935 946
 
936
-	if (!empty($context['browse_title']))
937
-		echo '
947
+	if (!empty($context['browse_title'])) {
948
+			echo '
938 949
 		<div class="cat_bar">
939 950
 			<h3 class="catbg">', $context['browse_title'], '</h3>
940 951
 		</div>';
952
+	}
941 953
 
942 954
 	echo '
943 955
 		<table class="table_grid tborder">
@@ -957,14 +969,13 @@  discard block
 block discarded – undo
957 969
 			<tr class="windowbg">
958 970
 				<td>';
959 971
 
960
-		if ($file['is_editable'])
961
-			echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
962
-
963
-		elseif ($file['is_directory'])
964
-			echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
965
-
966
-		else
967
-			echo $file['filename'];
972
+		if ($file['is_editable']) {
973
+					echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
974
+		} elseif ($file['is_directory']) {
975
+					echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
976
+		} else {
977
+					echo $file['filename'];
978
+		}
968 979
 
969 980
 		echo '
970 981
 				</td>
@@ -986,11 +997,12 @@  discard block
 block discarded – undo
986 997
 {
987 998
 	global $context, $settings, $scripturl, $txt;
988 999
 
989
-	if ($context['session_error'])
990
-		echo '
1000
+	if ($context['session_error']) {
1001
+			echo '
991 1002
 	<div class="errorbox">
992 1003
 		', $txt['error_session_timeout'], '
993 1004
 	</div>';
1005
+	}
994 1006
 
995 1007
 	// From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com.
996 1008
 	echo '
@@ -1053,17 +1065,18 @@  discard block
 block discarded – undo
1053 1065
 					try
1054 1066
 					{
1055 1067
 					';
1056
-	if (isBrowser('is_ie'))
1057
-		echo '
1068
+	if (isBrowser('is_ie')) {
1069
+			echo '
1058 1070
 						var sheets = frames["css_preview_box"].document.styleSheets;
1059 1071
 						for (var j = 0; j < sheets.length; j++)
1060 1072
 						{
1061 1073
 							if (sheets[j].id == "css_preview_box")
1062 1074
 								sheets[j].cssText = document.forms.stylesheetForm.entire_file.value;
1063 1075
 						}';
1064
-	else
1065
-		echo '
1076
+	} else {
1077
+			echo '
1066 1078
 						setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);';
1079
+	}
1067 1080
 	echo '
1068 1081
 					}
1069 1082
 					catch (e)
@@ -1115,9 +1128,10 @@  discard block
 block discarded – undo
1115 1128
 			</div>
1116 1129
 			<div class="windowbg">';
1117 1130
 
1118
-	if (!$context['allow_save'])
1119
-		echo '
1131
+	if (!$context['allow_save']) {
1132
+			echo '
1120 1133
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1134
+	}
1121 1135
 
1122 1136
 	echo '
1123 1137
 				<textarea name="entire_file" cols="80" rows="20" style="width: 96%; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br>
@@ -1130,9 +1144,10 @@  discard block
 block discarded – undo
1130 1144
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1131 1145
 
1132 1146
 	// Hopefully it exists.
1133
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1134
-		echo '
1147
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1148
+			echo '
1135 1149
 			<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1150
+	}
1136 1151
 
1137 1152
 	echo '
1138 1153
 		</form>
@@ -1146,18 +1161,20 @@  discard block
 block discarded – undo
1146 1161
 {
1147 1162
 	global $context, $scripturl, $txt;
1148 1163
 
1149
-	if ($context['session_error'])
1150
-		echo '
1164
+	if ($context['session_error']) {
1165
+			echo '
1151 1166
 	<div class="errorbox">
1152 1167
 		', $txt['error_session_timeout'], '
1153 1168
 	</div>';
1169
+	}
1154 1170
 
1155
-	if (isset($context['parse_error']))
1156
-		echo '
1171
+	if (isset($context['parse_error'])) {
1172
+			echo '
1157 1173
 	<div class="errorbox">
1158 1174
 		', $txt['themeadmin_edit_error'], '
1159 1175
 			<div><pre>', $context['parse_error'], '</pre></div>
1160 1176
 	</div>';
1177
+	}
1161 1178
 
1162 1179
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1163 1180
 	echo '
@@ -1168,16 +1185,18 @@  discard block
 block discarded – undo
1168 1185
 			</div>
1169 1186
 			<div class="windowbg">';
1170 1187
 
1171
-	if (!$context['allow_save'])
1172
-		echo '
1188
+	if (!$context['allow_save']) {
1189
+			echo '
1173 1190
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1191
+	}
1174 1192
 
1175
-	foreach ($context['file_parts'] as $part)
1176
-		echo '
1193
+	foreach ($context['file_parts'] as $part) {
1194
+			echo '
1177 1195
 				<label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br>
1178 1196
 				<div class="centertext">
1179 1197
 					<textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1180 1198
 				</div>';
1199
+	}
1181 1200
 
1182 1201
 	echo '
1183 1202
 				<div class="padding righttext">
@@ -1186,9 +1205,10 @@  discard block
 block discarded – undo
1186 1205
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1187 1206
 
1188 1207
 	// Hopefully it exists.
1189
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1190
-		echo '
1208
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1209
+			echo '
1191 1210
 					<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1211
+	}
1192 1212
 
1193 1213
 	echo '
1194 1214
 				</div>
@@ -1204,18 +1224,20 @@  discard block
 block discarded – undo
1204 1224
 {
1205 1225
 	global $context, $scripturl, $txt;
1206 1226
 
1207
-	if ($context['session_error'])
1208
-		echo '
1227
+	if ($context['session_error']) {
1228
+			echo '
1209 1229
 	<div class="errorbox">
1210 1230
 		', $txt['error_session_timeout'], '
1211 1231
 	</div>';
1232
+	}
1212 1233
 
1213 1234
 	//Is this file writeable?
1214
-	if (!$context['allow_save'])
1215
-		echo '
1235
+	if (!$context['allow_save']) {
1236
+			echo '
1216 1237
 	<div class="errorbox">
1217 1238
 		', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '
1218 1239
 	</div>';
1240
+	}
1219 1241
 
1220 1242
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1221 1243
 	echo '
@@ -1231,9 +1253,10 @@  discard block
 block discarded – undo
1231 1253
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1232 1254
 
1233 1255
 	// Hopefully it exists.
1234
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1235
-		echo '
1256
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1257
+			echo '
1236 1258
 				<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1259
+	}
1237 1260
 
1238 1261
 	echo '
1239 1262
 			</div>
Please login to merge, or discard this patch.
Themes/default/PersonalMessage.template.php 1 patch
Braces   +262 added lines, -181 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 	<div id="personal_messages">';
22 22
 
23 23
 	// Show the capacity bar, if available.
24
-	if (!empty($context['limit_bar']))
25
-		echo '
24
+	if (!empty($context['limit_bar'])) {
25
+			echo '
26 26
 		<div class="cat_bar">
27 27
 			<h3 class="catbg">
28 28
 				<span class="floatleft">', $txt['pm_capacity'], ':</span>
@@ -32,14 +32,16 @@  discard block
 block discarded – undo
32 32
 				<span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span>
33 33
 			</h3>
34 34
 		</div>';
35
+	}
35 36
 
36 37
 	// Message sent? Show a small indication.
37
-	if (isset($context['pm_sent']))
38
-		echo '
38
+	if (isset($context['pm_sent'])) {
39
+			echo '
39 40
 		<div class="infobox">
40 41
 			', $txt['pm_sent'], '
41 42
 		</div>';
42
-}
43
+	}
44
+	}
43 45
 
44 46
 /**
45 47
  * Just the end of the index bar, nothing special.
@@ -72,8 +74,7 @@  discard block
 block discarded – undo
72 74
 	{
73 75
 		echo '
74 76
 			<div class="no_unread">', $txt['pm_no_unread'], '</div>';
75
-	}
76
-	else
77
+	} else
77 78
 	{
78 79
 		foreach ($context['unread_pms'] as $id_pm => $pm_details)
79 80
 		{
@@ -193,14 +194,15 @@  discard block
 block discarded – undo
193 194
 	if ($context['get_pmessage']('message', true))
194 195
 	{
195 196
 		// Show the helpful titlebar - generally.
196
-		if ($context['display_mode'] != 1)
197
-			echo '
197
+		if ($context['display_mode'] != 1) {
198
+					echo '
198 199
 				<div class="cat_bar">
199 200
 					<h3 class="catbg">
200 201
 						<span id="author">', $txt['author'], '</span>
201 202
 						<span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span>
202 203
 					</h3>
203 204
 				</div>';
205
+		}
204 206
 
205 207
 		// Show a few buttons if we are in conversation mode and outputting the first message.
206 208
 		if ($context['display_mode'] == 2)
@@ -229,9 +231,10 @@  discard block
 block discarded – undo
229 231
 			<div class="custom_fields_above_member">
230 232
 				<ul class="nolist">';
231 233
 
232
-			foreach ($message['custom_fields']['above_member'] as $custom)
233
-				echo '
234
+			foreach ($message['custom_fields']['above_member'] as $custom) {
235
+							echo '
234 236
 					<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
237
+			}
235 238
 
236 239
 			echo '
237 240
 				</ul>
@@ -243,9 +246,10 @@  discard block
 block discarded – undo
243 246
 				<a id="msg', $message['id'], '"></a>';
244 247
 
245 248
 		// Show online and offline buttons?
246
-		if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
247
-			echo '
249
+		if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
250
+					echo '
248 251
 				<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>';
252
+		}
249 253
 
250 254
 		// Show a link to the member's profile (but only if the sender isn't a guest).
251 255
 				echo '
@@ -258,48 +262,56 @@  discard block
 block discarded – undo
258 262
 			<ul class="user_info">';
259 263
 
260 264
 			// Show the user's avatar.
261
-			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
262
-				echo '
265
+			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
266
+							echo '
263 267
 				<li class="avatar">
264 268
 					<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a>
265 269
 				</li>';
270
+			}
266 271
 
267 272
 		// Are there any custom fields below the avatar?
268
-		if (!empty($message['custom_fields']['below_avatar']))
269
-			foreach ($message['custom_fields']['below_avatar'] as $custom)
273
+		if (!empty($message['custom_fields']['below_avatar'])) {
274
+					foreach ($message['custom_fields']['below_avatar'] as $custom)
270 275
 				echo '
271 276
 				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
277
+		}
272 278
 
273
-			if (!$message['member']['is_guest'])
274
-				echo '
279
+			if (!$message['member']['is_guest']) {
280
+							echo '
275 281
 				<li class="icons">', $message['member']['group_icons'], '</li>';
282
+			}
276 283
 			// Show the member's primary group (like 'Administrator') if they have one.
277
-			if (isset($message['member']['group']) && $message['member']['group'] != '')
278
-				echo '
284
+			if (isset($message['member']['group']) && $message['member']['group'] != '') {
285
+							echo '
279 286
 				<li class="membergroup">', $message['member']['group'], '</li>';
287
+			}
280 288
 
281 289
 			// Show the member's custom title, if they have one.
282
-			if (isset($message['member']['title']) && $message['member']['title'] != '')
283
-				echo '
290
+			if (isset($message['member']['title']) && $message['member']['title'] != '') {
291
+							echo '
284 292
 				<li class="title">', $message['member']['title'], '</li>';
293
+			}
285 294
 
286 295
 			// Don't show these things for guests.
287 296
 			if (!$message['member']['is_guest'])
288 297
 			{
289 298
 				// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
290
-				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
291
-					echo '
299
+				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') {
300
+									echo '
292 301
 				<li class="postgroup">', $message['member']['post_group'], '</li>';
302
+				}
293 303
 
294 304
 				// Show how many posts they have made.
295
-				if (!isset($context['disabled_fields']['posts']))
296
-					echo '
305
+				if (!isset($context['disabled_fields']['posts'])) {
306
+									echo '
297 307
 				<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
308
+				}
298 309
 
299 310
 				// Show their personal text?
300
-				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '')
301
-					echo '
311
+				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') {
312
+									echo '
302 313
 				<li class="blurb">', $message['member']['blurb'], '</li>';
314
+				}
303 315
 
304 316
 				// Any custom fields to show as icons?
305 317
 				if (!empty($message['custom_fields']['icons']))
@@ -308,9 +320,10 @@  discard block
 block discarded – undo
308 320
 				<li class="im_icons">
309 321
 					<ol>';
310 322
 
311
-					foreach ($message['custom_fields']['icons'] as $custom)
312
-						echo '
323
+					foreach ($message['custom_fields']['icons'] as $custom) {
324
+											echo '
313 325
 						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
326
+					}
314 327
 
315 328
 					echo '
316 329
 					</ol>
@@ -318,19 +331,22 @@  discard block
 block discarded – undo
318 331
 				}
319 332
 
320 333
 		// Show the IP to this user for this post - because you can moderate?
321
-		if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
322
-			echo '
334
+		if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
335
+					echo '
323 336
 				<li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>';
337
+		}
324 338
 
325 339
 		// Or, should we show it because this is you?
326
-		elseif ($message['can_see_ip'])
327
-			echo '
340
+		elseif ($message['can_see_ip']) {
341
+					echo '
328 342
 				<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>';
343
+		}
329 344
 
330 345
 		// Okay, you are logged in, then we can show something about why IPs are logged...
331
-		else
332
-			echo '
346
+		else {
347
+					echo '
333 348
 				<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
349
+		}
334 350
 
335 351
 				// Show the profile, website, email address, and personal message buttons.
336 352
 				if ($message['member']['show_profile_buttons'])
@@ -340,24 +356,28 @@  discard block
 block discarded – undo
340 356
 					<ol class="profile_icons">';
341 357
 
342 358
 					// Show the profile button
343
-					if ($message['member']['can_view_profile'])
344
-						echo '
359
+					if ($message['member']['can_view_profile']) {
360
+											echo '
345 361
 						<li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>';
362
+					}
346 363
 
347 364
 					// Don't show an icon if they haven't specified a website.
348
-					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
349
-						echo '
365
+					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) {
366
+											echo '
350 367
 						<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
368
+					}
351 369
 
352 370
 					// Don't show the email address if they want it hidden.
353
-					if ($message['member']['show_email'])
354
-						echo '
371
+					if ($message['member']['show_email']) {
372
+											echo '
355 373
 						<li><a href="mailto:', $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
374
+					}
356 375
 
357 376
 					// Since we know this person isn't a guest, you *can* message them.
358
-					if ($context['can_send_pm'])
359
-						echo '
377
+					if ($context['can_send_pm']) {
378
+											echo '
360 379
 						<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
380
+					}
361 381
 
362 382
 					echo '
363 383
 					</ol>
@@ -365,21 +385,24 @@  discard block
 block discarded – undo
365 385
 				}
366 386
 
367 387
 				// Any custom fields for standard placement?
368
-				if (!empty($message['custom_fields']['standard']))
369
-					foreach ($message['custom_fields']['standard'] as $custom)
388
+				if (!empty($message['custom_fields']['standard'])) {
389
+									foreach ($message['custom_fields']['standard'] as $custom)
370 390
 						echo '
371 391
 				<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
392
+				}
372 393
 
373 394
 				// Are we showing the warning status?
374
-				if ($message['member']['can_see_warning'])
375
-					echo '
395
+				if ($message['member']['can_see_warning']) {
396
+									echo '
376 397
 				<li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span>', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
398
+				}
377 399
 
378 400
 				// Are there any custom fields to show at the bottom of the poster info?
379
-				if (!empty($message['custom_fields']['bottom_poster']))
380
-					foreach ($message['custom_fields']['bottom_poster'] as $custom)
401
+				if (!empty($message['custom_fields']['bottom_poster'])) {
402
+									foreach ($message['custom_fields']['bottom_poster'] as $custom)
381 403
 						echo '
382 404
 				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
405
+				}
383 406
 			}
384 407
 
385 408
 			// Done with the information about the poster... on to the post itself.
@@ -398,24 +421,28 @@  discard block
 block discarded – undo
398 421
 					<span class="smalltext">&#171; <strong> ', $txt['sent_to'], ':</strong> ';
399 422
 
400 423
 			// People it was sent directly to....
401
-			if (!empty($message['recipients']['to']))
402
-				echo implode(', ', $message['recipients']['to']);
424
+			if (!empty($message['recipients']['to'])) {
425
+							echo implode(', ', $message['recipients']['to']);
426
+			}
403 427
 			// Otherwise, we're just going to say "some people"...
404
-			elseif ($context['folder'] != 'sent')
405
-				echo '(', $txt['pm_undisclosed_recipients'], ')';
428
+			elseif ($context['folder'] != 'sent') {
429
+							echo '(', $txt['pm_undisclosed_recipients'], ')';
430
+			}
406 431
 
407 432
 			echo '
408 433
 						<strong> ', $txt['on'], ':</strong> ', $message['time'], ' &#187;
409 434
 					</span>';
410 435
 
411 436
 			// If we're in the sent items, show who it was sent to besides the "To:" people.
412
-			if (!empty($message['recipients']['bcc']))
413
-				echo '
437
+			if (!empty($message['recipients']['bcc'])) {
438
+							echo '
414 439
 					<br><span class="smalltext">&#171; <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' &#187;</span>';
440
+			}
415 441
 
416
-			if (!empty($message['is_replied_to']))
417
-				echo '
442
+			if (!empty($message['is_replied_to'])) {
443
+							echo '
418 444
 					<br><span class="smalltext">&#171; ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' &#187;</span>';
445
+			}
419 446
 
420 447
 			echo '
421 448
 				</div>
@@ -423,13 +450,15 @@  discard block
 block discarded – undo
423 450
 			<div class="post">
424 451
 				<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>';
425 452
 
426
-			if ($message['can_report'] || $context['can_send_pm'])
427
-			echo '
453
+			if ($message['can_report'] || $context['can_send_pm']) {
454
+						echo '
428 455
 				<div class="under_message">';
456
+			}
429 457
 
430
-				if ($message['can_report'])
431
-				echo '
458
+				if ($message['can_report']) {
459
+								echo '
432 460
 					<a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>';
461
+				}
433 462
 
434 463
 				echo '
435 464
 					<ul class="quickbuttons">';
@@ -441,32 +470,36 @@  discard block
 block discarded – undo
441 470
 					if (!$message['member']['is_guest'])
442 471
 					{
443 472
 						// Is there than more than one recipient you can reply to?
444
-						if ($message['number_recipients'] > 1)
445
-							echo '
473
+						if ($message['number_recipients'] > 1) {
474
+													echo '
446 475
 						<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>';
476
+						}
447 477
 
448 478
 						echo '
449 479
 						<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>
450 480
 						<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
451 481
 					}
452 482
 					// This is for "forwarding" - even if the member is gone.
453
-					else
454
-						echo '
483
+					else {
484
+											echo '
455 485
 						<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>';
486
+					}
456 487
 				}
457 488
 				echo '
458 489
 						<li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>';
459 490
 
460
-				if (empty($context['display_mode']))
461
-					echo '
491
+				if (empty($context['display_mode'])) {
492
+									echo '
462 493
 						<li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;" class="input_check"></li>';
494
+				}
463 495
 
464 496
 				echo '
465 497
 					</ul>';
466 498
 
467
-			if ($message['can_report'] || $context['can_send_pm'])
468
-			echo '
499
+			if ($message['can_report'] || $context['can_send_pm']) {
500
+						echo '
469 501
 				</div>';
502
+			}
470 503
 
471 504
 			// Are there any custom profile fields for above the signature?
472 505
 			if (!empty($message['custom_fields']['above_signature']))
@@ -475,9 +508,10 @@  discard block
 block discarded – undo
475 508
 					<div class="custom_fields_above_signature">
476 509
 						<ul class="nolist">';
477 510
 
478
-				foreach ($message['custom_fields']['above_signature'] as $custom)
479
-					echo '
511
+				foreach ($message['custom_fields']['above_signature'] as $custom) {
512
+									echo '
480 513
 							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
514
+				}
481 515
 
482 516
 				echo '
483 517
 						</ul>
@@ -485,9 +519,10 @@  discard block
 block discarded – undo
485 519
 			}
486 520
 
487 521
 			// Show the member's signature?
488
-			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
489
-				echo '
522
+			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
523
+							echo '
490 524
 				<div class="signature">', $message['member']['signature'], '</div>';
525
+			}
491 526
 
492 527
 			// Are there any custom profile fields for below the signature?
493 528
 			if (!empty($message['custom_fields']['below_signature']))
@@ -496,9 +531,10 @@  discard block
 block discarded – undo
496 531
 					<div class="custom_fields_below_signature">
497 532
 						<ul class="nolist">';
498 533
 
499
-				foreach ($message['custom_fields']['below_signature'] as $custom)
500
-					echo '
534
+				foreach ($message['custom_fields']['below_signature'] as $custom) {
535
+									echo '
501 536
 							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
537
+				}
502 538
 
503 539
 				echo '
504 540
 						</ul>
@@ -523,19 +559,21 @@  discard block
 block discarded – undo
523 559
 					{
524 560
 						echo '
525 561
 						<option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>';
526
-						foreach ($context['labels'] as $label)
527
-							if (!isset($message['labels'][$label['id']]))
562
+						foreach ($context['labels'] as $label) {
563
+													if (!isset($message['labels'][$label['id']]))
528 564
 								echo '
529 565
 							<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
566
+						}
530 567
 					}
531 568
 					// ... and are there any that can be removed?
532 569
 					if (!empty($message['labels']) && (count($message['labels']) > 1 || !isset($message['labels'][-1])))
533 570
 					{
534 571
 						echo '
535 572
 						<option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>';
536
-						foreach ($message['labels'] as $label)
537
-							echo '
573
+						foreach ($message['labels'] as $label) {
574
+													echo '
538 575
 							<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
576
+						}
539 577
 					}
540 578
 					echo '
541 579
 					</select>
@@ -555,13 +593,14 @@  discard block
 block discarded – undo
555 593
 	</div>';
556 594
 		}
557 595
 
558
-		if (empty($context['display_mode']))
559
-			echo '
596
+		if (empty($context['display_mode'])) {
597
+					echo '
560 598
 
561 599
 	<div class="pagesection">
562 600
 		<div class="floatleft">', $context['page_index'], '</div>
563 601
 		<div class="floatright"><input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button_submit"></div>
564 602
 	</div>';
603
+		}
565 604
 
566 605
 		// Show a few buttons if we are in conversation mode and outputting the first message.
567 606
 		elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons']))
@@ -621,11 +660,12 @@  discard block
 block discarded – undo
621 660
 		</tr>
622 661
 	</thead>
623 662
 	<tbody>';
624
-	if (!$context['show_delete'])
625
-		echo '
663
+	if (!$context['show_delete']) {
664
+			echo '
626 665
 		<tr class="windowbg">
627 666
 			<td colspan="5">', $txt['pm_alert_none'], '</td>
628 667
 		</tr>';
668
+	}
629 669
 
630 670
 	while ($message = $context['get_pmessage']('subject'))
631 671
 	{
@@ -678,9 +718,10 @@  discard block
 block discarded – undo
678 718
 
679 719
 			foreach ($context['labels'] as $label)
680 720
 			{
681
-				if ($label['id'] != $context['current_label_id'])
682
-					echo '
721
+				if ($label['id'] != $context['current_label_id']) {
722
+									echo '
683 723
 					<option value="add_', $label['id'], '">&nbsp;', $label['name'], '</option>';
724
+				}
684 725
 			}
685 726
 
686 727
 			echo '
@@ -765,9 +806,10 @@  discard block
 block discarded – undo
765 806
 					<dt class="between">', $txt['pm_search_post_age'], ':</dt>
766 807
 					<dd>', $txt['pm_search_between'], ' <input type="number" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999">&nbsp;', $txt['pm_search_between_and'], '&nbsp;<input type="number" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd>
767 808
 				</dl>';
768
-	if (!$context['currently_using_labels'])
769
-		echo '
809
+	if (!$context['currently_using_labels']) {
810
+			echo '
770 811
 				<input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button_submit">';
812
+	}
771 813
 		echo '
772 814
 				<br class="clear_right">
773 815
 			</div>
@@ -787,12 +829,13 @@  discard block
 block discarded – undo
787 829
 				<div id="advanced_panel_div">
788 830
 					<ul id="searchLabelsExpand">';
789 831
 
790
-		foreach ($context['search_labels'] as $label)
791
-			echo '
832
+		foreach ($context['search_labels'] as $label) {
833
+					echo '
792 834
 						<li>
793 835
 							<label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', ' class="input_check">
794 836
 							', $label['name'], '</label>
795 837
 						</li>';
838
+		}
796 839
 
797 840
 		echo '
798 841
 					</ul>
@@ -852,8 +895,8 @@  discard block
 block discarded – undo
852 895
 		</div>';
853 896
 
854 897
 	// complete results ?
855
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
856
-		echo '
898
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
899
+			echo '
857 900
 	<table class="table_grid">
858 901
 	<thead>
859 902
 		<tr class="title_bar">
@@ -863,6 +906,7 @@  discard block
 block discarded – undo
863 906
 		</tr>
864 907
 	</thead>
865 908
 	<tbody>';
909
+	}
866 910
 
867 911
 	// Print each message out...
868 912
 	foreach ($context['personal_messages'] as $message)
@@ -882,11 +926,13 @@  discard block
 block discarded – undo
882 926
 
883 927
 				// Show the recipients.
884 928
 				// @todo This doesn't deal with the sent item searching quite right for bcc.
885
-				if (!empty($message['recipients']['to']))
886
-					echo implode(', ', $message['recipients']['to']);
929
+				if (!empty($message['recipients']['to'])) {
930
+									echo implode(', ', $message['recipients']['to']);
931
+				}
887 932
 				// Otherwise, we're just going to say "some people"...
888
-				elseif ($context['folder'] != 'sent')
889
-					echo '(', $txt['pm_undisclosed_recipients'], ')';
933
+				elseif ($context['folder'] != 'sent') {
934
+									echo '(', $txt['pm_undisclosed_recipients'], ')';
935
+				}
890 936
 
891 937
 					echo '
892 938
 				</h3>
@@ -900,14 +946,16 @@  discard block
 block discarded – undo
900 946
 					$quote_button = create_button('quote.png', 'reply_quote', 'reply_quote', 'class="centericon"');
901 947
 					$reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"');
902 948
 					// You can only reply if they are not a guest...
903
-					if (!$message['member']['is_guest'])
904
-						echo '
949
+					if (!$message['member']['is_guest']) {
950
+											echo '
905 951
 							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], '
906 952
 							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
953
+					}
907 954
 					// This is for "forwarding" - even if the member is gone.
908
-					else
909
-						echo '
955
+					else {
956
+											echo '
910 957
 							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator'];
958
+					}
911 959
 				}
912 960
 
913 961
 				echo '
@@ -928,17 +976,19 @@  discard block
 block discarded – undo
928 976
 	}
929 977
 
930 978
 	// Finish off the page...
931
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
932
-		echo '
979
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
980
+			echo '
933 981
 		</tbody>
934 982
 		</table>';
983
+	}
935 984
 
936 985
 	// No results?
937
-	if (empty($context['personal_messages']))
938
-		echo '
986
+	if (empty($context['personal_messages'])) {
987
+			echo '
939 988
 		<div class="windowbg">
940 989
 			<p class="centertext">', $txt['pm_search_none_found'], '</p>
941 990
 		</div>';
991
+	}
942 992
 
943 993
 	echo '
944 994
 		<div class="pagesection">
@@ -962,12 +1012,14 @@  discard block
 block discarded – undo
962 1012
 				<h3 class="catbg">', $txt['pm_send_report'], '</h3>
963 1013
 			</div>
964 1014
 			<div class="windowbg">';
965
-				if (!empty($context['send_log']['sent']))
966
-					foreach ($context['send_log']['sent'] as $log_entry)
1015
+				if (!empty($context['send_log']['sent'])) {
1016
+									foreach ($context['send_log']['sent'] as $log_entry)
967 1017
 						echo '<span class="error">', $log_entry, '</span><br>';
968
-				if (!empty($context['send_log']['failed']))
969
-					foreach ($context['send_log']['failed'] as $log_entry)
1018
+				}
1019
+				if (!empty($context['send_log']['failed'])) {
1020
+									foreach ($context['send_log']['failed'] as $log_entry)
970 1021
 						echo '<span class="error">', $log_entry, '</span><br>';
1022
+				}
971 1023
 				echo '
972 1024
 			</div>
973 1025
 			<br>';
@@ -1015,12 +1067,13 @@  discard block
 block discarded – undo
1015 1067
 				</dl>
1016 1068
 			</div>';
1017 1069
 
1018
-	if (!empty($modSettings['drafts_pm_enabled']))
1019
-		echo '
1070
+	if (!empty($modSettings['drafts_pm_enabled'])) {
1071
+			echo '
1020 1072
 			<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
1021 1073
 				sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), '
1022 1074
 				', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
1023 1075
 			</div>';
1076
+	}
1024 1077
 
1025 1078
 	echo '
1026 1079
 			<dl id="post_header">';
@@ -1075,9 +1128,10 @@  discard block
 block discarded – undo
1075 1128
 	}
1076 1129
 
1077 1130
 	// What about smileys?
1078
-	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
1079
-		echo '
1131
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) {
1132
+			echo '
1080 1133
 			<div id="smileyBox_message"></div>';
1134
+	}
1081 1135
 
1082 1136
 	// Show BBC buttons, smileys and textbox.
1083 1137
 	echo '
@@ -1124,10 +1178,11 @@  discard block
 block discarded – undo
1124 1178
 					<dt><strong>', $txt['subject'], '</strong></dt>
1125 1179
 					<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
1126 1180
 
1127
-		foreach ($context['drafts'] as $draft)
1128
-			echo '
1181
+		foreach ($context['drafts'] as $draft) {
1182
+					echo '
1129 1183
 					<dt>', $draft['link'], '</dt>
1130 1184
 					<dd>', $draft['poster_time'], '</dd>';
1185
+		}
1131 1186
 		echo '
1132 1187
 				</dl>
1133 1188
 			</div>';
@@ -1233,8 +1288,8 @@  discard block
 block discarded – undo
1233 1288
 			}';
1234 1289
 
1235 1290
 	// Code for showing and hiding drafts
1236
-	if (!empty($context['drafts']))
1237
-		echo '
1291
+	if (!empty($context['drafts'])) {
1292
+			echo '
1238 1293
 			var oSwapDraftOptions = new smc_Toggle({
1239 1294
 				bToggleEnabled: true,
1240 1295
 				bCurrentlyCollapsed: true,
@@ -1256,13 +1311,14 @@  discard block
 block discarded – undo
1256 1311
 					}
1257 1312
 				]
1258 1313
 			});';
1314
+	}
1259 1315
 
1260 1316
 	echo '
1261 1317
 		</script>';
1262 1318
 
1263 1319
 	// Show the message you're replying to.
1264
-	if ($context['reply'])
1265
-		echo '
1320
+	if ($context['reply']) {
1321
+			echo '
1266 1322
 	<br>
1267 1323
 	<br>
1268 1324
 	<div class="cat_bar">
@@ -1276,6 +1332,7 @@  discard block
 block discarded – undo
1276 1332
 		<hr>
1277 1333
 		', $context['quoted_message']['body'], '
1278 1334
 	</div><br class="clear">';
1335
+	}
1279 1336
 
1280 1337
 	echo '
1281 1338
 		<script>
@@ -1286,22 +1343,24 @@  discard block
 block discarded – undo
1286 1343
 				sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
1287 1344
 				sToControlId: \'to_control\',
1288 1345
 				aToRecipients: [';
1289
-	foreach ($context['recipients']['to'] as $i => $member)
1290
-		echo '
1346
+	foreach ($context['recipients']['to'] as $i => $member) {
1347
+			echo '
1291 1348
 					{
1292 1349
 						sItemId: ', JavaScriptEscape($member['id']), ',
1293 1350
 						sItemName: ', JavaScriptEscape($member['name']), '
1294 1351
 					}', $i == count($context['recipients']['to']) - 1 ? '' : ',';
1352
+	}
1295 1353
 
1296 1354
 	echo '
1297 1355
 				],
1298 1356
 				aBccRecipients: [';
1299
-	foreach ($context['recipients']['bcc'] as $i => $member)
1300
-		echo '
1357
+	foreach ($context['recipients']['bcc'] as $i => $member) {
1358
+			echo '
1301 1359
 					{
1302 1360
 						sItemId: ', JavaScriptEscape($member['id']), ',
1303 1361
 						sItemName: ', JavaScriptEscape($member['name']), '
1304 1362
 					}', $i == count($context['recipients']['bcc']) - 1 ? '' : ',';
1363
+	}
1305 1364
 
1306 1365
 	echo '
1307 1366
 				],
@@ -1388,26 +1447,28 @@  discard block
 block discarded – undo
1388 1447
 				</th>
1389 1448
 				<th class="centertext table_icon">';
1390 1449
 
1391
-	if (count($context['labels']) > 2)
1392
-		echo '
1450
+	if (count($context['labels']) > 2) {
1451
+			echo '
1393 1452
 					<input type="checkbox" class="input_check" onclick="invertAll(this, this.form);">';
1453
+	}
1394 1454
 
1395 1455
 	echo '
1396 1456
 				</th>
1397 1457
 			</tr>
1398 1458
 		</thead>
1399 1459
 		<tbody>';
1400
-	if (count($context['labels']) < 2)
1401
-		echo '
1460
+	if (count($context['labels']) < 2) {
1461
+			echo '
1402 1462
 			<tr class="windowbg">
1403 1463
 				<td colspan="2">', $txt['pm_labels_no_exist'], '</td>
1404 1464
 			</tr>';
1405
-	else
1465
+	} else
1406 1466
 	{
1407 1467
 		foreach ($context['labels'] as $label)
1408 1468
 		{
1409
-			if ($label['id'] == -1)
1410
-				continue;
1469
+			if ($label['id'] == -1) {
1470
+							continue;
1471
+			}
1411 1472
 
1412 1473
 				echo '
1413 1474
 			<tr class="windowbg">
@@ -1422,12 +1483,13 @@  discard block
 block discarded – undo
1422 1483
 		</tbody>
1423 1484
 		</table>';
1424 1485
 
1425
-	if (!count($context['labels']) < 2)
1426
-		echo '
1486
+	if (!count($context['labels']) < 2) {
1487
+			echo '
1427 1488
 		<div class="padding">
1428 1489
 			<input type="submit" name="save" value="', $txt['save'], '" class="button_submit">
1429 1490
 			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button_submit you_sure">
1430 1491
 		</div>';
1492
+	}
1431 1493
 
1432 1494
 	echo '
1433 1495
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1482,9 +1544,10 @@  discard block
 block discarded – undo
1482 1544
 				<dd>
1483 1545
 					<select name="id_admin">
1484 1546
 						<option value="0">', $txt['pm_report_all_admins'], '</option>';
1485
-		foreach ($context['admins'] as $id => $name)
1486
-			echo '
1547
+		foreach ($context['admins'] as $id => $name) {
1548
+					echo '
1487 1549
 						<option value="', $id, '">', $name, '</option>';
1550
+		}
1488 1551
 		echo '
1489 1552
 					</select>
1490 1553
 				</dd>';
@@ -1546,9 +1609,10 @@  discard block
 block discarded – undo
1546 1609
 				</th>
1547 1610
 				<th class="centertext table_icon">';
1548 1611
 
1549
-	if (!empty($context['rules']))
1550
-		echo '
1612
+	if (!empty($context['rules'])) {
1613
+			echo '
1551 1614
 					<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check">';
1615
+	}
1552 1616
 
1553 1617
 	echo '
1554 1618
 				</th>
@@ -1556,13 +1620,14 @@  discard block
 block discarded – undo
1556 1620
 		</thead>
1557 1621
 		<tbody>';
1558 1622
 
1559
-	if (empty($context['rules']))
1560
-		echo '
1623
+	if (empty($context['rules'])) {
1624
+			echo '
1561 1625
 			<tr class="windowbg">
1562 1626
 				<td colspan="2">
1563 1627
 					', $txt['pm_rules_none'], '
1564 1628
 				</td>
1565 1629
 			</tr>';
1630
+	}
1566 1631
 
1567 1632
 	foreach ($context['rules'] as $rule)
1568 1633
 	{
@@ -1583,14 +1648,16 @@  discard block
 block discarded – undo
1583 1648
 		<div class="righttext">
1584 1649
 			<a class="button_link" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>';
1585 1650
 
1586
-	if (!empty($context['rules']))
1587
-		echo '
1651
+	if (!empty($context['rules'])) {
1652
+			echo '
1588 1653
 			[<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]';
1654
+	}
1589 1655
 
1590
-	if (!empty($context['rules']))
1591
-		echo '
1656
+	if (!empty($context['rules'])) {
1657
+			echo '
1592 1658
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1593 1659
 			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button_submit smalltext you_sure">';
1660
+	}
1594 1661
 
1595 1662
 	echo '
1596 1663
 		</div>
@@ -1612,14 +1679,16 @@  discard block
 block discarded – undo
1612 1679
 			var groups = new Array()
1613 1680
 			var labels = new Array()';
1614 1681
 
1615
-	foreach ($context['groups'] as $id => $title)
1616
-		echo '
1682
+	foreach ($context['groups'] as $id => $title) {
1683
+			echo '
1617 1684
 			groups[', $id, '] = "', addslashes($title), '";';
1685
+	}
1618 1686
 
1619
-	foreach ($context['labels'] as $label)
1620
-		if ($label['id'] != -1)
1687
+	foreach ($context['labels'] as $label) {
1688
+			if ($label['id'] != -1)
1621 1689
 			echo '
1622 1690
 			labels[', ($label['id']), '] = "', addslashes($label['name']), '";';
1691
+	}
1623 1692
 
1624 1693
 	echo '
1625 1694
 			function addCriteriaOption()
@@ -1634,8 +1703,9 @@  discard block
 block discarded – undo
1634 1703
 
1635 1704
 				setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select>&nbsp;<span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value="" class="input_text"><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>';
1636 1705
 
1637
-	foreach ($context['groups'] as $id => $group)
1638
-		echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1706
+	foreach ($context['groups'] as $id => $group) {
1707
+			echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1708
+	}
1639 1709
 
1640 1710
 	echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\');
1641 1711
 			}
@@ -1652,9 +1722,10 @@  discard block
 block discarded – undo
1652 1722
 
1653 1723
 				setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select>&nbsp;<span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>';
1654 1724
 
1655
-	foreach ($context['labels'] as $label)
1656
-		if ($label['id'] != -1)
1725
+	foreach ($context['labels'] as $label) {
1726
+			if ($label['id'] != -1)
1657 1727
 			echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>';
1728
+	}
1658 1729
 
1659 1730
 	echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\');
1660 1731
 			}
@@ -1768,18 +1839,20 @@  discard block
 block discarded – undo
1768 1839
 	$isFirst = true;
1769 1840
 	foreach ($context['rule']['criteria'] as $k => $criteria)
1770 1841
 	{
1771
-		if (!$isFirst && $criteria['t'] == '')
1772
-			echo '<div id="removeonjs1">';
1773
-		elseif (!$isFirst)
1774
-			echo '<br>';
1842
+		if (!$isFirst && $criteria['t'] == '') {
1843
+					echo '<div id="removeonjs1">';
1844
+		} elseif (!$isFirst) {
1845
+					echo '<br>';
1846
+		}
1775 1847
 
1776 1848
 		echo '
1777 1849
 				<select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();">
1778 1850
 					<option value="">', $txt['pm_rule_criteria_pick'], ':</option>';
1779 1851
 
1780
-		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr)
1781
-			echo '
1852
+		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) {
1853
+					echo '
1782 1854
 					<option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>';
1855
+		}
1783 1856
 
1784 1857
 		echo '
1785 1858
 				</select>
@@ -1790,18 +1863,20 @@  discard block
 block discarded – undo
1790 1863
 					<select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();">
1791 1864
 						<option value="">', $txt['pm_rule_sel_group'], '</option>';
1792 1865
 
1793
-		foreach ($context['groups'] as $id => $group)
1794
-			echo '
1866
+		foreach ($context['groups'] as $id => $group) {
1867
+					echo '
1795 1868
 						<option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>';
1869
+		}
1796 1870
 		echo '
1797 1871
 					</select>
1798 1872
 				</span>';
1799 1873
 
1800 1874
 		// If this is the dummy we add a means to hide for non js users.
1801
-		if ($isFirst)
1802
-			$isFirst = false;
1803
-		elseif ($criteria['t'] == '')
1804
-			echo '</div>';
1875
+		if ($isFirst) {
1876
+					$isFirst = false;
1877
+		} elseif ($criteria['t'] == '') {
1878
+					echo '</div>';
1879
+		}
1805 1880
 	}
1806 1881
 
1807 1882
 	echo '
@@ -1824,10 +1899,11 @@  discard block
 block discarded – undo
1824 1899
 	$isFirst = true;
1825 1900
 	foreach ($context['rule']['actions'] as $k => $action)
1826 1901
 	{
1827
-		if (!$isFirst && $action['t'] == '')
1828
-			echo '<div id="removeonjs2">';
1829
-		elseif (!$isFirst)
1830
-			echo '<br>';
1902
+		if (!$isFirst && $action['t'] == '') {
1903
+					echo '<div id="removeonjs2">';
1904
+		} elseif (!$isFirst) {
1905
+					echo '<br>';
1906
+		}
1831 1907
 
1832 1908
 		echo '
1833 1909
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
@@ -1838,20 +1914,22 @@  discard block
 block discarded – undo
1838 1914
 				<span id="labdiv', $k, '">
1839 1915
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
1840 1916
 						<option value="">', $txt['pm_rule_sel_label'], '</option>';
1841
-		foreach ($context['labels'] as $label)
1842
-			if ($label['id'] != -1)
1917
+		foreach ($context['labels'] as $label) {
1918
+					if ($label['id'] != -1)
1843 1919
 				echo '
1844 1920
 						<option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>';
1921
+		}
1845 1922
 
1846 1923
 		echo '
1847 1924
 					</select>
1848 1925
 				</span>';
1849 1926
 
1850
-		if ($isFirst)
1851
-			$isFirst = false;
1852
-		elseif ($action['t'] == '')
1853
-			echo '
1927
+		if ($isFirst) {
1928
+					$isFirst = false;
1929
+		} elseif ($action['t'] == '') {
1930
+					echo '
1854 1931
 			</div>';
1932
+		}
1855 1933
 	}
1856 1934
 
1857 1935
 	echo '
@@ -1875,22 +1953,25 @@  discard block
 block discarded – undo
1875 1953
 		echo '
1876 1954
 	<script>';
1877 1955
 
1878
-	foreach ($context['rule']['criteria'] as $k => $c)
1879
-		echo '
1956
+	foreach ($context['rule']['criteria'] as $k => $c) {
1957
+			echo '
1880 1958
 			updateRuleDef(', $k, ');';
1959
+	}
1881 1960
 
1882
-	foreach ($context['rule']['actions'] as $k => $c)
1883
-		echo '
1961
+	foreach ($context['rule']['actions'] as $k => $c) {
1962
+			echo '
1884 1963
 			updateActionDef(', $k, ');';
1964
+	}
1885 1965
 
1886 1966
 	echo '
1887 1967
 			rebuildRuleDesc();';
1888 1968
 
1889 1969
 	// If this isn't a new rule and we have JS enabled remove the JS compatibility stuff.
1890
-	if ($context['rid'])
1891
-		echo '
1970
+	if ($context['rid']) {
1971
+			echo '
1892 1972
 			document.getElementById("removeonjs1").style.display = "none";
1893 1973
 			document.getElementById("removeonjs2").style.display = "none";';
1974
+	}
1894 1975
 
1895 1976
 	echo '
1896 1977
 			document.getElementById("addonjs1").style.display = "";
@@ -1918,12 +1999,12 @@  discard block
 block discarded – undo
1918 1999
 		</div>';
1919 2000
 
1920 2001
 	// No drafts? Just show an informative message.
1921
-	if (empty($context['drafts']))
1922
-		echo '
2002
+	if (empty($context['drafts'])) {
2003
+			echo '
1923 2004
 		<div class="windowbg2 centertext">
1924 2005
 			', $txt['draft_none'], '
1925 2006
 		</div>';
1926
-	else
2007
+	} else
1927 2008
 	{
1928 2009
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
1929 2010
 		foreach ($context['drafts'] as $draft)
Please login to merge, or discard this patch.
Sources/tasks/CreatePost-Notify.php 1 patch
Braces   +62 added lines, -46 removed lines patch added patch discarded remove patch
@@ -73,8 +73,9 @@  discard block
 block discarded – undo
73 73
 		while ($row = $smcFunc['db_fetch_assoc']($request))
74 74
 		{
75 75
 			$groups = array_merge(array($row['id_group'], $row['id_post_group']), (empty($row['additional_groups']) ? array() : explode(',', $row['additional_groups'])));
76
-			if (!in_array(1, $groups) && count(array_intersect($groups, explode(',', $row['member_groups']))) == 0)
77
-				continue;
76
+			if (!in_array(1, $groups) && count(array_intersect($groups, explode(',', $row['member_groups']))) == 0) {
77
+							continue;
78
+			}
78 79
 
79 80
 			$members[] = $row['id_member'];
80 81
 			$watched[$row['id_member']] = $row;
@@ -82,8 +83,9 @@  discard block
 block discarded – undo
82 83
 
83 84
 		$smcFunc['db_free_result']($request);
84 85
 
85
-		if (empty($members))
86
-			return true;
86
+		if (empty($members)) {
87
+					return true;
88
+		}
87 89
 
88 90
 		$members = array_unique($members);
89 91
 		$prefs = getNotifyPrefs($members, '', true);
@@ -105,20 +107,23 @@  discard block
 block discarded – undo
105 107
 			$notify_types = !empty($prefs[$member]['msg_notify_type']) ? $prefs[$member]['msg_notify_type'] : 1;
106 108
 
107 109
 			// Don't send a notification if the watching member ignored the member who made the action.
108
-			if (!empty($data['pm_ignore_list']) && in_array($data['id_member_updated'], explode(',', $data['pm_ignore_list'])))
109
-			    continue;
110
-			if (!in_array($type, array('reply', 'topic')) && $notify_types == 2 && $member != $data['id_member_started'])
111
-				continue;
112
-			elseif (in_array($type, array('reply', 'topic')) && $member == $posterOptions['id'])
113
-				continue;
114
-			elseif (!in_array($type, array('reply', 'topic')) && $notify_types == 3)
115
-				continue;
116
-			elseif ($notify_types == 4)
117
-				continue;
110
+			if (!empty($data['pm_ignore_list']) && in_array($data['id_member_updated'], explode(',', $data['pm_ignore_list']))) {
111
+						    continue;
112
+			}
113
+			if (!in_array($type, array('reply', 'topic')) && $notify_types == 2 && $member != $data['id_member_started']) {
114
+							continue;
115
+			} elseif (in_array($type, array('reply', 'topic')) && $member == $posterOptions['id']) {
116
+							continue;
117
+			} elseif (!in_array($type, array('reply', 'topic')) && $notify_types == 3) {
118
+							continue;
119
+			} elseif ($notify_types == 4) {
120
+							continue;
121
+			}
118 122
 
119 123
 			if ($frequency > 2 || (!empty($frequency) && $data['sent']) || in_array($member, $done_members)
120
-				|| (!empty($this->_details['members_only']) && !in_array($member, $this->_details['members_only'])))
121
-				continue;
124
+				|| (!empty($this->_details['members_only']) && !in_array($member, $this->_details['members_only']))) {
125
+							continue;
126
+			}
122 127
 
123 128
 			// Watched topic?
124 129
 			if (!empty($data['id_topic']) && $type != 'topic' && !empty($prefs[$member]))
@@ -128,10 +133,12 @@  discard block
 block discarded – undo
128 133
 
129 134
 				if ($type == 'reply')
130 135
 				{
131
-					if (!empty($prefs[$member]['msg_receive_body']))
132
-						$message_type .= '_body';
133
-					if (!empty($frequency))
134
-						$message_type .= '_once';
136
+					if (!empty($prefs[$member]['msg_receive_body'])) {
137
+											$message_type .= '_body';
138
+					}
139
+					if (!empty($frequency)) {
140
+											$message_type .= '_once';
141
+					}
135 142
 				}
136 143
 
137 144
 				$content_type = 'topic';
@@ -144,12 +151,14 @@  discard block
 block discarded – undo
144 151
 				$content_type = 'board';
145 152
 
146 153
 				$message_type = !empty($frequency) ? 'notify_boards_once' : 'notify_boards';
147
-				if (!empty($prefs[$member]['msg_receive_body']))
148
-					$message_type .= '_body';
154
+				if (!empty($prefs[$member]['msg_receive_body'])) {
155
+									$message_type .= '_body';
156
+				}
149 157
 			}
150 158
 			// If neither of the above, this might be a redundent row due to the OR clause in our SQL query, skip
151
-			else
152
-				continue;
159
+			else {
160
+							continue;
161
+			}
153 162
 
154 163
 			if ($pref & 0x02)
155 164
 			{
@@ -212,14 +221,15 @@  discard block
 block discarded – undo
212 221
 		);
213 222
 
214 223
 		// Insert the alerts if any
215
-		if (!empty($alert_rows))
216
-			$smcFunc['db_insert']('',
224
+		if (!empty($alert_rows)) {
225
+					$smcFunc['db_insert']('',
217 226
 				'{db_prefix}user_alerts',
218 227
 				array('alert_time' => 'int', 'id_member' => 'int', 'id_member_started' => 'int', 'member_name' => 'string',
219 228
 					'content_type' => 'string', 'content_id' => 'int', 'content_action' => 'string', 'is_read' => 'int', 'extra' => 'string'),
220 229
 				$alert_rows,
221 230
 				array()
222 231
 			);
232
+		}
223 233
 
224 234
 		return true;
225 235
 	}
@@ -230,8 +240,9 @@  discard block
 block discarded – undo
230 240
 
231 241
 		foreach ($quotedMembers as $id => $member)
232 242
 		{
233
-			if (!isset($prefs[$id]) || $id == $posterOptions['id'] || empty($prefs[$id]['msg_quote']))
234
-				continue;
243
+			if (!isset($prefs[$id]) || $id == $posterOptions['id'] || empty($prefs[$id]['msg_quote'])) {
244
+							continue;
245
+			}
235 246
 
236 247
 			$done_members[] = $id;
237 248
 
@@ -283,32 +294,35 @@  discard block
 block discarded – undo
283 294
 		{
284 295
 			if (preg_match('/\[quote(.*)?\]/i', $block, $matches))
285 296
 			{
286
-				if ($quote_level == 0)
287
-					$message .= '[quote' . $matches[1] . ']';
297
+				if ($quote_level == 0) {
298
+									$message .= '[quote' . $matches[1] . ']';
299
+				}
288 300
 				$quote_level++;
289
-			}
290
-			elseif (preg_match('/\[\/quote\]/i', $block))
301
+			} elseif (preg_match('/\[\/quote\]/i', $block))
291 302
 			{
292
-				if ($quote_level <= 1)
293
-					$message .= '[/quote]';
303
+				if ($quote_level <= 1) {
304
+									$message .= '[/quote]';
305
+				}
294 306
 				if ($quote_level >= 1)
295 307
 				{
296 308
 					$quote_level--;
297 309
 					$message .= "\n";
298 310
 				}
311
+			} elseif ($quote_level <= 1) {
312
+							$message .= $block;
299 313
 			}
300
-			elseif ($quote_level <= 1)
301
-				$message .= $block;
302 314
 		}
303 315
 
304 316
 		preg_match_all('/\[quote.*?link=msg=([0-9]+).*?\]/i', $message, $matches);
305 317
 
306 318
 		$id_msgs = $matches[1];
307
-		foreach ($id_msgs as $k => $id_msg)
308
-			$id_msgs[$k] = (int) $id_msg;
319
+		foreach ($id_msgs as $k => $id_msg) {
320
+					$id_msgs[$k] = (int) $id_msg;
321
+		}
309 322
 
310
-		if (empty($id_msgs))
311
-			return array();
323
+		if (empty($id_msgs)) {
324
+					return array();
325
+		}
312 326
 
313 327
 		// Get the messages
314 328
 		$request = $smcFunc['db_query']('', '
@@ -326,8 +340,9 @@  discard block
 block discarded – undo
326 340
 		$members = array();
327 341
 		while ($row = $smcFunc['db_fetch_assoc']($request))
328 342
 		{
329
-			if ($posterOptions['id'] == $row['id_member'])
330
-				continue;
343
+			if ($posterOptions['id'] == $row['id_member']) {
344
+							continue;
345
+			}
331 346
 
332 347
 			$members[$row['id_member']] = $row;
333 348
 		}
@@ -341,10 +356,11 @@  discard block
 block discarded – undo
341 356
 
342 357
 		foreach ($members as $id => $member)
343 358
 		{
344
-			if (!empty($prefs[$id]['msg_mention']))
345
-				$done_members[] = $id;
346
-			else
347
-				continue;
359
+			if (!empty($prefs[$id]['msg_mention'])) {
360
+							$done_members[] = $id;
361
+			} else {
362
+							continue;
363
+			}
348 364
 
349 365
 			// Alerts' emails are always instant
350 366
 			if ($prefs[$id]['msg_mention'] & 0x02)
Please login to merge, or discard this patch.