Completed
Pull Request — release-2.1 (#4184)
by Mert
10:08
created
Themes/default/ManageSearch.template.php 1 patch
Braces   +23 added lines, -18 removed lines patch added patch discarded remove patch
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 			<div class="windowbg2 noup">
112 112
 				<dl class="settings">';
113 113
 
114
-	if (!empty($context['table_info']))
115
-		echo '
114
+	if (!empty($context['table_info'])) {
115
+			echo '
116 116
 					<dt>
117 117
 						<strong>', $txt['search_method_messages_table_space'], ':</strong>
118 118
 					</dt>
@@ -125,6 +125,7 @@  discard block
 block discarded – undo
125 125
 					<dd>
126 126
 						', $context['table_info']['index_length'], '
127 127
 					</dd>';
128
+	}
128 129
 	echo '
129 130
 				</dl>
130 131
 				', $context['double_index'] ? '<div class="noticebox">
@@ -146,16 +147,17 @@  discard block
 block discarded – undo
146 147
 						<dd>
147 148
 
148 149
 							<span class="smalltext">';
149
-	if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext']))
150
-		echo '
150
+	if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) {
151
+			echo '
151 152
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]';
152
-	elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext']))
153
-		echo '
153
+	} elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) {
154
+			echo '
154 155
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create'];
155
-	else
156
-		echo '
156
+	} else {
157
+			echo '
157 158
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br>
158 159
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length'];
160
+	}
159 161
 	echo '
160 162
 								</span>
161 163
 						</dd>';
@@ -168,25 +170,27 @@  discard block
 block discarded – undo
168 170
 						</dt>
169 171
 						<dd>
170 172
 							<span class="smalltext">';
171
-	if ($context['custom_index'])
172
-		echo '
173
+	if ($context['custom_index']) {
174
+			echo '
173 175
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br>
174 176
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length'];
175
-	elseif ($context['partial_custom_index'])
176
-		echo '
177
+	} elseif ($context['partial_custom_index']) {
178
+			echo '
177 179
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br>
178 180
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length'];
179
-	else
180
-		echo '
181
+	} else {
182
+			echo '
181 183
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]';
184
+	}
182 185
 	echo '
183 186
 							</span>
184 187
 						</dd>';
185 188
 
186 189
 	foreach ($context['search_apis'] as $api)
187 190
 	{
188
-		if (empty($api['label']) || $api['has_template'])
189
-			continue;
191
+		if (empty($api['label']) || $api['has_template']) {
192
+					continue;
193
+		}
190 194
 
191 195
 		echo '
192 196
 						<dt>
@@ -194,12 +198,13 @@  discard block
 block discarded – undo
194 198
 							', $api['label'], '
195 199
 						</dt>';
196 200
 
197
-	if ($api['desc'])
198
-		echo '
201
+	if ($api['desc']) {
202
+			echo '
199 203
 						<dd>
200 204
 							<span class="smalltext">', $api['desc'], '</span>
201 205
 						</dd>';
202 206
 	}
207
+	}
203 208
 
204 209
 	echo '
205 210
 					</dl>
Please login to merge, or discard this patch.
Themes/default/Recent.template.php 1 patch
Braces   +74 added lines, -52 removed lines patch added patch discarded remove patch
@@ -43,28 +43,33 @@  discard block
 block discarded – undo
43 43
 					</div>
44 44
 					<div class="list_posts">', $post['message'], '</div>';
45 45
 
46
-		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
47
-			echo '
46
+		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
47
+					echo '
48 48
 					<ul class="quickbuttons">';
49
+		}
49 50
 
50 51
 		// If they *can* reply?
51
-		if ($post['can_reply'])
52
-			echo '
52
+		if ($post['can_reply']) {
53
+					echo '
53 54
 						<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
55
+		}
54 56
 
55 57
 		// If they *can* quote?
56
-		if ($post['can_quote'])
57
-			echo '
58
+		if ($post['can_quote']) {
59
+					echo '
58 60
 						<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
61
+		}
59 62
 
60 63
 		// How about... even... remove it entirely?!
61
-		if ($post['can_delete'])
62
-			echo '
64
+		if ($post['can_delete']) {
65
+					echo '
63 66
 						<li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
67
+		}
64 68
 
65
-		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
66
-			echo '
69
+		if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
70
+					echo '
67 71
 					</ul>';
72
+		}
68 73
 
69 74
 		echo '
70 75
 			</div>';
@@ -86,12 +91,13 @@  discard block
 block discarded – undo
86 91
 	echo '
87 92
 	<div id="recent" class="main_content">';
88 93
 
89
-	if ($context['showCheckboxes'])
90
-		echo '
94
+	if ($context['showCheckboxes']) {
95
+			echo '
91 96
 		<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;">
92 97
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
93 98
 			<input type="hidden" name="qaction" value="markread">
94 99
 			<input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">';
100
+	}
95 101
 
96 102
 	if (!empty($context['topics']))
97 103
 	{
@@ -117,11 +123,12 @@  discard block
 block discarded – undo
117 123
 					</div>';
118 124
 
119 125
 		// Show a "select all" box for quick moderation?
120
-		if ($context['showCheckboxes'])
121
-			echo '
126
+		if ($context['showCheckboxes']) {
127
+					echo '
122 128
 					<div class="moderation">
123 129
 						<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">
124 130
 					</div>';
131
+		}
125 132
 
126 133
 		echo '
127 134
 				</div>
@@ -140,15 +147,18 @@  discard block
 block discarded – undo
140 147
 			// Now we handle the icons
141 148
 			echo '
142 149
 							<div class="icons floatright">';
143
-			if ($topic['is_locked'])
144
-				echo '
150
+			if ($topic['is_locked']) {
151
+							echo '
145 152
 								<span class="generic_icons lock"></span>';
146
-			if ($topic['is_sticky'])
147
-				echo '
153
+			}
154
+			if ($topic['is_sticky']) {
155
+							echo '
148 156
 								<span class="generic_icons sticky"></span>';
149
-			if ($topic['is_poll'])
150
-				echo '
157
+			}
158
+			if ($topic['is_poll']) {
159
+							echo '
151 160
 								<span class="generic_icons poll"></span>';
161
+			}
152 162
 			echo '
153 163
 							</div>';
154 164
 
@@ -173,19 +183,21 @@  discard block
 block discarded – undo
173 183
 							', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '
174 184
 						</div>';
175 185
 
176
-			if ($context['showCheckboxes'])
177
-				echo '
186
+			if ($context['showCheckboxes']) {
187
+							echo '
178 188
 						<div class="moderation">
179 189
 							<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">
180 190
 						</div>';
191
+			}
181 192
 
182 193
 				echo '
183 194
 					</div>';
184 195
 		}
185 196
 
186
-		if (empty($context['topics']))
187
-			echo '
197
+		if (empty($context['topics'])) {
198
+					echo '
188 199
 						<div style="display: none;"></div>';
200
+		}
189 201
 
190 202
 		echo '
191 203
 				</div>
@@ -197,25 +209,27 @@  discard block
 block discarded – undo
197 209
 				', $context['menu_separator'], '<a href="#recent" class="topbottom floatleft">', $txt['go_up'], '</a>
198 210
 				<div class="pagelinks">', $context['page_index'], '</div>
199 211
 			</div>';
200
-	}
201
-	else
202
-		echo '
212
+	} else {
213
+			echo '
203 214
 			<div class="cat_bar">
204 215
 				<h3 class="catbg centertext">
205 216
 					', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], '
206 217
 				</h3>
207 218
 			</div>';
219
+	}
208 220
 
209
-	if ($context['showCheckboxes'])
210
-		echo '
221
+	if ($context['showCheckboxes']) {
222
+			echo '
211 223
 		</form>';
224
+	}
212 225
 
213 226
 	echo '
214 227
 	</div>';
215 228
 
216
-	if (empty($context['no_topic_listing']))
217
-		template_topic_legend();
218
-}
229
+	if (empty($context['no_topic_listing'])) {
230
+			template_topic_legend();
231
+	}
232
+	}
219 233
 
