Completed
Push — release-2.1 ( a51b86...3c6b17 )
by Colin
08:06
created
Themes/default/PersonalMessage.template.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
 				foreach ($message['custom_fields']['above_member'] as $custom)
234 234
 					echo '
235
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
235
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
236 236
 
237 237
 				echo '
238 238
 						</ul>
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 			if (!empty($message['custom_fields']['below_avatar']))
270 270
 				foreach ($message['custom_fields']['below_avatar'] as $custom)
271 271
 					echo '
272
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
272
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
273 273
 
274 274
 			if (!$message['member']['is_guest'])
275 275
 				echo '
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 
312 312
 					foreach ($message['custom_fields']['icons'] as $custom)
313 313
 						echo '
314
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
314
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
315 315
 
316 316
 					echo '
317 317
 							</ol>
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 				if (!empty($message['custom_fields']['standard']))
370 370
 					foreach ($message['custom_fields']['standard'] as $custom)
371 371
 						echo '
372
-						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
372
+						<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
373 373
 
374 374
 				// Are we showing the warning status?
375 375
 				if ($message['member']['can_see_warning'])
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 				if (!empty($message['custom_fields']['bottom_poster']))
381 381
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
382 382
 						echo '
383
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
383
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
384 384
 			}
385 385
 
386 386
 			// Done with the information about the poster... on to the post itself.
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 
482 482
 				foreach ($message['custom_fields']['above_signature'] as $custom)
483 483
 					echo '
484
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
484
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
485 485
 
486 486
 				echo '
487 487
 							</ul>
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 
503 503
 				foreach ($message['custom_fields']['below_signature'] as $custom)
504 504
 					echo '
505
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
505
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
506 506
 
507 507
 				echo '
508 508
 							</ul>
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 	while ($message = $context['get_pmessage']('subject'))
642 642
 	{
643 643
 		echo '
644
-			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
644
+			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
645 645
 				<td class="table_icon">
646 646
 					<script>
647 647
 						currentLabels[', $message['id'], '] = {';
@@ -926,13 +926,13 @@  discard block
 block discarded – undo
926 926
 				// You can only reply if they are not a guest...
927 927
 				if (!$message['member']['is_guest'])
928 928
 					echo '
929
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], '
930
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
929
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], '
930
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator'];
931 931
 
932 932
 				// This is for "forwarding" - even if the member is gone.
933 933
 				else
934 934
 					echo '
935
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator'];
935
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator'];
936 936
 			}
937 937
 
938 938
 			echo '
@@ -1037,7 +1037,7 @@  discard block
 block discarded – undo
1037 1037
 				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
1038 1038
 					<dl>
1039 1039
 						<dt>
1040
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1040
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1041 1041
 						</dt>
1042 1042
 						<dd class="error" id="error_list">
1043 1043
 							', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1094 1094
 					</dt>
1095 1095
 					<dd id="pm_subject">
1096
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/>
1096
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/>
1097 1097
 					</dd>
1098 1098
 				</dl>
1099 1099
 				<hr>';
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 		echo '
1463 1463
 		<div class="padding">
1464 1464
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1465
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1465
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure">
1466 1466
 		</div>';
1467 1467
 
1468 1468
 	echo '
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 	if (!empty($context['rules']))
1628 1628
 		echo '
1629 1629
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1630
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1630
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">';
1631 1631
 
1632 1632
 	echo '
1633 1633
 		</div>
@@ -1871,9 +1871,9 @@  discard block
 block discarded – undo
1871 1871
 
1872 1872
 		echo '
1873 1873
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1874
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1875
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1876
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1874
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1875
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1876
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1877 1877
 				</select>
1878 1878
 				<span id="labdiv', $k, '">
1879 1879
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1987,7 +1987,7 @@  discard block
 block discarded – undo
1987 1987
 			</div>
1988 1988
 			<ul class="quickbuttons">
1989 1989
 				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li>
1990
-				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;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>
1990
+				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;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>
1991 1991
 			</ul>
1992 1992
 		</div><!-- .windowbg -->';
1993 1993
 		}
Please login to merge, or discard this patch.
Braces   +268 added lines, -187 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 	<div id="personal_messages">';
22 22
 
23 23
 	// Show the capacity bar, if available.
24
-	if (!empty($context['limit_bar']))
25
-		echo '
24
+	if (!empty($context['limit_bar'])) {
25
+			echo '
26 26
 		<div class="cat_bar">
27 27
 			<h3 class="catbg">
28 28
 				<span class="floatleft">', $txt['pm_capacity'], ':</span>
@@ -32,14 +32,16 @@  discard block
 block discarded – undo
32 32
 				<span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span>
33 33
 			</h3>
34 34
 		</div>';
35
+	}
35 36
 
36 37
 	// Message sent? Show a small indication.
37
-	if (isset($context['pm_sent']))
38
-		echo '
38
+	if (isset($context['pm_sent'])) {
39
+			echo '
39 40
 		<div class="infobox">
40 41
 			', $txt['pm_sent'], '
41 42
 		</div>';
42
-}
43
+	}
44
+	}
43 45
 
