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