Completed
Push — release-2.1 ( 3c29ac...c0ce3f )
by Mathias
07:06
created
Themes/default/Post.template.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
 		foreach ($context['posting_fields'] as $pf)
140 140
 			echo '
141 141
 						<dt>
142
-							', $pf['dt'] ,'
142
+							', $pf['dt'], '
143 143
 						</dt>
144 144
 						<dd>
145
-							', $pf['dd'] ,'
145
+							', $pf['dd'], '
146 146
 						</dd>';
147 147
 
148 148
 
@@ -459,13 +459,13 @@  discard block
 block discarded – undo
459 459
 									<p class="message" data-dz-message></p>
460 460
 									<p class="attached_BBC">
461 461
 										<input type="text" name="attachBBC" value="" readonly>
462
-										<a class="button_submit insertBBC">', $txt['attached_insertBBC'] ,'</a>
462
+										<a class="button_submit insertBBC">', $txt['attached_insertBBC'], '</a>
463 463
 									</p>
464 464
 									<p class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></p>
465 465
 								</div>
466 466
 								<div class="attach-ui">
467
-									<a data-dz-remove class="button_submit delete">', $txt['modify_cancel'] ,'</a>
468
-									<a class="button_submit start">', $txt['upload'] ,'</a>
467
+									<a data-dz-remove class="button_submit delete">', $txt['modify_cancel'], '</a>
468
+									<a class="button_submit start">', $txt['upload'], '</a>
469 469
 								</div>
470 470
 							</div>
471 471
 						</div>
@@ -482,10 +482,10 @@  discard block
 block discarded – undo
482 482
 							</dt>
483 483
 							<dd class="smalltext fallback">
484 484
 								<div id="attachUpload" class="descbox">
485
-									<h5>', $txt['attach_drop_zone'] ,'</h5>
486
-									<a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a>
487
-									<a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a>
488
-									<a class="button_submit fileinput-button">', $txt['attach_add'] ,'</a>
485
+									<h5>', $txt['attach_drop_zone'], '</h5>
486
+									<a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a>
487
+									<a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a>
488
+									<a class="button_submit fileinput-button">', $txt['attach_add'], '</a>
489 489
 									<div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
490 490
 									<div class="fallback">
491 491
 										<input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="input_file fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 	// Option to delete an event if user is editing one.
593 593
 	if ($context['make_event'] && !$context['event']['new'])
594 594
 		echo '
595
-						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">';
595
+						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button_submit you_sure">';
596 596
 
597 597
 	echo '
598 598
 					</span>
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 			});';
847 847
 
848 848
 	echo '
849
-			var oEditorID = "', $context['post_box_name'] ,'";
849
+			var oEditorID = "', $context['post_box_name'], '";
850 850
 			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
851 851
 		</script>';
852 852
 
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 			{
879 879
 				echo '
880 880
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
881
-						<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>
881
+						<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>
882 882
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
883 883
 					</ul>';
884 884
 			}
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 	<head>
966 966
 		<meta charset="', $context['character_set'], '">
967 967
 		<title>', $txt['spell_check'], '</title>
968
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
968
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
969 969
 		<style>
970 970
 			body, td
971 971
 			{
@@ -998,8 +998,8 @@  discard block
 block discarded – undo
998 998
 			var spell_formname = window.opener.spell_formname;
999 999
 			var spell_fieldname = window.opener.spell_fieldname;
1000 1000
 		</script>
1001
-		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script>
1002
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
1001
+		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script>
1002
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
1003 1003
 		<script>
1004 1004
 			', $context['spell_js'], '
1005 1005
 		</script>
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 	<head>
1042 1042
 		<meta charset="', $context['character_set'], '">
1043 1043
 		<title>', $txt['retrieving_quote'], '</title>
1044
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
1044
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
1045 1045
 	</head>
1046 1046
 	<body>
1047 1047
 		', $txt['retrieving_quote'], '
Please login to merge, or discard this patch.
Braces   +107 added lines, -73 removed lines patch added patch discarded remove patch
@@ -22,22 +22,24 @@  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
-	foreach ($context['icons'] as $icon)
33
-		echo '
33
+	foreach ($context['icons'] as $icon) {
34
+			echo '
34 35
 				\'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ',';
36
+	}
35 37
 	echo '
36 38
 			};';
37 39
 
38 40
 	// If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations.
39
-	if ($context['make_poll'])
40
-		echo '
41
+	if ($context['make_poll']) {
42
+			echo '
41 43
 			var pollOptionNum = 0, pollTabIndex;
42 44
 			var pollOptionId = ', $context['last_choice_id'], ';
43 45
 			function addPollOption()
@@ -56,11 +58,13 @@  discard block
 block discarded – undo
56 58
 
57 59
 				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('" class="input_text"></dd><p id="pollMoreOptions"></p>'), ');
58 60
 			}';
61
+	}
59 62
 
60 63
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.
61
-	if ($context['make_event'])
62
-		echo '
64
+	if ($context['make_event']) {
65
+			echo '
63 66
 			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];';
67
+	}
64 68
 
65 69
 	// End of the javascript, start the form and display the link tree.
66 70
 	echo '
@@ -80,9 +84,10 @@  discard block
 block discarded – undo
80 84
 				</div>
81 85
 			</div><br>';
82 86
 
83
-	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board'])))
84
-		echo '
87
+	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) {
88
+			echo '
85 89
 			<input type="hidden" name="eventid" value="', $context['event']['id'], '">';
90
+	}
86 91
 
87 92
 	// Start the main table.
88 93
 	echo '
@@ -117,26 +122,28 @@  discard block
 block discarded – undo
117 122
 	}
118 123
 
119 124
 	// If it's locked, show a message to warn the replier.
120
-	if (!empty($context['locked']))
121
-	echo '
125
+	if (!empty($context['locked'])) {
126
+		echo '
122 127
 					<p class="errorbox">
123 128
 						', $txt['topic_locked_no_reply'], '
124 129
 					</p>';
130
+	}
125 131
 
126
-	if (!empty($modSettings['drafts_post_enabled']))
127
-		echo '
132
+	if (!empty($modSettings['drafts_post_enabled'])) {
133
+			echo '
128 134
 					<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
129 135
 						sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), '
130 136
 						', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
131 137
 					</div>';
138
+	}
132 139
 
133 140
 	// The post header... important stuff
134 141
 	echo '
135 142
 					<dl id="post_header">';
136 143
 
137 144
 	// Custom posting fields.
138
-	if (!empty($context['posting_fields']) && is_array($context['posting_fields']))
139
-		foreach ($context['posting_fields'] as $pf)
145
+	if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) {
146
+			foreach ($context['posting_fields'] as $pf)
140 147
 			echo '
141 148
 						<dt>
142 149
 							', $pf['dt'] ,'
@@ -144,6 +151,7 @@  discard block
 block discarded – undo
144 151
 						<dd>
145 152
 							', $pf['dd'] ,'
146 153
 						</dd>';
154
+	}
147 155
 
148 156
 
149 157
 	// Guests have to put in their name and email...
@@ -157,14 +165,15 @@  discard block
 block discarded – undo
157 165
 							<input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text">
158 166
 						</dd>';
159 167
 
160
-		if (empty($modSettings['guest_post_no_email']))
161
-			echo '
168
+		if (empty($modSettings['guest_post_no_email'])) {
169
+					echo '
162 170
 						<dt>
163 171
 							<span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span>
164 172
 						</dt>
165 173
 						<dd>
166 174
 							<input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required>
167 175
 						</dd>';
176
+		}
168 177
 	}
169 178
 
170 179
 	// Now show the subject box for this post.
@@ -182,9 +191,10 @@  discard block
 block discarded – undo
182 191
 							<select name="icon" id="icon" onchange="showimage()">';
183 192
 
184 193
 	// Loop through each message icon allowed, adding it to the drop down list.
185
-	foreach ($context['icons'] as $icon)
186
-		echo '
194
+	foreach ($context['icons'] as $icon) {
195
+			echo '
187 196
 								<option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected' : '', '>', $icon['name'], '</option>';
197
+	}
188 198
 
189 199
 	echo '
190 200
 							</select>
@@ -206,9 +216,10 @@  discard block
 block discarded – undo
206 216
 								<select name="year" id="year" tabindex="', $context['tabindex']++, '" onchange="generateDays();">';
207 217
 
208 218
 		// Show a list of all the years we allow...
209
-		for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
210
-			echo '
219
+		for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) {
220
+					echo '
211 221
 									<option value="', $year, '"', $year == $context['event']['year'] ? ' selected' : '', '>', $year, '&nbsp;</option>';
222
+		}
212 223
 
213 224
 		echo '
214 225
 								</select>
@@ -216,9 +227,10 @@  discard block
 block discarded – undo
216 227
 								<select name="month" id="month" onchange="generateDays();">';
217 228
 
218 229
 		// There are 12 months per year - ensure that they all get listed.
219
-		for ($month = 1; $month <= 12; $month++)
220
-			echo '
230
+		for ($month = 1; $month <= 12; $month++) {
231
+					echo '
221 232
 									<option value="', $month, '"', $month == $context['event']['month'] ? ' selected' : '', '>', $txt['months'][$month], '&nbsp;</option>';
233
+		}
222 234
 
223 235
 		echo '
224 236
 								</select>
@@ -226,9 +238,10 @@  discard block
 block discarded – undo
226 238
 								<select name="day" id="day">';
227 239
 
228 240
 		// This prints out all the days in the current month - this changes dynamically as we switch months.
229
-		for ($day = 1; $day <= $context['event']['last_day']; $day++)
230
-			echo '
241
+		for ($day = 1; $day <= $context['event']['last_day']; $day++) {
242
+					echo '
231 243
 									<option value="', $day, '"', $day == $context['event']['day'] ? ' selected' : '', '>', $day, '&nbsp;</option>';
244
+		}
232 245
 
233 246
 		echo '
234 247
 								</select>
@@ -251,9 +264,10 @@  discard block
 block discarded – undo
251 264
 										', $txt['calendar_numb_days'], '
252 265
 										<select name="span">';
253 266
 
254
-				for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++)
255
-					echo '
267
+				for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) {
268
+									echo '
256 269
 											<option value="', $days, '"', $days == $context['event']['span'] ? ' selected' : '', '>', $days, '&nbsp;</option>';
270
+				}
257 271
 
258 272
 				echo '
259 273
 										</select>
@@ -271,9 +285,10 @@  discard block
 block discarded – undo
271 285
 				{
272 286
 					echo '
273 287
 											<optgroup label="', $category['name'], '">';
274
-					foreach ($category['boards'] as $board)
275
-						echo '
288
+					foreach ($category['boards'] as $board) {
289
+											echo '
276 290
 												<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '&nbsp;</option>';
291
+					}
277 292
 					echo '
278 293
 											</optgroup>';
279 294
 				}
@@ -344,14 +359,15 @@  discard block
 block discarded – undo
344 359
 									<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check">
345 360
 								</dd>';
346 361
 
347
-		if ($context['poll_options']['guest_vote_enabled'])
348
-			echo '
362
+		if ($context['poll_options']['guest_vote_enabled']) {
363
+					echo '
349 364
 								<dt>
350 365
 									<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
351 366
 								</dt>
352 367
 								<dd>
353 368
 									<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', ' class="input_check">
354 369
 								</dd>';
370
+		}
355 371
 
356 372
 		echo '
357 373
 								<dt>
@@ -372,8 +388,8 @@  discard block
 block discarded – undo
372 388
 					', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
373 389
 
374 390
 	// If we're editing and displaying edit details, show a box where they can say why
375
-	if (isset($context['editing']) && $modSettings['show_modify'])
376
-		echo '
391
+	if (isset($context['editing']) && $modSettings['show_modify']) {
392
+			echo '
377 393
 					<dl>
378 394
 						<dt class="clear">
379 395
 							<span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span>
@@ -382,20 +398,23 @@  discard block
 block discarded – undo
382 398
 							<input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text">
383 399
 						</dd>
384 400
 					</dl>';
401
+	}
385 402
 
386 403
 	// If this message has been edited in the past - display when it was.
387
-	if (isset($context['last_modified']))
388
-		echo '
404
+	if (isset($context['last_modified'])) {
405
+			echo '
389 406
 					<div class="padding smalltext">
390 407
 						', $context['last_modified_text'], '
391 408
 					</div>';
409
+	}
392 410
 
393 411
 	// If the admin has enabled the hiding of the additional options - show a link and image for it.
394
-	if (!empty($modSettings['additional_options_collapsable']))
395
-		echo '
412
+	if (!empty($modSettings['additional_options_collapsable'])) {
413
+			echo '
396 414
 					<div id="postAdditionalOptionsHeader">
397 415
 						<strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong>
398 416
 					</div>';
417
+	}
399 418
 
400 419
 	echo '
401 420
 					<div id="postAdditionalOptions">';
@@ -427,19 +446,21 @@  discard block
 block discarded – undo
427 446
 								<input type="hidden" name="attach_del[]" value="0">
428 447
 								', $txt['uncheck_unwatchd_attach'], ':
429 448
 							</dd>';
430
-		foreach ($context['current_attachments'] as $attachment)
431
-			echo '
449
+		foreach ($context['current_attachments'] as $attachment) {
450
+					echo '
432 451
 							<dd class="smalltext">
433 452
 								<label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', ' class="input_check"> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
434 453
 								!empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label>
435 454
 							</dd>';
455
+		}
436 456
 
437 457
 		echo '
438 458
 						</dl>';
439 459
 
440
-		if (!empty($context['files_in_session_warning']))
441
-			echo '
460
+		if (!empty($context['files_in_session_warning'])) {
461
+					echo '
442 462
 						<div class="smalltext">', $context['files_in_session_warning'], '</div>';
463
+		}
443 464
 	}
444 465
 
445 466
 	// Is the user allowed to post any additional ones? If so give them the boxes to do it!
@@ -492,8 +513,8 @@  discard block
 block discarded – undo
492 513
 								', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '">');
493 514
 
494 515
 		// Show more boxes if they aren't approaching that limit.
495
-		if ($context['num_allowed_attachments'] > 1)
496
-			echo '
516
+		if ($context['num_allowed_attachments'] > 1) {
517
+					echo '
497 518
 										<script>
498 519
 											var allowed_attachments = ', $context['num_allowed_attachments'], ';
499 520
 											var current_attachment = 1;
@@ -514,9 +535,10 @@  discard block
 block discarded – undo
514 535
 									</div>
515 536
 								</div>
516 537
 							</dd>';
517
-		else
518
-			echo '
538
+		} else {
539
+					echo '
519 540
 							</dd>';
541
+		}
520 542
 
521 543
 		// Add any template changes for an alternative upload system here.
522 544
 		call_integration_hook('integrate_upload_template');
@@ -525,21 +547,25 @@  discard block
 block discarded – undo
525 547
 							<dd class="smalltext">';
526 548
 
527 549
 		// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
528
-		if (!empty($modSettings['attachmentCheckExtensions']))
529
-			echo '
550
+		if (!empty($modSettings['attachmentCheckExtensions'])) {
551
+					echo '
530 552
 								', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>';
553
+		}
531 554
 
532
-		if (!empty($context['attachment_restrictions']))
533
-			echo '
555
+		if (!empty($context['attachment_restrictions'])) {
556
+					echo '
534 557
 								', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>';
558
+		}
535 559
 
536
-		if ($context['num_allowed_attachments'] == 0)
537
-			echo '
560
+		if ($context['num_allowed_attachments'] == 0) {
561
+					echo '
538 562
 								', $txt['attach_limit_nag'], '<br>';
563
+		}
539 564
 
540
-		if (!$context['can_post_attachment_unapproved'])
541
-			echo '
565
+		if (!$context['can_post_attachment_unapproved']) {
566
+					echo '
542 567
 								<span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>';
568
+		}
543 569
 
544 570
 		echo '
545 571
 							</dd>
@@ -562,10 +588,11 @@  discard block
 block discarded – undo
562 588
 							<dt><strong>', $txt['subject'], '</strong></dt>
563 589
 							<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
564 590
 
565
-		foreach ($context['drafts'] as $draft)
566
-			echo '
591
+		foreach ($context['drafts'] as $draft) {
592
+					echo '
567 593
 							<dt>', $draft['link'], '</dt>
568 594
 							<dd>', $draft['poster_time'], '</dd>';
595
+		}
569 596
 		echo '
570 597
 						</dl>
571 598
 					</div>';
@@ -590,9 +617,10 @@  discard block
 block discarded – undo
590 617
 						', template_control_richedit_buttons($context['post_box_name']);
591 618
 
592 619
 	// Option to delete an event if user is editing one.
593
-	if ($context['make_event'] && !$context['event']['new'])
594
-		echo '
620
+	if ($context['make_event'] && !$context['event']['new']) {
621
+			echo '
595 622
 						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">';
623
+	}
596 624
 
597 625
 	echo '
598 626
 					</span>
@@ -601,9 +629,10 @@  discard block
 block discarded – undo
601 629
 			<br class="clear">';
602 630
 
603 631
 	// Assuming this isn't a new topic pass across the last message id.
604
-	if (isset($context['topic_last_message']))
605
-		echo '
632
+	if (isset($context['topic_last_message'])) {
633
+			echo '
606 634
 			<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">';
635
+	}
607 636
 
608 637
 	echo '
609 638
 			<input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '">
@@ -745,9 +774,10 @@  discard block
 block discarded – undo
745 774
 
746 775
 						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>\';';
747 776
 
748
-	if ($context['can_quote'])
749
-		echo '
777
+	if ($context['can_quote']) {
778
+			echo '
750 779
 						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>\';';
780
+	}
751 781
 
752 782
 	echo '
753 783
 						newPostsHTML += \'<br class="clear">\';
@@ -790,8 +820,8 @@  discard block
 block discarded – undo
790 820
 			}';
791 821
 
792 822
 	// Code for showing and hiding additional options.
793
-	if (!empty($modSettings['additional_options_collapsable']))
794
-		echo '
823
+	if (!empty($modSettings['additional_options_collapsable'])) {
824
+			echo '
795 825
 			var oSwapAdditionalOptions = new smc_Toggle({
796 826
 				bToggleEnabled: true,
797 827
 				bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ',
@@ -819,10 +849,11 @@  discard block
 block discarded – undo
819 849
 					}
820 850
 				]
821 851
 			});';
852
+	}
822 853
 
823 854
 	// Code for showing and hiding drafts
824
-	if (!empty($context['drafts']))
825
-		echo '
855
+	if (!empty($context['drafts'])) {
856
+			echo '
826 857
 			var oSwapDraftOptions = new smc_Toggle({
827 858
 				bToggleEnabled: true,
828 859
 				bCurrentlyCollapsed: true,
@@ -844,6 +875,7 @@  discard block
 block discarded – undo
844 875
 					}
845 876
 				]
846 877
 			});';
878
+	}
847 879
 
848 880
 	echo '
849 881
 			var oEditorID = "', $context['post_box_name'] ,'";
@@ -864,8 +896,9 @@  discard block
 block discarded – undo
864 896
 		foreach ($context['previous_posts'] as $post)
865 897
 		{
866 898
 			$ignoring = false;
867
-			if (!empty($post['is_ignored']))
868
-				$ignored_posts[] = $ignoring = $post['id'];
899
+			if (!empty($post['is_ignored'])) {
900
+							$ignored_posts[] = $ignoring = $post['id'];
901
+			}
869 902
 
870 903
 			echo '
871 904
 			<div class="windowbg">
@@ -1048,10 +1081,10 @@  discard block
 block discarded – undo
1048 1081
 		<div id="temporary_posting_area" style="display: none;"></div>
1049 1082
 		<script>';
1050 1083
 
1051
-	if ($context['close_window'])
1052
-		echo '
1084
+	if ($context['close_window']) {
1085
+			echo '
1053 1086
 			window.close();';
1054
-	else
1087
+	} else
1055 1088
 	{
1056 1089
 		// Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;).
1057 1090
 		echo '
@@ -1105,11 +1138,12 @@  discard block
 block discarded – undo
1105 1138
 				</p>
1106 1139
 				<ul>';
1107 1140
 
1108
-	foreach ($context['groups'] as $group)
1109
-		echo '
1141
+	foreach ($context['groups'] as $group) {
1142
+			echo '
1110 1143
 					<li>
1111 1144
 						<label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em>
1112 1145
 					</li>';
1146
+	}
1113 1147
 
1114 1148
 	echo '
1115 1149
 					<li>
Please login to merge, or discard this patch.
Themes/default/Display.template.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	echo '
40 40
 		<div id="display_head" class="information">
41 41
 			<h2 class="display_title"><span id="top_subject">', $context['subject'], '</span>', ($context['is_locked']) ? ' <span class="generic_icons lock"></span>' : '', ($context['is_sticky']) ? ' <span class="generic_icons sticky"></span>' : '', '</h2>
42
-			<p>',$txt['started_by'],' ', $context['topic_poster_name'],', ', $context['topic_started_time'],'</p>';
42
+			<p>',$txt['started_by'], ' ', $context['topic_poster_name'], ', ', $context['topic_started_time'], '</p>';
43 43
 
44 44
 	// Next - Prev
45 45
 	echo '
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 			<div id="poll">
75 75
 				<div class="cat_bar">
76 76
 					<h3 class="catbg">
77
-						<span class="generic_icons poll"></span>', $context['poll']['is_locked'] ? '<span class="generic_icons lock"></span>' : '' ,' ', $context['poll']['question'], '
77
+						<span class="generic_icons poll"></span>', $context['poll']['is_locked'] ? '<span class="generic_icons lock"></span>' : '', ' ', $context['poll']['question'], '
78 78
 					</h3>
79 79
 				</div>
80 80
 				<div class="windowbg noup">
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 	// Mobile action - moderation buttons (top)
189 189
 	echo '
190 190
 			<div class="mobile_buttons floatright">
191
-				<a class="button mobile_act">', $txt['mobile_action'],'</a>
192
-				', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">'. $txt['mobile_moderation'].'</a>' : '','
191
+				<a class="button mobile_act">', $txt['mobile_action'], '</a>
192
+				', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', '
193 193
 			</div>';
194 194
 
195 195
 	// Show the topic information - icon, subject, etc.
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
 	// Mobile action - moderation buttons (bottom)
214 214
 	echo '
215 215
 			<div class="mobile_buttons floatright">
216
-				<a class="button mobile_act">', $txt['mobile_action'],'</a>
217
-				', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">'. $txt['mobile_moderation'].'</a>' : '','
216
+				<a class="button mobile_act">', $txt['mobile_action'], '</a>
217
+				', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', '
218 218
 			</div>';
219 219
 
220 220
 	// Show the page index... "Pages: [1]".
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	echo '
249 249
 			<div id="mobile_action" class="popup_container">
250 250
 				<div class="popup_window description">
251
-					<div class="popup_heading">', $txt['mobile_action'],'
251
+					<div class="popup_heading">', $txt['mobile_action'], '
252 252
 					<a href="javascript:void(0);" class="generic_icons hide_popup"></a></div>
253 253
 					', template_button_strip($context['normal_buttons']), '
254 254
 				</div>
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 		echo '
260 260
 			<div id="mobile_moderation" class="popup_container">
261 261
 				<div class="popup_window description">
262
-					<div class="popup_heading">', $txt['mobile_moderation'],'
262
+					<div class="popup_heading">', $txt['mobile_moderation'], '
263 263
 					<a href="javascript:void(0);" class="generic_icons hide_popup"></a></div>
264 264
 					<div id="moderationbuttons_mobile">
265 265
 						', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip_mobile')), '
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 							sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
348 348
 							sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
349 349
 							sTemplateTopSubject: ', JavaScriptEscape('%subject%'), ',
350
-							sTemplateReasonEdit: ', JavaScriptEscape($txt['reason_for_edit'] .': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text quickModifyMargin">'), ',
350
+							sTemplateReasonEdit: ', JavaScriptEscape($txt['reason_for_edit'] . ': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text quickModifyMargin">'), ',
351 351
 							sTemplateReasonNormal: ', JavaScriptEscape('%modify_text'), ',
352 352
 							sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ($context['can_reply']) ? ',
353 353
 							sFormRemoveAccessKeys: \'postmodify\'' : '', '
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
 	// Show the message anchor and a "new" anchor if this message is new.
422 422
 	echo '
423
-				<div class="', $message['css_class'] ,'">', $message['id'] != $context['first_message'] ? '
423
+				<div class="', $message['css_class'], '">', $message['id'] != $context['first_message'] ? '
424 424
 					<a id="msg' . $message['id'] . '"></a>' . ($message['first_new'] ? '<a id="new"></a>' : '') : '', '
425 425
 					<div class="post_wrapper">';
426 426
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 
438 438
 		foreach ($message['custom_fields']['above_member'] as $custom)
439 439
 			echo '
440
-									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
440
+									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
441 441
 
442 442
 		echo '
443 443
 								</ul>
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 	if (!empty($message['custom_fields']['below_avatar']))
474 474
 		foreach ($message['custom_fields']['below_avatar'] as $custom)
475 475
 			echo '
476
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
476
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
477 477
 
478 478
 	// Show the post group icons, but not for guests.
479 479
 	if (!$message['member']['is_guest'])
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 
519 519
 			foreach ($message['custom_fields']['icons'] as $custom)
520 520
 				echo '
521
-										<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
521
+										<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
522 522
 
523 523
 			echo '
524 524
 									</ol>
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 		if (!empty($message['custom_fields']['standard']))
557 557
 			foreach ($message['custom_fields']['standard'] as $custom)
558 558
 				echo '
559
-								<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
559
+								<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
560 560
 
561 561
 	}
562 562
 	// Otherwise, show the guest's email.
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 	if (!empty($message['custom_fields']['bottom_poster']))
595 595
 		foreach ($message['custom_fields']['bottom_poster'] as $custom)
596 596
 			echo '
597
-									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
597
+									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
598 598
 
599 599
 	// Poster info ends.
600 600
 	echo '
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 			$base .= (isset($txt[$base . $count])) ? $count : 'n';
782 782
 
783 783
 			echo '
784
-									<li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] .';'. $context['session_var'] .'='. $context['session_id'], comma_format($count)), '</li>';
784
+									<li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], comma_format($count)), '</li>';
785 785
 		}
786 786
 
787 787
 		echo '
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 		if ($context['can_quote'])
799 799
 			echo '
800 800
 									<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>
801
-									<li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>';
801
+									<li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>';
802 802
 
803 803
 		// Can the user modify the contents of this post? Show the modify inline image.
804 804
 		if ($message['can_modify'])
@@ -820,10 +820,10 @@  discard block
 block discarded – undo
