Passed
Push — patch_1-1-9 ( d927f0...e2616d )
by Spuds
01:06 queued 27s
created
sources/subs/Event.class.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,9 +73,12 @@  discard block
 block discarded – undo
73 73
 	public function add($event, $priority)
74 74
 	{
75 75
 		if (is_array($event[1]))
76
-			$name = $event[1][0];
77
-		else
78
-			$name = $event[1];
76
+		{
77
+					$name = $event[1][0];
78
+		}
79
+		else {
80
+					$name = $event[1];
81
+		}
79 82
 
80 83
 		$this->_priority->add($name, $priority);
81 84
 		$this->_events[$name] = $event;
@@ -111,10 +114,14 @@  discard block
 block discarded – undo
111 114
 	{
112 115
 		$return = array();
113 116
 		if ($this->_sorted === false)
114
-			$this->_doSorting();
117
+		{
118
+					$this->_doSorting();
119
+		}
115 120
 
116 121
 		foreach ($this->_priority->getSortedEntities() as $value)
117
-			$return[] = $this->_events[$value];
122
+		{
123
+					$return[] = $this->_events[$value];
124
+		}
118 125
 
119 126
 		return $return;
120 127
 	}
Please login to merge, or discard this patch.
sources/subs/CalendarEvent.class.php 1 patch
Braces   +60 added lines, -21 removed lines patch added patch discarded remove patch
@@ -69,9 +69,13 @@  discard block
 block discarded – undo
69 69
 		{
70 70
 			// Make sure it's turned on and not some fool trying to trick it.
71 71
 			if (empty($this->_settings['cal_allowspan']))
72
-				throw new Elk_Exception('no_span', false);
72
+			{
73
+							throw new Elk_Exception('no_span', false);
74
+			}
73 75
 			if ($event['span'] < 1 || $event['span'] > $this->_settings['cal_maxspan'])
74
-				throw new Elk_Exception('invalid_days_numb', false);
76
+			{
77
+							throw new Elk_Exception('invalid_days_numb', false);
78
+			}
75 79
 		}
76 80
 
77 81
 
@@ -80,34 +84,54 @@  discard block
 block discarded – undo
80 84
 		{
81 85
 			// No month?  No year?
82 86
 			if (!isset($event['month']))
83
-				throw new Elk_Exception('event_month_missing', false);
87
+			{
88
+							throw new Elk_Exception('event_month_missing', false);
89
+			}
84 90
 			if (!isset($event['year']))
85
-				throw new Elk_Exception('event_year_missing', false);
91
+			{
92
+							throw new Elk_Exception('event_year_missing', false);
93
+			}
86 94
 
87 95
 			// Check the month and year...
88 96
 			if ($event['month'] < 1 || $event['month'] > 12)
89
-				throw new Elk_Exception('invalid_month', false);
97
+			{
98
+							throw new Elk_Exception('invalid_month', false);
99
+			}
90 100
 			if ($event['year'] < $this->_settings['cal_minyear'] || $event['year'] > (int) date('Y') + $this->_settings['cal_limityear'])
91
-				throw new Elk_Exception('invalid_year', false);
101
+			{
102
+							throw new Elk_Exception('invalid_year', false);
103
+			}
92 104
 
93 105
 			// No day?
94 106
 			if (!isset($event['day']))
95
-				throw new Elk_Exception('event_day_missing', false);
107
+			{
108
+							throw new Elk_Exception('event_day_missing', false);
109
+			}
96 110
 
97 111
 			if (!isset($event['evtitle']) && !isset($event['subject']))
98
-				throw new Elk_Exception('event_title_missing', false);
112
+			{
113
+							throw new Elk_Exception('event_title_missing', false);
114
+			}
99 115
 			elseif (!isset($event['evtitle']))
100
-				$event['evtitle'] = $event['subject'];
116
+			{
117
+							$event['evtitle'] = $event['subject'];
118
+			}
101 119
 
102 120
 			// Bad day?
103 121
 			if (!checkdate($event['month'], $event['day'], $event['year']))
104
-				throw new Elk_Exception('invalid_date', false);
122
+			{
123
+							throw new Elk_Exception('invalid_date', false);
124
+			}
105 125
 
106 126
 			// No title?
107 127
 			if (Util::htmltrim($event['evtitle']) === '')
108
-				throw new Elk_Exception('no_event_title', false);
128
+			{
129
+							throw new Elk_Exception('no_event_title', false);
130
+			}
109 131
 			if (Util::strlen($event['evtitle']) > 100)
110
-				$event['evtitle'] = Util::substr($event['evtitle'], 0, 100);
132
+			{
133
+							$event['evtitle'] = Util::substr($event['evtitle'], 0, 100);
134
+			}
111 135
 			$event['evtitle'] = str_replace(';', '', $event['evtitle']);
112 136
 		}
113 137
 
@@ -153,19 +177,28 @@  discard block
 block discarded – undo
153 177
 	{
154 178
 		// There could be already a topic you are not allowed to modify
155 179
 		if (!allowedTo('post_new') && empty($this->_settings['disableNoPostingCalendarEdits']))
156
-			$eventProperties = getEventProperties($this->_event_id, true);
180
+		{
181
+					$eventProperties = getEventProperties($this->_event_id, true);
182
+		}
157 183
 
158 184
 		$id_board = isset($eventProperties['id_board']) ? $eventProperties['id_board'] : (isset($options['id_board']) ? $options['board'] : 0);
159 185
 		$id_topic = isset($eventProperties['id_topic']) ? $eventProperties['id_topic'] : (isset($options['id_topic']) ? $options['topic'] : 0);
160 186
 
161 187
 		if (empty($this->_settings['cal_allowspan']))
162
-			$span = 0;
188
+		{
189
+					$span = 0;
190
+		}
163 191
 		elseif (empty($options['span']) || $options['span'] == 1)
164
-			$span = 0;
192
+		{
193
+					$span = 0;
194
+		}
165 195
 		elseif (empty($this->_settings['cal_maxspan']) || $options['span'] > $this->_settings['cal_maxspan'])
166
-			$span = 0;
167
-		else
168
-			$span = min((int) $this->_settings['cal_maxspan'], (int) $options['span'] - 1);
196
+		{
197
+					$span = 0;
198
+		}
199
+		else {
200
+					$span = min((int) $this->_settings['cal_maxspan'], (int) $options['span'] - 1);
201
+		}
169 202
 
170 203
 		$eventOptions = array(
171 204
 			'title' => Util::substr($options['evtitle'], 0, 100),
@@ -217,7 +250,9 @@  discard block
 block discarded – undo
217 250
 			$event = getEventProperties($this->_event_id);
218 251
 
219 252
 			if ($event === false)
220
-				throw new Elk_Exception('no_access', false);
253
+			{
254
+							throw new Elk_Exception('no_access', false);
255
+			}
221 256
 
222 257
 			// If it has a board, then they should be editing it within the topic.
223 258
 			if (!empty($event['topic']['id']) && !empty($event['topic']['first_msg']))
@@ -229,9 +264,13 @@  discard block
 block discarded – undo
229 264
 
230 265
 			// Make sure the user is allowed to edit this event.
231 266
 			if ($event['member'] != $member_id)
232
-				isAllowedTo('calendar_edit_any');
267
+			{
268
+							isAllowedTo('calendar_edit_any');
269
+			}
233 270
 			elseif (!allowedTo('calendar_edit_any'))
234
-				isAllowedTo('calendar_edit_own');
271
+			{
272
+							isAllowedTo('calendar_edit_own');
273
+			}
235 274
 		}
236 275
 
237 276
 		return $event;
Please login to merge, or discard this patch.
sources/subs/Subscriptions-twoCheckOut.class.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -113,11 +113,15 @@  discard block
 block discarded – undo
113 113
 
114 114
 		// Is it even on?
115 115
 		if (empty($modSettings['2co_id']) || empty($modSettings['2co_password']))
116
-			return false;
116
+		{
117
+					return false;
118
+		}
117 119
 
118 120
 		// Is it a 2co hash?
119 121
 		if (empty($_POST['x_MD5_Hash']))
120
-			return false;
122
+		{
123
+					return false;
124
+		}
121 125
 
122 126
 		// Do we have an invoice number?
123 127
 		 return !empty($_POST['x_invoice_num']);
@@ -134,14 +138,18 @@  discard block
 block discarded – undo
134 138
 
135 139
 		// Is this the right hash?
136 140
 		if (empty($modSettings['2co_password']) || $_POST['x_MD5_Hash'] !== strtoupper(md5($modSettings['2co_password'] . $modSettings['2co_id'] . $_POST['x_trans_id'] . $_POST['x_amount'])))
137
-			generateSubscriptionError($txt['2co_password_wrong']);
141
+		{
142
+					generateSubscriptionError($txt['2co_password_wrong']);
143
+		}
138 144
 
139 145
 		// Verify the currency
140 146
 		list (, $currency) = explode(':', $_POST['x_invoice_num']);
141 147
 
142 148
 		// Verify the currency!
143 149
 		if (strtolower($currency) != $modSettings['currency_code'])
144
-			exit;
150
+		{
151
+					exit;
152
+		}
145 153
 
146 154
 		// Return the ID_SUB/ID_MEMBER
147 155
 		return explode('+', $_POST['x_invoice_num']);
Please login to merge, or discard this patch.
sources/subs/Drafts.subs.php 2 patches
Braces   +39 added lines, -15 removed lines patch added patch discarded remove patch
@@ -222,7 +222,9 @@  discard block
 block discarded – undo
222 222
 
223 223
 	// No results?
224 224
 	if (!$db->num_rows($request))
225
-		return false;
225
+	{
226
+			return false;
227
+	}
226 228
 
227 229
 	// Load up the data
228 230
 	$draft_info = $db->fetch_assoc($request);
@@ -295,13 +297,17 @@  discard block
 block discarded – undo
295 297
 
296 298
 	// Only a single draft.
297 299
 	if (!is_array($id_draft))
298
-		$id_draft = array($id_draft);
300
+	{
301
+			$id_draft = array($id_draft);
302
+	}
299 303
 
300 304
 	$id_draft = array_map('intval', $id_draft);
301 305
 
302 306
 	// Can't delete nothing
303 307
 	if (empty($id_draft))
304
-		return false;
308
+	{
309
+			return false;
310
+	}
305 311
 
306 312
 	$db->query('', '
307 313
 		DELETE FROM {db_prefix}user_drafts
@@ -454,13 +460,19 @@  discard block
 block discarded – undo
454 460
 	// The message and subject still need a bit more work
455 461
 	preparsecode($draft['body']);
456 462
 	if (Util::strlen($draft['subject']) > 100)
457
-		$draft['subject'] = Util::substr($draft['subject'], 0, 100);
463
+	{
464
+			$draft['subject'] = Util::substr($draft['subject'], 0, 100);
465
+	}
458 466
 
459 467
 	if (!isset($draft['is_usersaved']))
460
-		$draft['is_usersaved'] = 0;
468
+	{
469
+			$draft['is_usersaved'] = 0;
470
+	}
461 471
 
462 472
 	if (isset($draft_info['is_usersaved']) && $draft_info['is_usersaved'] == 1)
463
-		$draft['is_usersaved'] = 1;
473
+	{
474
+			$draft['is_usersaved'] = 1;
475
+	}
464 476
 
465 477
 	// Modifying an existing draft, like hitting the save draft button or autosave enabled?
466 478
 	if (!empty($id_draft) && !empty($draft_info))
@@ -482,8 +494,9 @@  discard block
 block discarded – undo
482 494
 			$context['draft_saved'] = true;
483 495
 			$context['id_draft'] = $id_draft;
484 496
 		}
485
-		else
486
-			$post_errors->addError('draft_not_saved');
497
+		else {
498
+					$post_errors->addError('draft_not_saved');
499
+		}
487 500
 	}
488 501
 }