44 46
 /**
45 47
  * Just the end of the index bar, nothing special.
@@ -72,8 +74,7 @@  discard block
 block discarded – undo
72 74
 	{
73 75
 		echo '
74 76
 			<div class="no_unread">', $txt['pm_no_unread'], '</div>';
75
-	}
76
-	else
77
+	} else
77 78
 	{
78 79
 		foreach ($context['unread_pms'] as $id_pm => $pm_details)
79 80
 		{
@@ -194,14 +195,15 @@  discard block
 block discarded – undo
194 195
 	if ($context['get_pmessage']('message', true))
195 196
 	{
196 197
 		// Show the helpful titlebar - generally.
197
-		if ($context['display_mode'] != 1)
198
-			echo '
198
+		if ($context['display_mode'] != 1) {
199
+					echo '
199 200
 			<div class="cat_bar">
200 201
 				<h3 class="catbg">
201 202
 					<span id="author">', $txt['author'], '</span>
202 203
 					<span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span>
203 204
 				</h3>
204 205
 			</div>';
206
+		}
205 207
 
206 208
 		// Show a few buttons if we are in conversation mode and outputting the first message.
207 209
 		if ($context['display_mode'] == 2)
@@ -230,9 +232,10 @@  discard block
 block discarded – undo
230 232
 					<div class="custom_fields_above_member">
231 233
 						<ul class="nolist">';
232 234
 
233
-				foreach ($message['custom_fields']['above_member'] as $custom)
234
-					echo '
235
+				foreach ($message['custom_fields']['above_member'] as $custom) {
236
+									echo '
235 237
 							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
238
+				}
236 239
 
237 240
 				echo '
238 241
 						</ul>
@@ -244,25 +247,28 @@  discard block
 block discarded – undo
244 247
 						<a id="msg', $message['id'], '"></a>';
245 248
 
246 249
 			// Show online and offline buttons?
247
-			if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
248
-				echo '
250
+			if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
251
+							echo '
249 252
 						<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>';
253
+			}
250 254
 
251 255
 			// Custom fields BEFORE the username?
252
-			if (!empty($message['custom_fields']['before_member']))
253
-				foreach ($message['custom_fields']['before_member'] as $custom)
256
+			if (!empty($message['custom_fields']['before_member'])) {
257
+							foreach ($message['custom_fields']['before_member'] as $custom)
254 258
 					echo '
255 259
 						<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
260
+			}
256 261
 
257 262
 			// Show a link to the member's profile.
258 263
 			echo '
259 264
 						', $message['member']['link'];
260 265
 
261 266
 				// Custom fields AFTER the username?
262
-				if (!empty($message['custom_fields']['after_member']))
263
-					foreach ($message['custom_fields']['after_member'] as $custom)
267
+				if (!empty($message['custom_fields']['after_member'])) {
268
+									foreach ($message['custom_fields']['after_member'] as $custom)
264 269
 						echo '
265 270
 						<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
271
+				}
266 272
 
267 273
 			echo '
268 274
 					</h4>';
@@ -271,48 +277,56 @@  discard block
 block discarded – undo
271 277
 					<ul class="user_info">';
272 278
 
273 279
 			// Show the user's avatar.
274
-			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
275
-				echo '
280
+			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
281
+							echo '
276 282
 						<li class="avatar">
277 283
 							<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a>
278 284
 						</li>';
285
+			}
279 286
 
280 287
 			// Are there any custom fields below the avatar?
281
-			if (!empty($message['custom_fields']['below_avatar']))
282
-				foreach ($message['custom_fields']['below_avatar'] as $custom)
288
+			if (!empty($message['custom_fields']['below_avatar'])) {
289
+							foreach ($message['custom_fields']['below_avatar'] as $custom)
283 290
 					echo '
284 291
 						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
292
+			}
285 293
 
286
-			if (!$message['member']['is_guest'])
287
-				echo '
294
+			if (!$message['member']['is_guest']) {
295
+							echo '
288 296
 						<li class="icons">', $message['member']['group_icons'], '</li>';
297
+			}
289 298
 			// Show the member's primary group (like 'Administrator') if they have one.
290
-			if (isset($message['member']['group']) && $message['member']['group'] != '')
291
-				echo '
299
+			if (isset($message['member']['group']) && $message['member']['group'] != '') {
300
+							echo '
292 301
 						<li class="membergroup">', $message['member']['group'], '</li>';
302
+			}
293 303
 
294 304
 			// Show the member's custom title, if they have one.
295
-			if (isset($message['member']['title']) && $message['member']['title'] != '')
296
-				echo '
305
+			if (isset($message['member']['title']) && $message['member']['title'] != '') {
306
+							echo '
297 307
 						<li class="title">', $message['member']['title'], '</li>';
308
+			}
298 309
 
299 310
 			// Don't show these things for guests.
300 311
 			if (!$message['member']['is_guest'])
301 312
 			{
302 313
 				// 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.
303
-				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
304
-					echo '
314
+				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') {
315
+									echo '
305 316
 						<li class="postgroup">', $message['member']['post_group'], '</li>';
317
+				}
306 318
 
307 319
 				// Show how many posts they have made.
308
-				if (!isset($context['disabled_fields']['posts']))
309
-					echo '
320
+				if (!isset($context['disabled_fields']['posts'])) {
321
+									echo '
310 322
 						<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
323
+				}
311 324
 
312 325
 				// Show their personal text?
313
-				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '')
314
-					echo '
326
+				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') {
327
+									echo '
315 328
 						<li class="blurb">', $message['member']['blurb'], '</li>';
329
+				}
316 330
 
317 331
 				// Any custom fields to show as icons?
318 332
 				if (!empty($message['custom_fields']['icons']))
@@ -321,9 +335,10 @@  discard block
 block discarded – undo
321 335
 						<li class="im_icons">
322 336
 							<ol>';
323 337
 
324
-					foreach ($message['custom_fields']['icons'] as $custom)
325
-						echo '
338
+					foreach ($message['custom_fields']['icons'] as $custom) {
339
+											echo '
326 340
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
341
+					}
327 342
 
328 343
 					echo '
329 344
 							</ol>
@@ -331,19 +346,22 @@  discard block
 block discarded – undo
331 346
 				}
332 347
 
333 348
 				// Show the IP to this user for this post - because you can moderate?
334
-				if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
335
-					echo '
349
+				if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
350
+									echo '
336 351
 						<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>';
352
+				}
337 353
 
338 354
 				// Or, should we show it because this is you?
339
-				elseif ($message['can_see_ip'])
340
-					echo '
355
+				elseif ($message['can_see_ip']) {
356
+									echo '
341 357
 						<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>';
358
+				}
342 359
 
343 360
 				// Okay, you are logged in, then we can show something about why IPs are logged...
344
-				else
345
-					echo '
361
+				else {
362
+									echo '
346 363
 						<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
364
+				}
347 365
 
348 366
 				// Show the profile, website, email address, and personal message buttons.
349 367
 				if ($message['member']['show_profile_buttons'])
@@ -353,24 +371,28 @@  discard block
 block discarded – undo
353 371
 							<ol class="profile_icons">';
354 372
 
355 373
 					// Show the profile button
356
-					if ($message['member']['can_view_profile'])
357
-						echo '
374
+					if ($message['member']['can_view_profile']) {
375
+											echo '
358 376
 								<li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>';
377
+					}
359 378
 
360 379
 					// Don't show an icon if they haven't specified a website.
361
-					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
362
-						echo '
380
+					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) {
381
+											echo '
363 382
 								<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
383
+					}
364 384
 
365 385
 					// Don't show the email address if they want it hidden.
366
-					if ($message['member']['show_email'])
367
-						echo '
386
+					if ($message['member']['show_email']) {
387
+											echo '
368 388
 								<li><a href="mailto:', $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
389
+					}
369 390
 
370 391
 					// Since we know this person isn't a guest, you *can* message them.
371
-					if ($context['can_send_pm'])
372
-						echo '
392
+					if ($context['can_send_pm']) {
393
+											echo '
373 394
 								<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>';
395
+					}
374 396
 
375 397
 					echo '
376 398
 							</ol>
@@ -378,21 +400,24 @@  discard block
 block discarded – undo
378 400
 				}
379 401
 
380 402
 				// Any custom fields for standard placement?
381
-				if (!empty($message['custom_fields']['standard']))
382
-					foreach ($message['custom_fields']['standard'] as $custom)
403
+				if (!empty($message['custom_fields']['standard'])) {
404
+									foreach ($message['custom_fields']['standard'] as $custom)
383 405
 						echo '
384 406
 						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
407
+				}
385 408
 
386 409
 				// Are we showing the warning status?
387
-				if ($message['member']['can_see_warning'])
388
-					echo '
410
+				if ($message['member']['can_see_warning']) {
411
+									echo '
389 412
 						<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>';
413
+				}
390 414
 
391 415
 				// Are there any custom fields to show at the bottom of the poster info?
392
-				if (!empty($message['custom_fields']['bottom_poster']))
393
-					foreach ($message['custom_fields']['bottom_poster'] as $custom)
416
+				if (!empty($message['custom_fields']['bottom_poster'])) {
417
+									foreach ($message['custom_fields']['bottom_poster'] as $custom)
394 418
 						echo '
395 419
 						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
420
+				}
396 421
 			}
397 422
 
398 423
 			// Done with the information about the poster... on to the post itself.
@@ -411,25 +436,29 @@  discard block
 block discarded – undo
411 436
 							<span class="smalltext">&#171; <strong> ', $txt['sent_to'], ':</strong> ';
412 437
 
413 438
 			// People it was sent directly to....
414
-			if (!empty($message['recipients']['to']))
415
-				echo implode(', ', $message['recipients']['to']);
439
+			if (!empty($message['recipients']['to'])) {
440
+							echo implode(', ', $message['recipients']['to']);
441
+			}
416 442
 
417 443
 			// Otherwise, we're just going to say "some people"...
418
-			elseif ($context['folder'] != 'sent')
419
-				echo '(', $txt['pm_undisclosed_recipients'], ')';
444
+			elseif ($context['folder'] != 'sent') {
445
+							echo '(', $txt['pm_undisclosed_recipients'], ')';
446
+			}
420 447
 
421 448
 			echo '
422 449
 								<strong> ', $txt['on'], ':</strong> ', $message['time'], ' &#187;
423 450
 							</span>';
424 451
 
425 452
 			// If we're in the sent items, show who it was sent to besides the "To:" people.
426
-			if (!empty($message['recipients']['bcc']))
427
-				echo '
453
+			if (!empty($message['recipients']['bcc'])) {
454
+							echo '
428 455
 					<br><span class="smalltext">&#171; <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' &#187;</span>';
456
+			}
429 457
 
430
-			if (!empty($message['is_replied_to']))
431
-				echo '
458
+			if (!empty($message['is_replied_to'])) {
459
+							echo '
432 460
 					<br><span class="smalltext">&#171; ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' &#187;</span>';
461
+			}
433 462
 
434 463
 			echo '
435 464
 						</div><!-- .keyinfo -->
@@ -437,13 +466,15 @@  discard block
 block discarded – undo
437 466
 					<div class="post">
438 467
 						<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>';
439 468
 
440
-			if ($message['can_report'] || $context['can_send_pm'])
441
-				echo '
469
+			if ($message['can_report'] || $context['can_send_pm']) {
470
+							echo '
442 471
 						<div class="under_message">';
472
+			}
443 473
 
444
-			if ($message['can_report'])
445
-				echo '
474
+			if ($message['can_report']) {
475
+							echo '
446 476
 							<a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>';
477
+			}
447 478
 
448 479
 			echo '
449 480
 							<ul class="quickbuttons">';
@@ -455,32 +486,36 @@  discard block
 block discarded – undo
455 486
 				if (!$message['member']['is_guest'])
456 487
 				{
457 488
 					// Is there than more than one recipient you can reply to?
458
-					if ($message['number_recipients'] > 1)
459
-						echo '
489
+					if ($message['number_recipients'] > 1) {
490
+											echo '
460 491
 								<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>';
492
+					}
461 493
 
462 494
 					echo '
463 495
 								<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>
464 496
 								<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
465 497
 				}
466 498
 				// This is for "forwarding" - even if the member is gone.
467
-				else
468
-					echo '
499
+				else {
500
+									echo '
469 501
 								<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>';
502
+				}
470 503
 			}
471 504
 			echo '
472 505
 								<li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>';
473 506
 
474
-			if (empty($context['display_mode']))
475
-				echo '
507
+			if (empty($context['display_mode'])) {
508
+							echo '
476 509
 								<li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;"></li>';
510
+			}
477 511
 
478 512
 			echo '
479 513
 							</ul>';
480 514
 
481
-			if ($message['can_report'] || $context['can_send_pm'])
482
-			echo '
515
+			if ($message['can_report'] || $context['can_send_pm']) {
516
+						echo '
483 517
 						</div><!-- .under_message -->';
518
+			}
484 519
 
485 520
 			// Are there any custom profile fields for above the signature?
486 521
 			if (!empty($message['custom_fields']['above_signature']))
@@ -489,9 +524,10 @@  discard block
 block discarded – undo
489 524
 						<div class="custom_fields_above_signature">
490 525
 							<ul class="nolist">';
491 526
 
492
-				foreach ($message['custom_fields']['above_signature'] as $custom)
493
-					echo '
527
+				foreach ($message['custom_fields']['above_signature'] as $custom) {
528
+									echo '
494 529
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
530
+				}
495 531
 
496 532
 				echo '
497 533
 							</ul>
@@ -499,9 +535,10 @@  discard block
 block discarded – undo
499 535
 			}
500 536
 
501 537
 			// Show the member's signature?
502
-			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
503
-				echo '
538
+			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
539
+							echo '
504 540
 						<div class="signature">', $message['member']['signature'], '</div>';
541
+			}
505 542
 
506 543
 			// Are there any custom profile fields for below the signature?
507 544
 			if (!empty($message['custom_fields']['below_signature']))
@@ -510,9 +547,10 @@  discard block
 block discarded – undo
510 547
 						<div class="custom_fields_below_signature">
511 548
 							<ul class="nolist">';
512 549
 
513
-				foreach ($message['custom_fields']['below_signature'] as $custom)
514
-					echo '
550
+				foreach ($message['custom_fields']['below_signature'] as $custom) {
551
+									echo '
515 552
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
553
+				}
516 554
 
517 555
 				echo '
518 556
 							</ul>
@@ -539,10 +577,11 @@  discard block
 block discarded – undo
539 577
 						echo '
540 578
 								<option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>';
541 579
 
542
-						foreach ($context['labels'] as $label)
543
-							if (!isset($message['labels'][$label['id']]))
580
+						foreach ($context['labels'] as $label) {
581
+													if (!isset($message['labels'][$label['id']]))
544 582
 								echo '
545 583
 								<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
584
+						}
546 585
 					}
547 586
 
548 587
 					// ... and are there any that can be removed?
@@ -551,9 +590,10 @@  discard block
 block discarded – undo
551 590
 						echo '
552 591
 								<option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>';
553 592
 
554
-						foreach ($message['labels'] as $label)
555
-							echo '
593
+						foreach ($message['labels'] as $label) {
594
+													echo '
556 595
 								<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
596
+						}
557 597
 					}
558 598
 					echo '
559 599
 							</select>
@@ -572,8 +612,8 @@  discard block
 block discarded – undo
572 612
 			</div><!-- .windowbg -->';
573 613
 		}
574 614
 
575
-		if (empty($context['display_mode']))
576
-			echo '
615
+		if (empty($context['display_mode'])) {
616
+					echo '
577 617
 
578 618
 			<div class="pagesection">
579 619
 				<div class="floatleft">', $context['page_index'], '</div>
@@ -581,6 +621,7 @@  discard block
 block discarded – undo
581 621
 					<input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button">
582 622
 				</div>
583 623
 			</div>';
624
+		}
584 625
 
585 626
 		// Show a few buttons if we are in conversation mode and outputting the first message.
586 627
 		elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons']))
@@ -641,11 +682,12 @@  discard block
 block discarded – undo
641 682
 		</thead>
642 683
 		<tbody>';
643 684
 
644
-	if (!$context['show_delete'])
645
-		echo '
685
+	if (!$context['show_delete']) {
686
+			echo '
646 687
 			<tr class="windowbg">
647 688
 				<td colspan="5">', $txt['pm_alert_none'], '</td>
648 689
 			</tr>';
690
+	}
649 691
 
650 692
 	while ($message = $context['get_pmessage']('subject'))
651 693
 	{
@@ -705,9 +747,10 @@  discard block
 block discarded – undo
705 747
 
706 748
 			foreach ($context['labels'] as $label)
707 749
 			{
708
-				if ($label['id'] != $context['current_label_id'])
709
-					echo '
750
+				if ($label['id'] != $context['current_label_id']) {
751
+									echo '
710 752
 				<option value="add_', $label['id'], '">&nbsp;', $label['name'], '</option>';
753
+				}
711 754
 			}
712 755
 
713 756
 			echo '
@@ -793,9 +836,10 @@  discard block
 block discarded – undo
793 836
 					<dd>', $txt['pm_search_between'], ' <input type="number" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" min="0" max="9999">&nbsp;', $txt['pm_search_between_and'], '&nbsp;<input type="number" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd>
794 837
 				</dl>';
795 838
 
796
-	if (!$context['currently_using_labels'])
797
-		echo '
839
+	if (!$context['currently_using_labels']) {
840
+			echo '
798 841
 				<input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button">';
842
+	}
799 843
 
800 844
 	echo '
801 845
 				<br class="clear_right">
@@ -816,12 +860,13 @@  discard block
 block discarded – undo
816 860
 				<div id="advanced_panel_div">
817 861
 					<ul id="searchLabelsExpand">';
818 862
 
819
-		foreach ($context['search_labels'] as $label)
820
-			echo '
863
+		foreach ($context['search_labels'] as $label) {
864
+					echo '
821 865
 						<li>
822 866
 							<label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', '>
823 867
 							', $label['name'], '</label>
824 868
 						</li>';
869
+		}
825 870
 
826 871
 		echo '
827 872
 					</ul>
@@ -883,8 +928,8 @@  discard block
 block discarded – undo
883 928
 		</div>';
884 929
 
885 930
 	// complete results ?
886
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
887
-		echo '
931
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
932
+			echo '
888 933
 		<table class="table_grid">
889 934
 			<thead>
890 935
 				<tr class="title_bar">
@@ -894,6 +939,7 @@  discard block
 block discarded – undo
894 939
 				</tr>
895 940
 			</thead>
896 941
 			<tbody>';
942
+	}
897 943
 
898 944
 	// Print each message out...
899 945
 	foreach ($context['personal_messages'] as $message)
@@ -913,12 +959,14 @@  discard block
 block discarded – undo
913 959
 
914 960
 			// Show the recipients.
915 961
 			// @todo This doesn't deal with the sent item searching quite right for bcc.
916
-			if (!empty($message['recipients']['to']))
917
-				echo implode(', ', $message['recipients']['to']);
962
+			if (!empty($message['recipients']['to'])) {
963
+							echo implode(', ', $message['recipients']['to']);
964
+			}
918 965
 
919 966
 			// Otherwise, we're just going to say "some people"...
920
-			elseif ($context['folder'] != 'sent')
921
-				echo '(', $txt['pm_undisclosed_recipients'], ')';
967
+			elseif ($context['folder'] != 'sent') {
968
+							echo '(', $txt['pm_undisclosed_recipients'], ')';
969
+			}
922 970
 
923 971
 			echo '
924 972
 				</h3>
@@ -933,15 +981,17 @@  discard block
 block discarded – undo
933 981
 				$reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"');
934 982
 
935 983
 				// You can only reply if they are not a guest...
936
-				if (!$message['member']['is_guest'])
937
-					echo '
984
+				if (!$message['member']['is_guest']) {
985
+									echo '
938 986
 					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], '
939 987
 					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
988
+				}
940 989
 
941 990
 				// This is for "forwarding" - even if the member is gone.
942
-				else
943
-					echo '
991
+				else {
992
+									echo '
944 993
 					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator'];
994
+				}
945 995
 			}
946 996
 
947 997
 			echo '
@@ -962,17 +1012,19 @@  discard block
 block discarded – undo
962 1012
 	}
963 1013
 
964 1014
 	// Finish off the page...
965
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
966
-		echo '
1015
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
1016
+			echo '
967 1017
 			</tbody>
968 1018
 		</table>';
1019
+	}
969 1020
 
970 1021
 	// No results?
971
-	if (empty($context['personal_messages']))
972
-		echo '
1022
+	if (empty($context['personal_messages'])) {
1023
+			echo '
973 1024
 		<div class="windowbg">
974 1025
 			<p class="centertext">', $txt['pm_search_none_found'], '</p>
975 1026
 		</div>';
1027
+	}
976 1028
 
977 1029
 	echo '
978 1030
 		<div class="pagesection">
@@ -997,15 +1049,17 @@  discard block
 block discarded – undo
997 1049
 		</div>
998 1050
 		<div class="windowbg">';
999 1051
 
1000
-		if (!empty($context['send_log']['sent']))
1001
-			foreach ($context['send_log']['sent'] as $log_entry)
1052
+		if (!empty($context['send_log']['sent'])) {
1053
+					foreach ($context['send_log']['sent'] as $log_entry)
1002 1054
 				echo '
1003 1055
 			<span class="error">', $log_entry, '</span><br>';
1056
+		}
1004 1057
 
1005
-		if (!empty($context['send_log']['failed']))
1006
-			foreach ($context['send_log']['failed'] as $log_entry)
1058
+		if (!empty($context['send_log']['failed'])) {
1059
+					foreach ($context['send_log']['failed'] as $log_entry)
1007 1060
 				echo '
1008 1061
 			<span class="error">', $log_entry, '</span><br>';
1062
+		}
1009 1063
 
1010 1064
 		echo '
1011 1065
 		</div>
@@ -1054,12 +1108,13 @@  discard block
 block discarded – undo
1054 1108
 					</dl>
1055 1109
 				</div>';
1056 1110
 
1057
-	if (!empty($modSettings['drafts_pm_enabled']))
1058
-		echo '
1111
+	if (!empty($modSettings['drafts_pm_enabled'])) {
1112
+			echo '
1059 1113
 				<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
1060 1114
 					sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), '
1061 1115
 					', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
1062 1116
 				</div>';
1117
+	}
1063 1118
 
1064 1119
 	echo '
1065 1120
 				<dl id="post_header">';
@@ -1115,9 +1170,10 @@  discard block
 block discarded – undo
1115 1170
 	}
1116 1171
 
1117 1172
 	// What about smileys?
1118
-	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
1119
-		echo '
1173
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) {
1174
+			echo '
1120 1175
 				<div id="smileyBox_message"></div>';
1176
+	}
1121 1177
 
1122 1178
 	// Show BBC buttons, smileys and textbox.
1123 1179
 	echo '
@@ -1164,10 +1220,11 @@  discard block
 block discarded – undo
1164 1220
 				<dt><strong>', $txt['subject'], '</strong></dt>
1165 1221
 				<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
1166 1222
 
1167
-		foreach ($context['drafts'] as $draft)
1168
-			echo '
1223
+		foreach ($context['drafts'] as $draft) {
1224
+					echo '
1169 1225
 				<dt>', $draft['link'], '</dt>
1170 1226
 				<dd>', $draft['poster_time'], '</dd>';
1227
+		}
1171 1228
 		echo '
1172 1229
 			</dl>
1173 1230
 		</div>';
@@ -1274,8 +1331,8 @@  discard block
 block discarded – undo
1274 1331
 			}';
1275 1332
 
1276 1333
 	// Code for showing and hiding drafts
1277
-	if (!empty($context['drafts']))
1278
-		echo '
1334
+	if (!empty($context['drafts'])) {
1335
+			echo '
1279 1336
 			var oSwapDraftOptions = new smc_Toggle({
1280 1337
 				bToggleEnabled: true,
1281 1338
 				bCurrentlyCollapsed: true,
@@ -1297,13 +1354,14 @@  discard block
 block discarded – undo
1297 1354
 					}
1298 1355
 				]
1299 1356
 			});';
1357
+	}
1300 1358
 
1301 1359
 	echo '
1302 1360
 		</script>';
1303 1361
 
1304 1362
 	// Show the message you're replying to.
1305
-	if ($context['reply'])
1306
-		echo '
1363
+	if ($context['reply']) {
1364
+			echo '
1307 1365
 		<br><br>
1308 1366
 		<div class="cat_bar">
1309 1367
 			<h3 class="catbg">', $txt['subject'], ': ', $context['quoted_message']['subject'], '</h3>
@@ -1317,6 +1375,7 @@  discard block
 block discarded – undo
1317 1375
 			', $context['quoted_message']['body'], '
1318 1376
 		</div>
1319 1377
 		<br class="clear">';
1378
+	}
1320 1379
 
1321 1380
 	echo '
1322 1381
 		<script>
@@ -1328,23 +1387,25 @@  discard block
 block discarded – undo
1328 1387
 				sToControlId: \'to_control\',
1329 1388
 				aToRecipients: [';
1330 1389
 
1331
-	foreach ($context['recipients']['to'] as $i => $member)
1332
-		echo '
1390
+	foreach ($context['recipients']['to'] as $i => $member) {
1391
+			echo '
1333 1392
 					{
1334 1393
 						sItemId: ', JavaScriptEscape($member['id']), ',
1335 1394
 						sItemName: ', JavaScriptEscape($member['name']), '
1336 1395
 					}', $i == count($context['recipients']['to']) - 1 ? '' : ',';
1396
+	}
1337 1397
 
1338 1398
 	echo '
1339 1399
 				],
1340 1400
 				aBccRecipients: [';
1341 1401
 
1342
-	foreach ($context['recipients']['bcc'] as $i => $member)
1343
-		echo '
1402
+	foreach ($context['recipients']['bcc'] as $i => $member) {
1403
+			echo '
1344 1404
 					{
1345 1405
 						sItemId: ', JavaScriptEscape($member['id']), ',
1346 1406
 						sItemName: ', JavaScriptEscape($member['name']), '
1347 1407
 					}', $i == count($context['recipients']['bcc']) - 1 ? '' : ',';
1408
+	}
1348 1409
 
1349 1410
 	echo '
1350 1411
 				],
@@ -1433,26 +1494,28 @@  discard block
 block discarded – undo
1433 1494
 					</th>
1434 1495
 					<th class="centertext table_icon">';
1435 1496
 
1436
-	if (count($context['labels']) > 2)
1437
-		echo '
1497
+	if (count($context['labels']) > 2) {
1498
+			echo '
1438 1499
 						<input type="checkbox" onclick="invertAll(this, this.form);">';
1500
+	}
1439 1501
 
1440 1502
 	echo '
1441 1503
 					</th>
1442 1504
 				</tr>
1443 1505
 			</thead>
1444 1506
 			<tbody>';
1445
-	if (count($context['labels']) < 2)
1446
-		echo '
1507
+	if (count($context['labels']) < 2) {
1508
+			echo '
1447 1509
 				<tr class="windowbg">
1448 1510
 					<td colspan="2">', $txt['pm_labels_no_exist'], '</td>
1449 1511
 				</tr>';
1450
-	else
1512
+	} else
1451 1513
 	{
1452 1514
 		foreach ($context['labels'] as $label)
1453 1515
 		{
1454
-			if ($label['id'] == -1)
1455
-				continue;
1516
+			if ($label['id'] == -1) {
1517
+							continue;
1518
+			}
1456 1519
 
1457 1520
 				echo '
1458 1521
 				<tr class="windowbg">
@@ -1467,12 +1530,13 @@  discard block
 block discarded – undo
1467 1530
 			</tbody>
1468 1531
 		</table>';
1469 1532
 
1470
-	if (!count($context['labels']) < 2)
1471
-		echo '
1533
+	if (!count($context['labels']) < 2) {
1534
+			echo '
1472 1535
 		<div class="padding">
1473 1536
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1474 1537
 			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1475 1538
 		</div>';
1539
+	}
1476 1540
 
1477 1541
 	echo '
1478 1542
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1528,9 +1592,10 @@  discard block
 block discarded – undo
1528 1592
 				<dd>
1529 1593
 					<select name="id_admin">
1530 1594
 						<option value="0">', $txt['pm_report_all_admins'], '</option>';
1531
-		foreach ($context['admins'] as $id => $name)
1532
-			echo '
1595
+		foreach ($context['admins'] as $id => $name) {
1596
+					echo '
1533 1597
 						<option value="', $id, '">', $name, '</option>';
1598
+		}
1534 1599
 		echo '
1535 1600
 					</select>
1536 1601
 				</dd>';
@@ -1592,9 +1657,10 @@  discard block
 block discarded – undo
1592 1657
 					</th>
1593 1658
 					<th class="centertext table_icon">';
1594 1659
 
1595
-	if (!empty($context['rules']))
1596
-		echo '
1660
+	if (!empty($context['rules'])) {
1661
+			echo '
1597 1662
 						<input type="checkbox" onclick="invertAll(this, this.form);">';
1663
+	}
1598 1664
 
1599 1665
 	echo '
1600 1666
 					</th>
@@ -1602,13 +1668,14 @@  discard block
 block discarded – undo
1602 1668
 			</thead>
1603 1669
 			<tbody>';
1604 1670
 
1605
-	if (empty($context['rules']))
1606
-		echo '
1671
+	if (empty($context['rules'])) {
1672
+			echo '
1607 1673
 				<tr class="windowbg">
1608 1674
 					<td colspan="2">
1609 1675
 						', $txt['pm_rules_none'], '
1610 1676
 					</td>
1611 1677
 				</tr>';
1678
+	}
1612 1679
 
1613 1680
 	foreach ($context['rules'] as $rule)
1614 1681
 	{
@@ -1629,14 +1696,16 @@  discard block
 block discarded – undo
1629 1696
 		<div class="righttext">
1630 1697
 			<a class="button" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>';
1631 1698
 
1632
-	if (!empty($context['rules']))
1633
-		echo '
1699
+	if (!empty($context['rules'])) {
1700
+			echo '
1634 1701
 			[<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]';
1702
+	}
1635 1703
 
1636
-	if (!empty($context['rules']))
1637
-		echo '
1704
+	if (!empty($context['rules'])) {
1705
+			echo '
1638 1706
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1639 1707
 			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1708
+	}
1640 1709
 
1641 1710
 	echo '
1642 1711
 		</div>
@@ -1658,14 +1727,16 @@  discard block
 block discarded – undo
1658 1727
 		var groups = new Array()
1659 1728
 		var labels = new Array()';
1660 1729
 
1661
-	foreach ($context['groups'] as $id => $title)
1662
-		echo '
1730
+	foreach ($context['groups'] as $id => $title) {
1731
+			echo '
1663 1732
 		groups[', $id, '] = "', addslashes($title), '";';
1733
+	}
1664 1734
 
1665
-	foreach ($context['labels'] as $label)
1666
-		if ($label['id'] != -1)
1735
+	foreach ($context['labels'] as $label) {
1736
+			if ($label['id'] != -1)
1667 1737
 			echo '
1668 1738
 		labels[', ($label['id']), '] = "', addslashes($label['name']), '";';
1739
+	}
1669 1740
 
1670 1741
 	echo '
1671 1742
 		function addCriteriaOption()
@@ -1680,8 +1751,9 @@  discard block
 block discarded – undo
1680 1751
 
1681 1752
 			setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select>&nbsp;<span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value=""><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>';
1682 1753
 
1683
-	foreach ($context['groups'] as $id => $group)
1684
-		echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1754
+	foreach ($context['groups'] as $id => $group) {
1755
+			echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1756
+	}
1685 1757
 
1686 1758
 	echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\');
1687 1759
 			}
@@ -1698,9 +1770,10 @@  discard block
 block discarded – undo
1698 1770
 
1699 1771
 				setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select>&nbsp;<span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>';
1700 1772
 
1701
-	foreach ($context['labels'] as $label)
1702
-		if ($label['id'] != -1)
1773
+	foreach ($context['labels'] as $label) {
1774
+			if ($label['id'] != -1)
1703 1775
 			echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>';
1776
+	}
1704 1777
 
1705 1778
 	echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\');
1706 1779
 			}
@@ -1814,19 +1887,20 @@  discard block
 block discarded – undo
1814 1887
 	$isFirst = true;
1815 1888
 	foreach ($context['rule']['criteria'] as $k => $criteria)
1816 1889
 	{
1817
-		if (!$isFirst && $criteria['t'] == '')
1818
-			echo '<div id="removeonjs1">';
1819
-
1820
-		elseif (!$isFirst)
1821
-			echo '<br>';
1890
+		if (!$isFirst && $criteria['t'] == '') {
1891
+					echo '<div id="removeonjs1">';
1892
+		} elseif (!$isFirst) {
1893
+					echo '<br>';
1894
+		}
1822 1895
 
1823 1896
 		echo '
1824 1897
 				<select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();">
1825 1898
 					<option value="">', $txt['pm_rule_criteria_pick'], ':</option>';
1826 1899
 
1827
-		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr)
1828
-			echo '
1900
+		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) {
1901
+					echo '
1829 1902
 					<option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>';
1903
+		}
1830 1904
 
1831 1905
 		echo '
1832 1906
 				</select>
@@ -1837,19 +1911,20 @@  discard block
 block discarded – undo
1837 1911
 					<select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();">
1838 1912
 						<option value="">', $txt['pm_rule_sel_group'], '</option>';
1839 1913
 
1840
-		foreach ($context['groups'] as $id => $group)
1841
-			echo '
1914
+		foreach ($context['groups'] as $id => $group) {
1915
+					echo '
1842 1916
 						<option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>';
1917
+		}
1843 1918
 		echo '
1844 1919
 					</select>
1845 1920
 				</span>';
1846 1921
 
1847 1922
 		// If this is the dummy we add a means to hide for non js users.
1848
-		if ($isFirst)
1849
-			$isFirst = false;
1850
-
1851
-		elseif ($criteria['t'] == '')
1852
-			echo '</div><!-- .removeonjs1 -->';
1923
+		if ($isFirst) {
1924
+					$isFirst = false;
1925
+		} elseif ($criteria['t'] == '') {
1926
+					echo '</div><!-- .removeonjs1 -->';
1927
+		}
1853 1928
 	}
1854 1929
 
1855 1930
 	echo '
@@ -1872,10 +1947,11 @@  discard block
 block discarded – undo
1872 1947
 	$isFirst = true;
1873 1948
 	foreach ($context['rule']['actions'] as $k => $action)
1874 1949
 	{
1875
-		if (!$isFirst && $action['t'] == '')
1876
-			echo '<div id="removeonjs2">';
1877
-		elseif (!$isFirst)
1878
-			echo '<br>';
1950
+		if (!$isFirst && $action['t'] == '') {
1951
+					echo '<div id="removeonjs2">';
1952
+		} elseif (!$isFirst) {
1953
+					echo '<br>';
1954
+		}
1879 1955
 
1880 1956
 		echo '
1881 1957
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
@@ -1887,19 +1963,21 @@  discard block
 block discarded – undo
1887 1963
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
1888 1964
 						<option value="">', $txt['pm_rule_sel_label'], '</option>';
1889 1965
 
1890
-		foreach ($context['labels'] as $label)
1891
-			if ($label['id'] != -1)
1966
+		foreach ($context['labels'] as $label) {
1967
+					if ($label['id'] != -1)
1892 1968
 				echo '
1893 1969
 						<option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>';
1970
+		}
1894 1971
 
1895 1972
 		echo '
1896 1973
 					</select>
1897 1974
 				</span>';
1898 1975
 
1899
-		if ($isFirst)
1900
-			$isFirst = false;
1901
-		elseif ($action['t'] == '')
1902
-			echo '</div><!-- .removeonjs2 -->';
1976
+		if ($isFirst) {
1977
+					$isFirst = false;
1978
+		} elseif ($action['t'] == '') {
1979
+					echo '</div><!-- .removeonjs2 -->';
1980
+		}
1903 1981
 	}
1904 1982
 
1905 1983
 	echo '
@@ -1923,22 +2001,25 @@  discard block
 block discarded – undo
1923 2001
 		echo '
1924 2002
 	<script>';
1925 2003
 
1926
-	foreach ($context['rule']['criteria'] as $k => $c)
1927
-		echo '
2004
+	foreach ($context['rule']['criteria'] as $k => $c) {
2005
+			echo '
1928 2006
 			updateRuleDef(', $k, ');';
2007
+	}
1929 2008
 
1930
-	foreach ($context['rule']['actions'] as $k => $c)
1931
-		echo '
2009
+	foreach ($context['rule']['actions'] as $k => $c) {
2010
+			echo '
1932 2011
 			updateActionDef(', $k, ');';
2012
+	}
1933 2013
 
1934 2014
 	echo '
1935 2015
 			rebuildRuleDesc();';
1936 2016
 
1937 2017
 	// If this isn't a new rule and we have JS enabled remove the JS compatibility stuff.
1938
-	if ($context['rid'])
1939
-		echo '
2018
+	if ($context['rid']) {
2019
+			echo '
1940 2020
 			document.getElementById("removeonjs1").style.display = "none";
1941 2021
 			document.getElementById("removeonjs2").style.display = "none";';
2022
+	}
1942 2023
 
1943 2024
 	echo '
1944 2025
 			document.getElementById("addonjs1").style.display = "";
@@ -1966,12 +2047,12 @@  discard block
 block discarded – undo
1966 2047
 		</div>';
1967 2048
 
1968 2049
 	// No drafts? Just show an informative message.
1969
-	if (empty($context['drafts']))
1970
-		echo '
2050
+	if (empty($context['drafts'])) {
2051
+			echo '
1971 2052
 		<div class="windowbg2 centertext">
1972 2053
 			', $txt['draft_none'], '
1973 2054
 		</div>';
1974
-	else
2055
+	} else
1975 2056
 	{
1976 2057
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
1977 2058
 		foreach ($context['drafts'] as $draft)
Please login to merge, or discard this patch.
Themes/default/Login.template.php 1 patch
Braces   +35 added lines, -24 removed lines patch added patch discarded remove patch
@@ -28,15 +28,17 @@  discard block
 block discarded – undo
28 28
 				<form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">';
29 29
 
30 30
 	// Did they make a mistake last time?
31
-	if (!empty($context['login_errors']))
32
-		echo '
31
+	if (!empty($context['login_errors'])) {
32
+			echo '
33 33
 					<div class="errorbox">', implode('<br>', $context['login_errors']), '</div>
34 34
 					<br>';
35
+	}
35 36
 
36 37
 	// Or perhaps there's some special description for this time?
37
-	if (isset($context['description']))
38
-		echo '
38
+	if (isset($context['description'])) {
39
+			echo '
39 40
 					<div class="information">', $context['description'], '</div>';
41
+	}
40 42
 
41 43
 	// Now just get the basic information - username, password, etc.
42 44
 	echo '
@@ -61,10 +63,11 @@  discard block
 block discarded – undo
61 63
 						</dd>';
62 64
 
63 65
 	// If they have deleted their account, give them a chance to change their mind.
64
-	if (isset($context['login_show_undelete']))
65
-		echo '
66
+	if (isset($context['login_show_undelete'])) {
67
+			echo '
66 68
 						<dt class="alert">', $txt['undelete_account'], ':</dt>
67 69
 						<dd><input type="checkbox" name="undelete"></dd>';
70
+	}
68 71
 
69 72
 	echo '
70 73
 					</dl>
@@ -82,8 +85,8 @@  discard block
 block discarded – undo
82 85
 							document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus();
83 86
 						}, 150);';
84 87
 
85
-	if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2))
86
-		echo '
88
+	if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) {
89
+			echo '
87 90
 						form = $("#frmLogin");
88 91
 						form.submit(function(e) {
89 92
 							e.preventDefault();
@@ -116,16 +119,18 @@  discard block
 block discarded – undo
116 119
 
117 120
 							return false;
118 121
 						});';
122
+	}
119 123
 
120 124
 	echo '
121 125
 					</script>
122 126
 				</form>';
123 127
 
124 128
 	// It is a long story as to why we have this when we're clearly not going to use it.
125
-	if (!empty($context['from_ajax']))
126
-		echo '
129
+	if (!empty($context['from_ajax'])) {
130
+			echo '
127 131
 				<br>
128 132
 				<a href="javascript:self.close();"></a>';
133
+	}
129 134
 	echo '
130 135
 			</div><!-- .roundframe -->
131 136
 		</div><!-- .login -->';
@@ -147,11 +152,12 @@  discard block
 block discarded – undo
147 152
 			</div>
148 153
 			<div class="roundframe noup">';
149 154
 
150
-	if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error']))
151
-		echo '
155
+	if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) {
156
+			echo '
152 157
 				<div class="error">
153 158
 					', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], '
154 159
 				</div>';
160
+	}
155 161
 
156 162
 	echo '
157 163
 				<form action="', $context['tfa_url'], '" method="post" id="frmTfa">
@@ -180,8 +186,8 @@  discard block
 block discarded – undo
180 186
 				<script>
181 187
 						form = $("#frmTfa");';
182 188
 
183
-	if (!empty($context['from_ajax']))
184
-		echo '
189
+	if (!empty($context['from_ajax'])) {
190
+			echo '
185 191
 						form.submit(function(e) {
186 192
 							// If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page
187 193
 							if (form.find("input[name=tfa_backup]:first").val().length > 0)
@@ -200,6 +206,7 @@  discard block
 block discarded – undo
200 206
 
201 207
 							return false;
202 208
 						});';
209
+	}
203 210
 
204 211
 	echo '
205 212
 						form.find("input[name=backup]").click(function(e) {
@@ -232,10 +239,11 @@  discard block
 block discarded – undo
232 239
 				', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>';
233 240
 
234 241
 
235
-	if ($context['can_register'])
236
-		echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']);
237
-	else
238
-		echo $txt['login_below'];
242
+	if ($context['can_register']) {
243
+			echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']);
244
+	} else {
245
+			echo $txt['login_below'];
246
+	}
239 247
 
240 248
 	// And now the login information.
241 249
 	echo '
@@ -335,9 +343,10 @@  discard block
 block discarded – undo
335 343
 			</div>
336 344
 			<div class="roundframe centertext noup">';
337 345
 
338
-	if (!empty($context['incorrect_password']))
339
-		echo '
346
+	if (!empty($context['incorrect_password'])) {
347
+			echo '
340 348
 				<div class="error">', $txt['admin_incorrect_password'], '</div>';
349
+	}
341 350
 
342 351
 	echo '
343 352
 				<strong>', $txt['password'], ':</strong>
@@ -378,11 +387,12 @@  discard block
 block discarded – undo
378 387
 			<div class="roundframe">';
379 388
 
380 389
 	// You didn't even have an ID?
381
-	if (empty($context['member_id']))
382
-		echo '
390
+	if (empty($context['member_id'])) {
391
+			echo '
383 392
 				<dl>
384 393
 					<dt>', $txt['invalid_activation_username'], ':</dt>
385 394
 					<dd><input type="text" name="user" size="30"></dd>';
395
+	}
386 396
 
387 397
 	echo '
388 398
 					<dt>', $txt['invalid_activation_retry'], ':</dt>
@@ -419,13 +429,14 @@  discard block
 block discarded – undo
419 429
 					<dd><input type="password" name="passwd" size="30"></dd>
420 430
 				</dl>';
421 431
 
422
-	if ($context['can_activate'])
423
-		echo '
432
+	if ($context['can_activate']) {
433
+			echo '
424 434
 				<p>', $txt['invalid_activation_known'], '</p>
425 435
 				<dl>
426 436
 					<dt>', $txt['invalid_activation_retry'], ':</dt>
427 437
 					<dd><input type="text" name="code" size="30"></dd>
428 438
 				</dl>';
439
+	}
429 440
 
430 441
 	echo '
431 442
 				<p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button"></p>
Please login to merge, or discard this patch.
Sources/Subs-Db-mysql.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 
255 255
 		case 'datetime':
256 256
 			if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d) ([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $datetime_matches) === 1)
257
-				return 'str_to_date('.
258
-					sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5] ,$datetime_matches[6]).
257
+				return 'str_to_date(' .
258
+					sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5], $datetime_matches[6]) .
259 259
 					',\'%Y-%m-%d %h:%i:%s\')';
260 260
 			else
261 261
 				smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 	{
840 840
 		$count = count($insertRows);
841 841
 		$ai = 0;
842
-		for($i = 0; $i < $count; $i++)
842
+		for ($i = 0; $i < $count; $i++)
843 843
 		{
844 844
 			$old_id = $smcFunc['db_insert_id']();
845 845
 			
@@ -865,13 +865,13 @@  discard block
 block discarded – undo
865 865
 				$count2 = count($indexed_columns);
866 866
 				for ($x = 0; $x < $count2; $x++)
867 867
 				{
868
-					$where_string += key($indexed_columns[$x]) . ' = '. $insertRows[$i][$x];
868
+					$where_string += key($indexed_columns[$x]) . ' = ' . $insertRows[$i][$x];
869 869
 					if (($x + 1) < $count2)
870 870
 						$where_string += ' AND ';
871 871
 				}
872 872
 
873
-				$request = $smcFunc['db_query']('','
874
-					SELECT `'. $keys[0] . '` FROM ' . $table .'
873
+				$request = $smcFunc['db_query']('', '
874
+					SELECT `'. $keys[0] . '` FROM ' . $table . '
875 875
 					WHERE ' . $where_string . ' LIMIT 1',
876 876
 					array()
877 877
 				);
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 			$return_var = array();
901 901
 			$count = count($insertRows);
902 902
 			$start = smf_db_insert_id($table, $keys[0]);
903
-			for ($i = 0; $i < $count; $i++ )
903
+			for ($i = 0; $i < $count; $i++)
904 904
 				$return_var[] = $start + $i;
905 905
 		}
906 906
 		return $return_var;
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 	mysqli_stmt_bind_param($mysql_error_data_prep, 'iissssssi', 
1031 1031
 		$error_array[0], $error_array[1], $error_array[2], $error_array[3], $error_array[4], $error_array[5], $error_array[6],
1032 1032
 		$error_array[7], $error_array[8]);
1033
-	mysqli_stmt_execute ($mysql_error_data_prep);
1033
+	mysqli_stmt_execute($mysql_error_data_prep);
1034 1034
 }
1035 1035
 
1036 1036
 ?>
1037 1037
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +274 added lines, -203 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@  discard block
 block discarded – undo
13 13
  * @version 2.1 Beta 4
14 14
  */