820 820
 		// How about... even... remove it entirely?!
821 821
 		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id']))
822 822
 			echo '
823
-											<li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'],'</a></li>';
823
+											<li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'], '</a></li>';
824 824
 		elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id']))
825 825
 			echo '
826
-											<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
826
+											<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
827 827
 
828 828
 		// What about splitting it off the rest of the topic?
829 829
 		if ($context['can_split'] && !empty($context['real_num_replies']))
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 
882 882
 		foreach ($message['custom_fields']['above_signature'] as $custom)
883 883
 			echo '
884
-									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
884
+									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
885 885
 
886 886
 		echo '
887 887
 								</ul>
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
 
904 904
 		foreach ($message['custom_fields']['below_signature'] as $custom)
905 905
 			echo '
906
-									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
906
+									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
907 907
 
908 908
 		echo '
909 909
 								</ul>
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 	echo '
1005 1005
 				<br class="clear_right">
1006 1006
 				<span id="post_confirm_buttons">
1007
-					', template_control_richedit_buttons($context['post_box_name']) ,'
1007
+					', template_control_richedit_buttons($context['post_box_name']), '
1008 1008
 				</span>';
1009 1009
 		echo '
1010 1010
 					</form>
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
 						sJumpAnchor: "quickreply",
1048 1048
 						bIsFull: true
1049 1049
 					});
1050
-					var oEditorID = "', $context['post_box_name'] ,'";
1050
+					var oEditorID = "', $context['post_box_name'], '";
1051 1051
 					var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
1052 1052
 					var oJumpAnchor = "quickreply";
1053 1053
 				</script>';
Please login to merge, or discard this patch.
Braces   +202 added lines, -137 removed lines patch added patch discarded remove patch
@@ -51,11 +51,13 @@  discard block
 block discarded – undo
51 51
 				<p>';
52 52
 
53 53
 		// Show just numbers...?
54
-		if ($settings['display_who_viewing'] == 1)
55
-				echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
54
+		if ($settings['display_who_viewing'] == 1) {
55
+						echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
56
+		}
56 57
 		// Or show the actual people viewing the topic?
57
-		else
58
-			echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
58
+		else {
59
+					echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
60
+		}
59 61
 
60 62
 		// Now show how many guests are here too.
61 63
 		echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
@@ -93,10 +95,11 @@  discard block
 block discarded – undo
93 95
 						<dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
94 96
 						<dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">';
95 97
 
96
-				if ($context['allow_results_view'])
97
-					echo '
98
+				if ($context['allow_results_view']) {
99
+									echo '
98 100
 							', $option['bar_ndt'], '
99 101
 							<span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';
102
+				}
100 103
 
101 104
 				echo '
102 105
 						</dd>';
@@ -105,9 +108,10 @@  discard block
 block discarded – undo
105 108
 			echo '
106 109
 					</dl>';
107 110
 
108
-			if ($context['allow_results_view'])
109
-				echo '
111
+			if ($context['allow_results_view']) {
112
+							echo '
110 113
 						<p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
114
+			}
111 115
 		}
112 116
 		// They are allowed to vote! Go to it!
113 117
 		else
@@ -116,17 +120,19 @@  discard block
 block discarded – undo
116 120
 						<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
117 121
 
118 122
 			// Show a warning if they are allowed more than one option.
119
-			if ($context['poll']['allowed_warning'])
120
-				echo '
123
+			if ($context['poll']['allowed_warning']) {
124
+							echo '
121 125
 							<p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
126
+			}
122 127
 
123 128
 			echo '
124 129
 							<ul class="options">';
125 130
 
126 131
 			// Show each option with its button - a radio likely.
127
-			foreach ($context['poll']['options'] as $option)
128
-				echo '
132
+			foreach ($context['poll']['options'] as $option) {
133
+							echo '
129 134
 								<li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
135
+			}
130 136
 
131 137
 			echo '
132 138
 							</ul>
@@ -138,9 +144,10 @@  discard block
 block discarded – undo
138 144
 		}
139 145
 
140 146
 		// Is the clock ticking?
141
-		if (!empty($context['poll']['expire_time']))
142
-			echo '
147
+		if (!empty($context['poll']['expire_time'])) {
148
+					echo '
143 149
 						<p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
150
+		}
144 151
 
145 152
 		echo '
146 153
 					</div>
@@ -164,11 +171,12 @@  discard block
 block discarded – undo
164 171
 			<div class="information">
165 172
 				<ul>';
166 173
 
167
-		foreach ($context['linked_calendar_events'] as $event)
168
-			echo '
174
+		foreach ($context['linked_calendar_events'] as $event) {
175
+					echo '
169 176
 					<li>
170 177
 						', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify"></span></a> ' : ''), '<strong>', $event['title'], '</strong>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
171 178
 					</li>';
179
+		}
172 180
 
173 181
 		echo '
174 182
 				</ul>
@@ -203,8 +211,9 @@  discard block
 block discarded – undo
203 211
 	$context['removableMessageIDs'] = array();
204 212
 
205 213
 	// Get all the messages...
206
-	while ($message = $context['get_message']())
207
-		template_single_post($message);
214
+	while ($message = $context['get_message']()) {
215
+			template_single_post($message);
216
+	}
208 217
 
209 218
 	echo '
210 219
 				</form>
@@ -241,8 +250,9 @@  discard block
 block discarded – undo
241 250
 			<div id="display_jump_to">&nbsp;</div>';
242 251
 
243 252
 	// Show quickreply
244
-	if ($context['can_reply'])
245
-	template_quickreply();
253
+	if ($context['can_reply']) {
254
+		template_quickreply();
255
+	}
246 256
 
247 257
 	// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
248 258
 	echo '
@@ -255,8 +265,8 @@  discard block
 block discarded – undo
255 265
 			</div>';
256 266
 
257 267
 	// Show the moderation button & pop only if user can moderate
258
-	if ($context['can_moderate_forum'] || $context['user']['is_mod'])
259
-		echo '
268
+	if ($context['can_moderate_forum'] || $context['user']['is_mod']) {
269
+			echo '
260 270
 			<div id="mobile_moderation" class="popup_container">
261 271
 				<div class="popup_window description">
262 272
 					<div class="popup_heading">', $txt['mobile_moderation'],'
@@ -266,6 +276,7 @@  discard block
 block discarded – undo
266 276
 					</div>
267 277
 				</div>
268 278
 			</div>';
279
+	}
269 280
 
270 281
 		echo '
271 282
 				<script>';
@@ -389,9 +400,10 @@  discard block
 block discarded – undo
389 400
 						});
390 401
 					}';
391 402
 
392
-	if (!empty($context['ignoredMsgs']))
393
-		echo '
403
+	if (!empty($context['ignoredMsgs'])) {
404
+			echo '
394 405
 					ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');';
406
+	}
395 407
 
396 408
 	echo '
397 409
 				</script>';
@@ -408,8 +420,9 @@  discard block
 block discarded – undo
408 420
 
409 421
 	$ignoring = false;
410 422
 
411
-	if ($message['can_remove'])
412
-		$context['removableMessageIDs'][] = $message['id'];
423
+	if ($message['can_remove']) {
424
+			$context['removableMessageIDs'][] = $message['id'];
425
+	}
413 426
 
414 427
 	// Are we ignoring this message?
415 428
 	if (!empty($message['is_ignored']))
@@ -435,9 +448,10 @@  discard block
 block discarded – undo
435 448
 							<div class="custom_fields_above_member">
436 449
 								<ul class="nolist">';
437 450
 
438
-		foreach ($message['custom_fields']['above_member'] as $custom)
439
-			echo '
451
+		foreach ($message['custom_fields']['above_member'] as $custom) {
452
+					echo '
440 453
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
454
+		}
441 455
 
442 456
 		echo '
443 457
 								</ul>
@@ -448,9 +462,10 @@  discard block
 block discarded – undo
448 462
 									<h4>';
449 463
 
450 464
 	// Show online and offline buttons?
451
-	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
452
-		echo '
465
+	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
466
+			echo '
453 467
 								', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : '';
468
+	}
454 469
 
455 470
 
456 471
 	// Show a link to the member's profile.
@@ -463,51 +478,59 @@  discard block
 block discarded – undo
463 478
 
464 479
 
465 480
 	// Show the user's avatar.
466
-	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
467
-		echo '
481
+	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
482
+			echo '
468 483
 								<li class="avatar">
469 484
 									<a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a>
470 485
 								</li>';
486
+	}
471 487
 
472 488
 	// Are there any custom fields below the avatar?
473
-	if (!empty($message['custom_fields']['below_avatar']))
474
-		foreach ($message['custom_fields']['below_avatar'] as $custom)
489
+	if (!empty($message['custom_fields']['below_avatar'])) {
490
+			foreach ($message['custom_fields']['below_avatar'] as $custom)
475 491
 			echo '
476 492
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
493
+	}
477 494
 
478 495
 	// Show the post group icons, but not for guests.
479
-	if (!$message['member']['is_guest'])
480
-		echo '
496
+	if (!$message['member']['is_guest']) {
497
+			echo '
481 498
 								<li class="icons">', $message['member']['group_icons'], '</li>';
499
+	}
482 500
 
483 501
 	// Show the member's primary group (like 'Administrator') if they have one.
484
-	if (!empty($message['member']['group']))
485
-		echo '
502
+	if (!empty($message['member']['group'])) {
503
+			echo '
486 504
 								<li class="membergroup">', $message['member']['group'], '</li>';
505
+	}
487 506
 
488 507
 	// Show the member's custom title, if they have one.
489
-	if (!empty($message['member']['title']))
490
-		echo '
508
+	if (!empty($message['member']['title'])) {
509
+			echo '
491 510
 								<li class="title">', $message['member']['title'], '</li>';
511
+	}
492 512
 
493 513
 	// Don't show these things for guests.
494 514
 	if (!$message['member']['is_guest'])
495 515
 	{
496 516
 
497 517
 		// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
498
-		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group']))
499
-			echo '
518
+		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) {
519
+					echo '
500 520
 								<li class="postgroup">', $message['member']['post_group'], '</li>';
521
+		}
501 522
 
502 523
 		// Show how many posts they have made.
503
-		if (!isset($context['disabled_fields']['posts']))
504
-			echo '
524
+		if (!isset($context['disabled_fields']['posts'])) {
525
+					echo '
505 526
 								<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
527
+		}
506 528
 
507 529
 		// Show their personal text?
508
-		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb']))
509
-			echo '
530
+		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) {
531
+					echo '
510 532
 								<li class="blurb">', $message['member']['blurb'], '</li>';
533
+		}
511 534
 
512 535
 		// Any custom fields to show as icons?
513 536
 		if (!empty($message['custom_fields']['icons']))
@@ -516,9 +539,10 @@  discard block
 block discarded – undo
516 539
 								<li class="im_icons">
517 540
 									<ol>';
518 541
 
519
-			foreach ($message['custom_fields']['icons'] as $custom)
520
-				echo '
542
+			foreach ($message['custom_fields']['icons'] as $custom) {
543
+							echo '
521 544
 										<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
545
+			}
522 546
 
523 547
 			echo '
524 548
 									</ol>
@@ -533,19 +557,22 @@  discard block
 block discarded – undo
533 557
 									<ol class="profile_icons">';
534 558
 
535 559
 			// Don't show an icon if they haven't specified a website.
536
-			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website']))
537
-				echo '
560
+			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) {
561
+							echo '
538 562
 										<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
563
+			}
539 564
 
540 565
 			// Since we know this person isn't a guest, you *can* message them.
541
-			if ($context['can_send_pm'])
542
-				echo '
566
+			if ($context['can_send_pm']) {
567
+							echo '
543 568
 										<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
569
+			}
544 570
 
545 571
 			// Show the email if necessary
546
-			if (!empty($message['member']['email']) && $message['member']['show_email'])
547
-				echo '
572
+			if (!empty($message['member']['email']) && $message['member']['show_email']) {
573
+							echo '
548 574
 										<li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
575
+			}
549 576
 
550 577
 				echo '
551 578
 									</ol>
@@ -553,48 +580,56 @@  discard block
 block discarded – undo
553 580
 		}
554 581
 
555 582
 		// Any custom fields for standard placement?
556
-		if (!empty($message['custom_fields']['standard']))
557
-			foreach ($message['custom_fields']['standard'] as $custom)
583
+		if (!empty($message['custom_fields']['standard'])) {
584
+					foreach ($message['custom_fields']['standard'] as $custom)
558 585
 				echo '
559 586
 								<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
587
+		}
560 588
 
561 589
 	}
562 590
 	// Otherwise, show the guest's email.
563
-	elseif (!empty($message['member']['email']) && $message['member']['show_email'])
564
-		echo '
591
+	elseif (!empty($message['member']['email']) && $message['member']['show_email']) {
592
+			echo '
565 593
 								<li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
594
+	}
566 595
 
567 596
 	// Show the IP to this user for this post - because you can moderate?
568
-	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
569
-		echo '
597
+	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
598
+			echo '
570 599
 								<li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>';
600
+	}
571 601
 
572 602
 	// Or, should we show it because this is you?
573
-	elseif ($message['can_see_ip'])
574
-		echo '
603
+	elseif ($message['can_see_ip']) {
604
+			echo '
575 605
 								<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>';
606
+	}
576 607
 
577 608
 	// Okay, are you at least logged in? Then we can show something about why IPs are logged...
578
-	elseif (!$context['user']['is_guest'])
579
-		echo '
609
+	elseif (!$context['user']['is_guest']) {
610
+			echo '
580 611
 								<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
612
+	}
581 613
 
582 614
 	// Otherwise, you see NOTHING!
583
-	else
584
-		echo '
615
+	else {
616
+			echo '
585 617
 								<li class="poster_ip">', $txt['logged'], '</li>';
618
+	}
586 619
 
587 620
 	// Are we showing the warning status?
588 621
 	// Don't show these things for guests.
589
-	if (!$message['member']['is_guest'] && $message['member']['can_see_warning'])
590
-		echo '
622
+	if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) {
623
+			echo '
591 624
 								<li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span> ', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
625
+	}
592 626
 
593 627
 	// Are there any custom fields to show at the bottom of the poster info?
594
-	if (!empty($message['custom_fields']['bottom_poster']))
595
-		foreach ($message['custom_fields']['bottom_poster'] as $custom)
628
+	if (!empty($message['custom_fields']['bottom_poster'])) {
629
+			foreach ($message['custom_fields']['bottom_poster'] as $custom)
596 630
 			echo '
597 631
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
632
+	}
598 633
 
599 634
 	// Poster info ends.
600 635
 	echo '
@@ -623,9 +658,10 @@  discard block
 block discarded – undo
623 658
 	echo '
624 659
 									<span class="smalltext modified" id="modified_', $message['id'], '">';
625 660
 
626
-	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name']))
627
-		echo
661
+	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) {
662
+			echo
628 663
 										$message['modified']['last_edit_text'];
664
+	}
629 665
 
630 666
 	echo '
631 667
 									</span>';
@@ -636,22 +672,24 @@  discard block
 block discarded – undo
636 672
 							</div>';
637 673
 
638 674
 	// Ignoring this user? Hide the post.
639
-	if ($ignoring)
640
-		echo '
675
+	if ($ignoring) {
676
+			echo '
641 677
 							<div id="msg_', $message['id'], '_ignored_prompt">
642 678
 								', $txt['ignoring_user'], '
643 679
 								<a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
644 680
 							</div>';
681
+	}
645 682
 
646 683
 	// Show the post itself, finally!
647 684
 	echo '
648 685
 							<div class="post">';
649 686
 
650
-	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
651
-		echo '
687
+	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) {
688
+			echo '
652 689
 								<div class="approve_post">
653 690
 									', $txt['post_awaiting_approval'], '
654 691
 								</div>';
692
+	}
655 693
 	echo '
656 694
 								<div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div>
657 695
 							</div>';
@@ -668,9 +706,9 @@  discard block
 block discarded – undo
668 706
 		foreach ($message['attachment'] as $attachment)
669 707
 		{
670 708
 			// Do we want this attachment to not be showed here?
671
-			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']]))
672
-				continue;
673
-			elseif (!$div_output)
709
+			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) {
710
+							continue;
711
+			} elseif (!$div_output)
674 712
 			{
675 713
 				$div_output = true;
676 714
 
@@ -686,9 +724,10 @@  discard block
 block discarded – undo
686 724
 								<fieldset>
687 725
 									<legend>', $txt['attach_awaiting_approve'];
688 726
 
689
-				if ($context['can_approve'])
690
-					echo '
727
+				if ($context['can_approve']) {
728
+									echo '
691 729
 										&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
730
+				}
692 731
 
693 732
 				echo '
694 733
 									</legend>';
@@ -702,12 +741,13 @@  discard block
 block discarded – undo
702 741
 				echo '
703 742
 										<div class="attachments_top">';
704 743
 
705
-				if ($attachment['thumbnail']['has_thumb'])
706
-					echo '
744
+				if ($attachment['thumbnail']['has_thumb']) {
745
+									echo '
707 746
 											<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>';
708
-				else
709
-					echo '
747
+				} else {
748
+									echo '
710 749
 											<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">';
750
+				}
711 751
 
712 752
 				echo '
713 753
 										</div>';
@@ -717,9 +757,10 @@  discard block
 block discarded – undo
717 757
 										<div class="attachments_bot">
718 758
 											<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*">&nbsp;' . $attachment['name'] . '</a> ';
719 759
 
720
-			if (!$attachment['is_approved'] && $context['can_approve'])
721
-				echo '
760
+			if (!$attachment['is_approved'] && $context['can_approve']) {
761
+							echo '
722 762
 											[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
763
+			}
723 764
 			echo '
724 765
 											<br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), '
725 766
 										</div>';
@@ -728,33 +769,38 @@  discard block
 block discarded – undo
728 769
 									</div>';
729 770
 
730 771
 			// Next attachment line ?
731
-			if (++$i % $attachments_per_line === 0)
732
-				echo '
772
+			if (++$i % $attachments_per_line === 0) {
773
+							echo '
733 774
 									<br>';
775
+			}
734 776
 		}
735 777
 
736 778
 		// If we had unapproved attachments clean up.
737
-		if ($last_approved_state == 0)
738
-			echo '
779
+		if ($last_approved_state == 0) {
780
+					echo '
739 781
 								</fieldset>';
782
+		}
740 783
 
741 784
 		// Only do this if we output a div above - otherwise it'll break things
742
-		if ($div_output)
743
-			echo '
785
+		if ($div_output) {
786
+					echo '
744 787
 							</div>';
788
+		}
745 789
 	}
746 790
 
747 791
 	// And stuff below the attachments.
748
-	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
749
-	echo '
792
+	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) {
793
+		echo '
750 794
 							<div class="under_message">';
795
+	}
751 796
 
752 797
 	// Maybe they want to report this post to the moderator(s)?
753
-	if ($context['can_report_moderator'])
754
-		echo '
798
+	if ($context['can_report_moderator']) {
799
+			echo '
755 800
 								<ul class="floatright smalltext">
756 801
 									<li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>
757 802
 								</ul>';
803
+	}
758 804
 
759 805
 	// What about likes?
760 806
 	if (!empty($modSettings['enable_likes']))
@@ -795,78 +841,91 @@  discard block
 block discarded – undo
795 841
 								<ul class="quickbuttons">';
796 842
 
797 843
 		// Can they quote? if so they can select and quote as well!
798
-		if ($context['can_quote'])
799
-			echo '
844
+		if ($context['can_quote']) {
845
+					echo '
800 846
 									<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>
801 847
 									<li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>';
848
+		}
802 849
 
803 850
 		// Can the user modify the contents of this post? Show the modify inline image.
804
-		if ($message['can_modify'])
805
-			echo '
851
+		if ($message['can_modify']) {
852
+					echo '
806 853
 									<li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>';
854
+		}
807 855
 
808
-		if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
809
-			echo '
856
+		if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
857
+					echo '
810 858
 									<li class="post_options">', $txt['post_options'];
859
+		}
811 860
 
812 861
 		echo '
813 862
 										<ul>';
814 863
 
815 864
 		// Can the user modify the contents of this post?
816
-		if ($message['can_modify'])
817
-			echo '
865
+		if ($message['can_modify']) {
866
+					echo '
818 867
 											<li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>';
868
+		}
819 869
 
820 870
 		// How about... even... remove it entirely?!
821
-		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id']))
822
-			echo '
871
+		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) {
872
+					echo '
823 873
 											<li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'],'</a></li>';
824
-		elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id']))
825
-			echo '
874
+		} elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) {
875
+					echo '
826 876
 											<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
877
+		}
827 878
 
828 879
 		// What about splitting it off the rest of the topic?
829
-		if ($context['can_split'] && !empty($context['real_num_replies']))
830
-			echo '
880
+		if ($context['can_split'] && !empty($context['real_num_replies'])) {
881
+					echo '
831 882
 											<li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>';
883
+		}
832 884
 
833 885
 		// Can we issue a warning because of this post? Remember, we can't give guests warnings.
834
-		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
835
-			echo '
886
+		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) {
887
+					echo '
836 888
 											<li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>';
889
+		}
837 890
 
838 891
 		// Can we restore topics?
839
-		if ($context['can_restore_msg'])
840
-			echo '
892
+		if ($context['can_restore_msg']) {
893
+					echo '
841 894
 											<li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>';
895
+		}
842 896
 
843 897
 		// Maybe we can approve it, maybe we should?
844
-		if ($message['can_approve'])
845
-			echo '
898
+		if ($message['can_approve']) {
899
+					echo '
846 900
 											<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>';
901
+		}
847 902
 
848 903
 		// Maybe we can unapprove it?
849
-		if ($message['can_unapprove'])
850
-			echo '
904
+		if ($message['can_unapprove']) {
905
+					echo '
851 906
 											<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>';
907
+		}
852 908
 
853 909
 		echo '
854 910
 										</ul>
855 911
 									</li>';
856 912
 
857 913
 		// Show a checkbox for quick moderation?
858
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
859
-			echo '
914
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) {
915
+					echo '
860 916
 									<li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
917
+		}
861 918
 
862
-		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
863
-			echo '
919
+		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
920
+					echo '
864 921
 								</ul>';
922
+		}
865 923
 	}
866 924
 
867
-	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
868
-	echo '
925
+	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) {
926
+		echo '
869 927
 							</div>';
928
+	}
870 929
 
871 930
 	echo '
872 931
 						</div>
@@ -879,9 +938,10 @@  discard block
 block discarded – undo
879 938
 							<div class="custom_fields_above_signature">
880 939
 								<ul class="nolist">';
881 940
 
882
-		foreach ($message['custom_fields']['above_signature'] as $custom)
883
-			echo '
941
+		foreach ($message['custom_fields']['above_signature'] as $custom) {
942
+					echo '
884 943
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
944
+		}
885 945
 
886 946
 		echo '
887 947
 								</ul>
@@ -889,9 +949,10 @@  discard block
 block discarded – undo
889 949
 	}
890 950
 
891 951
 	// Show the member's signature?
892
-	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
893
-		echo '
952
+	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
953
+			echo '
894 954
 							<div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>';
955
+	}
895 956
 
896 957
 
897 958
 	// Are there any custom profile fields for below the signature?
@@ -901,9 +962,10 @@  discard block
 block discarded – undo
901 962
 							<div class="custom_fields_below_signature">
902 963
 								<ul class="nolist">';
903 964
 
904
-		foreach ($message['custom_fields']['below_signature'] as $custom)
905
-			echo '
965
+		foreach ($message['custom_fields']['below_signature'] as $custom) {
966
+					echo '
906 967
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
968
+		}
907 969
 
908 970
 		echo '
909 971
 								</ul>
@@ -951,8 +1013,8 @@  discard block
 block discarded – undo
951 1013
 						<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">';
952 1014
 
953 1015
 		// Guests just need more.
954
-		if ($context['user']['is_guest'])
955
-			echo '
1016
+		if ($context['user']['is_guest']) {
1017
+					echo '
956 1018
 						<dl id="post_header">
957 1019
 							<dt>
958 1020
 								', $txt['name'], ':
@@ -967,6 +1029,7 @@  discard block
 block discarded – undo
967 1029
 								<input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required>
968 1030
 							</dd>
969 1031
 						</dl>';
1032
+		}
970 1033
 
971 1034
 		echo '
972 1035
 						', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '
@@ -1014,8 +1077,8 @@  discard block
 block discarded – undo
1014 1077
 		<br class="clear">';
1015 1078
 
1016 1079
 	// draft autosave available and the user has it enabled?
1017
-	if (!empty($context['drafts_autosave']))
1018
-		echo '
1080
+	if (!empty($context['drafts_autosave'])) {
1081
+			echo '
1019 1082
 			<script>
1020 1083
 				var oDraftAutoSave = new smf_DraftAutoSave({
1021 1084
 					sSelf: \'oDraftAutoSave\',
@@ -1027,10 +1090,12 @@  discard block
 block discarded – undo
1027 1090
 					iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), '
1028 1091
 				});
1029 1092
 			</script>';
1093
+	}
1030 1094
 
1031
-	if ($context['show_spellchecking'])
1032
-		echo '
1095
+	if ($context['show_spellchecking']) {
1096
+			echo '
1033 1097
 			<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>';
1098
+	}
1034 1099
 
1035 1100
 	echo '
1036 1101
 				<script>
Please login to merge, or discard this patch.
Themes/default/GenericMenu.template.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		<a class="menu_icon mobile_generic_menu_', $context['cur_menu_id'], '"></a>
53 53
 		<div id="mobile_generic_menu_', $context['cur_menu_id'], '" class="popup_container">
54 54
 			<div class="popup_window description">
55
-				<div class="popup_heading">', $txt['mobile_user_menu'],'
55
+				<div class="popup_heading">', $txt['mobile_user_menu'], '
56 56
 				<a href="javascript:void(0);" class="generic_icons hide_popup"></a></div>
57 57
 				', template_generic_menu($menu_context), '
58 58
 			</div>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		</script>';
68 68
 }
69 69
 