489 502
 
@@ -526,18 +539,26 @@  discard block
 block discarded – undo
526 539
 
527 540
 	// Determine who this is being sent to
528 541
 	if (!$check_last_save && !empty($draft_info['to_list']) && empty($recipientList))
529
-		$recipientList = Util::unserialize($draft_info['to_list']);
542
+	{
543
+			$recipientList = Util::unserialize($draft_info['to_list']);
544
+	}
530 545
 
531 546
 	// message and subject always need a bit more work
532 547
 	preparsecode($draft['body']);
533 548
 	if (Util::strlen($draft['subject']) > 100)
534
-		$draft['subject'] = Util::substr($draft['subject'], 0, 100);
549
+	{
550
+			$draft['subject'] = Util::substr($draft['subject'], 0, 100);
551
+	}
535 552
 
536 553
 	if (!isset($draft['is_usersaved']))
537
-		$draft['is_usersaved'] = 0;
554
+	{
555
+			$draft['is_usersaved'] = 0;
556
+	}
538 557
 
539 558
 	if (isset($draft_info['is_usersaved']) && $draft_info['is_usersaved'] == 1)
540
-		$draft['is_usersaved'] = 1;
559
+	{
560
+			$draft['is_usersaved'] = 1;
561
+	}
541 562
 
542 563
 	// Modifying an existing PM draft?
543 564
 	if (!empty($id_pm_draft) && !empty($draft_info))
@@ -559,8 +580,9 @@  discard block
 block discarded – undo
559 580
 			$context['draft_saved'] = true;
560 581
 			$context['id_pm_draft'] = $id_pm_draft;
561 582
 		}
562
-		else
563
-			$post_errors->addError('draft_not_saved');
583
+		else {
584
+					$post_errors->addError('draft_not_saved');
585
+		}
564 586
 	}
565 587
 
566 588
 	// if we were called from the autosave function, send something back
@@ -599,7 +621,9 @@  discard block
 block discarded – undo
599 621
 
600 622
 	// Nothing to read, nothing to do
601 623
 	if (empty($id_draft))
602
-		return false;
624
+	{
625
+			return false;
626
+	}
603 627
 
604 628
 	// Load in this draft from the DB
605 629
 	$drafts_keep_days = !empty($modSettings['drafts_keep_days']) ? (time() - ($modSettings['drafts_keep_days'] * 86400)) : 0;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -404,7 +404,7 @@
 block discarded – undo