220 234
 /**
221 235
  * Template for showing unread replies (eg new replies to topics you've posted in)
@@ -227,12 +241,13 @@  discard block
 block discarded – undo
227 241
 	echo '
228 242
 	<div id="recent">';
229 243
 
230
-	if ($context['showCheckboxes'])
231
-		echo '
244
+	if ($context['showCheckboxes']) {
245
+			echo '
232 246
 		<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;">
233 247
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
234 248
 			<input type="hidden" name="qaction" value="markread">
235 249
 			<input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">';
250
+	}
236 251
 
237 252
 	if (!empty($context['topics']))
238 253
 	{
@@ -258,11 +273,12 @@  discard block
 block discarded – undo
258 273
 					</div>';
259 274
 
260 275
 		// Show a "select all" box for quick moderation?
261
-		if ($context['showCheckboxes'])
262
-				echo '
276
+		if ($context['showCheckboxes']) {
277
+						echo '
263 278
 					<div class="moderation">
264 279
 						<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">
265 280
 					</div>';
281
+		}
266 282
 
267 283
 		echo '
268 284
 				</div>
@@ -281,15 +297,18 @@  discard block
 block discarded – undo
281 297
 			// Now we handle the icons
282 298
 			echo '
283 299
 								<div class="icons floatright">';
284
-			if ($topic['is_locked'])
285
-				echo '
300
+			if ($topic['is_locked']) {
301
+							echo '
286 302
 									<span class="generic_icons lock"></span>';
287
-			if ($topic['is_sticky'])
288
-				echo '
303
+			}
304
+			if ($topic['is_sticky']) {
305
+							echo '
289 306
 									<span class="generic_icons sticky"></span>';
290
-			if ($topic['is_poll'])
291
-				echo '
307
+			}
308
+			if ($topic['is_poll']) {
309
+							echo '
292 310
 									<span class="generic_icons poll"></span>';
311
+			}
293 312
 			echo '
294 313
 								</div>';
295 314
 
@@ -314,11 +333,12 @@  discard block
 block discarded – undo
314 333
 								', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '
315 334
 							</div>';
316 335
 
317
-			if ($context['showCheckboxes'])
318
-				echo '
336
+			if ($context['showCheckboxes']) {
337
+							echo '
319 338
 							<div class="moderation">
320 339
 								<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">
321 340
 							</div>';
341
+			}
322 342
 			echo '
323 343
 						</div>';
324 344
 		}
@@ -331,24 +351,26 @@  discard block
 block discarded – undo
331 351
 				', $context['menu_separator'], '<a href="#recent" class="topbottom floatleft">', $txt['go_up'], '</a>
332 352
 				<div class="pagelinks">', $context['page_index'], '</div>
333 353
 			</div>';
334
-	}
335
-	else
336
-		echo '
354
+	} else {
355
+			echo '
337 356
 			<div class="cat_bar">
338 357
 				<h3 class="catbg centertext">
339 358
 					', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], '
340 359
 				</h3>
341 360
 			</div>';
361
+	}
342 362
 
343
-	if ($context['showCheckboxes'])
344
-		echo '
363
+	if ($context['showCheckboxes']) {
364
+			echo '
345 365
 		</form>';
366
+	}
346 367
 
347 368
 	echo '
348 369
 	</div>';
349 370
 
350
-	if (empty($context['no_topic_listing']))
351
-		template_topic_legend();
352
-}
371
+	if (empty($context['no_topic_listing'])) {
372
+			template_topic_legend();
373
+	}
374
+	}
353 375
 
354 376
 ?>
355 377
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/Search.template.php 1 patch
Braces   +85 added lines, -60 removed lines patch added patch discarded remove patch
@@ -25,13 +25,15 @@  discard block
 block discarded – undo
25 25
 			</h3>
26 26
 		</div>';
27 27
 
28
-	if (!empty($context['search_errors']))
29
-		echo '
28
+	if (!empty($context['search_errors'])) {
29
+			echo '
30 30
 		<div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>';
31
+	}
31 32
 
32
-	if (!empty($context['search_ignored']))
33
-		echo '
33
+	if (!empty($context['search_ignored'])) {
34
+			echo '
34 35
 		<p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
36
+	}
35 37
 
36 38
 	echo '
37 39
 		<div id="advanced_search" class="roundframe">
@@ -42,9 +44,10 @@  discard block
 block discarded – undo
42 44
 				<dd>
43 45
 					<input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text">';
44 46
 
45
-	if (empty($modSettings['search_simple_fulltext']))
46
-		echo '
47
+	if (empty($modSettings['search_simple_fulltext'])) {
48
+			echo '
47 49
 					<br><em class="smalltext">', $txt['search_example'], '</em>';
50
+	}
48 51
 
49 52
 	echo '
50 53
 				</dd>
@@ -115,11 +118,12 @@  discard block
 block discarded – undo
115 118
 	}
116 119
 
117 120
 	// If $context['search_params']['topic'] is set, that means we're searching just one topic.
118
-	if (!empty($context['search_params']['topic']))
119
-		echo '
121
+	if (!empty($context['search_params']['topic'])) {
122
+			echo '
120 123
 				<p>', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.</p>
121 124
 				<input type="hidden" name="topic" value="', $context['search_topic']['id'], '">
122 125
 				<input type="submit" name="b_search" value="', $txt['search'], '" class="button_submit">';
126
+	}
123 127
 
124 128
 	echo '
125 129
 			</div>
@@ -150,14 +154,15 @@  discard block
 block discarded – undo
150 154
 
151 155
 			foreach ($category['boards'] as $board)
152 156
 			{
153
-				if ($i == $limit)
154
-					echo '
157
+				if ($i == $limit) {
158
+									echo '
155 159
 							</ul>
156 160
 						</li>
157 161
 					</ul>
158 162
 					<ul class="ignoreboards floatright">
159 163
 						<li class="category">
160 164
 							<ul>';
165
+				}
161 166
 
162 167
 				echo '
163 168
 								<li class="board">
@@ -245,13 +250,15 @@  discard block
 block discarded – undo
245 250
 		<div class="roundframe">';
246 251
 
247 252
 		// Did they make any typos or mistakes, perhaps?
248
-		if (isset($context['did_you_mean']))
249
-			echo '
253
+		if (isset($context['did_you_mean'])) {
254
+					echo '
250 255
 			<p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>';
256
+		}
251 257
 
252
-		if (!empty($context['search_ignored']))
253
-			echo '
258
+		if (!empty($context['search_ignored'])) {
259
+					echo '
254 260
 			<p>', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
261
+		}
255 262
 
256 263
 		echo '
257 264
 			<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
@@ -273,10 +280,11 @@  discard block
 block discarded – undo
273 280
 					<input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '">
274 281
 					<input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '">
275 282
 				</div>';
276
-		if (!empty($context['search_params']['brd']))
277
-			foreach ($context['search_params']['brd'] as $board_id)
283
+		if (!empty($context['search_params']['brd'])) {
284
+					foreach ($context['search_params']['brd'] as $board_id)
278 285
 				echo '
279 286
 				<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">';
287
+		}
280 288
 
281 289
 		echo '
282 290
 			</form>
@@ -287,17 +295,19 @@  discard block
 block discarded – undo
287 295
 	if ($context['compact'])
288 296
 	{
289 297
 		// Quick moderation set to checkboxes? Oh, how fun :/.
290
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
291
-			echo '
298
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
299
+					echo '
292 300
 	<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">';
301
+		}
293 302
 
294 303
 	echo '
295 304
 		<div class="cat_bar">
296 305
 			<h3 class="catbg">
297 306
 				<span class="floatright">';
298
-					if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
299
-					echo '
307
+					if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
308
+										echo '
300 309
 							<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">';
310
+					}
301 311
 				echo '
302 312
 				</span>
303 313
 				<span class="generic_icons filter"></span>&nbsp;', $txt['mlist_search_results'], ':&nbsp;', $context['search_params']['search'], '
@@ -305,14 +315,15 @@  discard block
 block discarded – undo
305 315
 		</div>';
306 316
 
307 317
 		// was anything even found?
308
-		if (!empty($context['topics']))
309
-		echo'
318
+		if (!empty($context['topics'])) {
319
+				echo'
310 320
 		<div class="pagesection">
311 321
 			<span>', $context['page_index'], '</span>
312 322
 		</div>';
313
-		else
314
-			echo '
323
+		} else {
324
+					echo '
315 325
 			<div class="roundframe">', $txt['find_no_results'], '</div>';
326
+		}
316 327
 
317 328
 		// while we have results to show ...
318 329
 		while ($topic = $context['get_topics']())
@@ -340,38 +351,43 @@  discard block
 block discarded – undo
340 351
 					{
341 352
 						echo '
342 353
 						<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">';
343
-					}
344
-					else
354
+					} else
345 355
 					{
346
-						if ($topic['quick_mod']['remove'])
347
-							echo '
356
+						if ($topic['quick_mod']['remove']) {
357
+													echo '
348 358
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>';
359
+						}
349 360
 
350
-						if ($topic['quick_mod']['lock'])
351
-							echo '
361
+						if ($topic['quick_mod']['lock']) {
362
+													echo '
352 363
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
364
+						}
353 365
 
354
-						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
355
-							echo '
366
+						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
367
+													echo '
356 368
 						<br>';
369
+						}
357 370
 
358
-						if ($topic['quick_mod']['sticky'])
359
-							echo '
371
+						if ($topic['quick_mod']['sticky']) {
372
+													echo '
360 373
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
374
+						}
361 375
 
362
-						if ($topic['quick_mod']['move'])
363
-							echo '
376
+						if ($topic['quick_mod']['move']) {
377
+													echo '
364 378
 						<a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
379
+						}
365 380
 					}
366 381
 
367 382
 					echo '
368 383
 					</div>';
369 384
 				}
370 385
 
371
-				if ($message['body_highlighted'] != '')
372
-					echo '
386
+				if ($message['body_highlighted'] != '') {
387
+									echo '
373 388
 					<br class="clear">
374 389
 					<div class="list_posts double_height">', $message['body_highlighted'], '</div>';
390
+				}
375 391
 			}
376 392
 
377 393
 			echo '
@@ -379,11 +395,12 @@  discard block
 block discarded – undo
379 395
 			</div>';
380 396
 
381 397
 		}
382
-		if (!empty($context['topics']))
383
-		echo '
398
+		if (!empty($context['topics'])) {
399
+				echo '
384 400
 		<div class="pagesection">
385 401
 			<span>', $context['page_index'], '</span>
386 402
 		</div>';
403
+		}
387 404
 
388 405
 		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
389 406
 		{
@@ -393,17 +410,19 @@  discard block
 block discarded – undo
393 410
 					<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
394 411
 						<option value="">--------</option>';
395 412
 
396
-			foreach ($context['qmod_actions'] as $qmod_action)
397
-				if ($context['can_' . $qmod_action])
413
+			foreach ($context['qmod_actions'] as $qmod_action) {
414
+							if ($context['can_' . $qmod_action])
398 415
 					echo '
399 416
 							<option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
417
+			}
400 418
 
401 419
 			echo '
402 420
 					</select>';
403 421
 
404
-			if ($context['can_move'])
405
-				echo '
422
+			if ($context['can_move']) {
423
+							echo '
406 424
 				<span id="quick_mod_jump_to">&nbsp;</span>';
425
+			}
407 426
 
408 427
 			echo '
409 428
 					<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '">
@@ -413,13 +432,13 @@  discard block
 block discarded – undo
413 432
 		}
414 433
 
415 434
 
416
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
417
-			echo '
435
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
436
+					echo '
418 437
 			<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
419 438
 		</form>';
439
+		}
420 440
 
421
-	}
422
-	else
441
+	} else
423 442
 	{
424 443
 		echo '
425 444
 		<div class="cat_bar">
@@ -431,9 +450,10 @@  discard block
 block discarded – undo
431 450
 			<span>', $context['page_index'], '</span>
432 451
 		</div>';
433 452
 
434
-		if (empty($context['topics']))
435
-			echo '
453
+		if (empty($context['topics'])) {
454
+					echo '
436 455
 		<div class="information">(', $txt['search_no_results'], ')</div>';
456
+		}
437 457
 
438 458
 		while ($topic = $context['get_topics']())
439 459
 		{
@@ -448,23 +468,27 @@  discard block
 block discarded – undo
448 468
 					</div>
449 469
 					<div class="list_posts">', $message['body_highlighted'], '</div>';
450 470
 
451
-			if ($topic['can_reply'])
452
-				echo '
471
+			if ($topic['can_reply']) {
472
+							echo '
453 473
 						<ul class="quickbuttons">';
474
+			}
454 475
 
455 476
 				// If they *can* reply?
456
-			if ($topic['can_reply'])
457
-				echo '
477
+			if ($topic['can_reply']) {
478
+							echo '
458 479
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
480
+			}
459 481
 
460 482
 				// If they *can* quote?
461
-			if ($topic['can_quote'])
462
-				echo '
483
+			if ($topic['can_quote']) {
484
+							echo '
463 485
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
486
+			}
464 487
 
465
-			if ($topic['can_reply'])
466
-				echo '
488
+			if ($topic['can_reply']) {
489
+							echo '
467 490
 						</ul>';
491
+			}
468 492
 			echo '
469 493
 					<br class="clear">
470 494
 				</div>';
@@ -483,8 +507,8 @@  discard block
 block discarded – undo
483 507
 		<div class="smalltext righttext" id="search_jump_to">&nbsp;</div>
484 508
 		<script>';
485 509
 
486
-	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
487
-		echo '
510
+	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
511
+			echo '
488 512
 				if (typeof(window.XMLHttpRequest) != "undefined")
489 513
 					aJumpTo[aJumpTo.length] = new JumpTo({
490 514
 						sContainerId: "quick_mod_jump_to",
@@ -499,6 +523,7 @@  discard block
 block discarded – undo
499 523
 						bDisabled: true,
500 524
 						sCustomName: "move_to"
501 525
 					});';
526
+	}
502 527
 
503 528
 	echo '
504 529
 			if (typeof(window.XMLHttpRequest) != "undefined")
Please login to merge, or discard this patch.
cache/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 	header('Location: ' . $boardurl);
13 13
 }
14 14
 // Can't find it... just forget it.
15
-else
15
+else {
16 16
 	exit;
17
+}
17 18
 
18 19
 ?>
19 20
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/SplitTopics.php 1 patch
Braces   +260 added lines, -186 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
  * Original module by Mach8 - We'll never forget you.
16 16
  */