70
-function template_generic_menu (&$menu_context)
70
+function template_generic_menu(&$menu_context)
71 71
 {
72 72
 	global $context;
73 73
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	foreach ($menu_context['sections'] as $section)
82 82
 	{
83 83
 		echo '
84
-						<li ', !empty($section['areas']) ? 'class="subsections"' : '', '><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'] , '</a>
84
+						<li ', !empty($section['areas']) ? 'class="subsections"' : '', '><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'], '</a>
85 85
 							<ul>';
86 86
 
87 87
 		// For every area of this section show a link to that area (bold if it's currently selected.)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 				echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
221 221
 
222 222
 			if (!empty($selected_tab['help']) || !empty($tab_context['help']))
223
-				echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>';
223
+				echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>';
224 224
 
225 225
 			echo $tab_context['title'];
226 226
 		}
Please login to merge, or discard this patch.
Braces   +50 added lines, -37 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
 		foreach ($section['areas'] as $i => $area)
90 90
 		{
91 91
 			// Not supposed to be printed?
92
-			if (empty($area['label']))
93
-				continue;
92
+			if (empty($area['label'])) {
93
+							continue;
94
+			}
94 95
 
95 96
 			echo '
96 97
 								<li', !empty($area['subsections']) ? ' class="subsections"' : '', '>';
@@ -99,8 +100,9 @@  discard block
 block discarded – undo
99 100
 									<a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>';
100 101
 
101 102
 			// Is this the current area, or just some area?
102
-			if (!empty($area['selected']) && empty($context['tabs']))
103
-					$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
103
+			if (!empty($area['selected']) && empty($context['tabs'])) {
104
+								$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
105
+			}
104 106
 
105 107
 			// Are there any subsections?
106 108
 			if (!empty($area['subsections']))
@@ -110,8 +112,9 @@  discard block
 block discarded – undo
110 112
 
111 113
 				foreach ($area['subsections'] as $sa => $sub)
112 114
 				{
113
-					if (!empty($sub['disabled']))
114
-						continue;
115
+					if (!empty($sub['disabled'])) {
116
+											continue;
117
+					}
115 118
 
116 119
 					$url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;
117 120
 
@@ -158,8 +161,9 @@  discard block
 block discarded – undo
158 161
 							<h3 class="catbg">';
159 162
 
160 163
 		// The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available
161
-		if (function_exists('template_admin_quick_search'))
162
-			template_admin_quick_search();
164
+		if (function_exists('template_admin_quick_search')) {
165
+					template_admin_quick_search();
166
+		}
163 167
 
164 168
 		// Exactly how many tabs do we have?
165 169
 		if (!empty($context['tabs']))
@@ -174,30 +178,36 @@  discard block
 block discarded – undo
174 178
 				}
175 179
 
176 180
 				// Did this not even exist - or do we not have a label?
177
-				if (!isset($tab_context['tabs'][$id]))
178
-					$tab_context['tabs'][$id] = array('label' => $tab['label']);
179
-				elseif (!isset($tab_context['tabs'][$id]['label']))
180
-					$tab_context['tabs'][$id]['label'] = $tab['label'];
181
+				if (!isset($tab_context['tabs'][$id])) {
182
+									$tab_context['tabs'][$id] = array('label' => $tab['label']);
183
+				} elseif (!isset($tab_context['tabs'][$id]['label'])) {
184
+									$tab_context['tabs'][$id]['label'] = $tab['label'];
185
+				}
181 186
 
182 187
 				// Has a custom URL defined in the main admin structure?
183
-				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
184
-					$tab_context['tabs'][$id]['url'] = $tab['url'];
188
+				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) {
189
+									$tab_context['tabs'][$id]['url'] = $tab['url'];
190
+				}
185 191
 
186 192
 				// Any additional paramaters for the url?
187
-				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
188
-					$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
193
+				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) {
194
+									$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
195
+				}
189 196
 
190 197
 				// Has it been deemed selected?
191
-				if (!empty($tab['is_selected']))
192
-					$tab_context['tabs'][$id]['is_selected'] = true;
198
+				if (!empty($tab['is_selected'])) {
199
+									$tab_context['tabs'][$id]['is_selected'] = true;
200
+				}
193 201
 
194 202
 				// Does it have its own help?
195
-				if (!empty($tab['help']))
196
-					$tab_context['tabs'][$id]['help'] = $tab['help'];
203
+				if (!empty($tab['help'])) {
204
+									$tab_context['tabs'][$id]['help'] = $tab['help'];
205
+				}
197 206
 
198 207
 				// Is this the last one?
199
-				if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
200
-					$tab_context['tabs'][$id]['is_last'] = true;
208
+				if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) {
209
+									$tab_context['tabs'][$id]['is_last'] = true;
210
+				}
201 211
 			}
202 212
 
203 213
 			// Find the selected tab
@@ -214,17 +224,18 @@  discard block
 block discarded – undo
214 224
 		// Show an icon and/or a help item?
215 225
 		if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help']))
216 226
 		{
217
-			if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']))
218
-				echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
219
-			elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon']))
220
-				echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
227
+			if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) {
228
+							echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
229
+			} elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) {
230
+							echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
231
+			}
221 232
 
222
-			if (!empty($selected_tab['help']) || !empty($tab_context['help']))
223
-				echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>';
233
+			if (!empty($selected_tab['help']) || !empty($tab_context['help'])) {
234
+							echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>';
235
+			}
224 236
 
225 237
 			echo $tab_context['title'];
226
-		}
227
-		else
238
+		} else
228 239
 		{
229 240
 			echo '
230 241
 							', $tab_context['title'];
@@ -237,11 +248,12 @@  discard block
 block discarded – undo
237 248
 	}
238 249
 
239 250
 	// Shall we use the tabs? Yes, it's the only known way!
240
-	if (!empty($selected_tab['description']) || !empty($tab_context['description']))
241
-		echo '
251
+	if (!empty($selected_tab['description']) || !empty($tab_context['description'])) {
252
+			echo '
242 253
 					<p class="information">
243 254
 						', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
244 255
 					</p>';
256
+	}
245 257
 
246 258
 	// Print out all the items in this tab (if any).
247 259
 	if (!empty($context['tabs']))
@@ -253,8 +265,9 @@  discard block
 block discarded – undo
253 265
 
254 266
 		foreach ($tab_context['tabs'] as $sa => $tab)
255 267
 		{
256
-			if (!empty($tab['disabled']))
257
-				continue;
268
+			if (!empty($tab['disabled'])) {
269
+							continue;
270
+			}
258 271
 
259 272
 			if (!empty($tab['is_selected']))
260 273
 			{
@@ -262,12 +275,12 @@  discard block
 block discarded – undo
262 275
 							<li>
263 276
 								<a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
264 277
 							</li>';
265
-			}
266
-			else
267
-				echo '
278
+			} else {
279
+							echo '
268 280
 							<li>
269 281
 								<a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
270 282
 							</li>';
283
+			}
271 284
 		}
272 285
 
273 286
 		// the end of tabs
Please login to merge, or discard this patch.
Themes/default/Themes.template.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 					</dd>';
614 614
 		}
615 615
 		// A Textarea?
616
-        	elseif ($setting['type'] == 'textarea')
616
+			elseif ($setting['type'] == 'textarea')
617 617
 		{
618 618
 			echo '
619 619
 					<dt>
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 					</dt>
627 627
 					<dd>
628 628
 						<textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>';
629
-                echo '
629
+				echo '
630 630
                 			</dd>';
631 631
 		}
632 632
 		// A regular input box, then?
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	echo '
25 25
 		<div class="cat_bar">
26 26
 		<h3 class="catbg">
27
-			<a href="', $scripturl, '?action=helpadmin;help=themes" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>
27
+			<a href="', $scripturl, '?action=helpadmin;help=themes" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>
28 28
 			', $txt['themeadmin_title'], '
29 29
 		</h3>
30 30
 		</div>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	if (isset($_GET['done']))
193 193
 		echo '
194 194
 	<div class="infobox">
195
-		', $txt['theme_confirmed_'. $_GET['done']] ,'
195
+		', $txt['theme_confirmed_' . $_GET['done']], '
196 196
 	</div>';
197 197
 
198 198
 	echo '
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 			<div class="cat_bar">
219 219
 				<h3 class="catbg">
220 220
 					<span class="floatleft">
221
-						', (!empty($theme['enable']) || $theme['id'] == 1 ? '<a href="'. $scripturl .'?action=admin;area=theme;th='. $theme['id'] .';'. $context['session_var'] .'='. $context['session_id'] .';sa=list">'. $theme['name'] .'</a>' : $theme['name'] ),'', (!empty($theme['version']) ? ' <em>(' . $theme['version'] . ')</em>' : ''), '
221
+						', (!empty($theme['enable']) || $theme['id'] == 1 ? '<a href="' . $scripturl . '?action=admin;area=theme;th=' . $theme['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';sa=list">' . $theme['name'] . '</a>' : $theme['name']), '', (!empty($theme['version']) ? ' <em>(' . $theme['version'] . ')</em>' : ''), '
222 222
 					</span>';
223 223
 
224 224
 			// You *cannot* disable/enable/delete the default theme. It's important!
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
 				// Enable/Disable.
231 231
 				echo '
232
-					<a href="', $scripturl, '?action=admin;area=theme;sa=enable;th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['admin-tre_token_var'], '=', $context['admin-tre_token'], '', (!empty($theme['enable']) ? ';disabled' : '') ,'" data-confirm="', $txt['theme_'. (!empty($theme['enable']) ? 'disable' : 'enable') .'_confirm'], '" class="you_sure"><span class="generic_icons ',!empty($theme['enable']) ? 'disable' : 'enable','" title="', $txt['theme_'. (!empty($theme['enable']) ? 'disable' : 'enable')] ,'"></span></a>';
232
+					<a href="', $scripturl, '?action=admin;area=theme;sa=enable;th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['admin-tre_token_var'], '=', $context['admin-tre_token'], '', (!empty($theme['enable']) ? ';disabled' : ''), '" data-confirm="', $txt['theme_' . (!empty($theme['enable']) ? 'disable' : 'enable') . '_confirm'], '" class="you_sure"><span class="generic_icons ', !empty($theme['enable']) ? 'disable' : 'enable', '" title="', $txt['theme_' . (!empty($theme['enable']) ? 'disable' : 'enable')], '"></span></a>';
233 233
 
234 234
 				// Deleting.
235 235
 				echo '
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 		<form action="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['theme_settings']['theme_id'], '" method="post" accept-charset="', $context['character_set'], '">
457 457
 			<div class="cat_bar">
458 458
 				<h3 class="catbg">
459
-					<a href="', $scripturl, '?action=helpadmin;help=theme_settings" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ', $txt['theme_settings'], ' - ', $context['theme_settings']['name'], '
459
+					<a href="', $scripturl, '?action=helpadmin;help=theme_settings" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ', $txt['theme_settings'], ' - ', $context['theme_settings']['name'], '
460 460
 				</h3>
461 461
 			</div>
462 462
 			<br>';
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 			echo '
626 626
 					</dt>
627 627
 					<dd>
628
-						<textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>';
628
+						<textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>';
629 629
                 echo '
630 630
                 			</dd>';
631 631
 		}
@@ -809,14 +809,14 @@  discard block
 block discarded – undo
809 809
 	if (!empty($context['error_message']))
810 810
 		echo '
811 811
 			<p>
812
-				', $context['error_message'] ,'
812
+				', $context['error_message'], '
813 813
 			</p>';
814 814
 
815 815
 	// Not much to show except a link back...
816 816
 	else
817 817
 		echo '
818 818
 			<p>
819
-				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_'. (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') .'_message'], '
819
+				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], '
820 820
 			</p>
821 821
 			<p>
822 822
 				<a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a>
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
 		echo '
1157 1157
 				<label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br>
1158 1158
 				<div class="centertext">
1159
-					<textarea id="on_line', $part['line'] ,'" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1159
+					<textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1160 1160
 				</div>';
1161 1161
 
1162 1162
 	echo '
Please login to merge, or discard this patch.
Braces   +106 added lines, -78 removed lines patch added patch discarded remove patch
@@ -54,9 +54,10 @@  discard block
 block discarded – undo
54 54
 					<dd>
55 55
 						<div id="known_themes_list">';
56 56
 
57
-	foreach ($context['themes'] as $theme)
58
-		echo '
57
+	foreach ($context['themes'] as $theme) {
58
+			echo '
59 59
 							<label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>';
60
+	}
60 61
 
61 62
 		echo '
62 63
 						</div>
@@ -73,9 +74,10 @@  discard block
 block discarded – undo
73 74
 						<select name="options[theme_guests]" id="theme_guests">';
74 75
 
75 76
 	// Put an option for each theme in the select box.
76
-	foreach ($context['themes'] as $theme)
77
-		echo '
77
+	foreach ($context['themes'] as $theme) {
78
+			echo '
78 79
 							<option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';
80
+	}
79 81
 
80 82
 	echo '
81 83
 						</select>
@@ -90,9 +92,10 @@  discard block
 block discarded – undo
90 92
 							<option value="0">', $txt['theme_forum_default'], '</option>';
91 93
 
92 94
 	// Same thing, this time for changing the theme of everyone.
93
-	foreach ($context['themes'] as $theme)
94
-		echo '
95
+	foreach ($context['themes'] as $theme) {
96
+			echo '
95 97
 							<option value="', $theme['id'], '">', $theme['name'], '</option>';
98
+	}
96 99
 
97 100
 	echo '
98 101
 						</select>
@@ -189,11 +192,12 @@  discard block
 block discarded – undo
189 192
 	global $context, $scripturl, $txt;
190 193
 
191 194
 	// Show a nice confirmation message.
192
-	if (isset($_GET['done']))
193
-		echo '
195
+	if (isset($_GET['done'])) {
196
+			echo '
194 197
 	<div class="infobox">
195 198
 		', $txt['theme_confirmed_'. $_GET['done']] ,'
196 199
 	</div>';
200
+	}
197 201
 
198 202
 	echo '
199 203
 	<div id="admincenter">';
@@ -353,22 +357,24 @@  discard block
 block discarded – undo
353 357
 					<dt ', $context['theme_options_reset'] ? 'style="width:50%"' : '', '>';
354 358
 
355 359
 		// Show the change option box ?
356
-		if ($context['theme_options_reset'])
357
-			echo '
360
+		if ($context['theme_options_reset']) {
361
+					echo '
358 362
 						<span class="floatleft"><select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;">
359 363
 							<option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option>
360 364
 							<option value="1">', $txt['themeadmin_reset_options_change'], '</option>
361 365
 							<option value="2">', $txt['themeadmin_reset_options_default'], '</option>
362 366
 						</select>&nbsp;</span>';
367
+		}
363 368
 
364 369
 		// display checkbox options
365 370
 		if ($setting['type'] == 'checkbox')
366 371
 		{
367 372
 			echo '
368 373
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
369
-			if (isset($setting['description']))
370
-				echo '
374
+			if (isset($setting['description'])) {
375
+							echo '
371 376
 						<br><span class="smalltext">', $setting['description'], '</span>';
377
+			}
372 378
 		echo '
373 379
 					</dt>
374 380
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>
@@ -380,9 +386,10 @@  discard block
 block discarded – undo
380 386
 		{
381 387
 			echo '
382 388
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
383
-			if (isset($setting['description']))
384
-				echo '
389
+			if (isset($setting['description'])) {
390
+							echo '
385 391
 						<br><span class="smalltext">', $setting['description'], '</span>';
392
+			}
386 393
 		echo '
387 394
 					</dt>
388 395
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>
@@ -402,9 +409,10 @@  discard block
 block discarded – undo
402 409
 		{
403 410
 			echo '
404 411
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
405
-			if (isset($setting['description']))
406
-				echo '
412
+			if (isset($setting['description'])) {
413
+							echo '
407 414
 						<br><span class="smalltext">', $setting['description'], '</span>';
415
+			}
408 416
 		echo '
409 417
 					</dt>
410 418
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>';
@@ -417,8 +425,7 @@  discard block
 block discarded – undo
417 425
 
418 426
 				echo '
419 427
 						<input type="number"', $min . $max . $step;
420
-			}
421
-			else
428
+			} else
422 429
 			{
423 430
 				echo '
424 431
 						<input type="text"';
@@ -462,8 +469,8 @@  discard block
 block discarded – undo
462 469
 			<br>';
463 470
 
464 471
 	// @todo Why can't I edit the default theme popup.
465
-	if ($context['theme_settings']['theme_id'] != 1)
466
-		echo '
472
+	if ($context['theme_settings']['theme_id'] != 1) {
473
+			echo '
467 474
 			<div class="cat_bar">
468 475
 				<h3 class="catbg config_hd">
469 476
 					', $txt['theme_edit'], '
@@ -479,6 +486,7 @@  discard block
 block discarded – undo
479 486
 					</li>
480 487
 				</ul>
481 488
 			</div>';
489
+	}
482 490
 
483 491
 	echo '
484 492
 			<div class="cat_bar">
@@ -532,9 +540,10 @@  discard block
 block discarded – undo
532 540
 					<dd>
533 541
 						<select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">';
534 542
 
535
-		foreach ($context['theme_variants'] as $key => $variant)
536
-			echo '
543
+		foreach ($context['theme_variants'] as $key => $variant) {
544
+					echo '
537 545
 							<option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>';
546
+		}
538 547
 
539 548
 		echo '
540 549
 						</select>
@@ -577,9 +586,10 @@  discard block
 block discarded – undo
577 586
 					<dt>
578 587
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
579 588
 
580
-			if (isset($setting['description']))
581
-				echo '<br>
589
+			if (isset($setting['description'])) {
590
+							echo '<br>
582 591
 						<span class="smalltext">', $setting['description'], '</span>';
592
+			}
583 593
 
584 594
 			echo '
585 595
 					</dt>
@@ -595,18 +605,20 @@  discard block
 block discarded – undo
595 605
 					<dt>
596 606
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
597 607
 
598
-			if (isset($setting['description']))
599
-				echo '<br>
608
+			if (isset($setting['description'])) {
609
+							echo '<br>
600 610
 						<span class="smalltext">', $setting['description'], '</span>';
611
+			}
601 612
 
602 613
 			echo '
603 614
 					</dt>
604 615
 					<dd>
605 616
 						<select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">';
606 617
 
607
-			foreach ($setting['options'] as $value => $label)
608
-				echo '
618
+			foreach ($setting['options'] as $value => $label) {
619
+							echo '
609 620
 							<option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>';
621
+			}
610 622
 
611 623
 			echo '
612 624
 						</select>
@@ -619,9 +631,10 @@  discard block
 block discarded – undo
619 631
 					<dt>
620 632
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
621 633
 
622
-			if (isset($setting['description']))
623
-				echo '<br>
634
+			if (isset($setting['description'])) {
635
+							echo '<br>
624 636
 						<span class="smalltext">', $setting['description'], '</span>';
637
+			}
625 638
 			echo '
626 639
 					</dt>
627 640
 					<dd>
@@ -636,9 +649,10 @@  discard block
 block discarded – undo
636 649
 					<dt>
637 650
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
638 651
 
639
-			if (isset($setting['description']))
640
-				echo '<br>
652
+			if (isset($setting['description'])) {
653
+							echo '<br>
641 654
 						<span class="smalltext">', $setting['description'], '</span>';
655
+			}
642 656
 
643 657
 			echo '
644 658
 					</dt>
@@ -652,8 +666,7 @@  discard block
 block discarded – undo
652 666
 
653 667
 				echo '
654 668
 						<input type="number"', $min . $max . $step;
655
-			}
656
-			else
669
+			} else
657 670
 			{
658 671
 				echo '
659 672
 						<input type="text"';
@@ -806,21 +819,23 @@  discard block
 block discarded – undo
806 819
 		<div class="windowbg">';
807 820
 
808 821
 	// Oops! there was an error :(
809
-	if (!empty($context['error_message']))
810
-		echo '
822
+	if (!empty($context['error_message'])) {
823
+			echo '
811 824
 			<p>
812 825
 				', $context['error_message'] ,'
813 826
 			</p>';
827
+	}
814 828
 
815 829
 	// Not much to show except a link back...
816
-	else
817
-		echo '
830
+	else {
831
+			echo '
818 832
 			<p>
819 833
 				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_'. (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') .'_message'], '
820 834
 			</p>
821 835
 			<p>
822 836
 				<a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a>
823 837
 			</p>';
838
+	}
824 839
 
825 840
 	echo '
826 841
 		</div>
@@ -887,10 +902,11 @@  discard block
 block discarded – undo
887 902
 					<span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span>
888 903
 					<span class="floatright">';
889 904
 
890
-		if ($template['can_copy'])
891
-			echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
892
-		else
893
-			echo $txt['themeadmin_edit_no_copy'];
905
+		if ($template['can_copy']) {
906
+					echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
907
+		} else {
908
+					echo $txt['themeadmin_edit_no_copy'];
909
+		}
894 910
 
895 911
 		echo '
896 912
 					</span>
@@ -913,11 +929,12 @@  discard block
 block discarded – undo
913 929
 	echo '
914 930
 	<div id="admincenter">';
915 931
 
916
-	if (!empty($context['browse_title']))
917
-		echo '
932
+	if (!empty($context['browse_title'])) {
933
+			echo '
918 934
 		<div class="cat_bar">
919 935
 			<h3 class="catbg">', $context['browse_title'], '</h3>
920 936
 		</div>';
937
+	}
921 938
 
922 939
 	echo '
923 940
 		<table class="table_grid tborder">
@@ -937,14 +954,13 @@  discard block
 block discarded – undo
937 954
 			<tr class="windowbg">
938 955
 				<td>';
939 956
 
940
-		if ($file['is_editable'])
941
-			echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
942
-
943
-		elseif ($file['is_directory'])
944
-			echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
945
-
946
-		else
947
-			echo $file['filename'];
957
+		if ($file['is_editable']) {
958
+					echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
959
+		} elseif ($file['is_directory']) {
960
+					echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
961
+		} else {
962
+					echo $file['filename'];
963
+		}
948 964
 
949 965
 		echo '
950 966
 				</td>
@@ -966,11 +982,12 @@  discard block
 block discarded – undo
966 982
 {
967 983
 	global $context, $settings, $scripturl, $txt;
968 984
 
969
-	if ($context['session_error'])
970
-		echo '
985
+	if ($context['session_error']) {
986
+			echo '
971 987
 	<div class="errorbox">
972 988
 		', $txt['error_session_timeout'], '
973 989
 	</div>';
990
+	}
974 991
 
975 992
 	// From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com.
976 993
 	echo '
@@ -1033,17 +1050,18 @@  discard block
 block discarded – undo
1033 1050
 					try
1034 1051
 					{
1035 1052
 					';
1036
-	if (isBrowser('is_ie'))
1037
-		echo '
1053
+	if (isBrowser('is_ie')) {
1054
+			echo '
1038 1055
 						var sheets = frames["css_preview_box"].document.styleSheets;
1039 1056
 						for (var j = 0; j < sheets.length; j++)
1040 1057
 						{
1041 1058
 							if (sheets[j].id == "css_preview_box")
1042 1059
 								sheets[j].cssText = document.forms.stylesheetForm.entire_file.value;
1043 1060
 						}';
1044
-	else
1045
-		echo '
1061
+	} else {
1062
+			echo '
1046 1063
 						setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);';
1064
+	}
1047 1065
 	echo '
1048 1066
 					}
1049 1067
 					catch (e)
@@ -1095,9 +1113,10 @@  discard block
 block discarded – undo
1095 1113
 			</div>
1096 1114
 			<div class="windowbg">';
1097 1115
 
1098
-	if (!$context['allow_save'])
1099
-		echo '
1116
+	if (!$context['allow_save']) {
1117
+			echo '
1100 1118
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1119
+	}
1101 1120
 
1102 1121
 	echo '
1103 1122
 				<textarea name="entire_file" cols="80" rows="20" style="width: 96%; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br>
@@ -1110,9 +1129,10 @@  discard block
 block discarded – undo
1110 1129
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1111 1130
 
1112 1131
 	// Hopefully it exists.
1113
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1114
-		echo '
1132
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1133
+			echo '
1115 1134
 			<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1135
+	}
1116 1136
 
1117 1137
 	echo '
1118 1138
 		</form>
@@ -1126,18 +1146,20 @@  discard block
 block discarded – undo
1126 1146
 {
1127 1147
 	global $context, $scripturl, $txt;
1128 1148
 
1129
-	if ($context['session_error'])
1130
-		echo '
1149
+	if ($context['session_error']) {
1150
+			echo '
1131 1151
 	<div class="errorbox">
1132 1152
 		', $txt['error_session_timeout'], '
1133 1153
 	</div>';
1154
+	}
1134 1155
 
1135
-	if (isset($context['parse_error']))
1136
-		echo '
1156
+	if (isset($context['parse_error'])) {
1157
+			echo '
1137 1158
 	<div class="errorbox">
1138 1159
 		', $txt['themeadmin_edit_error'], '
1139 1160
 			<div><pre>', $context['parse_error'], '</pre></div>
1140 1161
 	</div>';
1162
+	}
1141 1163
 
1142 1164
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1143 1165
 	echo '
@@ -1148,16 +1170,18 @@  discard block
 block discarded – undo
1148 1170
 			</div>
1149 1171
 			<div class="windowbg">';
1150 1172
 
1151
-	if (!$context['allow_save'])
1152
-		echo '
1173
+	if (!$context['allow_save']) {
1174
+			echo '
1153 1175
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1176
+	}
1154 1177
 
1155
-	foreach ($context['file_parts'] as $part)
1156
-		echo '
1178
+	foreach ($context['file_parts'] as $part) {
1179
+			echo '
1157 1180
 				<label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br>
1158 1181
 				<div class="centertext">
1159 1182
 					<textarea id="on_line', $part['line'] ,'" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1160 1183
 				</div>';
1184
+	}
1161 1185
 
1162 1186
 	echo '
1163 1187
 				<div class="padding righttext">
@@ -1166,9 +1190,10 @@  discard block
 block discarded – undo
1166 1190
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1167 1191
 
1168 1192
 	// Hopefully it exists.
1169
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1170
-		echo '
1193
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1194
+			echo '
1171 1195
 					<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1196
+	}
1172 1197
 
1173 1198
 	echo '
1174 1199
 				</div>
@@ -1184,18 +1209,20 @@  discard block
 block discarded – undo
1184 1209
 {
1185 1210
 	global $context, $scripturl, $txt;
1186 1211
 
1187
-	if ($context['session_error'])
1188
-		echo '
1212
+	if ($context['session_error']) {
1213
+			echo '
1189 1214
 	<div class="errorbox">
1190 1215
 		', $txt['error_session_timeout'], '
1191 1216
 	</div>';
1217
+	}
1192 1218
 
1193 1219
 	//Is this file writeable?
1194
-	if (!$context['allow_save'])
1195
-		echo '
1220
+	if (!$context['allow_save']) {
1221
+			echo '
1196 1222
 	<div class="errorbox">
1197 1223
 		', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '
1198 1224
 	</div>';
1225
+	}
1199 1226
 
1200 1227
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1201 1228
 	echo '
@@ -1211,9 +1238,10 @@  discard block
 block discarded – undo
1211 1238
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1212 1239
 
1213 1240
 	// Hopefully it exists.
1214
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1215
-		echo '
1241
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1242
+			echo '
1216 1243
 				<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1244
+	}
1217 1245
 