404 404
 		array(
405 405
 			'poster_time_old' => time() - (86400 * $days),
406 406
 		),
407
-		function ($row)
407
+		function($row)
408 408
 		{
409 409
 			return (int) $row['id_draft'];
410 410
 		}
Please login to merge, or discard this patch.
sources/subs/Maintenance.subs.php 2 patches
Braces   +43 added lines, -18 removed lines patch added patch discarded remove patch
@@ -100,8 +100,10 @@  discard block
 block discarded – undo
100 100
 
101 101
 	$colData = $table->db_list_columns('{db_prefix}messages', true);
102 102
 	foreach ($colData as $column)
103
-		if ($column['name'] == 'body')
103
+	{
104
+			if ($column['name'] == 'body')
104 105
 			$body_type = $column['type'];
106
+	}
105 107
 
106 108
 	return $body_type;
107 109
 }
@@ -197,7 +199,9 @@  discard block
 block discarded – undo
197 199
 	// Get a list of tables, as well as how many there are.
198 200
 	$temp_tables = $db->db_list_tables(false, $real_prefix . '%');
199 201
 	foreach ($temp_tables as $table)
200
-			$tables[] = array('table_name' => $table);
202
+	{
203
+				$tables[] = array('table_name' => $table);
204
+	}
201 205
 
202 206
 	return $tables;
203 207
 }
@@ -319,7 +323,9 @@  discard block
 block discarded – undo
319 323
 	$allowed_columns = array('num_posts', 'num_topics', 'unapproved_posts', 'unapproved_topics');
320 324
 
321 325
 	if (!in_array($column, $allowed_columns))
322
-			return false;
326
+	{
327
+				return false;
328
+	}
323 329
 
324 330
 	$db->query('', '
325 331
 		UPDATE {db_prefix}boards
@@ -536,11 +542,14 @@  discard block
 block discarded – undo
536 542
 	);
537 543
 	$boards = array();
538 544
 	while ($row = $db->fetch_assoc($request))
539
-		$boards[$row['id_board']][] = $row['id_msg'];
545
+	{
546
+			$boards[$row['id_board']][] = $row['id_msg'];
547
+	}
540 548
 	$db->free_result($request);
541 549
 
542 550
 	foreach ($boards as $board_id => $messages)
543
-		$db->query('', '
551
+	{
552
+			$db->query('', '
544 553
 			UPDATE {db_prefix}messages
545 554
 			SET id_board = {int:id_board}
546 555
 			WHERE id_msg IN ({array_int:id_msg_array})',
@@ -549,7 +558,8 @@  discard block
 block discarded – undo
549 558
 				'id_board' => $board_id,
550 559
 			)
551 560
 		);
552
-}
561
+	}
562
+	}
553 563
 