15 15
 
16
-if (!defined('SMF'))
16
+if (!defined('SMF')) {
17 17
 	die('No direct access...');
18
+}
18 19
 
19 20
 /**
20 21
  *  Maps the implementations in this file (smf_db_function_name)
@@ -33,8 +34,8 @@  discard block
 block discarded – undo
33 34
 	global $smcFunc;
34 35
 
35 36
 	// Map some database specific functions, only do this once.
36
-	if (!isset($smcFunc['db_fetch_assoc']))
37
-		$smcFunc += array(
37
+	if (!isset($smcFunc['db_fetch_assoc'])) {
38
+			$smcFunc += array(
38 39
 			'db_query'                  => 'smf_db_query',
39 40
 			'db_quote'                  => 'smf_db_quote',
40 41
 			'db_fetch_assoc'            => 'mysqli_fetch_assoc',
@@ -62,9 +63,11 @@  discard block
 block discarded – undo
62 63
 			'db_fetch_all'              => 'smf_db_fetch_all',
63 64
 			'db_error_insert'			=> 'smf_db_error_insert',
64 65
 		);
66
+	}
65 67
 
66
-	if (!empty($db_options['persist']))
67
-		$db_server = 'p:' . $db_server;
68
+	if (!empty($db_options['persist'])) {
69
+			$db_server = 'p:' . $db_server;
70
+	}
68 71
 
69 72
 	$connection = mysqli_init();
70 73
 
@@ -73,24 +76,27 @@  discard block
 block discarded – undo
73 76
 	$success = false;
74 77
 
75 78
 	if ($connection) {
76
-		if (!empty($db_options['port']))
77
-			$success = mysqli_real_connect($connection, $db_server, $db_user, $db_passwd, '', $db_options['port'], null, $flags);
78
-		else
79
-			$success = mysqli_real_connect($connection, $db_server, $db_user, $db_passwd, '', 0, null, $flags);
79
+		if (!empty($db_options['port'])) {
80
+					$success = mysqli_real_connect($connection, $db_server, $db_user, $db_passwd, '', $db_options['port'], null, $flags);
81
+		} else {
82
+					$success = mysqli_real_connect($connection, $db_server, $db_user, $db_passwd, '', 0, null, $flags);
83
+		}
80 84
 	}
81 85
 
82 86
 	// Something's wrong, show an error if its fatal (which we assume it is)
83 87
 	if ($success === false)
84 88
 	{
85
-		if (!empty($db_options['non_fatal']))
86
-			return null;
87
-		else
88
-			display_db_error();
89
+		if (!empty($db_options['non_fatal'])) {
90
+					return null;
91
+		} else {
92
+					display_db_error();
93
+		}
89 94
 	}
90 95
 
91 96
 	// Select the database, unless told not to
92
-	if (empty($db_options['dont_select_db']) && !@mysqli_select_db($connection, $db_name) && empty($db_options['non_fatal']))
93
-		display_db_error();
97
+	if (empty($db_options['dont_select_db']) && !@mysqli_select_db($connection, $db_name) && empty($db_options['non_fatal'])) {
98
+			display_db_error();
99
+	}
94 100
 
95 101
 	$smcFunc['db_query']('', 'SET SESSION sql_mode = \'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\'',
96 102
 		array(),
@@ -166,34 +172,42 @@  discard block
 block discarded – undo
166 172
 	global $db_callback, $user_info, $db_prefix, $smcFunc;
167 173
 
168 174
 	list ($values, $connection) = $db_callback;
169
-	if (!is_object($connection))
170
-		display_db_error();
175
+	if (!is_object($connection)) {
176
+			display_db_error();
177
+	}
171 178
 
172
-	if ($matches[1] === 'db_prefix')
173
-		return $db_prefix;
179
+	if ($matches[1] === 'db_prefix') {
180
+			return $db_prefix;
181
+	}
174 182
 
175
-	if (isset($user_info[$matches[1]]) && strpos($matches[1], 'query_') !== false)
176
-		return $user_info[$matches[1]];
183
+	if (isset($user_info[$matches[1]]) && strpos($matches[1], 'query_') !== false) {
184
+			return $user_info[$matches[1]];
185
+	}
177 186
 
178
-	if ($matches[1] === 'empty')
179
-		return '\'\'';
187
+	if ($matches[1] === 'empty') {
188
+			return '\'\'';
189
+	}
180 190
 
181
-	if (!isset($matches[2]))
182
-		smf_db_error_backtrace('Invalid value inserted or no type specified.', '', E_USER_ERROR, __FILE__, __LINE__);
191
+	if (!isset($matches[2])) {
192
+			smf_db_error_backtrace('Invalid value inserted or no type specified.', '', E_USER_ERROR, __FILE__, __LINE__);
193
+	}
183 194
 
184
-	if ($matches[1] === 'literal')
185
-		return '\'' . mysqli_real_escape_string($connection, $matches[2]) . '\'';
195
+	if ($matches[1] === 'literal') {
196
+			return '\'' . mysqli_real_escape_string($connection, $matches[2]) . '\'';
197
+	}
186 198
 
187
-	if (!isset($values[$matches[2]]))
188
-		smf_db_error_backtrace('The database value you\'re trying to insert does not exist: ' . (isset($smcFunc['htmlspecialchars']) ? $smcFunc['htmlspecialchars']($matches[2]) : htmlspecialchars($matches[2])), '', E_USER_ERROR, __FILE__, __LINE__);
199
+	if (!isset($values[$matches[2]])) {
200
+			smf_db_error_backtrace('The database value you\'re trying to insert does not exist: ' . (isset($smcFunc['htmlspecialchars']) ? $smcFunc['htmlspecialchars']($matches[2]) : htmlspecialchars($matches[2])), '', E_USER_ERROR, __FILE__, __LINE__);
201
+	}
189 202
 
190 203
 	$replacement = $values[$matches[2]];
191 204
 
192 205
 	switch ($matches[1])
193 206
 	{
194 207
 		case 'int':
195
-			if (!is_numeric($replacement) || (string) $replacement !== (string) (int) $replacement)
196
-				smf_db_error_backtrace('Wrong value type sent to the database. Integer expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
208
+			if (!is_numeric($replacement) || (string) $replacement !== (string) (int) $replacement) {
209
+							smf_db_error_backtrace('Wrong value type sent to the database. Integer expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
210
+			}
197 211
 			return (string) (int) $replacement;
198 212
 		break;
199 213
 
@@ -205,65 +219,73 @@  discard block
 block discarded – undo
205 219
 		case 'array_int':
206 220
 			if (is_array($replacement))
207 221
 			{
208
-				if (empty($replacement))
209
-					smf_db_error_backtrace('Database error, given array of integer values is empty. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
222
+				if (empty($replacement)) {
223
+									smf_db_error_backtrace('Database error, given array of integer values is empty. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
224
+				}
210 225
 
211 226
 				foreach ($replacement as $key => $value)
212 227
 				{
213
-					if (!is_numeric($value) || (string) $value !== (string) (int) $value)
214
-						smf_db_error_backtrace('Wrong value type sent to the database. Array of integers expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
228
+					if (!is_numeric($value) || (string) $value !== (string) (int) $value) {
229
+											smf_db_error_backtrace('Wrong value type sent to the database. Array of integers expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
230
+					}
215 231
 
216 232
 					$replacement[$key] = (string) (int) $value;
217 233
 				}
218 234
 
219 235
 				return implode(', ', $replacement);
236
+			} else {
237
+							smf_db_error_backtrace('Wrong value type sent to the database. Array of integers expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
220 238
 			}
221
-			else
222
-				smf_db_error_backtrace('Wrong value type sent to the database. Array of integers expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
223 239
 
224 240
 		break;
225 241
 
226 242
 		case 'array_string':
227 243
 			if (is_array($replacement))
228 244
 			{
229
-				if (empty($replacement))
230
-					smf_db_error_backtrace('Database error, given array of string values is empty. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
245
+				if (empty($replacement)) {
246
+									smf_db_error_backtrace('Database error, given array of string values is empty. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
247
+				}
231 248
 
232
-				foreach ($replacement as $key => $value)
233
-					$replacement[$key] = sprintf('\'%1$s\'', mysqli_real_escape_string($connection, $value));
249
+				foreach ($replacement as $key => $value) {
250
+									$replacement[$key] = sprintf('\'%1$s\'', mysqli_real_escape_string($connection, $value));
251
+				}
234 252
 
235 253
 				return implode(', ', $replacement);
254
+			} else {
255
+							smf_db_error_backtrace('Wrong value type sent to the database. Array of strings expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
236 256
 			}
237
-			else
238
-				smf_db_error_backtrace('Wrong value type sent to the database. Array of strings expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
239 257
 		break;
240 258
 
241 259
 		case 'date':
242
-			if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d)$~', $replacement, $date_matches) === 1)
243
-				return sprintf('\'%04d-%02d-%02d\'', $date_matches[1], $date_matches[2], $date_matches[3]);
244
-			else
245
-				smf_db_error_backtrace('Wrong value type sent to the database. Date expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
260
+			if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d)$~', $replacement, $date_matches) === 1) {
261
+							return sprintf('\'%04d-%02d-%02d\'', $date_matches[1], $date_matches[2], $date_matches[3]);
262
+			} else {
263
+							smf_db_error_backtrace('Wrong value type sent to the database. Date expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
264
+			}
246 265
 		break;
247 266
 
248 267
 		case 'time':
249
-			if (preg_match('~^([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $time_matches) === 1)
250
-				return sprintf('\'%02d:%02d:%02d\'', $time_matches[1], $time_matches[2], $time_matches[3]);
251
-			else
252
-				smf_db_error_backtrace('Wrong value type sent to the database. Time expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
268
+			if (preg_match('~^([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $time_matches) === 1) {
269
+							return sprintf('\'%02d:%02d:%02d\'', $time_matches[1], $time_matches[2], $time_matches[3]);
270
+			} else {
271
+							smf_db_error_backtrace('Wrong value type sent to the database. Time expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
272
+			}
253 273
 		break;
254 274
 
255 275
 		case 'datetime':
256
-			if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d) ([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $datetime_matches) === 1)
257
-				return 'str_to_date('.
276
+			if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d) ([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $datetime_matches) === 1) {
277
+							return 'str_to_date('.
258 278
 					sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5] ,$datetime_matches[6]).
259 279
 					',\'%Y-%m-%d %h:%i:%s\')';
260
-			else
261
-				smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
280
+			} else {
281
+							smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
282
+			}
262 283
 		break;
263 284
 
264 285
 		case 'float':
265
-			if (!is_numeric($replacement))
266
-				smf_db_error_backtrace('Wrong value type sent to the database. Floating point number expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
286
+			if (!is_numeric($replacement)) {
287
+							smf_db_error_backtrace('Wrong value type sent to the database. Floating point number expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
288
+			}
267 289
 			return (string) (float) $replacement;
268 290
 		break;
269 291
 
@@ -277,32 +299,37 @@  discard block
 block discarded – undo
277 299
 		break;
278 300
 
279 301
 		case 'inet':
280
-			if ($replacement == 'null' || $replacement == '')
281
-				return 'null';
282
-			if (!isValidIP($replacement))
283
-				smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
302
+			if ($replacement == 'null' || $replacement == '') {
303
+							return 'null';
304
+			}
305
+			if (!isValidIP($replacement)) {
306
+							smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
307
+			}
284 308
 			//we don't use the native support of mysql > 5.6.2
285 309
 			return sprintf('unhex(\'%1$s\')', bin2hex(inet_pton($replacement)));
286 310
 
287 311
 		case 'array_inet':
288 312
 			if (is_array($replacement))
289 313
 			{
290
-				if (empty($replacement))
291
-					smf_db_error_backtrace('Database error, given array of IPv4 or IPv6 values is empty. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
314
+				if (empty($replacement)) {
315
+									smf_db_error_backtrace('Database error, given array of IPv4 or IPv6 values is empty. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
316
+				}
292 317
 
293 318
 				foreach ($replacement as $key => $value)
294 319
 				{
295
-					if ($replacement == 'null' || $replacement == '')
296
-						$replacement[$key] = 'null';
297
-					if (!isValidIP($value))
298
-						smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
320
+					if ($replacement == 'null' || $replacement == '') {
321
+											$replacement[$key] = 'null';
322
+					}
323
+					if (!isValidIP($value)) {
324
+											smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
325
+					}
299 326
 					$replacement[$key] = sprintf('unhex(\'%1$s\')', bin2hex(inet_pton($value)));
300 327
 				}
301 328
 
302 329
 				return implode(', ', $replacement);
330
+			} else {
331
+							smf_db_error_backtrace('Wrong value type sent to the database. Array of IPv4 or IPv6 expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
303 332
 			}
304
-			else
305
-				smf_db_error_backtrace('Wrong value type sent to the database. Array of IPv4 or IPv6 expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
306 333
 		break;
307 334
 
308 335
 		default:
@@ -378,22 +405,25 @@  discard block
 block discarded – undo
378 405
 		// Are we in SSI mode?  If so try that username and password first
379 406
 		if (SMF == 'SSI' && !empty($ssi_db_user) && !empty($ssi_db_passwd))
380 407
 		{
381
-			if (empty($db_persist))
382
-				$db_connection = @mysqli_connect($db_server, $ssi_db_user, $ssi_db_passwd);
383
-			else
384
-				$db_connection = @mysqli_connect('p:' . $db_server, $ssi_db_user, $ssi_db_passwd);
408
+			if (empty($db_persist)) {
409
+							$db_connection = @mysqli_connect($db_server, $ssi_db_user, $ssi_db_passwd);
410
+			} else {
411
+							$db_connection = @mysqli_connect('p:' . $db_server, $ssi_db_user, $ssi_db_passwd);
412
+			}
385 413
 		}
386 414
 		// Fall back to the regular username and password if need be
387 415
 		if (!$db_connection)
388 416
 		{
389
-			if (empty($db_persist))
390
-				$db_connection = @mysqli_connect($db_server, $db_user, $db_passwd);
391
-			else
392
-				$db_connection = @mysqli_connect('p:' . $db_server, $db_user, $db_passwd);
417
+			if (empty($db_persist)) {
418
+							$db_connection = @mysqli_connect($db_server, $db_user, $db_passwd);
419
+			} else {
420
+							$db_connection = @mysqli_connect('p:' . $db_server, $db_user, $db_passwd);
421
+			}
393 422
 		}
394 423
 
395
-		if (!$db_connection || !@mysqli_select_db($db_connection, $db_name))
396
-			$db_connection = false;
424
+		if (!$db_connection || !@mysqli_select_db($db_connection, $db_name)) {
425
+					$db_connection = false;
426
+		}
397 427
 
398 428
 		$connection = $db_connection;
399 429
 	}
@@ -401,18 +431,20 @@  discard block
 block discarded – undo
401 431
 	// One more query....
402 432
 	$db_count = !isset($db_count) ? 1 : $db_count + 1;
403 433
 
404
-	if (empty($modSettings['disableQueryCheck']) && strpos($db_string, '\'') !== false && empty($db_values['security_override']))
405
-		smf_db_error_backtrace('Hacking attempt...', 'Illegal character (\') used in query...', true, __FILE__, __LINE__);
434
+	if (empty($modSettings['disableQueryCheck']) && strpos($db_string, '\'') !== false && empty($db_values['security_override'])) {
435
+			smf_db_error_backtrace('Hacking attempt...', 'Illegal character (\') used in query...', true, __FILE__, __LINE__);
436
+	}
406 437
 
407 438
 	// Use "ORDER BY null" to prevent Mysql doing filesorts for Group By clauses without an Order By
408 439
 	if (strpos($db_string, 'GROUP BY') !== false && strpos($db_string, 'ORDER BY') === false && preg_match('~^\s+SELECT~i', $db_string))
409 440
 	{
410 441
 		// Add before LIMIT
411
-		if ($pos = strpos($db_string, 'LIMIT '))
412
-			$db_string = substr($db_string, 0, $pos) . "\t\t\tORDER BY null\n" . substr($db_string, $pos, strlen($db_string));
413
-		else
414
-			// Append it.
442
+		if ($pos = strpos($db_string, 'LIMIT ')) {
443
+					$db_string = substr($db_string, 0, $pos) . "\t\t\tORDER BY null\n" . substr($db_string, $pos, strlen($db_string));
444
+		} else {
445
+					// Append it.
415 446
 			$db_string .= "\n\t\t\tORDER BY null";
447
+		}
416 448
 	}
417 449
 
418 450
 	if (empty($db_values['security_override']) && (!empty($db_values) || strpos($db_string, '{db_prefix}') !== false))
@@ -434,8 +466,9 @@  discard block
 block discarded – undo
434 466
 		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
435 467
 
436 468
 		// Initialize $db_cache if not already initialized.
437
-		if (!isset($db_cache))
438
-			$db_cache = array();
469
+		if (!isset($db_cache)) {
470
+					$db_cache = array();
471
+		}
439 472
 
440 473
 		if (!empty($_SESSION['debug_redirect']))
441 474
 		{
@@ -461,17 +494,18 @@  discard block
 block discarded – undo
461 494
 		while (true)
462 495
 		{
463 496
 			$pos = strpos($db_string, '\'', $pos + 1);
464
-			if ($pos === false)
465
-				break;
497
+			if ($pos === false) {
498
+							break;
499
+			}
466 500
 			$clean .= substr($db_string, $old_pos, $pos - $old_pos);
467 501
 
468 502
 			while (true)
469 503
 			{
470 504
 				$pos1 = strpos($db_string, '\'', $pos + 1);
471 505
 				$pos2 = strpos($db_string, '\\', $pos + 1);
472
-				if ($pos1 === false)
473
-					break;
474
-				elseif ($pos2 === false || $pos2 > $pos1)
506
+				if ($pos1 === false) {
507
+									break;
508
+				} elseif ($pos2 === false || $pos2 > $pos1)
475 509
 				{
476 510
 					$pos = $pos1;
477 511
 					break;
@@ -487,29 +521,35 @@  discard block
 block discarded – undo
487 521
 		$clean = trim(strtolower(preg_replace($allowed_comments_from, $allowed_comments_to, $clean)));
488 522
 
489 523
 		// Comments?  We don't use comments in our queries, we leave 'em outside!
490
-		if (strpos($clean, '/*') > 2 || strpos($clean, '--') !== false || strpos($clean, ';') !== false)
491
-			$fail = true;
524
+		if (strpos($clean, '/*') > 2 || strpos($clean, '--') !== false || strpos($clean, ';') !== false) {
525
+					$fail = true;
526
+		}
492 527
 		// Trying to change passwords, slow us down, or something?
493
-		elseif (strpos($clean, 'sleep') !== false && preg_match('~(^|[^a-z])sleep($|[^[_a-z])~s', $clean) != 0)
494
-			$fail = true;
495
-		elseif (strpos($clean, 'benchmark') !== false && preg_match('~(^|[^a-z])benchmark($|[^[a-z])~s', $clean) != 0)
496
-			$fail = true;
528
+		elseif (strpos($clean, 'sleep') !== false && preg_match('~(^|[^a-z])sleep($|[^[_a-z])~s', $clean) != 0) {
529
+					$fail = true;
530
+		} elseif (strpos($clean, 'benchmark') !== false && preg_match('~(^|[^a-z])benchmark($|[^[a-z])~s', $clean) != 0) {
531
+					$fail = true;
532
+		}
497 533
 
498
-		if (!empty($fail) && function_exists('log_error'))
499
-			smf_db_error_backtrace('Hacking attempt...', 'Hacking attempt...' . "\n" . $db_string, E_USER_ERROR, __FILE__, __LINE__);
534
+		if (!empty($fail) && function_exists('log_error')) {
535
+					smf_db_error_backtrace('Hacking attempt...', 'Hacking attempt...' . "\n" . $db_string, E_USER_ERROR, __FILE__, __LINE__);
536
+		}
500 537
 	}
501 538
 
502
-	if (empty($db_unbuffered))
503
-		$ret = @mysqli_query($connection, $db_string);
504
-	else
505
-		$ret = @mysqli_query($connection, $db_string, MYSQLI_USE_RESULT);
539
+	if (empty($db_unbuffered)) {
540
+			$ret = @mysqli_query($connection, $db_string);
541
+	} else {
542
+			$ret = @mysqli_query($connection, $db_string, MYSQLI_USE_RESULT);
543
+	}
506 544
 
507
-	if ($ret === false && empty($db_values['db_error_skip']))
508
-		$ret = smf_db_error($db_string, $connection);
545
+	if ($ret === false && empty($db_values['db_error_skip'])) {
546
+			$ret = smf_db_error($db_string, $connection);
547
+	}
509 548
 
510 549
 	// Debugging.
511
-	if (isset($db_show_debug) && $db_show_debug === true)
512
-		$db_cache[$db_count]['t'] = array_sum(explode(' ', microtime())) - array_sum(explode(' ', $st));
550
+	if (isset($db_show_debug) && $db_show_debug === true) {
551
+			$db_cache[$db_count]['t'] = array_sum(explode(' ', microtime())) - array_sum(explode(' ', $st));
552
+	}
513 553
 
514 554
 	return $ret;
515 555
 }
@@ -556,12 +596,13 @@  discard block
 block discarded – undo
556 596
 	// Decide which connection to use
557 597
 	$connection = $connection === null ? $db_connection : $connection;
558 598
 
559
-	if ($type == 'begin')
560
-		return @mysqli_query($connection, 'BEGIN');
561
-	elseif ($type == 'rollback')
562
-		return @mysqli_query($connection, 'ROLLBACK');
563
-	elseif ($type == 'commit')
564
-		return @mysqli_query($connection, 'COMMIT');
599
+	if ($type == 'begin') {
600
+			return @mysqli_query($connection, 'BEGIN');
601
+	} elseif ($type == 'rollback') {
602
+			return @mysqli_query($connection, 'ROLLBACK');
603
+	} elseif ($type == 'commit') {
604
+			return @mysqli_query($connection, 'COMMIT');
605
+	}
565 606
 
566 607
 	return false;
567 608
 }
@@ -601,8 +642,9 @@  discard block
 block discarded – undo
601 642
 	//    2013: Lost connection to server during query.
602 643
 
603 644
 	// Log the error.
604
-	if ($query_errno != 1213 && $query_errno != 1205 && function_exists('log_error'))
605
-		log_error($txt['database_error'] . ': ' . $query_error . (!empty($modSettings['enableErrorQueryLogging']) ? "\n\n$db_string" : ''), 'database', $file, $line);
645
+	if ($query_errno != 1213 && $query_errno != 1205 && function_exists('log_error')) {
646
+			log_error($txt['database_error'] . ': ' . $query_error . (!empty($modSettings['enableErrorQueryLogging']) ? "\n\n$db_string" : ''), 'database', $file, $line);
647
+	}
606 648
 
607 649
 	// Database error auto fixing ;).
608 650
 	if (function_exists('cache_get_data') && (!isset($modSettings['autoFixDatabase']) || $modSettings['autoFixDatabase'] == '1'))
@@ -611,8 +653,9 @@  discard block
 block discarded – undo
611 653
 		$old_cache = @$modSettings['cache_enable'];
612 654
 		$modSettings['cache_enable'] = '1';
613 655
 
614
-		if (($temp = cache_get_data('db_last_error', 600)) !== null)
615
-			$db_last_error = max(@$db_last_error, $temp);
656
+		if (($temp = cache_get_data('db_last_error', 600)) !== null) {
657
+					$db_last_error = max(@$db_last_error, $temp);
658
+		}
616 659
 
617 660
 		if (@$db_last_error < time() - 3600 * 24 * 3)
618 661
 		{
@@ -628,8 +671,9 @@  discard block
 block discarded – undo
628 671
 					foreach ($tables as $table)
629 672
 					{
630 673
 						// Now, it's still theoretically possible this could be an injection.  So backtick it!
631
-						if (trim($table) != '')
632
-							$fix_tables[] = '`' . strtr(trim($table), array('`' => '')) . '`';
674
+						if (trim($table) != '') {
675
+													$fix_tables[] = '`' . strtr(trim($table), array('`' => '')) . '`';
676
+						}
633 677
 					}
634 678
 				}
635 679
 
@@ -638,8 +682,9 @@  discard block
 block discarded – undo
638 682
 			// Table crashed.  Let's try to fix it.
639 683
 			elseif ($query_errno == 1016)
640 684
 			{
641
-				if (preg_match('~\'([^\.\']+)~', $query_error, $match) != 0)
642
-					$fix_tables = array('`' . $match[1] . '`');
685
+				if (preg_match('~\'([^\.\']+)~', $query_error, $match) != 0) {
686
+									$fix_tables = array('`' . $match[1] . '`');
687
+				}
643 688
 			}
644 689
 			// Indexes crashed.  Should be easy to fix!
645 690
 			elseif ($query_errno == 1034 || $query_errno == 1035)
@@ -658,13 +703,15 @@  discard block
 block discarded – undo
658 703
 
659 704
 			// Make a note of the REPAIR...
660 705
 			cache_put_data('db_last_error', time(), 600);
661
-			if (($temp = cache_get_data('db_last_error', 600)) === null)
662
-				updateSettingsFile(array('db_last_error' => time()));
706
+			if (($temp = cache_get_data('db_last_error', 600)) === null) {
707
+							updateSettingsFile(array('db_last_error' => time()));
708
+			}
663 709
 
664 710
 			// Attempt to find and repair the broken table.
665
-			foreach ($fix_tables as $table)
666
-				$smcFunc['db_query']('', "
711
+			foreach ($fix_tables as $table) {
712
+							$smcFunc['db_query']('', "
667 713
 					REPAIR TABLE $table", false, false);
714
+			}
668 715
 
669 716
 			// And send off an email!
670 717
 			sendmail($webmaster_email, $txt['database_error'], $txt['tried_to_repair'], null, 'dberror');
@@ -673,11 +720,12 @@  discard block
 block discarded – undo
673 720
 
674 721
 			// Try the query again...?
675 722
 			$ret = $smcFunc['db_query']('', $db_string, false, false);
676
-			if ($ret !== false)
677
-				return $ret;
723
+			if ($ret !== false) {
724
+							return $ret;
725
+			}
726
+		} else {
727
+					$modSettings['cache_enable'] = $old_cache;
678 728
 		}
679
-		else
680
-			$modSettings['cache_enable'] = $old_cache;
681 729
 
682 730
 		// Check for the "lost connection" or "deadlock found" errors - and try it just one more time.
683 731
 		if (in_array($query_errno, array(1205, 1213, 2006, 2013)))
@@ -687,22 +735,25 @@  discard block
 block discarded – undo
687 735
 				// Are we in SSI mode?  If so try that username and password first
688 736
 				if (SMF == 'SSI' && !empty($ssi_db_user) && !empty($ssi_db_passwd))
689 737
 				{
690
-					if (empty($db_persist))
691
-						$db_connection = @mysqli_connect($db_server, $ssi_db_user, $ssi_db_passwd);
692
-					else
693
-						$db_connection = @mysqli_connect('p:' . $db_server, $ssi_db_user, $ssi_db_passwd);
738
+					if (empty($db_persist)) {
739
+											$db_connection = @mysqli_connect($db_server, $ssi_db_user, $ssi_db_passwd);
740
+					} else {
741
+											$db_connection = @mysqli_connect('p:' . $db_server, $ssi_db_user, $ssi_db_passwd);
742
+					}
694 743
 				}
695 744
 				// Fall back to the regular username and password if need be
696 745
 				if (!$db_connection)
697 746
 				{
698
-					if (empty($db_persist))
699
-						$db_connection = @mysqli_connect($db_server, $db_user, $db_passwd);
700
-					else
701
-						$db_connection = @mysqli_connect('p:' . $db_server, $db_user, $db_passwd);
747
+					if (empty($db_persist)) {
748
+											$db_connection = @mysqli_connect($db_server, $db_user, $db_passwd);
749
+					} else {
750
+											$db_connection = @mysqli_connect('p:' . $db_server, $db_user, $db_passwd);
751
+					}
702 752
 				}
703 753
 
704
-				if (!$db_connection || !@mysqli_select_db($db_connection, $db_name))
705
-					$db_connection = false;
754
+				if (!$db_connection || !@mysqli_select_db($db_connection, $db_name)) {
755
+									$db_connection = false;
756
+				}
706 757
 			}
707 758
 
708 759
 			if ($db_connection)
@@ -713,24 +764,27 @@  discard block
 block discarded – undo
713 764
 					$ret = $smcFunc['db_query']('', $db_string, false, false);
714 765
 
715 766
 					$new_errno = mysqli_errno($db_connection);
716
-					if ($ret !== false || in_array($new_errno, array(1205, 1213)))
717
-						break;
767
+					if ($ret !== false || in_array($new_errno, array(1205, 1213))) {
768
+											break;
769
+					}
718 770
 				}
719 771
 
720 772
 				// If it failed again, shucks to be you... we're not trying it over and over.
721
-				if ($ret !== false)
722
-					return $ret;
773
+				if ($ret !== false) {
774
+									return $ret;
775
+				}
723 776
 			}
724 777
 		}
725 778
 		// Are they out of space, perhaps?
726 779
 		elseif ($query_errno == 1030 && (strpos($query_error, ' -1 ') !== false || strpos($query_error, ' 28 ') !== false || strpos($query_error, ' 12 ') !== false))
727 780
 		{
728
-			if (!isset($txt))
729
-				$query_error .= ' - check database storage space.';
730
-			else
781
+			if (!isset($txt)) {
782
+							$query_error .= ' - check database storage space.';
783
+			} else
731 784
 			{
732
-				if (!isset($txt['mysql_error_space']))
733
-					loadLanguage('Errors');
785
+				if (!isset($txt['mysql_error_space'])) {
786
+									loadLanguage('Errors');
787
+				}
734 788
 
735 789
 				$query_error .= !isset($txt['mysql_error_space']) ? ' - check database storage space.' : $txt['mysql_error_space'];
736 790
 			}
@@ -738,15 +792,17 @@  discard block
 block discarded – undo
738 792
 	}
739 793
 
740 794
 	// Nothing's defined yet... just die with it.
741
-	if (empty($context) || empty($txt))
742
-		die($query_error);
795
+	if (empty($context) || empty($txt)) {
796
+			die($query_error);
797
+	}
743 798
 
744 799
 	// Show an error message, if possible.
745 800
 	$context['error_title'] = $txt['database_error'];
746
-	if (allowedTo('admin_forum'))
747
-		$context['error_message'] = nl2br($query_error) . '<br>' . $txt['file'] . ': ' . $file . '<br>' . $txt['line'] . ': ' . $line;
748
-	else
749
-		$context['error_message'] = $txt['try_again'];
801
+	if (allowedTo('admin_forum')) {
802
+			$context['error_message'] = nl2br($query_error) . '<br>' . $txt['file'] . ': ' . $file . '<br>' . $txt['line'] . ': ' . $line;
803
+	} else {
804
+			$context['error_message'] = $txt['try_again'];
805
+	}
750 806
 
751 807
 	if (allowedTo('admin_forum') && isset($db_show_debug) && $db_show_debug === true)
752 808
 	{
@@ -778,8 +834,9 @@  discard block
 block discarded – undo
778 834
 	$return_var = null;
779 835
 
780 836
 	// With nothing to insert, simply return.
781
-	if (empty($data))
782
-		return;
837
+	if (empty($data)) {
838
+			return;
839
+	}
783 840
 
784 841
 	// Replace the prefix holder with the actual prefix.
785 842
 	$table = str_replace('{db_prefix}', $db_prefix, $table);
@@ -789,23 +846,26 @@  discard block
 block discarded – undo
789 846
 	if (!empty($keys) && (count($keys) > 0) && $returnmode > 0)
790 847
 	{
791 848
 		$with_returning = true;
792
-		if ($returnmode == 2)
793
-			$return_var = array();
849
+		if ($returnmode == 2) {
850
+					$return_var = array();
851
+		}
794 852
 	}
795 853
 
796 854
 	// Inserting data as a single row can be done as a single array.
797
-	if (!is_array($data[array_rand($data)]))
798
-		$data = array($data);
855
+	if (!is_array($data[array_rand($data)])) {
856
+			$data = array($data);
857
+	}
799 858
 
800 859
 	// Create the mold for a single row insert.
801 860
 	$insertData = '(';
802 861
 	foreach ($columns as $columnName => $type)
803 862
 	{
804 863
 		// Are we restricting the length?
805
-		if (strpos($type, 'string-') !== false)
806
-			$insertData .= sprintf('SUBSTRING({string:%1$s}, 1, ' . substr($type, 7) . '), ', $columnName);
807
-		else
808
-			$insertData .= sprintf('{%1$s:%2$s}, ', $type, $columnName);
864
+		if (strpos($type, 'string-') !== false) {
865
+					$insertData .= sprintf('SUBSTRING({string:%1$s}, 1, ' . substr($type, 7) . '), ', $columnName);
866
+		} else {
867
+					$insertData .= sprintf('{%1$s:%2$s}, ', $type, $columnName);
868
+		}
809 869
 	}
810 870
 	$insertData = substr($insertData, 0, -2) . ')';
811 871
 
@@ -814,8 +874,9 @@  discard block
 block discarded – undo
814 874
 
815 875
 	// Here's where the variables are injected to the query.
816 876
 	$insertRows = array();
817
-	foreach ($data as $dataRow)
818
-		$insertRows[] = smf_db_quote($insertData, array_combine($indexed_columns, $dataRow), $connection);
877
+	foreach ($data as $dataRow) {
878
+			$insertRows[] = smf_db_quote($insertData, array_combine($indexed_columns, $dataRow), $connection);
879
+	}
819 880
 
820 881
 	// Determine the method of insertion.
821 882
 	$queryTitle = $method == 'replace' ? 'REPLACE' : ($method == 'ignore' ? 'INSERT IGNORE' : 'INSERT');
@@ -834,8 +895,7 @@  discard block
 block discarded – undo
834 895
 			),
835 896
 			$connection
836 897
 		);
837
-	}
838
-	else //special way for ignore method with returning
898
+	} else //special way for ignore method with returning
839 899
 	{
840 900
 		$count = count($insertRows);
841 901
 		$ai = 0;
@@ -855,19 +915,21 @@  discard block
 block discarded – undo
855 915
 			);
856 916
 			$new_id = $smcFunc['db_insert_id']();
857 917
 			
858
-			if ($last_id != $new_id) //the inserted value was new
918
+			if ($last_id != $new_id) {
919
+				//the inserted value was new
859 920
 			{
860 921
 				$ai = $new_id;
861 922
 			}
862
-			else	// the inserted value already exists we need to find the pk
923
+			} else	// the inserted value already exists we need to find the pk
863 924
 			{
864 925
 				$where_string = '';
865 926
 				$count2 = count($indexed_columns);
866 927
 				for ($x = 0; $x < $count2; $x++)
867 928
 				{
868 929
 					$where_string += key($indexed_columns[$x]) . ' = '. $insertRows[$i][$x];
869
-					if (($x + 1) < $count2)
870
-						$where_string += ' AND ';
930
+					if (($x + 1) < $count2) {
931
+											$where_string += ' AND ';
932
+					}
871 933
 				}
872 934
 
873 935
 				$request = $smcFunc['db_query']('','
@@ -883,25 +945,27 @@  discard block
 block discarded – undo
883 945
 				}
884 946
 			}
885 947
 			
886
-			if ($returnmode == 1)
887
-				$return_var = $ai;
888
-			else if ($returnmode == 2)
889
-				$return_var[] = $ai;
948
+			if ($returnmode == 1) {
949
+							$return_var = $ai;
950
+			} else if ($returnmode == 2) {
951
+							$return_var[] = $ai;
952
+			}
890 953
 		}
891 954
 	}
892 955
 	
893 956
 
894 957
 	if ($with_returning)
895 958
 	{
896
-		if ($returnmode == 1 && empty($return_var))
897
-			$return_var = smf_db_insert_id($table, $keys[0]) + count($insertRows) - 1;
898
-		else if ($returnmode == 2 && empty($return_var))
959
+		if ($returnmode == 1 && empty($return_var)) {
960
+					$return_var = smf_db_insert_id($table, $keys[0]) + count($insertRows) - 1;
961
+		} else if ($returnmode == 2 && empty($return_var))
899 962
 		{
900 963
 			$return_var = array();
901 964
 			$count = count($insertRows);
902 965
 			$start = smf_db_insert_id($table, $keys[0]);
903
-			for ($i = 0; $i < $count; $i++ )
904
-				$return_var[] = $start + $i;
966
+			for ($i = 0; $i < $count; $i++ ) {
967
+							$return_var[] = $start + $i;
968
+			}
905 969
 		}
906 970
 		return $return_var;
907 971
 	}
@@ -919,8 +983,9 @@  discard block
 block discarded – undo
919 983
  */
