Completed
Push — release-2.1 ( e6c696...22bfba )
by Mathias
07:04
created
Themes/default/index.template.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 	// Show right to left, the language code, and the character set for ease of translating.
87 87
 	echo '<!DOCTYPE html>
88
-	<html', $context['right_to_left'] ? ' dir="rtl"' : '', !empty($txt['lang_locale']) ? ' lang="' . str_replace("_", "-", substr($txt['lang_locale'], 0, strcspn($txt['lang_locale'], "."))) . '"' : '' , '>
88
+	<html', $context['right_to_left'] ? ' dir="rtl"' : '', !empty($txt['lang_locale']) ? ' lang="' . str_replace("_", "-", substr($txt['lang_locale'], 0, strcspn($txt['lang_locale'], "."))) . '"' : '', '>
89 89
 <head>
90 90
 	<meta charset="', $context['character_set'], '">';
91 91
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		// Thirdly, alerts
211 211
 		echo '
212 212
 			<li>
213
-				<a href="', $scripturl, '?action=profile;area=showalerts;u=', $context['user']['id'] ,'"', !empty($context['self_alerts']) ? ' class="active"' : '', ' id="alerts_menu_top">', $txt['alerts'], !empty($context['user']['alerts']) ? ' <span class="amt">' . $context['user']['alerts'] . '</span>' : '', '</a>
213
+				<a href="', $scripturl, '?action=profile;area=showalerts;u=', $context['user']['id'], '"', !empty($context['self_alerts']) ? ' class="active"' : '', ' id="alerts_menu_top">', $txt['alerts'], !empty($context['user']['alerts']) ? ' <span class="amt">' . $context['user']['alerts'] . '</span>' : '', '</a>
214 214
 				<div id="alerts_menu" class="top_menu scrollable"></div>
215 215
 			</li>';
216 216
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				<a class="menu_icon mobile_user_menu"></a>
328 328
 				<div id="mobile_user_menu" class="popup_container">
329 329
 					<div class="popup_window description">
330
-						<div class="popup_heading">', $txt['mobile_user_menu'],'
330
+						<div class="popup_heading">', $txt['mobile_user_menu'], '
331 331
 						<a href="javascript:void(0);" class="generic_icons hide_popup"></a></div>
332 332
 						', template_menu(), '
333 333
 					</div>
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	// There is now a global "Go to top" link at the right.
375 375
 		echo '
376 376
 		<ul>
377
-			<li class="floatright"><a href="', $scripturl, '?action=help">', $txt['help'], '</a> ', (!empty($modSettings['requireAgreement'])) ? '| <a href="'. $scripturl. '?action=help;sa=rules">'. $txt['terms_and_rules']. '</a>' : '', ' | <a href="#top_section">', $txt['go_up'], ' &#9650;</a></li>
377
+			<li class="floatright"><a href="', $scripturl, '?action=help">', $txt['help'], '</a> ', (!empty($modSettings['requireAgreement'])) ? '| <a href="' . $scripturl . '?action=help;sa=rules">' . $txt['terms_and_rules'] . '</a>' : '', ' | <a href="#top_section">', $txt['go_up'], ' &#9650;</a></li>
378 378
 			<li class="copyright">', theme_copyright(), '</li>
379 379
 		</ul>';
380 380
 
@@ -479,9 +479,9 @@  discard block
 block discarded – undo
479 479
 	foreach ($context['menu_buttons'] as $act => $button)
480 480
 	{
481 481
 		echo '
482
-						<li class="button_', $act, '', !empty($button['sub_buttons']) ? ' subsections"' :'"', '>
482
+						<li class="button_', $act, '', !empty($button['sub_buttons']) ? ' subsections"' : '"', '>
483 483
 							<a', $button['active_button'] ? ' class="active"' : '', ' href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
484
-								', $button['icon'],'<span class="textmenu">', $button['title'], '</span>
484
+								', $button['icon'], '<span class="textmenu">', $button['title'], '</span>
485 485
 							</a>';
486 486
 
487 487
 		if (!empty($button['sub_buttons']))
@@ -492,8 +492,8 @@  discard block
 block discarded – undo
492 492
 			foreach ($button['sub_buttons'] as $childbutton)
493 493
 			{
494 494
 				echo '
495
-								<li', !empty($childbutton['sub_buttons']) ? ' class="subsections"' :'', '>
496
-									<a href="', $childbutton['href'], '"' , isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
495
+								<li', !empty($childbutton['sub_buttons']) ? ' class="subsections"' : '', '>
496
+									<a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
497 497
 										', $childbutton['title'], '
498 498
 									</a>';
499 499
 				// 3rd level menus :)
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 					foreach ($childbutton['sub_buttons'] as $grandchildbutton)
506 506
 						echo '
507 507
 										<li>
508
-											<a href="', $grandchildbutton['href'], '"' , isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
508
+											<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
509 509
 												', $grandchildbutton['title'], '
510 510
 											</a>
511 511
 										</li>';
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 				$value['id'] = $key;
554 554
 
555 555
 			$button = '
556
-				<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' '. $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="'. $value['url'] .'"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
556
+				<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
557 557
 
558 558
 			if (!empty($value['sub_buttons']))
559 559
 			{
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 		return;
588 588
 
589 589
 	echo '
590
-		<div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"': ''), '>
590
+		<div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"' : ''), '>
591 591
 			',implode('', $buttons), '
592 592
 		</div>';
593 593
 }
Please login to merge, or discard this patch.
Braces   +87 added lines, -59 removed lines patch added patch discarded remove patch
@@ -72,9 +72,10 @@  discard block
 block discarded – undo
72 72
 
73 73
 	// Allow css/js files to be disable for this specific theme.
74 74
 	// Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference.
75
-	if (!isset($settings['disable_files']))
76
-		$settings['disable_files'] = array();
77
-}
75
+	if (!isset($settings['disable_files'])) {
76
+			$settings['disable_files'] = array();
77
+	}
78
+	}
78 79
 