1218 1246
 	echo '
1219 1247
 			</div>
Please login to merge, or discard this patch.
Themes/default/ManageBoards.template.php 1 patch
Braces   +90 added lines, -62 removed lines patch added patch discarded remove patch
@@ -25,18 +25,20 @@  discard block
 block discarded – undo
25 25
 		</div>
26 26
 		<div class="windowbg2 noup">';
27 27
 
28
-	if (!empty($context['move_board']))
29
-		echo '
28
+	if (!empty($context['move_board'])) {
29
+			echo '
30 30
 		<div class="noticebox">
31 31
 			', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', '
32 32
 		</div>';
33
+	}
33 34
 
34 35
 	// No categories so show a label.
35
-	if (empty($context['categories']))
36
-		echo '
36
+	if (empty($context['categories'])) {
37
+			echo '
37 38
 		<div class="windowbg centertext">
38 39
 			', $txt['mboards_no_cats'], '
39 40
 		</div>';
41
+	}
40 42
 
41 43
 	// Loop through every category, listing the boards in each as we go.
42 44
 	foreach ($context['categories'] as $category)
@@ -54,9 +56,10 @@  discard block
 block discarded – undo
54 56
 		<form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '">
55 57
 				<ul id="category_', $category['id'], '" class="nolist">';
56 58
 
57
-		if (!empty($category['move_link']))
58
-			echo '
59
+		if (!empty($category['move_link'])) {
60
+					echo '
59 61
 					<li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>';
62
+		}
60 63
 
61 64
 		$recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>';
62 65
 		$redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">';
@@ -81,9 +84,10 @@  discard block
 block discarded – undo
81 84
 				echo '
82 85
 					<li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">';
83 86
 
84
-				foreach ($board['move_links'] as $link)
85
-					echo '
87
+				foreach ($board['move_links'] as $link) {
88
+									echo '
86 89
 						<a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>';
90
+				}
87 91
 
88 92
 				echo '
89 93
 					</li>';
@@ -132,9 +136,10 @@  discard block
 block discarded – undo
132 136
 						<select name="cat_order">';
133 137
 
134 138
 		// Print every existing category into a select box.
135
-		foreach ($context['category_order'] as $order)
136
-			echo '
139
+		foreach ($context['category_order'] as $order) {
140
+					echo '
137 141
 							<option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>';
142
+		}
138 143
 		echo '
139 144
 						</select>
140 145
 					</dd>';
@@ -168,21 +173,23 @@  discard block
 block discarded – undo
168 173
 	echo '
169 174
 				</dl>';
170 175
 
171
-	if (isset($context['category']['is_new']))
172
-		echo '
176
+	if (isset($context['category']['is_new'])) {
177
+			echo '
173 178
 					<input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit">';
174
-	else
175
-		echo '
179
+	} else {
180
+			echo '
176 181
 					<input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit">
177 182
 					<input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button_submit you_sure">';
183
+	}
178 184
 	echo '
179 185
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
180 186
 					<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
181 187
 
182 188
 	// If this category is empty we don't bother with the next confirmation screen.
183
-	if ($context['category']['is_empty'])
184
-		echo '
189
+	if ($context['category']['is_empty']) {
190
+			echo '
185 191
 					<input type="hidden" name="empty" value="1">';
192
+	}
186 193
 
187 194
 	echo '
188 195
 			</div>
@@ -209,9 +216,10 @@  discard block
 block discarded – undo
209 216
 				<p>', $txt['mboards_delete_cat_contains'], ':</p>
210 217
 				<ul>';
211 218
 
212
-	foreach ($context['category']['children'] as $child)
213
-		echo '
219
+	foreach ($context['category']['children'] as $child) {
220
+			echo '
214 221
 					<li>', $child, '</li>';
222
+	}
215 223
 
216 224
 	echo '
217 225
 				</ul>
@@ -225,10 +233,11 @@  discard block
 block discarded – undo
225 233
 					<label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>:
226 234
 					<select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>';
227 235
 
228
-	foreach ($context['category_order'] as $cat)
229
-		if ($cat['id'] != 0)
236
+	foreach ($context['category_order'] as $cat) {
237
+			if ($cat['id'] != 0)
230 238
 			echo '
231 239
 						<option value="', $cat['id'], '">', $cat['true_name'], '</option>';
240
+	}
232 241
 
233 242
 	echo '
234 243
 					</select>
@@ -272,9 +281,10 @@  discard block
 block discarded – undo
272 281
 					</dt>
273 282
 					<dd>
274 283
 						<select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">';
275
-		foreach ($context['categories'] as $category)
276
-			echo '
284
+		foreach ($context['categories'] as $category) {
285
+					echo '
277 286
 							<option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>';
287
+		}
278 288
 		echo '
279 289
 						</select>
280 290
 					</dd>';
@@ -301,9 +311,10 @@  discard block
 block discarded – undo
301 311
 	echo '
302 312
 						<select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '>
303 313
 							', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : '';
304
-	foreach ($context['board_order'] as $order)
305
-		echo '
314
+	foreach ($context['board_order'] as $order) {
315
+			echo '
306 316
 							<option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>';
317
+	}
307 318
 	echo '
308 319
 						</select>
309 320
 					</dd>';
@@ -332,13 +343,15 @@  discard block
 block discarded – undo
332 343
 					<dd>
333 344
 						<select name="profile">';
334 345
 
335
-	if (isset($context['board']['is_new']))
336
-		echo '
346
+	if (isset($context['board']['is_new'])) {
347
+			echo '
337 348
 							<option value="-1">[', $txt['permission_profile_inherit'], ']</option>';
349
+	}
338 350
 
339
-	foreach ($context['profiles'] as $id => $profile)
340
-		echo '
351
+	foreach ($context['profiles'] as $id => $profile) {
352
+			echo '
341 353
 							<option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
354
+	}
342 355
 
343 356
 	echo '
344 357
 						</select>
@@ -351,8 +364,8 @@  discard block
 block discarded – undo
351 364
 					</dt>
352 365
 					<dd>';
353 366
 
354
-	if (!empty($modSettings['deny_boards_access']))
355
-		echo '
367
+	if (!empty($modSettings['deny_boards_access'])) {
368
+			echo '
356 369
 						<table>
357 370
 							<tr>
358 371
 								<td></td>
@@ -360,10 +373,11 @@  discard block
 block discarded – undo
360 373
 								<th>', $txt['permissions_option_off'], '</th>
361 374
 								<th>', $txt['permissions_option_deny'], '</th>
362 375
 							</tr>';
376
+	}
363 377
 
364 378
 	// List all the membergroups so the user can choose who may access this board.
365
-	foreach ($context['groups'] as $group)
366
-		if (empty($modSettings['deny_boards_access']))
379
+	foreach ($context['groups'] as $group) {
380
+			if (empty($modSettings['deny_boards_access']))
367 381
 			echo '
368 382
 						<label for="groups_', $group['id'], '">
369 383
 							<input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), ' class="input_check">
@@ -371,8 +385,9 @@  discard block
 block discarded – undo
371 385
 								', $group['name'], '
372 386
 							</span>
373 387
 						</label><br>';
374
-		else
375
-			echo '
388
+	}
389
+		else {
390
+					echo '
376 391
 							<tr>
377 392
 								<td>
378 393
 									<label for="groups_', $group['id'], '_a">
@@ -392,16 +407,17 @@  discard block
 block discarded – undo
392 407
 								</td>
393 408
 								<td></td>
394 409
 							</tr>';
410
+		}
395 411
 
396
-	if (empty($modSettings['deny_boards_access']))
397
-		echo '
412
+	if (empty($modSettings['deny_boards_access'])) {
413
+			echo '
398 414
 						<span class="select_all_box">
399 415
 							<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[\');">
400 416
 						</span>
401 417
 						<br><br>
402 418
 					</dd>';
403
-	else
404
-		echo '
419
+	} else {
420
+			echo '
405 421
 							<tr class="select_all_box">
406 422
 								<td>
407 423
 								</td>
@@ -420,6 +436,7 @@  discard block
 block discarded – undo
420 436
 							</tr>
421 437
 						</table>
422 438
 					</dd>';
439
+	}
423 440
 
424 441
 	// Options to choose moderators, specify as announcement board and choose whether to count posts here.
425 442
 	echo '
@@ -474,8 +491,8 @@  discard block
 block discarded – undo
474 491
 					</dl>
475 492
 				</div>';
476 493
 
477
-		if ($context['board']['redirect'])
478
-			echo '
494
+		if ($context['board']['redirect']) {
495
+					echo '
479 496
 				<div id="reset_redirect_div">
480 497
 					<dl class="settings">
481 498
 						<dt>
@@ -488,6 +505,7 @@  discard block
 block discarded – undo
488 505
 						</dd>
489 506
 					</dl>
490 507
 				</div>';
508
+		}
491 509
 	}
492 510
 
493 511
 	echo '
@@ -515,9 +533,10 @@  discard block
 block discarded – undo
515 533
 							<select name="boardtheme" id="boardtheme" onchange="refreshOptions();">
516 534
 								<option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>';
517 535
 
518
-	foreach ($context['themes'] as $theme)
519
-		echo '
536
+	foreach ($context['themes'] as $theme) {
537
+			echo '
520 538
 									<option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';
539
+	}
521 540
 
522 541
 	echo '
523 542
 							</select>
@@ -536,9 +555,10 @@  discard block
 block discarded – undo
536 555
 					</dl>
537 556
 				</div>';
538 557
 
539
-	if (!empty($context['board']['is_recycle']))
540
-		echo '
558
+	if (!empty($context['board']['is_recycle'])) {
559
+			echo '
541 560
 				<div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>';
561
+	}
542 562
 
543 563
 	echo '
544 564
 				<input type="hidden" name="rid" value="', $context['redirect_location'], '">
@@ -546,21 +566,24 @@  discard block
 block discarded – undo
546 566
 				<input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">';
547 567
 
548 568
 	// If this board has no children don't bother with the next confirmation screen.
549
-	if ($context['board']['no_children'])
550
-		echo '
569
+	if ($context['board']['no_children']) {
570
+			echo '
551 571
 				<input type="hidden" name="no_children" value="1">';
572
+	}
552 573
 
553
-	if (isset($context['board']['is_new']))
554
-		echo '
574
+	if (isset($context['board']['is_new'])) {
575
+			echo '
555 576
 				<input type="hidden" name="cur_cat" value="', $context['board']['category'], '">
556 577
 				<input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit">';
557
-	else
558
-		echo '
578
+	} else {
579
+			echo '
559 580
 				<input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit">';
581
+	}
560 582
 
561
-	if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle']))
562
-		echo '
583
+	if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) {
584
+			echo '
563 585
 				<input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button_submit you_sure">';
586
+	}
564 587
 	echo '
565 588
 			</div>
566 589
 		</form>
@@ -581,12 +604,13 @@  discard block
 block discarded – undo
581 604
 		sItemListContainerId: \'moderator_container\',
582 605
 		aListItems: [';
583 606
 
584
-	foreach ($context['board']['moderators'] as $id_member => $member_name)
585
-		echo '
607
+	foreach ($context['board']['moderators'] as $id_member => $member_name) {
608
+			echo '
586 609
 					{
587 610
 						sItemId: ', JavaScriptEscape($id_member), ',
588 611
 						sItemName: ', JavaScriptEscape($member_name), '
589 612
 					}', $id_member == $context['board']['last_moderator_id'] ? '' : ',';
613
+	}
590 614
 
591 615
 	echo '
592 616
 		]
@@ -606,12 +630,13 @@  discard block
 block discarded – undo
606 630
 		sItemListContainerId: \'moderator_group_container\',
607 631
 		aListItems: [';
608 632
 
609
-	foreach ($context['board']['moderator_groups'] as $id_group => $group_name)
610
-		echo '
633
+	foreach ($context['board']['moderator_groups'] as $id_group => $group_name) {
634
+			echo '
611 635
 					{
612 636
 						sItemId: ', JavaScriptEscape($id_group), ',
613 637
 						sItemName: ', JavaScriptEscape($group_name), '
614 638
 					}', $id_group == $context['board']['last_moderator_group_id'] ? '' : ',';
639
+	}
615 640
 
616 641
 		echo '
617 642
 			]
@@ -637,9 +662,10 @@  discard block
 block discarded – undo
637 662
 		echo '
638 663
 			document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";';
639 664
 
640
-		if ($context['board']['redirect'])
641
-			echo '
665
+		if ($context['board']['redirect']) {
666
+					echo '
642 667
 			document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";';
668
+		}
643 669
 	}
644 670
 
645 671
 	echo '
@@ -668,9 +694,10 @@  discard block
 block discarded – undo
668 694
 				<p>', $txt['mboards_delete_board_contains'], '</p>
669 695
 					<ul>';
670 696
 
671
-	foreach ($context['children'] as $child)
672
-		echo '
697
+	foreach ($context['children'] as $child) {
698
+			echo '
673 699
 						<li>', $child['node']['name'], '</li>';
700
+	}
674 701
 
675 702
 	echo '
676 703
 					</ul>
@@ -684,10 +711,11 @@  discard block
 block discarded – undo
684 711
 					<label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>:
685 712
 					<select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>';
686 713
 
687
-	foreach ($context['board_order'] as $board)
688
-		if ($board['id'] != $context['board']['id'] && empty($board['is_child']))
714
+	foreach ($context['board_order'] as $board) {
715
+			if ($board['id'] != $context['board']['id'] && empty($board['is_child']))
689 716
 			echo '
690 717
 						<option value="', $board['id'], '">', $board['name'], '</option>';
718
+	}
691 719
 
692 720
 	echo '
693 721
 					</select>
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 2 patches
Spacing   +29 added lines, -30 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 	echo '
56 56
 		<div class="profile_user_avatar floatleft">
57
-			<a href="', $scripturl, '?action=profile;u=', $context['user']['id'], '">', $context['member']['avatar']['image'],'</a>
57
+			<a href="', $scripturl, '?action=profile;u=', $context['user']['id'], '">', $context['member']['avatar']['image'], '</a>
58 58
 		</div>
59 59
 		<div class="profile_user_info floatleft">
60 60
 			<span class="profile_username"><a href="', $scripturl, '?action=profile;u=', $context['user']['id'], '">', $context['user']['name'], '</a></span>
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 		echo '
330 330
 					<dt>', $txt['profile_warning_level'], ': </dt>
331 331
 					<dd>
332
-						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning') , '">', $context['member']['warning'], '%</a>';
332
+						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>';
333 333
 
334 334
 		// Can we provide information on what this means?
335 335
 		if (!empty($context['warning_status']))
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
348 348
 		if (!empty($context['activate_message']))
349 349
 			echo '