920 984
 function smf_db_error_backtrace($error_message, $log_message = '', $error_type = false, $file = null, $line = null)
921 985
 {
922
-	if (empty($log_message))
923
-		$log_message = $error_message;
986
+	if (empty($log_message)) {
987
+			$log_message = $error_message;
988
+	}
924 989
 
925 990
 	foreach (debug_backtrace() as $step)
926 991
 	{
@@ -939,12 +1004,14 @@  discard block
 block discarded – undo
939 1004
 	}
940 1005
 
941 1006
 	// A special case - we want the file and line numbers for debugging.
942
-	if ($error_type == 'return')
943
-		return array($file, $line);
1007
+	if ($error_type == 'return') {
1008
+			return array($file, $line);
1009
+	}
944 1010
 
945 1011
 	// Is always a critical error.
946
-	if (function_exists('log_error'))
947
-		log_error($log_message, 'critical', $file, $line);
1012
+	if (function_exists('log_error')) {
1013
+			log_error($log_message, 'critical', $file, $line);
1014
+	}
948 1015
 
949 1016
 	if (function_exists('fatal_error'))
950 1017
 	{
@@ -952,12 +1019,12 @@  discard block
 block discarded – undo
952 1019
 
953 1020
 		// Cannot continue...
954 1021
 		exit;
1022
+	} elseif ($error_type) {
1023
+			trigger_error($error_message . ($line !== null ? '<em>(' . basename($file) . '-' . $line . ')</em>' : ''), $error_type);
1024
+	} else {
1025
+			trigger_error($error_message . ($line !== null ? '<em>(' . basename($file) . '-' . $line . ')</em>' : ''));
1026
+	}
955 1027
 	}
956
-	elseif ($error_type)
957
-		trigger_error($error_message . ($line !== null ? '<em>(' . basename($file) . '-' . $line . ')</em>' : ''), $error_type);
958
-	else
959
-		trigger_error($error_message . ($line !== null ? '<em>(' . basename($file) . '-' . $line . ')</em>' : ''));
960
-}
961 1028
 
962 1029
 /**
963 1030
  * Escape the LIKE wildcards so that they match the character and not the wildcard.
@@ -974,10 +1041,11 @@  discard block
 block discarded – undo
974 1041
 		'\\' => '\\\\',
975 1042
 	);
976 1043
 
977
-	if ($translate_human_wildcards)
978
-		$replacements += array(
1044
+	if ($translate_human_wildcards) {
1045
+			$replacements += array(
979 1046
 			'*' => '%',
980 1047
 		);
1048
+	}
981 1049
 
982 1050
 	return strtr($string, $replacements);
983 1051
 }
@@ -991,8 +1059,9 @@  discard block
 block discarded – undo
991 1059
  */
992 1060
 function smf_is_resource($result)
993 1061
 {
994
-	if ($result instanceof mysqli_result)
995
-		return true;
1062
+	if ($result instanceof mysqli_result) {
1063
+			return true;
1064
+	}
996 1065
 
997 1066
 	return false;
998 1067
 }
@@ -1020,16 +1089,18 @@  discard block
 block discarded – undo
1020 1089
 	global  $db_prefix, $db_connection;
1021 1090
 	static $mysql_error_data_prep;
1022 1091
 
1023
-	if (empty($mysql_error_data_prep))
1024
-			$mysql_error_data_prep = mysqli_prepare($db_connection,
1092
+	if (empty($mysql_error_data_prep)) {
1093
+				$mysql_error_data_prep = mysqli_prepare($db_connection,
1025 1094
 				'INSERT INTO ' . $db_prefix . 'log_errors(id_member, log_time, ip, url, message, session, error_type, file, line)
1026 1095
 													VALUES(		?,		?,		unhex(?), ?, 		?,		?,			?,		?,	?)'
1027 1096
 			);
1097
+	}
1028 1098
 
1029
-	if (filter_var($error_array[2], FILTER_VALIDATE_IP) !== false)
1030
-		$error_array[2] = bin2hex(inet_pton($error_array[2]));
1031
-	else
1032
-		$error_array[2] = null;
1099
+	if (filter_var($error_array[2], FILTER_VALIDATE_IP) !== false) {
1100
+			$error_array[2] = bin2hex(inet_pton($error_array[2]));
1101
+	} else {
1102
+			$error_array[2] = null;
1103
+	}
1033 1104
 	mysqli_stmt_bind_param($mysql_error_data_prep, 'iissssssi', 
1034 1105
 		$error_array[0], $error_array[1], $error_array[2], $error_array[3], $error_array[4], $error_array[5], $error_array[6],
1035 1106
 		$error_array[7], $error_array[8]);
Please login to merge, or discard this patch.
Themes/default/Register.template.php 1 patch
Braces   +72 added lines, -52 removed lines patch added patch discarded remove patch
@@ -28,14 +28,15 @@  discard block
 block discarded – undo
28 28
 			<div id="confirm_buttons">';
29 29
 
30 30
 	// Age restriction in effect?
31
-	if ($context['show_coppa'])
32
-		echo '
31
+	if ($context['show_coppa']) {
32
+			echo '
33 33
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br>
34 34
 				<br>
35 35
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
36
-	else
37
-		echo '
36
+	} else {
37
+			echo '
38 38
 				<input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button">';
39
+	}
39 40
 
40 41
 	echo '
41 42
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -78,9 +79,10 @@  discard block
 block discarded – undo
78 79
 			<ul>';
79 80
 
80 81
 		// Cycle through each error and display an error message.
81
-		foreach ($context['registration_errors'] as $error)
82
-			echo '
82
+		foreach ($context['registration_errors'] as $error) {
83
+					echo '
83 84
 				<li>', $error, '</li>';
85
+		}
84 86
 
85 87
 		echo '
86 88
 			</ul>
@@ -150,14 +152,15 @@  discard block
 block discarded – undo
150 152
 
151 153
 					<dl class="register_form">';
152 154
 
153
-		foreach ($context['custom_fields'] as $field)
154
-			if ($field['show_reg'] > 1)
155
+		foreach ($context['custom_fields'] as $field) {
156
+					if ($field['show_reg'] > 1)
155 157
 				echo '
156 158
 						<dt>
157 159
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
158 160
 							<span class="smalltext">', $field['desc'], '</span>
159 161
 						</dt>
160 162
 						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
163
+		}
161 164
 
162 165
 		echo '
163 166
 					</dl>';
@@ -191,41 +194,45 @@  discard block
 block discarded – undo
191 194
 					$callback_func = 'template_profile_' . $field['callback_func'];
192 195
 					$callback_func();
193 196
 				}
194
-			}
195
-			else
197
+			} else
196 198
 			{
197 199
 				echo '
198 200
 						<dt>
199 201
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>';
200 202
 
201 203
 				// Does it have any subtext to show?
202
-				if (!empty($field['subtext']))
203
-					echo '
204
+				if (!empty($field['subtext'])) {
205
+									echo '
204 206
 							<span class="smalltext">', $field['subtext'], '</span>';
207
+				}
205 208
 
206 209
 				echo '
207 210
 						</dt>
208 211
 						<dd>';
209 212
 
210 213
 				// Want to put something infront of the box?
211
-				if (!empty($field['preinput']))
212
-					echo '
214
+				if (!empty($field['preinput'])) {
215
+									echo '
213 216
 							', $field['preinput'];
217
+				}
214 218
 
215 219
 				// What type of data are we showing?
216
-				if ($field['type'] == 'label')
217
-					echo '
220
+				if ($field['type'] == 'label') {
221
+									echo '
218 222
 							', $field['value'];
223
+				}
219 224
 
220 225
 				// Maybe it's a text box - very likely!
221
-				elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
222
-					echo '
226
+				elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) {
227
+									echo '
223 228
 							<input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
229
+				}
224 230
 
225 231
 				// You "checking" me out? ;)
226
-				elseif ($field['type'] == 'check')
227
-					echo '
232
+				elseif ($field['type'] == 'check') {
233
+									echo '
228 234
 							<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
235
+				}
229 236
 
230 237
 				// Always fun - select boxes!
231 238
 				elseif ($field['type'] == 'select')
@@ -236,14 +243,16 @@  discard block
 block discarded – undo
236 243
 					if (isset($field['options']))
237 244
 					{
238 245
 						// Is this some code to generate the options?
239
-						if (!is_array($field['options']))
240
-							$field['options'] = eval($field['options']);
246
+						if (!is_array($field['options'])) {
247
+													$field['options'] = eval($field['options']);
248
+						}
241 249
 
242 250
 						// Assuming we now have some!
243
-						if (is_array($field['options']))
244
-							foreach ($field['options'] as $value => $name)
251
+						if (is_array($field['options'])) {
252
+													foreach ($field['options'] as $value => $name)
245 253
 								echo '
246 254
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
255
+						}
247 256
 					}
248 257
 
249 258
 					echo '
@@ -251,9 +260,10 @@  discard block
 block discarded – undo
251 260
 				}
252 261
 
253 262
 				// Something to end with?
254
-				if (!empty($field['postinput']))
255
-					echo '
263
+				if (!empty($field['postinput'])) {
264
+									echo '
256 265
 							', $field['postinput'];
266
+				}
257 267
 
258 268
 				echo '
259 269
 						</dd>';
@@ -266,13 +276,14 @@  discard block
 block discarded – undo
266 276
 	{
267 277
 		foreach ($context['custom_fields'] as $field)
268 278
 		{
269
-			if ($field['show_reg'] < 2)
270
-				echo '
279
+			if ($field['show_reg'] < 2) {
280
+							echo '
271 281
 						<dt>
272 282
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
273 283
 							<span class="smalltext">', $field['desc'], '</span>
274 284
 						</dt>
275 285
 						<dd>', $field['input_html'], '</dd>';
286
+			}
276 287
 		}
277 288
 	}
278 289
 
@@ -302,14 +313,15 @@  discard block
 block discarded – undo
302 313
 			<div id="confirm_buttons" class="flow_auto">';
303 314
 
304 315
 	// Age restriction in effect?
305
-	if (!$context['require_agreement'] && $context['show_coppa'])
306
-		echo '
316
+	if (!$context['require_agreement'] && $context['show_coppa']) {
317
+			echo '
307 318
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br>
308 319
 				<br>
309 320
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
310
-	else
311
-		echo '
321
+	} else {
322
+			echo '
312 323
 				<input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button">';
324
+	}
313 325
 	echo '
314 326
 			</div>
315 327
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -457,19 +469,20 @@  discard block
 block discarded – undo
457 469
 	</head>
458 470
 	<body style="margin: 1ex;">
459 471
 		<div class="windowbg description" style="text-align: center;">';
460
-	if (isBrowser('is_ie') || isBrowser('is_ie11'))
461
-		echo '
472
+	if (isBrowser('is_ie') || isBrowser('is_ie11')) {
473
+			echo '
462 474
 			<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
463 475
 				<param name="AutoStart" value="1">
464 476
 				<param name="FileName" value="', $context['verification_sound_href'], '">
465 477
 			</object>';
466
-	else
467
-		echo '
478
+	} else {
479
+			echo '
468 480
 			<audio src="', $context['verification_sound_href'], '" controls>
469 481
 				<object type="audio/x-wav" data="', $context['verification_sound_href'], '">
470 482
 					<a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
471 483
 				</object>
472 484
 			</audio>';
485
+	}
473 486
 	echo '
474 487
 			<br>
475 488
 			<a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br>
@@ -496,11 +509,12 @@  discard block
 block discarded – undo
496 509
 				</div>
497 510
 				<div id="register_screen" class="windowbg2 noup">';
498 511
 
499
-	if (!empty($context['registration_done']))
500
-		echo '
512
+	if (!empty($context['registration_done'])) {
513
+			echo '
501 514
 					<div class="infobox">
502 515
 						', $context['registration_done'], '
503 516
 					</div>';
517
+	}
504 518
 
505 519
 	echo '
506 520
 					<dl class="register_form" id="admin_register_form">
@@ -536,9 +550,10 @@  discard block
 block discarded – undo
536 550
 						<dd>
537 551
 							<select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
538 552
 
539
-		foreach ($context['member_groups'] as $id => $name)
540
-			echo '
553
+		foreach ($context['member_groups'] as $id => $name) {
554
+					echo '
541 555
 								<option value="', $id, '">', $name, '</option>';
556
+		}
542 557
 
543 558
 		echo '
544 559
 							</select>
@@ -546,8 +561,8 @@  discard block
 block discarded – undo
546 561
 	}
547 562
 
548 563
 	// If there is any field marked as required, show it here!
549
-	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
550
-		foreach ($context['custom_fields'] as $field)
564
+	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) {
565
+			foreach ($context['custom_fields'] as $field)
551 566
 			if ($field['show_reg'] > 1)
552 567
 				echo '
553 568
 						<dt>
@@ -557,6 +572,7 @@  discard block
 block discarded – undo
557 572
 						<dd>
558 573
 							', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '
559 574
 						</dd>';
575
+	}
560 576
 
561 577
 	echo '
562 578
 						<dt>
@@ -593,12 +609,13 @@  discard block
 block discarded – undo