17 17
 
18
-if (!defined('SMF'))
18
+if (!defined('SMF')) {
19 19
 	die('No direct access...');
20
+}
20 21
 
21 22
 /**
22 23
  * splits a topic into two topics.
@@ -30,15 +31,17 @@  discard block
 block discarded – undo
30 31
 	global $topic, $sourcedir;
31 32
 
32 33
 	// And... which topic were you splitting, again?
33
-	if (empty($topic))
34
-		fatal_lang_error('numbers_one_to_nine', false);
34
+	if (empty($topic)) {
35
+			fatal_lang_error('numbers_one_to_nine', false);
36
+	}
35 37
 
36 38
 	// Are you allowed to split topics?
37 39
 	isAllowedTo('split_any');
38 40
 
39 41
 	// Load up the "dependencies" - the template, getMsgMemberID(), and sendNotifications().
40
-	if (!isset($_REQUEST['xml']))
41
-		loadTemplate('SplitTopics');
42
+	if (!isset($_REQUEST['xml'])) {
43
+			loadTemplate('SplitTopics');
44
+	}
42 45
 	require_once($sourcedir . '/Subs-Boards.php');
43 46
 	require_once($sourcedir . '/Subs-Post.php');
44 47
 
@@ -50,12 +53,12 @@  discard block
 block discarded – undo
50 53
 	);
51 54
 
52 55
 	// ?action=splittopics;sa=LETSBREAKIT won't work, sorry.
53
-	if (empty($_REQUEST['sa']) || !isset($subActions[$_REQUEST['sa']]))
54
-		SplitIndex();
55
-
56
-	else
57
-		call_helper($subActions[$_REQUEST['sa']]);
58
-}
56
+	if (empty($_REQUEST['sa']) || !isset($subActions[$_REQUEST['sa']])) {
57
+			SplitIndex();
58
+	} else {
59
+			call_helper($subActions[$_REQUEST['sa']]);
60
+	}
61
+	}
59 62
 
60 63
 /**
61 64
  * screen shown before the actual split.
@@ -71,8 +74,9 @@  discard block
 block discarded – undo
71 74
 	global $txt, $topic, $context, $smcFunc, $modSettings;
72 75
 
73 76
 	// Validate "at".
74
-	if (empty($_GET['at']))
75
-		fatal_lang_error('numbers_one_to_nine', false);
77
+	if (empty($_GET['at'])) {
78
+			fatal_lang_error('numbers_one_to_nine', false);
79
+	}
76 80
 	$_GET['at'] = (int) $_GET['at'];
77 81
 
78 82
 	// Retrieve the subject and stuff of the specific topic/message.
@@ -89,26 +93,31 @@  discard block
 block discarded – undo
89 93
 			'split_at' => $_GET['at'],
90 94
 		)
91 95
 	);
92
-	if ($smcFunc['db_num_rows']($request) == 0)
93
-		fatal_lang_error('cant_find_messages');
96
+	if ($smcFunc['db_num_rows']($request) == 0) {
97
+			fatal_lang_error('cant_find_messages');
98
+	}
94 99
 	list ($_REQUEST['subname'], $num_replies, $unapproved_posts, $id_first_msg, $approved) = $smcFunc['db_fetch_row']($request);
95 100
 	$smcFunc['db_free_result']($request);
96 101
 
97 102
 	// If not approved validate they can see it.
98
-	if ($modSettings['postmod_active'] && !$approved)
99
-		isAllowedTo('approve_posts');
103
+	if ($modSettings['postmod_active'] && !$approved) {
104
+			isAllowedTo('approve_posts');
105
+	}
100 106
 
101 107
 	// If this topic has unapproved posts, we need to count them too...
102
-	if ($modSettings['postmod_active'] && allowedTo('approve_posts'))
103
-		$num_replies += $unapproved_posts - ($approved ? 0 : 1);
108
+	if ($modSettings['postmod_active'] && allowedTo('approve_posts')) {
109
+			$num_replies += $unapproved_posts - ($approved ? 0 : 1);
110
+	}
104 111
 
105 112
 	// Check if there is more than one message in the topic.  (there should be.)
106
-	if ($num_replies < 1)
107
-		fatal_lang_error('topic_one_post', false);
113
+	if ($num_replies < 1) {
114
+			fatal_lang_error('topic_one_post', false);
115
+	}
108 116
 
109 117
 	// Check if this is the first message in the topic (if so, the first and second option won't be available)
110
-	if ($id_first_msg == $_GET['at'])
111
-		return SplitSelectTopics();
118
+	if ($id_first_msg == $_GET['at']) {
119
+			return SplitSelectTopics();
120
+	}
112 121
 
113 122
 	// Basic template information....
114 123
 	$context['message'] = array(
@@ -137,8 +146,9 @@  discard block
 block discarded – undo
137 146
 	checkSession();
138 147
 
139 148
 	// Clean up the subject.
140
-	if (!isset($_POST['subname']) || $_POST['subname'] == '')
141
-		$_POST['subname'] = $txt['new_topic'];
149
+	if (!isset($_POST['subname']) || $_POST['subname'] == '') {
150
+			$_POST['subname'] = $txt['new_topic'];
151
+	}
142 152
 
143 153
 	// Redirect to the selector if they chose selective.
144 154
 	if ($_POST['step2'] == 'selective')
@@ -163,16 +173,19 @@  discard block
 block discarded – undo
163 173
 				'split_at' => $_POST['at'],
164 174
 			)
165 175
 		);
166
-		while ($row = $smcFunc['db_fetch_assoc']($request))
167
-			$messagesToBeSplit[] = $row['id_msg'];
176
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
177
+					$messagesToBeSplit[] = $row['id_msg'];
178
+		}
168 179
 		$smcFunc['db_free_result']($request);
169 180
 	}
170 181
 	// Only the selected message has to be split. That should be easy.
171
-	elseif ($_POST['step2'] == 'onlythis')
172
-		$messagesToBeSplit[] = $_POST['at'];
182
+	elseif ($_POST['step2'] == 'onlythis') {
183
+			$messagesToBeSplit[] = $_POST['at'];
184
+	}
173 185
 	// There's another action?!
174
-	else
175
-		fatal_lang_error('no_access', false);
186
+	else {
187
+			fatal_lang_error('no_access', false);
188
+	}
176 189
 
177 190
 	$context['old_topic'] = $topic;
178 191
 	$context['new_topic'] = splitTopic($topic, $messagesToBeSplit, $_POST['subname']);
@@ -199,8 +212,9 @@  discard block
 block discarded – undo
199 212
 	$_SESSION['split_selection'][$topic] = empty($_SESSION['split_selection'][$topic]) ? array() : $_SESSION['split_selection'][$topic];
200 213
 
201 214
 	// This is a special case for split topics from quick-moderation checkboxes
202
-	if (isset($_REQUEST['subname_enc']))
203
-		$_REQUEST['subname'] = urldecode($_REQUEST['subname_enc']);
215
+	if (isset($_REQUEST['subname_enc'])) {
216
+			$_REQUEST['subname'] = urldecode($_REQUEST['subname_enc']);
217
+	}
204 218
 
205 219
 	$context['not_selected'] = array(
206 220
 		'num_messages' => 0,
@@ -252,10 +266,12 @@  discard block
 block discarded – undo
252 266
 			)
253 267
 		);
254 268
 		// You can't split the last message off.
255
-		if (empty($context['not_selected']['start']) && $smcFunc['db_num_rows']($request) <= 1 && $_REQUEST['move'] == 'down')
256
-			$_REQUEST['move'] = '';
257
-		while ($row = $smcFunc['db_fetch_assoc']($request))
258
-			$original_msgs['not_selected'][] = $row['id_msg'];
269
+		if (empty($context['not_selected']['start']) && $smcFunc['db_num_rows']($request) <= 1 && $_REQUEST['move'] == 'down') {
270
+					$_REQUEST['move'] = '';
271
+		}
272
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
273
+					$original_msgs['not_selected'][] = $row['id_msg'];
274
+		}
259 275
 		$smcFunc['db_free_result']($request);
260 276
 		if (!empty($_SESSION['split_selection'][$topic]))
261 277
 		{
@@ -275,8 +291,9 @@  discard block
 block discarded – undo
275 291
 					'messages_per_page' => $context['messages_per_page'],
276 292
 				)
277 293
 			);
278
-			while ($row = $smcFunc['db_fetch_assoc']($request))
279
-				$original_msgs['selected'][] = $row['id_msg'];
294
+			while ($row = $smcFunc['db_fetch_assoc']($request)) {
295
+							$original_msgs['selected'][] = $row['id_msg'];
296
+			}
280 297
 			$smcFunc['db_free_result']($request);
281 298
 		}
282 299
 	}
@@ -286,12 +303,13 @@  discard block
 block discarded – undo
286 303
 	{
287 304
 		$_REQUEST['msg'] = (int) $_REQUEST['msg'];
288 305
 
289
-		if ($_REQUEST['move'] == 'reset')
290
-			$_SESSION['split_selection'][$topic] = array();
291
-		elseif ($_REQUEST['move'] == 'up')
292
-			$_SESSION['split_selection'][$topic] = array_diff($_SESSION['split_selection'][$topic], array($_REQUEST['msg']));
293
-		else
294
-			$_SESSION['split_selection'][$topic][] = $_REQUEST['msg'];
306
+		if ($_REQUEST['move'] == 'reset') {
307
+					$_SESSION['split_selection'][$topic] = array();
308
+		} elseif ($_REQUEST['move'] == 'up') {
309
+					$_SESSION['split_selection'][$topic] = array_diff($_SESSION['split_selection'][$topic], array($_REQUEST['msg']));
310
+		} else {
311
+					$_SESSION['split_selection'][$topic][] = $_REQUEST['msg'];
312
+		}
295 313
 	}
296 314
 
297 315
 	// Make sure the selection is still accurate.
@@ -310,8 +328,9 @@  discard block
 block discarded – undo
310 328
 			)
311 329
 		);
312 330
 		$_SESSION['split_selection'][$topic] = array();
313
-		while ($row = $smcFunc['db_fetch_assoc']($request))
314
-			$_SESSION['split_selection'][$topic][] = $row['id_msg'];
331
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
332
+					$_SESSION['split_selection'][$topic][] = $row['id_msg'];
333
+		}
315 334
 		$smcFunc['db_free_result']($request);
316 335
 	}
317 336
 
@@ -328,13 +347,15 @@  discard block
 block discarded – undo
328 347
 			'is_approved' => 1,
329 348
 		)
330 349
 	);
331
-	while ($row = $smcFunc['db_fetch_assoc']($request))
332
-		$context[empty($row['is_selected']) || $row['is_selected'] == 'f' ? 'not_selected' : 'selected']['num_messages'] = $row['num_messages'];
350
+	while ($row = $smcFunc['db_fetch_assoc']($request)) {
351
+			$context[empty($row['is_selected']) || $row['is_selected'] == 'f' ? 'not_selected' : 'selected']['num_messages'] = $row['num_messages'];
352
+	}
333 353
 	$smcFunc['db_free_result']($request);
334 354
 
335 355
 	// Fix an oversized starting page (to make sure both pageindexes are properly set).
336
-	if ($context['selected']['start'] >= $context['selected']['num_messages'])
337
-		$context['selected']['start'] = $context['selected']['num_messages'] <= $context['messages_per_page'] ? 0 : ($context['selected']['num_messages'] - (($context['selected']['num_messages'] % $context['messages_per_page']) == 0 ? $context['messages_per_page'] : ($context['selected']['num_messages'] % $context['messages_per_page'])));
356
+	if ($context['selected']['start'] >= $context['selected']['num_messages']) {
357
+			$context['selected']['start'] = $context['selected']['num_messages'] <= $context['messages_per_page'] ? 0 : ($context['selected']['num_messages'] - (($context['selected']['num_messages'] % $context['messages_per_page']) == 0 ? $context['messages_per_page'] : ($context['selected']['num_messages'] % $context['messages_per_page'])));
358
+	}
338 359
 
339 360
 	// Build a page list of the not-selected topics...
340 361
 	$context['not_selected']['page_index'] = constructPageIndex($scripturl . '?action=splittopics;sa=selectTopics;subname=' . strtr(urlencode($_REQUEST['subname']), array('%' => '%%')) . ';topic=' . $topic . '.%1$d;start2=' . $context['selected']['start'], $context['not_selected']['start'], $context['not_selected']['num_messages'], $context['messages_per_page'], true);
@@ -434,11 +455,12 @@  discard block
 block discarded – undo
434 455
 		);
435 456
 
436 457
 		$context['changes'] = array();
437
-		foreach ($changes as $change_type => $change_array)
438
-			foreach ($change_array as $section => $msg_array)
458
+		foreach ($changes as $change_type => $change_array) {
459
+					foreach ($change_array as $section => $msg_array)
439 460
 			{
440 461
 				if (empty($msg_array))
441 462
 					continue;
463
+		}
442 464
 
443 465
 				foreach ($msg_array as $id_msg)
444 466
 				{
@@ -447,8 +469,9 @@  discard block
 block discarded – undo
447 469
 						'type' => $change_type,
448 470
 						'section' => $section,
449 471
 					);
450
-					if ($change_type == 'insert')
451
-						$context['changes']['insert' . $id_msg]['insert_value'] = $context[$section]['messages'][$id_msg];
472
+					if ($change_type == 'insert') {
473
+											$context['changes']['insert' . $id_msg]['insert_value'] = $context[$section]['messages'][$id_msg];
474
+					}
452 475
 				}
453 476
 			}
454 477
 	}
@@ -468,12 +491,14 @@  discard block
 block discarded – undo
468 491
 	checkSession();
469 492
 
470 493
 	// Default the subject in case it's blank.
471
-	if (!isset($_POST['subname']) || $_POST['subname'] == '')
472
-		$_POST['subname'] = $txt['new_topic'];
494
+	if (!isset($_POST['subname']) || $_POST['subname'] == '') {
495
+			$_POST['subname'] = $txt['new_topic'];
496
+	}
473 497
 
474 498
 	// You must've selected some messages!  Can't split out none!
475
-	if (empty($_SESSION['split_selection'][$topic]))
476
-		fatal_lang_error('no_posts_selected', false);
499
+	if (empty($_SESSION['split_selection'][$topic])) {
500
+			fatal_lang_error('no_posts_selected', false);
501
+	}
477 502
 
478 503
 	$context['old_topic'] = $topic;
479 504
 	$context['new_topic'] = splitTopic($topic, $_SESSION['split_selection'][$topic], $_POST['subname']);
@@ -499,8 +524,9 @@  discard block
 block discarded – undo
499 524
 	global $smcFunc, $txt, $sourcedir;
500 525
 
501 526
 	// Nothing to split?
502
-	if (empty($splitMessages))
503
-		fatal_lang_error('no_posts_selected', false);
527
+	if (empty($splitMessages)) {
528
+			fatal_lang_error('no_posts_selected', false);
529
+	}
504 530
 
505 531
 	// Get some board info.
506 532
 	$request = $smcFunc['db_query']('', '
@@ -532,8 +558,9 @@  discard block
 block discarded – undo
532 558
 		)
533 559
 	);
534 560
 	// You can't select ALL the messages!
535
-	if ($smcFunc['db_num_rows']($request) == 0)
536
-		fatal_lang_error('selected_all_posts', false);
561
+	if ($smcFunc['db_num_rows']($request) == 0) {
562
+			fatal_lang_error('selected_all_posts', false);
563
+	}
537 564
 
538 565
 	$split1_first_msg = null;
539 566
 	$split1_last_msg = null;
@@ -541,24 +568,27 @@  discard block
 block discarded – undo
541 568
 	while ($row = $smcFunc['db_fetch_assoc']($request))
542 569
 	{
543 570
 		// Get the right first and last message dependant on approved state...
544
-		if (empty($split1_first_msg) || $row['myid_first_msg'] < $split1_first_msg)
545
-			$split1_first_msg = $row['myid_first_msg'];
546
-		if (empty($split1_last_msg) || $row['approved'])
547
-			$split1_last_msg = $row['myid_last_msg'];
571
+		if (empty($split1_first_msg) || $row['myid_first_msg'] < $split1_first_msg) {
572
+					$split1_first_msg = $row['myid_first_msg'];
573
+		}
574
+		if (empty($split1_last_msg) || $row['approved']) {
575
+					$split1_last_msg = $row['myid_last_msg'];
576
+		}
548 577
 
549 578
 		// Get the counts correct...
550 579
 		if ($row['approved'])
551 580
 		{
552 581
 			$split1_replies = $row['message_count'] - 1;
553 582
 			$split1_unapprovedposts = 0;
554
-		}
555
-		else
583
+		} else
556 584
 		{
557
-			if (!isset($split1_replies))
558
-				$split1_replies = 0;
585
+			if (!isset($split1_replies)) {
586
+							$split1_replies = 0;
587
+			}
559 588
 			// If the topic isn't approved then num replies must go up by one... as first post wouldn't be counted.
560
-			elseif (!$split1_approved)
561
-				$split1_replies++;
589
+			elseif (!$split1_approved) {
590
+							$split1_replies++;
591
+			}
562 592
 
563 593
 			$split1_unapprovedposts = $row['message_count'];
564 594
 		}
@@ -584,10 +614,12 @@  discard block
 block discarded – undo
584 614
 	while ($row = $smcFunc['db_fetch_assoc']($request))
585 615
 	{
586 616
 		// As before get the right first and last message dependant on approved state...
587
-		if (empty($split2_first_msg) || $row['myid_first_msg'] < $split2_first_msg)
588
-			$split2_first_msg = $row['myid_first_msg'];
589
-		if (empty($split2_last_msg) || $row['approved'])
590
-			$split2_last_msg = $row['myid_last_msg'];
617
+		if (empty($split2_first_msg) || $row['myid_first_msg'] < $split2_first_msg) {
618
+					$split2_first_msg = $row['myid_first_msg'];
619
+		}
620
+		if (empty($split2_last_msg) || $row['approved']) {
621
+					$split2_last_msg = $row['myid_last_msg'];
622
+		}
591 623
 
592 624
 		// Then do the counts again...
593 625
 		if ($row['approved'])
@@ -595,18 +627,20 @@  discard block
 block discarded – undo
595 627
 			$split2_approved = true;
596 628
 			$split2_replies = $row['message_count'] - 1;
597 629
 			$split2_unapprovedposts = 0;
598
-		}
599
-		else
630
+		} else
600 631
 		{
601 632
 			// Should this one be approved??
602
-			if ($split2_first_msg == $row['myid_first_msg'])
603
-				$split2_approved = false;
633
+			if ($split2_first_msg == $row['myid_first_msg']) {
634
+							$split2_approved = false;
635
+			}
604 636
 
605
-			if (!isset($split2_replies))
606
-				$split2_replies = 0;
637
+			if (!isset($split2_replies)) {
638
+							$split2_replies = 0;
639
+			}
607 640
 			// As before, fix number of replies.
608
-			elseif (!$split2_approved)
609
-				$split2_replies++;
641
+			elseif (!$split2_approved) {
642
+							$split2_replies++;
643
+			}
610 644
 
611 645
 			$split2_unapprovedposts = $row['message_count'];
612 646
 		}
@@ -616,12 +650,14 @@  discard block
 block discarded – undo
616 650
 	$split2_lastMem = getMsgMemberID($split2_last_msg);
617 651
 
618 652
 	// No database changes yet, so let's double check to see if everything makes at least a little sense.
619
-	if ($split1_first_msg <= 0 || $split1_last_msg <= 0 || $split2_first_msg <= 0 || $split2_last_msg <= 0 || $split1_replies < 0 || $split2_replies < 0 || $split1_unapprovedposts < 0 || $split2_unapprovedposts < 0 || !isset($split1_approved) || !isset($split2_approved))
620
-		fatal_lang_error('cant_find_messages');
653
+	if ($split1_first_msg <= 0 || $split1_last_msg <= 0 || $split2_first_msg <= 0 || $split2_last_msg <= 0 || $split1_replies < 0 || $split2_replies < 0 || $split1_unapprovedposts < 0 || $split2_unapprovedposts < 0 || !isset($split1_approved) || !isset($split2_approved)) {
654
+			fatal_lang_error('cant_find_messages');
655
+	}
621 656
 
622 657
 	// You cannot split off the first message of a topic.
623
-	if ($split1_first_msg > $split2_first_msg)
624
-		fatal_lang_error('split_first_post', false);
658
+	if ($split1_first_msg > $split2_first_msg) {
659
+			fatal_lang_error('split_first_post', false);
660
+	}
625 661
 
626 662
 	// We're off to insert the new topic!  Use 0 for now to avoid UNIQUE errors.
627 663
 	$split2_ID_TOPIC = $smcFunc['db_insert']('',
@@ -644,14 +680,16 @@  discard block
 block discarded – undo
644 680
 			array('id_topic'),
645 681
 			1
646 682
 		);
647
-	if ($split2_ID_TOPIC <= 0)
648
-		fatal_lang_error('cant_insert_topic');
683
+	if ($split2_ID_TOPIC <= 0) {
684
+			fatal_lang_error('cant_insert_topic');
685
+	}
649 686
 
650 687
 	// Move the messages over to the other topic.
651 688
 	$new_subject = strtr($smcFunc['htmltrim']($smcFunc['htmlspecialchars']($new_subject)), array("\r" => '', "\n" => '', "\t" => ''));
652 689
 	// Check the subject length.
653
-	if ($smcFunc['strlen']($new_subject) > 100)
654
-		$new_subject = $smcFunc['substr']($new_subject, 0, 100);
690
+	if ($smcFunc['strlen']($new_subject) > 100) {
691
+			$new_subject = $smcFunc['substr']($new_subject, 0, 100);
692
+	}
655 693
 	// Valid subject?
656 694
 	if ($new_subject != '')
657 695
 	{
@@ -722,8 +760,8 @@  discard block
 block discarded – undo
722 760
 	);
723 761
 
724 762
 	// If the new topic isn't approved ensure the first message flags this just in case.
725
-	if (!$split2_approved)
726
-		$smcFunc['db_query']('', '
763
+	if (!$split2_approved) {
764
+			$smcFunc['db_query']('', '
727 765
 			UPDATE {db_prefix}messages
728 766
 			SET approved = {int:approved}
729 767
 			WHERE id_msg = {int:id_msg}
@@ -734,6 +772,7 @@  discard block
 block discarded – undo
734 772
 				'id_topic' => $split2_ID_TOPIC,
735 773
 			)
736 774
 		);
775
+	}
737 776
 
738 777
 	// The board has more topics now (Or more unapproved ones!).
739 778
 	$smcFunc['db_query']('', '
@@ -760,8 +799,9 @@  discard block
 block discarded – undo
760 799
 	if ($smcFunc['db_num_rows']($request) > 0)
761 800
 	{
762 801
 		$replaceEntries = array();
763
-		while ($row = $smcFunc['db_fetch_assoc']($request))
764
-			$replaceEntries[] = array($row['id_member'], $split2_ID_TOPIC, $row['id_msg'], $row['unwatched']);
802
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
803
+					$replaceEntries[] = array($row['id_member'], $split2_ID_TOPIC, $row['id_msg'], $row['unwatched']);
804
+		}
765 805
 
766 806
 		$smcFunc['db_insert']('ignore',
767 807
 			'{db_prefix}log_topics',
@@ -785,8 +825,9 @@  discard block
 block discarded – undo
785 825
 	// If there's a search index that needs updating, update it...
786 826
 	require_once($sourcedir . '/Search.php');
787 827
 	$searchAPI = findSearchAPI();
788
-	if (is_callable(array($searchAPI, 'topicSplit')))
789
-		$searchAPI->topicSplit($split2_ID_TOPIC, $splitMessages);
828
+	if (is_callable(array($searchAPI, 'topicSplit'))) {
829
+			$searchAPI->topicSplit($split2_ID_TOPIC, $splitMessages);
830
+	}
790 831
 
791 832
 	// Maybe we want to let an external CMS know about this split
792 833
 	$split1 = array(
@@ -833,12 +874,12 @@  discard block
 block discarded – undo
833 874
 	);
834 875
 
835 876
 	// ?action=mergetopics;sa=LETSBREAKIT won't work, sorry.
836
-	if (empty($_REQUEST['sa']) || !isset($subActions[$_REQUEST['sa']]))
837
-		MergeIndex();
838
-
839
-	else
840
-		call_helper($subActions[$_REQUEST['sa']]);
841
-}
877
+	if (empty($_REQUEST['sa']) || !isset($subActions[$_REQUEST['sa']])) {
878
+			MergeIndex();
879
+	} else {
880
+			call_helper($subActions[$_REQUEST['sa']]);
881
+	}
882
+	}
842 883
 
843 884
 /**
844 885
  * allows to pick a topic to merge the current topic with.
@@ -852,8 +893,9 @@  discard block
 block discarded – undo
852 893
 	global $txt, $board, $context, $smcFunc, $sourcedir;
853 894
 	global $scripturl, $modSettings;
854 895
 
855
-	if (!isset($_GET['from']))
856
-		fatal_lang_error('no_access', false);
896
+	if (!isset($_GET['from'])) {
897
+			fatal_lang_error('no_access', false);
898
+	}
857 899
 	$_GET['from'] = (int) $_GET['from'];
858 900
 
859 901
 	$_REQUEST['targetboard'] = isset($_REQUEST['targetboard']) ? (int) $_REQUEST['targetboard'] : $board;
@@ -864,9 +906,9 @@  discard block
 block discarded – undo
864 906
 	{
865 907
 		$can_approve_boards = boardsAllowedTo('approve_posts');
866 908
 		$onlyApproved = $can_approve_boards !== array(0) && !in_array($_REQUEST['targetboard'], $can_approve_boards);
909
+	} else {
910
+			$onlyApproved = false;
867 911
 	}
868
-	else
869
-		$onlyApproved = false;
870 912
 
871 913
 	// How many topics are on this board?  (used for paging.)
872 914
 	$request = $smcFunc['db_query']('', '
@@ -900,8 +942,9 @@  discard block
 block discarded – undo
900 942
 			'is_approved' => 1,
901 943
 		)
902 944
 	);
903
-	if ($smcFunc['db_num_rows']($request) == 0)
904
-		fatal_lang_error('no_board');
945
+	if ($smcFunc['db_num_rows']($request) == 0) {
946
+			fatal_lang_error('no_board');
947
+	}
905 948
 	list ($subject) = $smcFunc['db_fetch_row']($request);
906 949
 	$smcFunc['db_free_result']($request);
907 950
 
@@ -914,8 +957,9 @@  discard block
 block discarded – undo
914 957
 	// Check which boards you have merge permissions on.
915 958
 	$merge_boards = boardsAllowedTo('merge_any');
916 959
 
917
-	if (empty($merge_boards))
918
-		fatal_lang_error('cannot_merge_any', 'user');
960
+	if (empty($merge_boards)) {
961
+			fatal_lang_error('cannot_merge_any', 'user');
962
+	}
919 963
 
920 964
 	// No sense in loading this if you can only merge on this board
921 965
 	if (count($merge_boards) > 1 || in_array(0, $merge_boards))
@@ -929,8 +973,9 @@  discard block
 block discarded – undo
929 973
 		);
930 974
 
931 975
 		// Only include these boards in the list (0 means you're an admin')
932
-		if (!in_array(0, $merge_boards))
933
-			$options['included_boards'] = $merge_boards;
976
+		if (!in_array(0, $merge_boards)) {
977
+					$options['included_boards'] = $merge_boards;
978
+		}
934 979
 
935 980
 		$context['merge_categories'] = getBoardList($options);
936 981
 	}
@@ -976,8 +1021,9 @@  discard block
 block discarded – undo
976 1021
 	}
977 1022
 	$smcFunc['db_free_result']($request);
978 1023
 
979
-	if (empty($context['topics']) && count($merge_boards) <= 1 && !in_array(0, $merge_boards))
980
-		fatal_lang_error('merge_need_more_topics');
1024
+	if (empty($context['topics']) && count($merge_boards) <= 1 && !in_array(0, $merge_boards)) {
1025
+			fatal_lang_error('merge_need_more_topics');
1026
+	}
981 1027
 
982 1028
 	$context['sub_template'] = 'merge';
983 1029
 }
@@ -1007,24 +1053,29 @@  discard block
 block discarded – undo
1007 1053
 	checkSession('request');
1008 1054
 
1009 1055
 	// Handle URLs from MergeIndex.
1010
-	if (!empty($_GET['from']) && !empty($_GET['to']))
1011
-		$topics = array((int) $_GET['from'], (int) $_GET['to']);
1056
+	if (!empty($_GET['from']) && !empty($_GET['to'])) {
1057
+			$topics = array((int) $_GET['from'], (int) $_GET['to']);
1058
+	}
1012 1059
 
1013 1060
 	// If we came from a form, the topic IDs came by post.
1014
-	if (!empty($_POST['topics']) && is_array($_POST['topics']))
1015
-		$topics = $_POST['topics'];
1061
+	if (!empty($_POST['topics']) && is_array($_POST['topics'])) {
1062
+			$topics = $_POST['topics'];
1063
+	}
1016 1064
 
1017 1065
 	// There's nothing to merge with just one topic...
1018
-	if (empty($topics) || !is_array($topics) || count($topics) == 1)
1019
-		fatal_lang_error('merge_need_more_topics');
1066
+	if (empty($topics) || !is_array($topics) || count($topics) == 1) {
1067
+			fatal_lang_error('merge_need_more_topics');
1068
+	}
1020 1069
 
1021 1070
 	// Make sure every topic is numeric, or some nasty things could be done with the DB.
1022
-	foreach ($topics as $id => $topic)
1023
-		$topics[$id] = (int) $topic;
1071
+	foreach ($topics as $id => $topic) {
1072
+			$topics[$id] = (int) $topic;
1073
+	}
1024 1074
 
1025 1075
 	// Joy of all joys, make sure they're not messing about with unapproved topics they can't see :P
1026
-	if ($modSettings['postmod_active'])
1027
-		$can_approve_boards = boardsAllowedTo('approve_posts');
1076
+	if ($modSettings['postmod_active']) {
1077
+			$can_approve_boards = boardsAllowedTo('approve_posts');
1078
+	}
1028 1079
 
1029 1080
 	// Get info about the topics and polls that will be merged.
1030 1081
 	$request = $smcFunc['db_query']('', '
@@ -1045,8 +1096,9 @@  discard block
 block discarded – undo
1045 1096
 			'limit' => count($topics),
1046 1097
 		)
1047 1098
 	);
1048
-	if ($smcFunc['db_num_rows']($request) < 2)
1049
-		fatal_lang_error('no_topic_id');
1099
+	if ($smcFunc['db_num_rows']($request) < 2) {
1100
+			fatal_lang_error('no_topic_id');
1101
+	}
1050 1102
 	$num_views = 0;
1051 1103
 	$is_sticky = 0;
1052 1104
 	$boardTotals = array();
@@ -1059,34 +1111,38 @@  discard block
 block discarded – undo
1059 1111
 	while ($row = $smcFunc['db_fetch_assoc']($request))
1060 1112
 	{
1061 1113
 		// Sorry, redirection topics can't be merged
1062
-		if (!empty($row['id_redirect_topic']))
1063
-			fatal_lang_error('cannot_merge_redirect', false);
1114
+		if (!empty($row['id_redirect_topic'])) {
1115
+					fatal_lang_error('cannot_merge_redirect', false);
1116
+		}
1064 1117
 
1065 1118
 		// Make a note for the board counts...
1066
-		if (!isset($boardTotals[$row['id_board']]))
1067
-			$boardTotals[$row['id_board']] = array(
1119
+		if (!isset($boardTotals[$row['id_board']])) {
1120
+					$boardTotals[$row['id_board']] = array(
1068 1121
 				'posts' => 0,
1069 1122
 				'topics' => 0,
1070 1123
 				'unapproved_posts' => 0,
1071 1124
 				'unapproved_topics' => 0
1072 1125
 			);
1126
+		}
1073 1127
 
1074 1128
 		// We can't see unapproved topics here?
1075 1129
 		if ($modSettings['postmod_active'] && !$row['approved'] && $can_approve_boards != array(0) && in_array($row['id_board'], $can_approve_boards))
1076 1130
 		{
1077 1131
 			unset($topics[$row['id_topic']]); // If we can't see it, we should not merge it and not adjust counts! Instead skip it.
1078 1132
 			continue;
1079
-		}elseif (!$row['approved'])
1080
-			$boardTotals[$row['id_board']]['unapproved_topics']++;
1081
-		else
1082
-			$boardTotals[$row['id_board']]['topics']++;
1133
+		} elseif (!$row['approved']) {
1134
+					$boardTotals[$row['id_board']]['unapproved_topics']++;
1135
+		} else {
1136
+					$boardTotals[$row['id_board']]['topics']++;
1137
+		}
1083 1138
 
1084 1139
 		$boardTotals[$row['id_board']]['unapproved_posts'] += $row['unapproved_posts'];
1085 1140
 		$boardTotals[$row['id_board']]['posts'] += $row['num_replies'] + ($row['approved'] ? 1 : 0);
1086 1141
 
1087 1142
 		// In the case of making a redirect, the topic count goes up by one due to the redirect topic.
1088
-		if (isset($_POST['postRedirect']))
1089
-			$boardTotals[$row['id_board']]['topics']--;
1143
+		if (isset($_POST['postRedirect'])) {
1144
+					$boardTotals[$row['id_board']]['topics']--;
1145
+		}
1090 1146
 
1091 1147
 		$topic_data[$row['id_topic']] = array(
1092 1148
 			'id' => $row['id_topic'],
@@ -1112,11 +1168,13 @@  discard block
 block discarded – undo
1112 1168
 		$boards[] = $row['id_board'];
1113 1169
 
1114 1170
 		// If there's no poll, id_poll == 0...
1115
-		if ($row['id_poll'] > 0)
1116
-			$polls[] = $row['id_poll'];
1171
+		if ($row['id_poll'] > 0) {
1172
+					$polls[] = $row['id_poll'];
1173
+		}
1117 1174
 		// Store the id_topic with the lowest id_first_msg.
1118
-		if (empty($firstTopic))
1119
-			$firstTopic = $row['id_topic'];
1175
+		if (empty($firstTopic)) {
1176
+					$firstTopic = $row['id_topic'];
1177
+		}
1120 1178
 
1121 1179
 		// Lowest topic id gets selected as surviving topic id. We need to store this board so we can adjust the topic count (This one will not have a redirect topic)
1122 1180
 		if ($row['id_topic'] < $lowestTopicId || empty($lowestTopicId))
@@ -1130,11 +1188,13 @@  discard block
 block discarded – undo
1130 1188
 	$smcFunc['db_free_result']($request);
1131 1189
 
1132 1190
 	// If we didn't get any topics then they've been messing with unapproved stuff.
1133
-	if (empty($topic_data))
1134
-		fatal_lang_error('no_topic_id');
1191
+	if (empty($topic_data)) {
1192
+			fatal_lang_error('no_topic_id');
1193
+	}
1135 1194
 
1136
-	if (isset($_POST['postRedirect']) && !empty($lowestTopicBoard))
1137
-		$boardTotals[$lowestTopicBoard]['topics']++;
1195
+	if (isset($_POST['postRedirect']) && !empty($lowestTopicBoard)) {
1196
+			$boardTotals[$lowestTopicBoard]['topics']++;
1197
+	}
1138 1198
 
1139 1199
 	// Will this be approved?
1140 1200
 	$context['is_approved'] = $topic_data[$firstTopic]['approved'];
@@ -1150,8 +1210,9 @@  discard block
 block discarded – undo
1150 1210
 
1151 1211
 	// Get the boards a user is allowed to merge in.
1152 1212
 	$merge_boards = boardsAllowedTo('merge_any');
1153
-	if (empty($merge_boards))
1154
-		fatal_lang_error('cannot_merge_any', 'user');
1213
+	if (empty($merge_boards)) {
1214
+			fatal_lang_error('cannot_merge_any', 'user');
1215
+	}
1155 1216
 
1156 1217
 	// Make sure they can see all boards....
1157 1218
 	$request = $smcFunc['db_query']('', '
@@ -1168,8 +1229,9 @@  discard block
 block discarded – undo
1168 1229
 		)
1169 1230
 	);
1170 1231
 	// If the number of boards that's in the output isn't exactly the same as we've put in there, you're in trouble.
1171
-	if ($smcFunc['db_num_rows']($request) != count($boards))
1172
-		fatal_lang_error('no_board');
1232
+	if ($smcFunc['db_num_rows']($request) != count($boards)) {
1233
+			fatal_lang_error('no_board');
1234
+	}
1173 1235
 	$smcFunc['db_free_result']($request);
1174 1236
 
1175 1237
 	if (empty($_REQUEST['sa']) || $_REQUEST['sa'] == 'options')
@@ -1188,8 +1250,8 @@  discard block
 block discarded – undo
1188 1250
 					'limit' => count($polls),
1189 1251
 				)
1190 1252
 			);
1191
-			while ($row = $smcFunc['db_fetch_assoc']($request))
1192
-				$context['polls'][] = array(
1253
+			while ($row = $smcFunc['db_fetch_assoc']($request)) {
1254
+							$context['polls'][] = array(
1193 1255
 					'id' => $row['id_poll'],
1194 1256
 					'topic' => array(
1195 1257
 						'id' => $row['id_topic'],
@@ -1198,6 +1260,7 @@  discard block
 block discarded – undo
1198 1260
 					'question' => $row['question'],
1199 1261
 					'selected' => $row['id_topic'] == $firstTopic
1200 1262
 				);
1263
+			}
1201 1264
 			$smcFunc['db_free_result']($request);
1202 1265
 		}
1203 1266
 		if (count($boards) > 1)
@@ -1213,18 +1276,20 @@  discard block
 block discarded – undo
1213 1276
 					'limit' => count($boards),
1214 1277
 				)
1215 1278
 			);
1216
-			while ($row = $smcFunc['db_fetch_assoc']($request))
1217
-				$context['boards'][] = array(
1279
+			while ($row = $smcFunc['db_fetch_assoc']($request)) {
1280
+							$context['boards'][] = array(
1218 1281
 					'id' => $row['id_board'],
1219 1282
 					'name' => $row['name'],
1220 1283
 					'selected' => $row['id_board'] == $topic_data[$firstTopic]['board']
1221 1284
 				);
1285
+			}
1222 1286
 			$smcFunc['db_free_result']($request);
1223 1287
 		}
1224 1288
 
1225 1289
 		$context['topics'] = $topic_data;
1226
-		foreach ($topic_data as $id => $topic)
1227
-			$context['topics'][$id]['selected'] = $topic['id'] == $firstTopic;
1290
+		foreach ($topic_data as $id => $topic) {
1291
+					$context['topics'][$id]['selected'] = $topic['id'] == $firstTopic;
1292
+		}
1228 1293
 
1229 1294
 		$context['page_title'] = $txt['merge'];
1230 1295
 		$context['sub_template'] = 'merge_extra_options';
@@ -1233,13 +1298,15 @@  discard block
 block discarded – undo
1233 1298
 
1234 1299
 	// Determine target board.
1235 1300
 	$target_board = count($boards) > 1 ? (int) $_REQUEST['board'] : $boards[0];
1236
-	if (!in_array($target_board, $boards))
1237
-		fatal_lang_error('no_board');
1301
+	if (!in_array($target_board, $boards)) {
1302
+			fatal_lang_error('no_board');
1303
+	}
1238 1304
 
1239 1305
 	// Determine which poll will survive and which polls won't.
1240 1306
 	$target_poll = count($polls) > 1 ? (int) $_POST['poll'] : (count($polls) == 1 ? $polls[0] : 0);
1241
-	if ($target_poll > 0 && !in_array($target_poll, $polls))
1242
-		fatal_lang_error('no_access', false);
1307
+	if ($target_poll > 0 && !in_array($target_poll, $polls)) {
1308
+			fatal_lang_error('no_access', false);
1309
+	}
1243 1310
 	$deleted_polls = empty($target_poll) ? $polls : array_diff($polls, array($target_poll));
1244 1311
 
1245 1312
 	// Determine the subject of the newly merged topic - was a custom subject specified?
@@ -1247,19 +1314,23 @@  discard block
 block discarded – undo
1247 1314
 	{
1248 1315
 		$target_subject = strtr($smcFunc['htmltrim']($smcFunc['htmlspecialchars']($_POST['custom_subject'])), array("\r" => '', "\n" => '', "\t" => ''));
1249 1316
 		// Keep checking the length.
1250
-		if ($smcFunc['strlen']($target_subject) > 100)
1251
-			$target_subject = $smcFunc['substr']($target_subject, 0, 100);
1317
+		if ($smcFunc['strlen']($target_subject) > 100) {
1318
+					$target_subject = $smcFunc['substr']($target_subject, 0, 100);
1319
+		}
1252 1320
 
1253 1321
 		// Nothing left - odd but pick the first topics subject.
1254
-		if ($target_subject == '')
1255
-			$target_subject = $topic_data[$firstTopic]['subject'];
1322
+		if ($target_subject == '') {
1323
+					$target_subject = $topic_data[$firstTopic]['subject'];
1324
+		}
1256 1325
 	}
1257 1326
 	// A subject was selected from the list.
1258
-	elseif (!empty($topic_data[(int) $_POST['subject']]['subject']))
1259
-		$target_subject = $topic_data[(int) $_POST['subject']]['subject'];
1327
+	elseif (!empty($topic_data[(int) $_POST['subject']]['subject'])) {
1328
+			$target_subject = $topic_data[(int) $_POST['subject']]['subject'];
1329
+	}
1260 1330
 	// Nothing worked? Just take the subject of the first message.
1261
-	else
1262
-		$target_subject = $topic_data[$firstTopic]['subject'];
1331
+	else {
1332
+			$target_subject = $topic_data[$firstTopic]['subject'];
1333
+	}
1263 1334
 
1264 1335
 	// Get the first and last message and the number of messages....
1265 1336
 	$request = $smcFunc['db_query']('', '
@@ -1285,15 +1356,13 @@  discard block
 block discarded – undo
1285 1356
 			{
1286 1357
 				$num_replies = $row['message_count'] - 1;
1287 1358
 				$num_unapproved = 0;
1288
-			}
1289
-			else
1359
+			} else
1290 1360
 			{
1291 1361
 				$topic_approved = 0;
1292 1362
 				$num_replies = 0;
1293 1363
 				$num_unapproved = $row['message_count'];
1294 1364
 			}
1295
-		}
1296
-		else
1365
+		} else
1297 1366
 		{
1298 1367
 			// If this has a lower first_msg then the first post is not approved and hence the number of replies was wrong!
1299 1368
 			if ($first_msg > $row['first_msg'])
@@ -1339,8 +1408,9 @@  discard block
 block discarded – undo
1339 1408
 	list ($member_started) = $smcFunc['db_fetch_row']($request);
1340 1409
 	list ($member_updated) = $smcFunc['db_fetch_row']($request);
1341 1410
 	// First and last message are the same, so only row was returned.
1342
-	if ($member_updated === NULL)
1343
-		$member_updated = $member_started;
1411
+	if ($member_updated === NULL) {
1412
+			$member_updated = $member_started;
1413
+	}
1344 1414
 
1345 1415
 	$smcFunc['db_free_result']($request);
1346 1416
 
@@ -1353,8 +1423,9 @@  discard block
 block discarded – undo
1353 1423
 		array(
1354 1424
 			'topic_list' => $topics,
1355 1425
 	));
1356
-	while ($row = $smcFunc['db_fetch_row']($request))
1357
-		$affected_msgs[] = $row[0];
1426
+	while ($row = $smcFunc['db_fetch_row']($request)) {
1427
+			$affected_msgs[] = $row[0];
1428
+	}
1358 1429
 	$smcFunc['db_free_result']($request);
1359 1430
 
1360 1431
 	// Assign the first topic ID to be the merged topic.
@@ -1432,9 +1503,9 @@  discard block
 block discarded – undo
1432 1503
 	// Grab the response prefix (like 'Re: ') in the default forum language.
1433 1504
 	if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
1434 1505
 	{
1435
-		if ($language === $user_info['language'])
1436
-			$context['response_prefix'] = $txt['response_prefix'];
1437
-		else
1506
+		if ($language === $user_info['language']) {
1507
+					$context['response_prefix'] = $txt['response_prefix'];
1508
+		} else
1438 1509
 		{
1439 1510
 			loadLanguage('index', $language, false);
1440 1511
 			$context['response_prefix'] = $txt['response_prefix'];
@@ -1514,8 +1585,9 @@  discard block
 block discarded – undo
1514 1585
 	if ($smcFunc['db_num_rows']($request) > 0)
1515 1586
 	{
1516 1587
 		$replaceEntries = array();
1517
-		while ($row = $smcFunc['db_fetch_assoc']($request))
1518
-			$replaceEntries[] = array($row['id_member'], $id_topic, $row['new_id_msg'], $row['unwatched']);
1588
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
1589
+					$replaceEntries[] = array($row['id_member'], $id_topic, $row['new_id_msg'], $row['unwatched']);
1590
+		}
1519 1591
 
1520 1592
 		$smcFunc['db_insert']('replace',
1521 1593
 			'{db_prefix}log_topics',
@@ -1552,8 +1624,9 @@  discard block
 block discarded – undo
1552 1624
 		if ($smcFunc['db_num_rows']($request) > 0)
1553 1625
 		{
1554 1626
 			$replaceEntries = array();
1555
-			while ($row = $smcFunc['db_fetch_assoc']($request))
1556
-				$replaceEntries[] = array($row['id_member'], $id_topic, 0, $row['sent']);
1627
+			while ($row = $smcFunc['db_fetch_assoc']($request)) {
1628
+							$replaceEntries[] = array($row['id_member'], $id_topic, 0, $row['sent']);
1629
+			}
1557 1630
 
1558 1631
 			$smcFunc['db_insert']('replace',
1559 1632
 					'{db_prefix}log_notify',
@@ -1728,8 +1801,9 @@  discard block
 block discarded – undo
1728 1801
 	// If there's a search index that needs updating, update it...
1729 1802
 	require_once($sourcedir . '/Search.php');
1730 1803
 	$searchAPI = findSearchAPI();
1731
-	if (is_callable(array($searchAPI, 'topicMerge')))
1732
-		$searchAPI->topicMerge($id_topic, $topics, $affected_msgs, empty($_POST['enforce_subject']) ? null : array($context['response_prefix'], $target_subject));
1804
+	if (is_callable(array($searchAPI, 'topicMerge'))) {
1805
+			$searchAPI->topicMerge($id_topic, $topics, $affected_msgs, empty($_POST['enforce_subject']) ? null : array($context['response_prefix'], $target_subject));
1806
+	}
1733 1807
 
1734 1808
 	// Merging is the sort of thing an external CMS might want to know about
1735 1809
 	$merged_topic = array(
Please login to merge, or discard this patch.
Sources/minify/path-converter/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/minify/path-converter/src/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/minify/data/js/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/minify/data/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.