350
-					<dt class="clear"><span class="alert">', $context['activate_message'], '</span>&nbsp;(<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="'. $txt['profileConfirm'] .'"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
350
+					<dt class="clear"><span class="alert">', $context['activate_message'], '</span>&nbsp;(<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="' . $txt['profileConfirm'] . '"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
351 351
 
352 352
 		// If the current member is banned, show a message and possibly a link to the ban.
353 353
 		if (!empty($context['member']['bans']))
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 		foreach ($context['posts'] as $post)
474 474
 		{
475 475
 			echo '
476
-			<div class="', $post['css_class'] ,'">
476
+			<div class="', $post['css_class'], '">
477 477
 				<div class="counter">', $post['counter'], '</div>
478 478
 				<div class="topic_details">
479 479
 					<h5><strong><a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a></strong></h5>
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 			// How about... even... remove it entirely?!
510 510
 			if ($post['can_delete'])
511 511
 				echo '
512
-						<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>';
512
+						<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>';
513 513
 
514 514
 			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
515 515
 				echo '
@@ -580,9 +580,9 @@  discard block
 block discarded – undo
580 580
 					<td>', $alert['time'], '</td>
581 581
 					<td>
582 582
 						<ul class="quickbuttons">
583
-							<li><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=showalerts;do=remove;aid=', $id ,';', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'] ,'</a></li>
584
-							<li><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=showalerts;do=', ($alert['is_read'] != 0 ? 'unread' : 'read') ,';aid=', $id ,';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons ', $alert['is_read'] != 0 ? 'unread_button' : 'read_button','"></span>', ($alert['is_read'] != 0 ? $txt['mark_unread'] : $txt['mark_read_short']),'</a></li>
585
-							<li><input type="checkbox" name="mark[', $id ,']" value="', $id ,'"></li>
583
+							<li><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=showalerts;do=remove;aid=', $id, ';', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>
584
+							<li><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=showalerts;do=', ($alert['is_read'] != 0 ? 'unread' : 'read'), ';aid=', $id, ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons ', $alert['is_read'] != 0 ? 'unread_button' : 'read_button', '"></span>', ($alert['is_read'] != 0 ? $txt['mark_unread'] : $txt['mark_read_short']), '</a></li>
585
+							<li><input type="checkbox" name="mark[', $id, ']" value="', $id, '"></li>
586 586
 						</ul>
587 587
 					</td>
588 588
 				</tr>';
@@ -592,17 +592,17 @@  discard block
 block discarded – undo
592 592
 			</table>
593 593
 			<div class="pagesection">
594 594
 				<div class="floatleft">
595
-					', $context['pagination'] ,'
595
+					', $context['pagination'], '
596 596
 				</div>
597 597
 				<div class="floatright">
598
-					', $txt['check_all'] ,': <input type="checkbox" name="select_all" id="select_all">
598
+					', $txt['check_all'], ': <input type="checkbox" name="select_all" id="select_all">
599 599
 					<select name="mark_as">
600
-						<option value="read">', $txt['quick_mod_markread'] ,'</option>
601
-						<option value="unread">', $txt['quick_mod_markunread'] ,'</option>
602
-						<option value="remove">', $txt['quick_mod_remove'] ,'</option>
600
+						<option value="read">', $txt['quick_mod_markread'], '</option>
601
+						<option value="unread">', $txt['quick_mod_markunread'], '</option>
602
+						<option value="remove">', $txt['quick_mod_remove'], '</option>
603 603
 					</select>
604 604
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
605
-					<input type="submit" name="req" value="', $txt['quick_mod_go'] ,'" class="button_submit you_sure">
605
+					<input type="submit" name="req" value="', $txt['quick_mod_go'], '" class="button_submit you_sure">
606 606
 				</div>
607 607
 			</div>
608 608
 		</form>';
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 				<div class="floatright">
660 660
 					<ul class="quickbuttons">
661 661
 						<li><a href="', $scripturl, '?action=post;', (empty($draft['topic']['id']) ? 'board=' . $draft['board']['id'] : 'topic=' . $draft['topic']['id']), '.0;id_draft=', $draft['id_draft'], '"><span class="generic_icons reply_button"></span>', $txt['draft_edit'], '</a></li>
662
-						<li><a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';area=showdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
662
+						<li><a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';area=showdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
663 663
 					</ul>
664 664
 				</div>
665 665
 			</div>';
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 	if (empty($context['buddies']))
716 716
 		echo '
717 717
 			<tr class="windowbg">
718
-				<td colspan="', allowedTo('moderate_forum') ? '10' : '9','"><strong>', $txt['no_buddies'], '</strong></td>
718
+				<td colspan="', allowedTo('moderate_forum') ? '10' : '9', '"><strong>', $txt['no_buddies'], '</strong></td>
719 719
 			</tr>';
720 720
 
721 721
 		// Now loop through each buddy showing info on each.
@@ -818,14 +818,14 @@  discard block
 block discarded – undo
818 818
 				<th scope="col">', $txt['email'], '</th>';
819 819
 
820 820
 	echo '
821
-				<th scope="col">', $txt['ignore_remove'] ,'</th>
821
+				<th scope="col">', $txt['ignore_remove'], '</th>
822 822
 			</tr>';
823 823
 
824 824
 	// If they don't have anyone on their ignore list, don't list it!
825 825
 	if (empty($context['ignore_list']))
826 826
 		echo '
827 827
 			<tr class="windowbg">
828
-				<td colspan="', allowedTo('moderate_forum') ? '4' : '3','"><strong>', $txt['no_ignore'], '</strong></td>
828
+				<td colspan="', allowedTo('moderate_forum') ? '4' : '3', '"><strong>', $txt['no_ignore'], '</strong></td>
829 829
 			</tr>';
830 830
 
831 831
 	// Now loop through each buddy showing info on each.
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
 	else
1064 1064
 	{
1065 1065
 		echo '
1066
-		<div class="information">',$txt['showPermissions_help'],'</div>
1066
+		<div class="information">',$txt['showPermissions_help'], '</div>
1067 1067
 		<div id="permissions" class="flow_hidden">';
1068 1068
 
1069 1069
 		if (!empty($context['no_access_boards']))
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 
1111 1111
 				if ($permission['is_denied'])
1112 1112
 					echo '
1113
-									<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']),'</span>';
1113
+									<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1114 1114
 				else
1115 1115
 					echo '
1116 1116
 									', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
 		{
1897 1897
 			echo '
1898 1898
 				<tr class="windowbg">
1899
-					<td>', $txt['alert_' . $alert_id], isset($alert_details['help']) ? '<a href="' . $scripturl . '?action=helpadmin;help=' . $alert_details['help'] . '" onclick="return reqOverlayDiv(this.href);" class="help floatright"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : '', '</td>';
1899
+					<td>', $txt['alert_' . $alert_id], isset($alert_details['help']) ? '<a href="' . $scripturl . '?action=helpadmin;help=' . $alert_details['help'] . '" onclick="return reqOverlayDiv(this.href);" class="help floatright"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '', '</td>';
1900 1900
 
1901 1901
 			foreach ($context['alert_bits'] as $type => $bitmask)
1902 1902
 			{
@@ -2078,7 +2078,7 @@  discard block
 block discarded – undo
2078 2078
 						<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>';
2079 2079
 				elseif ($group['type'] == 2 && $group['pending'])
2080 2080
 					echo '
2081
-						<span class="floatright">', $txt['approval_pending'],'</span>';
2081
+						<span class="floatright">', $txt['approval_pending'], '</span>';
2082 2082
 				elseif ($group['type'] == 2)
2083 2083
 					echo '
2084 2084
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
@@ -2382,7 +2382,7 @@  discard block
 block discarded – undo
2382 2382
 			<div id="box_preview"', !empty($context['warning_data']['body_preview']) ? '' : ' style="display:none"', '>
2383 2383
 				<dl class="settings">
2384 2384
 					<dt>
2385
-						<strong>', $txt['preview'] , '</strong>
2385
+						<strong>', $txt['preview'], '</strong>
2386 2386
 					</dt>
2387 2387
 					<dd id="body_preview">
2388 2388
 						', !empty($context['warning_data']['body_preview']) ? $context['warning_data']['body_preview'] : '', '
@@ -2801,7 +2801,7 @@  discard block
 block discarded – undo
2801 2801
 								', !empty($context['member']['avatar']['allow_server_stored']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_server_stored" value="server_stored"' . ($context['member']['avatar']['choice'] == 'server_stored' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_server_stored"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['choose_avatar_gallery'] . '</label><br />' : '', '
2802 2802
 								', !empty($context['member']['avatar']['allow_external']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_external" value="external"' . ($context['member']['avatar']['choice'] == 'external' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_external"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['my_own_pic'] . '</label><br />' : '', '
2803 2803
 								', !empty($context['member']['avatar']['allow_upload']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_upload" value="upload"' . ($context['member']['avatar']['choice'] == 'upload' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_upload"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['avatar_will_upload'] . '</label><br />' : '', '
2804
-								', !empty($context['member']['avatar']['allow_gravatar']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_gravatar" value="gravatar"'. ($context['member']['avatar']['choice'] == 'gravatar' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_gravatar"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['use_gravatar'] . '</label>' : '', '
2804
+								', !empty($context['member']['avatar']['allow_gravatar']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_gravatar" value="gravatar"' . ($context['member']['avatar']['choice'] == 'gravatar' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_gravatar"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['use_gravatar'] . '</label>' : '', '
2805 2805
 							</dt>
2806 2806
 							<dd>';
2807 2807
 
@@ -2968,7 +2968,7 @@  discard block
 block discarded – undo
2968 2968
 	echo '
2969 2969
 							<dt>
2970 2970
 								<strong><label for="easyformat">', $txt['time_format'], ':</label></strong><br>
2971
-								<a href="', $scripturl, '?action=helpadmin;help=time_format" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>
2971
+								<a href="', $scripturl, '?action=helpadmin;help=time_format" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>
2972 2972
 								<span class="smalltext">&nbsp;<label for="time_format">', $txt['date_format'], '</label></span>
2973 2973
 							</dt>
2974 2974
 							<dd>
@@ -3034,8 +3034,7 @@  discard block
 block discarded – undo
3034 3034
 							<div class="roundframe">
3035 3035
 								<div>
3036 3036
 		', !empty($context['tfa_backup']) ? '
3037
-									<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' :
3038
-			($modSettings['tfa_mode'] == 2 ? '
3037
+									<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? '
3039 3038
 									<div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), '
3040 3039
 									<div class="smalltext">', $txt['tfa_desc'], '</div>
3041 3040
 									<div id="basicinfo" style="width: 60%">
@@ -3043,7 +3042,7 @@  discard block
 block discarded – undo
3043 3042
 											<div class="title_top">
3044 3043
 												<strong>', $txt['tfa_step1'], '</strong><br />
3045 3044
 												', !empty($context['tfa_pass_error']) ? '<div class="error smalltext">' . $txt['tfa_pass_invalid'] . '</div>' : '', '
3046
-												<input type="password" name="passwd" style="width: 200px;"', !empty($context['tfa_pass_error']) ? ' class="error"' : '', !empty($context['tfa_pass_value']) ? ' value="' . $context['tfa_pass_value'] . '"' : '' ,'>
3045
+												<input type="password" name="passwd" style="width: 200px;"', !empty($context['tfa_pass_error']) ? ' class="error"' : '', !empty($context['tfa_pass_value']) ? ' value="' . $context['tfa_pass_value'] . '"' : '', '>
3047 3046
 											</div>
3048 3047
 											<div class="title_top">
3049 3048
 												<strong>', $txt['tfa_step2'], '</strong>
@@ -3051,9 +3050,9 @@  discard block
 block discarded – undo
3051 3050
 												<div class="tfacode">', $context['tfa_secret'], '</div>
3052 3051
 											</div>
3053 3052
 											<div class="title_top">
3054
-												<strong>', $txt['tfa_step3'] , '</strong><br />
3053
+												<strong>', $txt['tfa_step3'], '</strong><br />
3055 3054
 												', !empty($context['tfa_error']) ? '<div class="error smalltext">' . $txt['tfa_code_invalid'] . '</div>' : '', '
3056
-												<input type="text" name="tfa_code" style="width: 200px;"', !empty($context['tfa_error']) ? ' class="error"' : '', !empty($context['tfa_value']) ? ' value="' . $context['tfa_value'] . '"' : '' ,'>
3055
+												<input type="text" name="tfa_code" style="width: 200px;"', !empty($context['tfa_error']) ? ' class="error"' : '', !empty($context['tfa_value']) ? ' value="' . $context['tfa_value'] . '"' : '', '>
3057 3056
 												<input type="submit" name="save" value="', $txt['tfa_enable'], '" class="button_submit" style="float: none;" />
3058 3057
 											</div>
3059 3058
 											<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />
Please login to merge, or discard this patch.
Braces   +442 added lines, -322 removed lines patch added patch discarded remove patch
@@ -18,23 +18,25 @@  discard block
 block discarded – undo
18 18
 	global $context;
19 19
 
20 20
 	// Prevent Chrome from auto completing fields when viewing/editing other members profiles
21
-	if (isBrowser('is_chrome') && !$context['user']['is_owner'])
22
-		echo '
21
+	if (isBrowser('is_chrome') && !$context['user']['is_owner']) {
22
+			echo '
23 23
 	<script>
24 24
 		disableAutoComplete();
25 25
 	</script>';
26
+	}
26 27
 
27 28
 	// If an error occurred while trying to save previously, give the user a clue!
28 29
 	echo '
29 30
 					', template_error_message();
30 31
 
31 32
 	// If the profile was update successfully, let the user know this.
32
-	if (!empty($context['profile_updated']))
33
-		echo '
33
+	if (!empty($context['profile_updated'])) {
34
+			echo '
34 35
 					<div class="infobox">
35 36
 						', $context['profile_updated'], '
36 37
 					</div>';
37
-}
38
+	}
39
+	}
38 40
 
39 41
 /**
40 42
  * Template for any HTML needed below the profile (closing off divs/tables, etc.)
@@ -102,8 +104,7 @@  discard block
 block discarded – undo
102 104
 	if (empty($context['unread_alerts']))
103 105
 	{
104 106
 		template_alerts_all_read();
105
-	}
106
-	else
107
+	} else
107 108
 	{
108 109
 		foreach ($context['unread_alerts'] as $id_alert => $details)
109 110
 		{
@@ -164,10 +165,11 @@  discard block
 block discarded – undo
164 165
 			<div class="custom_fields_above_name">
165 166
 				<ul >';
166 167
 
167
-		foreach ($context['print_custom_fields']['above_member'] as $field)
168
-			if (!empty($field['output_html']))
168
+		foreach ($context['print_custom_fields']['above_member'] as $field) {
169
+					if (!empty($field['output_html']))
169 170
 				echo '
170 171
 					<li>', $field['output_html'], '</li>';
172
+		}
171 173
 
172 174
 		echo '
173 175
 				</ul>
@@ -188,10 +190,11 @@  discard block
 block discarded – undo
188 190
 			<div class="custom_fields_below_avatar">
189 191
 				<ul >';
190 192
 
191
-		foreach ($context['print_custom_fields']['below_avatar'] as $field)
192
-			if (!empty($field['output_html']))
193
+		foreach ($context['print_custom_fields']['below_avatar'] as $field) {
194
+					if (!empty($field['output_html']))
193 195
 				echo '
194 196
 					<li>', $field['output_html'], '</li>';
197
+		}
195 198
 
196 199
 		echo '
197 200
 				</ul>
@@ -202,22 +205,25 @@  discard block
 block discarded – undo
202 205
 		echo '
203 206
 			<ul class="clear">';
204 207
 	// Email is only visible if it's your profile or you have the moderate_forum permission
205
-	if ($context['member']['show_email'])
206
-		echo '
208
+	if ($context['member']['show_email']) {
209
+			echo '
207 210
 				<li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>';
211
+	}
208 212
 
209 213
 	// Don't show an icon if they haven't specified a website.
210
-	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
211
-		echo '
214
+	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) {
215
+			echo '
212 216
 				<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
217
+	}
213 218
 
214 219
 	// Are there any custom profile fields as icons?
215 220
 	if (!empty($context['print_custom_fields']['icons']))
216 221
 	{
217
-		foreach ($context['print_custom_fields']['icons'] as $field)
218
-			if (!empty($field['output_html']))
222
+		foreach ($context['print_custom_fields']['icons'] as $field) {
223
+					if (!empty($field['output_html']))
219 224
 				echo '
220 225
 					<li class="custom_field">', $field['output_html'], '</li>';
226
+		}
221 227
 	}
222 228
 
223 229
 	echo '
@@ -225,23 +231,26 @@  discard block
 block discarded – undo
225 231
 			<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : '';
226 232
 
227 233
 	// Can they add this member as a buddy?
228
-	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
229
-		echo '
234
+	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) {
235
+			echo '
230 236
 				<br><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
237
+	}
231 238
 
232 239
 	echo '
233 240
 			</span>';
234 241
 
235
-	if (!$context['user']['is_owner'] && $context['can_send_pm'])
236
-		echo '
242
+	if (!$context['user']['is_owner'] && $context['can_send_pm']) {
243
+			echo '
237 244
 			<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>';
245
+	}
238 246
 
239 247
 	echo '
240 248
 			<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>';
241 249
 
242
-	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled']))
243
-		echo '
250
+	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) {
251
+			echo '
244 252
 			<a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>';
253
+	}
245 254
 
246 255
 	echo '
247 256
 			<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>';
@@ -253,10 +262,11 @@  discard block
 block discarded – undo
253 262
 			<div class="custom_fields_bottom">
254 263
 				<ul class="nolist">';
255 264
 
256
-		foreach ($context['print_custom_fields']['bottom_poster'] as $field)
257
-			if (!empty($field['output_html']))
265
+		foreach ($context['print_custom_fields']['bottom_poster'] as $field) {
266
+					if (!empty($field['output_html']))
258 267
 				echo '
259 268
 					<li>', $field['output_html'], '</li>';
269
+		}
260 270
 
261 271
 		echo '
262 272
 				</ul>
@@ -270,15 +280,17 @@  discard block
 block discarded – undo
270 280
 		<div id="detailedinfo">
271 281
 			<dl>';
272 282
 
273
-	if ($context['user']['is_owner'] || $context['user']['is_admin'])
274
-		echo '
283
+	if ($context['user']['is_owner'] || $context['user']['is_admin']) {
284
+			echo '
275 285
 				<dt>', $txt['username'], ': </dt>
276 286
 				<dd>', $context['member']['username'], '</dd>';
287
+	}
277 288
 
278
-	if (!isset($context['disabled_fields']['posts']))
279
-		echo '
289
+	if (!isset($context['disabled_fields']['posts'])) {
290
+			echo '
280 291
 				<dt>', $txt['profile_posts'], ': </dt>
281 292
 				<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
293
+	}
282 294
 
283 295
 	if ($context['member']['show_email'])
284 296
 	{
@@ -287,15 +299,17 @@  discard block
 block discarded – undo
287 299
 				<dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>';
288 300
 	}
289 301
 
290
-	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
291
-		echo '
302
+	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) {
303
+			echo '
292 304
 				<dt>', $txt['custom_title'], ': </dt>
293 305
 				<dd>', $context['member']['title'], '</dd>';
306
+	}
294 307
 
295
-	if (!empty($context['member']['blurb']))
296
-		echo '
308
+	if (!empty($context['member']['blurb'])) {
309
+			echo '
297 310
 				<dt>', $txt['personal_text'], ': </dt>
298 311
 				<dd>', $context['member']['blurb'], '</dd>';
312
+	}
299 313
 
300 314
 	echo '
301 315
 				<dt>', $txt['age'], ':</dt>
@@ -310,11 +324,12 @@  discard block
 block discarded – undo
310 324
 		echo '
311 325
 				<dl>';
312 326
 
313
-		foreach ($context['print_custom_fields']['standard'] as $field)
314
-			if (!empty($field['output_html']))
327
+		foreach ($context['print_custom_fields']['standard'] as $field) {
328
+					if (!empty($field['output_html']))
315 329
 				echo '
316 330
 					<dt>', $field['name'], ':</dt>
317 331
 					<dd>', $field['output_html'], '</dd>';
332
+		}
318 333
 
319 334
 		echo '
320 335
 				</dl>';
@@ -332,9 +347,10 @@  discard block
 block discarded – undo
332 347
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning') , '">', $context['member']['warning'], '%</a>';
333 348
 
334 349
 		// Can we provide information on what this means?
335
-		if (!empty($context['warning_status']))
336
-			echo '
350
+		if (!empty($context['warning_status'])) {
351
+					echo '
337 352
 						<span class="smalltext">(', $context['warning_status'], ')</span>';
353
+		}
338 354
 
339 355
 		echo '
340 356
 					</dd>';
@@ -345,9 +361,10 @@  discard block
 block discarded – undo
345 361
 	{
346 362
 
347 363
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
348
-		if (!empty($context['activate_message']))
349
-			echo '
364
+		if (!empty($context['activate_message'])) {
365
+					echo '
350 366
 					<dt class="clear"><span class="alert">', $context['activate_message'], '</span>&nbsp;(<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="'. $txt['profileConfirm'] .'"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
367
+		}
351 368
 
352 369
 		// If the current member is banned, show a message and possibly a link to the ban.
353 370
 		if (!empty($context['member']['bans']))
@@ -357,9 +374,10 @@  discard block
 block discarded – undo
357 374
 					<dt class="clear" id="ban_info" style="display: none;">
358 375
 						<strong>', $txt['user_banned_by_following'], ':</strong>';
359 376
 
360
-			foreach ($context['member']['bans'] as $ban)
361
-				echo '
377
+			foreach ($context['member']['bans'] as $ban) {
378
+							echo '
362 379
 						<br><span class="smalltext">', $ban['explanation'], '</span>';
380
+			}
363 381
 
364 382
 			echo '
365 383
 					</dt>';
@@ -373,30 +391,34 @@  discard block
 block discarded – undo
373 391
 	// If the person looking is allowed, they can check the members IP address and hostname.
374 392
 	if ($context['can_see_ip'])
375 393
 	{
376
-		if (!empty($context['member']['ip']))
377
-		echo '
394
+		if (!empty($context['member']['ip'])) {
395
+				echo '
378 396
 					<dt>', $txt['ip'], ': </dt>
379 397
 					<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
398
+		}
380 399
 
381
-		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
382
-			echo '
400
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) {
401
+					echo '
383 402
 					<dt>', $txt['hostname'], ': </dt>
384 403
 					<dd>', $context['member']['hostname'], '</dd>';
404
+		}
385 405
 	}
386 406
 
387 407
 	echo '
388 408
 					<dt>', $txt['local_time'], ':</dt>
389 409
 					<dd>', $context['member']['local_time'], '</dd>';
390 410
 
391
-	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
392
-		echo '
411
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) {
412
+			echo '
393 413
 					<dt>', $txt['language'], ':</dt>
394 414
 					<dd>', $context['member']['language'], '</dd>';
415
+	}
395 416
 
396
-	if ($context['member']['show_last_login'])
397
-		echo '
417
+	if ($context['member']['show_last_login']) {
418
+			echo '
398 419
 					<dt>', $txt['lastLoggedIn'], ': </dt>
399 420
 					<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
421
+	}
400 422
 
401 423
 	echo '
402 424
 				</dl>';
@@ -408,10 +430,11 @@  discard block
 block discarded – undo
408 430
 				<div class="custom_fields_above_signature">
409 431
 					<ul class="nolist">';
410 432
 
411
-		foreach ($context['print_custom_fields']['above_signature'] as $field)
412
-			if (!empty($field['output_html']))
433
+		foreach ($context['print_custom_fields']['above_signature'] as $field) {
434
+					if (!empty($field['output_html']))
413 435
 				echo '
414 436
 						<li>', $field['output_html'], '</li>';
437
+		}
415 438
 
416 439
 		echo '
417 440
 					</ul>
@@ -419,12 +442,13 @@  discard block
 block discarded – undo
419 442
 	}
420 443
 
421 444
 	// Show the users signature.
422
-	if ($context['signature_enabled'] && !empty($context['member']['signature']))
423
-		echo '
445
+	if ($context['signature_enabled'] && !empty($context['member']['signature'])) {
446
+			echo '
424 447
 				<div class="signature">
425 448
 					<h5>', $txt['signature'], ':</h5>
426 449
 					', $context['member']['signature'], '
427 450
 				</div>';
451
+	}
428 452
 
429 453
 	// Are there any custom profile fields for below the signature?
430 454
 	if (!empty($context['print_custom_fields']['below_signature']))
@@ -433,10 +457,11 @@  discard block
 block discarded – undo
433 457
 				<div class="custom_fields_below_signature">
434 458
 					<ul class="nolist">';
435 459
 
436
-		foreach ($context['print_custom_fields']['below_signature'] as $field)
437
-			if (!empty($field['output_html']))
460
+		foreach ($context['print_custom_fields']['below_signature'] as $field) {
461
+					if (!empty($field['output_html']))
438 462
 				echo '
439 463
 						<li>', $field['output_html'], '</li>';
464
+		}
440 465
 
441 466
 		echo '
442 467
 					</ul>
@@ -481,62 +506,70 @@  discard block
 block discarded – undo
481 506
 				</div>
482 507
 				<div class="list_posts">';
483 508
 
484
-			if (!$post['approved'])
485
-				echo '
509
+			if (!$post['approved']) {
510
+							echo '
486 511
 					<div class="approve_post">
487 512
 						<em>', $txt['post_awaiting_approval'], '</em>
488 513
 					</div>';
514
+			}
489 515
 
490 516
 			echo '
491 517
 					', $post['body'], '
492 518
 				</div>';
493 519
 
494
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
495
-				echo '
520
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
521
+							echo '
496 522
 				<div class="floatright">
497 523
 					<ul class="quickbuttons">';
524
+			}
498 525
 
499 526
 			// If they *can* reply?
500
-			if ($post['can_reply'])
501
-				echo '
527
+			if ($post['can_reply']) {
528
+							echo '
502 529
 						<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
530
+			}
503 531
 
504 532
 			// If they *can* quote?
505
-			if ($post['can_quote'])
506
-				echo '
533
+			if ($post['can_quote']) {
534
+							echo '
507 535
 						<li><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
536
+			}
508 537
 
509 538
 			// How about... even... remove it entirely?!
510
-			if ($post['can_delete'])
511
-				echo '
539
+			if ($post['can_delete']) {
540
+							echo '
512 541
 						<li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
542
+			}
513 543
 
514
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
515
-				echo '
544
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
545
+							echo '
516 546
 					</ul>
517 547
 				</div>';
548
+			}
518 549
 
519 550
 			echo '
520 551
 			</div>';
521 552
 		}
553
+	} else {
554
+			template_show_list('attachments');
522 555
 	}
523
-	else
524
-		template_show_list('attachments');
525 556
 
526 557
 	// No posts? Just end with a informative message.
527
-	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
528
-		echo '
558
+	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) {
559
+			echo '
529 560
 			<div class="windowbg2">
530 561
 				', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
531 562
 			</div>';
563
+	}
532 564
 
533 565
 	// Show more page numbers.
534
-	if (!empty($context['page_index']))
535
-		echo '
566
+	if (!empty($context['page_index'])) {
567
+			echo '
536 568
 		<div class="pagesection">
537 569
 			<div class="pagelinks">', $context['page_index'], '</div>
538 570
 		</div>';
539
-}
571
+	}
572
+	}
540 573
 
541 574
 /**
542 575
  * Template for showing alerts within the alerts popup
@@ -546,11 +579,12 @@  discard block
 block discarded – undo
546 579
 	global $context, $txt, $scripturl;
547 580
 
548 581
 	// Do we have an update message?
549
-	if (!empty($context['update_message']))
550
-		echo '
582
+	if (!empty($context['update_message'])) {
583
+			echo '
551 584
 		<div class="infobox">
552 585
 			', $context['update_message'], '.
553 586
 		</div>';
587
+	}
554 588
 
555 589
 	echo '
556 590
 		<div class="cat_bar">
@@ -559,13 +593,12 @@  discard block
 block discarded – undo
559 593
 			</h3>
560 594
 		</div>';
561 595
 
562
-	if (empty($context['alerts']))
563
-		echo '
596
+	if (empty($context['alerts'])) {
597
+			echo '
564 598
 		<div class="information">
565 599
 			', $txt['alerts_none'], '
566 600
 		</div>';
567
-
568
-	else
601
+	} else
569 602
 	{
570 603
 		// Start the form.
571 604
 		echo '
@@ -627,12 +660,12 @@  discard block
 block discarded – undo
627 660
 		</div>' : '';
628 661
 
629 662
 	// No drafts? Just show an informative message.
630
-	if (empty($context['drafts']))
631
-		echo '
663
+	if (empty($context['drafts'])) {
664
+			echo '
632 665
 		<div class="windowbg2 centertext">
633 666
 			', $txt['draft_none'], '
634 667
 		</div>';
635
-	else
668
+	} else
636 669
 	{
637 670
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
638 671
 		foreach ($context['drafts'] as $draft)
@@ -643,11 +676,13 @@  discard block
 block discarded – undo
643 676
 					<div class="topic_details">
644 677
 						<h5><strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
645 678
 
646
-			if (!empty($draft['sticky']))
647
-				echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
679
+			if (!empty($draft['sticky'])) {
680
+							echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
681
+			}
648 682
 
649
-			if (!empty($draft['locked']))
650
-				echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
683
+			if (!empty($draft['locked'])) {
684
+							echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
685
+			}
651 686
 
652 687
 			echo '
653 688
 						</h5>
@@ -680,12 +715,13 @@  discard block
 block discarded – undo
680 715
 {
681 716
 	global $context, $scripturl, $txt;
682 717
 
683
-	if (!empty($context['saved_successful']))
684
-		echo '
718
+	if (!empty($context['saved_successful'])) {
719
+			echo '
685 720
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
686
-	elseif (!empty($context['saved_failed']))
687
-		echo '
721
+	} elseif (!empty($context['saved_failed'])) {
722
+			echo '
688 723
 					<div class="errorbox">', $context['saved_failed'], '</div>';
724
+	}
689 725
 
690 726
 	echo '
691 727
 	<div id="edit_buddies">
@@ -699,24 +735,27 @@  discard block
 block discarded – undo
699 735
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
700 736
 				<th scope="col">', $txt['status'], '</th>';
701 737
 
702
-	if (allowedTo('moderate_forum'))
703
-		echo '
738
+	if (allowedTo('moderate_forum')) {
739
+			echo '
704 740
 				<th scope="col">', $txt['email'], '</th>';
741
+	}
705 742
 
706
-	if (!empty($context['custom_pf']))
707
-		foreach ($context['custom_pf'] as $column)
743
+	if (!empty($context['custom_pf'])) {
744
+			foreach ($context['custom_pf'] as $column)
708 745
 				echo '<th scope="col">', $column['label'], '</th>';
746
+	}
709 747
 
710 748
 	echo '
711 749
 				<th scope="col">', $txt['remove'], '</th>
712 750
 			</tr>';
713 751
 
714 752
 	// If they don't have any buddies don't list them!
715
-	if (empty($context['buddies']))
716
-		echo '
753
+	if (empty($context['buddies'])) {
754
+			echo '
717 755
 			<tr class="windowbg">
718 756
 				<td colspan="', allowedTo('moderate_forum') ? '10' : '9','"><strong>', $txt['no_buddies'], '</strong></td>
719 757
 			</tr>';
758
+	}
720 759
 
721 760
 		// Now loop through each buddy showing info on each.
722 761
 	else
@@ -728,15 +767,17 @@  discard block
 block discarded – undo
728 767
 					<td>', $buddy['link'], '</td>
729 768
 					<td><a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a></td>';
730 769
 
731
-			if ($buddy['show_email'])
732
-				echo '
770
+			if ($buddy['show_email']) {
771
+							echo '
733 772
 					<td><a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a></td>';
773
+			}
734 774
 
735 775
 			// Show the custom profile fields for this user.
736
-			if (!empty($context['custom_pf']))
737
-				foreach ($context['custom_pf'] as $key => $column)
776
+			if (!empty($context['custom_pf'])) {
777
+							foreach ($context['custom_pf'] as $key => $column)
738 778
 					echo '
739 779
 						<td class="lefttext">', $buddy['options'][$key], '</td>';
780
+			}
740 781
 
741 782
 			echo '
742 783
 					<td><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['buddy_remove'], '"></span></a></td>
@@ -766,9 +807,10 @@  discard block
 block discarded – undo
766 807
 			</dl>
767 808
 		</div>';
768 809
 
769
-	if (!empty($context['token_check']))
770
-		echo '
810
+	if (!empty($context['token_check'])) {
811
+			echo '
771 812
 			<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
813
+	}
772 814
 
773 815
 	echo '
774 816
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -794,12 +836,13 @@  discard block
 block discarded – undo
794 836
 {
795 837
 	global $context, $scripturl, $txt;
796 838
 
797
-	if (!empty($context['saved_successful']))
798
-		echo '
839
+	if (!empty($context['saved_successful'])) {
840
+			echo '
799 841
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
800
-	elseif (!empty($context['saved_failed']))
801
-		echo '
842
+	} elseif (!empty($context['saved_failed'])) {
843
+			echo '
802 844
 					<div class="errorbox">', $context['saved_failed'], '</div>';
845
+	}
803 846
 
804 847
 	echo '
805 848
 	<div id="edit_buddies">
@@ -813,20 +856,22 @@  discard block
 block discarded – undo
813 856
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
814 857
 				<th scope="col">', $txt['status'], '</th>';
815 858
 
816
-	if (allowedTo('moderate_forum'))
817
-		echo '
859
+	if (allowedTo('moderate_forum')) {
860
+			echo '
818 861
 				<th scope="col">', $txt['email'], '</th>';
862
+	}
819 863
 
820 864
 	echo '
821 865
 				<th scope="col">', $txt['ignore_remove'] ,'</th>
822 866
 			</tr>';
823 867
 
824 868
 	// If they don't have anyone on their ignore list, don't list it!
825
-	if (empty($context['ignore_list']))
826
-		echo '
869
+	if (empty($context['ignore_list'])) {
870
+			echo '
827 871
 			<tr class="windowbg">
828 872
 				<td colspan="', allowedTo('moderate_forum') ? '4' : '3','"><strong>', $txt['no_ignore'], '</strong></td>
829 873
 			</tr>';
874
+	}
830 875
 
831 876
 	// Now loop through each buddy showing info on each.
832 877
 	foreach ($context['ignore_list'] as $member)
@@ -836,9 +881,10 @@  discard block
 block discarded – undo
836 881
 				<td>', $member['link'], '</td>
837 882
 				<td><a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a></td>';
838 883
 
839
-		if ($member['show_email'])
840
-			echo '
884
+		if ($member['show_email']) {
885
+					echo '
841 886
 				<td><a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a></td>';
887
+		}
842 888
 		echo '
843 889
 				<td><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['ignore_remove'], '"></span></a></td>
844 890
 			</tr>';
@@ -865,9 +911,10 @@  discard block
 block discarded – undo
865 911
 			</dl>
866 912
 		</div>';
867 913
 
868
-	if (!empty($context['token_check']))
869
-		echo '
914
+	if (!empty($context['token_check'])) {
915
+			echo '
870 916
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
917
+	}
871 918
 
872 919
 	echo '
873 920
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -912,9 +959,10 @@  discard block
 block discarded – undo
912 959
 					<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
913 960
 
914 961
 	// Second address detected?
915
-	if (!empty($context['last_ip2']))
916
-		echo '
962
+	if (!empty($context['last_ip2'])) {
963
+			echo '
917 964
 					, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
965
+	}
918 966
 
919 967
 	echo '
920 968
 				</dd>';
@@ -979,9 +1027,10 @@  discard block
 block discarded – undo
979 1027
 				<h3 class="catbg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
980 1028
 			</div>
981 1029
 			<div class="windowbg2 noup">';
982
-			foreach ($context['whois_servers'] as $server)
983
-			echo '
1030
+			foreach ($context['whois_servers'] as $server) {
1031
+						echo '
984 1032
 				<a href="', $server['url'], '" target="_blank" class="new_win"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>';
1033
+			}
985 1034
 			echo '
986 1035
 			</div>
987 1036
 			<br>';
@@ -992,10 +1041,10 @@  discard block
 block discarded – undo
992 1041
 		<div class="cat_bar">
993 1042
 			<h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
994 1043
 		</div>';
995
-	if (empty($context['ips']))
996
-		echo '
1044
+	if (empty($context['ips'])) {
1045
+			echo '
997 1046
 		<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
998
-	else
1047
+	} else
999 1048
 	{
1000 1049
 		echo '
1001 1050
 		<table class="table_grid">
@@ -1008,12 +1057,13 @@  discard block
 block discarded – undo
1008 1057
 			<tbody>';
1009 1058
 
1010 1059
 		// Loop through each of the members and display them.
1011
-		foreach ($context['ips'] as $ip => $memberlist)
1012
-			echo '
1060
+		foreach ($context['ips'] as $ip => $memberlist) {
1061
+					echo '
1013 1062
 				<tr class="windowbg">
1014 1063
 					<td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
1015 1064
 					<td>', implode(', ', $memberlist), '</td>
1016 1065
 				</tr>';
1066
+		}
1017 1067
 
1018 1068
 		echo '
1019 1069
 			</tbody>
@@ -1059,8 +1109,7 @@  discard block
 block discarded – undo
1059 1109
 	{
1060 1110
 		echo '
1061 1111
 		<div class="information">', $txt['showPermissions_all'], '</div>';
1062
-	}
1063
-	else
1112
+	} else
1064 1113
 	{
1065 1114
 		echo '
1066 1115
 		<div class="information">',$txt['showPermissions_help'],'</div>
@@ -1074,9 +1123,10 @@  discard block
 block discarded – undo
1074 1123
 				</div>
1075 1124
 				<div class="windowbg smalltext">
1076 1125
 					', $txt['showPermissions_restricted_boards_desc'], ':<br>';
1077
-				foreach ($context['no_access_boards'] as $no_access_board)
1078
-					echo '
1126
+				foreach ($context['no_access_boards'] as $no_access_board) {
1127
+									echo '
1079 1128
 						<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
1129
+				}
1080 1130
 				echo '
1081 1131
 				</div>';
1082 1132
 		}
@@ -1108,12 +1158,13 @@  discard block
 block discarded – undo
1108 1158
 								</td>
1109 1159
 								<td class="smalltext">';
1110 1160
 
1111
-				if ($permission['is_denied'])
1112
-					echo '
1161
+				if ($permission['is_denied']) {
1162
+									echo '
1113 1163
 									<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']),'</span>';
1114
-				else
1115
-					echo '
1164
+				} else {
1165
+									echo '
1116 1166
 									', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
1167
+				}
1117 1168
 
1118 1169
 					echo '
1119 1170
 								</td>
@@ -1123,10 +1174,10 @@  discard block
 block discarded – undo
1123 1174
 						</tbody>
1124 1175
 					</table>
1125 1176
 				</div><br>';
1126
-		}
1127
-		else
1128
-			echo '
1177
+		} else {
1178
+					echo '
1129 1179
 			<p class="windowbg2">', $txt['showPermissions_none_general'], '</p>';
1180
+		}
1130 1181
 
1131 1182
 		// Board permission section.
1132 1183
 		echo '
@@ -1136,14 +1187,16 @@  discard block
 block discarded – undo
1136 1187
 						<a id="board_permissions"></a>', $txt['showPermissions_select'], ':
1137 1188
 						<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
1138 1189
 							<option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
1139
-				if (!empty($context['boards']))
1140
-					echo '
1190
+				if (!empty($context['boards'])) {
1191
+									echo '
1141 1192
 							<option value="" disabled>---------------------------</option>';
1193
+				}
1142 1194
 
1143 1195
 				// Fill the box with any local permission boards.
1144
-				foreach ($context['boards'] as $board)
1145
-					echo '
1196
+				foreach ($context['boards'] as $board) {
1197
+									echo '
1146 1198
 							<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
1199
+				}
1147 1200
 
1148 1201
 				echo '
1149 1202
 						</select>
@@ -1174,8 +1227,7 @@  discard block
 block discarded – undo
1174 1227
 				{
1175 1228
 					echo '
1176 1229
 							<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1177
-				}
1178
-				else
1230
+				} else
1179 1231
 				{
1180 1232
 					echo '
1181 1233
 							', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
@@ -1187,10 +1239,10 @@  discard block
 block discarded – undo
1187 1239
 			echo '
1188 1240
 				</tbody>
1189 1241
 			</table>';
1190
-		}
1191
-		else
1192
-			echo '
1242
+		} else {
1243
+					echo '
1193 1244
 			<p class="windowbg2">', $txt['showPermissions_none_board'], '</p>';
1245
+		}
1194 1246
 	echo '
1195 1247
 			</div>
1196 1248
 		</div>';
@@ -1232,9 +1284,10 @@  discard block
 block discarded – undo
1232 1284
 			</div>';
1233 1285
 
1234 1286
 	// If they haven't post at all, don't draw the graph.
1235
-	if (empty($context['posts_by_time']))
1236
-		echo '
1287
+	if (empty($context['posts_by_time'])) {
1288
+			echo '
1237 1289
 			<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1290
+	}
1238 1291
 	// Otherwise do!
1239 1292
 	else
1240 1293
 	{
@@ -1273,11 +1326,10 @@  discard block
 block discarded – undo
1273 1326
 					</h3>
1274 1327
 				</div>';
1275 1328
 
1276
-	if (empty($context['popular_boards']))
1277
-		echo '
1329
+	if (empty($context['popular_boards'])) {
1330
+			echo '
1278 1331
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1279
-
1280
-	else
1332
+	} else
1281 1333
 	{
1282 1334
 		echo '
1283 1335
 				<dl class="stats">';
@@ -1308,10 +1360,10 @@  discard block
 block discarded – undo
1308 1360
 					</h3>
1309 1361
 				</div>';
1310 1362
 
1311
-	if (empty($context['board_activity']))
1312
-		echo '
1363
+	if (empty($context['board_activity'])) {
1364
+			echo '
1313 1365
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1314
-	else
1366
+	} else
1315 1367
 	{
1316 1368
 		echo '
1317 1369
 				<dl class="stats">';
@@ -1359,41 +1411,46 @@  discard block
 block discarded – undo
1359 1411
 				<h3 class="catbg profile_hd">';
1360 1412
 
1361 1413
 		// Don't say "Profile" if this isn't the profile...
1362
-		if (!empty($context['profile_header_text']))
1363
-			echo '
1414
+		if (!empty($context['profile_header_text'])) {
1415
+					echo '
1364 1416
 					', $context['profile_header_text'];
1365
-		else
1366
-			echo '
1417
+		} else {
1418
+					echo '
1367 1419
 					', $txt['profile'];
1420
+		}
1368 1421
 
1369 1422
 		echo '
1370 1423
 				</h3>
1371 1424
 			</div>';
1372 1425
 
1373 1426
 	// Have we some description?
1374
-	if ($context['page_desc'])
1375
-		echo '
1427
+	if ($context['page_desc']) {
1428
+			echo '
1376 1429
 			<p class="information">', $context['page_desc'], '</p>';
1430
+	}
1377 1431
 
1378 1432
 	echo '
1379 1433
 			<div class="roundframe">';
1380 1434
 
1381 1435
 	// Any bits at the start?
1382
-	if (!empty($context['profile_prehtml']))
1383
-		echo '
1436
+	if (!empty($context['profile_prehtml'])) {
1437
+			echo '
1384 1438
 				<div>', $context['profile_prehtml'], '</div>';
1439
+	}
1385 1440
 
1386
-	if (!empty($context['profile_fields']))
1387
-		echo '
1441
+	if (!empty($context['profile_fields'])) {
1442
+			echo '
1388 1443
 				<dl>';
1444
+	}
1389 1445
 
1390 1446
 	// Start the big old loop 'of love.
1391 1447
 	$lastItem = 'hr';
1392 1448
 	foreach ($context['profile_fields'] as $key => $field)
1393 1449
 	{
1394 1450
 		// We add a little hack to be sure we never get more than one hr in a row!
1395
-		if ($lastItem == 'hr' && $field['type'] == 'hr')
1396
-			continue;
1451
+		if ($lastItem == 'hr' && $field['type'] == 'hr') {
1452
+					continue;
1453
+		}
1397 1454
 
1398 1455
 		$lastItem = $field['type'];
1399 1456
 		if ($field['type'] == 'hr')
@@ -1402,48 +1459,50 @@  discard block
 block discarded – undo
1402 1459
 				</dl>
1403 1460
 				<hr>
1404 1461
 				<dl>';
1405
-		}
1406
-		elseif ($field['type'] == 'callback')
1462
+		} elseif ($field['type'] == 'callback')
1407 1463
 		{
1408 1464
 			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
1409 1465
 			{
1410 1466
 				$callback_func = 'template_profile_' . $field['callback_func'];
1411 1467
 				$callback_func();
1412 1468
 			}
1413
-		}
1414
-		else
1469
+		} else
1415 1470
 		{
1416 1471
 			echo '
1417 1472
 					<dt>
1418 1473
 						<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
1419 1474
 
1420 1475
 			// Does it have any subtext to show?
1421
-			if (!empty($field['subtext']))
1422
-				echo '
1476
+			if (!empty($field['subtext'])) {
1477
+							echo '
1423 1478
 						<br>
1424 1479
 						<span class="smalltext">', $field['subtext'], '</span>';
1480
+			}
1425 1481
 
1426 1482
 			echo '
1427 1483
 					</dt>
1428 1484
 					<dd>';
1429 1485
 
1430 1486
 			// Want to put something infront of the box?
1431
-			if (!empty($field['preinput']))
1432
-				echo '
1487
+			if (!empty($field['preinput'])) {
1488
+							echo '
1433 1489
 						', $field['preinput'];
1490
+			}
1434 1491
 
1435 1492
 			// What type of data are we showing?
1436
-			if ($field['type'] == 'label')
1437
-				echo '
1493
+			if ($field['type'] == 'label') {
1494
+							echo '
1438 1495
 						', $field['value'];
1496
+			}
1439 1497
 
1440 1498
 			// Maybe it's a text box - very likely!
1441 1499
 			elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url')))
1442 1500
 			{
1443
-				if ($field['type'] == 'int' || $field['type'] == 'float')
1444
-					$type = 'number';
1445
-				else
1446
-					$type = $field['type'];
1501
+				if ($field['type'] == 'int' || $field['type'] == 'float') {
1502
+									$type = 'number';
1503
+				} else {
1504
+									$type = $field['type'];
1505
+				}
1447 1506
 				$step = $field['type'] == 'float' ? ' step="0.1"' : '';
1448 1507
 
1449 1508
 
@@ -1451,9 +1510,10 @@  discard block
 block discarded – undo
1451 1510
 						<input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '"', $step, '>';
1452 1511
 			}
1453 1512
 			// You "checking" me out? ;)
1454
-			elseif ($field['type'] == 'check')
1455
-				echo '
1513
+			elseif ($field['type'] == 'check') {
1514
+							echo '
1456 1515
 						<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" class="input_check" ', $field['input_attr'], '>';
1516
+			}
1457 1517
 
1458 1518
 			// Always fun - select boxes!
1459 1519
 			elseif ($field['type'] == 'select')
@@ -1464,13 +1524,15 @@  discard block
 block discarded – undo
1464 1524
 				if (isset($field['options']))
1465 1525
 				{
1466 1526
 					// Is this some code to generate the options?
1467
-					if (!is_array($field['options']))
1468
-						$field['options'] = $field['options']();
1527
+					if (!is_array($field['options'])) {
1528
+											$field['options'] = $field['options']();
1529
+					}
1469 1530
 					// Assuming we now have some!
1470
-					if (is_array($field['options']))
1471
-						foreach ($field['options'] as $value => $name)
1531
+					if (is_array($field['options'])) {
1532
+											foreach ($field['options'] as $value => $name)
1472 1533
 							echo '
1473 1534
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
1535
+					}
1474 1536
 				}
1475 1537
 
1476 1538
 				echo '
@@ -1478,25 +1540,28 @@  discard block
 block discarded – undo
1478 1540
 			}
1479 1541
 
1480 1542
 			// Something to end with?
1481
-			if (!empty($field['postinput']))
1482
-				echo '
1543
+			if (!empty($field['postinput'])) {
1544
+							echo '
1483 1545
 							', $field['postinput'];
1546
+			}
1484 1547
 
1485 1548
 			echo '
1486 1549
 					</dd>';
1487 1550
 		}
1488 1551
 	}
1489 1552
 
1490
-	if (!empty($context['profile_fields']))
1491
-		echo '
1553
+	if (!empty($context['profile_fields'])) {
1554
+			echo '
1492 1555
 				</dl>';
1556
+	}
1493 1557
 
1494 1558
 	// Are there any custom profile fields - if so print them!
1495 1559
 	if (!empty($context['custom_fields']))
1496 1560
 	{
1497
-		if ($lastItem != 'hr')
1498
-			echo '
1561
+		if ($lastItem != 'hr') {
1562
+					echo '
1499 1563
 				<hr>';
1564
+		}
1500 1565
 
1501 1566
 		echo '
1502 1567
 				<dl>';
@@ -1519,13 +1584,14 @@  discard block
 block discarded – undo
1519 1584
 	}
1520 1585
 
1521 1586
 	// Any closing HTML?
1522
-	if (!empty($context['profile_posthtml']))
1523
-		echo '
1587
+	if (!empty($context['profile_posthtml'])) {
1588
+			echo '
1524 1589
 				<div>', $context['profile_posthtml'], '</div>';
1590
+	}
1525 1591
 
1526 1592
 	// Only show the password box if it's actually needed.
1527
-	if ($context['require_password'])
1528
-		echo '
1593
+	if ($context['require_password']) {
1594
+			echo '
1529 1595
 				<dl>
1530 1596
 					<dt>
1531 1597
 						<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br>
@@ -1535,18 +1601,21 @@  discard block
 block discarded – undo
1535 1601
 						<input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password">
1536 1602
 					</dd>
1537 1603
 				</dl>';
1604
+	}
1538 1605
 
1539 1606
 	// The button shouldn't say "Change profile" unless we're changing the profile...
1540
-	if (!empty($context['submit_button_text']))
1541
-		echo '
1607
+	if (!empty($context['submit_button_text'])) {
1608
+			echo '
1542 1609
 				<input type="submit" name="save" value="', $context['submit_button_text'], '" class="button_submit">';
1543
-	else
1544
-		echo '
1610
+	} else {
1611
+			echo '
1545 1612
 				<input type="submit" name="save" value="', $txt['change_profile'], '" class="button_submit">';
1613
+	}
1546 1614
 
1547
-	if (!empty($context['token_check']))
1548
-		echo '
1615
+	if (!empty($context['token_check'])) {
1616
+			echo '
1549 1617
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
1618
+	}
1550 1619
 
1551 1620
 	echo '
1552 1621
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1556,10 +1625,11 @@  discard block
 block discarded – undo
1556 1625
 		</form>';
1557 1626
 
1558 1627
 	// Any final spellchecking stuff?
1559
-	if (!empty($context['show_spellchecking']))
1560
-		echo '
1628
+	if (!empty($context['show_spellchecking'])) {
1629
+			echo '
1561 1630
 		<form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value=""></form>';
1562
-}
1631
+	}
1632
+	}
1563 1633
 
1564 1634
 /**
1565 1635
  * Personal Message settings.
@@ -1596,10 +1666,11 @@  discard block
 block discarded – undo
1596 1666
 										<select name="pm_receive_from" id="pm_receive_from">
1597 1667
 												<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
1598 1668
 
1599
-	if (!empty($modSettings['enable_buddylist']))
1600
-		echo '
1669
+	if (!empty($modSettings['enable_buddylist'])) {
1670
+			echo '
1601 1671
 												<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option>
1602 1672
 												<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
1673
+	}
1603 1674
 
1604 1675
 	echo '
1605 1676
 												<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option>
@@ -1655,8 +1726,8 @@  discard block
 block discarded – undo
1655 1726
 								<input type="checkbox" name="default_options[show_no_signatures]" id="show_no_signatures" value="1"', !empty($context['member']['options']['show_no_signatures']) ? ' checked' : '', ' class="input_check">
1656 1727
 							</dd>';
1657 1728
 
1658
-	if (!empty($modSettings['allow_no_censored']))
1659
-		echo '
1729
+	if (!empty($modSettings['allow_no_censored'])) {
1730
+			echo '
1660 1731
 							<dt>
1661 1732
 								<label for="show_no_censored">' . $txt['show_no_censored'] . '</label>
1662 1733
 							</dt>
@@ -1664,6 +1735,7 @@  discard block
 block discarded – undo
1664 1735
 								<input type="hidden" name="default_options[show_no_censored]" value="0">
1665 1736
 								<input type="checkbox" name="default_options[show_no_censored]" id="show_no_censored" value="1"' . (!empty($context['member']['options']['show_no_censored']) ? ' checked' : '') . ' class="input_check">
1666 1737
 							</dd>';
1738
+	}
1667 1739
 
1668 1740
 	echo '
1669 1741
 							<dt>
@@ -1674,8 +1746,8 @@  discard block
 block discarded – undo
1674 1746
 								<input type="checkbox" name="default_options[return_to_post]" id="return_to_post" value="1"', !empty($context['member']['options']['return_to_post']) ? ' checked' : '', ' class="input_check">
1675 1747
 							</dd>';
1676 1748
 
1677
-	if (!empty($modSettings['enable_buddylist']))
1678
-		echo '
1749
+	if (!empty($modSettings['enable_buddylist'])) {
1750
+			echo '
1679 1751
 							<dt>
1680 1752
 								<label for="posts_apply_ignore_list">', $txt['posts_apply_ignore_list'], '</label>
1681 1753
 							</dt>
@@ -1683,6 +1755,7 @@  discard block
 block discarded – undo
1683 1755
 								<input type="hidden" name="default_options[posts_apply_ignore_list]" value="0">
1684 1756
 								<input type="checkbox" name="default_options[posts_apply_ignore_list]" id="posts_apply_ignore_list" value="1"', !empty($context['member']['options']['posts_apply_ignore_list']) ? ' checked' : '', ' class="input_check">
1685 1757
 							</dd>';
1758
+	}
1686 1759
 
1687 1760
 	echo '
1688 1761
 							<dt>
@@ -1694,8 +1767,8 @@  discard block
 block discarded – undo
1694 1767
 							</dd>';
1695 1768
 
1696 1769
 	// Choose WYSIWYG settings?
1697
-	if (empty($modSettings['disable_wysiwyg']))
1698
-		echo '
1770
+	if (empty($modSettings['disable_wysiwyg'])) {
1771
+			echo '
1699 1772
 							<dt>
1700 1773
 								<label for="wysiwyg_default">', $txt['wysiwyg_default'], '</label>
1701 1774
 							</dt>
@@ -1703,6 +1776,7 @@  discard block
 block discarded – undo
1703 1776
 								<input type="hidden" name="default_options[wysiwyg_default]" value="0">
1704 1777
 								<input type="checkbox" name="default_options[wysiwyg_default]" id="wysiwyg_default" value="1"', !empty($context['member']['options']['wysiwyg_default']) ? ' checked' : '', ' class="input_check">
1705 1778
 							</dd>';
1779
+	}
1706 1780
 
1707 1781
 	if (empty($modSettings['disableCustomPerPage']))
1708 1782
 	{
@@ -1733,8 +1807,8 @@  discard block
 block discarded – undo
1733 1807
 							</dd>';
1734 1808
 	}
1735 1809
 
1736
-	if (!empty($modSettings['cal_enabled']))
1737
-		echo '
1810
+	if (!empty($modSettings['cal_enabled'])) {
1811
+			echo '
1738 1812
 							<dt>
1739 1813
 								<label for="calendar_start_day">', $txt['calendar_start_day'], ':</label>
1740 1814
 							</dt>
@@ -1745,9 +1819,10 @@  discard block
 block discarded – undo
1745 1819
 									<option value="6"', !empty($context['member']['options']['calendar_start_day']) && $context['member']['options']['calendar_start_day'] == 6 ? ' selected' : '', '>', $txt['days'][6], '</option>
1746 1820
 								</select>
1747 1821
 							</dd>';
1822
+	}
1748 1823
 
1749
-	if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_autosave_enabled']))
1750
-		echo '
1824
+	if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_autosave_enabled'])) {
1825
+			echo '
1751 1826
 							<dt>
1752 1827
 								<label for="drafts_autosave_enabled">', $txt['drafts_autosave_enabled'], '</label>
1753 1828
 							</dt>
@@ -1755,8 +1830,9 @@  discard block
 block discarded – undo
1755 1830
 								<input type="hidden" name="default_options[drafts_autosave_enabled]" value="0">
1756 1831
 								<input type="checkbox" name="default_options[drafts_autosave_enabled]" id="drafts_autosave_enabled" value="1"', !empty($context['member']['options']['drafts_autosave_enabled']) ? ' checked' : '', ' class="input_check">
1757 1832
 							</dd>';
1758
-	if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_show_saved_enabled']))
1759
-		echo '
1833
+	}
1834
+	if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_show_saved_enabled'])) {
1835
+			echo '
1760 1836
 							<dt>
1761 1837
 								<label for="drafts_show_saved_enabled">', $txt['drafts_show_saved_enabled'], '</label>
1762 1838
 							</dt>
@@ -1764,6 +1840,7 @@  discard block
 block discarded – undo
1764 1840
 								<input type="hidden" name="default_options[drafts_show_saved_enabled]" value="0">
1765 1841
 								<input type="checkbox" name="default_options[drafts_show_saved_enabled]" id="drafts_show_saved_enabled" value="1"', !empty($context['member']['options']['drafts_show_saved_enabled']) ? ' checked' : '', ' class="input_check">
1766 1842
 							</dd>';
1843
+	}
1767 1844
 
1768 1845
 	echo '
1769 1846
 							<dt>
@@ -1809,8 +1886,8 @@  discard block
 block discarded – undo
1809 1886
 				<dl class="settings">';
1810 1887
 
1811 1888
 	// Allow notification on announcements to be disabled?
1812
-	if (!empty($modSettings['allow_disableAnnounce']))
1813
-		echo '
1889
+	if (!empty($modSettings['allow_disableAnnounce'])) {
1890
+			echo '
1814 1891
 					<dt>
1815 1892
 						<label for="notify_announcements">', $txt['notify_important_email'], '</label>
1816 1893
 					</dt>
@@ -1818,9 +1895,10 @@  discard block
 block discarded – undo
1818 1895
 						<input type="hidden" name="notify_announcements" value="0">
1819 1896
 						<input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', ' class="input_check">
1820 1897
 					</dd>';
1898
+	}
1821 1899
 
1822
-	if (!empty($modSettings['enable_ajax_alerts']))
1823
-		echo '
1900
+	if (!empty($modSettings['enable_ajax_alerts'])) {
1901
+			echo '
1824 1902
 					<dt>
1825 1903
 						<label for="notify_send_body">', $txt['notify_alert_timeout'], '</label>
1826 1904
 					</dt>
@@ -1828,6 +1906,7 @@  discard block
 block discarded – undo
1828 1906
 						<input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '" class="input_text">
1829 1907
 					</dd>
1830 1908
 		';
1909
+	}
1831 1910
 
1832 1911
 	echo '
1833 1912
 				</dl>
@@ -1858,9 +1937,10 @@  discard block
 block discarded – undo
1858 1937
 				<div class="smalltext">';
1859 1938
 				$label = $txt['alert_opt_' . $opts[1]];
1860 1939
 				$label_pos = isset($opts['label']) ? $opts['label'] : '';
1861
-				if ($label_pos == 'before')
1862
-					echo '
1940
+				if ($label_pos == 'before') {
1941
+									echo '
1863 1942
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1943
+				}
1864 1944
 
1865 1945
 				$this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0;
1866 1946
 				switch ($opts[0])
@@ -1872,17 +1952,19 @@  discard block
 block discarded – undo
1872 1952
 					case 'select':
1873 1953
 						echo '
1874 1954
 						<select name="opt_', $opts[1], '" id="opt_', $opts[1], '">';
1875
-						foreach ($opts['opts'] as $k => $v)
1876
-							echo '
1955
+						foreach ($opts['opts'] as $k => $v) {
1956
+													echo '
1877 1957
 							<option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>';
1958
+						}
1878 1959
 						echo '
1879 1960
 						</select>';
1880 1961
 						break;
1881 1962
 				}
1882 1963
 
1883
-				if ($label_pos == 'after')
1884
-					echo '
1964
+				if ($label_pos == 'after') {
1965
+									echo '
1885 1966
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1967
+				}
1886 1968
 
1887 1969
 				echo '
1888 1970
 				</div>';
@@ -1998,11 +2080,12 @@  discard block
 block discarded – undo
1998 2080
 			<p class="information">', $txt['groupMembership_info'], '</p>';
1999 2081
 
2000 2082
 	// Do we have an update message?
2001
-	if (!empty($context['update_message']))
2002
-		echo '
2083
+	if (!empty($context['update_message'])) {
2084
+			echo '
2003 2085
 			<div class="infobox">
2004 2086
 				', $context['update_message'], '.
2005 2087
 			</div>';
2088
+	}
2006 2089
 
2007 2090
 	echo '
2008 2091
 		<div id="groups">';
@@ -2024,8 +2107,7 @@  discard block
 block discarded – undo
2024 2107
 					</div>
2025 2108
 				</div>
2026 2109
 			</div>';
2027
-	}
2028
-	else
2110
+	} else
2029 2111
 	{
2030 2112
 		echo '
2031 2113
 			<div class="title_bar">
@@ -2037,27 +2119,30 @@  discard block
 block discarded – undo
2037 2119
 			echo '
2038 2120
 					<div class="windowbg" id="primdiv_', $group['id'], '">';
2039 2121
 
2040
-				if ($context['can_edit_primary'])
2041
-					echo '
2122
+				if ($context['can_edit_primary']) {
2123
+									echo '
2042 2124
 						<input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '"', $group['is_primary'] ? ' checked' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');"', $group['can_be_primary'] ? '' : ' disabled', ' class="input_radio">';
2125
+				}
2043 2126
 
2044 2127
 				echo '
2045 2128
 						<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>';
2046 2129
 
2047 2130
 				// Can they leave their group?
2048
-				if ($group['can_leave'])
2049
-					echo '
2131
+				if ($group['can_leave']) {
2132
+									echo '
2050 2133
 						<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>';
2134
+				}
2051 2135
 
2052 2136
 				echo '
2053 2137
 					</div>';
2054 2138
 		}
2055 2139
 
2056
-		if ($context['can_edit_primary'])
2057
-			echo '
2140
+		if ($context['can_edit_primary']) {
2141
+					echo '
2058 2142
 			<div class="padding righttext">
2059 2143
 				<input type="submit" value="', $txt['make_primary'], '" class="button_submit">
2060 2144
 			</div>';
2145
+		}
2061 2146
 
2062 2147
 		// Any groups they can join?
2063 2148
 		if (!empty($context['groups']['available']))
@@ -2073,15 +2158,16 @@  discard block
 block discarded – undo
2073 2158
 					<div class="windowbg">
2074 2159
 						<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>' : ''), '';
2075 2160
 
2076
-				if ($group['type'] == 3)
2077
-					echo '
2161
+				if ($group['type'] == 3) {
2162
+									echo '
2078 2163
 						<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>';
2079
-				elseif ($group['type'] == 2 && $group['pending'])
2080
-					echo '
2164
+				} elseif ($group['type'] == 2 && $group['pending']) {
2165
+									echo '
2081 2166
 						<span class="floatright">', $txt['approval_pending'],'</span>';
2082
-				elseif ($group['type'] == 2)
2083
-					echo '
2167
+				} elseif ($group['type'] == 2) {
2168
+									echo '
2084 2169
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
2170
+				}
2085 2171
 
2086 2172
 				echo '
2087 2173
 					</div>';
@@ -2104,9 +2190,10 @@  discard block
 block discarded – undo
2104 2190
 
2105 2191
 			prevDiv.className = "windowbg";
2106 2192
 		}';
2107
-		if (isset($context['groups']['member'][$context['primary_group']]))
2108
-			echo '
2193
+		if (isset($context['groups']['member'][$context['primary_group']])) {
2194
+					echo '
2109 2195
 		highlightSelected("primdiv_' . $context['primary_group'] . '");';
2196
+		}
2110 2197
 		echo '
2111 2198
 	</script>';
2112 2199
 	}
@@ -2114,9 +2201,10 @@  discard block
 block discarded – undo
2114 2201
 	echo '
2115 2202
 		</div>';
2116 2203
 
2117
-	if (!empty($context['token_check']))
2118
-		echo '
2204
+	if (!empty($context['token_check'])) {
2205
+			echo '
2119 2206
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2207
+	}
2120 2208
 
2121 2209
 	echo '
2122 2210
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2163,14 +2251,15 @@  discard block
 block discarded – undo
2163 2251
 
2164 2252
 		foreach ($category['boards'] as $board)
2165 2253
 		{
2166
-			if ($i == $limit)
2167
-				echo '
2254
+			if ($i == $limit) {
2255
+							echo '
2168 2256
 						</ul>
2169 2257
 					</li>
2170 2258
 				</ul>
2171 2259
 				<ul class="ignoreboards floatright">
2172 2260
 					<li class="category">
2173 2261
 						<ul>';
2262
+			}
2174 2263
 
2175 2264
 			echo '
2176 2265
 							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
@@ -2216,10 +2305,11 @@  discard block
 block discarded – undo
2216 2305
 
2217 2306
 	// Work out the starting color.
2218 2307
 	$context['current_color'] = $context['colors'][0];
2219
-	foreach ($context['colors'] as $limit => $color)
2220
-		if ($context['member']['warning'] >= $limit)
2308
+	foreach ($context['colors'] as $limit => $color) {
2309
+			if ($context['member']['warning'] >= $limit)
2221 2310
 			$context['current_color'] = $color;
2222
-}
2311
+	}
2312
+	}
2223 2313
 
2224 2314
 // Show all warnings of a user?
2225 2315
 function template_viewWarning()
@@ -2258,14 +2348,15 @@  discard block
 block discarded – undo
2258 2348
 				</dd>';
2259 2349
 
2260 2350
 		// There's some impact of this?
2261
-		if (!empty($context['level_effects'][$context['current_level']]))
2262
-			echo '
2351
+		if (!empty($context['level_effects'][$context['current_level']])) {
2352
+					echo '
2263 2353
 				<dt>
2264 2354
 					<strong>', $txt['profile_viewwarning_impact'], ':</strong>
2265 2355
 				</dt>
2266 2356
 				<dd>
2267 2357
 					', $context['level_effects'][$context['current_level']], '
2268 2358
 				</dd>';
2359
+		}
2269 2360
 
2270 2361
 		echo '
2271 2362
 			</dl>
@@ -2303,10 +2394,11 @@  discard block
 block discarded – undo
2303 2394
 
2304 2395
 			// Otherwise see what we can do...';
2305 2396
 
2306
-	foreach ($context['notification_templates'] as $k => $type)
2307
-		echo '
2397
+	foreach ($context['notification_templates'] as $k => $type) {
2398
+			echo '
2308 2399
 			if (index == ', $k, ')
2309 2400
 				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
2401
+	}
2310 2402
 
2311 2403
 	echo '
2312 2404
 		}
@@ -2316,10 +2408,11 @@  discard block
 block discarded – undo
2316 2408
 			// Also set the right effect.
2317 2409
 			effectText = "";';
2318 2410
 
2319
-	foreach ($context['level_effects'] as $limit => $text)
2320
-		echo '
2411
+	foreach ($context['level_effects'] as $limit => $text) {
2412
+			echo '
2321 2413
 			if (slideAmount >= ', $limit, ')
2322 2414
 				effectText = "', $text, '";';
2415
+	}
2323 2416
 
2324 2417
 	echo '
2325 2418
 			setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\');
@@ -2334,31 +2427,34 @@  discard block
 block discarded – undo
2334 2427
 			</h3>
2335 2428
 		</div>';
2336 2429
 
2337
-	if (!$context['user']['is_owner'])
2338
-		echo '
2430
+	if (!$context['user']['is_owner']) {
2431
+			echo '
2339 2432
 		<p class="information">', $txt['profile_warning_desc'], '</p>';
2433
+	}
2340 2434
 
2341 2435
 	echo '
2342 2436
 		<div class="windowbg">
2343 2437
 			<dl class="settings">';
2344 2438
 
2345
-	if (!$context['user']['is_owner'])
2346
-		echo '
2439
+	if (!$context['user']['is_owner']) {
2440
+			echo '
2347 2441
 				<dt>
2348 2442
 					<strong>', $txt['profile_warning_name'], ':</strong>
2349 2443
 				</dt>
2350 2444
 				<dd>
2351 2445
 					<strong>', $context['member']['name'], '</strong>
2352 2446
 				</dd>';
2447
+	}
2353 2448
 
2354 2449
 	echo '
2355 2450
 				<dt>
2356 2451
 					<strong>', $txt['profile_warning_level'], ':</strong>';
2357 2452
 
2358 2453
 	// Is there only so much they can apply?
2359
-	if ($context['warning_limit'])
2360
-		echo '
2454
+	if ($context['warning_limit']) {
2455
+			echo '
2361 2456
 					<br><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
2457
+	}
2362 2458
 
2363 2459
 	echo '
2364 2460
 				</dt>
@@ -2411,9 +2507,10 @@  discard block
 block discarded – undo
2411 2507
 						<option value="-1">', $txt['profile_warning_notify_template'], '</option>
2412 2508
 						<option value="-1" disabled>------------------------------</option>';
2413 2509
 
2414
-		foreach ($context['notification_templates'] as $id_template => $template)
2415
-			echo '
2510
+		foreach ($context['notification_templates'] as $id_template => $template) {
2511
+					echo '
2416 2512
 						<option value="', $id_template, '">', $template['title'], '</option>';
2513
+		}
2417 2514
 
2418 2515
 		echo '
2419 2516
 					</select>
@@ -2425,9 +2522,10 @@  discard block
 block discarded – undo
2425 2522
 			</dl>
2426 2523
 			<div class="righttext">';
2427 2524
 
2428
-	if (!empty($context['token_check']))
2429
-		echo '
2525
+	if (!empty($context['token_check'])) {
2526
+			echo '
2430 2527
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2528
+	}
2431 2529
 
2432 2530
 	echo '
2433 2531
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2443,8 +2541,8 @@  discard block
 block discarded – undo
2443 2541
 	echo '
2444 2542
 	<script>';
2445 2543
 
2446
-	if (!$context['user']['is_owner'])
2447
-		echo '
2544
+	if (!$context['user']['is_owner']) {
2545
+			echo '
2448 2546
 		modifyWarnNotify();
2449 2547
 		$(document).ready(function() {
2450 2548
 			$("#preview_button").click(function() {
@@ -2483,6 +2581,7 @@  discard block
 block discarded – undo
2483 2581
 			});
2484 2582
 			return false;
2485 2583
 		}';
2584
+	}
2486 2585
 
2487 2586
 	echo '
2488 2587
 	</script>';
@@ -2505,16 +2604,18 @@  discard block
 block discarded – undo
2505 2604
 			</div>';
2506 2605
 
2507 2606
 	// If deleting another account give them a lovely info box.
2508
-	if (!$context['user']['is_owner'])
2509
-		echo '
2607
+	if (!$context['user']['is_owner']) {
2608
+			echo '
2510 2609
 			<p class="information">', $txt['deleteAccount_desc'], '</p>';
2610
+	}
2511 2611
 	echo '
2512 2612
 			<div class="windowbg2">';
2513 2613
 
2514 2614
 	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
2515
-	if ($context['needs_approval'])
2516
-		echo '
2615
+	if ($context['needs_approval']) {
2616
+			echo '
2517 2617
 				<div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
2618
+	}
2518 2619
 
2519 2620
 	// If the user is deleting their own account warn them first - and require a password!
2520 2621
 	if ($context['user']['is_owner'])
@@ -2526,9 +2627,10 @@  discard block
 block discarded – undo
2526 2627
 					<input type="password" name="oldpasswrd" size="20" class="input_password">&nbsp;&nbsp;&nbsp;&nbsp;
2527 2628
 					<input type="submit" value="', $txt['yes'], '" class="button_submit">';
2528 2629
 
2529
-		if (!empty($context['token_check']))
2530
-			echo '
2630
+		if (!empty($context['token_check'])) {
2631
+					echo '
2531 2632
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2633
+		}
2532 2634
 
2533 2635
 		echo '
2534 2636
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2554,9 +2656,10 @@  discard block
 block discarded – undo
2554 2656
 						<option value="topics">', $txt['deleteAccount_topics'], '</option>
2555 2657
 					</select>';
2556 2658
 
2557
-			if ($context['show_perma_delete'])
2558
-				echo '
2659
+			if ($context['show_perma_delete']) {
2660
+							echo '
2559 2661
 					<br><label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1" class="input_check">', $txt['deleteAccount_permanent'], ':</label>';
2662
+			}
2560 2663
 
2561 2664
 			echo '
2562 2665
 				</div>';
@@ -2569,9 +2672,10 @@  discard block
 block discarded – undo
2569 2672
 				<div>
2570 2673
 					<input type="submit" value="', $txt['delete'], '" class="button_submit">';
2571 2674
 
2572
-		if (!empty($context['token_check']))
2573
-			echo '
2675
+		if (!empty($context['token_check'])) {
2676
+					echo '
2574 2677
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2678
+		}
2575 2679
 
2576 2680
 		echo '
2577 2681
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2597,8 +2701,8 @@  discard block
 block discarded – undo
2597 2701
 					<hr>';
2598 2702
 
2599 2703
 	// Only show the password box if it's actually needed.
2600
-	if ($context['require_password'])
2601
-		echo '
2704
+	if ($context['require_password']) {
2705
+			echo '
2602 2706
 					<dl>
2603 2707
 						<dt>
2604 2708
 							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br>
@@ -2608,13 +2712,15 @@  discard block
 block discarded – undo
2608 2712
 							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password">
2609 2713
 						</dd>
2610 2714
 					</dl>';
2715
+	}
2611 2716
 
2612 2717
 	echo '
2613 2718
 					<div class="righttext">';
2614 2719
 
2615
-		if (!empty($context['token_check']))
2616
-			echo '
2720
+		if (!empty($context['token_check'])) {
2721
+					echo '
2617 2722
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2723
+		}
2618 2724
 
2619 2725
 	echo '
2620 2726
 						<input type="submit" value="', $txt['change_profile'], '" class="button_submit">
@@ -2641,9 +2747,10 @@  discard block
 block discarded – undo
2641 2747
 			<ul id="list_errors">';
2642 2748
 
2643 2749
 		// Cycle through each error and display an error message.
2644
-		foreach ($context['post_errors'] as $error)
2645
-			echo '
2750
+		foreach ($context['post_errors'] as $error) {
2751
+					echo '
2646 2752
 				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
2753
+		}
2647 2754
 
2648 2755
 		echo '
2649 2756
 			</ul>';
@@ -2669,12 +2776,13 @@  discard block
 block discarded – undo
2669 2776
 								<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;"' : ''), '>';
2670 2777
 
2671 2778
 		// Fill the select box with all primary member groups that can be assigned to a member.
2672
-		foreach ($context['member_groups'] as $member_group)
2673
-			if (!empty($member_group['can_be_primary']))
2779
+		foreach ($context['member_groups'] as $member_group) {
2780
+					if (!empty($member_group['can_be_primary']))
2674 2781
 				echo '
2675 2782
 									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '>
2676 2783
 										', $member_group['name'], '
2677 2784
 									</option>';
2785
+		}
2678 2786
 		echo '
2679 2787
 								</select>
2680 2788
 							</dd>
@@ -2686,10 +2794,11 @@  discard block
 block discarded – undo
2686 2794
 									<input type="hidden" name="additional_groups[]" value="0">';
2687 2795
 
2688 2796
 		// For each membergroup show a checkbox so members can be assigned to more than one group.
2689
-		foreach ($context['member_groups'] as $member_group)
2690
-			if ($member_group['can_be_additional'])
2797
+		foreach ($context['member_groups'] as $member_group) {
2798
+					if ($member_group['can_be_additional'])
2691 2799
 				echo '
2692 2800
 									<label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked' : '', ' class="input_check"> ', $member_group['name'], '</label><br>';
2801
+		}
2693 2802
 		echo '
2694 2803
 								</span>
2695 2804
 								<a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;" class="toggle_down">', $txt['additional_membergroups_show'], '</a>
@@ -2749,9 +2858,10 @@  discard block
 block discarded – undo
2749 2858
 								<span class="smalltext">', $txt['sig_info'], '</span><br>
2750 2859
 								<br>';
2751 2860
 
2752
-	if ($context['show_spellchecking'])
2753
-		echo '
2861
+	if ($context['show_spellchecking']) {
2862
+			echo '
2754 2863
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button_submit">';
2864
+	}
2755 2865
 
2756 2866
 		echo '
2757 2867
 							</dt>
@@ -2759,17 +2869,20 @@  discard block
 block discarded – undo
2759 2869
 								<textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50" style="min-width: 50%; max-width: 99%;">', $context['member']['signature'], '</textarea><br>';
2760 2870
 
2761 2871
 	// If there is a limit at all!
2762
-	if (!empty($context['signature_limits']['max_length']))
2763
-		echo '
2872
+	if (!empty($context['signature_limits']['max_length'])) {
2873
+			echo '
2764 2874
 								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>';
2875
+	}
2765 2876
 
2766
-	if (!empty($context['show_preview_button']))
2767
-		echo '
2877
+	if (!empty($context['show_preview_button'])) {
2878
+			echo '
2768 2879
 								<input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button_submit">';
2880
+	}
2769 2881
 
2770
-	if ($context['signature_warning'])
2771
-		echo '
2882
+	if ($context['signature_warning']) {
2883
+			echo '
2772 2884
 								<span class="smalltext">', $context['signature_warning'], '</span>';
2885
+	}
2773 2886
 
2774 2887
 	// Some javascript used to count how many characters have been used so far in the signature.
2775 2888
 	echo '
@@ -2813,9 +2926,10 @@  discard block
 block discarded – undo
2813 2926
 									<div>
2814 2927
 										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
2815 2928
 		// This lists all the file categories.
2816
-		foreach ($context['avatars'] as $avatar)
2817
-			echo '
2929
+		foreach ($context['avatars'] as $avatar) {
2930
+					echo '
2818 2931
 											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>';
2932
+		}
2819 2933
 		echo '
2820 2934
 										</select>
2821 2935
 									</div>
@@ -2870,16 +2984,17 @@  discard block
 block discarded – undo
2870 2984
 								<div id="avatar_gravatar">
2871 2985
 									<img src="' . $context['member']['avatar']['href'] . '" alt="" />';
2872 2986
 
2873
-		if (empty($modSettings['gravatarAllowExtraEmail']))
2874
-			echo '
2987
+		if (empty($modSettings['gravatarAllowExtraEmail'])) {
2988
+					echo '
2875 2989
 									<div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>';
2876
-		else
2990
+		} else
2877 2991
 		{
2878 2992
 			// Depending on other stuff, the stored value here might have some odd things in it from other areas.
2879
-			if ($context['member']['avatar']['external'] == $context['member']['email'])
2880
-				$textbox_value = '';
2881
-			else
2882
-				$textbox_value = $context['member']['avatar']['external'];
2993
+			if ($context['member']['avatar']['external'] == $context['member']['email']) {
2994
+							$textbox_value = '';
2995
+			} else {
2996
+							$textbox_value = $context['member']['avatar']['external'];
2997
+			}
2883 2998
 
2884 2999
 			echo '
2885 3000
 									<div class="smalltext">', $txt['gravatar_alternateEmail'], '</div>
@@ -2951,8 +3066,9 @@  discard block
 block discarded – undo
2951 3066
 	$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
2952 3067
 
2953 3068
 	$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
2954
-	if (empty($suffix))
2955
-		return;
3069
+	if (empty($suffix)) {
3070
+			return;
3071
+	}
2956 3072
 
2957 3073
 	echo '
2958 3074
 									<div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>';
@@ -2974,9 +3090,10 @@  discard block
 block discarded – undo
2974 3090
 							<dd>
2975 3091
 								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
2976 3092
 	// Help the user by showing a list of common time formats.
2977
-	foreach ($context['easy_timeformats'] as $time_format)
2978
-		echo '
3093
+	foreach ($context['easy_timeformats'] as $time_format) {
3094
+			echo '
2979 3095
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3096
+	}
2980 3097
 	echo '
2981 3098
 								</select><br>
2982 3099
 								<input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30" class="input_text">
@@ -3012,9 +3129,10 @@  discard block
 block discarded – undo
3012 3129
 							</dt>
3013 3130
 							<dd>
3014 3131
 								<select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">';
3015
-	foreach ($context['smiley_sets'] as $set)
3016
-		echo '
3132
+	foreach ($context['smiley_sets'] as $set) {
3133
+			echo '
3017 3134
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>';
3135
+	}
3018 3136
 	echo '
3019 3137
 								</select> <img id="smileypr" class="centericon" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.png', '" alt=":)"  style="padding-left: 20px;">
3020 3138
 							</dd>';
@@ -3065,10 +3183,11 @@  discard block
 block discarded – undo
3065 3183
 									</div>
3066 3184
 									<div class="clear"></div>';
3067 3185
 
3068
-	if (!empty($context['from_ajax']))
3069
-		echo '
3186
+	if (!empty($context['from_ajax'])) {
3187
+			echo '
3070 3188
 									<br>
3071 3189
 									<a href="javascript:self.close();"></a>';
3190
+	}
3072 3191
 
3073 3192
 	echo '
3074 3193
 								</div>
@@ -3107,15 +3226,16 @@  discard block
 block discarded – undo
3107 3226
 								<br /><div class="smalltext">', $txt['tfa_profile_desc'], '</div>
3108 3227
 							</dt>
3109 3228
 							<dd>';
3110
-	if (!$context['tfa_enabled'] && $context['user']['is_owner'])
3111
-		echo '
3229
+	if (!$context['tfa_enabled'] && $context['user']['is_owner']) {
3230
+			echo '
3112 3231
 								<a href="', !empty($modSettings['force_ssl']) && $modSettings['force_ssl'] < 2 ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>';
3113
-	elseif (!$context['tfa_enabled'])
3114
-		echo '
3232
+	} elseif (!$context['tfa_enabled']) {
3233
+			echo '
3115 3234
 								', $txt['tfa_profile_disabled'];
3116
-	else
3117
-		echo '
3235
+	} else {
3236
+			echo '
3118 3237
 							', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable');
3238
+	}
3119 3239
 	echo '
3120 3240
 							</dd>';
3121 3241
 }
Please login to merge, or discard this patch.
Themes/default/ManageMembergroups.template.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 	echo '
344 344
 				</dl>
345 345
 				<input type="submit" name="save" value="', $txt['membergroups_edit_save'], '" class="button_submit">', $context['group']['allow_delete'] ? '
346
-				<input type="submit" name="delete" value="'. $txt['membergroups_delete'] .'" data-confirm="'. ($context['is_moderator_group'] ? $txt['membergroups_confirm_delete_mod'] : $txt['membergroups_confirm_delete']) .'" class="button_submit you_sure">' : '', '
346
+				<input type="submit" name="delete" value="'. $txt['membergroups_delete'] . '" data-confirm="' . ($context['is_moderator_group'] ? $txt['membergroups_confirm_delete_mod'] : $txt['membergroups_confirm_delete']) . '" class="button_submit you_sure">' : '', '
347 347
 			</div>
348 348
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
349 349
 			<input type="hidden" name="', $context['admin-mmg_token_var'], '" value="', $context['admin-mmg_token'], '">
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 
531 531
 	echo '
532 532
 	<div id="admincenter">
533
-		<form action="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : '') , ';sa=members;group=', $context['group']['id'], '" method="post" accept-charset="', $context['character_set'], '" id="view_group">
533
+		<form action="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;group=', $context['group']['id'], '" method="post" accept-charset="', $context['character_set'], '" id="view_group">
534 534
 			<div class="cat_bar">
535 535
 				<h3 class="catbg">', $context['page_title'], '</h3>
536 536
 			</div>
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 						<strong>' . $txt['membergroups_members_description'] . ':</strong>
550 550
 					</dt>
551 551
 					<dd>
552
-						', $context['group']['description'] ,'
552
+						', $context['group']['description'], '
553 553
 					</dd>';
554 554
 
555 555
 	echo '
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 						<strong>', $txt['membergroups_members_top'], ':</strong>
558 558
 					</dt>
559 559
 					<dd>
560
-						', $context['total_members'] ,'
560
+						', $context['total_members'], '
561 561
 					</dd>';
562 562
 	// Any group moderators to show?
563 563
 	if (!empty($context['group']['moderators']))
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 						<strong>', $txt['membergroups_members_group_moderators'], ':</strong>
572 572
 					</dt>
573 573
 					<dd>
574
-						', implode(', ', $moderators) ,'
574
+						', implode(', ', $moderators), '
575 575
 					</dd>';
576 576
 	}
577 577
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	echo '
598 598
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
599 599
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['date_registered'], $context['sort_by'] == 'registered' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
600
-						<th ', empty($context['group']['assignable']) ? ' colspan="2"' : '', '><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '','</a></th>';
600
+						<th ', empty($context['group']['assignable']) ? ' colspan="2"' : '', '><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
601 601
 	if (!empty($context['group']['assignable']))
602 602
 		echo '
603 603
 						<th style="width: 4%"><input type="checkbox" class="input_check" onclick="invertAll(this, this.form);"></th>';
Please login to merge, or discard this patch.
Braces   +92 added lines, -65 removed lines patch added patch discarded remove patch
@@ -52,9 +52,10 @@  discard block
 block discarded – undo
52 52
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
53 53
 							<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
54 54
 
55
-		if ($context['allow_protected'])
56
-			echo '
55
+		if ($context['allow_protected']) {
56
+					echo '
57 57
 							<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
58
+		}
58 59
 
59 60
 		echo '
60 61
 							<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
@@ -64,14 +65,15 @@  discard block
 block discarded – undo
64 65
 					</dd>';
65 66
 	}
66 67
 
67
-	if ($context['post_group'] || $context['undefined_group'])
68
-		echo '
68
+	if ($context['post_group'] || $context['undefined_group']) {
69
+			echo '
69 70
 					<dt id="min_posts_text">
70 71
 						<strong>', $txt['membergroups_min_posts'], ':</strong>
71 72
 					</dt>
72 73
 					<dd>
73 74
 						<input type="number" name="min_posts" id="min_posts_input" size="5" class="input_text">
74 75
 					</dd>';
76
+	}
75 77
 	if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups']))
76 78
 	{
77 79
 		echo '
@@ -87,9 +89,10 @@  discard block
 block discarded – undo
87 89
 							<select name="inheritperm" id="inheritperm_select" onclick="document.getElementById(\'perm_type_inherit\').checked = true;">
88 90
 								<option value="-1">', $txt['membergroups_guests'], '</option>
89 91
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
90
-		foreach ($context['groups'] as $group)
91
-			echo '
92
+		foreach ($context['groups'] as $group) {
93
+					echo '
92 94
 								<option value="', $group['id'], '">', $group['name'], '</option>';
95
+		}
93 96
 		echo '
94 97
 							</select>
95 98
 							<br>
@@ -98,9 +101,10 @@  discard block
 block discarded – undo
98 101
 							<select name="copyperm" id="copyperm_select" onclick="document.getElementById(\'perm_type_copy\').checked = true;">
99 102
 								<option value="-1">', $txt['membergroups_guests'], '</option>
100 103
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
101
-		foreach ($context['groups'] as $group)
102
-			echo '
104
+		foreach ($context['groups'] as $group) {
105
+					echo '
103 106
 								<option value="', $group['id'], '">', $group['name'], '</option>';
107
+		}
104 108
 		echo '
105 109
 							</select>
106 110
 							<br>
@@ -173,8 +177,8 @@  discard block
 block discarded – undo
173 177
 						<input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30" class="input_text">
174 178
 					</dd>';
175 179
 
176
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
177
-		echo '
180
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
181
+			echo '
178 182
 
179 183
 					<dt id="group_desc_text">
180 184
 						<label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label>
@@ -182,6 +186,7 @@  discard block
 block discarded – undo
182 186
 					<dd>
183 187
 						<textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea>
184 188
 					</dd>';
189
+	}
185 190
 
186 191
 	// Group type...
187 192
 	if ($context['group']['allow_post_group'])
@@ -195,9 +200,10 @@  discard block
 block discarded – undo
195 200
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
196 201
 							<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
197 202
 
198
-		if ($context['group']['allow_protected'])
199
-			echo '
203
+		if ($context['group']['allow_protected']) {
204
+					echo '
200 205
 							<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
206
+		}
201 207
 
202 208
 		echo '
203 209
 							<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
@@ -207,8 +213,8 @@  discard block
 block discarded – undo
207 213
 					</dd>';
208 214
 	}
209 215
 
210
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
211
-		echo '
216
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
217
+			echo '
212 218
 					<dt id="group_moderators_text">
213 219
 						<label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label>
214 220
 					</dt>
@@ -226,6 +232,7 @@  discard block
 block discarded – undo
226 232
 							<option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option>
227 233
 						</select>
228 234
 					</dd>';
235
+	}
229 236
 
230 237
 	// Can they inherit permissions?
231 238
 	if ($context['group']['id'] > 1 && $context['group']['id'] != 3)
@@ -242,9 +249,10 @@  discard block
 block discarded – undo
242 249
 							<option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>';
243 250
 
244 251
 		// For all the inheritable groups show an option.
245
-		foreach ($context['inheritable_groups'] as $id => $group)
246
-			echo '
252
+		foreach ($context['inheritable_groups'] as $id => $group) {
253
+					echo '
247 254
 							<option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>';
255
+		}
248 256
 
249 257
 		echo '
250 258
 						</select>
@@ -252,8 +260,8 @@  discard block
 block discarded – undo
252 260
 					</dd>';
253 261
 	}
254 262
 
255
-	if ($context['group']['allow_post_group'])
256
-		echo '
263
+	if ($context['group']['allow_post_group']) {
264
+			echo '
257 265
 
258 266
 					<dt id="min_posts_text">
259 267
 						<label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label>
@@ -261,6 +269,7 @@  discard block
 block discarded – undo
261 269
 					<dd>
262 270
 						<input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6" class="input_text">
263 271
 					</dd>';
272
+	}
264 273
 	echo '
265 274
 					<dt>
266 275
 						<label for="online_color_input"><strong>', $txt['membergroups_online_color'], ':</strong></label>
@@ -301,9 +310,10 @@  discard block
 block discarded – undo
301 310
 	}
302 311
 
303 312
 	// No? Hide the entire control.
304
-	else
305
-		echo '
313
+	else {
314
+			echo '
306 315
 					<input type="hidden" name="icon_image" value="">';
316
+	}
307 317
 
308 318
 	echo '
309 319
 					<dt>
@@ -314,8 +324,8 @@  discard block
 block discarded – undo
314 324
 						<input type="text" name="max_messages" id="max_messages_input" value="', $context['group']['id'] == 1 ? 0 : $context['group']['max_messages'], '" size="6"', $context['group']['id'] == 1 ? ' disabled' : '', ' class="input_text">
315 325
 					</dd>';
316 326
 	//Force 2FA for this membergroup?
317
-	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2)
318
-	echo '
327
+	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) {
328
+		echo '
319 329
 					<dt>
320 330
 						<label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br>
321 331
 						<span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span>
@@ -323,6 +333,7 @@  discard block
 block discarded – undo
323 333
 					<dd>
324 334
 						<input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', ' class="input_check">
325 335
 					</dd>';
336
+	}
326 337
 
327 338
 	if (!empty($context['categories']))
328 339
 	{
@@ -332,10 +343,11 @@  discard block
 block discarded – undo
332 343
 						<span class="smalltext">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', '
333 344
 					</dt>
334 345
 					<dd>';
335
-		if (!empty($context['can_manage_boards']))
336
-			echo $txt['membergroups_can_manage_access'];
337
-		else
338
-			template_add_edit_group_boards_list();
346
+		if (!empty($context['can_manage_boards'])) {
347
+					echo $txt['membergroups_can_manage_access'];
348
+		} else {
349
+					template_add_edit_group_boards_list();
350
+		}
339 351
 
340 352
 		echo '
341 353
 					</dd>';
@@ -364,20 +376,21 @@  discard block
 block discarded – undo
364 376
 				sItemListContainerId: \'moderator_container\',
365 377
 				aListItems: [';
366 378
 
367
-			foreach ($context['group']['moderators'] as $id_member => $member_name)
368
-				echo '
379
+			foreach ($context['group']['moderators'] as $id_member => $member_name) {
380
+							echo '
369 381
 							{
370 382
 								sItemId: ', JavaScriptEscape($id_member), ',
371 383
 								sItemName: ', JavaScriptEscape($member_name), '
372 384
 							}', $id_member == $context['group']['last_moderator_id'] ? '' : ',';
385
+			}
373 386
 
374 387
 			echo '
375 388
 				]
376 389
 			});
377 390
 		</script>';
378 391
 
379
-	if ($context['group']['allow_post_group'])
380
-		echo '
392
+	if ($context['group']['allow_post_group']) {
393
+			echo '
381 394
 		<script>
382 395
 			function swapPostGroup(isChecked)
383 396
 			{
@@ -425,7 +438,8 @@  discard block
 block discarded – undo
425 438
 
426 439
 			swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', ');
427 440
 		</script>';
428
-}
441
+	}
442
+	}
429 443
 
430 444
 /**
431 445
  * The template for determining which boards a group has access to.
@@ -442,13 +456,13 @@  discard block
 block discarded – undo
442 456
 
443 457
 	foreach ($context['categories'] as $category)
444 458
 	{
445
-		if (empty($modSettings['deny_boards_access']))
446
-			echo '
459
+		if (empty($modSettings['deny_boards_access'])) {
460
+					echo '
447 461
 									<li class="category">
448 462
 										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a>
449 463
 									<ul style="width:100%">';
450
-		else
451
-			echo '
464
+		} else {
465
+					echo '
452 466
 									<li class="category">
453 467
 										<strong>', $category['name'], '</strong>
454 468
 										<span class="select_all_box">
@@ -461,16 +475,17 @@  discard block
 block discarded – undo
461 475
 											</select>
462 476
 										</span>
463 477
 										<ul style="width:100%" id="boards_list_', $category['id'], '">';
478
+		}
464 479
 
465 480
 		foreach ($category['boards'] as $board)
466 481
 		{
467
-			if (empty($modSettings['deny_boards_access']))
468
-				echo '
482
+			if (empty($modSettings['deny_boards_access'])) {
483
+							echo '
469 484
 										<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
470 485
 											<input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', ' class="input_check"> <label for="brd', $board['id'], '">', $board['name'], '</label>
471 486
 										</li>';
472
-			else
473
-				echo '
487
+			} else {
488
+							echo '
474 489
 											<li class="board" style="width:100%">
475 490
 												<span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span>
476 491
 												<span style="width:50%;float:right">
@@ -479,6 +494,7 @@  discard block
 block discarded – undo
479 494
 													<input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', ' class="input_check"> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label>
480 495
 												</span>
481 496
 											</li>';
497
+			}
482 498
 		}
483 499
 
484 500
 		echo '
@@ -489,13 +505,13 @@  discard block
 block discarded – undo
489 505
 	echo '
490 506
 							</ul>';
491 507
 
492
-	if (empty($modSettings['deny_boards_access']))
493
-		echo '
508
+	if (empty($modSettings['deny_boards_access'])) {
509
+			echo '
494 510
 								<br class="clear"><br>
495 511
 								<input type="checkbox" id="checkall_check" class="input_check" onclick="invertAll(this, this.form, \'boardaccess\');"> <label for="checkall_check"><em>', $txt['check_all'], '</em></label>
496 512
 							</fieldset>';
497
-	else
498
-		echo '
513
+	} else {
514
+			echo '
499 515
 								<br class="clear">
500 516
 								<span class="select_all_box">
501 517
 									<em>', $txt['all'], ': </em>
@@ -511,15 +527,17 @@  discard block
 block discarded – undo
511 527
 									});
512 528
 								});
513 529
 							</script>';
530
+	}
514 531
 
515
-	if ($collapse)
516
-		echo '
532
+	if ($collapse) {
533
+			echo '
517 534
 							<a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a>
518 535
 							<script>
519 536
 								document.getElementById("visible_boards_link").style.display = "";
520 537
 								document.getElementById("visible_boards").style.display = "none";
521 538
 							</script>';
522
-}
539
+	}
540
+	}
523 541
 
524 542
 /**
525 543
  * Templatine for viewing the members of a group.
@@ -543,14 +561,15 @@  discard block
 block discarded – undo
543 561
 						<span ', $context['group']['online_color'] ? 'style="color: ' . $context['group']['online_color'] . ';"' : '', '>', $context['group']['name'], '</span> ', $context['group']['icons'], '
544 562
 					</dd>';
545 563
 	//Any description to show?
546
-	if (!empty($context['group']['description']))
547
-		echo '
564
+	if (!empty($context['group']['description'])) {
565
+			echo '
548 566
 					<dt>
549 567
 						<strong>' . $txt['membergroups_members_description'] . ':</strong>
550 568
 					</dt>
551 569
 					<dd>
552 570
 						', $context['group']['description'] ,'
553 571
 					</dd>';
572
+	}
554 573
 
555 574
 	echo '
556 575
 					<dt>
@@ -563,8 +582,9 @@  discard block
 block discarded – undo
563 582
 	if (!empty($context['group']['moderators']))
564 583
 	{
565 584
 		$moderators = array();
566
-		foreach ($context['group']['moderators'] as $moderator)
567
-			$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
585
+		foreach ($context['group']['moderators'] as $moderator) {
586
+					$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
587
+		}
568 588
 
569 589
 		echo '
570 590
 					<dt>
@@ -590,27 +610,30 @@  discard block
 block discarded – undo
590 610
 					<tr class="title_bar">
591 611
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
592 612
 
593
-	if ($context['can_send_email'])
594
-		echo '
613
+	if ($context['can_send_email']) {
614
+			echo '
595 615
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
616
+	}
596 617
 
597 618
 	echo '
598 619
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
599 620
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['date_registered'], $context['sort_by'] == 'registered' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
600 621
 						<th ', empty($context['group']['assignable']) ? ' colspan="2"' : '', '><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '','</a></th>';
601
-	if (!empty($context['group']['assignable']))
602
-		echo '
622
+	if (!empty($context['group']['assignable'])) {
623
+			echo '
603 624
 						<th style="width: 4%"><input type="checkbox" class="input_check" onclick="invertAll(this, this.form);"></th>';
625
+	}
604 626
 	echo '
605 627
 					</tr>
606 628
 				</thead>
607 629
 				<tbody>';
608 630
 
609
-	if (empty($context['members']))
610
-		echo '
631
+	if (empty($context['members'])) {
632
+			echo '
611 633
 					<tr class="windowbg">
612 634
 						<td colspan="6">', $txt['membergroups_members_no_members'], '</td>
613 635
 					</tr>';
636
+	}
614 637
 
615 638
 	foreach ($context['members'] as $member)
616 639
 	{
@@ -629,9 +652,10 @@  discard block
 block discarded – undo
629 652
 						<td>', $member['last_online'], '</td>
630 653
 						<td>', $member['registered'], '</td>
631 654
 						<td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>';
632
-		if (!empty($context['group']['assignable']))
633
-			echo '
655
+		if (!empty($context['group']['assignable'])) {
656
+					echo '
634 657
 						<td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" class="input_check" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>';
658
+		}
635 659
 		echo '
636 660
 					</tr>';
637 661
 	}
@@ -640,11 +664,12 @@  discard block
 block discarded – undo
640 664
 				</tbody>
641 665
 			</table>';
642 666
 
643
-	if (!empty($context['group']['assignable']))
644
-		echo '
667
+	if (!empty($context['group']['assignable'])) {
668
+			echo '
645 669
 			<div class="floatright">
646 670
 				<input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button_submit ">
647 671
 			</div>';
672
+	}
648 673
 
649 674
 	echo '
650 675
 			<div class="pagesection flow_hidden">
@@ -678,8 +703,8 @@  discard block
 block discarded – undo
678 703
 		</form>
679 704
 	</div>';
680 705
 
681
-	if (!empty($context['group']['assignable']))
682
-		echo '
706
+	if (!empty($context['group']['assignable'])) {
707
+			echo '
683 708
 		<script>
684 709
 			var oAddMemberSuggest = new smc_AutoSuggest({
685 710
 				sSelf: \'oAddMemberSuggest\',
@@ -695,7 +720,8 @@  discard block
 block discarded – undo
695 720
 				sItemListContainerId: \'toAddItemContainer\'
696 721
 			});
697 722
 		</script>';
698
-}
723
+	}
724
+	}
699 725
 
700 726
 /**
701 727
  * Allow the moderator to enter a reason to each user being rejected.
@@ -715,8 +741,8 @@  discard block
 block discarded – undo
715 741
 				<dl class="settings">';
716 742
 
717 743
 	// Loop through and print out a reason box for each...
718
-	foreach ($context['group_requests'] as $request)
719
-		echo '
744
+	foreach ($context['group_requests'] as $request) {
745
+			echo '
720 746
 					<dt>
721 747
 						<strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong>
722 748
 					</dt>
@@ -724,6 +750,7 @@  discard block
 block discarded – undo
724 750
 						<input type="hidden" name="groupr[]" value="', $request['id'], '">
725 751
 						<textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="min-width: 80%; max-width: 99%;"></textarea>
726 752
 					</dd>';
753
+	}
727 754
 
728 755
 	echo '
729 756
 				</dl>
Please login to merge, or discard this patch.
Themes/default/Who.template.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@
 block discarded – undo
244 244
 	// SMF itself
245 245
 	echo '
246 246
 		<div class="cat_bar">
247
-			<h3 class="catbg">', $txt['credits_forum'],' ', $txt['credits_copyright'], '</h3>
247
+			<h3 class="catbg">', $txt['credits_forum'], ' ', $txt['credits_copyright'], '</h3>
248 248
 		</div>
249 249
 		<div class="windowbg noup">
250 250
 			', $context['copyrights']['smf'], '
Please login to merge, or discard this patch.
Braces   +39 added lines, -27 removed lines patch added patch discarded remove patch
@@ -31,9 +31,10 @@  discard block
 block discarded – undo
31 31
 					<div class="selectbox floatright" id="upper_show">', $txt['who_show1'], '
32 32
 						<select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">';
33 33
 
34
-	foreach ($context['show_methods'] as $value => $label)
35
-		echo '
34
+	foreach ($context['show_methods'] as $value => $label) {
35
+			echo '
36 36
 							<option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>';
37
+	}
37 38
 	echo '
38 39
 						</select>
39 40
 						<noscript>
@@ -71,9 +72,10 @@  discard block
 block discarded – undo
71 72
 									', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt['profile_of'] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', '
72 73
 								</span>';
73 74
 
74
-		if (!empty($member['ip']))
75
-			echo '
75
+		if (!empty($member['ip'])) {
76
+					echo '
76 77
 								(<a href="' . $scripturl . '?action=', ($member['is_guest'] ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $member['id']), ';searchip=' . $member['ip'] . '">' . $member['ip'] . '</a>)';
78
+		}
77 79
 
78 80
 		echo '
79 81
 							</td>
@@ -103,9 +105,10 @@  discard block
 block discarded – undo
103 105
 					<div class="selectbox floatright">', $txt['who_show1'], '
104 106
 						<select name="show" onchange="document.forms.whoFilter.submit();">';
105 107
 
106
-	foreach ($context['show_methods'] as $value => $label)
107
-		echo '
108
+	foreach ($context['show_methods'] as $value => $label) {
109
+			echo '
108 110
 							<option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>';
111
+	}
109 112
 	echo '
110 113
 						</select>
111 114
 						<noscript>
@@ -134,17 +137,19 @@  discard block
 block discarded – undo
134 137
 
135 138
 	foreach ($context['credits'] as $section)
136 139
 	{
137
-		if (isset($section['pretext']))
138
-		echo '
140
+		if (isset($section['pretext'])) {
141
+				echo '
139 142
 		<div class="windowbg noup">
140 143
 			<p>', $section['pretext'], '</p>
141 144
 		</div>';
145
+		}
142 146
 
143
-		if (isset($section['title']))
144
-		echo '
147
+		if (isset($section['title'])) {
148
+				echo '
145 149
 		<div class="cat_bar">
146 150
 			<h3 class="catbg">', $section['title'], '</h3>
147 151
 		</div>';
152
+		}
148 153
 
149 154
 		echo '
150 155
 		<div class="windowbg2 noup">
@@ -152,17 +157,18 @@  discard block
 block discarded – undo
152 157
 
153 158
 		foreach ($section['groups'] as $group)
154 159
 		{
155
-			if (isset($group['title']))
156
-				echo '
160
+			if (isset($group['title'])) {
161
+							echo '
157 162
 				<dt>
158 163
 					<strong>', $group['title'], '</strong>
159 164
 				</dt>
160 165
 				<dd>';
166
+			}
161 167
 
162 168
 			// Try to make this read nicely.
163
-			if (count($group['members']) <= 2)
164
-				echo implode(' ' . $txt['credits_and'] . ' ', $group['members']);
165
-			else
169
+			if (count($group['members']) <= 2) {
170
+							echo implode(' ' . $txt['credits_and'] . ' ', $group['members']);
171
+			} else
166 172
 			{
167 173
 				$last_peep = array_pop($group['members']);
168 174
 				echo implode(', ', $group['members']), ' ', $txt['credits_and'], ' ', $last_peep;
@@ -175,9 +181,10 @@  discard block
 block discarded – undo
175 181
 		echo '
176 182
 			</dl>';
177 183
 
178
-		if (isset($section['posttext']))
179
-			echo '
184
+		if (isset($section['posttext'])) {
185
+					echo '
180 186
 				<p class="posttext">', $section['posttext'], '</p>';
187
+		}
181 188
 
182 189
 		echo '
183 190
 		</div>';
@@ -192,26 +199,29 @@  discard block
 block discarded – undo
192 199
 		</div>
193 200
 		<div class="windowbg noup">';
194 201
 
195
-		if (!empty($context['credits_software_graphics']['graphics']))
196
-			echo '
202
+		if (!empty($context['credits_software_graphics']['graphics'])) {
203
+					echo '
197 204
 			<dl>
198 205
 				<dt><strong>', $txt['credits_graphics'], '</strong></dt>
199 206
 				<dd>', implode('</dd><dd>', $context['credits_software_graphics']['graphics']), '</dd>
200 207
 			</dl>';
208
+		}
201 209
 
202
-		if (!empty($context['credits_software_graphics']['software']))
203
-			echo '
210
+		if (!empty($context['credits_software_graphics']['software'])) {
211
+					echo '
204 212
 			<dl>
205 213
 				<dt><strong>', $txt['credits_software'], '</strong></dt>
206 214
 				<dd>', implode('</dd><dd>', $context['credits_software_graphics']['software']), '</dd>
207 215
 			</dl>';
216
+		}
208 217
 
209
-		if (!empty($context['credits_software_graphics']['fonts']))
210
-			echo '
218
+		if (!empty($context['credits_software_graphics']['fonts'])) {
219
+					echo '
211 220
 			<dl>
212 221
 				<dt><strong>', $txt['credits_fonts'], '</strong></dt>
213 222
 				<dd>', implode('</dd><dd>', $context['credits_software_graphics']['fonts']), '</dd>
214 223
 			</dl>';
224
+		}
215 225
 		echo '
216 226
 		</div>';
217 227
 	}
@@ -226,16 +236,18 @@  discard block
 block discarded – undo
226 236
 		<div class="windowbg noup">';
227 237
 
228 238
 		// Display the credits.
229
-		if (!empty($context['credits_modifications']))
230
-			echo '
239
+		if (!empty($context['credits_modifications'])) {
240
+					echo '
231 241
 			', implode('
232 242
 			<br>', $context['credits_modifications']);
243
+		}
233 244
 
234 245
 		// Legacy.
235
-		if (!empty($context['copyrights']['mods']))
236
-			echo (empty($context['credits_modifications']) ? '<br>' : ''),
246
+		if (!empty($context['copyrights']['mods'])) {
247
+					echo (empty($context['credits_modifications']) ? '<br>' : ''),
237 248
 			implode('
238 249
 			<br>', $context['copyrights']['mods']);
250
+		}
239 251
 
240 252
 		echo '
241 253
 		</div>';
Please login to merge, or discard this patch.
Themes/default/ManageSmileys.template.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@
 block discarded – undo
188 188
 					</dd>
189 189
 				</dl>
190 190
 				<input type="submit" name="smiley_save" value="', $txt['smileys_save'], '" class="button_submit">
191
-				<input type="submit" name="deletesmiley" value="', $txt['smileys_delete'], '" data-confirm="', $txt['smileys_delete_confirm'] ,'" class="button_submit you_sure">
191
+				<input type="submit" name="deletesmiley" value="', $txt['smileys_delete'], '" data-confirm="', $txt['smileys_delete_confirm'], '" class="button_submit you_sure">
192 192
 			</div>
193 193
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
194 194
 			<input type="hidden" name="smiley" value="', $context['current_smiley']['id'], '">
Please login to merge, or discard this patch.
Braces   +55 added lines, -41 removed lines patch added patch discarded remove patch
@@ -65,18 +65,19 @@  discard block
 block discarded – undo
65 65
 					</dt>
66 66
 					<dd>
67 67
 						', $modSettings['smileys_url'], '/';
68
-		if ($context['current_set']['id'] == 'default')
69
-			echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
70
-		elseif (empty($context['smiley_set_dirs']))
71
-			echo '
68
+		if ($context['current_set']['id'] == 'default') {
69
+					echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
70
+		} elseif (empty($context['smiley_set_dirs'])) {
71
+					echo '
72 72
 						<input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '" class="input_text"> ';
73
-		else
73
+		} else
74 74
 		{
75 75
 			echo '
76 76
 						<select name="smiley_sets_path" id="smiley_sets_path">';
77
-			foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
78
-				echo '
77
+			foreach ($context['smiley_set_dirs'] as $smiley_set_dir) {
78
+							echo '
79 79
 							<option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>';
80
+			}
80 81
 			echo '
81 82
 						</select> ';
82 83
 		}
@@ -91,14 +92,15 @@  discard block
 block discarded – undo
91 92
 					</dd>';
92 93
 
93 94
 		// If this is a new smiley set they have the option to import smileys already in the directory.
94
-		if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
95
-			echo '
95
+		if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) {
96
+					echo '
96 97
 					<dt>
97 98
 						<strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong>
98 99
 					</dt>
99 100
 					<dd>
100 101
 						<input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1" class="input_check">
101 102
 					</dd>';
103
+		}
102 104
 
103 105
 		echo '
104 106
 				</dl>
@@ -132,9 +134,10 @@  discard block
 block discarded – undo
132 134
 					<dd>
133 135
 						<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();">';
134 136
 
135
-		foreach ($context['smiley_sets'] as $smiley_set)
136
-			echo '
137
+		foreach ($context['smiley_sets'] as $smiley_set) {
138
+					echo '
137 139
 						<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
140
+		}
138 141
 
139 142
 		echo '
140 143
 						</select>)
@@ -149,16 +152,17 @@  discard block
 block discarded – undo
149 152
 						<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
150 153
 					</dt>
151 154
 					<dd>';
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'], '" class="input_text">';
155
-			else
158
+			} else
156 159
 			{
157 160
 				echo '
158 161
 						<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">';
159
-				foreach ($context['filenames'] as $filename)
160
-					echo '
162
+				foreach ($context['filenames'] as $filename) {
163
+									echo '
161 164
 							<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
165
+				}
162 166
 				echo '
163 167
 						</select>';
164 168
 			}
@@ -227,9 +231,10 @@  discard block
 block discarded – undo
227 231
 						<dd>
228 232
 							', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">';
229 233
 
230
-		foreach ($context['smiley_sets'] as $smiley_set)
231
-			echo '
234
+		foreach ($context['smiley_sets'] as $smiley_set) {
235
+					echo '
232 236
 							<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
237
+		}
233 238
 
234 239
 		echo '
235 240
 							</select>
@@ -238,16 +243,17 @@  discard block
 block discarded – undo
238 243
 							<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
239 244
 						</dt>
240 245
 						<dd>';
241
-	if (empty($context['filenames']))
242
-		echo '
246
+	if (empty($context['filenames'])) {
247
+			echo '
243 248
 							<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');" class="input_text">';
244
-	else
249
+	} else
245 250
 	{
246 251
 		echo '
247 252
 								<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">';
248
-		foreach ($context['filenames'] as $filename)
249
-			echo '
253
+		foreach ($context['filenames'] as $filename) {
254
+					echo '
250 255
 								<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
256
+		}
251 257
 		echo '
252 258
 							</select>';
253 259
 	}
@@ -275,14 +281,15 @@  discard block
 block discarded – undo
275 281
 				</fieldset>
276 282
 
277 283
 				<dl id="uploadMore" style="display: none;" class="settings">';
278
-	foreach ($context['smiley_sets'] as $smiley_set)
279
-		echo '
284
+	foreach ($context['smiley_sets'] as $smiley_set) {
285
+			echo '
280 286
 					<dt>
281 287
 						', $txt['smileys_add_upload_for1'], ' <strong>', $smiley_set['name'], '</strong> ', $txt['smileys_add_upload_for2'], ':
282 288
 					</dt>
283 289
 					<dd>
284 290
 						<input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');" class="input_file">
285 291
 					</dd>';
292
+	}
286 293
 	echo '
287 294
 				</dl>
288 295
 			</div>
@@ -351,24 +358,27 @@  discard block
 block discarded – undo
351 358
 				<strong>', empty($context['move_smiley']) ? $txt['smileys_move_select_smiley'] : $txt['smileys_move_select_destination'], '...</strong><br>';
352 359
 		foreach ($location['rows'] as $row)
353 360
 		{
354
-			if (!empty($context['move_smiley']))
355
-				echo '
361
+			if (!empty($context['move_smiley'])) {
362
+							echo '
356 363
 					<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>';
364
+			}
357 365
 
358 366
 			foreach ($row as $smiley)
359 367
 			{
360
-				if (empty($context['move_smiley']))
361
-					echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>';
362
-				else
363
-					echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><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>';
368
+				if (empty($context['move_smiley'])) {
369
+									echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>';
370
+				} else {
371
+									echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><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>';
372
+				}
364 373
 			}
365 374
 
366 375
 			echo '
367 376
 				<br>';
368 377
 		}
369
-		if (!empty($context['move_smiley']))
370
-			echo '
378
+		if (!empty($context['move_smiley'])) {
379
+					echo '
371 380
 				<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>';
381
+		}
372 382
 		echo '
373 383
 			</div>
374 384
 		<input type="hidden" name="reorder" value="1">
@@ -404,14 +414,15 @@  discard block
 block discarded – undo
404 414
 			</div>
405 415
 			<div class="windowbg2">
406 416
 				<dl class="settings">';
407
-	if (!$context['new_icon'])
408
-		echo '
417
+	if (!$context['new_icon']) {
418
+			echo '
409 419
 					<dt>
410 420
 						<strong>', $txt['smiley_preview'], ': </strong>
411 421
 					</dt>
412 422
 					<dd>
413 423
 						<img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '">
414 424
 					</dd>';
425
+	}
415 426
 	echo '
416 427
 					<dt>
417 428
 						<strong><label for="icon_filename">', $txt['smileys_filename'], '</label>: </strong><br><span class="smalltext">', $txt['icons_filename_all_png'], '</span>
@@ -436,9 +447,10 @@  discard block
 block discarded – undo
436 447
 	{
437 448
 		echo '
438 449
 							<optgroup label="', $category['name'], '">';
439
-		foreach ($category['boards'] as $board)
440
-			echo '
450
+		foreach ($category['boards'] as $board) {
451
+					echo '
441 452
 								<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
453
+		}
442 454
 		echo '
443 455
 							</optgroup>';
444 456
 	}
@@ -453,19 +465,21 @@  discard block
 block discarded – undo
453 465
 							<option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>';
454 466
 
455 467
 	// Print the list of all the icons it can be put after...
456
-	foreach ($context['icons'] as $id => $data)
457
-		if (empty($context['icon']['id']) || $id != $context['icon']['id'])
468
+	foreach ($context['icons'] as $id => $data) {
469
+			if (empty($context['icon']['id']) || $id != $context['icon']['id'])
458 470
 			echo '
459 471
 							<option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
472
+	}
460 473
 
461 474
 	echo '
462 475
 						</select>
463 476
 					</dd>
464 477
 				</dl>';
465 478
 
466
-	if (!$context['new_icon'])
467
-		echo '
479
+	if (!$context['new_icon']) {
480
+			echo '
468 481
 				<input type="hidden" name="icon" value="', $context['icon']['id'], '">';
482
+	}
469 483
 
470 484
 	echo '
471 485
 				<input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button_submit">
Please login to merge, or discard this patch.