593 609
 {
594 610
 	global $context, $scripturl, $txt;
595 611
 
596
-	if (!empty($context['saved_successful']))
597
-		echo '
612
+	if (!empty($context['saved_successful'])) {
613
+			echo '
598 614
 		<div class="infobox">', $txt['settings_saved'], '</div>';
599
-	elseif (!empty($context['could_not_save']))
600
-		echo '
615
+	} elseif (!empty($context['could_not_save'])) {
616
+			echo '
601 617
 		<div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>';
618
+	}
602 619
 
603 620
 	// Just a big box to edit the text file ;)
604 621
 	echo '
@@ -608,9 +625,10 @@  discard block
 block discarded – undo
608 625
 			</div>';
609 626
 
610 627
 	// Warning for if the file isn't writable.
611
-	if (!empty($context['warning']))
612
-		echo '
628
+	if (!empty($context['warning'])) {
629
+			echo '
613 630
 			<p class="error">', $context['warning'], '</p>';
631
+	}
614 632
 
615 633
 	echo '
616 634
 			<div class="windowbg2 noup" id="registration_agreement">';
@@ -627,9 +645,10 @@  discard block
 block discarded – undo
627 645
 						<strong>', $txt['admin_agreement_select_language'], ':</strong>&nbsp;
628 646
 						<select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
629 647
 
630
-		foreach ($context['editable_agreements'] as $file => $name)
631
-			echo '
648
+		foreach ($context['editable_agreements'] as $file => $name) {
649
+					echo '
632 650
 							<option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>';
651
+		}
633 652
 
634 653
 		echo '
635 654
 						</select>
@@ -669,9 +688,10 @@  discard block
 block discarded – undo
669 688
 {
670 689
 	global $context, $scripturl, $txt;
671 690
 
672
-	if (!empty($context['saved_successful']))
673
-		echo '
691
+	if (!empty($context['saved_successful'])) {
692
+			echo '
674 693
 	<div class="infobox">', $txt['settings_saved'], '</div>';
694
+	}
675 695
 
676 696
 	echo '
677 697
 	<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
Please login to merge, or discard this patch.
Themes/default/Printpage.template.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -144,11 +144,12 @@  discard block
 block discarded – undo
144 144
 				<div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>';
145 145
 
146 146
 		$options = 1;
147
-		foreach ($context['poll']['options'] as $option)
148
-			echo '
147
+		foreach ($context['poll']['options'] as $option) {
148
+					echo '
149 149
 					<div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong>
150 150
 						', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', '
151 151
 					</div>';
152
+		}
152 153
 
153 154
 		echo '
154 155
 			</div>';
@@ -170,9 +171,10 @@  discard block
 block discarded – undo
170 171
 			echo '
171 172
 				<hr>';
172 173
 
173
-			foreach ($context['printattach'][$post['id_msg']] as $attach)
174
-				echo '
174
+			foreach ($context['printattach'][$post['id_msg']] as $attach) {
175
+							echo '
175 176
 					<img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">';
177
+			}
176 178
 		}
177 179
 
178 180
 		echo '
@@ -207,12 +209,13 @@  discard block
 block discarded – undo
207 209
 		<div class="print_options">';
208 210
 
209 211
 	// Which option is set, text or text&images
210
-	if (isset($_REQUEST['images']))
211
-		echo '
212
+	if (isset($_REQUEST['images'])) {
213
+			echo '
212 214
 			<a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>';
213
-	else
214
-		echo '
215
+	} else {
216
+			echo '
215 217
 			<strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>';
218
+	}
216 219
 
217 220
 	echo '
218 221
 		</div><!-- .print_options -->';
Please login to merge, or discard this patch.
Themes/default/Search.template.php 1 patch
Braces   +85 added lines, -61 removed lines patch added patch discarded remove patch
@@ -25,15 +25,17 @@  discard block
 block discarded – undo
25 25
 			</h3>
26 26
 		</div>';
27 27
 
28
-	if (!empty($context['search_errors']))
29
-		echo '
28
+	if (!empty($context['search_errors'])) {
29
+			echo '
30 30
 		<div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>';
31
+	}
31 32
 
32
-	if (!empty($context['search_ignored']))
33
-		echo '
33
+	if (!empty($context['search_ignored'])) {
34
+			echo '
34 35
 		<p class="noticebox">
35 36
 			', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '
36 37
 		</p>';
38
+	}
37 39
 
38 40
 	echo '
39 41
 		<div id="advanced_search" class="roundframe">
@@ -44,9 +46,10 @@  discard block
 block discarded – undo
44 46
 				<dd>
45 47
 					<input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">';
46 48
 
47
-	if (empty($modSettings['search_simple_fulltext']))
48
-		echo '
49
+	if (empty($modSettings['search_simple_fulltext'])) {
50
+			echo '
49 51
 					<br><em class="smalltext">', $txt['search_example'], '</em>';
52
+	}
50 53
 
51 54
 	echo '
52 55
 				</dd>
@@ -120,13 +123,14 @@  discard block
 block discarded – undo
120 123
 	}
121 124
 
122 125
 	// If $context['search_params']['topic'] is set, that means we're searching just one topic.
123
-	if (!empty($context['search_params']['topic']))
124
-		echo '
126
+	if (!empty($context['search_params']['topic'])) {
127
+			echo '
125 128
 			<p>
126 129
 				', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.
127 130
 			</p>
128 131
 			<input type="hidden" name="topic" value="', $context['search_topic']['id'], '">
129 132
 			<input type="submit" name="b_search" value="', $txt['search'], '" class="button">';
133
+	}
130 134
 
131 135
 	echo '
132 136
 		</div>';
@@ -156,14 +160,15 @@  discard block
 block discarded – undo
156 160
 
157 161
 			foreach ($category['boards'] as $board)
158 162
 			{
159
-				if ($i == $limit)
160
-					echo '
163
+				if ($i == $limit) {
164
+									echo '
161 165
 							</ul>
162 166
 						</li>
163 167
 					</ul>
164 168
 					<ul class="ignoreboards floatright">
165 169
 						<li class="category">
166 170
 							<ul>';
171
+				}
167 172
 
168 173
 				echo '
169 174
 								<li class="board">
@@ -251,17 +256,19 @@  discard block
 block discarded – undo
251 256
 		<div class="roundframe">';
252 257
 
253 258
 		// Did they make any typos or mistakes, perhaps?
254
-		if (isset($context['did_you_mean']))
255
-			echo '
259
+		if (isset($context['did_you_mean'])) {
260
+					echo '
256 261
 			<p>
257 262
 				', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.
258 263
 			</p>';
264
+		}
259 265
 
260
-		if (!empty($context['search_ignored']))
261
-			echo '
266
+		if (!empty($context['search_ignored'])) {
267
+					echo '
262 268
 			<p>
263 269
 				', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '
264 270
 			</p>';
271
+		}
265 272
 
266 273
 		echo '
267 274
 			<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
@@ -284,10 +291,11 @@  discard block
 block discarded – undo
284 291
 					<input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '">
285 292
 				</div>';
286 293
 
287
-		if (!empty($context['search_params']['brd']))
288
-			foreach ($context['search_params']['brd'] as $board_id)
294
+		if (!empty($context['search_params']['brd'])) {
295
+					foreach ($context['search_params']['brd'] as $board_id)
289 296
 				echo '
290 297
 				<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">';
298
+		}
291 299
 
292 300
 		echo '
293 301
 			</form>
@@ -299,18 +307,20 @@  discard block
 block discarded – undo
299 307
 	if ($context['compact'])
300 308
 	{
301 309
 		// Quick moderation set to checkboxes? Oh, how fun :/
302
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
303
-			echo '
310
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
311
+					echo '
304 312
 	<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">';
313
+		}
305 314
 
306 315
 		echo '
307 316
 		<div class="cat_bar">
308 317
 			<h3 class="catbg">
309 318
 				<span class="floatright">';
310 319
 
311
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
312
-			echo '
320
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
321
+					echo '
313 322
 					<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">';
323
+		}
314 324
 		echo '
315 325
 				</span>
316 326
 				<span class="generic_icons filter"></span>&nbsp;', $txt['mlist_search_results'], ':&nbsp;', $context['search_params']['search'], '
@@ -318,15 +328,15 @@  discard block
 block discarded – undo
318 328
 		</div>';
319 329
 
320 330
 		// Was anything even found?
321
-		if (!empty($context['topics']))
322
-			echo '
331
+		if (!empty($context['topics'])) {
332
+					echo '
323 333
 		<div class="pagesection">
324 334
 			<span>', $context['page_index'], '</span>
325 335
 		</div>';
326
-
327
-		else
328
-			echo '
336
+		} else {
337
+					echo '
329 338
 		<div class="roundframe">', $txt['find_no_results'], '</div>';
339
+		}
330 340
 
331 341
 		// While we have results to show ...
332 342
 		while ($topic = $context['get_topics']())
@@ -354,38 +364,43 @@  discard block
 block discarded – undo
354 364
 					{
355 365
 						echo '
356 366
 					<input type="checkbox" name="topics[]" value="', $topic['id'], '">';
357
-					}
358
-					else
367
+					} else
359 368
 					{
360
-						if ($topic['quick_mod']['remove'])
361
-							echo '
369
+						if ($topic['quick_mod']['remove']) {
370
+													echo '
362 371
 					<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>';
372
+						}
363 373
 
364
-						if ($topic['quick_mod']['lock'])
365
-							echo '
374
+						if ($topic['quick_mod']['lock']) {
375
+													echo '
366 376
 					<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
377
+						}
367 378
 
368
-						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
369
-							echo '
379
+						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
380
+													echo '
370 381
 					<br>';
382
+						}
371 383
 
372
-						if ($topic['quick_mod']['sticky'])
373
-							echo '
384
+						if ($topic['quick_mod']['sticky']) {
385
+													echo '
374 386
 					<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
387
+						}
375 388
 
376
-						if ($topic['quick_mod']['move'])
377
-							echo '
389
+						if ($topic['quick_mod']['move']) {
390
+													echo '
378 391
 					<a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
392
+						}
379 393
 					}
380 394
 
381 395
 					echo '
382 396
 				</div><!-- .floatright -->';
383 397
 				}
384 398
 
385
-				if ($message['body_highlighted'] != '')
386
-					echo '
399
+				if ($message['body_highlighted'] != '') {
400
+									echo '
387 401
 				<br class="clear">
388 402
 				<div class="list_posts double_height">', $message['body_highlighted'], '</div>';
403
+				}
389 404
 			}
390 405
 
391 406
 			echo '
@@ -393,11 +408,12 @@  discard block
 block discarded – undo
393 408
 		</div><!-- $topic[css_class] -->';
394 409
 
395 410
 		}
396
-		if (!empty($context['topics']))
397
-			echo '
411
+		if (!empty($context['topics'])) {
412
+					echo '
398 413
 		<div class="pagesection">
399 414
 			<span>', $context['page_index'], '</span>
400 415
 		</div>';
416
+		}
401 417
 
402 418
 		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
403 419
 		{
@@ -407,17 +423,19 @@  discard block
 block discarded – undo
407 423
 			<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
408 424
 				<option value="">--------</option>';
409 425
 
410
-			foreach ($context['qmod_actions'] as $qmod_action)
411
-				if ($context['can_' . $qmod_action])
426
+			foreach ($context['qmod_actions'] as $qmod_action) {
427
+							if ($context['can_' . $qmod_action])
412 428
 					echo '
413 429
 				<option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
430
+			}
414 431
 
415 432
 			echo '
416 433
 			</select>';
417 434
 
418
-			if ($context['can_move'])
419
-				echo '
435
+			if ($context['can_move']) {
436
+							echo '
420 437
 			<span id="quick_mod_jump_to">&nbsp;</span>';
438
+			}
421 439
 
422 440
 			echo '
423 441
 			<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '">
@@ -427,13 +445,13 @@  discard block
 block discarded – undo
427 445
 		}
428 446
 
429 447
 
430
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
431
-			echo '
448
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
449
+					echo '
432 450
 		<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
433 451
 	</form>';
452
+		}
434 453
 
435
-	}
436
-	else
454
+	} else
437 455
 	{
438 456
 		echo '
439 457
 	<div class="cat_bar">
@@ -445,9 +463,10 @@  discard block
 block discarded – undo
445 463
 		<span>', $context['page_index'], '</span>
446 464
 	</div>';
447 465
 
448
-		if (empty($context['topics']))
449
-			echo '
466
+		if (empty($context['topics'])) {
467
+					echo '
450 468
 	<div class="information">(', $txt['search_no_results'], ')</div>';
469
+		}
451 470
 
452 471
 		while ($topic = $context['get_topics']())
453 472
 		{
@@ -464,23 +483,27 @@  discard block
 block discarded – undo
464 483
 		</div>
465 484
 		<div class="list_posts">', $message['body_highlighted'], '</div>';
466 485
 
467
-			if ($topic['can_reply'])
468
-				echo '
486
+			if ($topic['can_reply']) {
487
+							echo '
469 488
 		<ul class="quickbuttons">';
489
+			}
470 490
 
471 491
 			// If they *can* reply?
472
-			if ($topic['can_reply'])
473
-				echo '
492
+			if ($topic['can_reply']) {
493
+							echo '
474 494
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
495
+			}
475 496
 
476 497
 			// If they *can* quote?
477
-			if ($topic['can_quote'])
478
-				echo '
498
+			if ($topic['can_quote']) {
499
+							echo '
479 500
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
501
+			}
480 502
 
481
-			if ($topic['can_reply'])
482
-				echo '
503
+			if ($topic['can_reply']) {
504
+							echo '
483 505
 		</ul>';
506
+			}
484 507
 			echo '
485 508
 		<br class="clear">
486 509
 	</div><!-- $topic[css_class] -->';
@@ -499,8 +522,8 @@  discard block
 block discarded – undo
499 522
 	<div class="smalltext righttext" id="search_jump_to">&nbsp;</div>
500 523
 	<script>';
501 524
 
502
-	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
503
-		echo '
525
+	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
526
+			echo '
504 527
 		if (typeof(window.XMLHttpRequest) != "undefined")
505 528
 			aJumpTo[aJumpTo.length] = new JumpTo({
506 529
 				sContainerId: "quick_mod_jump_to",
@@ -515,6 +538,7 @@  discard block
 block discarded – undo
515 538
 				bDisabled: true,
516 539
 				sCustomName: "move_to"
517 540
 			});';
541
+	}
518 542
 
519 543
 	echo '
520 544
 		if (typeof(window.XMLHttpRequest) != "undefined")
Please login to merge, or discard this patch.
Themes/default/Themes.template.php 1 patch
Braces   +103 added lines, -80 removed lines patch added patch discarded remove patch
@@ -54,9 +54,10 @@  discard block
 block discarded – undo
54 54
 					<dd>
55 55
 						<div id="known_themes_list">';
56 56
 
57
-	foreach ($context['themes'] as $theme)
58
-		echo '
57
+	foreach ($context['themes'] as $theme) {
58
+			echo '
59 59
 							<label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $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">';
@@ -358,11 +362,12 @@  discard block
 block discarded – undo
358 362
 		if (empty($setting) || !is_array($setting))
359 363
 		{
360 364
 			// Insert a separator (unless this is the first item in the list)
361
-			if ($i !== $first_option_key)
362
-				echo '
365
+			if ($i !== $first_option_key) {
366
+							echo '
363 367
 				</dl>
364 368
 				<hr>
365 369
 				<dl class="settings">';
370
+			}
366 371
 
367 372
 			// Should we give a name to this section?
368 373
 			if (is_string($setting) && !empty($setting))
@@ -371,9 +376,9 @@  discard block
 block discarded – undo
371 376
 				echo '
372 377
 					<dt><strong>' . $setting . '</strong></dt>
373 378
 					<dd></dd>';
379
+			} else {
380
+							$titled_section = false;
374 381
 			}
375
-			else
376
-				$titled_section = false;
377 382
 
378 383
 			continue;
379 384
 		}
@@ -382,8 +387,8 @@  discard block
 block discarded – undo
382 387
 					<dt>';
383 388
 
384 389
 		// Show the change option box?
385
-		if ($context['theme_options_reset'])
386
-			echo '
390
+		if ($context['theme_options_reset']) {
391
+					echo '
387 392
 						<span class="floatleft">
388 393
 							<select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;">
389 394
 								<option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option>
@@ -391,14 +396,16 @@  discard block
 block discarded – undo
391 396
 								<option value="2">', $txt['themeadmin_reset_options_default'], '</option>
392 397
 							</select>
393 398
 						</span>';
399
+		}
394 400
 
395 401
 		echo '
396 402
 						<label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>';
397 403
 
398
-		if (isset($setting['description']))
399
-			echo '
404
+		if (isset($setting['description'])) {
405
+					echo '
400 406
 						<br>
401 407
 						<span class="smalltext">', $setting['description'], '</span>';
408
+		}
402 409
 		echo '
403 410
 					</dt>';
404 411
 
@@ -440,13 +447,11 @@  discard block
 block discarded – undo
440 447
 
441 448
 				echo '
442 449
 						<input type="number"', $min . $max . $step;
443
-			}
444
-			else if (isset($setting['type']) && $setting['type'] == 'url')
450
+			} else if (isset($setting['type']) && $setting['type'] == 'url')
445 451
 			{
446 452
 				echo'
447 453
 						<input type="url"';
448
-			}
449
-			else
454
+			} else
450 455
 			{
451 456
 				echo '
452 457
 						<input type="text"';
@@ -490,8 +495,8 @@  discard block
 block discarded – undo
490 495
 			<br>';
491 496
 
492 497
 	// @todo Why can't I edit the default theme popup.
493
-	if ($context['theme_settings']['theme_id'] != 1)
494
-		echo '
498
+	if ($context['theme_settings']['theme_id'] != 1) {
499
+			echo '
495 500
 			<div class="cat_bar">
496 501
 				<h3 class="catbg config_hd">
497 502
 					', $txt['theme_edit'], '
@@ -507,6 +512,7 @@  discard block
 block discarded – undo
507 512
 					</li>
508 513
 				</ul>
509 514
 			</div>';
515
+	}
510 516
 
511 517
 	echo '
512 518
 			<div class="cat_bar">
@@ -560,9 +566,10 @@  discard block
 block discarded – undo
560 566
 					<dd>
561 567
 						<select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">';
562 568
 
563
-		foreach ($context['theme_variants'] as $key => $variant)
564
-			echo '
569
+		foreach ($context['theme_variants'] as $key => $variant) {
570
+					echo '
565 571
 							<option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>';
572
+		}
566 573
 
567 574
 		echo '
568 575
 						</select>
@@ -598,11 +605,12 @@  discard block
 block discarded – undo
598 605
 		if (empty($setting) || !is_array($setting))
599 606
 		{
600 607
 			// We don't need a separator before the first list element
601
-			if ($i !== $first_setting_key)
602
-				echo '
608
+			if ($i !== $first_setting_key) {
609
+							echo '
603 610
 				</dl>
604 611
 				<hr>
605 612
 				<dl class="settings">';
613
+			}
606 614
 
607 615
 			// Add a fake heading?
608 616
 			if (is_string($setting) && !empty($setting))
@@ -611,9 +619,9 @@  discard block
 block discarded – undo
611 619
 				echo '
612 620
 					<dt><strong>' . $setting . '</strong></dt>
613 621
 					<dd></dd>';
622
+			} else {
623
+							$titled_section = false;
614 624
 			}
615
-			else
616
-				$titled_section = false;
617 625
 
618 626
 			continue;
619 627
 		}
@@ -622,9 +630,10 @@  discard block
 block discarded – undo
622 630
 					<dt>
623 631
 						<label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:';
624 632
 
625
-		if (isset($setting['description']))
626
-			echo '<br>
633
+		if (isset($setting['description'])) {
634
+					echo '<br>
627 635
 						<span class="smalltext">', $setting['description'], '</span>';
636
+		}
628 637
 
629 638
 		echo '
630 639
 					</dt>';
@@ -645,9 +654,10 @@  discard block
 block discarded – undo
645 654
 					<dd>
646 655
 						<select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">';
647 656
 
648
-			foreach ($setting['options'] as $value => $label)
649
-				echo '
657
+			foreach ($setting['options'] as $value => $label) {
658
+							echo '
650 659
 							<option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>';
660
+			}
651 661
 
652 662
 			echo '
653 663
 						</select>
@@ -676,13 +686,11 @@  discard block
 block discarded – undo
676 686
 
677 687
 				echo '
678 688
 						<input type="number"', $min . $max . $step;
679
-			}
680
-			else if (isset($setting['type']) && $setting['type'] == 'url')
689
+			} else if (isset($setting['type']) && $setting['type'] == 'url')
681 690
 			{
682 691
 				echo'
683 692
 						<input type="url"';
684
-			}
685
-			else
693
+			} else
686 694
 			{
687 695
 				echo '
688 696
 						<input type="text"';
@@ -839,21 +847,23 @@  discard block
 block discarded – undo
839 847
 		<div class="windowbg">';
840 848
 
841 849
 	// Oops! there was an error :(
842
-	if (!empty($context['error_message']))
843
-		echo '
850
+	if (!empty($context['error_message'])) {
851
+			echo '
844 852
 			<p>
845 853
 				', $context['error_message'], '
846 854
 			</p>';
855
+	}
847 856
 
848 857
 	// Not much to show except a link back...
849
-	else
850
-		echo '
858
+	else {
859
+			echo '
851 860
 			<p>
852 861
 				<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'], '
853 862
 			</p>
854 863
 			<p>
855 864
 				<a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a>
856 865
 			</p>';
866
+	}
857 867
 
858 868
 	echo '
859 869
 		</div><!-- .windowbg -->
@@ -920,11 +930,12 @@  discard block
 block discarded – undo
920 930
 					<span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span>
921 931
 					<span class="floatright">';
922 932
 
923
-		if ($template['can_copy'])
924
-			echo '
933
+		if ($template['can_copy']) {
934
+					echo '
925 935
 						<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>';
926
-		else
927
-			echo $txt['themeadmin_edit_no_copy'];
936
+		} else {
937
+					echo $txt['themeadmin_edit_no_copy'];
938
+		}
928 939
 
929 940
 		echo '
930 941
 					</span>
@@ -947,11 +958,12 @@  discard block
 block discarded – undo
947 958
 	echo '
948 959
 	<div id="admincenter">';
949 960
 
950
-	if (!empty($context['browse_title']))
951
-		echo '
961
+	if (!empty($context['browse_title'])) {
962
+			echo '
952 963
 		<div class="cat_bar">
953 964
 			<h3 class="catbg">', $context['browse_title'], '</h3>
954 965
 		</div>';
966
+	}
955 967
 
956 968
 	echo '
957 969
 		<table class="table_grid tborder">
@@ -971,16 +983,15 @@  discard block
 block discarded – undo
971 983
 				<tr class="windowbg">
972 984
 					<td>';
973 985
 
974
-		if ($file['is_editable'])
975
-			echo '
986
+		if ($file['is_editable']) {
987
+					echo '
976 988
 						<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
977
-
978
-		elseif ($file['is_directory'])
979
-			echo '
989
+		} elseif ($file['is_directory']) {
990
+					echo '
980 991
 						<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
981
-
982
-		else
983
-			echo $file['filename'];
992
+		} else {
993
+					echo $file['filename'];
994
+		}
984 995
 
985 996
 		echo '
986 997
 					</td>
@@ -1002,11 +1013,12 @@  discard block
 block discarded – undo
1002 1013
 {
1003 1014
 	global $context, $settings, $scripturl, $txt;
1004 1015
 
1005
-	if ($context['session_error'])
1006
-		echo '
1016
+	if ($context['session_error']) {
1017
+			echo '
1007 1018
 	<div class="errorbox">
1008 1019
 		', $txt['error_session_timeout'], '
1009 1020
 	</div>';
1021
+	}
1010 1022
 
1011 1023
 	// From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com.
1012 1024
 	echo '
@@ -1069,17 +1081,18 @@  discard block
 block discarded – undo
1069 1081
 					try
1070 1082
 					{
1071 1083
 					';
1072
-	if (isBrowser('is_ie'))
1073
-		echo '
1084
+	if (isBrowser('is_ie')) {
1085
+			echo '
1074 1086
 						var sheets = frames["css_preview_box"].document.styleSheets;
1075 1087
 						for (var j = 0; j < sheets.length; j++)
1076 1088
 						{
1077 1089
 							if (sheets[j].id == "css_preview_box")
1078 1090
 								sheets[j].cssText = document.forms.stylesheetForm.entire_file.value;
1079 1091
 						}';
1080
-	else
1081
-		echo '
1092
+	} else {
1093
+			echo '
1082 1094
 						setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);';
1095
+	}
1083 1096
 	echo '
1084 1097
 					}
1085 1098
 					catch (e)
@@ -1131,9 +1144,10 @@  discard block
 block discarded – undo
1131 1144
 			</div>
1132 1145
 			<div class="windowbg">';
1133 1146
 
1134
-	if (!$context['allow_save'])
1135
-		echo '
1147
+	if (!$context['allow_save']) {
1148
+			echo '
1136 1149
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1150
+	}
1137 1151
 
1138 1152
 	echo '
1139 1153
 				<textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea>
@@ -1147,9 +1161,10 @@  discard block
 block discarded – undo
1147 1161
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1148 1162
 
1149 1163
 	// Hopefully it exists.
1150
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1151
-		echo '
1164
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1165
+			echo '
1152 1166
 			<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'], '">';
1167
+	}
1153 1168
 
1154 1169
 	echo '
1155 1170
 		</form>
@@ -1163,18 +1178,20 @@  discard block
 block discarded – undo
