Completed
Push — master ( 477aa2...0a4bb5 )
by Angus
06:22
created
public/index.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -210,10 +210,10 @@
 block discarded – undo
210 210
 {
211 211
 	// Ensure there's a trailing slash
212 212
 	$system_path = strtr(
213
-		               rtrim($system_path, '/\\'),
214
-		               '/\\',
215
-		               DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
216
-	               ).DIRECTORY_SEPARATOR;
213
+					   rtrim($system_path, '/\\'),
214
+					   '/\\',
215
+					   DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
216
+				   ).DIRECTORY_SEPARATOR;
217 217
 }
218 218
 
219 219
 // Is the system path correct?
Please login to merge, or discard this patch.
Braces   +18 added lines, -45 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
  * Different environments will require different levels of error reporting.
64 64
  * By default development will show errors but testing and live will hide them.
65 65
  */
66
-switch (ENVIRONMENT)
67
-{
66
+switch (ENVIRONMENT) {
68 67
 	case 'development':
69 68
 		error_reporting(-1);
70 69
 		ini_set('display_errors', 1);
@@ -79,12 +78,9 @@  discard block
 block discarded – undo
79 78
 	case 'testing':
80 79
 	case 'production':
81 80
 		ini_set('display_errors', 0);
82
-		if (version_compare(PHP_VERSION, '5.3', '>='))
83
-		{
81
+		if (version_compare(PHP_VERSION, '5.3', '>=')) {
84 82
 			error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
85
-		}
86
-		else
87
-		{
83
+		} else {
88 84
 			error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
89 85
 		}
90 86
 		break;
@@ -197,17 +193,13 @@  discard block
 block discarded – undo
197 193
  */
198 194
 
199 195
 // Set the current directory correctly for CLI requests
200
-if (defined('STDIN'))
201
-{
196
+if (defined('STDIN')) {
202 197
 	chdir(dirname(__FILE__));
203 198
 }
204 199
 
205
-if (($_temp = realpath($system_path)) !== FALSE)
206
-{
200
+if (($_temp = realpath($system_path)) !== FALSE) {
207 201
 	$system_path = $_temp.DIRECTORY_SEPARATOR;
208
-}
209
-else
210
-{
202
+} else {
211 203
 	// Ensure there's a trailing slash
212 204
 	$system_path = strtr(
213 205
 		               rtrim($system_path, '/\\'),
@@ -217,8 +209,7 @@  discard block
 block discarded – undo
217 209
 }
218 210
 
219 211
 // Is the system path correct?
220
-if ( ! is_dir($system_path))
221
-{
212
+if ( ! is_dir($system_path)) {
222 213
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
223 214
 	echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
224 215
 	exit(3); // EXIT_CONFIG
@@ -242,31 +233,23 @@  discard block
 block discarded – undo
242 233
 define('SYSDIR', basename(BASEPATH));
243 234
 
244 235
 // The path to the "application" directory
245
-if (is_dir($application_folder))
246
-{
247
-	if (($_temp = realpath($application_folder)) !== FALSE)
248
-	{
236
+if (is_dir($application_folder)) {
237
+	if (($_temp = realpath($application_folder)) !== FALSE) {
249 238
 		$application_folder = $_temp;
250
-	}
251
-	else
252
-	{
239
+	} else {
253 240
 		$application_folder = strtr(
254 241
 			rtrim($application_folder, '/\\'),
255 242
 			'/\\',
256 243
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
257 244
 		);
258 245
 	}
259
-}
260
-elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
261
-{
246
+} elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) {
262 247
 	$application_folder = BASEPATH.strtr(
263 248
 			trim($application_folder, '/\\'),
264 249
 			'/\\',
265 250
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
266 251
 		);
267
-}
268
-else
269
-{
252
+} else {
270 253
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
271 254
 	echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
272 255
 	exit(3); // EXIT_CONFIG
@@ -275,35 +258,25 @@  discard block
 block discarded – undo
275 258
 define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
276 259
 
277 260
 // The path to the "views" directory
278
-if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
279
-{
261
+if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) {
280 262
 	$view_folder = APPPATH.'views';
281
-}
282
-elseif (is_dir($view_folder))
283
-{
284
-	if (($_temp = realpath($view_folder)) !== FALSE)
285
-	{
263
+} elseif (is_dir($view_folder)) {
264
+	if (($_temp = realpath($view_folder)) !== FALSE) {
286 265
 		$view_folder = $_temp;
287
-	}
288
-	else
289
-	{
266
+	} else {
290 267
 		$view_folder = strtr(
291 268
 			rtrim($view_folder, '/\\'),
292 269
 			'/\\',
293 270
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
294 271
 		);
295 272
 	}
296
-}
297
-elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
298
-{
273
+} elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) {
299 274
 	$view_folder = APPPATH.strtr(
300 275
 			trim($view_folder, '/\\'),
301 276
 			'/\\',
302 277
 			DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
303 278
 		);
304
-}
305
-else
306
-{
279
+} else {
307 280
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
308 281
 	echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
309 282
 	exit(3); // EXIT_CONFIG
Please login to merge, or discard this patch.
application/core/MY_Controller.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 	protected $footer_data = array();
7 7
 	public    $global_data = array();
8 8
 
9
-	public function __construct(){
9
+	public function __construct() {
10 10
 		parent::__construct();
11 11
 
12 12
 		//FIXME: This is pretty much a phpUnit hack. Without it phpUnit fails here. We need a proper way to fake user/admin testing.
@@ -80,7 +80,9 @@  discard block
 block discarded – undo
80 80
 	public function __construct() {
81 81
 		parent::__construct();
82 82
 
83
-		if($this->ion_auth->logged_in()) redirect('/');
83
+		if($this->ion_auth->logged_in()) {
84
+			redirect('/');
85
+		}
84 86
 	}
85 87
 }
86 88
 
Please login to merge, or discard this patch.
application/models/User_Model.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 			if($query->num_rows() > 0) {
72 72
 				//username exists, grab email
73 73
 				$email = $query->row('email');
74
-			}else{
74
+			} else {
75 75
 				//username doesn't exist, return FALSE
76 76
 				$email = FALSE;
77 77
 			}
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 		$this->load->database();
46 46
 
47 47
 		$query = $this->db->select('*')
48
-		                  ->from('auth_users')
49
-		                  ->where('username', $username)
50
-		                  ->get();
48
+						  ->from('auth_users')
49
+						  ->where('username', $username)
50
+						  ->get();
51 51
 
52 52
 		return (bool) $query->num_rows();
53 53
 	}
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 			$this->load->database();
70 70
 
71 71
 			$query = $this->db->select('email')
72
-			                  ->from('auth_users')
73
-			                  ->where('username', $identity)
74
-			                  ->get();
72
+							  ->from('auth_users')
73
+							  ->where('username', $identity)
74
+							  ->get();
75 75
 
76 76
 			if($query->num_rows() > 0) {
77 77
 				//username exists, grab email
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 		$user = NULL;
90 90
 
91 91
 		$query = $this->db->select('*')
92
-		                  ->from('auth_users')
93
-		                  ->where('username', $username)
94
-		                  ->get();
92
+						  ->from('auth_users')
93
+						  ->where('username', $username)
94
+						  ->get();
95 95
 
96 96
 		if($query->num_rows() > 0) {
97 97
 			$user = $query->row();
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 		$api_key = NULL;
121 121
 		if($this->logged_in()) {
122 122
 			$this->db->select('api_key')
123
-			         ->where('id', $this->User->id)
124
-			         ->get('auth_users');
123
+					 ->where('id', $this->User->id)
124
+					 ->get('auth_users');
125 125
 
126 126
 			$query = $this->db->select('api_key')
127
-			                  ->where('id', $this->User->id)
128
-			                  ->get('auth_users');
127
+							  ->where('id', $this->User->id)
128
+							  ->get('auth_users');
129 129
 
130 130
 			if($query->num_rows() > 0) {
131 131
 				$api_key = $query->row('api_key');
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
 	
138 138
 	public function get_id_from_api_key(string $api_key) {
139 139
 		$query = $this->db->select('id')
140
-		                  ->from('auth_users')
141
-		                  ->where('api_key', $api_key)
142
-		                  ->get();
140
+						  ->from('auth_users')
141
+						  ->where('api_key', $api_key)
142
+						  ->get();
143 143
 
144 144
 		if($query->num_rows() > 0) {
145 145
 			$userID = $query->row('id');
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
 	}
202 202
 	public function hideLatestNotice() {
203 203
 		$idQuery = $this->db->select('1')
204
-		                    ->where('user_id', $this->User->id)
205
-		                    ->get('tracker_user_notices');
204
+							->where('user_id', $this->User->id)
205
+							->get('tracker_user_notices');
206 206
 		if($idQuery->num_rows() > 0) {
207 207
 			$success = (bool) $this->db->set('hidden_notice_id', '(SELECT id FROM tracker_notices ORDER BY id DESC LIMIT 1)', FALSE)
208
-			                           ->where('user_id', $this->User->id)
209
-			                           ->update('tracker_user_notices');
208
+									   ->where('user_id', $this->User->id)
209
+									   ->update('tracker_user_notices');
210 210
 		} else {
211 211
 			$success = (bool) $this->db->insert('tracker_user_notices', [
212 212
 				'user_id'           => $this->User->id,
Please login to merge, or discard this patch.
application/models/User_Options_Model.php 2 patches
Braces   +10 added lines, -3 removed lines patch added patch discarded remove patch
@@ -137,7 +137,9 @@  discard block
 block discarded – undo
137 137
 				}
138 138
 
139 139
 				$success = $this->set_db($idData, $valueData);
140
-				if($success) $this->session->unset_tempdata("option_{$option}");
140
+				if($success) {
141
+					$this->session->unset_tempdata("option_{$option}");
142
+				}
141 143
 			} else {
142 144
 				$success = FALSE;
143 145
 			}
@@ -164,7 +166,9 @@  discard block
 block discarded – undo
164 166
 			}
165 167
 
166 168
 			//Overall fallback method.
167
-			if(!isset($value)) $value = $this->options[$option]['default'];
169
+			if(!isset($value)) {
170
+				$value = $this->options[$option]['default'];
171
+			}
168 172
 		} else {
169 173
 			$value = FALSE;
170 174
 		}
@@ -215,7 +219,10 @@  discard block
 block discarded – undo
215 219
 				//This should never happen.
216 220
 				break;
217 221
 		}
218
-		if(!isset($value)) $value = FALSE; //FIXME: This won't play nice with BOOL type false?
222
+		if(!isset($value)) {
223
+			$value = FALSE;
224
+		}
225
+		//FIXME: This won't play nice with BOOL type false?
219 226
 
220 227
 		return $value;
221 228
 	}
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -188,18 +188,18 @@
 block discarded – undo
188 188
 		//FIXME: Query duplication.
189 189
 		if($this->User->id !== $userID) {
190 190
 			$query = $this->db->select('value_str, value_int')
191
-			                  ->from('user_options')
192
-			                  ->where('user_id', $userID)
193
-			                  ->where('name',    $option)
194
-			                  ->limit(1);
191
+							  ->from('user_options')
192
+							  ->where('user_id', $userID)
193
+							  ->where('name',    $option)
194
+							  ->limit(1);
195 195
 			$data = $query->get()->row_array();
196 196
 		} else {
197 197
 			if(!($data = $this->session->tempdata("option_{$option}"))) {
198 198
 				$query = $this->db->select('value_str, value_int')
199
-				                  ->from('user_options')
200
-				                  ->where('user_id', $userID)
201
-				                  ->where('name',    $option)
202
-				                  ->limit(1);
199
+								  ->from('user_options')
200
+								  ->where('user_id', $userID)
201
+								  ->where('name',    $option)
202
+								  ->limit(1);
203 203
 				$data = $query->get()->row_array();
204 204
 				$this->session->set_tempdata("option_{$option}", $data, 3600);
205 205
 			}
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Tag_Model.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 		$success = FALSE;
10 10
 		if(preg_match("/^[a-z0-9\\-_,:]{0,255}$/", $tag_string)) {
11 11
 			$success = (bool) $this->db->set(['tags' => $tag_string, 'active' => 'Y', 'last_updated' => NULL])
12
-			                           ->where('user_id', $userID)
13
-			                           ->where('id', $chapterID)
14
-			                           ->update('tracker_chapters');
12
+									   ->where('user_id', $userID)
13
+									   ->where('id', $chapterID)
14
+									   ->update('tracker_chapters');
15 15
 		}
16 16
 
17 17
 		if($success) {
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Title_Model.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,9 +35,13 @@
 block discarded – undo
35 35
 			$titleID = $id;
36 36
 		} else {
37 37
 			//TODO: Check if title is valid URL!
38
-			if($create) $titleID = $this->addTitle($titleURL, $siteID);
38
+			if($create) {
39
+				$titleID = $this->addTitle($titleURL, $siteID);
40
+			}
41
+		}
42
+		if(!isset($titleID) || !$titleID) {
43
+			$titleID = 0;
39 44
 		}
40
-		if(!isset($titleID) || !$titleID) $titleID = 0;
41 45
 
42 46
 		return ($returnData && $titleID !== 0 ? $query->row_array() : $titleID);
43 47
 	}
Please login to merge, or discard this patch.
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	public function getID(string $titleURL, int $siteID, bool $create = TRUE, bool $returnData = FALSE) {
19 19
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title, tracker_titles.title_url, tracker_titles.latest_chapter, tracker_titles.status, tracker_sites.site_class, (tracker_titles.last_checked > DATE_SUB(NOW(), INTERVAL 3 DAY)) AS active', FALSE)
20
-		                  ->from('tracker_titles')
21
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
22
-		                  ->where('tracker_titles.title_url', $titleURL)
23
-		                  ->where('tracker_titles.site_id', $siteID)
24
-		                  ->get();
20
+						  ->from('tracker_titles')
21
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
22
+						  ->where('tracker_titles.title_url', $titleURL)
23
+						  ->where('tracker_titles.site_id', $siteID)
24
+						  ->get();
25 25
 
26 26
 		if($query->num_rows() > 0) {
27 27
 			$id = (int) $query->row('id');
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 						//Make sure last_checked is always updated on successful run.
36 36
 						//CHECK: Is there a reason we aren't just doing this in updateTitleById?
37 37
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
38
-						         ->where('id', $id)
39
-						         ->update('tracker_titles');
38
+								 ->where('id', $id)
39
+								 ->update('tracker_titles');
40 40
 					}
41 41
 				} else {
42 42
 					log_message('error', "{$siteClass} | {$query->row('title')} ({$query->row('title_url')}) | Failed to update.");
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	private function addTitle(string $titleURL, int $siteID) : int {
78 78
 		$query = $this->db->select('site, site_class')
79
-		                  ->from('tracker_sites')
80
-		                  ->where('id', $siteID)
81
-		                  ->get();
79
+						  ->from('tracker_sites')
80
+						  ->where('id', $siteID)
81
+						  ->get();
82 82
 
83 83
 		$titleData = $this->sites->{$query->row()->site_class}->getTitleData($titleURL, TRUE);
84 84
 
@@ -104,21 +104,21 @@  discard block
 block discarded – undo
104 104
 	public function updateByID(int $titleID, ?string $latestChapter) : bool {
105 105
 		//FIXME: Really not too happy with how we're doing history stuff here, it just feels messy.
106 106
 		$query = $this->db->select('latest_chapter AS current_chapter')
107
-		                  ->from('tracker_titles')
108
-		                  ->where('id', $titleID)
109
-		                  ->get();
107
+						  ->from('tracker_titles')
108
+						  ->where('id', $titleID)
109
+						  ->get();
110 110
 		$row = $query->row();
111 111
 
112 112
 		//TODO (CHECK): If failed_checks changes won't that trigger affected_rows?
113 113
 		$success = $this->db->set(['latest_chapter' => $latestChapter, 'failed_checks' => 0]) //last_updated gets updated via a trigger if something changes
114
-		                    ->where('id', $titleID)
115
-		                    ->update('tracker_titles');
114
+							->where('id', $titleID)
115
+							->update('tracker_titles');
116 116
 
117 117
 		if($this->db->affected_rows() > 0) {
118 118
 			//Clear hidden latest chapter
119 119
 			$this->db->set(['ignore_chapter' => 'NULL', 'last_updated' => 'last_updated'], NULL, FALSE)
120
-			         ->where('title_id', $titleID)
121
-			         ->update('tracker_chapters');
120
+					 ->where('title_id', $titleID)
121
+					 ->update('tracker_chapters');
122 122
 		}
123 123
 
124 124
 		//Update History
@@ -135,20 +135,20 @@  discard block
 block discarded – undo
135 135
 		if(!array_diff(array_keys($data), TITLEDATA_COLUMNS)) {
136 136
 			$newData = array_merge($data, ['failed_checks' => 0]);
137 137
 			$oldData = $this->db->select('latest_chapter AS current_chapter')
138
-			                    ->from('tracker_titles')
139
-			                    ->where('id', $titleID)
140
-			                    ->get()->row_array();
138
+								->from('tracker_titles')
139
+								->where('id', $titleID)
140
+								->get()->row_array();
141 141
 
142 142
 
143 143
 			$success = $this->db->set($newData) //last_updated gets updated via a trigger if something changes
144
-			                    ->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
145
-			                    ->where('id', $titleID)
146
-			                    ->update('tracker_titles');
144
+								->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
145
+								->where('id', $titleID)
146
+								->update('tracker_titles');
147 147
 			if(in_array('latest_chapter', $newData, TRUE) && $newData['latest_chapter'] !== $oldData['current_chapter'] && $this->db->affected_rows() > 0) {
148 148
 				//Clear hidden latest chapter
149 149
 				$this->db->set(['ignore_chapter' => 'NULL', 'last_updated' => 'last_updated'], NULL, FALSE)
150
-				         ->where('title_id', $titleID)
151
-				         ->update('tracker_chapters');
150
+						 ->where('title_id', $titleID)
151
+						 ->update('tracker_chapters');
152 152
 			}
153 153
 
154 154
 			//Update History
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
 
165 165
 	public function updateFailedChecksByID(int $titleID) : bool {
166 166
 		$success = $this->db->set('failed_checks', 'failed_checks + 1', FALSE)
167
-		                    ->where('id', $titleID)
168
-		                    ->update('tracker_titles');
167
+							->where('id', $titleID)
168
+							->update('tracker_titles');
169 169
 
170 170
 		return $success;
171 171
 	}
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function getSiteDataFromURL(string $site_url) {
179 179
 		$query = $this->db->select('*')
180
-		                  ->from('tracker_sites')
181
-		                  ->where('site', $site_url)
182
-		                  ->get();
180
+						  ->from('tracker_sites')
181
+						  ->where('site', $site_url)
182
+						  ->get();
183 183
 
184 184
 		return $query->row();
185 185
 	}
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Category_Model.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
 
8 8
 	public function setByID(int $userID, int $chapterID, string $category) : bool {
9 9
 		$success = $this->db->set(['category' => $category, 'active' => 'Y', 'last_updated' => NULL])
10
-		                    ->where('user_id', $userID)
11
-		                    ->where('id', $chapterID)
12
-		                    ->update('tracker_chapters');
10
+							->where('user_id', $userID)
11
+							->where('id', $chapterID)
12
+							->update('tracker_chapters');
13 13
 
14 14
 		return (bool) $success;
15 15
 	}
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
 
41 41
 	public function getUsed(int $userID) : array {
42 42
 		$query = $this->db->distinct()
43
-		                  ->select('category')
44
-		                  ->from('tracker_chapters')
45
-		                  ->where('tracker_chapters.active', 'Y')
46
-		                  ->where('user_id', $userID)
47
-		                  ->get();
43
+						  ->select('category')
44
+						  ->from('tracker_chapters')
45
+						  ->where('tracker_chapters.active', 'Y')
46
+						  ->where('user_id', $userID)
47
+						  ->get();
48 48
 
49 49
 		return array_column($query->result_array(), 'category');
50 50
 	}
Please login to merge, or discard this patch.
application/controllers/AdminPanel.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,12 +40,12 @@
 block discarded – undo
40 40
 
41 41
 	private function _list_complete_titles() {
42 42
 		$query = $this->db->select('tracker_titles.id, tracker_sites.site_class, tracker_titles.title, tracker_titles.title_url')
43
-		                  ->from('tracker_chapters')
44
-		                  ->join('tracker_titles', 'tracker_chapters.title_id = tracker_titles.id', 'left')
45
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
46
-		                  ->like('tracker_chapters.tags', 'complete')
47
-		                  ->where('tracker_titles.status', 0)
48
-		                  ->get();
43
+						  ->from('tracker_chapters')
44
+						  ->join('tracker_titles', 'tracker_chapters.title_id = tracker_titles.id', 'left')
45
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
46
+						  ->like('tracker_chapters.tags', 'complete')
47
+						  ->where('tracker_titles.status', 0)
48
+						  ->get();
49 49
 
50 50
 		$completeList = [];
51 51
 		if($query->num_rows() > 0) {
Please login to merge, or discard this patch.
application/controllers/User/History.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@  discard block
 block discarded – undo
6 6
 	}
7 7
 
8 8
 	public function index(int $page = 1) : void {
9
-		if($page === 0) redirect('user/history/1');
9
+		if($page === 0) {
10
+			redirect('user/history/1');
11
+		}
10 12
 
11 13
 		$this->header_data['title'] = "History";
12 14
 		$this->header_data['page']  = "history";
@@ -16,7 +18,9 @@  discard block
 block discarded – undo
16 18
 		$this->body_data['currentPage'] = (int) $page;
17 19
 		$this->body_data['totalPages']  = $historyData['totalPages'];
18 20
 
19
-		if($page > $this->body_data['totalPages'] && $page > 1) redirect('user/history/1');
21
+		if($page > $this->body_data['totalPages'] && $page > 1) {
22
+			redirect('user/history/1');
23
+		}
20 24
 
21 25
 		$this->_render_page('User/History');
22 26
 	}
Please login to merge, or discard this patch.