554 564
 /**
555 565
  * Updates the latest message of each board.
@@ -572,7 +582,9 @@  discard block
 block discarded – undo
572 582
 	);
573 583
 	$realBoardCounts = array();
574 584
 	while ($row = $db->fetch_assoc($request))
575
-		$realBoardCounts[$row['id_board']] = $row['local_last_msg'];
585
+	{
586
+			$realBoardCounts[$row['id_board']] = $row['local_last_msg'];
587
+	}
576 588
 	$db->free_result($request);
577 589
 
578 590
 	$request = $db->query('', '
@@ -593,16 +605,20 @@  discard block
 block discarded – undo
593 605
 
594 606
 	$lastModifiedMsg = array();
595 607
 	foreach ($resort_me as $rows)
596
-		foreach ($rows as $row)
608
+	{
609
+			foreach ($rows as $row)
597 610
 		{
598 611
 			// The latest message is the latest of the current board and its children.
599 612
 			if (isset($lastModifiedMsg[$row['id_board']]))
600 613
 				$curLastModifiedMsg = max($row['local_last_msg'], $lastModifiedMsg[$row['id_board']]);
601
-			else
602
-				$curLastModifiedMsg = $row['local_last_msg'];
614
+	}
615
+			else {
616
+							$curLastModifiedMsg = $row['local_last_msg'];
617
+			}
603 618
 				// If what is and what should be the latest message differ, an update is necessary.
604 619
 			if ($row['local_last_msg'] != $row['id_last_msg'] || $curLastModifiedMsg != $row['id_msg_updated'])
605
-				$db->query('', '
620
+			{
621
+							$db->query('', '
606 622
 					UPDATE {db_prefix}boards
607 623
 					SET id_last_msg = {int:id_last_msg}, id_msg_updated = {int:id_msg_updated}
608 624
 					WHERE id_board = {int:id_board}',
@@ -612,12 +628,16 @@  discard block
 block discarded – undo
612 628
 						'id_board' => $row['id_board'],
613 629
 					)
614 630
 				);
631
+			}
615 632
 
616 633
 			// Parent boards inherit the latest modified message of their children.
617 634
 			if (isset($lastModifiedMsg[$row['id_parent']]))
618
-				$lastModifiedMsg[$row['id_parent']] = max($row['local_last_msg'], $lastModifiedMsg[$row['id_parent']]);
619
-			else
620
-				$lastModifiedMsg[$row['id_parent']] = $row['local_last_msg'];
635
+			{
636
+							$lastModifiedMsg[$row['id_parent']] = max($row['local_last_msg'], $lastModifiedMsg[$row['id_parent']]);
637
+			}
638
+			else {
639
+							$lastModifiedMsg[$row['id_parent']] = $row['local_last_msg'];
640
+			}
621 641
 		}
622 642
 }
623 643
 
@@ -736,7 +756,9 @@  discard block
 block discarded – undo
736 756
 	// Update the post count for this group
737 757
 	require_once(SUBSDIR . '/Members.subs.php');
738 758
 	while ($row = $db->fetch_assoc($request))
739
-		updateMemberData($row['id_member'], array('posts' => $row['posts']));
759
+	{
760
+			updateMemberData($row['id_member'], array('posts' => $row['posts']));
761
+	}
740 762
 	$db->free_result($request);
741 763
 
742 764
 	return $total_rows;
@@ -825,8 +847,9 @@  discard block
 block discarded – undo
825 847
 		$where = 'mem.date_registered < {int:time_limit} AND mem.is_activated = {int:is_activated}';
826 848
 		$where_vars['is_activated'] = 0;
827 849
 	}
828
-	else
829
-		$where = 'mem.last_login < {int:time_limit} AND (mem.last_login != 0 OR mem.date_registered < {int:time_limit})';
850
+	else {
851
+			$where = 'mem.last_login < {int:time_limit} AND (mem.last_login != 0 OR mem.date_registered < {int:time_limit})';
852
+	}
830 853
 
831 854
 	// Need to get *all* groups then work out which (if any) we avoid.
832 855
 	$request = $db->query('', '
@@ -874,7 +897,9 @@  discard block
 block discarded – undo
874 897
 	while ($row = $db->fetch_assoc($request))
875 898
 	{
876 899
 		if (!$row['is_mod'] || !in_array(3, $groups))
877
-			$members[] = $row['id_member'];
900
+		{
901
+					$members[] = $row['id_member'];
902
+		}
878 903
 	}
879 904
 	$db->free_result($request);
880 905
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			'start' => $start,
139 139
 			'increment' => $increment - 1,
140 140
 		),
141
-		function ($row)
141
+		function($row)
142 142
 		{
143 143
 			return $row['id_msg'];
144 144
 		}
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		array(
169 169
 			'messages' => $msg,
170 170
 		),
171
-		function ($row) use ($scripturl)
171
+		function($row) use ($scripturl)
172 172
 		{
173 173
 			return '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '">' . $row['subject'] . '</a>';
174 174
 		}
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 			'start' => $start,
264 264
 			'max_id' => $start + $increment,
265 265
 		),
266
-		function ($row)
266
+		function($row)
267 267
 		{
268 268
 			setTopicAttribute($row['id_topic'], array('num_replies' => $row['real_num_replies']));
269 269
 		}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 			'start' => $start,
297 297
 			'max_id' => $start + $increment,
298 298
 		),
299
-		function ($row)
299
+		function($row)
300 300
 		{
301 301
 			setTopicAttribute($row['id_topic'], array('unapproved_posts' => $row['real_unapproved_posts']));
302 302
 		}
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 		array(
489 489
 			'is_not_deleted' => 0,
490 490
 		),
491
-		function ($row)
491
+		function($row)
492 492
 		{
493 493
 			updateMemberData($row['id_member'], array('personal_messages' => $row['real_num']));
494 494
 		}
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 			'is_not_deleted' => 0,
506 506
 			'is_not_read' => 0,
507 507
 		),
508
-		function ($row)
508
+		function($row)
509 509
 		{
510 510
 			updateMemberData($row['id_member'], array('unread_messages' => $row['real_num']));
511 511
 		}
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 		array(
668 668
 			'id_board' => $id_board,
669 669
 		),
670
-		function ($row)
670
+		function($row)
671 671
 		{
672 672
 			return $row['id_topic'];
673 673
 		}
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 			array(
790 790
 				'zero' => 0,
791 791
 			),
792
-			function ($row)
792
+			function($row)
793 793
 			{
794 794
 				// Set the post count to zero for any delinquents we may have found
795 795
 				return $row['id_member'];
Please login to merge, or discard this patch.
sources/subs/Stats.subs.php 1 patch
Braces   +87 added lines, -35 removed lines patch added patch discarded remove patch
@@ -127,10 +127,13 @@  discard block
 block discarded – undo
127 127
 
128 128
 	// If there is a default setting, let's not retrieve something bigger
129 129
 	if (isset($modSettings['stats_limit']))
130
-		$limit = empty($limit) ? $modSettings['stats_limit'] : ($limit < $modSettings['stats_limit'] ? $limit : $modSettings['stats_limit']);
130
+	{
131
+			$limit = empty($limit) ? $modSettings['stats_limit'] : ($limit < $modSettings['stats_limit'] ? $limit : $modSettings['stats_limit']);
132
+	}
131 133
 	// Otherwise, fingers crossed and let's grab what is asked
132
-	else
133
-		$limit = empty($limit) ? 10 : $limit;
134
+	else {
135
+			$limit = empty($limit) ? 10 : $limit;
136
+	}
134 137
 
135 138
 	// Make the query to the the x number of top posters
136 139
 	$members_result = $db->query('', '
@@ -157,7 +160,9 @@  discard block
 block discarded – undo
157 160
 			'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['id_member'] . '">' . $row_members['real_name'] . '</a>'
158 161
 		);
159 162
 		if ($max_num_posts < $row_members['posts'])
160
-			$max_num_posts = $row_members['posts'];
163
+		{
164
+					$max_num_posts = $row_members['posts'];
165
+		}
161 166
 	}
162 167
 	$db->free_result($members_result);
163 168
 
@@ -188,10 +193,13 @@  discard block
 block discarded – undo
188 193
 
189 194
 	// If there is a default setting, let's not retrieve something bigger
190 195
 	if (isset($modSettings['stats_limit']))
191
-		$limit = empty($limit) ? $modSettings['stats_limit'] : ($limit < $modSettings['stats_limit'] ? $limit : $modSettings['stats_limit']);
196
+	{
197
+			$limit = empty($limit) ? $modSettings['stats_limit'] : ($limit < $modSettings['stats_limit'] ? $limit : $modSettings['stats_limit']);
198
+	}
192 199
 	// Otherwise, fingers crossed and let's grab what is asked
193
-	else
194
-		$limit = empty($limit) ? 10 : $limit;
200
+	else {
201
+			$limit = empty($limit) ? 10 : $limit;
202
+	}
195 203
 
196 204
 	$boards_result = $db->query('', '
197 205
 		SELECT b.id_board, b.name, b.num_posts, b.num_topics' . ($read_status ? ',' . (!$user_info['is_guest'] ? ' 1 AS is_read' : '
@@ -224,10 +232,14 @@  discard block
 block discarded – undo
224 232
 			'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['name'] . '</a>'
225 233
 		);
226 234
 		if ($read_status)
227
-			$top_boards[$row_board['id_board']]['is_read'] = !empty($row_board['is_read']);
235
+		{
236
+					$top_boards[$row_board['id_board']]['is_read'] = !empty($row_board['is_read']);
237
+		}
228 238
 
229 239
 		if ($max_num_posts < $row_board['num_posts'])
230
-			$max_num_posts = $row_board['num_posts'];
240
+		{
241
+					$max_num_posts = $row_board['num_posts'];
242
+		}
231 243
 	}
232 244
 	$db->free_result($boards_result);
233 245
 
@@ -258,10 +270,13 @@  discard block
 block discarded – undo
258 270
 
259 271
 	// If there is a default setting, let's not retrieve something bigger
260 272
 	if (isset($modSettings['stats_limit']))
261
-		$limit = empty($limit) ? $modSettings['stats_limit'] : ($limit < $modSettings['stats_limit'] ? $limit : $modSettings['stats_limit']);
273
+	{
274
+			$limit = empty($limit) ? $modSettings['stats_limit'] : ($limit < $modSettings['stats_limit'] ? $limit : $modSettings['stats_limit']);
275
+	}
262 276
 	// Otherwise, fingers crossed and let's grab what is asked
263
-	else
264
-		$limit = empty($limit) ? 10 : $limit;
277
+	else {
278
+			$limit = empty($limit) ? 10 : $limit;
279
+	}
265 280
 
266 281
 	// Are you on a larger forum?  If so, let's try to limit the number of topics we search through.
267 282
 	if ($modSettings['totalMessages'] > 100000)
@@ -280,11 +295,14 @@  discard block
 block discarded – undo
280 295
 		);
281 296
 		$topic_ids = array();
282 297
 		while ($row = $db->fetch_assoc($request))
283
-			$topic_ids[] = $row['id_topic'];
298
+		{
299
+					$topic_ids[] = $row['id_topic'];
300
+		}
284 301
 		$db->free_result($request);
285 302
 	}
286
-	else
287
-		$topic_ids = array();
303
+	else {
304
+			$topic_ids = array();
305
+	}
288 306
 
289 307
 	// Find the top x topics by number of replys
290 308
 	$topic_reply_result = $db->query('', '
@@ -327,7 +345,9 @@  discard block
 block discarded – undo
327 345
 		);
328 346
 
329 347
 		if ($max_num_replies < $row_topic_reply['num_replies'])
330
-			$max_num_replies = $row_topic_reply['num_replies'];
348
+		{
349
+					$max_num_replies = $row_topic_reply['num_replies'];
350
+		}
331 351
 	}
332 352
 	$db->free_result($topic_reply_result);
333 353
 
@@ -357,10 +377,13 @@  discard block
 block discarded – undo
357 377
 
358 378
 	// If there is a default setting, let's not retrieve something bigger
359 379
 	if (isset($modSettings['stats_limit']))
360
-		$limit = empty($limit) ? $modSettings['stats_limit'] : ($limit < $modSettings['stats_limit'] ? $limit : $modSettings['stats_limit']);
380
+	{
381
+			$limit = empty($limit) ? $modSettings['stats_limit'] : ($limit < $modSettings['stats_limit'] ? $limit : $modSettings['stats_limit']);
382
+	}
361 383
 	// Otherwise, fingers crossed and let's grab what is asked
362
-	else
363
-		$limit = empty($limit) ? 10 : $limit;
384
+	else {
385
+			$limit = empty($limit) ? 10 : $limit;
386
+	}
364 387
 
365 388
 	// Large forums may need a bit more prodding...
366 389
 	if ($modSettings['totalMessages'] > 100000)
@@ -377,11 +400,14 @@  discard block
 block discarded – undo
377 400
 		);
378 401
 		$topic_ids = array();
379 402
 		while ($row = $db->fetch_assoc($request))
380
-			$topic_ids[] = $row['id_topic'];
403
+		{
404
+					$topic_ids[] = $row['id_topic'];
405
+		}
381 406
 		$db->free_result($request);
382 407
 	}
383
-	else
384
-		$topic_ids = array();
408
+	else {
409
+			$topic_ids = array();
410
+	}
385 411
 
386 412
 	$topic_view_result = $db->query('', '
387 413
 		SELECT m.subject, t.num_views, t.num_replies, t.id_board, t.id_topic, b.name
@@ -423,7 +449,9 @@  discard block
 block discarded – undo
423 449
 		);
424 450
 
425 451
 		if ($max_num_views < $row_topic_views['num_views'])
426
-			$max_num_views = $row_topic_views['num_views'];
452
+		{
453
+					$max_num_views = $row_topic_views['num_views'];
454
+		}
427 455
 	}
428 456
 	$db->free_result($topic_view_result);
429 457
 
@@ -467,14 +495,18 @@  discard block
 block discarded – undo
467 495
 		);
468 496
 		$members = array();
469 497
 		while ($row = $db->fetch_assoc($request))
470
-			$members[$row['id_member_started']] = $row['hits'];
498
+		{
499
+					$members[$row['id_member_started']] = $row['hits'];
500
+		}
471 501
 		$db->free_result($request);
472 502
 
473 503
 		Cache::instance()->put('stats_top_starters', $members, 360);
474 504
 	}
475 505
 
476 506
 	if (empty($members))
477
-		$members = array(0 => 0);
507
+	{
508
+			$members = array(0 => 0);
509
+	}
478 510
 
479 511
 	// Find the top starters of topics
480 512
 	$members_result = $db->query('top_topic_starters', '
@@ -503,7 +535,9 @@  discard block
 block discarded – undo
503 535
 		);
504 536
 
505 537
 		if ($max_num_topics < $members[$row_members['id_member']])
506
-			$max_num_topics = $members[$row_members['id_member']];
538
+		{
539
+					$max_num_topics = $members[$row_members['id_member']];
540
+		}
507 541
 	}
508 542
 	$db->free_result($members_result);
509 543
 
@@ -554,7 +588,9 @@  discard block
 block discarded – undo
554 588
 	{
555 589
 		$temp2[] = (int) $row_members['id_member'];
556 590
 		if (count($top_time_online) >= $max_members)
557
-			continue;
591
+		{
592
+					continue;
593
+		}
558 594
 
559 595
 		// Figure out the days, hours and minutes.
560 596
 		$timeDays = floor($row_members['total_time_logged_in'] / 86400);
@@ -563,10 +599,14 @@  discard block
 block discarded – undo
563 599
 		// Figure out which things to show... (days, hours, minutes, etc.)
564 600
 		$timelogged = '';
565 601
 		if ($timeDays > 0)
566
-			$timelogged .= $timeDays . $txt['totalTimeLogged5'];
602
+		{
603
+					$timelogged .= $timeDays . $txt['totalTimeLogged5'];
604
+		}
567 605
 
568 606
 		if ($timeHours > 0)
569
-			$timelogged .= $timeHours . $txt['totalTimeLogged6'];
607
+		{
608
+					$timelogged .= $timeHours . $txt['totalTimeLogged6'];
609
+		}
570 610
 
571 611
 		$timelogged .= floor(($row_members['total_time_logged_in'] % 3600) / 60) . $txt['totalTimeLogged7'];
572 612
 
@@ -581,17 +621,23 @@  discard block
 block discarded – undo
581 621
 		);
582 622
 
583 623
 		if ($max_time_online < $row_members['total_time_logged_in'])
584
-			$max_time_online = $row_members['total_time_logged_in'];
624
+		{
625
+					$max_time_online = $row_members['total_time_logged_in'];
626
+		}
585 627
 	}
586 628
 	$db->free_result($members_result);
587 629
 
588 630
 	// As always percentages are next
589 631
 	foreach ($top_time_online as $i => $member)
590
-		$top_time_online[$i]['time_percent'] = round(($member['seconds_online'] * 100) / $max_time_online);
632
+	{
633
+			$top_time_online[$i]['time_percent'] = round(($member['seconds_online'] * 100) / $max_time_online);
634
+	}
591 635
 
592 636
 	// Cache the ones we found for a bit, just so we don't have to look again.
593 637
 	if ($temp !== $temp2)
594
-		Cache::instance()->put('stats_total_time_members', $temp2, 600);
638
+	{
639
+			Cache::instance()->put('stats_total_time_members', $temp2, 600);
640
+	}
595 641
 
596 642
 	return $top_time_online;
597 643
 }
@@ -621,7 +667,8 @@  discard block
 block discarded – undo
621 667
 		$expanded = !empty($_SESSION['expanded_stats'][$row_months['stats_year']]) && in_array($row_months['stats_month'], $_SESSION['expanded_stats'][$row_months['stats_year']]);
622 668
 
623 669
 		if (!isset($context['yearly'][$row_months['stats_year']]))
624
-			$context['yearly'][$row_months['stats_year']] = array(
670
+		{
671
+					$context['yearly'][$row_months['stats_year']] = array(
625 672
 				'year' => $row_months['stats_year'],
626 673
 				'new_topics' => 0,
627 674
 				'new_posts' => 0,
@@ -633,6 +680,7 @@  discard block
 block discarded – undo
633 680
 				'expanded' => false,
634 681
 				'current_year' => $row_months['stats_year'] == date('Y'),
635 682
 			);
683
+		}
636 684
 
637 685
 		$context['yearly'][$row_months['stats_year']]['months'][(int) $row_months['stats_month']] = array(
638 686
 			'id' => $id_month,
@@ -689,7 +737,8 @@  discard block
 block discarded – undo
689 737
 		$condition_parameters
690 738
 	);
691 739
 	while ($row_days = $db->fetch_assoc($days_result))
692
-		$context['yearly'][$row_days['stats_year']]['months'][(int) $row_days['stats_month']]['days'][] = array(
740
+	{
741
+			$context['yearly'][$row_days['stats_year']]['months'][(int) $row_days['stats_month']]['days'][] = array(
693 742
 			'day' => sprintf('%02d', $row_days['stats_day']),
694 743
 			'month' => sprintf('%02d', $row_days['stats_month']),
695 744
 			'year' => $row_days['stats_year'],
@@ -699,6 +748,7 @@  discard block
 block discarded – undo
699 748
 			'most_members_online' => comma_format($row_days['most_on']),
700 749
 			'hits' => comma_format($row_days['hits'])
701 750
 		);
751
+	}
702 752
 	$db->free_result($days_result);
703 753
 }
704 754
 
@@ -948,7 +998,8 @@  discard block
 block discarded – undo
948 998
 		for ($hour = 0; $hour < 24; $hour++)
949 999
 		{
950 1000
 			if (!isset($posts_by_time[$hour]))
951
-				$posts_by_time[$hour] = array(
1001
+			{
1002
+							$posts_by_time[$hour] = array(
952 1003
 					'hour' => $hour,
953 1004
 					'hour_format' => stripos($user_info['time_format'], '%p') === false ? $hour : date('g a', mktime($hour)),
954 1005
 					'posts' => 0,
@@ -956,6 +1007,7 @@  discard block
 block discarded – undo
956 1007
 					'relative_percent' => 0,
957 1008
 					'is_last' => $hour == 23,
958 1009
 				);
1010
+			}
959 1011
 			else
960 1012
 			{
961 1013
 				$posts_by_time[$hour]['posts_percent'] = round(($posts_by_time[$hour]['posts'] * 100) / $realPosts);
Please login to merge, or discard this patch.
sources/controllers/Recent.controller.php 2 patches
Braces   +27 added lines, -10 removed lines patch added patch discarded remove patch
@@ -187,19 +187,28 @@  discard block
 block discarded – undo
187 187
 
188 188
 		// Recent posts by category id's
189 189
 		if (!empty($this->_req->query->c) && empty($board))
190
-			$categories = $this->_recentPostsCategory();
190
+		{
191
+					$categories = $this->_recentPostsCategory();
192
+		}
191 193
 		// Or recent posts by board id's?
192 194
 		elseif (!empty($this->_req->query->boards))
193
-			$this->_recentPostsBoards();
195
+		{
196
+					$this->_recentPostsBoards();
197
+		}
194 198
 		// Or just the recent posts for a specific board
195 199
 		elseif (!empty($board))
196
-			$this->_recentPostsBoard();
200
+		{
201
+					$this->_recentPostsBoard();
202
+		}
197 203
 		// All the recent posts across boards and categories it is then
198
-		else
199
-			$this->_recentPostsAll();
204
+		else {
205
+					$this->_recentPostsAll();
206
+		}
200 207
 
201 208
 		if (!empty($this->_maxMsgID))
202
-			$this->_grabber->setEarliestMsg(max(0, $modSettings['maxMsgID'] - $this->_maxMsgID[0] - $this->_start * $this->_maxMsgID[1]));
209
+		{
210
+					$this->_grabber->setEarliestMsg(max(0, $modSettings['maxMsgID'] - $this->_maxMsgID[0] - $this->_start * $this->_maxMsgID[1]));
211
+		}
203 212
 
204 213
 		// Set up the pageindex
205 214
 		$context['page_index'] = constructPageIndex($this->_base_url, $this->_start, min(100, $this->_total_posts), $this->_num_per_page, !empty($this->_flex_start));
@@ -335,7 +344,9 @@  discard block
 block discarded – undo
335 344
 			$name = categoryName($categories[0]);
336 345
 
337 346
 			if (empty($name))
338
-				throw new Elk_Exception('no_access', false);
347
+			{
348
+							throw new Elk_Exception('no_access', false);
349
+			}
339 350
 
340 351
 			$context['linktree'][] = array(
341 352
 				'url' => $scripturl . $modSettings['default_forum_action'] . '#c' . $categories[0],
@@ -349,14 +360,18 @@  discard block
 block discarded – undo
349 360
 		$boards = array_keys($boards_posts);
350 361
 
351 362
 		if (empty($boards))
352
-			throw new Elk_Exception('error_no_boards_selected');
363
+		{
364
+					throw new Elk_Exception('error_no_boards_selected');
365
+		}
353 366
 
354 367
 		// The query for getting the messages
355 368
 		$this->_grabber->setBoards($boards);
356 369
 
357 370
 		// If this category has a significant number of posts in it...
358 371
 		if ($this->_total_posts > 100 && $this->_total_posts > $modSettings['totalMessages'] / 15)
359
-			$this->_maxMsgID = array(400, 7);
372
+		{
373
+					$this->_maxMsgID = array(400, 7);
374
+		}
360 375
 
361 376
 		$this->_base_url = $scripturl . '?action=recent;c=' . implode(',', $categories);
362 377
 
@@ -409,7 +424,9 @@  discard block
 block discarded – undo
409 424
 
410 425
 		// If this board has a significant number of posts in it...
411 426
 		if ($this->_total_posts > 80 && $this->_total_posts > $modSettings['totalMessages'] / $this->_num_per_page)
412
-			$this->_maxMsgID = array(600, 10);
427
+		{
428
+					$this->_maxMsgID = array(600, 10);
429
+		}
413 430
 
414 431
 		$this->_base_url = $scripturl . '?action=recent;board=' . $board . '.%1$d';
415 432
 		$this->_flex_start = true;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -445,7 +445,7 @@
 block discarded – undo
445 445
 		if (!empty($modSettings['likes_enabled']))
446 446
 		{
447 447
 			// Just the message id please
448
-			$messages = array_map(function ($element) {
448
+			$messages = array_map(function($element) {
449 449
 				return (int) $element['id'];
450 450
 			}, $messages);
451 451
 
Please login to merge, or discard this patch.
sources/controllers/Karma.controller.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -76,7 +76,9 @@  discard block
 block discarded – undo
76 76
 
77 77
 		// Sometimes the community needs to chill
78 78
 		if (!empty($modSettings['karmaDisableSmite']))
79
-			$this->_redirect_karma();
79
+		{
80
+					$this->_redirect_karma();
81
+		}
80 82
 
81 83
 		// The user ID _must_ be a number, no matter what.
82 84
 		$id_target = $this->_req->getQuery('uid', 'intval', 0);
@@ -105,12 +107,16 @@  discard block
 block discarded – undo
105 107
 
106 108
 		// They haven't, not before now, anyhow.
107 109
 		if (empty($action) || empty($modSettings['karmaWaitTime']))
108
-			addKarma($id_executor, $id_target, $dir);
110
+		{
111
+					addKarma($id_executor, $id_target, $dir);
112
+		}
109 113
 		else
110 114
 		{
111 115
 			// If you are gonna try to repeat.... don't allow it.
112 116
 			if ($action == $dir)
113
-				throw new Elk_Exception('karma_wait_time', false, array($modSettings['karmaWaitTime'], ($modSettings['karmaWaitTime'] == 1 ? strtolower($txt['hour']) : $txt['hours'])));
117
+			{
118
+							throw new Elk_Exception('karma_wait_time', false, array($modSettings['karmaWaitTime'], ($modSettings['karmaWaitTime'] == 1 ? strtolower($txt['hour']) : $txt['hours'])));
119
+			}
114 120
 
115 121
 			updateKarma($id_executor, $id_target, $dir);
116 122
 		}
@@ -130,7 +136,9 @@  discard block
 block discarded – undo
130 136
 
131 137
 		// If the mod is disabled, show an error.
132 138
 		if (empty($modSettings['karmaMode']))
133
-			throw new Elk_Exception('feature_disabled', true);
139
+		{
140
+					throw new Elk_Exception('feature_disabled', true);
141
+		}
134 142
 
135 143
 		// If you're a guest or can't do this, blow you off...
136 144
 		is_not_guest();
@@ -145,11 +153,15 @@  discard block
 block discarded – undo
145 153
 		// @todo Should this be dropped in favor of post group permissions?
146 154
 		// Should this apply to the member you are smiting/applauding?
147 155
 		if (!$user_info['is_admin'] && $user_info['posts'] < $modSettings['karmaMinPosts'])
148
-			throw new Elk_Exception('not_enough_posts_karma', true, array($modSettings['karmaMinPosts']));
156
+		{
157
+					throw new Elk_Exception('not_enough_posts_karma', true, array($modSettings['karmaMinPosts']));
158
+		}
149 159
 
150 160
 		// And you can't modify your own, punk! (use the profile if you need to.)
151 161
 		if (empty($id_target) || $id_target == $user_info['id'])
152
-			throw new Elk_Exception('cant_change_own_karma', false);
162
+		{
163
+					throw new Elk_Exception('cant_change_own_karma', false);
164
+		}
153 165
 
154 166
 		// Delete any older items from the log so we can get the go ahead or not
155 167
 		clearKarma($modSettings['karmaWaitTime']);
@@ -175,10 +187,14 @@  discard block
 block discarded – undo
175 187
 
176 188
 		// Figure out where to go back to.... the topic?
177 189
 		if (!empty($topic))
178
-			redirectexit('topic=' . $topic . '.' . $this->_req->start . '#msg' . $this->_req->get('m', 'intval'));
190
+		{
191
+					redirectexit('topic=' . $topic . '.' . $this->_req->start . '#msg' . $this->_req->get('m', 'intval'));
192
+		}
179 193
 		// Hrm... maybe a personal message?
180 194
 		elseif (isset($_REQUEST['f']))
181
-			redirectexit('action=pm;f=' . $_REQUEST['f'] . ';start=' . $this->_req->start . (isset($_REQUEST['l']) ? ';l=' . $this->_req->get('l', 'intval') : '') . (isset($_REQUEST['pm']) ? '#' . $this->_req->get('pm', 'intval') : ''));
195
+		{
196
+					redirectexit('action=pm;f=' . $_REQUEST['f'] . ';start=' . $this->_req->start . (isset($_REQUEST['l']) ? ';l=' . $this->_req->get('l', 'intval') : '') . (isset($_REQUEST['pm']) ? '#' . $this->_req->get('pm', 'intval') : ''));
197
+		}
182 198
 		// JavaScript as a last resort.
183 199
 		else
184 200
 		{
Please login to merge, or discard this patch.
sources/controllers/Xml.controller.php 1 patch
Braces   +90 added lines, -39 removed lines patch added patch discarded remove patch
@@ -54,7 +54,9 @@  discard block
 block discarded – undo
54 54
 
55 55
 		// Act a bit special for XML, probably never see it anyway :P
56 56
 		if (empty($subAction))
57
-			throw new Elk_Exception('no_access', false);
57
+		{
58
+					throw new Elk_Exception('no_access', false);
59
+		}
58 60
 
59 61
 		// Off we go then, (it will check permissions)
60 62
 		$action->dispatch($subAction);
@@ -118,7 +120,9 @@  discard block
 block discarded – undo
118 120
 		foreach ($files as $file)
119 121
 		{
120 122
 			if ($file->getFilename() === 'blank.png')
121
-				continue;
123
+			{
124
+							continue;
125
+			}
122 126
 
123 127
 			if (in_array(strtolower($file->getExtension()), $allowedTypes))
124 128
 			{
@@ -191,16 +195,19 @@  discard block
 block discarded – undo
191 195
 						),
192 196
 					);
193 197
 				}
194
-				else
195
-					$errors[] = array('value' => $txt['feature_no_exists']);
198
+				else {
199
+									$errors[] = array('value' => $txt['feature_no_exists']);
200
+				}
196 201
 			}
197 202
 			// Some problem loading in the core feature set
198
-			else
199
-				$errors[] = array('value' => $txt[$result]);
203
+			else {
204
+							$errors[] = array('value' => $txt[$result]);
205
+			}
200 206
 		}
201 207
 		// Failed session validation I'm afraid
202
-		else
203
-			$errors[] = array('value' => isset($txt[$validation]) ? $txt[$validation] : $txt['error_occurred']);
208
+		else {
209
+					$errors[] = array('value' => isset($txt[$validation]) ? $txt[$validation] : $txt['error_occurred']);
210
+		}
204 211
 
205 212
 		// Return the response to the calling program
206 213
 		$context['sub_template'] = 'generic_xml';
@@ -268,9 +275,12 @@  discard block
 block discarded – undo
268 275
 
269 276
 				// With the replace set
270 277
 				if (!empty($replace))
271
-					updateProfileFieldOrder($replace);
272
-				else
273
-					$errors[] = array('value' => $txt['no_sortable_items']);
278
+				{
279
+									updateProfileFieldOrder($replace);
280
+				}
281
+				else {
282
+									$errors[] = array('value' => $txt['no_sortable_items']);
283
+				}
274 284
 			}
275 285
 
276 286
 			$order[] = array(
@@ -281,10 +291,14 @@  discard block
 block discarded – undo
281 291
 		else
282 292
 		{
283 293
 			if ($validation_session !== true)
284
-				$errors[] = array('value' => $txt['session_verify_fail']);
294
+			{
295
+							$errors[] = array('value' => $txt['session_verify_fail']);
296
+			}
285 297
 
286 298
 			if ($validation_token === false)
287
-				$errors[] = array('value' => $txt['token_verify_fail']);
299
+			{
300
+							$errors[] = array('value' => $txt['token_verify_fail']);
301
+			}
288 302
 		}
289 303
 
290 304
 		// New generic token for use
@@ -360,7 +374,9 @@  discard block
 block discarded – undo
360 374
 					list ($category, $board, $childof) = explode(',', $id);
361 375
 
362 376
 					if ($board == -1)
363
-						continue;
377
+					{
378
+											continue;
379
+					}
364 380
 
365 381
 					$board_tree[] = array(
366 382
 						'category' => $category,
@@ -371,7 +387,9 @@  discard block
 block discarded – undo
371 387
 
372 388
 					// Keep track of where the moved board is in the sort stack
373 389
 					if ($board == $board_moved)
374
-						$moved_key = $list_order;
390
+					{
391
+											$moved_key = $list_order;
392
+					}
375 393
 
376 394
 					$list_order++;
377 395
 				}
@@ -391,11 +409,14 @@  discard block
 block discarded – undo
391 409
 						}
392 410
 						// Don't go to another parent tree
393 411
 						elseif ($board_tree[$i]['parent'] == 0)
394
-							break;
412
+						{
413
+													break;
414
+						}
395 415
 					}
396 416
 					// Don't go to another category
397
-					else
398
-						break;
417
+					else {
418
+											break;
419
+					}
399 420
 				}
400 421
 
401 422
 				// Retrieve the current saved state, returned in global $boards
@@ -436,19 +457,26 @@  discard block
 block discarded – undo
436 457
 
437 458
 				// If we have figured out what to do
438 459
 				if (!empty($boardOptions))
439
-					modifyBoard($board_moved, $boardOptions);
440
-				else
441
-					$errors[] = array('value' => $txt['mboards_board_error']);
460
+				{
461
+									modifyBoard($board_moved, $boardOptions);
462
+				}
463
+				else {
464
+									$errors[] = array('value' => $txt['mboards_board_error']);
465
+				}
442 466
 			}
443 467
 		}
444 468
 		// Failed validation, extra work for you I'm afraid
445 469
 		else
446 470
 		{
447 471
 			if ($validation_session !== true)
448
-				$errors[] = array('value' => $txt['session_verify_fail']);
472
+			{
473
+							$errors[] = array('value' => $txt['session_verify_fail']);
474
+			}
449 475
 
450 476
 			if ($validation_token === false)
451
-				$errors[] = array('value' => $txt['token_verify_fail']);
477
+			{
478
+							$errors[] = array('value' => $txt['token_verify_fail']);
479
+			}
452 480
 		}
453 481
 
454 482
 		// New generic token for use
@@ -545,7 +573,9 @@  discard block
 block discarded – undo
545 573
 
546 574
 						// Keep track of where the moved smiley is in the sort stack
547 575
 						if ($smile_id == $smile_moved)
548
-							$moved_key = $list_order;
576
+						{
577
+													$moved_key = $list_order;
578
+						}
549 579
 
550 580
 						$list_order++;
551 581
 					}
@@ -561,7 +591,9 @@  discard block
 block discarded – undo
561 591
 					{
562 592
 						$possible_after = getSmiley($smiley_tree[$moved_key - 1]);
563 593
 						if ($possible_after['row'] == $smiley['row'] && $possible_after['location'] == $smiley['location'])
564
-							$smiley = getSmileyPosition($smiley['location'], $smiley_tree[$moved_key - 1]);
594
+						{
595
+													$smiley = getSmileyPosition($smiley['location'], $smiley_tree[$moved_key - 1]);
596
+						}
565 597
 					}
566 598
 
567 599
 					// Empty means getSmileyPosition failed and so do we
@@ -586,8 +618,10 @@  discard block
 block discarded – undo
586 618
 
587 619
 								// Make sure the smiley order is always sequential.
588 620
 								foreach ($smiley_row as $order_id => $smiley)
589
-									if ($order_id != $smiley['order'])
621
+								{
622
+																	if ($order_id != $smiley['order'])
590 623
 										updateSmileyOrder($smiley['id'], $order_id);
624
+								}
591 625
 							}
592 626
 						}
593 627
 
@@ -598,17 +632,22 @@  discard block
 block discarded – undo
598 632
 					}
599 633
 				}
600 634
 			}
601
-			else
602
-				$errors[] = array('value' => $txt['smileys_moved_fail']);
635
+			else {
636
+							$errors[] = array('value' => $txt['smileys_moved_fail']);
637
+			}
603 638
 		}
604 639
 		// Failed validation :'(
605 640
 		else
606 641
 		{
607 642
 			if ($validation_session !== true)
608
-				$errors[] = array('value' => $txt['session_verify_fail']);
643
+			{
644
+							$errors[] = array('value' => $txt['session_verify_fail']);
645
+			}
609 646
 
610 647
 			if ($validation_token === false)
611
-				$errors[] = array('value' => $txt['token_verify_fail']);
648
+			{
649
+							$errors[] = array('value' => $txt['token_verify_fail']);
650
+			}
612 651
 		}
613 652
 
614 653
 		// New generic token for use
@@ -682,9 +721,12 @@  discard block
 block discarded – undo
682 721
 
683 722
 				// With the replace set
684 723
 				if (!empty($replace))
685
-					updateParserFilterOrder($replace, $filters);
686
-				else
687
-					$errors[] = array('value' => $txt['no_sortable_items']);
724
+				{
725
+									updateParserFilterOrder($replace, $filters);
726
+				}
727
+				else {
728
+									$errors[] = array('value' => $txt['no_sortable_items']);
729
+				}
688 730
 			}
689 731
 
690 732
 			$order[] = array(
@@ -695,10 +737,14 @@  discard block
 block discarded – undo
695 737
 		else
696 738
 		{
697 739
 			if ($validation_session !== true)
698
-				$errors[] = array('value' => $txt['session_verify_fail']);
740
+			{
741
+							$errors[] = array('value' => $txt['session_verify_fail']);
742
+			}
699 743
 
700 744
 			if ($validation_token === false)
701
-				$errors[] = array('value' => $txt['token_verify_fail']);
745
+			{
746
+							$errors[] = array('value' => $txt['token_verify_fail']);
747
+			}
702 748
 		}
703 749
 
704 750
 		// New generic token for use
@@ -777,8 +823,9 @@  discard block
 block discarded – undo
777 823
 					updateMessageIcon($iconInsert);
778 824
 					sortMessageIconTable();
779 825
 				}
780
-				else
781
-					$errors[] = array('value' => $txt['no_sortable_items']);
826
+				else {
827
+									$errors[] = array('value' => $txt['no_sortable_items']);
828
+				}
782 829
 			}
783 830
 
784 831
 			$order[] = array(
@@ -789,10 +836,14 @@  discard block
 block discarded – undo
789 836
 		else
790 837
 		{
791 838
 			if ($validation_session !== true)
792
-				$errors[] = array('value' => $txt['session_verify_fail']);
839
+			{
840
+							$errors[] = array('value' => $txt['session_verify_fail']);
841
+			}
793 842
 
794 843
 			if ($validation_token === false)
795
-				$errors[] = array('value' => $txt['token_verify_fail']);
844
+			{
845
+							$errors[] = array('value' => $txt['token_verify_fail']);
846
+			}
796 847
 		}
797 848
 
798 849
 		// New generic token for use
Please login to merge, or discard this patch.