1163 1178
 {
1164 1179
 	global $context, $scripturl, $txt;
1165 1180
 
1166
-	if ($context['session_error'])
1167
-		echo '
1181
+	if ($context['session_error']) {
1182
+			echo '
1168 1183
 	<div class="errorbox">
1169 1184
 		', $txt['error_session_timeout'], '
1170 1185
 	</div>';
1186
+	}
1171 1187
 
1172
-	if (isset($context['parse_error']))
1173
-		echo '
1188
+	if (isset($context['parse_error'])) {
1189
+			echo '
1174 1190
 	<div class="errorbox">
1175 1191
 		', $txt['themeadmin_edit_error'], '
1176 1192
 		<div><pre>', $context['parse_error'], '</pre></div>
1177 1193
 	</div>';
1194
+	}
1178 1195
 
1179 1196
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1180 1197
 	echo '
@@ -1185,16 +1202,18 @@  discard block
 block discarded – undo
1185 1202
 			</div>
1186 1203
 			<div class="windowbg">';
1187 1204
 
1188
-	if (!$context['allow_save'])
1189
-		echo '
1205
+	if (!$context['allow_save']) {
1206
+			echo '
1190 1207
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1208
+	}
1191 1209
 
1192
-	foreach ($context['file_parts'] as $part)
1193
-		echo '
1210
+	foreach ($context['file_parts'] as $part) {
1211
+			echo '
1194 1212
 				<label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br>
1195 1213
 				<div class="centertext">
1196 1214
 					<textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1197 1215
 				</div>';
1216
+	}
1198 1217
 
1199 1218
 	echo '
1200 1219
 				<div class="padding righttext">
@@ -1203,9 +1222,10 @@  discard block
 block discarded – undo
1203 1222
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1204 1223
 
1205 1224
 	// Hopefully it exists.
1206
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1207
-		echo '
1225
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1226
+			echo '
1208 1227
 					<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'], '">';
1228
+	}
1209 1229
 
1210 1230
 	echo '
1211 1231
 				</div><!-- .righttext -->
@@ -1221,18 +1241,20 @@  discard block
 block discarded – undo
1221 1241
 {
1222 1242
 	global $context, $scripturl, $txt;
1223 1243
 
1224
-	if ($context['session_error'])
1225
-		echo '
1244
+	if ($context['session_error']) {
1245
+			echo '
1226 1246
 	<div class="errorbox">
1227 1247
 		', $txt['error_session_timeout'], '
1228 1248
 	</div>';
1249
+	}
1229 1250
 
1230 1251
 	// Is this file writeable?
1231
-	if (!$context['allow_save'])
1232
-		echo '
1252
+	if (!$context['allow_save']) {
1253
+			echo '
1233 1254
 	<div class="errorbox">
1234 1255
 		', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '
1235 1256
 	</div>';
1257
+	}
1236 1258
 
1237 1259
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1238 1260
 	echo '
@@ -1248,9 +1270,10 @@  discard block
 block discarded – undo
1248 1270
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1249 1271
 
1250 1272
 	// Hopefully it exists.
1251
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1252
-		echo '
1273
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1274
+			echo '
1253 1275
 				<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'], '">';
1276
+	}
1254 1277
 
1255 1278
 	echo '
1256 1279
 			</div><!-- .windowbg -->
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3078,8 +3078,7 @@
 block discarded – undo
3078 3078
 			<div class="roundframe">
3079 3079
 				<div>
3080 3080
 		', !empty($context['tfa_backup']) ? '
3081
-					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' :
3082
-			($modSettings['tfa_mode'] == 2 ? '
3081
+					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? '
3083 3082
 									<div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), '
3084 3083
 									<div class="smalltext">', $txt['tfa_desc'], '</div>
3085 3084
 									<div class="floatleft">
Please login to merge, or discard this patch.
Braces   +471 added lines, -351 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>
@@ -179,20 +181,22 @@  discard block
 block discarded – undo
179 181
 			<div class="username clear">
180 182
 				<h4>';
181 183
 
182
-	if (!empty($context['print_custom_fields']['before_member']))
183
-		foreach ($context['print_custom_fields']['before_member'] as $field)
184
+	if (!empty($context['print_custom_fields']['before_member'])) {
185
+			foreach ($context['print_custom_fields']['before_member'] as $field)
184 186
 			if (!empty($field['output_html']))
185 187
 				echo '
186 188
 					<span>', $field['output_html'], '</span>';
189
+	}
187 190
 
188 191
 	echo '
189 192
 					', $context['member']['name'];
190 193
 
191
-	if (!empty($context['print_custom_fields']['after_member']))
192
-		foreach ($context['print_custom_fields']['after_member'] as $field)
194
+	if (!empty($context['print_custom_fields']['after_member'])) {
195
+			foreach ($context['print_custom_fields']['after_member'] as $field)
193 196
 			if (!empty($field['output_html']))
194 197
 				echo '
195 198
 					<span>', $field['output_html'], '</span>';
199
+	}
196 200
 
197 201
 
198 202
 	echo '
@@ -208,10 +212,11 @@  discard block
 block discarded – undo
208 212
 			<div class="custom_fields_below_avatar">
209 213
 				<ul>';
210 214
 
211
-		foreach ($context['print_custom_fields']['below_avatar'] as $field)
212
-			if (!empty($field['output_html']))
215
+		foreach ($context['print_custom_fields']['below_avatar'] as $field) {
216
+					if (!empty($field['output_html']))
213 217
 				echo '
214 218
 					<li>', $field['output_html'], '</li>';
219
+		}
215 220
 
216 221
 		echo '
217 222
 				</ul>
@@ -223,22 +228,25 @@  discard block
 block discarded – undo
223 228
 			<ul class="clear">';
224 229
 
225 230
 	// Email is only visible if it's your profile or you have the moderate_forum permission
226
-	if ($context['member']['show_email'])
227
-		echo '
231
+	if ($context['member']['show_email']) {
232
+			echo '
228 233
 				<li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>';
234
+	}
229 235
 
230 236
 	// Don't show an icon if they haven't specified a website.
231
-	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
232
-		echo '
237
+	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) {
238
+			echo '
233 239
 				<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
240
+	}
234 241
 
235 242
 	// Are there any custom profile fields as icons?
236 243
 	if (!empty($context['print_custom_fields']['icons']))
237 244
 	{
238
-		foreach ($context['print_custom_fields']['icons'] as $field)
239
-			if (!empty($field['output_html']))
245
+		foreach ($context['print_custom_fields']['icons'] as $field) {
246
+					if (!empty($field['output_html']))
240 247
 				echo '
241 248
 				<li class="custom_field">', $field['output_html'], '</li>';
249
+		}
242 250
 	}
243 251
 
244 252
 	echo '
@@ -247,24 +255,27 @@  discard block
 block discarded – undo
247 255
 				', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : '';
248 256
 
249 257
 	// Can they add this member as a buddy?
250
-	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
251
-		echo '
258
+	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) {
259
+			echo '
252 260
 				<br>
253 261
 				<a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
262
+	}
254 263
 
255 264
 	echo '
256 265
 			</span>';
257 266
 
258
-	if (!$context['user']['is_owner'] && $context['can_send_pm'])
259
-		echo '
267
+	if (!$context['user']['is_owner'] && $context['can_send_pm']) {
268
+			echo '
260 269
 			<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>';
270
+	}
261 271
 
262 272
 	echo '
263 273
 			<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>';
264 274
 
265
-	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled']))
266
-		echo '
275
+	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) {
276
+			echo '
267 277
 			<a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>';
278
+	}
268 279
 
269 280
 	echo '
270 281
 			<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>';
@@ -276,10 +287,11 @@  discard block
 block discarded – undo
276 287
 			<div class="custom_fields_bottom">
277 288
 				<ul class="nolist">';
278 289
 
279
-		foreach ($context['print_custom_fields']['bottom_poster'] as $field)
280
-			if (!empty($field['output_html']))
290
+		foreach ($context['print_custom_fields']['bottom_poster'] as $field) {
291
+					if (!empty($field['output_html']))
281 292
 				echo '
282 293
 					<li>', $field['output_html'], '</li>';
294
+		}
283 295
 
284 296
 		echo '
285 297
 				</ul>
@@ -292,15 +304,17 @@  discard block
 block discarded – undo
292 304
 		<div id="detailedinfo">
293 305
 			<dl class="settings">';
294 306
 
295
-	if ($context['user']['is_owner'] || $context['user']['is_admin'])
296
-		echo '
307
+	if ($context['user']['is_owner'] || $context['user']['is_admin']) {
308
+			echo '
297 309
 				<dt>', $txt['username'], ': </dt>
298 310
 				<dd>', $context['member']['username'], '</dd>';
311
+	}
299 312
 
300
-	if (!isset($context['disabled_fields']['posts']))
301
-		echo '
313
+	if (!isset($context['disabled_fields']['posts'])) {
314
+			echo '
302 315
 				<dt>', $txt['profile_posts'], ': </dt>
303 316
 				<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
317
+	}
304 318
 
305 319
 	if ($context['member']['show_email'])
306 320
 	{
@@ -309,15 +323,17 @@  discard block
 block discarded – undo
309 323
 				<dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>';
310 324
 	}
311 325
 
312
-	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
313
-		echo '
326
+	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) {
327
+			echo '
314 328
 				<dt>', $txt['custom_title'], ': </dt>
315 329
 				<dd>', $context['member']['title'], '</dd>';
330
+	}
316 331
 
317
-	if (!empty($context['member']['blurb']))
318
-		echo '
332
+	if (!empty($context['member']['blurb'])) {
333
+			echo '
319 334
 				<dt>', $txt['personal_text'], ': </dt>
320 335
 				<dd>', $context['member']['blurb'], '</dd>';
336
+	}
321 337
 
322 338
 	echo '
323 339
 				<dt>', $txt['age'], ':</dt>
@@ -331,19 +347,21 @@  discard block
 block discarded – undo
331 347
 	{
332 348
 		$fields = array();
333 349
 
334
-		foreach ($context['print_custom_fields']['standard'] as $field)
335
-			if (!empty($field['output_html']))
350
+		foreach ($context['print_custom_fields']['standard'] as $field) {
351
+					if (!empty($field['output_html']))
336 352
 				$fields[] = $field;
353
+		}
337 354
 
338 355
 		if (count($fields) > 0)
339 356
 		{
340 357
 			echo '
341 358
 			<dl class="settings">';
342 359
 
343
-			foreach ($fields as $field)
344
-				echo '
360
+			foreach ($fields as $field) {
361
+							echo '
345 362
 				<dt>', $field['name'], ':</dt>
346 363
 				<dd>', $field['output_html'], '</dd>';
364
+			}
347 365
 
348 366
 			echo '
349 367
 			</dl>';
@@ -363,9 +381,10 @@  discard block
 block discarded – undo
363 381
 					<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>';
364 382
 
365 383
 		// Can we provide information on what this means?
366
-		if (!empty($context['warning_status']))
367
-			echo '
384
+		if (!empty($context['warning_status'])) {
385
+					echo '
368 386
 					<span class="smalltext">(', $context['warning_status'], ')</span>';
387
+		}
369 388
 
370 389
 		echo '
371 390
 				</dd>';
@@ -376,9 +395,10 @@  discard block
 block discarded – undo
376 395
 	{
377 396
 
378 397
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
379
-		if (!empty($context['activate_message']))
380
-			echo '
398
+		if (!empty($context['activate_message'])) {
399
+					echo '
381 400
 				<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>';
401
+		}
382 402
 
383 403
 		// If the current member is banned, show a message and possibly a link to the ban.
384 404
 		if (!empty($context['member']['bans']))
@@ -390,10 +410,11 @@  discard block
 block discarded – undo
390 410
 				<dt class="clear" id="ban_info" style="display: none;">
391 411
 					<strong>', $txt['user_banned_by_following'], ':</strong>';
392 412
 
393
-			foreach ($context['member']['bans'] as $ban)
394
-				echo '
413
+			foreach ($context['member']['bans'] as $ban) {
414
+							echo '
395 415
 					<br>
396 416
 					<span class="smalltext">', $ban['explanation'], '</span>';
417
+			}
397 418
 
398 419
 			echo '
399 420
 				</dt>';
@@ -407,30 +428,34 @@  discard block
 block discarded – undo
407 428
 	// If the person looking is allowed, they can check the members IP address and hostname.
408 429
 	if ($context['can_see_ip'])
409 430
 	{
410
-		if (!empty($context['member']['ip']))
411
-		echo '
431
+		if (!empty($context['member']['ip'])) {
432
+				echo '
412 433
 				<dt>', $txt['ip'], ': </dt>
413 434
 				<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
435
+		}
414 436
 
415
-		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
416
-			echo '
437
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) {
438
+					echo '
417 439
 				<dt>', $txt['hostname'], ': </dt>
418 440
 				<dd>', $context['member']['hostname'], '</dd>';
441
+		}
419 442
 	}
420 443
 
421 444
 	echo '
422 445
 				<dt>', $txt['local_time'], ':</dt>
423 446
 				<dd>', $context['member']['local_time'], '</dd>';
424 447
 
425
-	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
426
-		echo '
448
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) {
449
+			echo '
427 450
 				<dt>', $txt['language'], ':</dt>
428 451
 				<dd>', $context['member']['language'], '</dd>';
452
+	}
429 453
 
430
-	if ($context['member']['show_last_login'])
431
-		echo '
454
+	if ($context['member']['show_last_login']) {
455
+			echo '
432 456
 				<dt>', $txt['lastLoggedIn'], ': </dt>
433 457
 				<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
458
+	}
434 459
 
435 460
 	echo '
436 461
 			</dl>';
@@ -442,10 +467,11 @@  discard block
 block discarded – undo
442 467
 			<div class="custom_fields_above_signature">
443 468
 				<ul class="nolist">';
444 469
 
445
-		foreach ($context['print_custom_fields']['above_signature'] as $field)
446
-			if (!empty($field['output_html']))
470
+		foreach ($context['print_custom_fields']['above_signature'] as $field) {
471
+					if (!empty($field['output_html']))
447 472
 				echo '
448 473
 					<li>', $field['output_html'], '</li>';
474
+		}
449 475
 
450 476
 		echo '
451 477
 				</ul>
@@ -453,12 +479,13 @@  discard block
 block discarded – undo
453 479
 	}
454 480
 
455 481
 	// Show the users signature.
456
-	if ($context['signature_enabled'] && !empty($context['member']['signature']))
457
-		echo '
482
+	if ($context['signature_enabled'] && !empty($context['member']['signature'])) {
483
+			echo '
458 484
 			<div class="signature">
459 485
 				<h5>', $txt['signature'], ':</h5>
460 486
 				', $context['member']['signature'], '
461 487
 			</div>';
488
+	}
462 489
 
463 490
 	// Are there any custom profile fields for below the signature?
464 491
 	if (!empty($context['print_custom_fields']['below_signature']))
@@ -467,10 +494,11 @@  discard block
 block discarded – undo
467 494
 			<div class="custom_fields_below_signature">
468 495
 				<ul class="nolist">';
469 496
 
470
-		foreach ($context['print_custom_fields']['below_signature'] as $field)
471
-			if (!empty($field['output_html']))
497
+		foreach ($context['print_custom_fields']['below_signature'] as $field) {
498
+					if (!empty($field['output_html']))
472 499
 				echo '
473 500
 					<li>', $field['output_html'], '</li>';
501
+		}
474 502
 
475 503
 		echo '
476 504
 				</ul>
@@ -516,62 +544,70 @@  discard block
 block discarded – undo
516 544
 			</div>
517 545
 			<div class="list_posts">';
518 546
 
519
-			if (!$post['approved'])
520
-				echo '
547
+			if (!$post['approved']) {
548
+							echo '
521 549
 				<div class="approve_post">
522 550
 					<em>', $txt['post_awaiting_approval'], '</em>
523 551
 				</div>';
552
+			}
524 553
 
525 554
 			echo '
526 555
 				', $post['body'], '
527 556
 			</div>';
528 557
 
529
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
530
-				echo '
558
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
559
+							echo '
531 560
 			<div class="floatright">
532 561
 				<ul class="quickbuttons">';
562
+			}
533 563
 
534 564
 			// If they *can* reply?
535
-			if ($post['can_reply'])
536
-				echo '
565
+			if ($post['can_reply']) {
566
+							echo '
537 567
 					<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
568
+			}
538 569
 
539 570
 			// If they *can* quote?
540
-			if ($post['can_quote'])
541
-				echo '
571
+			if ($post['can_quote']) {
572
+							echo '
542 573
 					<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>';
574
+			}
543 575
 
544 576
 			// How about... even... remove it entirely?!
545
-			if ($post['can_delete'])
546
-				echo '
577
+			if ($post['can_delete']) {
578
+							echo '
547 579
 					<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>';
580
+			}
548 581
 
549
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
550
-				echo '
582
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
583
+							echo '
551 584
 				</ul>
552 585
 			</div><!-- .floatright -->';
586
+			}
553 587
 
554 588
 			echo '
555 589
 		</div><!-- $post[css_class] -->';
556 590
 		}
591
+	} else {
592
+			template_show_list('attachments');
557 593
 	}
558
-	else
559
-		template_show_list('attachments');
560 594
 
561 595
 	// No posts? Just end with a informative message.
562
-	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
563
-		echo '
596
+	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) {
597
+			echo '
564 598
 		<div class="windowbg2">
565 599
 			', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
566 600
 		</div>';
601
+	}
567 602
 
568 603
 	// Show more page numbers.
569
-	if (!empty($context['page_index']))
570
-		echo '
604
+	if (!empty($context['page_index'])) {
605
+			echo '
571 606
 		<div class="pagesection">
572 607
 			<div class="pagelinks">', $context['page_index'], '</div>
573 608
 		</div>';
574
-}
609
+	}
610
+	}
575 611
 
