Completed
Pull Request — release-2.1 (#3807)
by Martyn
07:18
created
Themes/default/Printpage.template.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -145,11 +145,12 @@  discard block
 block discarded – undo
145 145
 				<div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>';
146 146
 
147 147
 		$options = 1;
148
-		foreach ($context['poll']['options'] as $option)
149
-			echo '
148
+		foreach ($context['poll']['options'] as $option) {
149
+					echo '
150 150
 					<div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong>
151 151
 						', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', '
152 152
 					</div>';
153
+		}
153 154
 
154 155
 		echo '
155 156
 			</div>';
@@ -171,9 +172,10 @@  discard block
 block discarded – undo
171 172
 			echo '
172 173
 				<hr>';
173 174
 
174
-			foreach ($context['printattach'][$post['id_msg']] as $attach)
175
-				echo '
175
+			foreach ($context['printattach'][$post['id_msg']] as $attach) {
176
+							echo '
176 177
 					<img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">';
178
+			}
177 179
 		}
178 180
 
179 181
 		echo '
@@ -213,11 +215,12 @@  discard block
 block discarded – undo
213 215
 		<div class="print_options">';
214 216
 
215 217
 	// which option is set, text or text&images
216
-	if (isset($_REQUEST['images']))
217
-		echo '
218
+	if (isset($_REQUEST['images'])) {
219
+			echo '
218 220
 			<a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>';
219
-	else
220
-		echo '
221
+	} else {
222
+			echo '
221 223
 			<strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>';
222
-}
224
+	}
225
+	}
223 226
 ?>
224 227
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/BoardIndex.template.php 1 patch
Braces   +57 added lines, -39 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@  discard block
 block discarded – undo
67 67
 	foreach ($context['categories'] as $category)
68 68
 	{
69 69
 		// If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)
70
-		if (empty($category['boards']) && !$category['is_collapsed'])
71
-			continue;
70
+		if (empty($category['boards']) && !$category['is_collapsed']) {
71
+					continue;
72
+		}
72 73
 
73 74
 		echo '
74 75
 		<div class="main_container">
@@ -76,9 +77,10 @@  discard block
 block discarded – undo
76 77
 				<h3 class="catbg">';
77 78
 
78 79
 		// If this category even can collapse, show a link to collapse it.
79
-		if ($category['can_collapse'])
80
-			echo '
80
+		if ($category['can_collapse']) {
81
+					echo '
81 82
 					<span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' floatright" data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'] ,'" style="display: none;"></span>';
83
+		}
82 84
 
83 85
 		echo '
84 86
 					', $category['link'], '
@@ -105,17 +107,19 @@  discard block
 block discarded – undo
105 107
 						</a>';
106 108
 
107 109
 				// Has it outstanding posts for approval?
108
-				if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
109
-					echo '
110
+				if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) {
111
+									echo '
110 112
 						<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';
113
+				}
111 114
 
112 115
 				echo '
113 116
 						<p class="board_description">', $board['description'] , '</p>';
114 117
 
115 118
 				// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
116
-				if (!empty($board['link_moderators']))
117
-					echo '
119
+				if (!empty($board['link_moderators'])) {
120
+									echo '
118 121
 						<p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
122
+				}
119 123
 
120 124
 				// Show some basic information about the number of posts, etc.
121 125
 					echo '
@@ -127,9 +131,10 @@  discard block
 block discarded – undo
127 131
 					</div>
128 132
 					<div class="lastpost ',!empty($board['last_post']['id']) ? 'lpr_border' : 'hidden','">';
129 133
 
130
-				if (!empty($board['last_post']['id']))
131
-					echo '
134
+				if (!empty($board['last_post']['id'])) {
135
+									echo '
132 136
 						<p>', $board['last_post']['last_post_message'], '</p>';
137
+				}
133 138
 				echo '
134 139
 					</div>';
135 140
 				// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
@@ -141,14 +146,16 @@  discard block
 block discarded – undo
141 146
 							id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
142 147
 					foreach ($board['children'] as $child)
143 148
 					{
144
-						if (!$child['is_redirect'])
145
-							$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>';
146
-						else
147
-							$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
149
+						if (!$child['is_redirect']) {
150
+													$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>';
151
+						} else {
152
+													$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
153
+						}
148 154
 
149 155
 						// Has it posts awaiting approval?
150
-						if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
151
-							$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
156
+						if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) {
157
+													$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
158
+						}
152 159
 
153 160
 						$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
154 161
 					}
@@ -172,10 +179,11 @@  discard block
 block discarded – undo
172 179
 	</div>';
173 180
 
174 181
 	// Show the mark all as read button?
175
-	if ($context['user']['is_logged'] && !empty($context['categories']))
176
-		echo '
182
+	if ($context['user']['is_logged'] && !empty($context['categories'])) {
183
+			echo '
177 184
 		<div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>';
178
-}
185
+	}
186
+	}
179 187
 
180 188
 /**
181 189
  * The lower part of the outer layer of the board index
@@ -192,8 +200,9 @@  discard block
 block discarded – undo
192 200
 {
193 201
 	global $context, $options, $txt;
194 202
 
195
-	if (empty($context['info_center']))
196
-		return;
203
+	if (empty($context['info_center'])) {
204
+			return;
205
+	}
197 206
 
198 207
 	// Here's where the "Info Center" starts...
199 208
 	echo '
@@ -293,14 +302,15 @@  discard block
 block discarded – undo
293 302
 		/* Each post in latest_posts has:
294 303
 				board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
295 304
 				subject, short_subject (shortened with...), time, link, and href. */
296
-		foreach ($context['latest_posts'] as $post)
297
-			echo '
305
+		foreach ($context['latest_posts'] as $post) {
306
+					echo '
298 307
 					<tr class="windowbg">
299 308
 						<td class="recentpost"><strong>', $post['link'], '</strong></td>
300 309
 						<td class="recentposter">', $post['poster']['link'], '</td>
301 310
 						<td class="recentboard">', $post['board']['link'], '</td>
302 311
 						<td class="recenttime">', $post['time'], '</td>
303 312
 					</tr>';
313
+		}
304 314
 		echo '
305 315
 				</table>';
306 316
 	}
@@ -324,9 +334,10 @@  discard block
 block discarded – undo
324 334
 			</div>';
325 335
 
326 336
 	// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
327
-	if (!empty($context['calendar_holidays']))
328
-		echo '
337
+	if (!empty($context['calendar_holidays'])) {
338
+			echo '
329 339
 				<p class="inline holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), '</p>';
340
+	}
330 341
 
331 342
 	// People's birthdays. Like mine. And yours, I guess. Kidding.
332 343
 	if (!empty($context['calendar_birthdays']))
@@ -335,9 +346,10 @@  discard block
 block discarded – undo
335 346
 				<p class="inline">
336 347
 					<span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';
337 348
 		// Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
338
-		foreach ($context['calendar_birthdays'] as $member)
339
-			echo '
349
+		foreach ($context['calendar_birthdays'] as $member) {
350
+					echo '
340 351
 					<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
352
+		}
341 353
 		echo '
342 354
 				</p>';
343 355
 	}
@@ -351,9 +363,10 @@  discard block
 block discarded – undo
351 363
 
352 364
 		// Each event in calendar_events should have:
353 365
 		//		title, href, is_last, can_edit (are they allowed?), modify_href, and is_today.
354
-		foreach ($context['calendar_events'] as $event)
355
-			echo '
366
+		foreach ($context['calendar_events'] as $event) {
367
+					echo '
356 368
 					', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><span class="generic_icons calendar_modify"></span></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br>' : ', ';
369
+		}
357 370
 		echo '
358 371
 				</p>';
359 372
 	}
@@ -398,15 +411,19 @@  discard block
 block discarded – undo
398 411
 
399 412
 	// Handle hidden users and buddies.
400 413
 	$bracketList = array();
401
-	if ($context['show_buddies'])
402
-		$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
403
-	if (!empty($context['num_spiders']))
404
-		$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
405
-	if (!empty($context['num_users_hidden']))
406
-		$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']);
414
+	if ($context['show_buddies']) {
415
+			$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
416
+	}
417
+	if (!empty($context['num_spiders'])) {
418
+			$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
419
+	}
420
+	if (!empty($context['num_users_hidden'])) {
421
+			$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']);
422
+	}
407 423
 
408
-	if (!empty($bracketList))
409
-		echo ' (' . implode(', ', $bracketList) . ')';
424
+	if (!empty($bracketList)) {
425
+			echo ' (' . implode(', ', $bracketList) . ')';
426
+	}
410 427
 
411 428
 	echo $context['show_who'] ? '</a>' : '', '
412 429
 
@@ -420,9 +437,10 @@  discard block
 block discarded – undo
420 437
 				', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']);
421 438
 
422 439
 		// Showing membergroups?
423
-		if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
424
-			echo '
440
+		if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) {
441
+					echo '
425 442
 				<span class="membergroups">' . implode(',&nbsp;', $context['membergroups']). '</span>';
443
+		}
426 444
 	}
427 445
 
428 446
 	echo '
Please login to merge, or discard this patch.
Themes/default/ModerationCenter.template.php 1 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/ManageLanguages.template.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,11 +36,12 @@  discard block
 block discarded – undo
36 36
 	}
37 37
 
38 38
 	// An error?
39
-	if (!empty($context['error_message']))
40
-		echo '
39
+	if (!empty($context['error_message'])) {
40
+			echo '
41 41
 	<div class="errorbox">
42 42
 		', $context['error_message'], '
43 43
 	</div>';
44
+	}
44 45
 
45 46
 	// Provide something of an introduction...
46 47
 	echo '
@@ -67,11 +68,12 @@  discard block
 block discarded – undo
67 68
 	// If the files are not writable, we might!
68 69
 	if (!empty($context['still_not_writable']))
69 70
 	{
70
-		if (!empty($context['package_ftp']['error']))
71
-			echo '
71
+		if (!empty($context['package_ftp']['error'])) {
72
+					echo '
72 73
 			<div class="errorbox">
73 74
 				', $context['package_ftp']['error'], '
74 75
 			</div>';
76
+		}
75 77
 
76 78
 		echo '
77 79
 			<div class="cat_bar">
@@ -243,11 +245,12 @@  discard block
 block discarded – undo
243 245
 
244 246
 	// Is it not writable?
245 247
 	// Show an error.
246
-	if (!empty($context['entries_not_writable_message']))
247
-		echo '
248
+	if (!empty($context['entries_not_writable_message'])) {
249
+			echo '
248 250
 			<div class="errorbox">
249 251
 				', $context['entries_not_writable_message'], '
250 252
 			</div>';
253
+	}
251 254
 
252 255
 	// Already have some file entries?
253 256
 	if (!empty($context['file_entries']))
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 2 patches
Braces   +442 added lines, -322 removed lines patch added patch discarded remove patch
@@ -18,23 +18,25 @@  discard block
 block discarded – undo
18 18
 	global $context;
19 19
 
20 20
 	// Prevent Chrome from auto completing fields when viewing/editing other members profiles
21
-	if (isBrowser('is_chrome') && !$context['user']['is_owner'])
22
-		echo '
21
+	if (isBrowser('is_chrome') && !$context['user']['is_owner']) {
22
+			echo '
23 23
 	<script>
24 24
 		disableAutoComplete();
25 25
 	</script>';
26
+	}
26 27
 
27 28
 	// If an error occurred while trying to save previously, give the user a clue!
28 29
 	echo '
29 30
 					', template_error_message();
30 31
 
31 32
 	// If the profile was update successfully, let the user know this.
32
-	if (!empty($context['profile_updated']))
33
-		echo '
33
+	if (!empty($context['profile_updated'])) {
34
+			echo '
34 35
 					<div class="infobox">
35 36
 						', $context['profile_updated'], '
36 37
 					</div>';
37
-}
38
+	}
39
+	}
38 40
 