79 80
 /**
80 81
  * The main sub template above the content.
@@ -111,8 +112,9 @@  discard block
 block discarded – undo
111 112
 		echo '
112 113
 	<meta';
113 114
 
114
-		foreach ($meta_tag as $meta_key => $meta_value)
115
-			echo ' ', $meta_key, '="', $meta_value, '"';
115
+		foreach ($meta_tag as $meta_key => $meta_value) {
116
+					echo ' ', $meta_key, '="', $meta_value, '"';
117
+		}
116 118
 
117 119
 		echo '>';
118 120
 	}
@@ -123,14 +125,16 @@  discard block
 block discarded – undo
123 125
 	<meta name="theme-color" content="#557EA0">';
124 126
 
125 127
 	// Please don't index these Mr Robot.
126
-	if (!empty($context['robot_no_index']))
127
-		echo '
128
+	if (!empty($context['robot_no_index'])) {
129
+			echo '
128 130
 	<meta name="robots" content="noindex">';
131
+	}
129 132
 
130 133
 	// Present a canonical url for search engines to prevent duplicate content in their indices.
131
-	if (!empty($context['canonical_url']))
132
-		echo '
134
+	if (!empty($context['canonical_url'])) {
135
+			echo '
133 136
 	<link rel="canonical" href="', $context['canonical_url'], '">';
137
+	}
134 138
 
135 139
 	// Show all the relative links, such as help, search, contents, and the like.
136 140
 	echo '
@@ -139,10 +143,11 @@  discard block
 block discarded – undo
139 143
 	<link rel="search" href="' . $scripturl . '?action=search">' : '');
140 144
 
141 145
 	// If RSS feeds are enabled, advertise the presence of one.
142
-	if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']))
143
-		echo '
146
+	if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) {
147
+			echo '
144 148
 	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?type=rss2;action=.xml">
145 149
 	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?type=atom;action=.xml">';
150
+	}
146 151
 
147 152
 	// If we're viewing a topic, these should be the previous and next topics, respectively.
148 153
 	if (!empty($context['links']['next']))
@@ -158,9 +163,10 @@  discard block
 block discarded – undo
158 163
 	}
159 164
 
160 165
 	// If we're in a board, or a topic for that matter, the index will be the board's index.
161
-	if (!empty($context['current_board']))
162
-		echo '
166
+	if (!empty($context['current_board'])) {
167
+			echo '
163 168
 	<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">';
169
+	}
164 170
 
165 171
 	// Output any remaining HTML headers. (from mods, maybe?)
166 172
 	echo $context['html_headers'];
@@ -191,8 +197,9 @@  discard block
 block discarded – undo
191 197
 		<ul class="floatleft" id="top_info">
192 198
 			<li>
193 199
 				<a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">';
194
-					if (!empty($context['user']['avatar']))
195
-						echo $context['user']['avatar']['image'];
200
+					if (!empty($context['user']['avatar'])) {
201
+											echo $context['user']['avatar']['image'];
202
+					}
196 203
 					echo $context['user']['name'], '</a>
197 204
 				<div id="profile_menu" class="top_menu"></div>
198 205
 			</li>';
@@ -219,11 +226,12 @@  discard block
 block discarded – undo
219 226
 		</ul>';
220 227
 	}
221 228
 	// Otherwise they're a guest. Ask them to either register or login.
222
-	else
223
-		echo '
229
+	else {
230
+			echo '
224 231
 		<ul class="floatleft welcome">
225 232
 			<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li>
226 233
 		</ul>';
234
+	}
227 235
 
228 236
 	if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1)
229 237
 	{
@@ -231,9 +239,10 @@  discard block
 block discarded – undo
231 239
 		<form id="languages_form" method="get" class="floatright">
232 240
 			<select id="language_select" name="language" onchange="this.form.submit()">';
233 241
 
234
-		foreach ($context['languages'] as $language)
235
-			echo '
242
+		foreach ($context['languages'] as $language) {
243
+					echo '
236 244
 				<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>';
245
+		}
237 246
 
238 247
 		echo '
239 248
 			</select>
@@ -257,31 +266,36 @@  discard block
 block discarded – undo
257 266
 				<option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>';
258 267
 
259 268
 		// Can't limit it to a specific topic if we are not in one
260
-		if (!empty($context['current_topic']))
261
-			echo '
269
+		if (!empty($context['current_topic'])) {
270
+					echo '
262 271
 				<option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>';
272
+		}
263 273
 
264 274
 		// Can't limit it to a specific board if we are not in one
265
-		if (!empty($context['current_board']))
266
-			echo '
275
+		if (!empty($context['current_board'])) {
276
+					echo '
267 277
 				<option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>';
278
+		}
268 279
 		
269 280
 		// Can't search for members if we can't see the memberlist
270
-		if (!empty($context['allow_memberlist']))
271
-			echo '
281
+		if (!empty($context['allow_memberlist'])) {
282
+					echo '
272 283
 				<option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>';
284
+		}
273 285
 				
274 286
 		echo '
275 287
 			</select>';
276 288
 
277 289
 		// Search within current topic?
278
-		if (!empty($context['current_topic']))
279
-			echo '
290
+		if (!empty($context['current_topic'])) {
291
+					echo '
280 292
 			<input type="hidden" name="sd_topic" value="', $context['current_topic'], '">';
293
+		}
281 294
 		// If we're on a certain board, limit it to this board ;).
282
-		elseif (!empty($context['current_board']))
283
-			echo '
295
+		elseif (!empty($context['current_board'])) {
296
+					echo '
284 297
 			<input type="hidden" name="sd_brd" value="', $context['current_board'], '">';
298
+		}
285 299
 
286 300
 		echo '
287 301
 			<input type="submit" name="search2" value="', $txt['search'], '" class="button_submit">
@@ -311,12 +325,13 @@  discard block
 block discarded – undo
311 325
 						', $context['current_time'], '
312 326
 					</div>';
313 327
 	// Show a random news item? (or you could pick one from news_lines...)
314
-	if (!empty($settings['enable_news']) && !empty($context['random_news_line']))
315
-		echo '
328
+	if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
329
+			echo '
316 330
 					<div class="news">
317 331
 						<h2>', $txt['news'], ': </h2>
318 332
 						<p>', $context['random_news_line'], '</p>
319 333
 					</div>';
334
+	}
320 335
 
321 336
 	echo '
322 337
 					<hr class="clear">
@@ -379,9 +394,10 @@  discard block
 block discarded – undo
379 394
 		</ul>';
380 395
 
381 396
 	// Show the load time?
382
-	if ($context['show_load_time'])
383
-		echo '
397
+	if ($context['show_load_time']) {
398
+			echo '
384 399
 		<p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>';
400
+	}
385 401
 
386 402
 	echo '
387 403
 	</div>';
@@ -411,19 +427,21 @@  discard block
 block discarded – undo
411 427
 	global $context, $shown_linktree, $scripturl, $txt;
412 428
 
413 429
 	// If linktree is empty, just return - also allow an override.
414
-	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
415
-		return;
430
+	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) {
431
+			return;
432
+	}
416 433
 
417 434
 	echo '
418 435
 				<div class="navigate_section">
419 436
 					<ul>';
420 437
 
421
-	if ($context['user']['is_logged'])
422
-	echo '
438
+	if ($context['user']['is_logged']) {
439
+		echo '
423 440
 						<li class="unread_links">
424 441
 							<a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a>
425 442
 							<a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a>
426 443
 						</li>';
444
+	}
427 445
 
428 446
 	// Each tree item has a URL and name. Some may have extra_before and extra_after.
429 447
 	foreach ($context['linktree'] as $link_num => $tree)
@@ -434,25 +452,29 @@  discard block
 block discarded – undo
434 452
 		// Don't show a separator for the first one.
435 453
 		// Better here. Always points to the next level when the linktree breaks to a second line.
436 454
 		// Picked a better looking HTML entity, and added support for RTL plus a span for styling.
437
-		if ($link_num != 0)
438
-			echo '
455
+		if ($link_num != 0) {
456
+					echo '
439 457
 							<span class="dividers">', $context['right_to_left'] ? ' &#9668; ' : ' &#9658; ', '</span>';
458
+		}
440 459
 
441 460
 		// Show something before the link?
442
-		if (isset($tree['extra_before']))
443
-			echo $tree['extra_before'], ' ';
461
+		if (isset($tree['extra_before'])) {
462
+					echo $tree['extra_before'], ' ';
463
+		}
444 464
 
445 465
 		// Show the link, including a URL if it should have one.
446
-		if (isset($tree['url']))
447
-			echo '
466
+		if (isset($tree['url'])) {
467
+					echo '
448 468
 					<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>';
449
-		else
450
-			echo '
469
+		} else {
470
+					echo '
451 471
 					<span>' . $tree['name'] . '</span>';
472
+		}
452 473
 
453 474
 		// Show something after the link...?
454
-		if (isset($tree['extra_after']))
455
-			echo ' ', $tree['extra_after'];
475
+		if (isset($tree['extra_after'])) {
476
+					echo ' ', $tree['extra_after'];
477
+		}
456 478
 
457 479
 		echo '
458 480
 						</li>';
@@ -502,13 +524,14 @@  discard block
 block discarded – undo
502 524
 					echo '
503 525
 									<ul>';
504 526
 
505
-					foreach ($childbutton['sub_buttons'] as $grandchildbutton)
506
-						echo '
527
+					foreach ($childbutton['sub_buttons'] as $grandchildbutton) {
528
+											echo '
507 529
 										<li>
508 530
 											<a href="', $grandchildbutton['href'], '"' , isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
509 531
 												', $grandchildbutton['title'], '
510 532
 											</a>
511 533
 										</li>';
534
+					}
512 535
 
513 536
 					echo '
514 537
 									</ul>';
@@ -539,8 +562,9 @@  discard block
 block discarded – undo
539 562
 {
540 563
 	global $context, $txt;
541 564
 
542
-	if (!is_array($strip_options))
543
-		$strip_options = array();
565
+	if (!is_array($strip_options)) {
566
+			$strip_options = array();
567
+	}
544 568
 
545 569
 	// Create the buttons...
546 570
 	$buttons = array();
@@ -549,8 +573,9 @@  discard block
 block discarded – undo
549 573
 		// As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!)
550 574
 		if (!isset($value['test']) || !empty($context[$value['test']]))
551 575
 		{
552
-			if (!isset($value['id']))
553
-				$value['id'] = $key;
576
+			if (!isset($value['id'])) {
577
+							$value['id'] = $key;
578
+			}
554 579
 
555 580
 			$button = '
556 581
 				<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' '. $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="'. $value['url'] .'"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
@@ -563,13 +588,15 @@  discard block
 block discarded – undo
563 588
 							<div class="overview">';
564 589
 				foreach ($value['sub_buttons'] as $element)
565 590
 				{
566
-					if (isset($element['test']) && empty($context[$element['test']]))
567
-						continue;
591
+					if (isset($element['test']) && empty($context[$element['test']])) {
592
+											continue;
593
+					}
568 594
 
569 595
 					$button .= '
570 596
 								<a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>';
571
-					if (isset($txt[$element['text'] . '_desc']))
572
-						$button .= '<br /><span>' . $txt[$element['text'] . '_desc'] . '</span>';
597
+					if (isset($txt[$element['text'] . '_desc'])) {
598
+											$button .= '<br /><span>' . $txt[$element['text'] . '_desc'] . '</span>';
599
+					}
573 600
 					$button .= '</a>';
574 601
 				}
575 602
 				$button .= '
@@ -583,8 +610,9 @@  discard block
 block discarded – undo
583 610
 	}
584 611
 
585 612
 	// No buttons? No button strip either.
586
-	if (empty($buttons))
587
-		return;
613
+	if (empty($buttons)) {
614
+			return;
615
+	}
588 616
 
589 617
 	echo '
590 618
 		<div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"': ''), '>
Please login to merge, or discard this patch.
Themes/default/Stats.template.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -44,10 +44,11 @@  discard block
 block discarded – undo
44 44
 				<dt>', $txt['users_online_today'], ':</dt>
45 45
 				<dd>', $context['online_today'], '</dd>';
46 46
 
47
-	if (!empty($modSettings['hitStats']))
48
-		echo '
47
+	if (!empty($modSettings['hitStats'])) {
48
+			echo '
49 49
 				<dt>', $txt['num_hits'], ':</dt>
50 50
 				<dd>', $context['num_hits'], '</dd>';
51
+	}
51 52
 
52 53
 	echo '
53 54
 			</dl>
@@ -71,17 +72,19 @@  discard block
 block discarded – undo
71 72
 				<dt>', $txt['gender_stats'], ':</dt>
72 73
 				<dd>';
73 74
 
74
-		foreach ($context['gender'] as $g => $n)
75
-			echo $g, ': ', $n, '<br>';
75
+		foreach ($context['gender'] as $g => $n) {
76
+					echo $g, ': ', $n, '<br>';
77
+		}
76 78
 
77 79
 		echo '
78 80
 				</dd>';
79 81
 	}
80 82
 
81
-	if (!empty($modSettings['hitStats']))
82
-		echo '
83
+	if (!empty($modSettings['hitStats'])) {
84
+			echo '
83 85
 				<dt>', $txt['average_hits'], ':</dt>
84 86
 				<dd>', $context['average_hits'], '</dd>';
87
+	}
85 88
 
86 89
 	echo '
87 90
 			</dl>';
@@ -105,14 +108,15 @@  discard block
 block discarded – undo
105 108
 						</dt>
106 109
 						<dd class="statsbar">';
107 110
 
108
-			if (!empty($item['percent']))
109
-				echo '
111
+			if (!empty($item['percent'])) {
112
+							echo '
110 113
 							<div class="bar" style="width: ', $item['percent'], '%;">
111 114
 								<span class="righttext">', $item['num'], '</span>
112 115
 							</div>';
113
-			else
114
-				echo '
116
+			} else {
117
+							echo '
115 118
 							<div class="bar empty"><span class="righttext">', $item['num'], '</span></div>';
119
+			}
116 120
 
117 121
 			echo '
118 122
 						</dd>';
@@ -144,9 +148,10 @@  discard block
 block discarded – undo
144 148
 					<th>', $txt['stats_new_members'], '</th>
145 149
 					<th>', $txt['most_online'], '</th>';
146 150
 
147
-		if (!empty($modSettings['hitStats']))
148
-			echo '
151
+		if (!empty($modSettings['hitStats'])) {
152
+					echo '
149 153
 					<th>', $txt['page_views'], '</th>';
154
+		}
150 155
 
151 156
 		echo '
152 157
 				</tr>
@@ -165,9 +170,10 @@  discard block
 block discarded – undo
165 170
 					<th>', $year['new_members'], '</th>
166 171
 					<th>', $year['most_members_online'], '</th>';
167 172
 
168
-			if (!empty($modSettings['hitStats']))
169
-				echo '
173
+			if (!empty($modSettings['hitStats'])) {
174
+							echo '
170 175
 					<th>', $year['hits'], '</th>';
176
+			}
171 177
 
172 178
 			echo '
173 179
 				</tr>';
@@ -184,9 +190,10 @@  discard block
 block discarded – undo
184 190
 					<th>', $month['new_members'], '</th>
185 191
 					<th>', $month['most_members_online'], '</th>';
186 192
 
187
-				if (!empty($modSettings['hitStats']))
188
-					echo '
193
+				if (!empty($modSettings['hitStats'])) {
194
+									echo '
189 195
 					<th>', $month['hits'], '</th>';
196
+				}
190 197
 
191 198
 				echo '
192 199
 				</tr>';
@@ -203,9 +210,10 @@  discard block
 block discarded – undo
203 210
 					<td>', $day['new_members'], '</td>
204 211
 					<td>', $day['most_members_online'], '</td>';
205 212
 
206
-						if (!empty($modSettings['hitStats']))
207
-							echo '
213
+						if (!empty($modSettings['hitStats'])) {
214
+													echo '
208 215
 					<td>', $day['hits'], '</td>';
216
+						}
209 217
 
210 218
 						echo '
211 219
 				</tr>';
Please login to merge, or discard this patch.
Themes/default/Help.template.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 		<meta charset="', $context['character_set'], '">
25 25
 		<meta name="robots" content="noindex">
26 26
 		<title>', $context['page_title'], '</title>
27
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
28
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
27
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
28
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
29 29
 	</head>
30 30
 	<body id="help_popup">
31 31
 		<div class="windowbg description">
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 		<title>', $txt['find_members'], '</title>
51 51
 		<meta charset="', $context['character_set'], '">
52 52
 		<meta name="robots" content="noindex">
53
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
54
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
53
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
54
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
55 55
 		<script>
56 56
 			var membersAdded = [];
57 57
 			function addMember(name)
Please login to merge, or discard this patch.
Braces   +15 added lines, -12 removed lines patch added patch discarded remove patch
@@ -86,9 +86,10 @@  discard block
 block discarded – undo
86 86
 					<span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br>';
87 87
 
88 88
 	// Only offer to search for buddies if we have some!
89
-	if (!empty($context['show_buddies']))
90
-		echo '
89
+	if (!empty($context['show_buddies'])) {
90
+			echo '
91 91
 					<span class="smalltext"><label for="buddies"><input type="checkbox" class="input_check" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked' : '', '> ', $txt['find_buddies'], '</label></span><br>';
92
+	}
92 93
 
93 94
 	echo '
94 95
 					<div class="padding righttext">
@@ -103,10 +104,10 @@  discard block
 block discarded – undo
103 104
 					<h3 class="catbg">', $txt['find_results'], '</h3>
104 105
 				</div>';
105 106
 
106
-	if (empty($context['results']))
107
-		echo '
107
+	if (empty($context['results'])) {
108
+			echo '
108 109
 				<p class="error">', $txt['find_no_results'], '</p>';
109
-	else
110
+	} else
110 111
 	{
111 112
 		echo '
112 113
 				<ul class="padding">';
@@ -135,11 +136,12 @@  discard block
 block discarded – undo
135 136
 			<input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '">
136 137
 		</form>';
137 138
 
138
-	if (empty($context['results']))
139
-		echo '
139
+	if (empty($context['results'])) {
140
+			echo '
140 141
 		<script>
141 142
 			document.getElementById("search").focus();
142 143
 		</script>';
144
+	}
143 145
 
144 146
 	echo '
145 147
 	</body>
@@ -183,8 +185,8 @@  discard block
 block discarded – undo
183 185
 {
184 186
 	global $txt, $context, $modSettings;
185 187
 
186
-	if (!empty($modSettings['requireAgreement']))
187
-		echo '
188
+	if (!empty($modSettings['requireAgreement'])) {
189
+			echo '
188 190
 			<div class="cat_bar">
189 191
 				<h3 class="catbg">
190 192
 					', $txt['terms_and_rules'], ' - ', $context['forum_name_html_safe'], '
@@ -193,11 +195,12 @@  discard block
 block discarded – undo
193 195
 			<div class="roundframe">
194 196
 				', $context['agreement'], '
195 197
 			</div>';
196
-	else
197
-		echo '
198
+	} else {
199
+			echo '
198 200
 			<div class="noticebox">
199 201
 				', $txt['agreement_disabled'], '
200 202
 			</div>';
201
-}
203
+	}
204
+	}
202 205
 
203 206
 ?>
204 207
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/Recent.template.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	<div id="recent" class="main_section">
22 22
 		<div class="cat_bar">
23 23
 			<h3 class="catbg">
24
-				<span class="xx"></span>',$txt['recent_posts'],'
24
+				<span class="xx"></span>',$txt['recent_posts'], '
25 25
 			</h3>
26 26
 		</div>
27 27
 		<div class="pagesection">', $context['page_index'], '</div>';
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	foreach ($context['posts'] as $post)
36 36
 	{
37 37
 		echo '
38
-			<div class="', $post['css_class'] ,'">
38
+			<div class="', $post['css_class'], '">
39 39
 					<div class="counter">', $post['counter'], '</div>
40 40
 					<div class="topic_details">
41 41
 						<h5>', $post['board']['link'], ' / ', $post['link'], '</h5>
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		// How about... even... remove it entirely?!
61 61
 		if ($post['can_delete'])
62 62
 			echo '
63
-						<li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;', $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>';
63
+						<li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;', $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>';
64 64
 
65 65
 		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
66 66
 			echo '
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 						<div class="', $topic['css_class'], '">
275 275
 							<div class="board_icon">
276 276
 								<img src="', $topic['first_post']['icon_url'], '" alt="">
277
-								', $topic['is_posted_in'] ? '<img class="posted" src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="">' : '','
277
+								', $topic['is_posted_in'] ? '<img class="posted" src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="">' : '', '
278 278
 							</div>
279 279
 							<div class="info">';
280 280
 
Please login to merge, or discard this patch.
Braces   +74 added lines, -52 removed lines patch added patch discarded remove patch
@@ -43,28 +43,33 @@  discard block
 block discarded – undo
43 43
 					</div>
44 44
 					<div class="list_posts">', $post['message'], '</div>';
45 45
 
46
-		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
47
-			echo '
46
+		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
47
+					echo '
48 48
 					<ul class="quickbuttons">';
49
+		}
49 50
 
50 51
 		// If they *can* reply?
51
-		if ($post['can_reply'])
52
-			echo '
52
+		if ($post['can_reply']) {
53
+					echo '
53 54
 						<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
55
+		}
54 56
 
55 57
 		// If they *can* quote?
56
-		if ($post['can_quote'])
57
-			echo '
58
+		if ($post['can_quote']) {
59
+					echo '
58 60
 						<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>';
61
+		}
59 62
 
60 63
 		// How about... even... remove it entirely?!
61
-		if ($post['can_delete'])
62
-			echo '
64
+		if ($post['can_delete']) {
65
+					echo '
63 66
 						<li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;', $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>';
67
+		}
64 68
 
65
-		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
66
-			echo '
69
+		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
70
+					echo '
67 71
 					</ul>';
72
+		}
68 73
 
69 74
 		echo '
70 75
 			</div>';
@@ -86,12 +91,13 @@  discard block
 block discarded – undo
86 91
 	echo '
87 92
 	<div id="recent" class="main_content">';
88 93
 
89
-	if ($context['showCheckboxes'])
90
-		echo '
94
+	if ($context['showCheckboxes']) {
95
+			echo '
91 96
 		<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;">
92 97
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
93 98
 			<input type="hidden" name="qaction" value="markread">
94 99
 			<input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">';
100
+	}
95 101
 
96 102
 	if (!empty($context['topics']))
97 103
 	{
@@ -117,11 +123,12 @@  discard block
 block discarded – undo
117 123
 					</div>';
118 124
 
119 125
 		// Show a "select all" box for quick moderation?
120
-		if ($context['showCheckboxes'])
121
-			echo '
126
+		if ($context['showCheckboxes']) {
127
+					echo '
122 128
 					<div class="moderation">
123 129
 						<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">
124 130
 					</div>';
131
+		}
125 132
 
126 133
 		echo '
127 134
 				</div>
@@ -140,15 +147,18 @@  discard block
 block discarded – undo
140 147
 			// Now we handle the icons
141 148
 			echo '
142 149
 							<div class="icons floatright">';
143
-			if ($topic['is_locked'])
144
-				echo '
150
+			if ($topic['is_locked']) {
151
+							echo '
145 152
 								<span class="generic_icons lock"></span>';
146
-			if ($topic['is_sticky'])
147
-				echo '
153
+			}
154
+			if ($topic['is_sticky']) {
155
+							echo '
148 156
 								<span class="generic_icons sticky"></span>';
149
-			if ($topic['is_poll'])
150
-				echo '
157
+			}
158
+			if ($topic['is_poll']) {
159
+							echo '
151 160
 								<span class="generic_icons poll"></span>';
161
+			}
152 162
 			echo '
153 163
 							</div>';
154 164
 
@@ -173,19 +183,21 @@  discard block
 block discarded – undo
173 183
 							', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '
174 184
 						</div>';
175 185
 
176
-			if ($context['showCheckboxes'])
177
-				echo '
186
+			if ($context['showCheckboxes']) {
187
+							echo '
178 188
 						<div class="moderation">
179 189
 							<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">
180 190
 						</div>';
191
+			}
181 192
 
182 193
 				echo '
183 194
 					</div>';
184 195
 		}
185 196
 
186
-		if (empty($context['topics']))
187
-			echo '
197
+		if (empty($context['topics'])) {
198
+					echo '
188 199
 						<div style="display: none;"></div>';
200
+		}
189 201
 
190 202
 		echo '
191 203
 				</div>
@@ -197,25 +209,27 @@  discard block
 block discarded – undo
197 209
 				', $context['menu_separator'], '<a href="#recent" class="topbottom floatleft">', $txt['go_up'], '</a>
198 210
 				<div class="pagelinks">', $context['page_index'], '</div>
199 211
 			</div>';
200
-	}
201
-	else
202
-		echo '
212
+	} else {
213
+			echo '
203 214
 			<div class="cat_bar">
204 215
 				<h3 class="catbg centertext">
205 216
 					', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], '
206 217
 				</h3>
207 218
 			</div>';
219
+	}
208 220
 
209
-	if ($context['showCheckboxes'])
210
-		echo '
221
+	if ($context['showCheckboxes']) {
222
+			echo '
211 223
 		</form>';
224
+	}
212 225
 
213 226
 	echo '
214 227
 	</div>';
215 228
 
216
-	if (empty($context['no_topic_listing']))
217
-		template_topic_legend();
218
-}
229
+	if (empty($context['no_topic_listing'])) {
230
+			template_topic_legend();
231
+	}
232
+	}
219 233
 
220 234
 /**
221 235
  * Template for showing unread replies (eg new replies to topics you've posted in)
@@ -227,12 +241,13 @@  discard block
 block discarded – undo
227 241
 	echo '
228 242
 	<div id="recent">';
229 243
 
230
-	if ($context['showCheckboxes'])
231
-		echo '
244
+	if ($context['showCheckboxes']) {
245
+			echo '
232 246
 		<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;">
233 247
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
234 248
 			<input type="hidden" name="qaction" value="markread">
235 249
 			<input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">';
250
+	}
236 251
 
237 252
 	if (!empty($context['topics']))
238 253
 	{
@@ -258,11 +273,12 @@  discard block
 block discarded – undo
258 273
 					</div>';
259 274
 
260 275
 		// Show a "select all" box for quick moderation?
261
-		if ($context['showCheckboxes'])
262
-				echo '
276
+		if ($context['showCheckboxes']) {
277
+						echo '
263 278
 					<div class="moderation">
264 279
 						<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">
265 280
 					</div>';
281
+		}
266 282
 
267 283
 		echo '
268 284
 				</div>
@@ -281,15 +297,18 @@  discard block
 block discarded – undo
281 297
 			// Now we handle the icons
282 298
 			echo '
283 299
 								<div class="icons floatright">';
284
-			if ($topic['is_locked'])
285
-				echo '
300
+			if ($topic['is_locked']) {
301
+							echo '
286 302
 									<span class="generic_icons lock"></span>';
287
-			if ($topic['is_sticky'])
288
-				echo '
303
+			}
304
+			if ($topic['is_sticky']) {
305
+							echo '
289 306
 									<span class="generic_icons sticky"></span>';
290
-			if ($topic['is_poll'])
291
-				echo '
307
+			}
308
+			if ($topic['is_poll']) {
309
+							echo '
292 310
 									<span class="generic_icons poll"></span>';
311
+			}
293 312
 			echo '
294 313
 								</div>';
295 314
 
@@ -314,11 +333,12 @@  discard block
 block discarded – undo
314 333
 								', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '
315 334
 							</div>';
316 335
 
317
-			if ($context['showCheckboxes'])
318
-				echo '
336
+			if ($context['showCheckboxes']) {
337
+							echo '
319 338
 							<div class="moderation">
320 339
 								<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">
321 340
 							</div>';
341
+			}
322 342
 			echo '
323 343
 						</div>';
324 344
 		}
@@ -331,24 +351,26 @@  discard block
 block discarded – undo
331 351
 				', $context['menu_separator'], '<a href="#recent" class="topbottom floatleft">', $txt['go_up'], '</a>
332 352
 				<div class="pagelinks">', $context['page_index'], '</div>
333 353
 			</div>';
334
-	}
335
-	else
336
-		echo '
354
+	} else {
355
+			echo '
337 356
 			<div class="cat_bar">
338 357
 				<h3 class="catbg centertext">
339 358
 					', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], '
340 359
 				</h3>
341 360
 			</div>';
361
+	}
342 362
 
343
-	if ($context['showCheckboxes'])
344
-		echo '
363
+	if ($context['showCheckboxes']) {
364
+			echo '
345 365
 		</form>';
366
+	}
346 367
 
347 368
 	echo '
348 369
 	</div>';
349 370
 
350
-	if (empty($context['no_topic_listing']))
351
-		template_topic_legend();
352
-}
371
+	if (empty($context['no_topic_listing'])) {
372
+			template_topic_legend();
373
+	}
374
+	}
353 375
 
354 376
 ?>
355 377
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/ModerationCenter.template.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 	{
326 326
 		echo '
327 327
 			<div class="infobox">
328
-				', $txt['report_action_'. $context['report_post_action']], '
328
+				', $txt['report_action_' . $context['report_post_action']], '
329 329
 			</div>';
330 330
 	}
331 331
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 			// Cycle through the notes.
347 347
 			foreach ($context['notes'] as $note)
348 348
 				echo '
349
-							<li class="smalltext">', ($note['can_delete'] ? '<a href="'. $note['delete_href'] .';'. $context['mod-modnote-del_token_var'] .'='. $context['mod-modnote-del_token'] .'" data-confirm="'. $txt['mc_reportedp_delete_confirm'] .'" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'] ,' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>';
349
+							<li class="smalltext">', ($note['can_delete'] ? '<a href="' . $note['delete_href'] . ';' . $context['mod-modnote-del_token_var'] . '=' . $context['mod-modnote-del_token'] . '" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'], ' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>';
350 350
 
351 351
 			echo '
352 352
 						</ul>
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 
480 480
 	if ($post['can_delete'])
481 481
 		$output_html .= '
482
-							<a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="'. $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a>
482
+							<a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="' . $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a>
483 483
 							<input type="checkbox" name="delete[]" value="' . $post['id'] . '" class="input_check">';
484 484
 
485 485
 	$output_html .= '
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 	<head>
547 547
 		<meta charset="', $context['character_set'], '">
548 548
 		<title>', $context['page_title'], '</title>
549
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
549
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
550 550
 	</head>
551 551
 	<body>
552 552
 		<div class="cat_bar">
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 				<div class="errorbox"', empty($context['warning_errors']) ? ' style="display: none"' : '', ' id="errors">
591 591
 					<dl>
592 592
 						<dt>
593
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
593
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
594 594
 						</dt>
595 595
 						<dd class="error" id="error_list">
596 596
 							', empty($context['warning_errors']) ? '' : implode('<br>', $context['warning_errors']), '
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 				<div id="box_preview"', !empty($context['template_preview']) ? '' : ' style="display:none"', '>
601 601
 					<dl class="settings">
602 602
 						<dt>
603
-							<strong>', $txt['preview'] , '</strong>
603
+							<strong>', $txt['preview'], '</strong>
604 604
 						</dt>
605 605
 						<dd id="template_preview">
606 606
 							', !empty($context['template_preview']) ? $context['template_preview'] : '', '
Please login to merge, or discard this patch.
Braces   +56 added lines, -39 removed lines patch added patch discarded remove patch
@@ -55,18 +55,20 @@  discard block
 block discarded – undo
55 55
 			<div class="modbox">
56 56
 				<ul>';
57 57
 
58
-		foreach ($context['group_requests'] as $request)
59
-			echo '
58
+		foreach ($context['group_requests'] as $request) {
59
+					echo '
60 60
 				<li class="smalltext">
61 61
 					<a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], '
62 62
 				</li>';
63
+		}
63 64
 
64 65
 		// Don't have any watched users right now?
65
-		if (empty($context['group_requests']))
66
-			echo '
66
+		if (empty($context['group_requests'])) {
67
+					echo '
67 68
 				<li>
68 69
 					<strong class="smalltext">', $txt['mc_group_requests_none'], '</strong>
69 70
 				</li>';
71
+		}
70 72
 
71 73
 		echo '
72 74
 				</ul>
@@ -124,18 +126,20 @@  discard block
 block discarded – undo
124 126
 			<div class="modbox">
125 127
 				<ul>';
126 128
 
127
-		foreach ($context['watched_users'] as $user)
128
-			echo '
129
+		foreach ($context['watched_users'] as $user) {
130
+					echo '
129 131
 					<li>
130 132
 						<span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span>
131 133
 					</li>';
134
+		}
132 135
 
133 136
 		// Don't have any watched users right now?
134
-		if (empty($context['watched_users']))
135
-			echo '
137
+		if (empty($context['watched_users'])) {
138
+					echo '
136 139
 					<li>
137 140
 						<strong class="smalltext">', $txt['mc_watched_users_none'], '</strong>
138 141
 					</li>';
142
+		}
139 143
 
140 144
 		echo '
141 145
 				</ul>
@@ -193,18 +197,20 @@  discard block
 block discarded – undo
193 197
 			<div class="modbox">
194 198
 				<ul>';
195 199
 
196
-		foreach ($context['reported_posts'] as $post)
197
-			echo '
200
+		foreach ($context['reported_posts'] as $post) {
201
+					echo '
198 202
 					<li>
199 203
 						<span class="smalltext">', sprintf($txt['mc_post_report'], $post['report_link'], $post['author']['link']), '</span>
200 204
 					</li>';
205
+		}
201 206
 
202 207
 		// Don't have any watched users right now?
203
-		if (empty($context['reported_posts']))
204
-			echo '
208
+		if (empty($context['reported_posts'])) {
209
+					echo '
205 210
 					<li>
206 211
 						<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
207 212
 					</li>';
213
+		}
208 214
 
209 215
 		echo '
210 216
 				</ul>
@@ -262,18 +268,20 @@  discard block
 block discarded – undo
262 268
 			<div class="modbox">
263 269
 				<ul>';
264 270
 
265
-		foreach ($context['reported_users'] as $user)
266
-			echo '
271
+		foreach ($context['reported_users'] as $user) {
272
+					echo '
267 273
 					<li>
268 274
 						<span class="smalltext">', $user['user']['link'], '</span>
269 275
 					</li>';
276
+		}
270 277
 
271 278
 		// Don't have any watched users right now?
272
-		if (empty($context['reported_users']))
273
-			echo '
279
+		if (empty($context['reported_users'])) {
280
+					echo '
274 281
 					<li>
275 282
 						<strong class="smalltext">', $txt['mc_reported_users_none'], '</strong>
276 283
 					</li>';
284
+		}
277 285
 
278 286
 		echo '
279 287
 				</ul>
@@ -344,9 +352,10 @@  discard block
 block discarded – undo
344 352
 						<ul class="moderation_notes">';
345 353
 
346 354
 			// Cycle through the notes.
347
-			foreach ($context['notes'] as $note)
348
-				echo '
355
+			foreach ($context['notes'] as $note) {
356
+							echo '
349 357
 							<li class="smalltext">', ($note['can_delete'] ? '<a href="'. $note['delete_href'] .';'. $context['mod-modnote-del_token_var'] .'='. $context['mod-modnote-del_token'] .'" data-confirm="'. $txt['mc_reportedp_delete_confirm'] .'" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'] ,' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>';
358
+			}
350 359
 
351 360
 			echo '
352 361
 						</ul>
@@ -388,16 +397,17 @@  discard block
 block discarded – undo
388 397
 	$remove_button = create_button('delete', 'remove_message', 'remove');
389 398
 
390 399
 	// No posts?
391
-	if (empty($context['unapproved_items']))
392
-		echo '
400
+	if (empty($context['unapproved_items'])) {
401
+			echo '
393 402
 		<div class="windowbg2">
394 403
 			<p class="centertext">', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '</p>
395 404
 		</div>';
396
-	else
397
-		echo '
405
+	} else {
406
+			echo '
398 407
 			<div class="pagesection floatleft">
399 408
 				', $context['page_index'], '
400 409
 			</div>';
410
+	}
401 411
 
402 412
 	foreach ($context['unapproved_items'] as $item)
403 413
 	{
@@ -414,14 +424,16 @@  discard block
 block discarded – undo
414 424
 			<span class="floatright">
415 425
 				<a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';approve=', $item['id'], '">', $approve_button, '</a>';
416 426
 
417
-		if ($item['can_delete'])
418
-			echo '
427
+		if ($item['can_delete']) {
428
+					echo '
419 429
 			', $context['menu_separator'], '
420 430
 				<a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';delete=', $item['id'], '">', $remove_button, '</a>';
431
+		}
421 432
 
422
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
423
-			echo '
433
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
434
+					echo '
424 435
 				<input type="checkbox" name="item[]" value="', $item['id'], '" checked class="input_check"> ';
436
+		}
425 437
 
426 438
 		echo '
427 439
 			</span>
@@ -431,8 +443,8 @@  discard block
 block discarded – undo
431 443
 	echo '
432 444
 		<div class="pagesection">';
433 445
 
434
-	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
435
-		echo '
446
+	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
447
+			echo '
436 448
 			<div class="floatright">
437 449
 				<select name="do" onchange="if (this.value != 0 &amp;&amp; confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();">
438 450
 					<option value="0">', $txt['with_selected'], ':</option>
@@ -442,12 +454,14 @@  discard block
 block discarded – undo
442 454
 				</select>
443 455
 				<noscript><input type="submit" name="mc_go" value="', $txt['go'], '" class="button_submit"></noscript>
444 456
 			</div>';
457
+	}
445 458
 
446
-	if (!empty($context['unapproved_items']))
447
-		echo '
459
+	if (!empty($context['unapproved_items'])) {
460
+			echo '
448 461
 			<div class="floatleft">
449 462
 				<div class="pagelinks">', $context['page_index'], '</div>
450 463
 			</div>';
464
+	}
451 465
 
452 466
 	echo '
453 467
 		</div>
@@ -467,8 +481,9 @@  discard block
 block discarded – undo
467 481
 	global $scripturl, $context, $txt, $delete_button;
468 482
 
469 483
 	// We'll have a delete please bob.
470
-	if (empty($delete_button))
471
-		$delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"');
484
+	if (empty($delete_button)) {
485
+			$delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"');
486
+	}
472 487
 
473 488
 	$output_html = '
474 489
 					<div>
@@ -477,10 +492,11 @@  discard block
 block discarded – undo
477 492
 						</div>
478 493
 						<div class="floatright">';
479 494
 
480
-	if ($post['can_delete'])
481
-		$output_html .= '
495
+	if ($post['can_delete']) {
496
+			$output_html .= '
482 497
 							<a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="'. $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a>
483 498
 							<input type="checkbox" name="delete[]" value="' . $post['id'] . '" class="input_check">';
499
+	}
484 500
 
485 501
 	$output_html .= '
486 502
 						</div>
@@ -522,12 +538,12 @@  discard block
 block discarded – undo
522 538
 				<input type="submit" name="save" value="', $txt['save'], '" class="button_submit">
523 539
 			</div>
524 540
 		</form>';
525
-	}
526
-	else
527
-		echo '
541
+	} else {
542
+			echo '
528 543
 		<div class="windowbg">
529 544
 			<div class="centertext">', $txt['mc_no_settings'], '</div>
530 545
 		</div>';
546
+	}
531 547
 
532 548
 	echo '
533 549
 	</div>';
@@ -623,8 +639,8 @@  discard block
 block discarded – undo
623 639
 					</dd>
624 640
 				</dl>';
625 641
 
626
-	if ($context['template_data']['can_edit_personal'])
627
-		echo '
642
+	if ($context['template_data']['can_edit_personal']) {
643
+			echo '
628 644
 				<input type="checkbox" name="make_personal" id="make_personal"', $context['template_data']['personal'] ? ' checked' : '', ' class="input_check">
629 645
 					<label for="make_personal">
630 646
 						<strong>', $txt['mc_warning_template_personal'], '</strong>
@@ -632,6 +648,7 @@  discard block
 block discarded – undo
632 648
 					<br>
633 649
 					<span class="smalltext">', $txt['mc_warning_template_personal_desc'], '</span>
634 650
 					<br>';
651
+	}
635 652
 
636 653
 	echo '
637 654
 				<hr>
Please login to merge, or discard this patch.
Themes/default/Post.template.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
 		foreach ($context['posting_fields'] as $pf)
140 140
 			echo '
141 141
 						<dt>
142
-							', $pf['dt'] ,'
142
+							', $pf['dt'], '
143 143
 						</dt>
144 144
 						<dd>
145
-							', $pf['dd'] ,'
145
+							', $pf['dd'], '
146 146
 						</dd>';
147 147
 
148 148
 
@@ -459,13 +459,13 @@  discard block
 block discarded – undo
459 459
 									<p class="message" data-dz-message></p>
460 460
 									<p class="attached_BBC">
461 461
 										<input type="text" name="attachBBC" value="" readonly>
462
-										<a class="button_submit insertBBC">', $txt['attached_insertBBC'] ,'</a>
462
+										<a class="button_submit insertBBC">', $txt['attached_insertBBC'], '</a>
463 463
 									</p>
464 464
 									<p class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></p>
465 465
 								</div>
466 466
 								<div class="attach-ui">
467
-									<a data-dz-remove class="button_submit delete">', $txt['modify_cancel'] ,'</a>
468
-									<a class="button_submit start">', $txt['upload'] ,'</a>
467
+									<a data-dz-remove class="button_submit delete">', $txt['modify_cancel'], '</a>
468
+									<a class="button_submit start">', $txt['upload'], '</a>
469 469
 								</div>
470 470
 							</div>
471 471
 						</div>
@@ -482,10 +482,10 @@  discard block
 block discarded – undo
482 482
 							</dt>
483 483
 							<dd class="smalltext fallback">
484 484
 								<div id="attachUpload" class="descbox">
485
-									<h5>', $txt['attach_drop_zone'] ,'</h5>
486
-									<a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a>
487
-									<a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a>
488
-									<a class="button_submit fileinput-button">', $txt['attach_add'] ,'</a>
485
+									<h5>', $txt['attach_drop_zone'], '</h5>
486
+									<a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a>
487
+									<a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a>
488
+									<a class="button_submit fileinput-button">', $txt['attach_add'], '</a>
489 489
 									<div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
490 490
 									<div class="fallback">
491 491
 										<input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="input_file fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 	// Option to delete an event if user is editing one.
593 593
 	if ($context['make_event'] && !$context['event']['new'])
594 594
 		echo '
595
-						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">';
595
+						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button_submit you_sure">';
596 596
 
597 597
 	echo '
598 598
 					</span>
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 			});';
847 847
 
848 848
 	echo '
849
-			var oEditorID = "', $context['post_box_name'] ,'";
849
+			var oEditorID = "', $context['post_box_name'], '";
850 850
 			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
851 851
 		</script>';
852 852
 
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 			{
879 879
 				echo '
880 880
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
881
-						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>
881
+						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>
882 882
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
883 883
 					</ul>';
884 884
 			}
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 	<head>
966 966
 		<meta charset="', $context['character_set'], '">
967 967
 		<title>', $txt['spell_check'], '</title>
968
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
968
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
969 969
 		<style>
970 970
 			body, td
971 971
 			{
@@ -998,8 +998,8 @@  discard block
 block discarded – undo
998 998
 			var spell_formname = window.opener.spell_formname;
999 999
 			var spell_fieldname = window.opener.spell_fieldname;
1000 1000
 		</script>
1001
-		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script>
1002
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
1001
+		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script>
1002
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
1003 1003
 		<script>
1004 1004
 			', $context['spell_js'], '
1005 1005
 		</script>
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 	<head>
1042 1042
 		<meta charset="', $context['character_set'], '">
1043 1043
 		<title>', $txt['retrieving_quote'], '</title>
1044
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
1044
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
1045 1045
 	</head>
1046 1046
 	<body>
1047 1047
 		', $txt['retrieving_quote'], '
Please login to merge, or discard this patch.
Braces   +98 added lines, -67 removed lines patch added patch discarded remove patch
@@ -22,22 +22,24 @@  discard block
 block discarded – undo
22 22
 		<script>';
23 23
 
24 24
 	// When using Go Back due to fatal_error, allow the form to be re-submitted with changes.
25
-	if (isBrowser('is_firefox'))
26
-		echo '
25
+	if (isBrowser('is_firefox')) {
26
+			echo '
27 27
 			window.addEventListener("pageshow", reActivate, false);';
28
+	}
28 29
 
29 30
 	// Start with message icons - and any missing from this theme.
30 31
 	echo '
31 32
 			var icon_urls = {';
32
-	foreach ($context['icons'] as $icon)
33
-		echo '
33
+	foreach ($context['icons'] as $icon) {
34
+			echo '
34 35
 				\'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ',';
36
+	}
35 37
 	echo '
36 38
 			};';
37 39
 
38 40
 	// If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations.
39
-	if ($context['make_poll'])
40
-		echo '
41
+	if ($context['make_poll']) {
42
+			echo '
41 43
 			var pollOptionNum = 0, pollTabIndex;
42 44
 			var pollOptionId = ', $context['last_choice_id'], ';
43 45
 			function addPollOption()
@@ -56,11 +58,13 @@  discard block
 block discarded – undo
56 58
 
57 59
 				setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('" class="input_text"></dd><p id="pollMoreOptions"></p>'), ');
58 60
 			}';
61
+	}
59 62
 
60 63
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.
61
-	if ($context['make_event'])
62
-		echo '
64
+	if ($context['make_event']) {
65
+			echo '
63 66
 			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];';
67
+	}
64 68
 
65 69
 	// End of the javascript, start the form and display the link tree.
66 70
 	echo '
@@ -80,9 +84,10 @@  discard block
 block discarded – undo
80 84
 				</div>
81 85
 			</div><br>';
82 86
 
83
-	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board'])))
84
-		echo '
87
+	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) {
88
+			echo '
85 89
 			<input type="hidden" name="eventid" value="', $context['event']['id'], '">';
90
+	}
86 91
 
87 92
 	// Start the main table.
88 93
 	echo '
@@ -117,26 +122,28 @@  discard block
 block discarded – undo
117 122
 	}
118 123
 
119 124
 	// If it's locked, show a message to warn the replier.
120
-	if (!empty($context['locked']))
121
-	echo '
125
+	if (!empty($context['locked'])) {
126
+		echo '
122 127
 					<p class="errorbox">
123 128
 						', $txt['topic_locked_no_reply'], '
124 129
 					</p>';
130
+	}
125 131
 
126
-	if (!empty($modSettings['drafts_post_enabled']))
127
-		echo '
132
+	if (!empty($modSettings['drafts_post_enabled'])) {
133
+			echo '
128 134
 					<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
129 135
 						sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), '
130 136
 						', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
131 137
 					</div>';
138
+	}
132 139
 
133 140
 	// The post header... important stuff
134 141
 	echo '
135 142
 					<dl id="post_header">';
136 143
 
137 144
 	// Custom posting fields.
138
-	if (!empty($context['posting_fields']) && is_array($context['posting_fields']))
139
-		foreach ($context['posting_fields'] as $pf)
145
+	if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) {
146
+			foreach ($context['posting_fields'] as $pf)
140 147
 			echo '
141 148
 						<dt>
142 149
 							', $pf['dt'] ,'
@@ -144,6 +151,7 @@  discard block
 block discarded – undo
144 151
 						<dd>
145 152
 							', $pf['dd'] ,'
146 153
 						</dd>';
154
+	}
147 155
 
148 156
 
149 157
 	// Guests have to put in their name and email...
@@ -157,14 +165,15 @@  discard block
 block discarded – undo
157 165
 							<input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text">
158 166
 						</dd>';
159 167
 
160
-		if (empty($modSettings['guest_post_no_email']))
161
-			echo '
168
+		if (empty($modSettings['guest_post_no_email'])) {
169
+					echo '
162 170
 						<dt>
163 171
 							<span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span>
164 172
 						</dt>
165 173
 						<dd>
166 174
 							<input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required>
167 175
 						</dd>';
176
+		}
168 177
 	}
169 178
 
170 179
 	// Now show the subject box for this post.
@@ -182,9 +191,10 @@  discard block
 block discarded – undo
182 191
 							<select name="icon" id="icon" onchange="showimage()">';
183 192
 
184 193
 	// Loop through each message icon allowed, adding it to the drop down list.
185
-	foreach ($context['icons'] as $icon)
186
-		echo '
194
+	foreach ($context['icons'] as $icon) {
195
+			echo '
187 196
 								<option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected' : '', '>', $icon['name'], '</option>';
197
+	}
188 198
 
189 199
 	echo '
190 200
 							</select>
@@ -219,9 +229,10 @@  discard block
 block discarded – undo
219 229
 				{
220 230
 					echo '
221 231
 										<optgroup label="', $category['name'], '">';
222
-					foreach ($category['boards'] as $board)
223
-						echo '
232
+					foreach ($category['boards'] as $board) {
233
+											echo '
224 234
 											<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '&nbsp;</option>';
235
+					}
225 236
 					echo '
226 237
 										</optgroup>';
227 238
 				}
@@ -257,9 +268,10 @@  discard block
 block discarded – undo
257 268
 									<span class="label">', $txt['calendar_timezone'], '</span>
258 269
 									<select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>';
259 270
 
260
-			foreach ($context['all_timezones'] as $tz => $tzname)
261
-				echo '
271
+			foreach ($context['all_timezones'] as $tz => $tzname) {
272
+							echo '
262 273
 										<option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>';
274
+			}
263 275
 
264 276
 			echo '
265 277
 									</select>
@@ -325,14 +337,15 @@  discard block
 block discarded – undo
325 337
 									<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check">
326 338
 								</dd>';
327 339
 
328
-		if ($context['poll_options']['guest_vote_enabled'])
329
-			echo '
340
+		if ($context['poll_options']['guest_vote_enabled']) {
341
+					echo '
330 342
 								<dt>
331 343
 									<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
332 344
 								</dt>
333 345
 								<dd>
334 346
 									<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', ' class="input_check">
335 347
 								</dd>';
348
+		}
336 349
 
337 350
 		echo '
338 351
 								<dt>
@@ -353,8 +366,8 @@  discard block
 block discarded – undo
353 366
 					', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
354 367
 
355 368
 	// If we're editing and displaying edit details, show a box where they can say why
356
-	if (isset($context['editing']) && $modSettings['show_modify'])
357
-		echo '
369
+	if (isset($context['editing']) && $modSettings['show_modify']) {
370
+			echo '
358 371
 					<dl>
359 372
 						<dt class="clear">
360 373
 							<span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span>
@@ -363,20 +376,23 @@  discard block
 block discarded – undo
363 376
 							<input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text">
364 377
 						</dd>
365 378
 					</dl>';
379
+	}
366 380
 
367 381
 	// If this message has been edited in the past - display when it was.
368
-	if (isset($context['last_modified']))
369
-		echo '
382
+	if (isset($context['last_modified'])) {
383
+			echo '
370 384
 					<div class="padding smalltext">
371 385
 						', $context['last_modified_text'], '
372 386
 					</div>';
387
+	}
373 388
 
374 389
 	// If the admin has enabled the hiding of the additional options - show a link and image for it.
375
-	if (!empty($modSettings['additional_options_collapsable']))
376
-		echo '
390
+	if (!empty($modSettings['additional_options_collapsable'])) {
391
+			echo '
377 392
 					<div id="postAdditionalOptionsHeader">
378 393
 						<strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong>
379 394
 					</div>';
395
+	}
380 396
 
381 397
 	echo '
382 398
 					<div id="postAdditionalOptions">';
@@ -408,19 +424,21 @@  discard block
 block discarded – undo
408 424
 								<input type="hidden" name="attach_del[]" value="0">
409 425
 								', $txt['uncheck_unwatchd_attach'], ':
410 426
 							</dd>';
411
-		foreach ($context['current_attachments'] as $attachment)
412
-			echo '
427
+		foreach ($context['current_attachments'] as $attachment) {
428
+					echo '
413 429
 							<dd class="smalltext">
414 430
 								<label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', ' class="input_check"> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
415 431
 								!empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label>
416 432
 							</dd>';
433
+		}
417 434
 
418 435
 		echo '
419 436
 						</dl>';
420 437
 
421
-		if (!empty($context['files_in_session_warning']))
422
-			echo '
438
+		if (!empty($context['files_in_session_warning'])) {
439
+					echo '
423 440
 						<div class="smalltext">', $context['files_in_session_warning'], '</div>';
441
+		}
424 442
 	}
425 443
 
426 444
 	// Is the user allowed to post any additional ones? If so give them the boxes to do it!
@@ -473,8 +491,8 @@  discard block
 block discarded – undo
473 491
 								', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '">');
474 492
 
475 493
 		// Show more boxes if they aren't approaching that limit.
476
-		if ($context['num_allowed_attachments'] > 1)
477
-			echo '
494
+		if ($context['num_allowed_attachments'] > 1) {
495
+					echo '
478 496
 										<script>
479 497
 											var allowed_attachments = ', $context['num_allowed_attachments'], ';
480 498
 											var current_attachment = 1;
@@ -495,9 +513,10 @@  discard block
 block discarded – undo
495 513
 									</div>
496 514
 								</div>
497 515
 							</dd>';
498
-		else
499
-			echo '
516
+		} else {
517
+					echo '
500 518
 							</dd>';
519
+		}
501 520
 
502 521
 		// Add any template changes for an alternative upload system here.
503 522
 		call_integration_hook('integrate_upload_template');
@@ -506,21 +525,25 @@  discard block
 block discarded – undo
506 525
 							<dd class="smalltext">';
507 526
 
508 527
 		// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
509
-		if (!empty($modSettings['attachmentCheckExtensions']))
510
-			echo '
528
+		if (!empty($modSettings['attachmentCheckExtensions'])) {
529
+					echo '
511 530
 								', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>';
531
+		}
512 532
 
513
-		if (!empty($context['attachment_restrictions']))
514
-			echo '
533
+		if (!empty($context['attachment_restrictions'])) {
534
+					echo '
515 535
 								', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>';
536
+		}
516 537
 
517
-		if ($context['num_allowed_attachments'] == 0)
518
-			echo '
538
+		if ($context['num_allowed_attachments'] == 0) {
539
+					echo '
519 540
 								', $txt['attach_limit_nag'], '<br>';
541
+		}
520 542
 
521
-		if (!$context['can_post_attachment_unapproved'])
522
-			echo '
543
+		if (!$context['can_post_attachment_unapproved']) {
544
+					echo '
523 545
 								<span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>';
546
+		}
524 547
 
525 548
 		echo '
526 549
 							</dd>
@@ -543,10 +566,11 @@  discard block
 block discarded – undo
543 566
 							<dt><strong>', $txt['subject'], '</strong></dt>
544 567
 							<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
545 568
 
546
-		foreach ($context['drafts'] as $draft)
547
-			echo '
569
+		foreach ($context['drafts'] as $draft) {
570
+					echo '
548 571
 							<dt>', $draft['link'], '</dt>
549 572
 							<dd>', $draft['poster_time'], '</dd>';
573
+		}
550 574
 		echo '
551 575
 						</dl>
552 576
 					</div>';
@@ -571,9 +595,10 @@  discard block
 block discarded – undo
571 595
 						', template_control_richedit_buttons($context['post_box_name']);
572 596
 
573 597
 	// Option to delete an event if user is editing one.
574
-	if ($context['make_event'] && !$context['event']['new'])
575
-		echo '
598
+	if ($context['make_event'] && !$context['event']['new']) {
599
+			echo '
576 600
 						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">';
601
+	}
577 602
 
578 603
 	echo '
579 604
 					</span>
@@ -582,9 +607,10 @@  discard block
 block discarded – undo
582 607
 			<br class="clear">';
583 608
 
584 609
 	// Assuming this isn't a new topic pass across the last message id.
585
-	if (isset($context['topic_last_message']))
586
-		echo '
610
+	if (isset($context['topic_last_message'])) {
611
+			echo '
587 612
 			<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">';
613
+	}
588 614
 
589 615
 	echo '
590 616
 			<input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '">
@@ -726,9 +752,10 @@  discard block
 block discarded – undo
726 752
 
727 753
 						newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \'&nbsp;&#187;</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';';
728 754
 
729
-	if ($context['can_quote'])
730
-		echo '
755
+	if ($context['can_quote']) {
756
+			echo '
731 757
 						newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';';
758
+	}
732 759
 
733 760
 	echo '
734 761
 						newPostsHTML += \'<br class="clear">\';
@@ -771,8 +798,8 @@  discard block
 block discarded – undo
771 798
 			}';
772 799
 
773 800
 	// Code for showing and hiding additional options.
774
-	if (!empty($modSettings['additional_options_collapsable']))
775
-		echo '
801
+	if (!empty($modSettings['additional_options_collapsable'])) {
802
+			echo '
776 803
 			var oSwapAdditionalOptions = new smc_Toggle({
777 804
 				bToggleEnabled: true,
778 805
 				bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ',
@@ -800,10 +827,11 @@  discard block
 block discarded – undo
800 827
 					}
801 828
 				]
802 829
 			});';
830
+	}
803 831
 
804 832
 	// Code for showing and hiding drafts
805
-	if (!empty($context['drafts']))
806
-		echo '
833
+	if (!empty($context['drafts'])) {
834
+			echo '
807 835
 			var oSwapDraftOptions = new smc_Toggle({
808 836
 				bToggleEnabled: true,
809 837
 				bCurrentlyCollapsed: true,
@@ -825,6 +853,7 @@  discard block
 block discarded – undo
825 853
 					}
826 854
 				]
827 855
 			});';
856
+	}
828 857
 
829 858
 	echo '
830 859
 			var oEditorID = "', $context['post_box_name'] ,'";
@@ -845,8 +874,9 @@  discard block
 block discarded – undo
845 874
 		foreach ($context['previous_posts'] as $post)
846 875
 		{
847 876
 			$ignoring = false;
848
-			if (!empty($post['is_ignored']))
849
-				$ignored_posts[] = $ignoring = $post['id'];
877
+			if (!empty($post['is_ignored'])) {
878
+							$ignored_posts[] = $ignoring = $post['id'];
879
+			}
850 880
 
851 881
 			echo '
852 882
 			<div class="windowbg">
@@ -1029,10 +1059,10 @@  discard block
 block discarded – undo
1029 1059
 		<div id="temporary_posting_area" style="display: none;"></div>
1030 1060
 		<script>';
1031 1061
 
1032
-	if ($context['close_window'])
1033
-		echo '
1062
+	if ($context['close_window']) {
1063
+			echo '
1034 1064
 			window.close();';
1035
-	else
1065
+	} else
1036 1066
 	{
1037 1067
 		// Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;).
1038 1068
 		echo '
@@ -1086,11 +1116,12 @@  discard block
 block discarded – undo
1086 1116
 				</p>
1087 1117
 				<ul>';
1088 1118
 
1089
-	foreach ($context['groups'] as $group)
1090
-		echo '
1119
+	foreach ($context['groups'] as $group) {
1120
+			echo '
1091 1121
 					<li>
1092 1122
 						<label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em>
1093 1123
 					</li>';
1124
+	}
1094 1125
 
1095 1126
 	echo '
1096 1127
 					<li>
Please login to merge, or discard this patch.
Themes/default/Display.template.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	echo '
40 40
 		<div id="display_head" class="information">
41 41
 			<h2 class="display_title"><span id="top_subject">', $context['subject'], '</span>', ($context['is_locked']) ? ' <span class="generic_icons lock"></span>' : '', ($context['is_sticky']) ? ' <span class="generic_icons sticky"></span>' : '', '</h2>
42
-			<p>',$txt['started_by'],' ', $context['topic_poster_name'],', ', $context['topic_started_time'],'</p>';
42
+			<p>',$txt['started_by'], ' ', $context['topic_poster_name'], ', ', $context['topic_started_time'], '</p>';
43 43
 
44 44
 	// Next - Prev
45 45
 	echo '
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 			<div id="poll">
75 75
 				<div class="cat_bar">
76 76
 					<h3 class="catbg">
77
-						<span class="generic_icons poll"></span>', $context['poll']['is_locked'] ? '<span class="generic_icons lock"></span>' : '' ,' ', $context['poll']['question'], '
77
+						<span class="generic_icons poll"></span>', $context['poll']['is_locked'] ? '<span class="generic_icons lock"></span>' : '', ' ', $context['poll']['question'], '
78 78
 					</h3>
79 79
 				</div>
80 80
 				<div class="windowbg noup">
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 	// Mobile action - moderation buttons (top)
189 189
 	echo '
190 190
 			<div class="mobile_buttons floatright">
191
-				<a class="button mobile_act">', $txt['mobile_action'],'</a>
192
-				', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">'. $txt['mobile_moderation'].'</a>' : '','
191
+				<a class="button mobile_act">', $txt['mobile_action'], '</a>
192
+				', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', '
193 193
 			</div>';
194 194
 
195 195
 	// Show the topic information - icon, subject, etc.
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
 	// Mobile action - moderation buttons (bottom)
214 214
 	echo '
215 215
 			<div class="mobile_buttons floatright">
216
-				<a class="button mobile_act">', $txt['mobile_action'],'</a>
217
-				', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">'. $txt['mobile_moderation'].'</a>' : '','
216
+				<a class="button mobile_act">', $txt['mobile_action'], '</a>
217
+				', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', '
218 218
 			</div>';
219 219
 
220 220
 	// Show the page index... "Pages: [1]".
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	echo '
249 249
 			<div id="mobile_action" class="popup_container">
250 250
 				<div class="popup_window description">
251
-					<div class="popup_heading">', $txt['mobile_action'],'
251
+					<div class="popup_heading">', $txt['mobile_action'], '
252 252
 					<a href="javascript:void(0);" class="generic_icons hide_popup"></a></div>
253 253
 					', template_button_strip($context['normal_buttons']), '
254 254
 				</div>
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 		echo '
260 260
 			<div id="mobile_moderation" class="popup_container">
261 261
 				<div class="popup_window description">
262
-					<div class="popup_heading">', $txt['mobile_moderation'],'
262
+					<div class="popup_heading">', $txt['mobile_moderation'], '
263 263
 					<a href="javascript:void(0);" class="generic_icons hide_popup"></a></div>
264 264
 					<div id="moderationbuttons_mobile">
265 265
 						', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip_mobile')), '
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 							sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
348 348
 							sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
349 349
 							sTemplateTopSubject: ', JavaScriptEscape('%subject%'), ',
350
-							sTemplateReasonEdit: ', JavaScriptEscape($txt['reason_for_edit'] .': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text quickModifyMargin">'), ',
350
+							sTemplateReasonEdit: ', JavaScriptEscape($txt['reason_for_edit'] . ': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text quickModifyMargin">'), ',
351 351
 							sTemplateReasonNormal: ', JavaScriptEscape('%modify_text'), ',
352 352
 							sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ($context['can_reply']) ? ',
353 353
 							sFormRemoveAccessKeys: \'postmodify\'' : '', '
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
 	// Show the message anchor and a "new" anchor if this message is new.
422 422
 	echo '
423
-				<div class="', $message['css_class'] ,'">', $message['id'] != $context['first_message'] ? '
423
+				<div class="', $message['css_class'], '">', $message['id'] != $context['first_message'] ? '
424 424
 					<a id="msg' . $message['id'] . '"></a>' . ($message['first_new'] ? '<a id="new"></a>' : '') : '', '
425 425
 					<div class="post_wrapper">';
426 426
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 
438 438
 		foreach ($message['custom_fields']['above_member'] as $custom)
439 439
 			echo '
440
-									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
440
+									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
441 441
 
442 442
 		echo '
443 443
 								</ul>
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 	if (!empty($message['custom_fields']['below_avatar']))
474 474
 		foreach ($message['custom_fields']['below_avatar'] as $custom)
475 475
 			echo '
476
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
476
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
477 477
 
478 478
 	// Show the post group icons, but not for guests.
479 479
 	if (!$message['member']['is_guest'])
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 
519 519
 			foreach ($message['custom_fields']['icons'] as $custom)
520 520
 				echo '
521
-										<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
521
+										<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
522 522
 
523 523
 			echo '
524 524
 									</ol>
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 		if (!empty($message['custom_fields']['standard']))
557 557
 			foreach ($message['custom_fields']['standard'] as $custom)
558 558
 				echo '
559
-								<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
559
+								<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
560 560
 
561 561
 	}
562 562
 	// Otherwise, show the guest's email.
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 	if (!empty($message['custom_fields']['bottom_poster']))
595 595
 		foreach ($message['custom_fields']['bottom_poster'] as $custom)
596 596
 			echo '
597
-									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
597
+									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
598 598
 
599 599
 	// Poster info ends.
600 600
 	echo '
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 			$base .= (isset($txt[$base . $count])) ? $count : 'n';
782 782
 
783 783
 			echo '
784
-									<li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] .';'. $context['session_var'] .'='. $context['session_id'], comma_format($count)), '</li>';
784
+									<li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], comma_format($count)), '</li>';
785 785
 		}
786 786
 
787 787
 		echo '
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 		if ($context['can_quote'])
799 799
 			echo '
800 800
 									<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>
801
-									<li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>';
801
+									<li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>';
802 802
 
803 803
 		// Can the user modify the contents of this post? Show the modify inline image.
804 804
 		if ($message['can_modify'])
@@ -820,10 +820,10 @@  discard block
 block discarded – undo
820 820
 		// How about... even... remove it entirely?!
821 821
 		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id']))
822 822
 			echo '
823
-											<li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'],'</a></li>';
823
+											<li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'], '</a></li>';
824 824
 		elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id']))
825 825
 			echo '
826
-											<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
826
+											<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
827 827
 
828 828
 		// What about splitting it off the rest of the topic?
829 829
 		if ($context['can_split'] && !empty($context['real_num_replies']))
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 
882 882
 		foreach ($message['custom_fields']['above_signature'] as $custom)
883 883
 			echo '
884
-									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
884
+									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
885 885
 
886 886
 		echo '
887 887
 								</ul>
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
 
904 904
 		foreach ($message['custom_fields']['below_signature'] as $custom)
905 905
 			echo '
906
-									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
906
+									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
907 907
 
908 908
 		echo '
909 909
 								</ul>
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 	echo '
1005 1005
 				<br class="clear_right">
1006 1006
 				<span id="post_confirm_buttons">
1007
-					', template_control_richedit_buttons($context['post_box_name']) ,'
1007
+					', template_control_richedit_buttons($context['post_box_name']), '
1008 1008
 				</span>';
1009 1009
 		echo '
1010 1010
 					</form>
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
 						sJumpAnchor: "quickreply",
1048 1048
 						bIsFull: true
1049 1049
 					});
1050
-					var oEditorID = "', $context['post_box_name'] ,'";
1050
+					var oEditorID = "', $context['post_box_name'], '";
1051 1051
 					var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
1052 1052
 					var oJumpAnchor = "quickreply";
1053 1053
 				</script>';
Please login to merge, or discard this patch.
Braces   +221 added lines, -151 removed lines patch added patch discarded remove patch
@@ -51,11 +51,13 @@  discard block
 block discarded – undo
51 51
 				<p>';
52 52
 
53 53
 		// Show just numbers...?
54
-		if ($settings['display_who_viewing'] == 1)
55
-				echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
54
+		if ($settings['display_who_viewing'] == 1) {
55
+						echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
56
+		}
56 57
 		// Or show the actual people viewing the topic?
57
-		else
58
-			echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
58
+		else {
59
+					echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
60
+		}
59 61
 
60 62
 		// Now show how many guests are here too.
61 63
 		echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
@@ -93,10 +95,11 @@  discard block
 block discarded – undo
93 95
 						<dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
94 96
 						<dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">';
95 97
 
96
-				if ($context['allow_results_view'])
97
-					echo '
98
+				if ($context['allow_results_view']) {
99
+									echo '
98 100
 							', $option['bar_ndt'], '
99 101
 							<span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';
102
+				}
100 103
 
101 104
 				echo '
102 105
 						</dd>';
@@ -105,9 +108,10 @@  discard block
 block discarded – undo
105 108
 			echo '
106 109
 					</dl>';
107 110
 
108
-			if ($context['allow_results_view'])
109
-				echo '
111
+			if ($context['allow_results_view']) {
112
+							echo '
110 113
 						<p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
114
+			}
111 115
 		}
112 116
 		// They are allowed to vote! Go to it!
113 117
 		else
@@ -116,17 +120,19 @@  discard block
 block discarded – undo
116 120
 						<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
117 121
 
118 122
 			// Show a warning if they are allowed more than one option.
119
-			if ($context['poll']['allowed_warning'])
120
-				echo '
123
+			if ($context['poll']['allowed_warning']) {
124
+							echo '
121 125
 							<p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
126
+			}
122 127
 
123 128
 			echo '
124 129
 							<ul class="options">';
125 130
 
126 131
 			// Show each option with its button - a radio likely.
127
-			foreach ($context['poll']['options'] as $option)
128
-				echo '
132
+			foreach ($context['poll']['options'] as $option) {
133
+							echo '
129 134
 								<li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
135
+			}
130 136
 
131 137
 			echo '
132 138
 							</ul>
@@ -138,9 +144,10 @@  discard block
 block discarded – undo
138 144
 		}
139 145
 
140 146
 		// Is the clock ticking?
141
-		if (!empty($context['poll']['expire_time']))
142
-			echo '
147
+		if (!empty($context['poll']['expire_time'])) {
148
+					echo '
143 149
 						<p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
150
+		}
144 151
 
145 152
 		echo '
146 153
 					</div>
@@ -170,11 +177,13 @@  discard block
 block discarded – undo
170 177
 					<li>
171 178
 						<b class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></b>';
172 179
 
173
-			if ($event['can_edit'])
174
-				echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
180
+			if ($event['can_edit']) {
181
+							echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
182
+			}
175 183
 
176
-			if ($event['can_export'])
177
-				echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
184
+			if ($event['can_export']) {
185
+							echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
186
+			}
178 187
 
179 188
 			echo '
180 189
 						<br>';
@@ -182,14 +191,14 @@  discard block
 block discarded – undo
182 191
 			if (!empty($event['allday']))
183 192
 			{
184 193
 				echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : '';
185
-			}
186
-			else
194
+			} else
187 195
 			{
188 196
 				// Display event info relative to user's local timezone
189 197
 				echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
190 198
 
191
-				if ($event['start_date_local'] != $event['end_date_local'])
192
-					echo trim($event['end_date_local']) . ', ';
199
+				if ($event['start_date_local'] != $event['end_date_local']) {
200
+									echo trim($event['end_date_local']) . ', ';
201
+				}
193 202
 
194 203
 				echo trim($event['end_time_local']);
195 204
 
@@ -198,23 +207,27 @@  discard block
 block discarded – undo
198 207
 				{
199 208
 					echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">';
200 209
 
201
-					if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig'])
202
-						echo trim($event['start_date_orig']), ', ';
210
+					if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) {
211
+											echo trim($event['start_date_orig']), ', ';
212
+					}
203 213
 
204 214
 					echo trim($event['start_time_orig']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
205 215
 
206
-					if ($event['start_date_orig'] != $event['end_date_orig'])
207
-						echo trim($event['end_date_orig']) . ', ';
216
+					if ($event['start_date_orig'] != $event['end_date_orig']) {
217
+											echo trim($event['end_date_orig']) . ', ';
218
+					}
208 219
 
209 220
 					echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)';
210 221
 				}
211 222
 				// Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion
212
-				else
213
-					echo ' ', $event['tz_abbrev'], '</time>';
223
+				else {
224
+									echo ' ', $event['tz_abbrev'], '</time>';
225
+				}
214 226
 			}
215 227
 
216
-			if (!empty($event['location']))
217
-				echo '<br>', $event['location'];
228
+			if (!empty($event['location'])) {
229
+							echo '<br>', $event['location'];
230
+			}
218 231
 
219 232
 			echo '
220 233
 					</li>';
@@ -252,8 +265,9 @@  discard block
 block discarded – undo
252 265
 	$context['removableMessageIDs'] = array();
253 266
 
254 267
 	// Get all the messages...
255
-	while ($message = $context['get_message']())
256
-		template_single_post($message);
268
+	while ($message = $context['get_message']()) {
269
+			template_single_post($message);
270
+	}
257 271
 
258 272
 	echo '
259 273
 				</form>
@@ -290,8 +304,9 @@  discard block
 block discarded – undo
290 304
 			<div id="display_jump_to">&nbsp;</div>';
291 305
 
292 306
 	// Show quickreply
293
-	if ($context['can_reply'])
294
-	template_quickreply();
307
+	if ($context['can_reply']) {
308
+		template_quickreply();
309
+	}
295 310
 
296 311
 	// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
297 312
 	echo '
@@ -304,8 +319,8 @@  discard block
 block discarded – undo
304 319
 			</div>';
305 320
 
306 321
 	// Show the moderation button & pop only if user can moderate
307
-	if ($context['can_moderate_forum'] || $context['user']['is_mod'])
308
-		echo '
322
+	if ($context['can_moderate_forum'] || $context['user']['is_mod']) {
323
+			echo '
309 324
 			<div id="mobile_moderation" class="popup_container">
310 325
 				<div class="popup_window description">
311 326
 					<div class="popup_heading">', $txt['mobile_moderation'],'
@@ -315,6 +330,7 @@  discard block
 block discarded – undo
315 330
 					</div>
316 331
 				</div>
317 332
 			</div>';
333
+	}
318 334
 
319 335
 		echo '
320 336
 				<script>';
@@ -438,9 +454,10 @@  discard block
 block discarded – undo
438 454
 						});
439 455
 					}';
440 456
 
441
-	if (!empty($context['ignoredMsgs']))
442
-		echo '
457
+	if (!empty($context['ignoredMsgs'])) {
458
+			echo '
443 459
 					ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');';
460
+	}
444 461
 
445 462
 	echo '
446 463
 				</script>';
@@ -457,8 +474,9 @@  discard block
 block discarded – undo
457 474
 
458 475
 	$ignoring = false;
459 476
 
460
-	if ($message['can_remove'])
461
-		$context['removableMessageIDs'][] = $message['id'];
477
+	if ($message['can_remove']) {
478
+			$context['removableMessageIDs'][] = $message['id'];
479
+	}
462 480
 
463 481
 	// Are we ignoring this message?
464 482
 	if (!empty($message['is_ignored']))
@@ -484,9 +502,10 @@  discard block
 block discarded – undo
484 502
 							<div class="custom_fields_above_member">
485 503
 								<ul class="nolist">';
486 504
 
487
-		foreach ($message['custom_fields']['above_member'] as $custom)
488
-			echo '
505
+		foreach ($message['custom_fields']['above_member'] as $custom) {
506
+					echo '
489 507
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
508
+		}
490 509
 
491 510
 		echo '
492 511
 								</ul>
@@ -497,9 +516,10 @@  discard block
 block discarded – undo
497 516
 									<h4>';
498 517
 
499 518
 	// Show online and offline buttons?
500
-	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
501
-		echo '
519
+	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
520
+			echo '
502 521
 								', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : '';
522
+	}
503 523
 
504 524
 
505 525
 	// Show a link to the member's profile.
@@ -512,51 +532,59 @@  discard block
 block discarded – undo
512 532
 
513 533
 
514 534
 	// Show the user's avatar.
515
-	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
516
-		echo '
535
+	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
536
+			echo '
517 537
 								<li class="avatar">
518 538
 									<a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a>
519 539
 								</li>';
540
+	}
520 541
 
521 542
 	// Are there any custom fields below the avatar?
522
-	if (!empty($message['custom_fields']['below_avatar']))
523
-		foreach ($message['custom_fields']['below_avatar'] as $custom)
543
+	if (!empty($message['custom_fields']['below_avatar'])) {
544
+			foreach ($message['custom_fields']['below_avatar'] as $custom)
524 545
 			echo '
525 546
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
547
+	}
526 548
 
527 549
 	// Show the post group icons, but not for guests.
528
-	if (!$message['member']['is_guest'])
529
-		echo '
550
+	if (!$message['member']['is_guest']) {
551
+			echo '
530 552
 								<li class="icons">', $message['member']['group_icons'], '</li>';
553
+	}
531 554
 
532 555
 	// Show the member's primary group (like 'Administrator') if they have one.
533
-	if (!empty($message['member']['group']))
534
-		echo '
556
+	if (!empty($message['member']['group'])) {
557
+			echo '
535 558
 								<li class="membergroup">', $message['member']['group'], '</li>';
559
+	}
536 560
 
537 561
 	// Show the member's custom title, if they have one.
538
-	if (!empty($message['member']['title']))
539
-		echo '
562
+	if (!empty($message['member']['title'])) {
563
+			echo '
540 564
 								<li class="title">', $message['member']['title'], '</li>';
565
+	}
541 566
 
542 567
 	// Don't show these things for guests.
543 568
 	if (!$message['member']['is_guest'])
544 569
 	{
545 570
 
546 571
 		// 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.
547
-		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group']))
548
-			echo '
572
+		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) {
573
+					echo '
549 574
 								<li class="postgroup">', $message['member']['post_group'], '</li>';
575
+		}
550 576
 
551 577
 		// Show how many posts they have made.
552
-		if (!isset($context['disabled_fields']['posts']))
553
-			echo '
578
+		if (!isset($context['disabled_fields']['posts'])) {
579
+					echo '
554 580
 								<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
581
+		}
555 582
 
556 583
 		// Show their personal text?
557
-		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb']))
558
-			echo '
584
+		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) {
585
+					echo '
559 586
 								<li class="blurb">', $message['member']['blurb'], '</li>';
587
+		}
560 588
 
561 589
 		// Any custom fields to show as icons?
562 590
 		if (!empty($message['custom_fields']['icons']))
@@ -565,9 +593,10 @@  discard block
 block discarded – undo
565 593
 								<li class="im_icons">
566 594
 									<ol>';
567 595
 
568
-			foreach ($message['custom_fields']['icons'] as $custom)
569
-				echo '
596
+			foreach ($message['custom_fields']['icons'] as $custom) {
597
+							echo '
570 598
 										<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
599
+			}
571 600
 
572 601
 			echo '
573 602
 									</ol>
@@ -582,19 +611,22 @@  discard block
 block discarded – undo
582 611
 									<ol class="profile_icons">';
583 612
 
584 613
 			// Don't show an icon if they haven't specified a website.
585
-			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website']))
586
-				echo '
614
+			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) {
615
+							echo '
587 616
 										<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
617
+			}
588 618
 
589 619
 			// Since we know this person isn't a guest, you *can* message them.
590
-			if ($context['can_send_pm'])
591
-				echo '
620
+			if ($context['can_send_pm']) {
621
+							echo '
592 622
 										<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>';
623
+			}
593 624
 
594 625
 			// Show the email if necessary
595
-			if (!empty($message['member']['email']) && $message['member']['show_email'])
596
-				echo '
626
+			if (!empty($message['member']['email']) && $message['member']['show_email']) {
627
+							echo '
597 628
 										<li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
629
+			}
598 630
 
599 631
 				echo '
600 632
 									</ol>
@@ -602,48 +634,56 @@  discard block
 block discarded – undo
602 634
 		}
603 635
 
604 636
 		// Any custom fields for standard placement?
605
-		if (!empty($message['custom_fields']['standard']))
606
-			foreach ($message['custom_fields']['standard'] as $custom)
637
+		if (!empty($message['custom_fields']['standard'])) {
638
+					foreach ($message['custom_fields']['standard'] as $custom)
607 639
 				echo '
608 640
 								<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
641
+		}
609 642
 
610 643
 	}
611 644
 	// Otherwise, show the guest's email.
612
-	elseif (!empty($message['member']['email']) && $message['member']['show_email'])
613
-		echo '
645
+	elseif (!empty($message['member']['email']) && $message['member']['show_email']) {
646
+			echo '
614 647
 								<li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
648
+	}
615 649
 
616 650
 	// Show the IP to this user for this post - because you can moderate?
617
-	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
618
-		echo '
651
+	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
652
+			echo '
619 653
 								<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>';
654
+	}
620 655
 
621 656
 	// Or, should we show it because this is you?
622
-	elseif ($message['can_see_ip'])
623
-		echo '
657
+	elseif ($message['can_see_ip']) {
658
+			echo '
624 659
 								<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>';
660
+	}
625 661
 
626 662
 	// Okay, are you at least logged in? Then we can show something about why IPs are logged...
627
-	elseif (!$context['user']['is_guest'])
628
-		echo '
663
+	elseif (!$context['user']['is_guest']) {
664
+			echo '
629 665
 								<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
666
+	}
630 667
 
631 668
 	// Otherwise, you see NOTHING!
632
-	else
633
-		echo '
669
+	else {
670
+			echo '
634 671
 								<li class="poster_ip">', $txt['logged'], '</li>';
672
+	}
635 673
 
636 674
 	// Are we showing the warning status?
637 675
 	// Don't show these things for guests.
638
-	if (!$message['member']['is_guest'] && $message['member']['can_see_warning'])
639
-		echo '
676
+	if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) {
677
+			echo '
640 678
 								<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>';
679
+	}
641 680
 
642 681
 	// Are there any custom fields to show at the bottom of the poster info?
643
-	if (!empty($message['custom_fields']['bottom_poster']))
644
-		foreach ($message['custom_fields']['bottom_poster'] as $custom)
682
+	if (!empty($message['custom_fields']['bottom_poster'])) {
683
+			foreach ($message['custom_fields']['bottom_poster'] as $custom)
645 684
 			echo '
646 685
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
686
+	}
647 687
 
648 688
 	// Poster info ends.
649 689
 	echo '
@@ -672,9 +712,10 @@  discard block
 block discarded – undo
672 712
 	echo '
673 713
 									<span class="smalltext modified" id="modified_', $message['id'], '">';
674 714
 
675
-	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name']))
676
-		echo
715
+	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) {
716
+			echo
677 717
 										$message['modified']['last_edit_text'];
718
+	}
678 719
 
679 720
 	echo '
680 721
 									</span>';
@@ -685,22 +726,24 @@  discard block
 block discarded – undo
685 726
 							</div>';
686 727
 
687 728
 	// Ignoring this user? Hide the post.
688
-	if ($ignoring)
689
-		echo '
729
+	if ($ignoring) {
730
+			echo '
690 731
 							<div id="msg_', $message['id'], '_ignored_prompt">
691 732
 								', $txt['ignoring_user'], '
692 733
 								<a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
693 734
 							</div>';
735
+	}
694 736
 
695 737
 	// Show the post itself, finally!
696 738
 	echo '
697 739
 							<div class="post">';
698 740
 
699
-	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
700
-		echo '
741
+	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) {
742
+			echo '
701 743
 								<div class="approve_post">
702 744
 									', $txt['post_awaiting_approval'], '
703 745
 								</div>';
746
+	}
704 747
 	echo '
705 748
 								<div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div>
706 749
 							</div>';
@@ -717,9 +760,9 @@  discard block
 block discarded – undo
717 760
 		foreach ($message['attachment'] as $attachment)
718 761
 		{
719 762
 			// Do we want this attachment to not be showed here?
720
-			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']]))
721
-				continue;
722
-			elseif (!$div_output)
763
+			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) {
764
+							continue;
765
+			} elseif (!$div_output)
723 766
 			{
724 767
 				$div_output = true;
725 768
 
@@ -735,9 +778,10 @@  discard block
 block discarded – undo
735 778
 								<fieldset>
736 779
 									<legend>', $txt['attach_awaiting_approve'];
737 780
 
738
-				if ($context['can_approve'])
739
-					echo '
781
+				if ($context['can_approve']) {
782
+									echo '
740 783
 										&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
784
+				}
741 785
 
742 786
 				echo '
743 787
 									</legend>';
@@ -751,12 +795,13 @@  discard block
 block discarded – undo
751 795
 				echo '
752 796
 										<div class="attachments_top">';
753 797
 
754
-				if ($attachment['thumbnail']['has_thumb'])
755
-					echo '
798
+				if ($attachment['thumbnail']['has_thumb']) {
799
+									echo '
756 800
 											<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>';
757
-				else
758
-					echo '
801
+				} else {
802
+									echo '
759 803
 											<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">';
804
+				}
760 805
 
761 806
 				echo '
762 807
 										</div>';
@@ -766,9 +811,10 @@  discard block
 block discarded – undo
766 811
 										<div class="attachments_bot">
767 812
 											<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*">&nbsp;' . $attachment['name'] . '</a> ';
768 813
 
769
-			if (!$attachment['is_approved'] && $context['can_approve'])
770
-				echo '
814
+			if (!$attachment['is_approved'] && $context['can_approve']) {
815
+							echo '
771 816
 											[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
817
+			}
772 818
 			echo '
773 819
 											<br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), '
774 820
 										</div>';
@@ -777,33 +823,38 @@  discard block
 block discarded – undo
777 823
 									</div>';
778 824
 
779 825
 			// Next attachment line ?
780
-			if (++$i % $attachments_per_line === 0)
781
-				echo '
826
+			if (++$i % $attachments_per_line === 0) {
827
+							echo '
782 828
 									<br>';
829
+			}
783 830
 		}
784 831
 
785 832
 		// If we had unapproved attachments clean up.
786
-		if ($last_approved_state == 0)
787
-			echo '
833
+		if ($last_approved_state == 0) {
834
+					echo '
788 835
 								</fieldset>';
836
+		}
789 837
 
790 838
 		// Only do this if we output a div above - otherwise it'll break things
791
-		if ($div_output)
792
-			echo '
839
+		if ($div_output) {
840
+					echo '
793 841
 							</div>';
842
+		}
794 843
 	}
795 844
 
796 845
 	// And stuff below the attachments.
797
-	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
798
-	echo '
846
+	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) {
847
+		echo '
799 848
 							<div class="under_message">';
849
+	}
800 850
 
801 851
 	// Maybe they want to report this post to the moderator(s)?
802
-	if ($context['can_report_moderator'])
803
-		echo '
852
+	if ($context['can_report_moderator']) {
853
+			echo '
804 854
 								<ul class="floatright smalltext">
805 855
 									<li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>
806 856
 								</ul>';
857
+	}
807 858
 
808 859
 	// What about likes?
809 860
 	if (!empty($modSettings['enable_likes']))
@@ -844,78 +895,91 @@  discard block
 block discarded – undo
844 895
 								<ul class="quickbuttons">';
845 896
 
846 897
 		// Can they quote? if so they can select and quote as well!
847
-		if ($context['can_quote'])
848
-			echo '
898
+		if ($context['can_quote']) {
899
+					echo '
849 900
 									<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>
850 901
 									<li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>';
902
+		}
851 903
 
852 904
 		// Can the user modify the contents of this post? Show the modify inline image.
853
-		if ($message['can_modify'])
854
-			echo '
905
+		if ($message['can_modify']) {
906
+					echo '
855 907
 									<li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>';
908
+		}
856 909
 
857
-		if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
858
-			echo '
910
+		if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
911
+					echo '
859 912
 									<li class="post_options">', $txt['post_options'];
913
+		}
860 914
 
861 915
 		echo '
862 916
 										<ul>';
863 917
 
864 918
 		// Can the user modify the contents of this post?
865
-		if ($message['can_modify'])
866
-			echo '
919
+		if ($message['can_modify']) {
920
+					echo '
867 921
 											<li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>';
922
+		}
868 923
 
869 924
 		// How about... even... remove it entirely?!
870
-		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id']))
871
-			echo '
925
+		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) {
926
+					echo '
872 927
 											<li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'],'</a></li>';
873
-		elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id']))
874
-			echo '
928
+		} elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) {
929
+					echo '
875 930
 											<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
931
+		}
876 932
 
877 933
 		// What about splitting it off the rest of the topic?
878
-		if ($context['can_split'] && !empty($context['real_num_replies']))
879
-			echo '
934
+		if ($context['can_split'] && !empty($context['real_num_replies'])) {
935
+					echo '
880 936
 											<li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>';
937
+		}
881 938
 
882 939
 		// Can we issue a warning because of this post? Remember, we can't give guests warnings.
883
-		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
884
-			echo '
940
+		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) {
941
+					echo '
885 942
 											<li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>';
943
+		}
886 944
 
887 945
 		// Can we restore topics?
888
-		if ($context['can_restore_msg'])
889
-			echo '
946
+		if ($context['can_restore_msg']) {
947
+					echo '
890 948
 											<li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>';
949
+		}
891 950
 
892 951
 		// Maybe we can approve it, maybe we should?
893
-		if ($message['can_approve'])
894
-			echo '
952
+		if ($message['can_approve']) {
953
+					echo '
895 954
 											<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>';
955
+		}
896 956
 
897 957
 		// Maybe we can unapprove it?
898
-		if ($message['can_unapprove'])
899
-			echo '
958
+		if ($message['can_unapprove']) {
959
+					echo '
900 960
 											<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>';
961
+		}
901 962
 
902 963
 		echo '
903 964
 										</ul>
904 965
 									</li>';
905 966
 
906 967
 		// Show a checkbox for quick moderation?
907
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
908
-			echo '
968
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) {
969
+					echo '
909 970
 									<li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
971
+		}
910 972
 
911
-		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
912
-			echo '
973
+		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
974
+					echo '
913 975
 								</ul>';
976
+		}
914 977
 	}
915 978
 
916
-	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
917
-	echo '
979
+	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) {
980
+		echo '
918 981
 							</div>';
982
+	}
919 983
 
920 984
 	echo '
921 985
 						</div>
@@ -928,9 +992,10 @@  discard block
 block discarded – undo
928 992
 							<div class="custom_fields_above_signature">
929 993
 								<ul class="nolist">';
930 994
 
931
-		foreach ($message['custom_fields']['above_signature'] as $custom)
932
-			echo '
995
+		foreach ($message['custom_fields']['above_signature'] as $custom) {
996
+					echo '
933 997
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
998
+		}
934 999
 
935 1000
 		echo '
936 1001
 								</ul>
@@ -938,9 +1003,10 @@  discard block
 block discarded – undo
938 1003
 	}
939 1004
 
940 1005
 	// Show the member's signature?
941
-	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
942
-		echo '
1006
+	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
1007
+			echo '
943 1008
 							<div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>';
1009
+	}
944 1010
 
945 1011
 
946 1012
 	// Are there any custom profile fields for below the signature?
@@ -950,9 +1016,10 @@  discard block
 block discarded – undo
950 1016
 							<div class="custom_fields_below_signature">
951 1017
 								<ul class="nolist">';
952 1018
 
953
-		foreach ($message['custom_fields']['below_signature'] as $custom)
954
-			echo '
1019
+		foreach ($message['custom_fields']['below_signature'] as $custom) {
1020
+					echo '
955 1021
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
1022
+		}
956 1023
 
957 1024
 		echo '
958 1025
 								</ul>
@@ -1000,8 +1067,8 @@  discard block
 block discarded – undo
1000 1067
 						<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">';
1001 1068
 
1002 1069
 		// Guests just need more.
1003
-		if ($context['user']['is_guest'])
1004
-			echo '
1070
+		if ($context['user']['is_guest']) {
1071
+					echo '
1005 1072
 						<dl id="post_header">
1006 1073
 							<dt>
1007 1074
 								', $txt['name'], ':
@@ -1016,6 +1083,7 @@  discard block
 block discarded – undo
1016 1083
 								<input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required>
1017 1084
 							</dd>
1018 1085
 						</dl>';
1086
+		}
1019 1087
 
1020 1088
 		echo '
1021 1089
 						', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '
@@ -1063,8 +1131,8 @@  discard block
 block discarded – undo
1063 1131
 		<br class="clear">';
1064 1132
 
1065 1133
 	// draft autosave available and the user has it enabled?
1066
-	if (!empty($context['drafts_autosave']))
1067
-		echo '
1134
+	if (!empty($context['drafts_autosave'])) {
1135
+			echo '
1068 1136
 			<script>
1069 1137
 				var oDraftAutoSave = new smf_DraftAutoSave({
1070 1138
 					sSelf: \'oDraftAutoSave\',
@@ -1076,10 +1144,12 @@  discard block
 block discarded – undo
1076 1144
 					iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), '
1077 1145
 				});
1078 1146
 			</script>';
1147
+	}
1079 1148
 
1080
-	if ($context['show_spellchecking'])
1081
-		echo '
1149
+	if ($context['show_spellchecking']) {
1150
+			echo '
1082 1151
 			<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>';
1152
+	}
1083 1153
 
1084 1154
 	echo '
1085 1155
 				<script>
Please login to merge, or discard this patch.
Themes/default/GenericMenu.template.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		<a class="menu_icon mobile_generic_menu_', $context['cur_menu_id'], '"></a>
53 53
 		<div id="mobile_generic_menu_', $context['cur_menu_id'], '" class="popup_container">
54 54
 			<div class="popup_window description">
55
-				<div class="popup_heading">', $txt['mobile_user_menu'],'
55
+				<div class="popup_heading">', $txt['mobile_user_menu'], '
56 56
 				<a href="javascript:void(0);" class="generic_icons hide_popup"></a></div>
57 57
 				', template_generic_menu($menu_context), '
58 58
 			</div>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		</script>';
68 68
 }
69 69
 
70
-function template_generic_menu (&$menu_context)
70
+function template_generic_menu(&$menu_context)
71 71
 {
72 72
 	global $context;
73 73
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	foreach ($menu_context['sections'] as $section)
82 82
 	{
83 83
 		echo '
84
-						<li ', !empty($section['areas']) ? 'class="subsections"' : '', '><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'] , '</a>
84
+						<li ', !empty($section['areas']) ? 'class="subsections"' : '', '><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'], '</a>
85 85
 							<ul>';
86 86
 
87 87
 		// For every area of this section show a link to that area (bold if it's currently selected.)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 				echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
221 221
 
222 222
 			if (!empty($selected_tab['help']) || !empty($tab_context['help']))
223
-				echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>';
223
+				echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>';
224 224
 
225 225
 			echo $tab_context['title'];
226 226
 		}
Please login to merge, or discard this patch.
Braces   +50 added lines, -37 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
 		foreach ($section['areas'] as $i => $area)
90 90
 		{
91 91
 			// Not supposed to be printed?
92
-			if (empty($area['label']))
93
-				continue;
92
+			if (empty($area['label'])) {
93
+							continue;
94
+			}
94 95
 
95 96
 			echo '
96 97
 								<li', !empty($area['subsections']) ? ' class="subsections"' : '', '>';
@@ -99,8 +100,9 @@  discard block
 block discarded – undo
99 100
 									<a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>';
100 101
 
101 102
 			// Is this the current area, or just some area?
102
-			if (!empty($area['selected']) && empty($context['tabs']))
103
-					$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
103
+			if (!empty($area['selected']) && empty($context['tabs'])) {
104
+								$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
105
+			}
104 106
 
105 107
 			// Are there any subsections?
106 108
 			if (!empty($area['subsections']))
@@ -110,8 +112,9 @@  discard block
 block discarded – undo
110 112
 
111 113
 				foreach ($area['subsections'] as $sa => $sub)
112 114
 				{
113
-					if (!empty($sub['disabled']))
114
-						continue;
115
+					if (!empty($sub['disabled'])) {
116
+											continue;
117
+					}
115 118
 
116 119
 					$url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;
117 120
 
@@ -158,8 +161,9 @@  discard block
 block discarded – undo
158 161
 							<h3 class="catbg">';
159 162
 
160 163
 		// The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available
161
-		if (function_exists('template_admin_quick_search'))
162
-			template_admin_quick_search();
164
+		if (function_exists('template_admin_quick_search')) {
165
+					template_admin_quick_search();
166
+		}
163 167
 
164 168
 		// Exactly how many tabs do we have?
165 169
 		if (!empty($context['tabs']))
@@ -174,30 +178,36 @@  discard block
 block discarded – undo
174 178
 				}
175 179
 
176 180
 				// Did this not even exist - or do we not have a label?
177
-				if (!isset($tab_context['tabs'][$id]))
178
-					$tab_context['tabs'][$id] = array('label' => $tab['label']);
179
-				elseif (!isset($tab_context['tabs'][$id]['label']))
180
-					$tab_context['tabs'][$id]['label'] = $tab['label'];
181
+				if (!isset($tab_context['tabs'][$id])) {
182
+									$tab_context['tabs'][$id] = array('label' => $tab['label']);
183
+				} elseif (!isset($tab_context['tabs'][$id]['label'])) {
184
+									$tab_context['tabs'][$id]['label'] = $tab['label'];
185
+				}
181 186
 
182 187
 				// Has a custom URL defined in the main admin structure?
183
-				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
184
-					$tab_context['tabs'][$id]['url'] = $tab['url'];
188
+				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) {
189
+									$tab_context['tabs'][$id]['url'] = $tab['url'];
190
+				}
185 191
 
186 192
 				// Any additional paramaters for the url?
187
-				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
188
-					$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
193
+				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) {
194
+									$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
195
+				}
189 196
 
190 197
 				// Has it been deemed selected?
191
-				if (!empty($tab['is_selected']))
192
-					$tab_context['tabs'][$id]['is_selected'] = true;
198
+				if (!empty($tab['is_selected'])) {
199
+									$tab_context['tabs'][$id]['is_selected'] = true;
200
+				}
193 201
 
194 202
 				// Does it have its own help?
195
-				if (!empty($tab['help']))
196
-					$tab_context['tabs'][$id]['help'] = $tab['help'];
203
+				if (!empty($tab['help'])) {
204
+									$tab_context['tabs'][$id]['help'] = $tab['help'];
205
+				}
197 206
 
198 207
 				// Is this the last one?
199
-				if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
200
-					$tab_context['tabs'][$id]['is_last'] = true;
208
+				if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) {
209
+									$tab_context['tabs'][$id]['is_last'] = true;
210
+				}
201 211
 			}
202 212
 
203 213
 			// Find the selected tab
@@ -214,17 +224,18 @@  discard block
 block discarded – undo
214 224
 		// Show an icon and/or a help item?
215 225
 		if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help']))
216 226
 		{
217
-			if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']))
218
-				echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
219
-			elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon']))
220
-				echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
227
+			if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) {
228
+							echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
229
+			} elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) {
230
+							echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
231
+			}
221 232
 
222
-			if (!empty($selected_tab['help']) || !empty($tab_context['help']))
223
-				echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>';
233
+			if (!empty($selected_tab['help']) || !empty($tab_context['help'])) {
234
+							echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>';
235
+			}
224 236
 
225 237
 			echo $tab_context['title'];
226
-		}
227
-		else
238
+		} else
228 239
 		{
229 240
 			echo '
230 241
 							', $tab_context['title'];
@@ -237,11 +248,12 @@  discard block
 block discarded – undo
237 248
 	}
238 249
 
239 250
 	// Shall we use the tabs? Yes, it's the only known way!
240
-	if (!empty($selected_tab['description']) || !empty($tab_context['description']))
241
-		echo '
251
+	if (!empty($selected_tab['description']) || !empty($tab_context['description'])) {
252
+			echo '
242 253
 					<p class="information">
243 254
 						', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
244 255
 					</p>';
256
+	}
245 257
 
246 258
 	// Print out all the items in this tab (if any).
247 259
 	if (!empty($context['tabs']))
@@ -253,8 +265,9 @@  discard block
 block discarded – undo
253 265
 
254 266
 		foreach ($tab_context['tabs'] as $sa => $tab)
255 267
 		{
256
-			if (!empty($tab['disabled']))
257
-				continue;
268
+			if (!empty($tab['disabled'])) {
269
+							continue;
270
+			}
258 271
 
259 272
 			if (!empty($tab['is_selected']))
260 273
 			{
@@ -262,12 +275,12 @@  discard block
 block discarded – undo
262 275
 							<li>
263 276
 								<a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
264 277
 							</li>';
265
-			}
266
-			else
267
-				echo '
278
+			} else {
279
+							echo '
268 280
 							<li>
269 281
 								<a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
270 282
 							</li>';
283
+			}
271 284
 		}
272 285
 
273 286
 		// the end of tabs
Please login to merge, or discard this patch.
Themes/default/Themes.template.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 					</dd>';
614 614
 		}
615 615
 		// A Textarea?
616
-        	elseif ($setting['type'] == 'textarea')
616
+			elseif ($setting['type'] == 'textarea')
617 617
 		{
618 618
 			echo '
619 619
 					<dt>
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 					</dt>
627 627
 					<dd>
628 628
 						<textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>';
629
-                echo '
629
+				echo '
630 630
                 			</dd>';
631 631
 		}
632 632
 		// A regular input box, then?
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	echo '
25 25
 		<div class="cat_bar">
26 26
 		<h3 class="catbg">
27
-			<a href="', $scripturl, '?action=helpadmin;help=themes" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>
27
+			<a href="', $scripturl, '?action=helpadmin;help=themes" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>
28 28
 			', $txt['themeadmin_title'], '
29 29
 		</h3>
30 30
 		</div>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	if (isset($_GET['done']))
193 193
 		echo '
194 194
 	<div class="infobox">
195
-		', $txt['theme_confirmed_'. $_GET['done']] ,'
195
+		', $txt['theme_confirmed_' . $_GET['done']], '
196 196
 	</div>';
197 197
 
198 198
 	echo '
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 			<div class="cat_bar">
219 219
 				<h3 class="catbg">
220 220
 					<span class="floatleft">
221
-						', (!empty($theme['enable']) || $theme['id'] == 1 ? '<a href="'. $scripturl .'?action=admin;area=theme;th='. $theme['id'] .';'. $context['session_var'] .'='. $context['session_id'] .';sa=list">'. $theme['name'] .'</a>' : $theme['name'] ),'', (!empty($theme['version']) ? ' <em>(' . $theme['version'] . ')</em>' : ''), '
221
+						', (!empty($theme['enable']) || $theme['id'] == 1 ? '<a href="' . $scripturl . '?action=admin;area=theme;th=' . $theme['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';sa=list">' . $theme['name'] . '</a>' : $theme['name']), '', (!empty($theme['version']) ? ' <em>(' . $theme['version'] . ')</em>' : ''), '
222 222
 					</span>';
223 223
 
224 224
 			// You *cannot* disable/enable/delete the default theme. It's important!
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
 				// Enable/Disable.
231 231
 				echo '
232
-					<a href="', $scripturl, '?action=admin;area=theme;sa=enable;th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['admin-tre_token_var'], '=', $context['admin-tre_token'], '', (!empty($theme['enable']) ? ';disabled' : '') ,'" data-confirm="', $txt['theme_'. (!empty($theme['enable']) ? 'disable' : 'enable') .'_confirm'], '" class="you_sure"><span class="generic_icons ',!empty($theme['enable']) ? 'disable' : 'enable','" title="', $txt['theme_'. (!empty($theme['enable']) ? 'disable' : 'enable')] ,'"></span></a>';
232
+					<a href="', $scripturl, '?action=admin;area=theme;sa=enable;th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['admin-tre_token_var'], '=', $context['admin-tre_token'], '', (!empty($theme['enable']) ? ';disabled' : ''), '" data-confirm="', $txt['theme_' . (!empty($theme['enable']) ? 'disable' : 'enable') . '_confirm'], '" class="you_sure"><span class="generic_icons ', !empty($theme['enable']) ? 'disable' : 'enable', '" title="', $txt['theme_' . (!empty($theme['enable']) ? 'disable' : 'enable')], '"></span></a>';
233 233
 
234 234
 				// Deleting.
235 235
 				echo '
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 		<form action="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['theme_settings']['theme_id'], '" method="post" accept-charset="', $context['character_set'], '">
457 457
 			<div class="cat_bar">
458 458
 				<h3 class="catbg">
459
-					<a href="', $scripturl, '?action=helpadmin;help=theme_settings" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ', $txt['theme_settings'], ' - ', $context['theme_settings']['name'], '
459
+					<a href="', $scripturl, '?action=helpadmin;help=theme_settings" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ', $txt['theme_settings'], ' - ', $context['theme_settings']['name'], '
460 460
 				</h3>
461 461
 			</div>
462 462
 			<br>';
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 			echo '
626 626
 					</dt>
627 627
 					<dd>
628
-						<textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>';
628
+						<textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>';
629 629
                 echo '
630 630
                 			</dd>';
631 631
 		}
@@ -809,14 +809,14 @@  discard block
 block discarded – undo
809 809
 	if (!empty($context['error_message']))
810 810
 		echo '
811 811
 			<p>
812
-				', $context['error_message'] ,'
812
+				', $context['error_message'], '
813 813
 			</p>';
814 814
 
815 815
 	// Not much to show except a link back...
816 816
 	else
817 817
 		echo '
818 818
 			<p>
819
-				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_'. (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') .'_message'], '
819
+				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], '
820 820
 			</p>
821 821
 			<p>
822 822
 				<a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a>
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
 		echo '
1157 1157
 				<label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br>
1158 1158
 				<div class="centertext">
1159
-					<textarea id="on_line', $part['line'] ,'" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1159
+					<textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1160 1160
 				</div>';
1161 1161
 
1162 1162
 	echo '
Please login to merge, or discard this patch.
Braces   +106 added lines, -78 removed lines patch added patch discarded remove patch
@@ -54,9 +54,10 @@  discard block
 block discarded – undo
54 54
 					<dd>
55 55
 						<div id="known_themes_list">';
56 56
 
57
-	foreach ($context['themes'] as $theme)
58
-		echo '
57
+	foreach ($context['themes'] as $theme) {
58
+			echo '
59 59
 							<label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>';
60
+	}
60 61
 
61 62
 		echo '
62 63
 						</div>
@@ -73,9 +74,10 @@  discard block
 block discarded – undo
73 74
 						<select name="options[theme_guests]" id="theme_guests">';
74 75
 
75 76
 	// Put an option for each theme in the select box.
76
-	foreach ($context['themes'] as $theme)
77
-		echo '
77
+	foreach ($context['themes'] as $theme) {
78
+			echo '
78 79
 							<option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';
80
+	}
79 81
 
80 82
 	echo '
81 83
 						</select>
@@ -90,9 +92,10 @@  discard block
 block discarded – undo
90 92
 							<option value="0">', $txt['theme_forum_default'], '</option>';
91 93
 
92 94
 	// Same thing, this time for changing the theme of everyone.
93
-	foreach ($context['themes'] as $theme)
94
-		echo '
95
+	foreach ($context['themes'] as $theme) {
96
+			echo '
95 97
 							<option value="', $theme['id'], '">', $theme['name'], '</option>';
98
+	}
96 99
 
97 100
 	echo '
98 101
 						</select>
@@ -189,11 +192,12 @@  discard block
 block discarded – undo
189 192
 	global $context, $scripturl, $txt;
190 193
 
191 194
 	// Show a nice confirmation message.
192
-	if (isset($_GET['done']))
193
-		echo '
195
+	if (isset($_GET['done'])) {
196
+			echo '
194 197
 	<div class="infobox">
195 198
 		', $txt['theme_confirmed_'. $_GET['done']] ,'
196 199
 	</div>';
200
+	}
197 201
 
198 202
 	echo '
199 203
 	<div id="admincenter">';
@@ -353,22 +357,24 @@  discard block
 block discarded – undo
353 357
 					<dt ', $context['theme_options_reset'] ? 'style="width:50%"' : '', '>';
354 358
 
355 359
 		// Show the change option box ?
356
-		if ($context['theme_options_reset'])
357
-			echo '
360
+		if ($context['theme_options_reset']) {
361
+					echo '
358 362
 						<span class="floatleft"><select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;">
359 363
 							<option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option>
360 364
 							<option value="1">', $txt['themeadmin_reset_options_change'], '</option>
361 365
 							<option value="2">', $txt['themeadmin_reset_options_default'], '</option>
362 366
 						</select>&nbsp;</span>';
367
+		}
363 368
 
364 369
 		// display checkbox options
365 370
 		if ($setting['type'] == 'checkbox')
366 371
 		{
367 372
 			echo '
368 373
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
369
-			if (isset($setting['description']))
370
-				echo '
374
+			if (isset($setting['description'])) {
375
+							echo '
371 376
 						<br><span class="smalltext">', $setting['description'], '</span>';
377
+			}
372 378
 		echo '
373 379
 					</dt>
374 380
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>
@@ -380,9 +386,10 @@  discard block
 block discarded – undo
380 386
 		{
381 387
 			echo '
382 388
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
383
-			if (isset($setting['description']))
384
-				echo '
389
+			if (isset($setting['description'])) {
390
+							echo '
385 391
 						<br><span class="smalltext">', $setting['description'], '</span>';
392
+			}
386 393
 		echo '
387 394
 					</dt>
388 395
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>
@@ -402,9 +409,10 @@  discard block
 block discarded – undo
402 409
 		{
403 410
 			echo '
404 411
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
405
-			if (isset($setting['description']))
406
-				echo '
412
+			if (isset($setting['description'])) {
413
+							echo '
407 414
 						<br><span class="smalltext">', $setting['description'], '</span>';
415
+			}
408 416
 		echo '
409 417
 					</dt>
410 418
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>';
@@ -417,8 +425,7 @@  discard block
 block discarded – undo
417 425
 
418 426
 				echo '
419 427
 						<input type="number"', $min . $max . $step;
420
-			}
421
-			else
428
+			} else
422 429
 			{
423 430
 				echo '
424 431
 						<input type="text"';
@@ -462,8 +469,8 @@  discard block
 block discarded – undo
462 469
 			<br>';
463 470
 
464 471
 	// @todo Why can't I edit the default theme popup.
465
-	if ($context['theme_settings']['theme_id'] != 1)
466
-		echo '
472
+	if ($context['theme_settings']['theme_id'] != 1) {
473
+			echo '
467 474
 			<div class="cat_bar">
468 475
 				<h3 class="catbg config_hd">
469 476
 					', $txt['theme_edit'], '
@@ -479,6 +486,7 @@  discard block
 block discarded – undo
479 486
 					</li>
480 487
 				</ul>
481 488
 			</div>';
489
+	}
482 490
 
483 491
 	echo '
484 492
 			<div class="cat_bar">
@@ -532,9 +540,10 @@  discard block
 block discarded – undo
532 540
 					<dd>
533 541
 						<select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">';
534 542
 
535
-		foreach ($context['theme_variants'] as $key => $variant)
536
-			echo '
543
+		foreach ($context['theme_variants'] as $key => $variant) {
544
+					echo '
537 545
 							<option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>';
546
+		}
538 547
 
539 548
 		echo '
540 549
 						</select>
@@ -577,9 +586,10 @@  discard block
 block discarded – undo
577 586
 					<dt>
578 587
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
579 588
 
580
-			if (isset($setting['description']))
581
-				echo '<br>
589
+			if (isset($setting['description'])) {
590
+							echo '<br>
582 591
 						<span class="smalltext">', $setting['description'], '</span>';
592
+			}
583 593
 
584 594
 			echo '
585 595
 					</dt>
@@ -595,18 +605,20 @@  discard block
 block discarded – undo
595 605
 					<dt>
596 606
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
597 607
 
598
-			if (isset($setting['description']))
599
-				echo '<br>
608
+			if (isset($setting['description'])) {
609
+							echo '<br>
600 610
 						<span class="smalltext">', $setting['description'], '</span>';
611
+			}
601 612
 
602 613
 			echo '
603 614
 					</dt>
604 615
 					<dd>
605 616
 						<select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">';
606 617
 
607
-			foreach ($setting['options'] as $value => $label)
608
-				echo '
618
+			foreach ($setting['options'] as $value => $label) {
619
+							echo '
609 620
 							<option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>';
621
+			}
610 622
 
611 623
 			echo '
612 624
 						</select>
@@ -619,9 +631,10 @@  discard block
 block discarded – undo
619 631
 					<dt>
620 632
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
621 633
 
622
-			if (isset($setting['description']))
623
-				echo '<br>
634
+			if (isset($setting['description'])) {
635
+							echo '<br>
624 636
 						<span class="smalltext">', $setting['description'], '</span>';
637
+			}
625 638
 			echo '
626 639
 					</dt>
627 640
 					<dd>
@@ -636,9 +649,10 @@  discard block
 block discarded – undo
636 649
 					<dt>
637 650
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
638 651
 
639
-			if (isset($setting['description']))
640
-				echo '<br>
652
+			if (isset($setting['description'])) {
653
+							echo '<br>
641 654
 						<span class="smalltext">', $setting['description'], '</span>';
655
+			}
642 656
 
643 657
 			echo '
644 658
 					</dt>
@@ -652,8 +666,7 @@  discard block
 block discarded – undo
652 666
 
653 667
 				echo '
654 668
 						<input type="number"', $min . $max . $step;
655
-			}
656
-			else
669
+			} else
657 670
 			{
658 671
 				echo '
659 672
 						<input type="text"';
@@ -806,21 +819,23 @@  discard block
 block discarded – undo
806 819
 		<div class="windowbg">';
807 820
 
808 821
 	// Oops! there was an error :(
809
-	if (!empty($context['error_message']))
810
-		echo '
822
+	if (!empty($context['error_message'])) {
823
+			echo '
811 824
 			<p>
812 825
 				', $context['error_message'] ,'
813 826
 			</p>';
827
+	}
814 828
 
815 829
 	// Not much to show except a link back...
816
-	else
817
-		echo '
830
+	else {
831
+			echo '
818 832
 			<p>
819 833
 				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_'. (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') .'_message'], '
820 834
 			</p>
821 835
 			<p>
822 836
 				<a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a>
823 837
 			</p>';
838
+	}
824 839
 
825 840
 	echo '
826 841
 		</div>
@@ -887,10 +902,11 @@  discard block
 block discarded – undo
887 902
 					<span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span>
888 903
 					<span class="floatright">';
889 904
 
890
-		if ($template['can_copy'])
891
-			echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
892
-		else
893
-			echo $txt['themeadmin_edit_no_copy'];
905
+		if ($template['can_copy']) {
906
+					echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
907
+		} else {
908
+					echo $txt['themeadmin_edit_no_copy'];
909
+		}
894 910
 
895 911
 		echo '
896 912
 					</span>
@@ -913,11 +929,12 @@  discard block
 block discarded – undo
913 929
 	echo '
914 930
 	<div id="admincenter">';
915 931
 
916
-	if (!empty($context['browse_title']))
917
-		echo '
932
+	if (!empty($context['browse_title'])) {
933
+			echo '
918 934
 		<div class="cat_bar">
919 935
 			<h3 class="catbg">', $context['browse_title'], '</h3>
920 936
 		</div>';
937
+	}
921 938
 
922 939
 	echo '
923 940
 		<table class="table_grid tborder">
@@ -937,14 +954,13 @@  discard block
 block discarded – undo
937 954
 			<tr class="windowbg">
938 955
 				<td>';
939 956
 
940
-		if ($file['is_editable'])
941
-			echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
942
-
943
-		elseif ($file['is_directory'])
944
-			echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
945
-
946
-		else
947
-			echo $file['filename'];
957
+		if ($file['is_editable']) {
958
+					echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
959
+		} elseif ($file['is_directory']) {
960
+					echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
961
+		} else {
962
+					echo $file['filename'];
963
+		}
948 964
 
949 965
 		echo '
950 966
 				</td>
@@ -966,11 +982,12 @@  discard block
 block discarded – undo
966 982
 {
967 983
 	global $context, $settings, $scripturl, $txt;
968 984
 
969
-	if ($context['session_error'])
970
-		echo '
985
+	if ($context['session_error']) {
986
+			echo '
971 987
 	<div class="errorbox">
972 988
 		', $txt['error_session_timeout'], '
973 989
 	</div>';
990
+	}
974 991
 
975 992
 	// From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com.
976 993
 	echo '
@@ -1033,17 +1050,18 @@  discard block
 block discarded – undo
1033 1050
 					try
1034 1051
 					{
1035 1052
 					';
1036
-	if (isBrowser('is_ie'))
1037
-		echo '
1053
+	if (isBrowser('is_ie')) {
1054
+			echo '
1038 1055
 						var sheets = frames["css_preview_box"].document.styleSheets;
1039 1056
 						for (var j = 0; j < sheets.length; j++)
1040 1057
 						{
1041 1058
 							if (sheets[j].id == "css_preview_box")
1042 1059
 								sheets[j].cssText = document.forms.stylesheetForm.entire_file.value;
1043 1060
 						}';
1044
-	else
1045
-		echo '
1061
+	} else {
1062
+			echo '
1046 1063
 						setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);';
1064
+	}
1047 1065
 	echo '
1048 1066
 					}
1049 1067
 					catch (e)
@@ -1095,9 +1113,10 @@  discard block
 block discarded – undo
1095 1113
 			</div>
1096 1114
 			<div class="windowbg">';
1097 1115
 
1098
-	if (!$context['allow_save'])
1099
-		echo '
1116
+	if (!$context['allow_save']) {
1117
+			echo '
1100 1118
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1119
+	}
1101 1120
 
1102 1121
 	echo '
1103 1122
 				<textarea name="entire_file" cols="80" rows="20" style="width: 96%; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br>
@@ -1110,9 +1129,10 @@  discard block
 block discarded – undo
1110 1129
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1111 1130
 
1112 1131
 	// Hopefully it exists.
1113
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1114
-		echo '
1132
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1133
+			echo '
1115 1134
 			<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1135
+	}
1116 1136
 
1117 1137
 	echo '
1118 1138
 		</form>
@@ -1126,18 +1146,20 @@  discard block
 block discarded – undo
1126 1146
 {
1127 1147
 	global $context, $scripturl, $txt;
1128 1148
 
1129
-	if ($context['session_error'])
1130
-		echo '
1149
+	if ($context['session_error']) {
1150
+			echo '
1131 1151
 	<div class="errorbox">
1132 1152
 		', $txt['error_session_timeout'], '
1133 1153
 	</div>';
1154
+	}
1134 1155
 
1135
-	if (isset($context['parse_error']))
1136
-		echo '
1156
+	if (isset($context['parse_error'])) {
1157
+			echo '
1137 1158
 	<div class="errorbox">
1138 1159
 		', $txt['themeadmin_edit_error'], '
1139 1160
 			<div><pre>', $context['parse_error'], '</pre></div>
1140 1161
 	</div>';
1162
+	}
1141 1163
 
1142 1164
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1143 1165
 	echo '
@@ -1148,16 +1170,18 @@  discard block
 block discarded – undo
1148 1170
 			</div>
1149 1171
 			<div class="windowbg">';
1150 1172
 
1151
-	if (!$context['allow_save'])
1152
-		echo '
1173
+	if (!$context['allow_save']) {
1174
+			echo '
1153 1175
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1176
+	}
1154 1177
 
1155
-	foreach ($context['file_parts'] as $part)
1156
-		echo '
1178
+	foreach ($context['file_parts'] as $part) {
1179
+			echo '
1157 1180
 				<label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br>
1158 1181
 				<div class="centertext">
1159 1182
 					<textarea id="on_line', $part['line'] ,'" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1160 1183
 				</div>';
1184
+	}
1161 1185
 
1162 1186
 	echo '
1163 1187
 				<div class="padding righttext">
@@ -1166,9 +1190,10 @@  discard block
 block discarded – undo
1166 1190
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1167 1191
 
1168 1192
 	// Hopefully it exists.
1169
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1170
-		echo '
1193
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1194
+			echo '
1171 1195
 					<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1196
+	}
1172 1197
 
1173 1198
 	echo '
1174 1199
 				</div>
@@ -1184,18 +1209,20 @@  discard block
 block discarded – undo
1184 1209
 {
1185 1210
 	global $context, $scripturl, $txt;
1186 1211
 
1187
-	if ($context['session_error'])
1188
-		echo '
1212
+	if ($context['session_error']) {
1213
+			echo '
1189 1214
 	<div class="errorbox">
1190 1215
 		', $txt['error_session_timeout'], '
1191 1216
 	</div>';
1217
+	}
1192 1218
 
1193 1219
 	//Is this file writeable?
1194
-	if (!$context['allow_save'])
1195
-		echo '
1220
+	if (!$context['allow_save']) {
1221
+			echo '
1196 1222
 	<div class="errorbox">
1197 1223
 		', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '
1198 1224
 	</div>';
1225
+	}
1199 1226
 
1200 1227
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1201 1228
 	echo '
@@ -1211,9 +1238,10 @@  discard block
 block discarded – undo
1211 1238
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1212 1239
 
1213 1240
 	// Hopefully it exists.
1214
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1215
-		echo '
1241
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1242
+			echo '
1216 1243
 				<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1244
+	}
1217 1245
 
1218 1246
 	echo '
1219 1247
 			</div>
Please login to merge, or discard this patch.