576 612
 /**
577 613
  * Template for showing alerts within the alerts popup
@@ -581,11 +617,12 @@  discard block
 block discarded – undo
581 617
 	global $context, $txt, $scripturl;
582 618
 
583 619
 	// Do we have an update message?
584
-	if (!empty($context['update_message']))
585
-		echo '
620
+	if (!empty($context['update_message'])) {
621
+			echo '
586 622
 		<div class="infobox">
587 623
 			', $context['update_message'], '.
588 624
 		</div>';
625
+	}
589 626
 
590 627
 	echo '
591 628
 		<div class="cat_bar">
@@ -594,13 +631,12 @@  discard block
 block discarded – undo
594 631
 			</h3>
595 632
 		</div>';
596 633
 
597
-	if (empty($context['alerts']))
598
-		echo '
634
+	if (empty($context['alerts'])) {
635
+			echo '
599 636
 		<div class="information">
600 637
 			', $txt['alerts_none'], '
601 638
 		</div>';
602
-
603
-	else
639
+	} else
604 640
 	{
605 641
 		// Start the form.
606 642
 		echo '
@@ -662,12 +698,12 @@  discard block
 block discarded – undo
662 698
 		</div>' : '';
663 699
 
664 700
 	// No drafts? Just show an informative message.
665
-	if (empty($context['drafts']))
666
-		echo '
701
+	if (empty($context['drafts'])) {
702
+			echo '
667 703
 		<div class="windowbg2 centertext">
668 704
 			', $txt['draft_none'], '
669 705
 		</div>';
670
-	else
706
+	} else
671 707
 	{
672 708
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
673 709
 		foreach ($context['drafts'] as $draft)
@@ -679,13 +715,15 @@  discard block
 block discarded – undo
679 715
 				<h5>
680 716
 					<strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
681 717
 
682
-			if (!empty($draft['sticky']))
683
-				echo '
718
+			if (!empty($draft['sticky'])) {
719
+							echo '
684 720
 					<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
721
+			}
685 722
 
686
-			if (!empty($draft['locked']))
687
-				echo '
723
+			if (!empty($draft['locked'])) {
724
+							echo '
688 725
 					<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
726
+			}
689 727
 
690 728
 			echo '
691 729
 				</h5>
@@ -718,13 +756,13 @@  discard block
 block discarded – undo
718 756
 {
719 757
 	global $context, $scripturl, $txt;
720 758
 
721
-	if (!empty($context['saved_successful']))
722
-		echo '
759
+	if (!empty($context['saved_successful'])) {
760
+			echo '
723 761
 	<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
724
-
725
-	elseif (!empty($context['saved_failed']))
726
-		echo '
762
+	} elseif (!empty($context['saved_failed'])) {
763
+			echo '
727 764
 	<div class="errorbox">', $context['saved_failed'], '</div>';
765
+	}
728 766
 
729 767
 	echo '
730 768
 	<div id="edit_buddies">
@@ -739,14 +777,16 @@  discard block
 block discarded – undo
739 777
 					<th scope="col" class="quarter_table">', $txt['name'], '</th>
740 778
 					<th scope="col">', $txt['status'], '</th>';
741 779
 
742
-	if (allowedTo('moderate_forum'))
743
-		echo '
780
+	if (allowedTo('moderate_forum')) {
781
+			echo '
744 782
 					<th scope="col">', $txt['email'], '</th>';
783
+	}
745 784
 
746
-	if (!empty($context['custom_pf']))
747
-		foreach ($context['custom_pf'] as $column)
785
+	if (!empty($context['custom_pf'])) {
786
+			foreach ($context['custom_pf'] as $column)
748 787
 				echo '
749 788
 					<th scope="col">', $column['label'], '</th>';
789
+	}
750 790
 
751 791
 	echo '
752 792
 					<th scope="col">', $txt['remove'], '</th>
@@ -755,13 +795,14 @@  discard block
 block discarded – undo
755 795
 			<tbody>';
756 796
 
757 797
 	// If they don't have any buddies don't list them!
758
-	if (empty($context['buddies']))
759
-		echo '
798
+	if (empty($context['buddies'])) {
799
+			echo '
760 800
 				<tr class="windowbg">
761 801
 					<td colspan="', allowedTo('moderate_forum') ? '10' : '9', '">
762 802
 						<strong>', $txt['no_buddies'], '</strong>
763 803
 					</td>
764 804
 				</tr>';
805
+	}
765 806
 
766 807
 		// Now loop through each buddy showing info on each.
767 808
 	else
@@ -775,17 +816,19 @@  discard block
 block discarded – undo
775 816
 						<a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a>
776 817
 					</td>';
777 818
 
778
-			if ($buddy['show_email'])
779
-				echo '
819
+			if ($buddy['show_email']) {
820
+							echo '
780 821
 					<td>
781 822
 						<a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a>
782 823
 					</td>';
824
+			}
783 825
 
784 826
 			// Show the custom profile fields for this user.
785
-			if (!empty($context['custom_pf']))
786
-				foreach ($context['custom_pf'] as $key => $column)
827
+			if (!empty($context['custom_pf'])) {
828
+							foreach ($context['custom_pf'] as $key => $column)
787 829
 					echo '
788 830
 					<td class="lefttext">', $buddy['options'][$key], '</td>';
831
+			}
789 832
 
790 833
 			echo '
791 834
 					<td>
@@ -818,9 +861,10 @@  discard block
 block discarded – undo
818 861
 			</dl>
819 862
 		</div>';
820 863
 
821
-	if (!empty($context['token_check']))
822
-		echo '
864
+	if (!empty($context['token_check'])) {
865
+			echo '
823 866
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
867
+	}
824 868
 
825 869
 	echo '
826 870
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -846,12 +890,13 @@  discard block
 block discarded – undo
846 890
 {
847 891
 	global $context, $scripturl, $txt;
848 892
 
849
-	if (!empty($context['saved_successful']))
850
-		echo '
893
+	if (!empty($context['saved_successful'])) {
894
+			echo '
851 895
 	<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
852
-	elseif (!empty($context['saved_failed']))
853
-		echo '
896
+	} elseif (!empty($context['saved_failed'])) {
897
+			echo '
854 898
 	<div class="errorbox">', $context['saved_failed'], '</div>';
899
+	}
855 900
 
856 901
 	echo '
857 902
 	<div id="edit_buddies">
@@ -866,9 +911,10 @@  discard block
 block discarded – undo
866 911
 					<th scope="col" class="quarter_table">', $txt['name'], '</th>
867 912
 					<th scope="col">', $txt['status'], '</th>';
868 913
 
869
-	if (allowedTo('moderate_forum'))
870
-		echo '
914
+	if (allowedTo('moderate_forum')) {
915
+			echo '
871 916
 					<th scope="col">', $txt['email'], '</th>';
917
+	}
872 918
 
873 919
 	echo '
874 920
 					<th scope="col">', $txt['ignore_remove'], '</th>
@@ -877,13 +923,14 @@  discard block
 block discarded – undo
877 923
 			<tbody>';
878 924
 
879 925
 	// If they don't have anyone on their ignore list, don't list it!
880
-	if (empty($context['ignore_list']))
881
-		echo '
926
+	if (empty($context['ignore_list'])) {
927
+			echo '
882 928
 				<tr class="windowbg">
883 929
 					<td colspan="', allowedTo('moderate_forum') ? '4' : '3', '">
884 930
 						<strong>', $txt['no_ignore'], '</strong>
885 931
 					</td>
886 932
 				</tr>';
933
+	}
887 934
 
888 935
 	// Now loop through each buddy showing info on each.
889 936
 	foreach ($context['ignore_list'] as $member)
@@ -895,11 +942,12 @@  discard block
 block discarded – undo
895 942
 						<a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a>
896 943
 					</td>';
897 944
 
898
-		if ($member['show_email'])
899
-			echo '
945
+		if ($member['show_email']) {
946
+					echo '
900 947
 					<td>
901 948
 						<a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a>
902 949
 					</td>';
950
+		}
903 951
 		echo '
904 952
 					<td>
905 953
 						<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>
@@ -929,9 +977,10 @@  discard block
 block discarded – undo
929 977
 			</dl>
930 978
 		</div>';
931 979
 
932
-	if (!empty($context['token_check']))
933
-		echo '
980
+	if (!empty($context['token_check'])) {
981
+			echo '
934 982
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
983
+	}
935 984
 
936 985
 	echo '
937 986
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -977,9 +1026,10 @@  discard block
 block discarded – undo
977 1026
 					<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
978 1027
 
979 1028
 	// Second address detected?
980
-	if (!empty($context['last_ip2']))
981
-		echo '
1029
+	if (!empty($context['last_ip2'])) {
1030
+			echo '
982 1031
 					, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
1032
+	}
983 1033
 
984 1034
 	echo '
985 1035
 				</dd>';
@@ -1045,9 +1095,10 @@  discard block
 block discarded – undo
1045 1095
 		</div>
1046 1096
 		<div class="windowbg2 noup">';
1047 1097
 
1048
-		foreach ($context['whois_servers'] as $server)
1049
-		echo '
1098
+		foreach ($context['whois_servers'] as $server) {
1099
+				echo '
1050 1100
 			<a href="', $server['url'], '" target="_blank"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>';
1101
+		}
1051 1102
 		echo '
1052 1103
 		</div>
1053 1104
 		<br>';
@@ -1058,10 +1109,10 @@  discard block
 block discarded – undo
1058 1109
 		<div class="cat_bar">
1059 1110
 			<h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
1060 1111
 		</div>';
1061
-	if (empty($context['ips']))
1062
-		echo '
1112
+	if (empty($context['ips'])) {
1113
+			echo '
1063 1114
 		<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
1064
-	else
1115
+	} else
1065 1116
 	{
1066 1117
 		echo '
1067 1118
 		<table class="table_grid">
@@ -1074,12 +1125,13 @@  discard block
 block discarded – undo
1074 1125
 			<tbody>';
1075 1126
 
1076 1127
 		// Loop through each of the members and display them.
1077
-		foreach ($context['ips'] as $ip => $memberlist)
1078
-			echo '
1128
+		foreach ($context['ips'] as $ip => $memberlist) {
1129
+					echo '
1079 1130
 				<tr class="windowbg">
1080 1131
 					<td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
1081 1132
 					<td>', implode(', ', $memberlist), '</td>
1082 1133
 				</tr>';
1134
+		}
1083 1135
 
1084 1136
 		echo '
1085 1137
 			</tbody>
@@ -1125,8 +1177,7 @@  discard block
 block discarded – undo
1125 1177
 	{
1126 1178
 		echo '
1127 1179
 		<div class="information">', $txt['showPermissions_all'], '</div>';
1128
-	}
1129
-	else
1180
+	} else
1130 1181
 	{
1131 1182
 		echo '
1132 1183
 		<div class="information">',$txt['showPermissions_help'], '</div>
@@ -1141,9 +1192,10 @@  discard block
 block discarded – undo
1141 1192
 			<div class="windowbg smalltext">
1142 1193
 				', $txt['showPermissions_restricted_boards_desc'], ':<br>';
1143 1194
 
1144
-			foreach ($context['no_access_boards'] as $no_access_board)
1145
-				echo '
1195
+			foreach ($context['no_access_boards'] as $no_access_board) {
1196
+							echo '
1146 1197
 				<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
1198
+			}
1147 1199
 			echo '
1148 1200
 			</div>';
1149 1201
 		}
@@ -1175,12 +1227,13 @@  discard block
 block discarded – undo
1175 1227
 							</td>
1176 1228
 							<td class="smalltext">';
1177 1229
 
1178
-				if ($permission['is_denied'])
1179
-					echo '
1230
+				if ($permission['is_denied']) {
1231
+									echo '
1180 1232
 								<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1181
-				else
1182
-					echo '
1233
+				} else {
1234
+									echo '
1183 1235
 								', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
1236
+				}
1184 1237
 
1185 1238
 				echo '
1186 1239
 							</td>
@@ -1191,10 +1244,10 @@  discard block
 block discarded – undo
1191 1244
 				</table>
1192 1245
 			</div><!-- .tborder -->
1193 1246
 			<br>';
1194
-		}
1195
-		else
1196
-			echo '
1247
+		} else {
1248
+					echo '
1197 1249
 			<p class="windowbg2">', $txt['showPermissions_none_general'], '</p>';
1250
+		}
1198 1251
 
1199 1252
 		// Board permission section.
1200 1253
 		echo '
@@ -1204,14 +1257,16 @@  discard block
 block discarded – undo
1204 1257
 						<a id="board_permissions"></a>', $txt['showPermissions_select'], ':
1205 1258
 						<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
1206 1259
 							<option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
1207
-		if (!empty($context['boards']))
1208
-			echo '
1260
+		if (!empty($context['boards'])) {
1261
+					echo '
1209 1262
 							<option value="" disabled>---------------------------</option>';
1263
+		}
1210 1264
 
1211 1265
 		// Fill the box with any local permission boards.
1212
-		foreach ($context['boards'] as $board)
1213
-			echo '
1266
+		foreach ($context['boards'] as $board) {
1267
+					echo '
1214 1268
 							<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
1269
+		}
1215 1270
 
1216 1271
 		echo '
1217 1272
 						</select>
@@ -1242,8 +1297,7 @@  discard block
 block discarded – undo
1242 1297
 				{
1243 1298
 					echo '
1244 1299
 							<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1245
-				}
1246
-				else
1300
+				} else
1247 1301
 				{
1248 1302
 					echo '
1249 1303
 							', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
@@ -1255,10 +1309,10 @@  discard block
 block discarded – undo
1255 1309
 			echo '
1256 1310
 				</tbody>
1257 1311
 			</table>';
1258
-		}
1259
-		else
1260
-			echo '
1312
+		} else {
1313
+					echo '
1261 1314
 			<p class="windowbg2">', $txt['showPermissions_none_board'], '</p>';
1315
+		}
1262 1316
 	echo '
1263 1317
 		</div><!-- #permissions -->';
1264 1318
 	}
@@ -1299,9 +1353,10 @@  discard block
 block discarded – undo
1299 1353
 			</div>';
1300 1354
 
1301 1355
 	// If they haven't post at all, don't draw the graph.
1302
-	if (empty($context['posts_by_time']))
1303
-		echo '
1356
+	if (empty($context['posts_by_time'])) {
1357
+			echo '
1304 1358
 			<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1359
+	}
1305 1360
 	// Otherwise do!
1306 1361
 	else
1307 1362
 	{
@@ -1339,11 +1394,10 @@  discard block
 block discarded – undo
1339 1394
 					</h3>
1340 1395
 				</div>';
1341 1396
 
1342
-	if (empty($context['popular_boards']))
1343
-		echo '
1397
+	if (empty($context['popular_boards'])) {
1398
+			echo '
1344 1399
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1345
-
1346
-	else
1400
+	} else
1347 1401
 	{
1348 1402
 		echo '
1349 1403
 				<dl class="stats">';
@@ -1373,10 +1427,10 @@  discard block
 block discarded – undo
1373 1427
 					</h3>
1374 1428
 				</div>';
1375 1429
 
1376
-	if (empty($context['board_activity']))
1377
-		echo '
1430
+	if (empty($context['board_activity'])) {
1431
+			echo '
1378 1432
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1379
-	else
1433
+	} else
1380 1434
 	{
1381 1435
 		echo '
1382 1436
 				<dl class="stats">';
@@ -1427,41 +1481,46 @@  discard block
 block discarded – undo
1427 1481
 				<h3 class="catbg profile_hd">';
1428 1482
 
1429 1483
 		// Don't say "Profile" if this isn't the profile...
1430
-		if (!empty($context['profile_header_text']))
1431
-			echo '
1484
+		if (!empty($context['profile_header_text'])) {
1485
+					echo '
1432 1486
 					', $context['profile_header_text'];
1433
-		else
1434
-			echo '
1487
+		} else {
1488
+					echo '
1435 1489
 					', $txt['profile'];
1490
+		}
1436 1491
 
1437 1492
 		echo '
1438 1493
 				</h3>
1439 1494
 			</div>';
1440 1495
 
1441 1496
 	// Have we some description?
1442
-	if ($context['page_desc'])
1443
-		echo '
1497
+	if ($context['page_desc']) {
1498
+			echo '
1444 1499
 			<p class="information">', $context['page_desc'], '</p>';
1500
+	}
1445 1501
 
1446 1502
 	echo '
1447 1503
 			<div class="roundframe">';
1448 1504
 
1449 1505
 	// Any bits at the start?
1450
-	if (!empty($context['profile_prehtml']))
1451
-		echo '
1506
+	if (!empty($context['profile_prehtml'])) {
1507
+			echo '
1452 1508
 				<div>', $context['profile_prehtml'], '</div>';
1509
+	}
1453 1510
 
1454
-	if (!empty($context['profile_fields']))
1455
-		echo '
1511
+	if (!empty($context['profile_fields'])) {
1512
+			echo '
1456 1513
 				<dl class="settings">';
1514
+	}
1457 1515
 
1458 1516
 	// Start the big old loop 'of love.
1459 1517
 	$lastItem = 'hr';
1460 1518
 	foreach ($context['profile_fields'] as $key => $field)
1461 1519
 	{
1462 1520
 		// We add a little hack to be sure we never get more than one hr in a row!
1463
-		if ($lastItem == 'hr' && $field['type'] == 'hr')
1464
-			continue;
1521
+		if ($lastItem == 'hr' && $field['type'] == 'hr') {
1522
+					continue;
1523
+		}
1465 1524
 
1466 1525
 		$lastItem = $field['type'];
1467 1526
 		if ($field['type'] == 'hr')
@@ -1470,48 +1529,50 @@  discard block
 block discarded – undo
1470 1529
 				</dl>
1471 1530
 				<hr>
1472 1531
 				<dl class="settings">';
1473
-		}
1474
-		elseif ($field['type'] == 'callback')
1532
+		} elseif ($field['type'] == 'callback')
1475 1533
 		{
1476 1534
 			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
1477 1535
 			{
1478 1536
 				$callback_func = 'template_profile_' . $field['callback_func'];
1479 1537
 				$callback_func();
1480 1538
 			}
1481
-		}
1482
-		else
1539
+		} else
1483 1540
 		{
1484 1541
 			echo '
1485 1542
 					<dt>
1486 1543
 						<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
1487 1544
 
1488 1545
 			// Does it have any subtext to show?
1489
-			if (!empty($field['subtext']))
1490
-				echo '
1546
+			if (!empty($field['subtext'])) {
1547
+							echo '
1491 1548
 						<br>
1492 1549
 						<span class="smalltext">', $field['subtext'], '</span>';
1550
+			}
1493 1551
 
1494 1552
 			echo '
1495 1553
 					</dt>
1496 1554
 					<dd>';
1497 1555
 
1498 1556
 			// Want to put something infront of the box?
1499
-			if (!empty($field['preinput']))
1500
-				echo '
1557
+			if (!empty($field['preinput'])) {
1558
+							echo '
1501 1559
 						', $field['preinput'];
1560
+			}
1502 1561
 
1503 1562
 			// What type of data are we showing?
1504
-			if ($field['type'] == 'label')
1505
-				echo '
1563
+			if ($field['type'] == 'label') {
1564
+							echo '
1506 1565
 						', $field['value'];
1566
+			}
1507 1567
 
1508 1568
 			// Maybe it's a text box - very likely!
1509 1569
 			elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url')))
1510 1570
 			{
1511
-				if ($field['type'] == 'int' || $field['type'] == 'float')
1512
-					$type = 'number';
1513
-				else
1514
-					$type = $field['type'];
1571
+				if ($field['type'] == 'int' || $field['type'] == 'float') {
1572
+									$type = 'number';
1573
+				} else {
1574
+									$type = $field['type'];
1575
+				}
1515 1576
 				$step = $field['type'] == 'float' ? ' step="0.1"' : '';
1516 1577
 
1517 1578
 
@@ -1519,10 +1580,11 @@  discard block
 block discarded – undo
1519 1580
 						<input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' ', $step, '>';
1520 1581
 			}
1521 1582
 			// You "checking" me out? ;)
1522
-			elseif ($field['type'] == 'check')
1523
-				echo '
1583
+			elseif ($field['type'] == 'check') {
1584
+							echo '
1524 1585
 						<input type="hidden" name="', $key, '" value="0">
1525 1586
 						<input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>';
1587
+			}
1526 1588
 
1527 1589
 			// Always fun - select boxes!
1528 1590
 			elseif ($field['type'] == 'select')
@@ -1533,14 +1595,16 @@  discard block
 block discarded – undo
1533 1595
 				if (isset($field['options']))
1534 1596
 				{
1535 1597
 					// Is this some code to generate the options?
1536
-					if (!is_array($field['options']))
1537
-						$field['options'] = $field['options']();
1598
+					if (!is_array($field['options'])) {
1599
+											$field['options'] = $field['options']();
1600
+					}
1538 1601
 
1539 1602
 					// Assuming we now have some!
1540
-					if (is_array($field['options']))
1541
-						foreach ($field['options'] as $value => $name)
1603
+					if (is_array($field['options'])) {
1604
+											foreach ($field['options'] as $value => $name)
1542 1605
 							echo '
1543 1606
 							<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
1607
+					}
1544 1608
 				}
1545 1609
 
1546 1610
 				echo '
@@ -1548,25 +1612,28 @@  discard block
 block discarded – undo
1548 1612
 			}
1549 1613
 
1550 1614
 			// Something to end with?
1551
-			if (!empty($field['postinput']))
1552
-				echo '
1615
+			if (!empty($field['postinput'])) {
1616
+							echo '
1553 1617
 						', $field['postinput'];
1618
+			}
1554 1619
 
1555 1620
 			echo '
1556 1621
 					</dd>';
1557 1622
 		}
1558 1623
 	}
1559 1624
 
1560
-	if (!empty($context['profile_fields']))
1561
-		echo '
1625
+	if (!empty($context['profile_fields'])) {
1626
+			echo '
1562 1627
 				</dl>';
1628
+	}
1563 1629
 
1564 1630
 	// Are there any custom profile fields - if so print them!
1565 1631
 	if (!empty($context['custom_fields']))
1566 1632
 	{
1567
-		if ($lastItem != 'hr')
1568
-			echo '
1633
+		if ($lastItem != 'hr') {
1634
+					echo '
1569 1635
 				<hr>';
1636
+		}
1570 1637
 
1571 1638
 		echo '
1572 1639
 				<dl class="settings">';
@@ -1589,13 +1656,14 @@  discard block
 block discarded – undo
1589 1656
 	}
1590 1657
 
1591 1658
 	// Any closing HTML?
1592
-	if (!empty($context['profile_posthtml']))
1593
-		echo '
1659
+	if (!empty($context['profile_posthtml'])) {
1660
+			echo '
1594 1661
 				<div>', $context['profile_posthtml'], '</div>';
1662
+	}
1595 1663
 
1596 1664
 	// Only show the password box if it's actually needed.
1597
-	if ($context['require_password'])
1598
-		echo '
1665
+	if ($context['require_password']) {
1666
+			echo '
1599 1667
 				<dl class="settings">
1600 1668
 					<dt>
1601 1669
 						<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br>
@@ -1605,18 +1673,21 @@  discard block
 block discarded – undo
1605 1673
 						<input type="password" name="oldpasswrd" id="oldpasswrd" size="20">
1606 1674
 					</dd>
1607 1675
 				</dl>';
1676
+	}
1608 1677
 
1609 1678
 	// The button shouldn't say "Change profile" unless we're changing the profile...
1610
-	if (!empty($context['submit_button_text']))
1611
-		echo '
1679
+	if (!empty($context['submit_button_text'])) {
1680
+			echo '
1612 1681
 				<input type="submit" name="save" value="', $context['submit_button_text'], '" class="button">';
1613
-	else
1614
-		echo '
1682
+	} else {
1683
+			echo '
1615 1684
 				<input type="submit" name="save" value="', $txt['change_profile'], '" class="button">';
1685
+	}
1616 1686
 
1617
-	if (!empty($context['token_check']))
1618
-		echo '
1687
+	if (!empty($context['token_check'])) {
1688
+			echo '
1619 1689
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
1690
+	}
1620 1691
 
1621 1692
 	echo '
1622 1693
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1626,10 +1697,11 @@  discard block
 block discarded – undo
1626 1697
 		</form>';
1627 1698
 
1628 1699
 	// Any final spellchecking stuff?
1629
-	if (!empty($context['show_spellchecking']))
1630
-		echo '
1700
+	if (!empty($context['show_spellchecking'])) {
1701
+			echo '
1631 1702
 		<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>';
1632
-}
1703
+	}
1704
+	}
1633 1705
 
1634 1706
 /**
1635 1707
  * Personal Message settings.
@@ -1666,10 +1738,11 @@  discard block
 block discarded – undo
1666 1738
 						<select name="pm_receive_from" id="pm_receive_from">
1667 1739
 							<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
1668 1740
 
1669
-	if (!empty($modSettings['enable_buddylist']))
1670
-		echo '
1741
+	if (!empty($modSettings['enable_buddylist'])) {
1742
+			echo '
1671 1743
 							<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option>
1672 1744
 							<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
1745
+	}
1673 1746
 
1674 1747
 	echo '
1675 1748
 							<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option>
@@ -1712,11 +1785,12 @@  discard block
 block discarded – undo
1712 1785
 		if (empty($setting) || !is_array($setting))
1713 1786
 		{
1714 1787
 			// Insert a separator (unless this is the first item in the list)
1715
-			if ($i !== $first_option_key)
1716
-				echo '
1788
+			if ($i !== $first_option_key) {
1789
+							echo '
1717 1790
 				</dl>
1718 1791
 				<hr>
1719 1792
 				<dl class="settings">';
1793
+			}
1720 1794
 
1721 1795
 			// Should we give a name to this section?
1722 1796
 			if (is_string($setting) && !empty($setting))
@@ -1725,52 +1799,57 @@  discard block
 block discarded – undo
1725 1799
 				echo '
1726 1800
 					<dt><strong>' . $setting . '</strong></dt>
1727 1801
 					<dd></dd>';
1802
+			} else {
1803
+							$titled_section = false;
1728 1804
 			}
1729
-			else
1730
-				$titled_section = false;
1731 1805
 
1732 1806
 			continue;
1733 1807
 		}
1734 1808
 
1735 1809
 		// Is this disabled?
1736
-		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled']))
1737
-			continue;
1738
-		elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage']))
1739
-			continue;
1740
-		elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored']))
1741
-			continue;
1742
-		elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist']))
1743
-			continue;
1744
-		elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg']))
1745
-			continue;
1746
-		elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1747
-			continue;
1748
-		elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1749
-			continue;
1810
+		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) {
1811
+					continue;
1812
+		} elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) {
1813
+					continue;
1814
+		} elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) {
1815
+					continue;
1816
+		} elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) {
1817
+					continue;
1818
+		} elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) {
1819
+					continue;
1820
+		} elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1821
+					continue;
1822
+		} elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1823
+					continue;
1824
+		}
1750 1825
 
1751 1826
 		// Some of these may not be set...  Set to defaults here
1752 1827
 		$opts = array('topics_per_page', 'messages_per_page', 'display_quick_mod');
1753
-		if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']]))
1754
-			$context['member']['options'][$setting['id']] = 0;
1828
+		if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']])) {
1829
+					$context['member']['options'][$setting['id']] = 0;
1830
+		}
1755 1831
 
1756
-		if (!isset($setting['type']) || $setting['type'] == 'bool')
1757
-			$setting['type'] = 'checkbox';
1758
-		elseif ($setting['type'] == 'int' || $setting['type'] == 'integer')
1759
-			$setting['type'] = 'number';
1760
-		elseif ($setting['type'] == 'string')
1761
-			$setting['type'] = 'text';
1832
+		if (!isset($setting['type']) || $setting['type'] == 'bool') {
1833
+					$setting['type'] = 'checkbox';
1834
+		} elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') {
1835
+					$setting['type'] = 'number';
1836
+		} elseif ($setting['type'] == 'string') {
1837
+					$setting['type'] = 'text';
1838
+		}
1762 1839
 
1763
-		if (isset($setting['options']))
1764
-			$setting['type'] = 'list';
1840
+		if (isset($setting['options'])) {
1841
+					$setting['type'] = 'list';
1842
+		}
1765 1843
 
1766 1844
 		echo '
1767 1845
 					<dt>
1768 1846
 						<label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>';
1769 1847
 
1770
-		if (isset($setting['description']))
1771
-			echo '
1848
+		if (isset($setting['description'])) {
1849
+					echo '
1772 1850
 						<br>
1773 1851
 						<span class="smalltext">', $setting['description'], '</span>';
1852
+		}
1774 1853
 		echo '
1775 1854
 					</dt>
1776 1855
 					<dd>';
@@ -1808,13 +1887,11 @@  discard block
 block discarded – undo
1808 1887
 
1809 1888
 				echo '
1810 1889
 						<input type="number"', $min . $max . $step;
1811
-			}
1812
-			else if (isset($setting['type']) && $setting['type'] == 'url')
1890
+			} else if (isset($setting['type']) && $setting['type'] == 'url')
1813 1891
 			{
1814 1892
 				echo'
1815 1893
 						<input type="url"';
1816
-			}
1817
-			else
1894
+			} else
1818 1895
 			{
1819 1896
 				echo '
1820 1897
 						<input type="text"';
@@ -1855,8 +1932,8 @@  discard block
 block discarded – undo
1855 1932
 				<dl class="settings">';
1856 1933
 
1857 1934
 	// Allow notification on announcements to be disabled?
1858
-	if (!empty($modSettings['allow_disableAnnounce']))
1859
-		echo '
1935
+	if (!empty($modSettings['allow_disableAnnounce'])) {
1936
+			echo '
1860 1937
 					<dt>
1861 1938
 						<label for="notify_announcements">', $txt['notify_important_email'], '</label>
1862 1939
 					</dt>
@@ -1864,15 +1941,17 @@  discard block
 block discarded – undo
1864 1941
 						<input type="hidden" name="notify_announcements" value="0">
1865 1942
 						<input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', '>
1866 1943
 					</dd>';
1944
+	}
1867 1945
 
1868
-	if (!empty($modSettings['enable_ajax_alerts']))
1869
-		echo '
1946
+	if (!empty($modSettings['enable_ajax_alerts'])) {
1947
+			echo '
1870 1948
 					<dt>
1871 1949
 						<label for="notify_send_body">', $txt['notify_alert_timeout'], '</label>
1872 1950
 					</dt>
1873 1951
 					<dd>
1874 1952
 						<input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '">
1875 1953
 					</dd>';
1954
+	}
1876 1955
 
1877 1956
 	echo '
1878 1957
 				</dl>
@@ -1902,9 +1981,10 @@  discard block
 block discarded – undo
1902 1981
 					<td colspan="3">';
1903 1982
 				$label = $txt['alert_opt_' . $opts[1]];
1904 1983
 				$label_pos = isset($opts['label']) ? $opts['label'] : '';
1905
-				if ($label_pos == 'before')
1906
-					echo '
1984
+				if ($label_pos == 'before') {
1985
+									echo '
1907 1986
 						<label for="opt_', $opts[1], '">', $label, '</label>';
1987
+				}
1908 1988
 
1909 1989
 				$this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0;
1910 1990
 				switch ($opts[0])
@@ -1916,17 +1996,19 @@  discard block
 block discarded – undo
1916 1996
 					case 'select':
1917 1997
 						echo '
1918 1998
 						<select name="opt_', $opts[1], '" id="opt_', $opts[1], '">';
1919
-						foreach ($opts['opts'] as $k => $v)
1920
-							echo '
1999
+						foreach ($opts['opts'] as $k => $v) {
2000
+													echo '
1921 2001
 							<option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>';
2002
+						}
1922 2003
 						echo '
1923 2004
 						</select>';
1924 2005
 						break;
1925 2006
 				}
1926 2007
 
1927
-				if ($label_pos == 'after')
1928
-					echo '
2008
+				if ($label_pos == 'after') {
2009
+									echo '
1929 2010
 						<label for="opt_', $opts[1], '">', $label, '</label>';
2011
+				}
1930 2012
 
1931 2013
 				echo '
1932 2014
 					</td>
@@ -2042,11 +2124,12 @@  discard block
 block discarded – undo
2042 2124
 			<p class="information">', $txt['groupMembership_info'], '</p>';
2043 2125
 
2044 2126
 	// Do we have an update message?
2045
-	if (!empty($context['update_message']))
2046
-		echo '
2127
+	if (!empty($context['update_message'])) {
2128
+			echo '
2047 2129
 			<div class="infobox">
2048 2130
 				', $context['update_message'], '.
2049 2131
 			</div>';
2132
+	}
2050 2133
 
2051 2134
 	echo '
2052 2135
 			<div id="groups">';
@@ -2068,8 +2151,7 @@  discard block
 block discarded – undo
2068 2151
 						</div>
2069 2152
 					</div>
2070 2153
 				</div><!-- .groupmembership -->';
2071
-	}
2072
-	else
2154
+	} else
2073 2155
 	{
2074 2156
 		echo '
2075 2157
 				<div class="title_bar">
@@ -2081,27 +2163,30 @@  discard block
 block discarded – undo
2081 2163
 			echo '
2082 2164
 				<div class="windowbg" id="primdiv_', $group['id'], '">';
2083 2165
 
2084
-				if ($context['can_edit_primary'])
2085
-					echo '
2166
+				if ($context['can_edit_primary']) {
2167
+									echo '
2086 2168
 					<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', '>';
2169
+				}
2087 2170
 
2088 2171
 				echo '
2089 2172
 					<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>';
2090 2173
 
2091 2174
 				// Can they leave their group?
2092
-				if ($group['can_leave'])
2093
-					echo '
2175
+				if ($group['can_leave']) {
2176
+									echo '
2094 2177
 					<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>';
2178
+				}
2095 2179
 
2096 2180
 				echo '
2097 2181
 				</div><!-- .windowbg -->';
2098 2182
 		}
2099 2183
 
2100
-		if ($context['can_edit_primary'])
2101
-			echo '
2184
+		if ($context['can_edit_primary']) {
2185
+					echo '
2102 2186
 				<div class="padding righttext">
2103 2187
 					<input type="submit" value="', $txt['make_primary'], '" class="button">
2104 2188
 				</div>';
2189
+		}
2105 2190
 
2106 2191
 		// Any groups they can join?
2107 2192
 		if (!empty($context['groups']['available']))
@@ -2117,15 +2202,16 @@  discard block
 block discarded – undo
2117 2202
 				<div class="windowbg">
2118 2203
 					<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>' : ''), '';
2119 2204
 
2120
-				if ($group['type'] == 3)
2121
-					echo '
2205
+				if ($group['type'] == 3) {
2206
+									echo '
2122 2207
 					<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>';
2123
-				elseif ($group['type'] == 2 && $group['pending'])
2124
-					echo '
2208
+				} elseif ($group['type'] == 2 && $group['pending']) {
2209
+									echo '
2125 2210
 					<span class="floatright">', $txt['approval_pending'], '</span>';
2126
-				elseif ($group['type'] == 2)
2127
-					echo '
2211
+				} elseif ($group['type'] == 2) {
2212
+									echo '
2128 2213
 					<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
2214
+				}
2129 2215
 
2130 2216
 				echo '
2131 2217
 				</div><!-- .windowbg -->';
@@ -2148,9 +2234,10 @@  discard block
 block discarded – undo
2148 2234
 
2149 2235
 						prevDiv.className = "windowbg";
2150 2236
 					}';
2151
-		if (isset($context['groups']['member'][$context['primary_group']]))
2152
-			echo '
2237
+		if (isset($context['groups']['member'][$context['primary_group']])) {
2238
+					echo '
2153 2239
 					highlightSelected("primdiv_' . $context['primary_group'] . '");';
2240
+		}
2154 2241
 		echo '
2155 2242
 				</script>';
2156 2243
 	}
@@ -2158,9 +2245,10 @@  discard block
 block discarded – undo
2158 2245
 	echo '
2159 2246
 			</div><!-- #groups -->';
2160 2247
 
2161
-	if (!empty($context['token_check']))
2162
-		echo '
2248
+	if (!empty($context['token_check'])) {
2249
+			echo '
2163 2250
 			<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2251
+	}
2164 2252
 
2165 2253
 	echo '
2166 2254
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2208,14 +2296,15 @@  discard block
 block discarded – undo
2208 2296
 
2209 2297
 		foreach ($category['boards'] as $board)
2210 2298
 		{
2211
-			if ($i == $limit)
2212
-				echo '
2299
+			if ($i == $limit) {
2300
+							echo '
2213 2301
 						</ul>
2214 2302
 					</li>
2215 2303
 				</ul>
2216 2304
 				<ul class="ignoreboards floatright">
2217 2305
 					<li class="category">
2218 2306
 						<ul>';
2307
+			}
2219 2308
 
2220 2309
 			echo '
2221 2310
 							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
@@ -2261,10 +2350,11 @@  discard block
 block discarded – undo
2261 2350
 
2262 2351
 	// Work out the starting color.
2263 2352
 	$context['current_color'] = $context['colors'][0];
2264
-	foreach ($context['colors'] as $limit => $color)
2265
-		if ($context['member']['warning'] >= $limit)
2353
+	foreach ($context['colors'] as $limit => $color) {
2354
+			if ($context['member']['warning'] >= $limit)
2266 2355
 			$context['current_color'] = $color;
2267
-}
2356
+	}
2357
+	}
2268 2358
 
2269 2359
 // Show all warnings of a user?
2270 2360
 function template_viewWarning()
@@ -2303,14 +2393,15 @@  discard block
 block discarded – undo
2303 2393
 				</dd>';
2304 2394
 
2305 2395
 	// There's some impact of this?
2306
-	if (!empty($context['level_effects'][$context['current_level']]))
2307
-		echo '
2396
+	if (!empty($context['level_effects'][$context['current_level']])) {
2397
+			echo '
2308 2398
 				<dt>
2309 2399
 					<strong>', $txt['profile_viewwarning_impact'], ':</strong>
2310 2400
 				</dt>
2311 2401
 				<dd>
2312 2402
 					', $context['level_effects'][$context['current_level']], '
2313 2403
 				</dd>';
2404
+	}
2314 2405
 
2315 2406
 	echo '
2316 2407
 			</dl>
@@ -2348,10 +2439,11 @@  discard block
 block discarded – undo
2348 2439
 
2349 2440
 			// Otherwise see what we can do...';
2350 2441
 
2351
-	foreach ($context['notification_templates'] as $k => $type)
2352
-		echo '
2442
+	foreach ($context['notification_templates'] as $k => $type) {
2443
+			echo '
2353 2444
 			if (index == ', $k, ')
2354 2445
 				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
2446
+	}
2355 2447
 
2356 2448
 	echo '
2357 2449
 		}
@@ -2361,10 +2453,11 @@  discard block
 block discarded – undo
2361 2453
 			// Also set the right effect.
2362 2454
 			effectText = "";';
2363 2455
 
2364
-	foreach ($context['level_effects'] as $limit => $text)
2365
-		echo '
2456
+	foreach ($context['level_effects'] as $limit => $text) {
2457
+			echo '
2366 2458
 			if (slideAmount >= ', $limit, ')
2367 2459
 				effectText = "', $text, '";';
2460
+	}
2368 2461
 
2369 2462
 	echo '
2370 2463
 			setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\');
@@ -2379,32 +2472,35 @@  discard block
 block discarded – undo
2379 2472
 			</h3>
2380 2473
 		</div>';
2381 2474
 
2382
-	if (!$context['user']['is_owner'])
2383
-		echo '
2475
+	if (!$context['user']['is_owner']) {
2476
+			echo '
2384 2477
 		<p class="information">', $txt['profile_warning_desc'], '</p>';
2478
+	}
2385 2479
 
2386 2480
 	echo '
2387 2481
 		<div class="windowbg">
2388 2482
 			<dl class="settings">';
2389 2483
 
2390
-	if (!$context['user']['is_owner'])
2391
-		echo '
2484
+	if (!$context['user']['is_owner']) {
2485
+			echo '
2392 2486
 				<dt>
2393 2487
 					<strong>', $txt['profile_warning_name'], ':</strong>
2394 2488
 				</dt>
2395 2489
 				<dd>
2396 2490
 					<strong>', $context['member']['name'], '</strong>
2397 2491
 				</dd>';
2492
+	}
2398 2493
 
2399 2494
 	echo '
2400 2495
 				<dt>
2401 2496
 					<strong>', $txt['profile_warning_level'], ':</strong>';
2402 2497
 
2403 2498
 	// Is there only so much they can apply?
2404
-	if ($context['warning_limit'])
2405
-		echo '
2499
+	if ($context['warning_limit']) {
2500
+			echo '
2406 2501
 					<br>
2407 2502
 					<span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
2503
+	}
2408 2504
 
2409 2505
 	echo '
2410 2506
 				</dt>
@@ -2459,9 +2555,10 @@  discard block
 block discarded – undo
2459 2555
 						<option value="-1">', $txt['profile_warning_notify_template'], '</option>
2460 2556
 						<option value="-1" disabled>------------------------------</option>';
2461 2557
 
2462
-		foreach ($context['notification_templates'] as $id_template => $template)
2463
-			echo '
2558
+		foreach ($context['notification_templates'] as $id_template => $template) {
2559
+					echo '
2464 2560
 						<option value="', $id_template, '">', $template['title'], '</option>';
2561
+		}
2465 2562
 
2466 2563
 		echo '
2467 2564
 					</select>
@@ -2474,9 +2571,10 @@  discard block
 block discarded – undo
2474 2571
 			</dl>
2475 2572
 			<div class="righttext">';
2476 2573
 
2477
-	if (!empty($context['token_check']))
2478
-		echo '
2574
+	if (!empty($context['token_check'])) {
2575
+			echo '
2479 2576
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2577
+	}
2480 2578
 
2481 2579
 	echo '
2482 2580
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2492,8 +2590,8 @@  discard block
 block discarded – undo
2492 2590
 	echo '
2493 2591
 	<script>';
2494 2592
 
2495
-	if (!$context['user']['is_owner'])
2496
-		echo '
2593
+	if (!$context['user']['is_owner']) {
2594
+			echo '
2497 2595
 		modifyWarnNotify();
2498 2596
 		$(document).ready(function() {
2499 2597
 			$("#preview_button").click(function() {
@@ -2532,6 +2630,7 @@  discard block
 block discarded – undo
2532 2630
 			});
2533 2631
 			return false;
2534 2632
 		}';
2633
+	}
2535 2634
 
2536 2635
 	echo '
2537 2636
 	</script>';
@@ -2554,16 +2653,18 @@  discard block
 block discarded – undo
2554 2653
 			</div>';
2555 2654
 
2556 2655
 	// If deleting another account give them a lovely info box.
2557
-	if (!$context['user']['is_owner'])
2558
-		echo '
2656
+	if (!$context['user']['is_owner']) {
2657
+			echo '
2559 2658
 			<p class="information">', $txt['deleteAccount_desc'], '</p>';
2659
+	}
2560 2660
 	echo '
2561 2661
 			<div class="windowbg2">';
2562 2662
 
2563 2663
 	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
2564
-	if ($context['needs_approval'])
2565
-		echo '
2664
+	if ($context['needs_approval']) {
2665
+			echo '
2566 2666
 				<div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
2667
+	}
2567 2668
 
2568 2669
 	// If the user is deleting their own account warn them first - and require a password!
2569 2670
 	if ($context['user']['is_owner'])
@@ -2575,9 +2676,10 @@  discard block
 block discarded – undo
2575 2676
 					<input type="password" name="oldpasswrd" size="20">&nbsp;&nbsp;&nbsp;&nbsp;
2576 2677
 					<input type="submit" value="', $txt['yes'], '" class="button">';
2577 2678
 
2578
-		if (!empty($context['token_check']))
2579
-			echo '
2679
+		if (!empty($context['token_check'])) {
2680
+					echo '
2580 2681
 					<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2682
+		}
2581 2683
 
2582 2684
 		echo '
2583 2685
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2607,10 +2709,11 @@  discard block
 block discarded – undo
2607 2709
 						<option value="topics">', $txt['deleteAccount_topics'], '</option>
2608 2710
 					</select>';
2609 2711
 
2610
-			if ($context['show_perma_delete'])
2611
-				echo '
2712
+			if ($context['show_perma_delete']) {
2713
+							echo '
2612 2714
 					<br>
2613 2715
 					<label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1">', $txt['deleteAccount_permanent'], ':</label>';
2716
+			}
2614 2717
 
2615 2718
 			echo '
2616 2719
 				</div>';
@@ -2623,9 +2726,10 @@  discard block
 block discarded – undo
2623 2726
 				<div>
2624 2727
 					<input type="submit" value="', $txt['delete'], '" class="button">';
2625 2728
 
2626
-		if (!empty($context['token_check']))
2627
-			echo '
2729
+		if (!empty($context['token_check'])) {
2730
+					echo '
2628 2731
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2732
+		}
2629 2733
 
2630 2734
 		echo '
2631 2735
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2651,8 +2755,8 @@  discard block
 block discarded – undo
2651 2755
 					<hr>';
2652 2756
 
2653 2757
 	// Only show the password box if it's actually needed.
2654
-	if ($context['require_password'])
2655
-		echo '
2758
+	if ($context['require_password']) {
2759
+			echo '
2656 2760
 					<dl class="settings">
2657 2761
 						<dt>
2658 2762
 							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br>
@@ -2662,13 +2766,15 @@  discard block
 block discarded – undo
2662 2766
 							<input type="password" name="oldpasswrd" size="20">
2663 2767
 						</dd>
2664 2768
 					</dl>';
2769
+	}
2665 2770
 
2666 2771
 	echo '
2667 2772
 					<div class="righttext">';
2668 2773
 
2669
-	if (!empty($context['token_check']))
2670
-		echo '
2774
+	if (!empty($context['token_check'])) {
2775
+			echo '
2671 2776
 						<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2777
+	}
2672 2778
 
2673 2779
 	echo '
2674 2780
 						<input type="submit" value="', $txt['change_profile'], '" class="button">
@@ -2695,9 +2801,10 @@  discard block
 block discarded – undo
2695 2801
 			<ul id="list_errors">';
2696 2802
 
2697 2803
 		// Cycle through each error and display an error message.
2698
-		foreach ($context['post_errors'] as $error)
2699
-			echo '
2804
+		foreach ($context['post_errors'] as $error) {
2805
+					echo '
2700 2806
 				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
2807
+		}
2701 2808
 
2702 2809
 		echo '
2703 2810
 			</ul>';
@@ -2723,12 +2830,13 @@  discard block
 block discarded – undo
2723 2830
 								<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;"' : ''), '>';
2724 2831
 
2725 2832
 	// Fill the select box with all primary member groups that can be assigned to a member.
2726
-	foreach ($context['member_groups'] as $member_group)
2727
-		if (!empty($member_group['can_be_primary']))
2833
+	foreach ($context['member_groups'] as $member_group) {
2834
+			if (!empty($member_group['can_be_primary']))
2728 2835
 			echo '
2729 2836
 									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '>
2730 2837
 										', $member_group['name'], '
2731 2838
 									</option>';
2839
+	}
2732 2840
 	echo '
2733 2841
 								</select>
2734 2842
 							</dd>
@@ -2740,10 +2848,11 @@  discard block
 block discarded – undo
2740 2848
 									<input type="hidden" name="additional_groups[]" value="0">';
2741 2849
 
2742 2850
 	// For each membergroup show a checkbox so members can be assigned to more than one group.
2743
-	foreach ($context['member_groups'] as $member_group)
2744
-		if ($member_group['can_be_additional'])
2851
+	foreach ($context['member_groups'] as $member_group) {
2852
+			if ($member_group['can_be_additional'])
2745 2853
 			echo '
2746 2854
 									<label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked' : '', '> ', $member_group['name'], '</label><br>';
2855
+	}
2747 2856
 	echo '
2748 2857
 								</span>
2749 2858
 								<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>
@@ -2803,9 +2912,10 @@  discard block
 block discarded – undo
2803 2912
 								<span class="smalltext">', $txt['sig_info'], '</span><br>
2804 2913
 								<br>';
2805 2914
 
2806
-	if ($context['show_spellchecking'])
2807
-		echo '
2915
+	if ($context['show_spellchecking']) {
2916
+			echo '
2808 2917
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button">';
2918
+	}
2809 2919
 
2810 2920
 		echo '
2811 2921
 							</dt>
@@ -2813,17 +2923,20 @@  discard block
 block discarded – undo
2813 2923
 								<textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br>';
2814 2924
 
2815 2925
 	// If there is a limit at all!
2816
-	if (!empty($context['signature_limits']['max_length']))
2817
-		echo '
2926
+	if (!empty($context['signature_limits']['max_length'])) {
2927
+			echo '
2818 2928
 								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>';
2929
+	}
2819 2930
 
2820
-	if (!empty($context['show_preview_button']))
2821
-		echo '
2931
+	if (!empty($context['show_preview_button'])) {
2932
+			echo '
2822 2933
 								<input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button">';
2934
+	}
2823 2935
 
2824
-	if ($context['signature_warning'])
2825
-		echo '
2936
+	if ($context['signature_warning']) {
2937
+			echo '
2826 2938
 								<span class="smalltext">', $context['signature_warning'], '</span>';
2939
+	}
2827 2940
 
2828 2941
 	// Some javascript used to count how many characters have been used so far in the signature.
2829 2942
 	echo '
@@ -2868,9 +2981,10 @@  discard block
 block discarded – undo
2868 2981
 										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
2869 2982
 
2870 2983
 		// This lists all the file categories.
2871
-		foreach ($context['avatars'] as $avatar)
2872
-			echo '
2984
+		foreach ($context['avatars'] as $avatar) {
2985
+					echo '
2873 2986
 											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>';
2987
+		}
2874 2988
 		echo '
2875 2989
 										</select>
2876 2990
 									</div>
@@ -2927,16 +3041,17 @@  discard block
 block discarded – undo
2927 3041
 								<div id="avatar_gravatar">
2928 3042
 									<img src="' . $context['member']['avatar']['href'] . '" alt="" />';
2929 3043
 
2930
-		if (empty($modSettings['gravatarAllowExtraEmail']))
2931
-			echo '
3044
+		if (empty($modSettings['gravatarAllowExtraEmail'])) {
3045
+					echo '
2932 3046
 									<div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>';
2933
-		else
3047
+		} else
2934 3048
 		{
2935 3049
 			// Depending on other stuff, the stored value here might have some odd things in it from other areas.
2936
-			if ($context['member']['avatar']['external'] == $context['member']['email'])
2937
-				$textbox_value = '';
2938
-			else
2939
-				$textbox_value = $context['member']['avatar']['external'];
3050
+			if ($context['member']['avatar']['external'] == $context['member']['email']) {
3051
+							$textbox_value = '';
3052
+			} else {
3053
+							$textbox_value = $context['member']['avatar']['external'];
3054
+			}
2940 3055
 
2941 3056
 			echo '
2942 3057
 									<div class="smalltext">', $txt['gravatar_alternateEmail'], '</div>
@@ -3008,8 +3123,9 @@  discard block
 block discarded – undo
3008 3123
 	$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
3009 3124
 
3010 3125
 	$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
3011
-	if (empty($suffix))
3012
-		return;
3126
+	if (empty($suffix)) {
3127
+			return;
3128
+	}
3013 3129
 
3014 3130
 	echo '
3015 3131
 								<div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>';
@@ -3034,9 +3150,10 @@  discard block
 block discarded – undo
3034 3150
 								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;">';
3035 3151
 
3036 3152
 	// Help the user by showing a list of common time formats.
3037
-	foreach ($context['easy_timeformats'] as $time_format)
3038
-		echo '
3153
+	foreach ($context['easy_timeformats'] as $time_format) {
3154
+			echo '
3039 3155
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3156
+	}
3040 3157
 	echo '
3041 3158
 								</select><br>
3042 3159
 								<input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30">
@@ -3073,9 +3190,10 @@  discard block
 block discarded – undo
3073 3190
 							<dd>
3074 3191
 								<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\';">';
3075 3192
 
3076
-	foreach ($context['smiley_sets'] as $set)
3077
-		echo '
3193
+	foreach ($context['smiley_sets'] as $set) {
3194
+			echo '
3078 3195
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>';
3196
+	}
3079 3197
 	echo '
3080 3198
 								</select>
3081 3199
 								<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=":)">
@@ -3126,10 +3244,11 @@  discard block
 block discarded – undo
3126 3244
 										<img src="', $context['tfa_qr_url'], '" alt="">
3127 3245
 									</div>';
3128 3246
 
3129
-	if (!empty($context['from_ajax']))
3130
-		echo '
3247
+	if (!empty($context['from_ajax'])) {
3248
+			echo '
3131 3249
 					<br>
3132 3250
 					<a href="javascript:self.close();"></a>';
3251
+	}
3133 3252
 
3134 3253
 	echo '
3135 3254
 				</div>
@@ -3168,15 +3287,16 @@  discard block
 block discarded – undo
3168 3287
 								<div class="smalltext">', $txt['tfa_profile_desc'], '</div>
3169 3288
 							</dt>
3170 3289
 							<dd>';
3171
-	if (!$context['tfa_enabled'] && $context['user']['is_owner'])
3172
-		echo '
3290
+	if (!$context['tfa_enabled'] && $context['user']['is_owner']) {
3291
+			echo '
3173 3292
 								<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>';
3174
-	elseif (!$context['tfa_enabled'])
3175
-		echo '
3293
+	} elseif (!$context['tfa_enabled']) {
3294
+			echo '
3176 3295
 								', $txt['tfa_profile_disabled'];
3177
-	else
3178
-		echo '
3296
+	} else {
3297
+			echo '
3179 3298
 							', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable');
3299
+	}
3180 3300
 	echo '
3181 3301
 							</dd>';
3182 3302
 }
Please login to merge, or discard this patch.
Themes/default/ManageBans.template.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -26,9 +26,10 @@  discard block
 block discarded – undo
26 26
 				</h3>
27 27
 			</div>';
28 28
 
29
-	if ($context['ban']['is_new'])
30
-		echo '
29
+	if ($context['ban']['is_new']) {
30
+			echo '
31 31
 			<div class="information noup">', $txt['ban_add_notes'], '</div>';
32
+	}
32 33
 
33 34
 	// If there were errors creating the ban, show them.
34 35
 	if (!empty($context['error_messages']))
@@ -38,9 +39,10 @@  discard block
 block discarded – undo
38 39
 				<strong>', $txt['ban_errors_detected'], '</strong>
39 40
 				<ul>';
40 41
 
41
-		foreach ($context['error_messages'] as $error)
42
-			echo '
42
+		foreach ($context['error_messages'] as $error) {
43
+					echo '
43 44
 					<li class="error">', $error, '</li>';
45
+		}
44 46
 
45 47
 		echo '
46 48
 				</ul>
@@ -57,8 +59,8 @@  discard block
 block discarded – undo
57 59
 						<input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60">
58 60
 					</dd>';
59 61
 
60
-	if (isset($context['ban']['reason']))
61
-		echo '
62
+	if (isset($context['ban']['reason'])) {
63
+			echo '
62 64
 					<dt>
63 65
 						<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br>
64 66
 						<span class="smalltext">', $txt['ban_reason_desc'], '</span>
@@ -66,9 +68,10 @@  discard block
 block discarded – undo
66 68
 					<dd>
67 69
 						<textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea>
68 70
 					</dd>';
71
+	}
69 72
 
70
-	if (isset($context['ban']['notes']))
71
-		echo '
73
+	if (isset($context['ban']['notes'])) {
74
+			echo '
72 75
 					<dt>
73 76
 						<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br>
74 77
 						<span class="smalltext">', $txt['ban_notes_desc'], '</span>
@@ -76,6 +79,7 @@  discard block
 block discarded – undo
76 79
 					<dd>
77 80
 						<textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea>
78 81
 					</dd>';
82
+	}
79 83
 
80 84
 	echo '
81 85
 				</dl>
@@ -115,8 +119,8 @@  discard block
 block discarded – undo
115 119
 							<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;">
116 120
 						</dd>';
117 121
 
118
-		if (empty($modSettings['disableHostnameLookup']))
119
-			echo '
122
+		if (empty($modSettings['disableHostnameLookup'])) {
123
+					echo '
120 124
 						<dt>
121 125
 							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '>
122 126
 							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
@@ -124,6 +128,7 @@  discard block
 block discarded – undo
124 128
 						<dd>
125 129
 							<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;">
126 130
 						</dd>';
131
+		}
127 132
 
128 133
 		echo '
129 134
 						<dt>
@@ -153,14 +158,15 @@  discard block
 block discarded – undo
153 158
 					<dl class="settings">';
154 159
 
155 160
 					$count = 0;
156
-					foreach ($ban_ips as $ip)
157
-						echo '
161
+					foreach ($ban_ips as $ip) {
162
+											echo '
158 163
 						<dt>
159 164
 							<input type="checkbox" id="suggestions_', $key, '_', $count, '" name="ban_suggestions[', $key, '][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '">
160 165
 						</dt>
161 166
 						<dd>
162 167
 							<label for="suggestions_', $key, '_', $count++, '">', $ip, '</label>
163 168
 						</dd>';
169
+					}
164 170
 
165 171
 					echo '
166 172
 					</dl>';
@@ -202,8 +208,8 @@  discard block
 block discarded – undo
202 208
 		addLoadEvent(fUpdateStatus);';
203 209
 
204 210
 	// Auto suggest only needed for adding new bans, not editing
205
-	if ($context['ban']['is_new'] && empty($_REQUEST['u']))
206
-		echo '
211
+	if ($context['ban']['is_new'] && empty($_REQUEST['u'])) {
212
+			echo '
207 213
 		var oAddMemberSuggest = new smc_AutoSuggest({
208 214
 			sSelf: \'oAddMemberSuggest\',
209 215
 			sSessionId: smf_session_id,
@@ -221,6 +227,7 @@  discard block
 block discarded – undo
221 227
 			return true;
222 228
 		}
223 229
 		oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');';
230
+	}
224 231
 
225 232
 	echo '
226 233
 		function confirmBan(aForm)
@@ -269,8 +276,8 @@  discard block
 block discarded – undo
269 276
 							<input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;">
270 277
 						</dd>';
271 278
 
272
-	if (empty($modSettings['disableHostnameLookup']))
273
-		echo '
279
+	if (empty($modSettings['disableHostnameLookup'])) {
280
+			echo '
274 281
 						<dt>
275 282
 							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '>
276 283
 							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
@@ -278,6 +285,7 @@  discard block
 block discarded – undo
278 285
 						<dd>
279 286
 							<input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;">
280 287
 						</dd>';
288
+	}
281 289
 
282 290
 	echo '
283 291
 						<dt>
Please login to merge, or discard this patch.