39 41
 /**
40 42
  * Template for any HTML needed below the profile (closing off divs/tables, etc.)
@@ -102,8 +104,7 @@  discard block
 block discarded – undo
102 104
 	if (empty($context['unread_alerts']))
103 105
 	{
104 106
 		template_alerts_all_read();
105
-	}
106
-	else
107
+	} else
107 108
 	{
108 109
 		foreach ($context['unread_alerts'] as $id_alert => $details)
109 110
 		{
@@ -164,10 +165,11 @@  discard block
 block discarded – undo
164 165
 			<div class="custom_fields_above_name">
165 166
 				<ul >';
166 167
 
167
-		foreach ($context['print_custom_fields']['above_member'] as $field)
168
-			if (!empty($field['output_html']))
168
+		foreach ($context['print_custom_fields']['above_member'] as $field) {
169
+					if (!empty($field['output_html']))
169 170
 				echo '
170 171
 					<li>', $field['output_html'], '</li>';
172
+		}
171 173
 
172 174
 		echo '
173 175
 				</ul>
@@ -188,10 +190,11 @@  discard block
 block discarded – undo
188 190
 			<div class="custom_fields_below_avatar">
189 191
 				<ul >';
190 192
 
191
-		foreach ($context['print_custom_fields']['below_avatar'] as $field)
192
-			if (!empty($field['output_html']))
193
+		foreach ($context['print_custom_fields']['below_avatar'] as $field) {
194
+					if (!empty($field['output_html']))
193 195
 				echo '
194 196
 					<li>', $field['output_html'], '</li>';
197
+		}
195 198
 
196 199
 		echo '
197 200
 				</ul>
@@ -202,22 +205,25 @@  discard block
 block discarded – undo
202 205
 		echo '
203 206
 			<ul class="clear">';
204 207
 	// Email is only visible if it's your profile or you have the moderate_forum permission
205
-	if ($context['member']['show_email'])
206
-		echo '
208
+	if ($context['member']['show_email']) {
209
+			echo '
207 210
 				<li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>';
211
+	}
208 212
 
209 213
 	// Don't show an icon if they haven't specified a website.
210
-	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
211
-		echo '
214
+	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) {
215
+			echo '
212 216
 				<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
217
+	}
213 218
 
214 219
 	// Are there any custom profile fields as icons?
215 220
 	if (!empty($context['print_custom_fields']['icons']))
216 221
 	{
217
-		foreach ($context['print_custom_fields']['icons'] as $field)
218
-			if (!empty($field['output_html']))
222
+		foreach ($context['print_custom_fields']['icons'] as $field) {
223
+					if (!empty($field['output_html']))
219 224
 				echo '
220 225
 					<li class="custom_field">', $field['output_html'], '</li>';
226
+		}
221 227
 	}
222 228
 
223 229
 	echo '
@@ -225,23 +231,26 @@  discard block
 block discarded – undo
225 231
 			<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : '';
226 232
 
227 233
 	// Can they add this member as a buddy?
228
-	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
229
-		echo '
234
+	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) {
235
+			echo '
230 236
 				<br><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
237
+	}
231 238
 
232 239
 	echo '
233 240
 			</span>';
234 241
 
235
-	if (!$context['user']['is_owner'] && $context['can_send_pm'])
236
-		echo '
242
+	if (!$context['user']['is_owner'] && $context['can_send_pm']) {
243
+			echo '
237 244
 			<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>';
245
+	}
238 246
 
239 247
 	echo '
240 248
 			<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>';
241 249
 
242
-	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled']))
243
-		echo '
250
+	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) {
251
+			echo '
244 252
 			<a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>';
253
+	}
245 254
 
246 255
 	echo '
247 256
 			<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>';
@@ -253,10 +262,11 @@  discard block
 block discarded – undo
253 262
 			<div class="custom_fields_bottom">
254 263
 				<ul class="nolist">';
255 264
 
256
-		foreach ($context['print_custom_fields']['bottom_poster'] as $field)
257
-			if (!empty($field['output_html']))
265
+		foreach ($context['print_custom_fields']['bottom_poster'] as $field) {
266
+					if (!empty($field['output_html']))
258 267
 				echo '
259 268
 					<li>', $field['output_html'], '</li>';
269
+		}
260 270
 
261 271
 		echo '
262 272
 				</ul>
@@ -270,15 +280,17 @@  discard block
 block discarded – undo
270 280
 		<div id="detailedinfo">
271 281
 			<dl>';
272 282
 
273
-	if ($context['user']['is_owner'] || $context['user']['is_admin'])
274
-		echo '
283
+	if ($context['user']['is_owner'] || $context['user']['is_admin']) {
284
+			echo '
275 285
 				<dt>', $txt['username'], ': </dt>
276 286
 				<dd>', $context['member']['username'], '</dd>';
287
+	}
277 288
 
278
-	if (!isset($context['disabled_fields']['posts']))
279
-		echo '
289
+	if (!isset($context['disabled_fields']['posts'])) {
290
+			echo '
280 291
 				<dt>', $txt['profile_posts'], ': </dt>
281 292
 				<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
293
+	}
282 294
 
283 295
 	if ($context['member']['show_email'])
284 296
 	{
@@ -287,15 +299,17 @@  discard block
 block discarded – undo
287 299
 				<dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>';
288 300
 	}
289 301
 
290
-	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
291
-		echo '
302
+	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) {
303
+			echo '
292 304
 				<dt>', $txt['custom_title'], ': </dt>
293 305
 				<dd>', $context['member']['title'], '</dd>';
306
+	}
294 307
 
295
-	if (!empty($context['member']['blurb']))
296
-		echo '
308
+	if (!empty($context['member']['blurb'])) {
309
+			echo '
297 310
 				<dt>', $txt['personal_text'], ': </dt>
298 311
 				<dd>', $context['member']['blurb'], '</dd>';
312
+	}
299 313
 
300 314
 	echo '
301 315
 				<dt>', $txt['age'], ':</dt>
@@ -310,11 +324,12 @@  discard block
 block discarded – undo
310 324
 		echo '
311 325
 				<dl>';
312 326
 
313
-		foreach ($context['print_custom_fields']['standard'] as $field)
314
-			if (!empty($field['output_html']))
327
+		foreach ($context['print_custom_fields']['standard'] as $field) {
328
+					if (!empty($field['output_html']))
315 329
 				echo '
316 330
 					<dt>', $field['name'], ':</dt>
317 331
 					<dd>', $field['output_html'], '</dd>';
332
+		}
318 333
 
319 334
 		echo '
320 335
 				</dl>';
@@ -332,9 +347,10 @@  discard block
 block discarded – undo
332 347
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning') , '">', $context['member']['warning'], '%</a>';
333 348
 
334 349
 		// Can we provide information on what this means?
335
-		if (!empty($context['warning_status']))
336
-			echo '
350
+		if (!empty($context['warning_status'])) {
351
+					echo '
337 352
 						<span class="smalltext">(', $context['warning_status'], ')</span>';
353
+		}
338 354
 
339 355
 		echo '
340 356
 					</dd>';
@@ -345,9 +361,10 @@  discard block
 block discarded – undo
345 361
 	{
346 362
 
347 363
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
348
-		if (!empty($context['activate_message']))
349
-			echo '
364
+		if (!empty($context['activate_message'])) {
365
+					echo '
350 366
 					<dt class="clear"><span class="alert">', $context['activate_message'], '</span>&nbsp;(<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="'. $txt['profileConfirm'] .'"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
367
+		}
351 368
 
352 369
 		// If the current member is banned, show a message and possibly a link to the ban.
353 370
 		if (!empty($context['member']['bans']))
@@ -357,9 +374,10 @@  discard block
 block discarded – undo
357 374
 					<dt class="clear" id="ban_info" style="display: none;">
358 375
 						<strong>', $txt['user_banned_by_following'], ':</strong>';
359 376
 
360
-			foreach ($context['member']['bans'] as $ban)
361
-				echo '
377
+			foreach ($context['member']['bans'] as $ban) {
378
+							echo '
362 379
 						<br><span class="smalltext">', $ban['explanation'], '</span>';
380
+			}
363 381
 
364 382
 			echo '
365 383
 					</dt>';
@@ -373,30 +391,34 @@  discard block
 block discarded – undo
373 391
 	// If the person looking is allowed, they can check the members IP address and hostname.
374 392
 	if ($context['can_see_ip'])
375 393
 	{
376
-		if (!empty($context['member']['ip']))
377
-		echo '
394
+		if (!empty($context['member']['ip'])) {
395
+				echo '
378 396
 					<dt>', $txt['ip'], ': </dt>
379 397
 					<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
398
+		}
380 399
 
381
-		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
382
-			echo '
400
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) {
401
+					echo '
383 402
 					<dt>', $txt['hostname'], ': </dt>
384 403
 					<dd>', $context['member']['hostname'], '</dd>';
404
+		}
385 405
 	}
386 406
 
387 407
 	echo '
388 408
 					<dt>', $txt['local_time'], ':</dt>
389 409
 					<dd>', $context['member']['local_time'], '</dd>';
390 410
 
391
-	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
392
-		echo '
411
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) {
412
+			echo '
393 413
 					<dt>', $txt['language'], ':</dt>
394 414
 					<dd>', $context['member']['language'], '</dd>';
415
+	}
395 416
 
396
-	if ($context['member']['show_last_login'])
397
-		echo '
417
+	if ($context['member']['show_last_login']) {
418
+			echo '
398 419
 					<dt>', $txt['lastLoggedIn'], ': </dt>
399 420
 					<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
421
+	}
400 422
 
401 423
 	echo '
402 424
 				</dl>';
@@ -408,10 +430,11 @@  discard block
 block discarded – undo
408 430
 				<div class="custom_fields_above_signature">
409 431
 					<ul class="nolist">';
410 432
 
411
-		foreach ($context['print_custom_fields']['above_signature'] as $field)
412
-			if (!empty($field['output_html']))
433
+		foreach ($context['print_custom_fields']['above_signature'] as $field) {
434
+					if (!empty($field['output_html']))
413 435
 				echo '
414 436
 						<li>', $field['output_html'], '</li>';
437
+		}
415 438
 
416 439
 		echo '
417 440
 					</ul>
@@ -419,12 +442,13 @@  discard block
 block discarded – undo
419 442
 	}
420 443
 
421 444
 	// Show the users signature.
422
-	if ($context['signature_enabled'] && !empty($context['member']['signature']))
423
-		echo '
445
+	if ($context['signature_enabled'] && !empty($context['member']['signature'])) {
446
+			echo '
424 447
 				<div class="signature">
425 448
 					<h5>', $txt['signature'], ':</h5>
426 449
 					', $context['member']['signature'], '
427 450
 				</div>';
451
+	}
428 452
 
429 453
 	// Are there any custom profile fields for below the signature?
430 454
 	if (!empty($context['print_custom_fields']['below_signature']))
@@ -433,10 +457,11 @@  discard block
 block discarded – undo
433 457
 				<div class="custom_fields_below_signature">
434 458
 					<ul class="nolist">';
435 459
 
436
-		foreach ($context['print_custom_fields']['below_signature'] as $field)
437
-			if (!empty($field['output_html']))
460
+		foreach ($context['print_custom_fields']['below_signature'] as $field) {
461
+					if (!empty($field['output_html']))
438 462
 				echo '
439 463
 						<li>', $field['output_html'], '</li>';
464
+		}
440 465
 
441 466
 		echo '
442 467
 					</ul>
@@ -481,62 +506,70 @@  discard block
 block discarded – undo
481 506
 				</div>
482 507
 				<div class="list_posts">';
483 508
 
484
-			if (!$post['approved'])
485
-				echo '
509
+			if (!$post['approved']) {
510
+							echo '
486 511
 					<div class="approve_post">
487 512
 						<em>', $txt['post_awaiting_approval'], '</em>
488 513
 					</div>';
514
+			}
489 515
 
490 516
 			echo '
491 517
 					', $post['body'], '
492 518
 				</div>';
493 519
 
494
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
495
-				echo '
520
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
521
+							echo '
496 522
 				<div class="floatright">
497 523
 					<ul class="quickbuttons">';
524
+			}
498 525
 
499 526
 			// If they *can* reply?
500
-			if ($post['can_reply'])
501
-				echo '
527
+			if ($post['can_reply']) {
528
+							echo '
502 529
 						<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
530
+			}
503 531
 
504 532
 			// If they *can* quote?
505
-			if ($post['can_quote'])
506
-				echo '
533
+			if ($post['can_quote']) {
534
+							echo '
507 535
 						<li><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
536
+			}
508 537
 
509 538
 			// How about... even... remove it entirely?!
510
-			if ($post['can_delete'])
511
-				echo '
539
+			if ($post['can_delete']) {
540
+							echo '
512 541
 						<li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
542
+			}
513 543
 
514
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
515
-				echo '
544
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
545
+							echo '
516 546
 					</ul>
517 547
 				</div>';
548
+			}
518 549
 
519 550
 			echo '
520 551
 			</div>';
521 552
 		}
553
+	} else {
554
+			template_show_list('attachments');
522 555
 	}
523
-	else
524
-		template_show_list('attachments');
525 556
 
526 557
 	// No posts? Just end with a informative message.
527
-	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
528
-		echo '
558
+	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) {
559
+			echo '
529 560
 			<div class="windowbg2">
530 561
 				', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
531 562
 			</div>';
563
+	}
532 564
 
533 565
 	// Show more page numbers.
534
-	if (!empty($context['page_index']))
535
-		echo '
566
+	if (!empty($context['page_index'])) {
567
+			echo '
536 568
 		<div class="pagesection">
537 569
 			<div class="pagelinks">', $context['page_index'], '</div>
538 570
 		</div>';
539
-}
571
+	}
572
+	}
540 573
 
541 574
 /**
542 575
  * Template for showing alerts within the alerts popup
@@ -546,11 +579,12 @@  discard block
 block discarded – undo
546 579
 	global $context, $txt, $scripturl;
547 580
 
548 581
 	// Do we have an update message?
549
-	if (!empty($context['update_message']))
550
-		echo '
582
+	if (!empty($context['update_message'])) {
583
+			echo '
551 584
 		<div class="infobox">
552 585
 			', $context['update_message'], '.
553 586
 		</div>';
587
+	}
554 588
 
555 589
 	echo '
556 590
 		<div class="cat_bar">
@@ -559,13 +593,12 @@  discard block
 block discarded – undo
559 593
 			</h3>
560 594
 		</div>';
561 595
 
562
-	if (empty($context['alerts']))
563
-		echo '
596
+	if (empty($context['alerts'])) {
597
+			echo '
564 598
 		<div class="information">
565 599
 			', $txt['alerts_none'], '
566 600
 		</div>';
567
-
568
-	else
601
+	} else
569 602
 	{
570 603
 		// Start the form.
571 604
 		echo '
@@ -627,12 +660,12 @@  discard block
 block discarded – undo
627 660
 		</div>' : '';
628 661
 
629 662
 	// No drafts? Just show an informative message.
630
-	if (empty($context['drafts']))
631
-		echo '
663
+	if (empty($context['drafts'])) {
664
+			echo '
632 665
 		<div class="windowbg2 centertext">
633 666
 			', $txt['draft_none'], '
634 667
 		</div>';
635
-	else
668
+	} else
636 669
 	{
637 670
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
638 671
 		foreach ($context['drafts'] as $draft)
@@ -643,11 +676,13 @@  discard block
 block discarded – undo
643 676
 					<div class="topic_details">
644 677
 						<h5><strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
645 678
 
646
-			if (!empty($draft['sticky']))
647
-				echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
679
+			if (!empty($draft['sticky'])) {
680
+							echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
681
+			}
648 682
 
649
-			if (!empty($draft['locked']))
650
-				echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
683
+			if (!empty($draft['locked'])) {
684
+							echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
685
+			}
651 686
 
652 687
 			echo '
653 688
 						</h5>
@@ -680,12 +715,13 @@  discard block
 block discarded – undo
680 715
 {
681 716
 	global $context, $scripturl, $txt;
682 717
 
683
-	if (!empty($context['saved_successful']))
684
-		echo '
718
+	if (!empty($context['saved_successful'])) {
719
+			echo '
685 720
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
686
-	elseif (!empty($context['saved_failed']))
687
-		echo '
721
+	} elseif (!empty($context['saved_failed'])) {
722
+			echo '
688 723
 					<div class="errorbox">', $context['saved_failed'], '</div>';
724
+	}
689 725
 
690 726
 	echo '
691 727
 	<div id="edit_buddies">
@@ -699,24 +735,27 @@  discard block
 block discarded – undo
699 735
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
700 736
 				<th scope="col">', $txt['status'], '</th>';
701 737
 
702
-	if (allowedTo('moderate_forum'))
703
-		echo '
738
+	if (allowedTo('moderate_forum')) {
739
+			echo '
704 740
 				<th scope="col">', $txt['email'], '</th>';
741
+	}
705 742
 
706
-	if (!empty($context['custom_pf']))
707
-		foreach ($context['custom_pf'] as $column)
743
+	if (!empty($context['custom_pf'])) {
744
+			foreach ($context['custom_pf'] as $column)
708 745
 				echo '<th scope="col">', $column['label'], '</th>';
746
+	}
709 747
 
710 748
 	echo '
711 749
 				<th scope="col">', $txt['remove'], '</th>
712 750
 			</tr>';
713 751
 
714 752
 	// If they don't have any buddies don't list them!
715
-	if (empty($context['buddies']))
716
-		echo '
753
+	if (empty($context['buddies'])) {
754
+			echo '
717 755
 			<tr class="windowbg">
718 756
 				<td colspan="', allowedTo('moderate_forum') ? '10' : '9','"><strong>', $txt['no_buddies'], '</strong></td>
719 757
 			</tr>';
758
+	}
720 759
 
721 760
 		// Now loop through each buddy showing info on each.
722 761
 	else
@@ -728,15 +767,17 @@  discard block
 block discarded – undo
728 767
 					<td>', $buddy['link'], '</td>
729 768
 					<td><a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a></td>';
730 769
 
731
-			if ($buddy['show_email'])
732
-				echo '
770
+			if ($buddy['show_email']) {
771
+							echo '
733 772
 					<td><a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a></td>';
773
+			}
734 774
 
735 775
 			// Show the custom profile fields for this user.
736
-			if (!empty($context['custom_pf']))
737
-				foreach ($context['custom_pf'] as $key => $column)
776
+			if (!empty($context['custom_pf'])) {
777
+							foreach ($context['custom_pf'] as $key => $column)
738 778
 					echo '
739 779
 						<td class="lefttext">', $buddy['options'][$key], '</td>';
780
+			}
740 781
 
741 782
 			echo '
742 783
 					<td><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['buddy_remove'], '"></span></a></td>
@@ -766,9 +807,10 @@  discard block
 block discarded – undo
766 807
 			</dl>
767 808
 		</div>';
768 809
 
769
-	if (!empty($context['token_check']))
770
-		echo '
810
+	if (!empty($context['token_check'])) {
811
+			echo '
771 812
 			<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
813
+	}
772 814
 
773 815
 	echo '
774 816
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -794,12 +836,13 @@  discard block
 block discarded – undo
794 836
 {
795 837
 	global $context, $scripturl, $txt;
796 838
 
797
-	if (!empty($context['saved_successful']))
798
-		echo '
839
+	if (!empty($context['saved_successful'])) {
840
+			echo '
799 841
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
800
-	elseif (!empty($context['saved_failed']))
801
-		echo '
842
+	} elseif (!empty($context['saved_failed'])) {
843
+			echo '
802 844
 					<div class="errorbox">', $context['saved_failed'], '</div>';
845
+	}
803 846
 
804 847
 	echo '
805 848
 	<div id="edit_buddies">
@@ -813,20 +856,22 @@  discard block
 block discarded – undo
813 856
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
814 857
 				<th scope="col">', $txt['status'], '</th>';
815 858
 
816
-	if (allowedTo('moderate_forum'))
817
-		echo '
859
+	if (allowedTo('moderate_forum')) {
860
+			echo '
818 861
 				<th scope="col">', $txt['email'], '</th>';
862
+	}
819 863
 
820 864
 	echo '
821 865
 				<th scope="col">', $txt['ignore_remove'] ,'</th>
822 866
 			</tr>';
823 867
 
824 868
 	// If they don't have anyone on their ignore list, don't list it!
825
-	if (empty($context['ignore_list']))
826
-		echo '
869
+	if (empty($context['ignore_list'])) {
870
+			echo '
827 871
 			<tr class="windowbg">
828 872
 				<td colspan="', allowedTo('moderate_forum') ? '4' : '3','"><strong>', $txt['no_ignore'], '</strong></td>
829 873
 			</tr>';
874
+	}
830 875
 
831 876
 	// Now loop through each buddy showing info on each.
832 877
 	foreach ($context['ignore_list'] as $member)
@@ -836,9 +881,10 @@  discard block
 block discarded – undo
836 881
 				<td>', $member['link'], '</td>
837 882
 				<td><a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a></td>';
838 883
 
839
-		if ($member['show_email'])
840
-			echo '
884
+		if ($member['show_email']) {
885
+					echo '
841 886
 				<td><a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a></td>';
887
+		}
842 888
 		echo '
843 889
 				<td><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['ignore_remove'], '"></span></a></td>
844 890
 			</tr>';
@@ -865,9 +911,10 @@  discard block
 block discarded – undo
865 911
 			</dl>
866 912
 		</div>';
867 913
 
868
-	if (!empty($context['token_check']))
869
-		echo '
914
+	if (!empty($context['token_check'])) {
915
+			echo '
870 916
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
917
+	}
871 918
 
872 919
 	echo '
873 920
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -912,9 +959,10 @@  discard block
 block discarded – undo
912 959
 					<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
913 960
 
914 961
 	// Second address detected?
915
-	if (!empty($context['last_ip2']))
916
-		echo '
962
+	if (!empty($context['last_ip2'])) {
963
+			echo '
917 964
 					, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
965
+	}
918 966
 
919 967
 	echo '
920 968
 				</dd>';
@@ -979,9 +1027,10 @@  discard block
 block discarded – undo
979 1027
 				<h3 class="catbg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
980 1028
 			</div>
981 1029
 			<div class="windowbg2 noup">';
982
-			foreach ($context['whois_servers'] as $server)
983
-			echo '
1030
+			foreach ($context['whois_servers'] as $server) {
1031
+						echo '
984 1032
 				<a href="', $server['url'], '" target="_blank" class="new_win"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>';
1033
+			}
985 1034
 			echo '
986 1035
 			</div>
987 1036
 			<br>';
@@ -992,10 +1041,10 @@  discard block
 block discarded – undo
992 1041
 		<div class="cat_bar">
993 1042
 			<h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
994 1043
 		</div>';
995
-	if (empty($context['ips']))
996
-		echo '
1044
+	if (empty($context['ips'])) {
1045
+			echo '
997 1046
 		<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
998
-	else
1047
+	} else
999 1048
 	{
1000 1049
 		echo '
1001 1050
 		<table class="table_grid">
@@ -1008,12 +1057,13 @@  discard block
 block discarded – undo
1008 1057
 			<tbody>';
1009 1058
 
1010 1059
 		// Loop through each of the members and display them.
1011
-		foreach ($context['ips'] as $ip => $memberlist)
1012
-			echo '
1060
+		foreach ($context['ips'] as $ip => $memberlist) {
1061
+					echo '
1013 1062
 				<tr class="windowbg">
1014 1063
 					<td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
1015 1064
 					<td>', implode(', ', $memberlist), '</td>
1016 1065
 				</tr>';
1066
+		}
1017 1067
 
1018 1068
 		echo '
1019 1069
 			</tbody>
@@ -1059,8 +1109,7 @@  discard block
 block discarded – undo
1059 1109
 	{
1060 1110
 		echo '
1061 1111
 		<div class="information">', $txt['showPermissions_all'], '</div>';
1062
-	}
1063
-	else
1112
+	} else
1064 1113
 	{
1065 1114
 		echo '
1066 1115
 		<div class="information">',$txt['showPermissions_help'],'</div>
@@ -1074,9 +1123,10 @@  discard block
 block discarded – undo
1074 1123
 				</div>
1075 1124
 				<div class="windowbg smalltext">
1076 1125
 					', $txt['showPermissions_restricted_boards_desc'], ':<br>';
1077
-				foreach ($context['no_access_boards'] as $no_access_board)
1078
-					echo '
1126
+				foreach ($context['no_access_boards'] as $no_access_board) {
1127
+									echo '
1079 1128
 						<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
1129
+				}
1080 1130
 				echo '
1081 1131
 				</div>';
1082 1132
 		}
@@ -1108,12 +1158,13 @@  discard block
 block discarded – undo
1108 1158
 								</td>
1109 1159
 								<td class="smalltext">';
1110 1160
 
1111
-				if ($permission['is_denied'])
1112
-					echo '
1161
+				if ($permission['is_denied']) {
1162
+									echo '
1113 1163
 									<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']),'</span>';
1114
-				else
1115
-					echo '
1164
+				} else {
1165
+									echo '
1116 1166
 									', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
1167
+				}
1117 1168
 
1118 1169
 					echo '
1119 1170
 								</td>
@@ -1123,10 +1174,10 @@  discard block
 block discarded – undo
1123 1174
 						</tbody>
1124 1175
 					</table>
1125 1176
 				</div><br>';
1126
-		}
1127
-		else
1128
-			echo '
1177
+		} else {
1178
+					echo '
1129 1179
 			<p class="windowbg2">', $txt['showPermissions_none_general'], '</p>';
1180
+		}
1130 1181
 
1131 1182
 		// Board permission section.
1132 1183
 		echo '
@@ -1136,14 +1187,16 @@  discard block
 block discarded – undo
1136 1187
 						<a id="board_permissions"></a>', $txt['showPermissions_select'], ':
1137 1188
 						<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
1138 1189
 							<option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
1139
-				if (!empty($context['boards']))
1140
-					echo '
1190
+				if (!empty($context['boards'])) {
1191
+									echo '
1141 1192
 							<option value="" disabled>---------------------------</option>';
1193
+				}
1142 1194
 
1143 1195
 				// Fill the box with any local permission boards.
1144
-				foreach ($context['boards'] as $board)
1145
-					echo '
1196
+				foreach ($context['boards'] as $board) {
1197
+									echo '
1146 1198
 							<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
1199
+				}
1147 1200
 
1148 1201
 				echo '
1149 1202
 						</select>
@@ -1174,8 +1227,7 @@  discard block
 block discarded – undo
1174 1227
 				{
1175 1228
 					echo '
1176 1229
 							<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1177
-				}
1178
-				else
1230
+				} else
1179 1231
 				{
1180 1232
 					echo '
1181 1233
 							', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
@@ -1187,10 +1239,10 @@  discard block
 block discarded – undo
1187 1239
 			echo '
1188 1240
 				</tbody>
1189 1241
 			</table>';
1190
-		}
1191
-		else
1192
-			echo '
1242
+		} else {
1243
+					echo '
1193 1244
 			<p class="windowbg2">', $txt['showPermissions_none_board'], '</p>';
1245
+		}
1194 1246
 	echo '
1195 1247
 			</div>
1196 1248
 		</div>';
@@ -1232,9 +1284,10 @@  discard block
 block discarded – undo
1232 1284
 			</div>';
1233 1285
 
1234 1286
 	// If they haven't post at all, don't draw the graph.
1235
-	if (empty($context['posts_by_time']))
1236
-		echo '
1287
+	if (empty($context['posts_by_time'])) {
1288
+			echo '
1237 1289
 			<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1290
+	}
1238 1291
 	// Otherwise do!
1239 1292
 	else
1240 1293
 	{
@@ -1273,11 +1326,10 @@  discard block
 block discarded – undo
1273 1326
 					</h3>
1274 1327
 				</div>';
1275 1328
 
1276
-	if (empty($context['popular_boards']))
1277
-		echo '
1329
+	if (empty($context['popular_boards'])) {
1330
+			echo '
1278 1331
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1279
-
1280
-	else
1332
+	} else
1281 1333
 	{
1282 1334
 		echo '
1283 1335
 				<dl class="stats">';
@@ -1308,10 +1360,10 @@  discard block
 block discarded – undo
1308 1360
 					</h3>
1309 1361
 				</div>';
1310 1362
 
1311
-	if (empty($context['board_activity']))
1312
-		echo '
1363
+	if (empty($context['board_activity'])) {
1364
+			echo '
1313 1365
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1314
-	else
1366
+	} else
1315 1367
 	{
1316 1368
 		echo '
1317 1369
 				<dl class="stats">';
@@ -1359,41 +1411,46 @@  discard block
 block discarded – undo
1359 1411
 				<h3 class="catbg profile_hd">';
1360 1412
 
1361 1413
 		// Don't say "Profile" if this isn't the profile...
1362
-		if (!empty($context['profile_header_text']))
1363
-			echo '
1414
+		if (!empty($context['profile_header_text'])) {
1415
+					echo '
1364 1416
 					', $context['profile_header_text'];
1365
-		else
1366
-			echo '
1417
+		} else {
1418
+					echo '
1367 1419
 					', $txt['profile'];
1420
+		}
1368 1421
 
1369 1422
 		echo '
1370 1423
 				</h3>
1371 1424
 			</div>';
1372 1425
 
1373 1426
 	// Have we some description?
1374
-	if ($context['page_desc'])
1375
-		echo '
1427
+	if ($context['page_desc']) {
1428
+			echo '
1376 1429
 			<p class="information">', $context['page_desc'], '</p>';
1430
+	}
1377 1431
 
1378 1432
 	echo '
1379 1433
 			<div class="roundframe">';
1380 1434
 
1381 1435
 	// Any bits at the start?
1382
-	if (!empty($context['profile_prehtml']))
1383
-		echo '
1436
+	if (!empty($context['profile_prehtml'])) {
1437
+			echo '
1384 1438
 				<div>', $context['profile_prehtml'], '</div>';
1439
+	}
1385 1440
 
1386
-	if (!empty($context['profile_fields']))
1387
-		echo '
1441
+	if (!empty($context['profile_fields'])) {
1442
+			echo '
1388 1443
 				<dl>';
1444
+	}
1389 1445
 
1390 1446
 	// Start the big old loop 'of love.
1391 1447
 	$lastItem = 'hr';
1392 1448
 	foreach ($context['profile_fields'] as $key => $field)
1393 1449
 	{
1394 1450
 		// We add a little hack to be sure we never get more than one hr in a row!
1395
-		if ($lastItem == 'hr' && $field['type'] == 'hr')
1396
-			continue;
1451
+		if ($lastItem == 'hr' && $field['type'] == 'hr') {
1452
+					continue;
1453
+		}
1397 1454
 
1398 1455
 		$lastItem = $field['type'];
1399 1456
 		if ($field['type'] == 'hr')
@@ -1402,48 +1459,50 @@  discard block
 block discarded – undo
1402 1459
 				</dl>
1403 1460
 				<hr>
1404 1461
 				<dl>';
1405
-		}
1406
-		elseif ($field['type'] == 'callback')
1462
+		} elseif ($field['type'] == 'callback')
1407 1463
 		{
1408 1464
 			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
1409 1465
 			{
1410 1466
 				$callback_func = 'template_profile_' . $field['callback_func'];
1411 1467
 				$callback_func();
1412 1468
 			}
1413
-		}
1414
-		else
1469
+		} else
1415 1470
 		{
1416 1471
 			echo '
1417 1472
 					<dt>
1418 1473
 						<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
1419 1474
 
1420 1475
 			// Does it have any subtext to show?
1421
-			if (!empty($field['subtext']))
1422
-				echo '
1476
+			if (!empty($field['subtext'])) {
1477
+							echo '
1423 1478
 						<br>
1424 1479
 						<span class="smalltext">', $field['subtext'], '</span>';
1480
+			}
1425 1481
 
1426 1482
 			echo '
1427 1483
 					</dt>
1428 1484
 					<dd>';
1429 1485
 
1430 1486
 			// Want to put something infront of the box?
1431
-			if (!empty($field['preinput']))
1432
-				echo '
1487
+			if (!empty($field['preinput'])) {
1488
+							echo '
1433 1489
 						', $field['preinput'];
1490
+			}
1434 1491
 
1435 1492
 			// What type of data are we showing?
1436
-			if ($field['type'] == 'label')
1437
-				echo '
1493
+			if ($field['type'] == 'label') {
1494
+							echo '
1438 1495
 						', $field['value'];
1496
+			}
1439 1497
 
1440 1498
 			// Maybe it's a text box - very likely!
1441 1499
 			elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url')))
1442 1500
 			{
1443
-				if ($field['type'] == 'int' || $field['type'] == 'float')
1444
-					$type = 'number';
1445
-				else
1446
-					$type = $field['type'];
1501
+				if ($field['type'] == 'int' || $field['type'] == 'float') {
1502
+									$type = 'number';
1503
+				} else {
1504
+									$type = $field['type'];
1505
+				}
1447 1506
 				$step = $field['type'] == 'float' ? ' step="0.1"' : '';
1448 1507
 
1449 1508
 
@@ -1451,9 +1510,10 @@  discard block
 block discarded – undo
1451 1510
 						<input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '"', $step, '>';
1452 1511
 			}
1453 1512
 			// You "checking" me out? ;)
1454
-			elseif ($field['type'] == 'check')
1455
-				echo '
1513
+			elseif ($field['type'] == 'check') {
1514
+							echo '
1456 1515
 						<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" class="input_check" ', $field['input_attr'], '>';
1516
+			}
1457 1517
 
1458 1518
 			// Always fun - select boxes!
1459 1519
 			elseif ($field['type'] == 'select')
@@ -1464,13 +1524,15 @@  discard block
 block discarded – undo
1464 1524
 				if (isset($field['options']))
1465 1525
 				{
1466 1526
 					// Is this some code to generate the options?
1467
-					if (!is_array($field['options']))
1468
-						$field['options'] = $field['options']();
1527
+					if (!is_array($field['options'])) {
1528
+											$field['options'] = $field['options']();
1529
+					}
1469 1530
 					// Assuming we now have some!
1470
-					if (is_array($field['options']))
1471
-						foreach ($field['options'] as $value => $name)
1531
+					if (is_array($field['options'])) {
1532
+											foreach ($field['options'] as $value => $name)
1472 1533
 							echo '
1473 1534
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
1535
+					}
1474 1536
 				}
1475 1537
 
1476 1538
 				echo '
@@ -1478,25 +1540,28 @@  discard block
 block discarded – undo
1478 1540
 			}
1479 1541
 
1480 1542
 			// Something to end with?
1481
-			if (!empty($field['postinput']))
1482
-				echo '
1543
+			if (!empty($field['postinput'])) {
1544
+							echo '
1483 1545
 							', $field['postinput'];
1546
+			}
1484 1547
 
1485 1548
 			echo '
1486 1549
 					</dd>';
1487 1550
 		}
1488 1551
 	}
1489 1552
 
1490
-	if (!empty($context['profile_fields']))
1491
-		echo '
1553
+	if (!empty($context['profile_fields'])) {
1554
+			echo '
1492 1555
 				</dl>';
1556
+	}
1493 1557
 
1494 1558
 	// Are there any custom profile fields - if so print them!
1495 1559
 	if (!empty($context['custom_fields']))
1496 1560
 	{
1497
-		if ($lastItem != 'hr')
1498
-			echo '
1561
+		if ($lastItem != 'hr') {
1562
+					echo '
1499 1563
 				<hr>';
1564
+		}
1500 1565
 
1501 1566
 		echo '
1502 1567
 				<dl>';
@@ -1519,13 +1584,14 @@  discard block
 block discarded – undo
1519 1584
 	}
1520 1585
 
1521 1586
 	// Any closing HTML?
1522
-	if (!empty($context['profile_posthtml']))
1523
-		echo '
1587
+	if (!empty($context['profile_posthtml'])) {
1588
+			echo '
1524 1589
 				<div>', $context['profile_posthtml'], '</div>';
1590
+	}
1525 1591
 
1526 1592
 	// Only show the password box if it's actually needed.
1527
-	if ($context['require_password'])
1528
-		echo '
1593
+	if ($context['require_password']) {
1594
+			echo '
1529 1595
 				<dl>
1530 1596
 					<dt>
1531 1597
 						<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br>
@@ -1535,18 +1601,21 @@  discard block
 block discarded – undo
1535 1601
 						<input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password">
1536 1602
 					</dd>
1537 1603
 				</dl>';
1604
+	}
1538 1605
 
1539 1606
 	// The button shouldn't say "Change profile" unless we're changing the profile...
1540
-	if (!empty($context['submit_button_text']))
1541
-		echo '
1607
+	if (!empty($context['submit_button_text'])) {
1608
+			echo '
1542 1609
 				<input type="submit" name="save" value="', $context['submit_button_text'], '" class="button_submit">';
1543
-	else
1544
-		echo '
1610
+	} else {
1611
+			echo '
1545 1612
 				<input type="submit" name="save" value="', $txt['change_profile'], '" class="button_submit">';
1613
+	}
1546 1614
 
1547
-	if (!empty($context['token_check']))
1548
-		echo '
1615
+	if (!empty($context['token_check'])) {
1616
+			echo '
1549 1617
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
1618
+	}
1550 1619
 
1551 1620
 	echo '
1552 1621
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1556,10 +1625,11 @@  discard block
 block discarded – undo
1556 1625
 		</form>';
1557 1626
 
1558 1627
 	// Any final spellchecking stuff?
1559
-	if (!empty($context['show_spellchecking']))
1560
-		echo '
1628
+	if (!empty($context['show_spellchecking'])) {
1629
+			echo '
1561 1630
 		<form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value=""></form>';
1562
-}
1631
+	}
1632
+	}
1563 1633
 
1564 1634
 /**
1565 1635
  * Personal Message settings.
@@ -1596,10 +1666,11 @@  discard block
 block discarded – undo
1596 1666
 										<select name="pm_receive_from" id="pm_receive_from">
1597 1667
 												<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
1598 1668
 
1599
-	if (!empty($modSettings['enable_buddylist']))
1600
-		echo '
1669
+	if (!empty($modSettings['enable_buddylist'])) {
1670
+			echo '
1601 1671
 												<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option>
1602 1672
 												<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
1673
+	}
1603 1674
 
1604 1675
 	echo '
1605 1676
 												<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option>
@@ -1655,8 +1726,8 @@  discard block
 block discarded – undo
1655 1726
 								<input type="checkbox" name="default_options[show_no_signatures]" id="show_no_signatures" value="1"', !empty($context['member']['options']['show_no_signatures']) ? ' checked' : '', ' class="input_check">
1656 1727
 							</dd>';
1657 1728
 
1658
-	if (!empty($modSettings['allow_no_censored']))
1659
-		echo '
1729
+	if (!empty($modSettings['allow_no_censored'])) {
1730
+			echo '
1660 1731
 							<dt>
1661 1732
 								<label for="show_no_censored">' . $txt['show_no_censored'] . '</label>
1662 1733
 							</dt>
@@ -1664,6 +1735,7 @@  discard block
 block discarded – undo
1664 1735
 								<input type="hidden" name="default_options[show_no_censored]" value="0">
1665 1736
 								<input type="checkbox" name="default_options[show_no_censored]" id="show_no_censored" value="1"' . (!empty($context['member']['options']['show_no_censored']) ? ' checked' : '') . ' class="input_check">
1666 1737
 							</dd>';
1738
+	}
1667 1739
 
1668 1740
 	echo '
1669 1741
 							<dt>
@@ -1674,8 +1746,8 @@  discard block
 block discarded – undo
1674 1746
 								<input type="checkbox" name="default_options[return_to_post]" id="return_to_post" value="1"', !empty($context['member']['options']['return_to_post']) ? ' checked' : '', ' class="input_check">
1675 1747
 							</dd>';
1676 1748
 
1677
-	if (!empty($modSettings['enable_buddylist']))
1678
-		echo '
1749
+	if (!empty($modSettings['enable_buddylist'])) {
1750
+			echo '
1679 1751
 							<dt>
1680 1752
 								<label for="posts_apply_ignore_list">', $txt['posts_apply_ignore_list'], '</label>
1681 1753
 							</dt>
@@ -1683,6 +1755,7 @@  discard block
 block discarded – undo
1683 1755
 								<input type="hidden" name="default_options[posts_apply_ignore_list]" value="0">
1684 1756
 								<input type="checkbox" name="default_options[posts_apply_ignore_list]" id="posts_apply_ignore_list" value="1"', !empty($context['member']['options']['posts_apply_ignore_list']) ? ' checked' : '', ' class="input_check">
1685 1757
 							</dd>';
1758
+	}
1686 1759
 
1687 1760
 	echo '
1688 1761
 							<dt>
@@ -1694,8 +1767,8 @@  discard block
 block discarded – undo
1694 1767
 							</dd>';
1695 1768
 
1696 1769
 	// Choose WYSIWYG settings?
1697
-	if (empty($modSettings['disable_wysiwyg']))
1698
-		echo '
1770
+	if (empty($modSettings['disable_wysiwyg'])) {
1771
+			echo '
1699 1772
 							<dt>
1700 1773
 								<label for="wysiwyg_default">', $txt['wysiwyg_default'], '</label>
1701 1774
 							</dt>
@@ -1703,6 +1776,7 @@  discard block
 block discarded – undo
1703 1776
 								<input type="hidden" name="default_options[wysiwyg_default]" value="0">
1704 1777
 								<input type="checkbox" name="default_options[wysiwyg_default]" id="wysiwyg_default" value="1"', !empty($context['member']['options']['wysiwyg_default']) ? ' checked' : '', ' class="input_check">
1705 1778
 							</dd>';
1779
+	}
1706 1780
 
1707 1781
 	if (empty($modSettings['disableCustomPerPage']))
1708 1782
 	{
@@ -1733,8 +1807,8 @@  discard block
 block discarded – undo
1733 1807
 							</dd>';
1734 1808
 	}
1735 1809
 
1736
-	if (!empty($modSettings['cal_enabled']))
1737
-		echo '
1810
+	if (!empty($modSettings['cal_enabled'])) {
1811
+			echo '
1738 1812
 							<dt>
1739 1813
 								<label for="calendar_start_day">', $txt['calendar_start_day'], ':</label>
1740 1814
 							</dt>
@@ -1745,9 +1819,10 @@  discard block
 block discarded – undo
1745 1819
 									<option value="6"', !empty($context['member']['options']['calendar_start_day']) && $context['member']['options']['calendar_start_day'] == 6 ? ' selected' : '', '>', $txt['days'][6], '</option>
1746 1820
 								</select>
1747 1821
 							</dd>';
1822
+	}
1748 1823
 
1749
-	if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_autosave_enabled']))
1750
-		echo '
1824
+	if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_autosave_enabled'])) {
1825
+			echo '
1751 1826
 							<dt>
1752 1827
 								<label for="drafts_autosave_enabled">', $txt['drafts_autosave_enabled'], '</label>
1753 1828
 							</dt>
@@ -1755,8 +1830,9 @@  discard block
 block discarded – undo
1755 1830
 								<input type="hidden" name="default_options[drafts_autosave_enabled]" value="0">
1756 1831
 								<input type="checkbox" name="default_options[drafts_autosave_enabled]" id="drafts_autosave_enabled" value="1"', !empty($context['member']['options']['drafts_autosave_enabled']) ? ' checked' : '', ' class="input_check">
1757 1832
 							</dd>';
1758
-	if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_show_saved_enabled']))
1759
-		echo '
1833
+	}
1834
+	if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_show_saved_enabled'])) {
1835
+			echo '
1760 1836
 							<dt>
1761 1837
 								<label for="drafts_show_saved_enabled">', $txt['drafts_show_saved_enabled'], '</label>
1762 1838
 							</dt>
@@ -1764,6 +1840,7 @@  discard block
 block discarded – undo
1764 1840
 								<input type="hidden" name="default_options[drafts_show_saved_enabled]" value="0">
1765 1841
 								<input type="checkbox" name="default_options[drafts_show_saved_enabled]" id="drafts_show_saved_enabled" value="1"', !empty($context['member']['options']['drafts_show_saved_enabled']) ? ' checked' : '', ' class="input_check">
1766 1842
 							</dd>';
1843
+	}
1767 1844
 
1768 1845
 	echo '
1769 1846
 							<dt>
@@ -1809,8 +1886,8 @@  discard block
 block discarded – undo
1809 1886
 				<dl class="settings">';
1810 1887
 
1811 1888
 	// Allow notification on announcements to be disabled?
1812
-	if (!empty($modSettings['allow_disableAnnounce']))
1813
-		echo '
1889
+	if (!empty($modSettings['allow_disableAnnounce'])) {
1890
+			echo '
1814 1891
 					<dt>
1815 1892
 						<label for="notify_announcements">', $txt['notify_important_email'], '</label>
1816 1893
 					</dt>
@@ -1818,9 +1895,10 @@  discard block
 block discarded – undo
1818 1895
 						<input type="hidden" name="notify_announcements" value="0">
1819 1896
 						<input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', ' class="input_check">
1820 1897
 					</dd>';
1898
+	}
1821 1899
 
1822
-	if (!empty($modSettings['enable_ajax_alerts']))
1823
-		echo '
1900
+	if (!empty($modSettings['enable_ajax_alerts'])) {
1901
+			echo '
1824 1902
 					<dt>
1825 1903
 						<label for="notify_send_body">', $txt['notify_alert_timeout'], '</label>
1826 1904
 					</dt>
@@ -1828,6 +1906,7 @@  discard block
 block discarded – undo
1828 1906
 						<input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '" class="input_text">
1829 1907
 					</dd>
1830 1908
 		';
1909
+	}
1831 1910
 
1832 1911
 	echo '
1833 1912
 				</dl>
@@ -1857,9 +1936,10 @@  discard block
 block discarded – undo
1857 1936
 					<td colspan="3">';
1858 1937
 				$label = $txt['alert_opt_' . $opts[1]];
1859 1938
 				$label_pos = isset($opts['label']) ? $opts['label'] : '';
1860
-				if ($label_pos == 'before')
1861
-					echo '
1939
+				if ($label_pos == 'before') {
1940
+									echo '
1862 1941
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1942
+				}
1863 1943
 
1864 1944
 				$this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0;
1865 1945
 				switch ($opts[0])
@@ -1871,17 +1951,19 @@  discard block
 block discarded – undo
1871 1951
 					case 'select':
1872 1952
 						echo '
1873 1953
 						<select name="opt_', $opts[1], '" id="opt_', $opts[1], '">';
1874
-						foreach ($opts['opts'] as $k => $v)
1875
-							echo '
1954
+						foreach ($opts['opts'] as $k => $v) {
1955
+													echo '
1876 1956
 							<option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>';
1957
+						}
1877 1958
 						echo '
1878 1959
 						</select>';
1879 1960
 						break;
1880 1961
 				}
1881 1962
 
1882
-				if ($label_pos == 'after')
1883
-					echo '
1963
+				if ($label_pos == 'after') {
1964
+									echo '
1884 1965
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1966
+				}
1885 1967
 
1886 1968
 				echo '
1887 1969
 					</td>
@@ -1995,11 +2077,12 @@  discard block
 block discarded – undo
1995 2077
 			<p class="information">', $txt['groupMembership_info'], '</p>';
1996 2078
 
1997 2079
 	// Do we have an update message?
1998
-	if (!empty($context['update_message']))
1999
-		echo '
2080
+	if (!empty($context['update_message'])) {
2081
+			echo '
2000 2082
 			<div class="infobox">
2001 2083
 				', $context['update_message'], '.
2002 2084
 			</div>';
2085
+	}
2003 2086
 
2004 2087
 	echo '
2005 2088
 		<div id="groups">';
@@ -2021,8 +2104,7 @@  discard block
 block discarded – undo
2021 2104
 					</div>
2022 2105
 				</div>
2023 2106
 			</div>';
2024
-	}
2025
-	else
2107
+	} else
2026 2108
 	{
2027 2109
 		echo '
2028 2110
 			<div class="title_bar">
@@ -2034,27 +2116,30 @@  discard block
 block discarded – undo
2034 2116
 			echo '
2035 2117
 					<div class="windowbg" id="primdiv_', $group['id'], '">';
2036 2118
 
2037
-				if ($context['can_edit_primary'])
2038
-					echo '
2119
+				if ($context['can_edit_primary']) {
2120
+									echo '
2039 2121
 						<input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '"', $group['is_primary'] ? ' checked' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');"', $group['can_be_primary'] ? '' : ' disabled', ' class="input_radio">';
2122
+				}
2040 2123
 
2041 2124
 				echo '
2042 2125
 						<label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>';
2043 2126
 
2044 2127
 				// Can they leave their group?
2045
-				if ($group['can_leave'])
2046
-					echo '
2128
+				if ($group['can_leave']) {
2129
+									echo '
2047 2130
 						<a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">' . $txt['leave_group'] . '</a>';
2131
+				}
2048 2132
 
2049 2133
 				echo '
2050 2134
 					</div>';
2051 2135
 		}
2052 2136
 
2053
-		if ($context['can_edit_primary'])
2054
-			echo '
2137
+		if ($context['can_edit_primary']) {
2138
+					echo '
2055 2139
 			<div class="padding righttext">
2056 2140
 				<input type="submit" value="', $txt['make_primary'], '" class="button_submit">
2057 2141
 			</div>';
2142
+		}
2058 2143
 
2059 2144
 		// Any groups they can join?
2060 2145
 		if (!empty($context['groups']['available']))
@@ -2070,15 +2155,16 @@  discard block
 block discarded – undo
2070 2155
 					<div class="windowbg">
2071 2156
 						<strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '';
2072 2157
 
2073
-				if ($group['type'] == 3)
2074
-					echo '
2158
+				if ($group['type'] == 3) {
2159
+									echo '
2075 2160
 						<a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '" class="button floatright">', $txt['join_group'], '</a>';
2076
-				elseif ($group['type'] == 2 && $group['pending'])
2077
-					echo '
2161
+				} elseif ($group['type'] == 2 && $group['pending']) {
2162
+									echo '
2078 2163
 						<span class="floatright">', $txt['approval_pending'],'</span>';
2079
-				elseif ($group['type'] == 2)
2080
-					echo '
2164
+				} elseif ($group['type'] == 2) {
2165
+									echo '
2081 2166
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
2167
+				}
2082 2168
 
2083 2169
 				echo '
2084 2170
 					</div>';
@@ -2101,9 +2187,10 @@  discard block
 block discarded – undo
2101 2187
 
2102 2188
 			prevDiv.className = "windowbg";
2103 2189
 		}';
2104
-		if (isset($context['groups']['member'][$context['primary_group']]))
2105
-			echo '
2190
+		if (isset($context['groups']['member'][$context['primary_group']])) {
2191
+					echo '
2106 2192
 		highlightSelected("primdiv_' . $context['primary_group'] . '");';
2193
+		}
2107 2194
 		echo '
2108 2195
 	</script>';
2109 2196
 	}
@@ -2111,9 +2198,10 @@  discard block
 block discarded – undo
2111 2198
 	echo '
2112 2199
 		</div>';
2113 2200
 
2114
-	if (!empty($context['token_check']))
2115
-		echo '
2201
+	if (!empty($context['token_check'])) {
2202
+			echo '
2116 2203
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2204
+	}
2117 2205
 
2118 2206
 	echo '
2119 2207
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2160,14 +2248,15 @@  discard block
 block discarded – undo
2160 2248
 
2161 2249
 		foreach ($category['boards'] as $board)
2162 2250
 		{
2163
-			if ($i == $limit)
2164
-				echo '
2251
+			if ($i == $limit) {
2252
+							echo '
2165 2253
 						</ul>
2166 2254
 					</li>
2167 2255
 				</ul>
2168 2256
 				<ul class="ignoreboards floatright">
2169 2257
 					<li class="category">
2170 2258
 						<ul>';
2259
+			}
2171 2260
 
2172 2261
 			echo '
2173 2262
 							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
@@ -2213,10 +2302,11 @@  discard block
 block discarded – undo
2213 2302
 
2214 2303
 	// Work out the starting color.
2215 2304
 	$context['current_color'] = $context['colors'][0];
2216
-	foreach ($context['colors'] as $limit => $color)
2217
-		if ($context['member']['warning'] >= $limit)
2305
+	foreach ($context['colors'] as $limit => $color) {
2306
+			if ($context['member']['warning'] >= $limit)
2218 2307
 			$context['current_color'] = $color;
2219
-}
2308
+	}
2309
+	}
2220 2310
 
2221 2311
 // Show all warnings of a user?
2222 2312
 function template_viewWarning()
@@ -2255,14 +2345,15 @@  discard block
 block discarded – undo
2255 2345
 				</dd>';
2256 2346
 
2257 2347
 		// There's some impact of this?
2258
-		if (!empty($context['level_effects'][$context['current_level']]))
2259
-			echo '
2348
+		if (!empty($context['level_effects'][$context['current_level']])) {
2349
+					echo '
2260 2350
 				<dt>
2261 2351
 					<strong>', $txt['profile_viewwarning_impact'], ':</strong>
2262 2352
 				</dt>
2263 2353
 				<dd>
2264 2354
 					', $context['level_effects'][$context['current_level']], '
2265 2355
 				</dd>';
2356
+		}
2266 2357
 
2267 2358
 		echo '
2268 2359
 			</dl>
@@ -2300,10 +2391,11 @@  discard block
 block discarded – undo
2300 2391
 
2301 2392
 			// Otherwise see what we can do...';
2302 2393
 
2303
-	foreach ($context['notification_templates'] as $k => $type)
2304
-		echo '
2394
+	foreach ($context['notification_templates'] as $k => $type) {
2395
+			echo '
2305 2396
 			if (index == ', $k, ')
2306 2397
 				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
2398
+	}
2307 2399
 
2308 2400
 	echo '
2309 2401
 		}
@@ -2313,10 +2405,11 @@  discard block
 block discarded – undo
2313 2405
 			// Also set the right effect.
2314 2406
 			effectText = "";';
2315 2407
 
2316
-	foreach ($context['level_effects'] as $limit => $text)
2317
-		echo '
2408
+	foreach ($context['level_effects'] as $limit => $text) {
2409
+			echo '
2318 2410
 			if (slideAmount >= ', $limit, ')
2319 2411
 				effectText = "', $text, '";';
2412
+	}
2320 2413
 
2321 2414
 	echo '
2322 2415
 			setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\');
@@ -2331,31 +2424,34 @@  discard block
 block discarded – undo
2331 2424
 			</h3>
2332 2425
 		</div>';
2333 2426
 
2334
-	if (!$context['user']['is_owner'])
2335
-		echo '
2427
+	if (!$context['user']['is_owner']) {
2428
+			echo '
2336 2429
 		<p class="information">', $txt['profile_warning_desc'], '</p>';
2430
+	}
2337 2431
 
2338 2432
 	echo '
2339 2433
 		<div class="windowbg">
2340 2434
 			<dl class="settings">';
2341 2435
 
2342
-	if (!$context['user']['is_owner'])
2343
-		echo '
2436
+	if (!$context['user']['is_owner']) {
2437
+			echo '
2344 2438
 				<dt>
2345 2439
 					<strong>', $txt['profile_warning_name'], ':</strong>
2346 2440
 				</dt>
2347 2441
 				<dd>
2348 2442
 					<strong>', $context['member']['name'], '</strong>
2349 2443
 				</dd>';
2444
+	}
2350 2445
 
2351 2446
 	echo '
2352 2447
 				<dt>
2353 2448
 					<strong>', $txt['profile_warning_level'], ':</strong>';
2354 2449
 
2355 2450
 	// Is there only so much they can apply?
2356
-	if ($context['warning_limit'])
2357
-		echo '
2451
+	if ($context['warning_limit']) {
2452
+			echo '
2358 2453
 					<br><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
2454
+	}
2359 2455
 
2360 2456
 	echo '
2361 2457
 				</dt>
@@ -2408,9 +2504,10 @@  discard block
 block discarded – undo
2408 2504
 						<option value="-1">', $txt['profile_warning_notify_template'], '</option>
2409 2505
 						<option value="-1" disabled>------------------------------</option>';
2410 2506
 
2411
-		foreach ($context['notification_templates'] as $id_template => $template)
2412
-			echo '
2507
+		foreach ($context['notification_templates'] as $id_template => $template) {
2508
+					echo '
2413 2509
 						<option value="', $id_template, '">', $template['title'], '</option>';
2510
+		}
2414 2511
 
2415 2512
 		echo '
2416 2513
 					</select>
@@ -2422,9 +2519,10 @@  discard block
 block discarded – undo
2422 2519
 			</dl>
2423 2520
 			<div class="righttext">';
2424 2521
 
2425
-	if (!empty($context['token_check']))
2426
-		echo '
2522
+	if (!empty($context['token_check'])) {
2523
+			echo '
2427 2524
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2525
+	}
2428 2526
 
2429 2527
 	echo '
2430 2528
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2440,8 +2538,8 @@  discard block
 block discarded – undo
2440 2538
 	echo '
2441 2539
 	<script>';
2442 2540
 
2443
-	if (!$context['user']['is_owner'])
2444
-		echo '
2541
+	if (!$context['user']['is_owner']) {
2542
+			echo '
2445 2543
 		modifyWarnNotify();
2446 2544
 		$(document).ready(function() {
2447 2545
 			$("#preview_button").click(function() {
@@ -2480,6 +2578,7 @@  discard block
 block discarded – undo
2480 2578
 			});
2481 2579
 			return false;
2482 2580
 		}';
2581
+	}
2483 2582
 
2484 2583
 	echo '
2485 2584
 	</script>';
@@ -2502,16 +2601,18 @@  discard block
 block discarded – undo
2502 2601
 			</div>';
2503 2602
 
2504 2603
 	// If deleting another account give them a lovely info box.
2505
-	if (!$context['user']['is_owner'])
2506
-		echo '
2604
+	if (!$context['user']['is_owner']) {
2605
+			echo '
2507 2606
 			<p class="information">', $txt['deleteAccount_desc'], '</p>';
2607
+	}
2508 2608
 	echo '
2509 2609
 			<div class="windowbg2">';
2510 2610
 
2511 2611
 	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
2512
-	if ($context['needs_approval'])
2513
-		echo '
2612
+	if ($context['needs_approval']) {
2613
+			echo '
2514 2614
 				<div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
2615
+	}
2515 2616
 
2516 2617
 	// If the user is deleting their own account warn them first - and require a password!
2517 2618
 	if ($context['user']['is_owner'])
@@ -2523,9 +2624,10 @@  discard block
 block discarded – undo
2523 2624
 					<input type="password" name="oldpasswrd" size="20" class="input_password">&nbsp;&nbsp;&nbsp;&nbsp;
2524 2625
 					<input type="submit" value="', $txt['yes'], '" class="button_submit">';
2525 2626
 
2526
-		if (!empty($context['token_check']))
2527
-			echo '
2627
+		if (!empty($context['token_check'])) {
2628
+					echo '
2528 2629
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2630
+		}
2529 2631
 
2530 2632
 		echo '
2531 2633
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2551,9 +2653,10 @@  discard block
 block discarded – undo
2551 2653
 						<option value="topics">', $txt['deleteAccount_topics'], '</option>
2552 2654
 					</select>';
2553 2655
 
2554
-			if ($context['show_perma_delete'])
2555
-				echo '
2656
+			if ($context['show_perma_delete']) {
2657
+							echo '
2556 2658
 					<br><label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1" class="input_check">', $txt['deleteAccount_permanent'], ':</label>';
2659
+			}
2557 2660
 
2558 2661
 			echo '
2559 2662
 				</div>';
@@ -2566,9 +2669,10 @@  discard block
 block discarded – undo
2566 2669
 				<div>
2567 2670
 					<input type="submit" value="', $txt['delete'], '" class="button_submit">';
2568 2671
 
2569
-		if (!empty($context['token_check']))
2570
-			echo '
2672
+		if (!empty($context['token_check'])) {
2673
+					echo '
2571 2674
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2675
+		}
2572 2676
 
2573 2677
 		echo '
2574 2678
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2594,8 +2698,8 @@  discard block
 block discarded – undo
2594 2698
 					<hr>';
2595 2699
 
2596 2700
 	// Only show the password box if it's actually needed.
2597
-	if ($context['require_password'])
2598
-		echo '
2701
+	if ($context['require_password']) {
2702
+			echo '
2599 2703
 					<dl>
2600 2704
 						<dt>
2601 2705
 							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br>
@@ -2605,13 +2709,15 @@  discard block
 block discarded – undo
2605 2709
 							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password">
2606 2710
 						</dd>
2607 2711
 					</dl>';
2712
+	}
2608 2713
 
2609 2714
 	echo '
2610 2715
 					<div class="righttext">';
2611 2716
 
2612
-		if (!empty($context['token_check']))
2613
-			echo '
2717
+		if (!empty($context['token_check'])) {
2718
+					echo '
2614 2719
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2720
+		}
2615 2721
 
2616 2722
 	echo '
2617 2723
 						<input type="submit" value="', $txt['change_profile'], '" class="button_submit">
@@ -2638,9 +2744,10 @@  discard block
 block discarded – undo
2638 2744
 			<ul id="list_errors">';
2639 2745
 
2640 2746
 		// Cycle through each error and display an error message.
2641
-		foreach ($context['post_errors'] as $error)
2642
-			echo '
2747
+		foreach ($context['post_errors'] as $error) {
2748
+					echo '
2643 2749
 				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
2750
+		}
2644 2751
 
2645 2752
 		echo '
2646 2753
 			</ul>';
@@ -2666,12 +2773,13 @@  discard block
 block discarded – undo
2666 2773
 								<select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 &amp;&amp; !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>';
2667 2774
 
2668 2775
 		// Fill the select box with all primary member groups that can be assigned to a member.
2669
-		foreach ($context['member_groups'] as $member_group)
2670
-			if (!empty($member_group['can_be_primary']))
2776
+		foreach ($context['member_groups'] as $member_group) {
2777
+					if (!empty($member_group['can_be_primary']))
2671 2778
 				echo '
2672 2779
 									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '>
2673 2780
 										', $member_group['name'], '
2674 2781
 									</option>';
2782
+		}
2675 2783
 		echo '
2676 2784
 								</select>
2677 2785
 							</dd>
@@ -2683,10 +2791,11 @@  discard block
 block discarded – undo
2683 2791
 									<input type="hidden" name="additional_groups[]" value="0">';
2684 2792
 
2685 2793
 		// For each membergroup show a checkbox so members can be assigned to more than one group.
2686
-		foreach ($context['member_groups'] as $member_group)
2687
-			if ($member_group['can_be_additional'])
2794
+		foreach ($context['member_groups'] as $member_group) {
2795
+					if ($member_group['can_be_additional'])
2688 2796
 				echo '
2689 2797
 									<label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked' : '', ' class="input_check"> ', $member_group['name'], '</label><br>';
2798
+		}
2690 2799
 		echo '
2691 2800
 								</span>
2692 2801
 								<a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;" class="toggle_down">', $txt['additional_membergroups_show'], '</a>
@@ -2746,9 +2855,10 @@  discard block
 block discarded – undo
2746 2855
 								<span class="smalltext">', $txt['sig_info'], '</span><br>
2747 2856
 								<br>';
2748 2857
 
2749
-	if ($context['show_spellchecking'])
2750
-		echo '
2858
+	if ($context['show_spellchecking']) {
2859
+			echo '
2751 2860
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button_submit">';
2861
+	}
2752 2862
 
2753 2863
 		echo '
2754 2864
 							</dt>
@@ -2756,17 +2866,20 @@  discard block
 block discarded – undo
2756 2866
 								<textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50" style="min-width: 50%; max-width: 99%;">', $context['member']['signature'], '</textarea><br>';
2757 2867
 
2758 2868
 	// If there is a limit at all!
2759
-	if (!empty($context['signature_limits']['max_length']))
2760
-		echo '
2869
+	if (!empty($context['signature_limits']['max_length'])) {
2870
+			echo '
2761 2871
 								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>';
2872
+	}
2762 2873
 
2763
-	if (!empty($context['show_preview_button']))
2764
-		echo '
2874
+	if (!empty($context['show_preview_button'])) {
2875
+			echo '
2765 2876
 								<input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button_submit">';
2877
+	}
2766 2878
 
2767
-	if ($context['signature_warning'])
2768
-		echo '
2879
+	if ($context['signature_warning']) {
2880
+			echo '
2769 2881
 								<span class="smalltext">', $context['signature_warning'], '</span>';
2882
+	}
2770 2883
 
2771 2884
 	// Some javascript used to count how many characters have been used so far in the signature.
2772 2885
 	echo '
@@ -2810,9 +2923,10 @@  discard block
 block discarded – undo
2810 2923
 									<div>
2811 2924
 										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
2812 2925
 		// This lists all the file categories.
2813
-		foreach ($context['avatars'] as $avatar)
2814
-			echo '
2926
+		foreach ($context['avatars'] as $avatar) {
2927
+					echo '
2815 2928
 											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>';
2929
+		}
2816 2930
 		echo '
2817 2931
 										</select>
2818 2932
 									</div>
@@ -2867,16 +2981,17 @@  discard block
 block discarded – undo
2867 2981
 								<div id="avatar_gravatar">
2868 2982
 									<img src="' . $context['member']['avatar']['href'] . '" alt="" />';
2869 2983
 
2870
-		if (empty($modSettings['gravatarAllowExtraEmail']))
2871
-			echo '
2984
+		if (empty($modSettings['gravatarAllowExtraEmail'])) {
2985
+					echo '
2872 2986
 									<div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>';
2873
-		else
2987
+		} else
2874 2988
 		{
2875 2989
 			// Depending on other stuff, the stored value here might have some odd things in it from other areas.
2876
-			if ($context['member']['avatar']['external'] == $context['member']['email'])
2877
-				$textbox_value = '';
2878
-			else
2879
-				$textbox_value = $context['member']['avatar']['external'];
2990
+			if ($context['member']['avatar']['external'] == $context['member']['email']) {
2991
+							$textbox_value = '';
2992
+			} else {
2993
+							$textbox_value = $context['member']['avatar']['external'];
2994
+			}
2880 2995
 
2881 2996
 			echo '
2882 2997
 									<div class="smalltext">', $txt['gravatar_alternateEmail'], '</div>
@@ -2948,8 +3063,9 @@  discard block
 block discarded – undo
2948 3063
 	$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
2949 3064
 
2950 3065
 	$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
2951
-	if (empty($suffix))
2952
-		return;
3066
+	if (empty($suffix)) {
3067
+			return;
3068
+	}
2953 3069
 
2954 3070
 	echo '
2955 3071
 									<div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>';
@@ -2971,9 +3087,10 @@  discard block
 block discarded – undo
2971 3087
 							<dd>
2972 3088
 								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
2973 3089
 	// Help the user by showing a list of common time formats.
2974
-	foreach ($context['easy_timeformats'] as $time_format)
2975
-		echo '
3090
+	foreach ($context['easy_timeformats'] as $time_format) {
3091
+			echo '
2976 3092
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3093
+	}
2977 3094
 	echo '
2978 3095
 								</select><br>
2979 3096
 								<input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30" class="input_text">
@@ -3009,9 +3126,10 @@  discard block
 block discarded – undo
3009 3126
 							</dt>
3010 3127
 							<dd>
3011 3128
 								<select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">';
3012
-	foreach ($context['smiley_sets'] as $set)
3013
-		echo '
3129
+	foreach ($context['smiley_sets'] as $set) {
3130
+			echo '
3014 3131
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>';
3132
+	}
3015 3133
 	echo '
3016 3134
 								</select> <img id="smileypr" class="centericon" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.png', '" alt=":)"  style="padding-left: 20px;">
3017 3135
 							</dd>';
@@ -3062,10 +3180,11 @@  discard block
 block discarded – undo
3062 3180
 									</div>
3063 3181
 									<div class="clear"></div>';
3064 3182
 
3065
-	if (!empty($context['from_ajax']))
3066
-		echo '
3183
+	if (!empty($context['from_ajax'])) {
3184
+			echo '
3067 3185
 									<br>
3068 3186
 									<a href="javascript:self.close();"></a>';
3187
+	}
3069 3188
 
3070 3189
 	echo '
3071 3190
 								</div>
@@ -3104,15 +3223,16 @@  discard block
 block discarded – undo
3104 3223
 								<br /><div class="smalltext">', $txt['tfa_profile_desc'], '</div>
3105 3224
 							</dt>
3106 3225
 							<dd>';
3107
-	if (!$context['tfa_enabled'] && $context['user']['is_owner'])
3108
-		echo '
3226
+	if (!$context['tfa_enabled'] && $context['user']['is_owner']) {
3227
+			echo '
3109 3228
 								<a href="', !empty($modSettings['force_ssl']) && $modSettings['force_ssl'] < 2 ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>';
3110
-	elseif (!$context['tfa_enabled'])
3111
-		echo '
3229
+	} elseif (!$context['tfa_enabled']) {
3230
+			echo '
3112 3231
 								', $txt['tfa_profile_disabled'];
3113
-	else
3114
-		echo '
3232
+	} else {
3233
+			echo '
3115 3234
 							', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable');
3235
+	}
3116 3236
 	echo '
3117 3237
 							</dd>';
3118 3238
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3031,8 +3031,7 @@
 block discarded – undo
3031 3031
 							<div class="roundframe">
3032 3032
 								<div>
3033 3033
 		', !empty($context['tfa_backup']) ? '
3034
-									<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' :
3035
-			($modSettings['tfa_mode'] == 2 ? '
3034
+									<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? '
3036 3035
 									<div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), '
3037 3036
 									<div class="smalltext">', $txt['tfa_desc'], '</div>
3038 3037
 									<div id="basicinfo" style="width: 60%">
Please login to merge, or discard this patch.
Themes/default/ManageMembers.template.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
 				</thead>
149 149
 				<tbody>';
150 150
 
151
-			foreach ($context['membergroups'] as $membergroup)
152
-				echo '
151
+			foreach ($context['membergroups'] as $membergroup) {
152
+							echo '
153 153
 					<tr class="windowbg">
154 154
 						<td>', $membergroup['name'], '</td>
155 155
 						<td class="centercol">
@@ -159,6 +159,7 @@  discard block
 block discarded – undo
159 159
 							', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked class="input_check">' : '', '
160 160
 						</td>
161 161
 					</tr>';
162
+			}
162 163
 
163 164
 			echo '
164 165
 					<tr class="windowbg">
@@ -185,8 +186,8 @@  discard block
 block discarded – undo
185 186
 				</thead>
186 187
 				<tbody>';
187 188
 
188
-			foreach ($context['postgroups'] as $postgroup)
189
-				echo '
189
+			foreach ($context['postgroups'] as $postgroup) {
190
+							echo '
190 191
 					<tr class="windowbg">
191 192
 						<td>
192 193
 							', $postgroup['name'], '
@@ -195,6 +196,7 @@  discard block
 block discarded – undo
195 196
 							<input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked class="input_check">
196 197
 						</td>
197 198
 					</tr>';
199
+			}
198 200
 
199 201
 			echo '
200 202
 					<tr class="windowbg">
Please login to merge, or discard this patch.
Themes/default/ReportedContent.template.php 1 patch
Braces   +51 added lines, -34 removed lines patch added patch discarded remove patch
@@ -54,8 +54,9 @@  discard block
 block discarded – undo
54 54
 
55 55
 		// Prepare the comments...
56 56
 		$comments = array();
57
-		foreach ($report['comments'] as $comment)
58
-			$comments[$comment['member']['id']] = $comment['member']['link'];
57
+		foreach ($report['comments'] as $comment) {
58
+					$comments[$comment['member']['id']] = $comment['member']['link'];
59
+		}
59 60
 
60 61
 		echo '
61 62
 				', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
@@ -69,18 +70,21 @@  discard block
 block discarded – undo
69 70
 				<li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>';
70 71
 
71 72
 		// Delete message button.
72
-		if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])))
73
-			echo '
73
+		if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) {
74
+					echo '
74 75
 				<li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'] ,'.0;msg=', $report['topic']['id_msg'] ,';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'] ,'" class="you_sure">', $delete_button, '</a></li>';
76
+		}
75 77
 
76 78
 		// Ban this user button.
77
-		if (!$report['closed'] && !empty($context['report_manage_bans']))
78
-			echo '
79
+		if (!$report['closed'] && !empty($context['report_manage_bans'])) {
80
+					echo '
79 81
 				<li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u='. $report['author']['id'] : ';msg='. $report['topic']['id_msg']) ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>';
82
+		}
80 83
 
81
-		if (!$context['view_closed'])
82
-			echo '
84
+		if (!$context['view_closed']) {
85
+					echo '
83 86
 				<li><input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check"></li>';
87
+		}
84 88
 
85 89
 			echo '
86 90
 				</ul>
@@ -88,11 +92,12 @@  discard block
 block discarded – undo
88 92
 	}
89 93
 
90 94
 	// Were none found?
91
-	if (empty($context['reports']))
92
-		echo '
95
+	if (empty($context['reports'])) {
96
+			echo '
93 97
 		<div class="windowbg2">
94 98
 			<p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
95 99
 		</div>';
100
+	}
96 101
 
97 102
 	echo '
98 103
 		<div class="pagesection">
@@ -125,18 +130,20 @@  discard block
 block discarded – undo
125 130
 			<div class="modbox">
126 131
 				<ul>';
127 132
 
128
-		foreach ($context['reported_posts'] as $report)
129
-			echo '
133
+		foreach ($context['reported_posts'] as $report) {
134
+					echo '
130 135
 					<li class="smalltext">
131 136
 						<a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], '
132 137
 					</li>';
138
+		}
133 139
 
134 140
 		// Don't have any watched users right now?
135
-		if (empty($context['reported_posts']))
136
-			echo '
141
+		if (empty($context['reported_posts'])) {
142
+					echo '
137 143
 					<li>
138 144
 						<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
139 145
 					</li>';
146
+		}
140 147
 
141 148
 		echo '
142 149
 				</ul>
@@ -226,12 +233,13 @@  discard block
 block discarded – undo
226 233
 				<h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3>
227 234
 			</div>';
228 235
 
229
-	foreach ($context['report']['comments'] as $comment)
230
-		echo '
236
+	foreach ($context['report']['comments'] as $comment) {
237
+			echo '
231 238
 			<div class="windowbg">
232 239
 				<p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
233 240
 				<p>', $comment['message'], '</p>
234 241
 			</div>';
242
+	}
235 243
 
236 244
 	echo '
237 245
 			<br>
@@ -240,11 +248,12 @@  discard block
 block discarded – undo
240 248
 			</div>
241 249
 				<div>';
242 250
 
243
-	if (empty($context['report']['mod_comments']))
244
-		echo '
251
+	if (empty($context['report']['mod_comments'])) {
252
+			echo '
245 253
 				<div class="information">
246 254
 					<p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
247 255
 				</div>';
256
+	}
248 257
 
249 258
 	foreach ($context['report']['mod_comments'] as $comment)
250 259
 	{
@@ -334,18 +343,20 @@  discard block
 block discarded – undo
334 343
 			<div class="modbox">
335 344
 				<ul>';
336 345
 
337
-		foreach ($context['reported_members'] as $report)
338
-			echo '
346
+		foreach ($context['reported_members'] as $report) {
347
+					echo '
339 348
 					<li class="smalltext">
340 349
 						<a href="', $report['report_href'], '">', $report['user_name'], '</a>
341 350
 					</li>';
351
+		}
342 352
 
343 353
 		// Don't have any reported members right now?
344
-		if (empty($context['reported_members']))
345
-			echo '
354
+		if (empty($context['reported_members'])) {
355
+					echo '
346 356
 					<li>
347 357
 						<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
348 358
 					</li>';
359
+		}
349 360
 
350 361
 		echo '
351 362
 				</ul>
@@ -431,8 +442,9 @@  discard block
 block discarded – undo
431 442
 
432 443
 		// Prepare the comments...
433 444
 		$comments = array();
434
-		foreach ($report['comments'] as $comment)
435
-			$comments[$comment['member']['id']] = $comment['member']['link'];
445
+		foreach ($report['comments'] as $comment) {
446
+					$comments[$comment['member']['id']] = $comment['member']['link'];
447
+		}
436 448
 
437 449
 		echo '
438 450
 				', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
@@ -444,13 +456,15 @@  discard block
 block discarded – undo
444 456
 				<li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>';
445 457
 
446 458
 		// Ban this user button.
447
-		if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id']))
448
-			echo '
459
+		if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) {
460
+					echo '
449 461
 				<li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'] ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>';
462
+		}
450 463
 
451
-		if (!$context['view_closed'])
452
-			echo '
464
+		if (!$context['view_closed']) {
465
+					echo '
453 466
 				<li><input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check"></li>';
467
+		}
454 468
 
455 469
 			echo '
456 470
 				</ul>
@@ -458,11 +472,12 @@  discard block
 block discarded – undo
458 472
 	}
459 473
 
460 474
 	// Were none found?
461
-	if (empty($context['reports']))
462
-		echo '
475
+	if (empty($context['reports'])) {
476
+			echo '
463 477
 		<div class="windowbg2">
464 478
 			<p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
465 479
 		</div>';
480
+	}
466 481
 
467 482
 	echo '
468 483
 		<div class="pagesection">
@@ -522,12 +537,13 @@  discard block
 block discarded – undo
522 537
 				<h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3>
523 538
 			</div>';
524 539
 
525
-	foreach ($context['report']['comments'] as $comment)
526
-		echo '
540
+	foreach ($context['report']['comments'] as $comment) {
541
+			echo '
527 542
 			<div class="windowbg">
528 543
 				<p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
529 544
 				<p>', $comment['message'], '</p>
530 545
 			</div>';
546
+	}
531 547
 
532 548
 	echo '
533 549
 			<br>
@@ -536,11 +552,12 @@  discard block
 block discarded – undo
536 552
 			</div>
537 553
 				<div>';
538 554
 
539
-	if (empty($context['report']['mod_comments']))
540
-		echo '
555
+	if (empty($context['report']['mod_comments'])) {
556
+			echo '
541 557
 				<div class="information">
542 558
 					<p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
543 559
 				</div>';
560
+	}
544 561
 
545 562
 	foreach ($context['report']['mod_comments'] as $comment)
546 563
 	{
Please login to merge, or discard this patch.
Themes/default/ManageCalendar.template.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,9 +39,10 @@  discard block
 block discarded – undo
39 39
 						<select name="year" id="year" onchange="generateDays();">
40 40
 							<option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>';
41 41
 	// Show a list of all the years we allow...
42
-	for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
43
-		echo '
42
+	for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) {
43
+			echo '
44 44
 							<option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>';
45
+	}
45 46
 
46 47
 	echo '
47 48
 						</select>&nbsp;
@@ -49,9 +50,10 @@  discard block
 block discarded – undo
49 50
 						<select name="month" id="month" onchange="generateDays();">';
50 51
 
51 52
 	// There are 12 months per year - ensure that they all get listed.
52
-	for ($month = 1; $month <= 12; $month++)
53
-		echo '
53
+	for ($month = 1; $month <= 12; $month++) {
54
+			echo '
54 55
 							<option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
56
+	}
55 57
 
56 58
 	echo '
57 59
 						</select>&nbsp;
@@ -59,23 +61,25 @@  discard block
 block discarded – undo
59 61
 						<select name="day" id="day" onchange="generateDays();">';
60 62
 
61 63
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
62
-	for ($day = 1; $day <= $context['holiday']['last_day']; $day++)
63
-		echo '
64
+	for ($day = 1; $day <= $context['holiday']['last_day']; $day++) {
65
+			echo '
64 66
 							<option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>';
67
+	}
65 68
 
66 69
 	echo '
67 70
 						</select>
68 71
 					</dd>
69 72
 				</dl>';
70 73
 
71
-	if ($context['is_new'])
72
-		echo '
74
+	if ($context['is_new']) {
75
+			echo '
73 76
 				<input type="submit" value="', $txt['holidays_button_add'], '" class="button_submit">';
74
-	else
75
-		echo '
77
+	} else {
78
+			echo '
76 79
 				<input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button_submit">
77 80
 				<input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button_submit">
78 81
 				<input type="hidden" name="holiday" value="', $context['holiday']['id'], '">';
82
+	}
79 83
 	echo '
80 84
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
81 85
 			</div>
Please login to merge, or discard this patch.
Themes/default/Poll.template.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 				<h3 class="catbg">', $context['page_title'], '</h3>
47 47
 			</div>';
48 48
 
49
-	if (!empty($context['poll_error']['messages']))
50
-		echo '
49
+	if (!empty($context['poll_error']['messages'])) {
50
+			echo '
51 51
 			<div class="errorbox">
52 52
 				<dl class="poll_error">
53 53
 					<dt>
@@ -58,6 +58,7 @@  discard block
 block discarded – undo
58 58
 					</dt>
59 59
 				</dl>
60 60
 			</div>';
61
+	}
61 62
 
62 63
 	echo '
63 64
 			<div>
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
 								<input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" class="input_text" size="80" maxlength="255">';
80 81
 
81 82
 		// Does this option have a vote count yet, or is it new?
82
-		if ($choice['votes'] != -1)
83
-			echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
83
+		if ($choice['votes'] != -1) {
84
+					echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
85
+		}
84 86
 
85 87
 		echo '
86 88
 							</dd>';
@@ -118,14 +120,15 @@  discard block
 block discarded – undo
118 120
 								<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check">
119 121
 							</dd>';
120 122
 
121
-		if ($context['poll']['guest_vote_allowed'])
122
-			echo '
123
+		if ($context['poll']['guest_vote_allowed']) {
124
+					echo '
123 125
 							<dt>
124 126
 								<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
125 127
 							</dt>
126 128
 							<dd>
127 129
 								<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', ' class="input_check">
128 130
 							</dd>';
131
+		}
129 132
 	}
130 133
 
131 134
 	echo '
@@ -140,12 +143,13 @@  discard block
 block discarded – undo
140 143
 						</dl>
141 144
 					</fieldset>';
142 145
 	// If this is an edit, we can allow them to reset the vote counts.
143
-	if ($context['is_edit'])
144
-		echo '
146
+	if ($context['is_edit']) {
147
+			echo '
145 148
 					<fieldset id="poll_reset">
146 149
 						<legend>', $txt['reset_votes'], '</legend>
147 150
 						<input type="checkbox" name="resetVoteCount" value="on" class="input_check"> ' . $txt['reset_votes_check'] . '
148 151
 					</fieldset>';
152
+	}
149 153
 	echo '
150 154
 					<input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit">
151 155
 				</div>
Please login to merge, or discard this patch.