@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class History_Model extends CI_Model { |
4 | 4 | public function __construct() { |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class History_Model extends CI_Model { |
4 | 4 | public function __construct() { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | foreach($result as $row) { |
50 | 50 | $arrRow = []; |
51 | 51 | |
52 | - $arrRow['updated_at'] = $row->updated_at; |
|
52 | + $arrRow['updated_at'] = $row->updated_at; |
|
53 | 53 | |
54 | 54 | $newChapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->new_chapter); |
55 | 55 | $arrRow['new_chapter'] = "<a href=\"{$newChapterData['url']}\">{$newChapterData['number']}</a>"; |
@@ -11,9 +11,9 @@ |
||
11 | 11 | |
12 | 12 | //This is pretty barebones bug reporting, and honestly not a great way to do it, but it works for now (until the Github is public). |
13 | 13 | $body = "". |
14 | - (!is_null($url) && !empty($url) ? "URL: ".htmlspecialchars(substr($url, 0, 255))."<br>\n" : ""). |
|
15 | - "Submitted by: ".$this->input->ip_address().(!is_null($userID) ? "| {$userID}" : "")."<br>\n". |
|
16 | - "<br>Bug report: ".htmlspecialchars(substr($text, 0, 1000)); |
|
14 | + (!is_null($url) && !empty($url) ? "URL: ".htmlspecialchars(substr($url, 0, 255))."<br>\n" : ""). |
|
15 | + "Submitted by: ".$this->input->ip_address().(!is_null($userID) ? "| {$userID}" : "")."<br>\n". |
|
16 | + "<br>Bug report: ".htmlspecialchars(substr($text, 0, 1000)); |
|
17 | 17 | |
18 | 18 | $success = TRUE; |
19 | 19 | $this->email->from('[email protected]', $this->config->item('site_title', 'ion_auth')); |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_Bug_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_Bug_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_Stats_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_Stats_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | ], FALSE) |
29 | 29 | ->from('tracker_chapters') |
30 | 30 | ->join('tracker_titles', 'tracker_titles.id = tracker_chapters.title_id', 'left') |
31 | - ->join('tracker_sites','tracker_titles.site_id = tracker_sites.id', 'left') |
|
31 | + ->join('tracker_sites', 'tracker_titles.site_id = tracker_sites.id', 'left') |
|
32 | 32 | ->group_by('tracker_chapters.title_id') |
33 | 33 | ->having('count > 1') |
34 | 34 | ->order_by('count DESC') |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_Base_Model extends CI_Model { |
4 | 4 | public $sites; |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_Base_Model extends CI_Model { |
4 | 4 | public $sites; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->enabledCategories['custom3'] = $this->User_Options->get('category_custom_3_text'); |
27 | 27 | } |
28 | 28 | |
29 | - foreach (glob(APPPATH.'models/Tracker/Sites/*.php') as $filename) { |
|
29 | + foreach(glob(APPPATH.'models/Tracker/Sites/*.php') as $filename) { |
|
30 | 30 | /** @noinspection PhpIncludeInspection */ |
31 | 31 | include_once $filename; |
32 | 32 | } |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_Admin_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | //Make sure last_checked is always updated on successful run. |
75 | 75 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
76 | 76 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
77 | - ->where('id', $row->title_id) |
|
78 | - ->update('tracker_titles'); |
|
77 | + ->where('id', $row->title_id) |
|
78 | + ->update('tracker_titles'); |
|
79 | 79 | |
80 | 80 | print " - ({$titleData['latest_chapter']})\n"; |
81 | 81 | } else { |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function updateCustom() { |
101 | 101 | $query = $this->db->select('*') |
102 | - ->from('tracker_sites') |
|
103 | - ->where('status', 'enabled') |
|
104 | - ->where('tracker_sites.use_custom', 'Y') |
|
105 | - ->get(); |
|
102 | + ->from('tracker_sites') |
|
103 | + ->where('status', 'enabled') |
|
104 | + ->where('tracker_sites.use_custom', 'Y') |
|
105 | + ->get(); |
|
106 | 106 | |
107 | 107 | $sites = $query->result_array(); |
108 | 108 | foreach ($sites as $site) { |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | //Make sure last_checked is always updated on successful run. |
118 | 118 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
119 | 119 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
120 | - ->where('id', $titleID) |
|
121 | - ->update('tracker_titles'); |
|
120 | + ->where('id', $titleID) |
|
121 | + ->update('tracker_titles'); |
|
122 | 122 | |
123 | 123 | print " - ({$titleData['latest_chapter']})\n"; |
124 | 124 | } else { |
@@ -142,13 +142,13 @@ discard block |
||
142 | 142 | |
143 | 143 | public function refollowCustom() { |
144 | 144 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
145 | - ->from('tracker_titles') |
|
146 | - ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
|
147 | - ->where('tracker_titles.followed','N') |
|
148 | - ->where('tracker_titles !=', '255') |
|
149 | - ->where('tracker_sites.status', 'enabled') |
|
150 | - ->where('tracker_sites.use_custom', 'Y') |
|
151 | - ->get(); |
|
145 | + ->from('tracker_titles') |
|
146 | + ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
|
147 | + ->where('tracker_titles.followed','N') |
|
148 | + ->where('tracker_titles !=', '255') |
|
149 | + ->where('tracker_sites.status', 'enabled') |
|
150 | + ->where('tracker_sites.use_custom', 'Y') |
|
151 | + ->get(); |
|
152 | 152 | |
153 | 153 | if($query->num_rows() > 0) { |
154 | 154 | foreach($query->result() as $row) { |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | |
160 | 160 | if(!empty($titleData)) { |
161 | 161 | $this->db->set($titleData) |
162 | - ->where('id', $row->id) |
|
163 | - ->update('tracker_titles'); |
|
162 | + ->where('id', $row->id) |
|
163 | + ->update('tracker_titles'); |
|
164 | 164 | |
165 | 165 | print "> {$row->site_class}:{$row->id}:{$row->title_url} FOLLOWED\n"; |
166 | 166 | } else { |
@@ -208,8 +208,8 @@ discard block |
||
208 | 208 | if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
209 | 209 | if($titleData['title'] !== $row->title) { |
210 | 210 | $this->db->set('title', $titleData['title']) |
211 | - ->where('id', $row->id) |
|
212 | - ->update('tracker_titles'); |
|
211 | + ->where('id', $row->id) |
|
212 | + ->update('tracker_titles'); |
|
213 | 213 | //TODO: Add to history somehow? |
214 | 214 | print " - NEW TITLE ({$titleData['title']})\n"; |
215 | 215 | } else { |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | //We might as well try to update as well. |
220 | 220 | if($this->Tracker->title->updateByID((int) $row->id, $titleData['latest_chapter'])) { |
221 | 221 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
222 | - ->where('id', $row->id) |
|
223 | - ->update('tracker_titles'); |
|
222 | + ->where('id', $row->id) |
|
223 | + ->update('tracker_titles'); |
|
224 | 224 | } |
225 | 225 | } else { |
226 | 226 | log_message('error', "{$row->title} failed to update title successfully"); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_Admin_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | // @formatter:on |
65 | 65 | |
66 | 66 | if($query->num_rows() > 0) { |
67 | - foreach ($query->result() as $row) { |
|
67 | + foreach($query->result() as $row) { |
|
68 | 68 | print "> {$row->title} <{$row->site_class}> | <{$row->title_id}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
69 | 69 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
70 | 70 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | ->get(); |
106 | 106 | |
107 | 107 | $sites = $query->result_array(); |
108 | - foreach ($sites as $site) { |
|
108 | + foreach($sites as $site) { |
|
109 | 109 | $siteClass = $this->sites->{$site['site_class']}; |
110 | 110 | if($titleDataList = $siteClass->doCustomUpdate()) { |
111 | - foreach ($titleDataList as $titleURL => $titleData) { |
|
111 | + foreach($titleDataList as $titleURL => $titleData) { |
|
112 | 112 | print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
113 | 113 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
114 | 114 | if($dbTitleData = $this->Tracker->title->getID($titleURL, (int) $site['id'], FALSE, TRUE)) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
149 | 149 | ->from('tracker_titles') |
150 | 150 | ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
151 | - ->where('tracker_titles.followed','N') |
|
151 | + ->where('tracker_titles.followed', 'N') |
|
152 | 152 | ->where('tracker_titles !=', '255') |
153 | 153 | ->where('tracker_sites.status', 'enabled') |
154 | 154 | ->where('tracker_sites.use_custom', 'Y') |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | // @formatter:on |
207 | 207 | |
208 | 208 | if($query->num_rows() > 0) { |
209 | - foreach ($query->result() as $row) { |
|
209 | + foreach($query->result() as $row) { |
|
210 | 210 | print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
211 | 211 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
212 | 212 | if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_List_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -171,14 +171,14 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | $idQuery = $this->db->select('id') |
174 | - ->where('user_id', $userID) |
|
175 | - ->where('title_id', $titleID) |
|
176 | - ->get('tracker_chapters'); |
|
174 | + ->where('user_id', $userID) |
|
175 | + ->where('title_id', $titleID) |
|
176 | + ->get('tracker_chapters'); |
|
177 | 177 | if($idQuery->num_rows() > 0) { |
178 | 178 | $success = (bool) $this->db->set(['current_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL, 'ignore_chapter' => NULL]) |
179 | - ->where('user_id', $userID) |
|
180 | - ->where('title_id', $titleID) |
|
181 | - ->update('tracker_chapters'); |
|
179 | + ->where('user_id', $userID) |
|
180 | + ->where('title_id', $titleID) |
|
181 | + ->update('tracker_chapters'); |
|
182 | 182 | |
183 | 183 | if($success) { |
184 | 184 | $idQueryRow = $idQuery->row(); |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | } |
205 | 205 | public function updateByID(int $userID, int $chapterID, string $chapter) : bool { |
206 | 206 | $success = (bool) $this->db->set(['current_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL]) |
207 | - ->where('user_id', $userID) |
|
208 | - ->where('id', $chapterID) |
|
209 | - ->update('tracker_chapters'); |
|
207 | + ->where('user_id', $userID) |
|
208 | + ->where('id', $chapterID) |
|
209 | + ->update('tracker_chapters'); |
|
210 | 210 | |
211 | 211 | if($success) { |
212 | 212 | $this->History->userUpdateTitle($chapterID, $chapter); |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | |
217 | 217 | public function ignoreByID(int $userID, int $chapterID, string $chapter) : bool { |
218 | 218 | $success = (bool) $this->db->set(['ignore_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL]) |
219 | - ->where('user_id', $userID) |
|
220 | - ->where('id', $chapterID) |
|
221 | - ->update('tracker_chapters'); |
|
219 | + ->where('user_id', $userID) |
|
220 | + ->where('id', $chapterID) |
|
221 | + ->update('tracker_chapters'); |
|
222 | 222 | |
223 | 223 | if($success) { |
224 | 224 | $this->History->userIgnoreTitle($chapterID, $chapter); |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | //This is to allow user history to function properly. |
232 | 232 | |
233 | 233 | $success = $this->db->set(['active' => 'N', 'last_updated' => NULL]) |
234 | - ->where('user_id', $userID) |
|
235 | - ->where('id', $chapterID) |
|
236 | - ->update('tracker_chapters'); |
|
234 | + ->where('user_id', $userID) |
|
235 | + ->where('id', $chapterID) |
|
236 | + ->update('tracker_chapters'); |
|
237 | 237 | |
238 | 238 | return (bool) $success; |
239 | 239 | } |
@@ -263,9 +263,9 @@ discard block |
||
263 | 263 | //TODO: OPTION, USE BACKEND MAL ID DB WHERE POSSIBLE (DEFAULT TRUE) |
264 | 264 | |
265 | 265 | $queryC = $this->db->select('mal_id') |
266 | - ->where('user_id', $userID) |
|
267 | - ->where('title_id', $titleID) |
|
268 | - ->get('tracker_chapters'); |
|
266 | + ->where('user_id', $userID) |
|
267 | + ->where('title_id', $titleID) |
|
268 | + ->get('tracker_chapters'); |
|
269 | 269 | |
270 | 270 | if($queryC->num_rows() > 0 && ($rowC = $queryC->row())) { |
271 | 271 | $malIDArr = [ |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | ]; |
275 | 275 | } else { |
276 | 276 | $queryT = $this->db->select('mal_id') |
277 | - ->where('title_id', $titleID) |
|
278 | - ->get('tracker_titles'); |
|
277 | + ->where('title_id', $titleID) |
|
278 | + ->get('tracker_titles'); |
|
279 | 279 | |
280 | 280 | if($queryT->num_rows() > 0 && ($rowT = $queryT->row())) { |
281 | 281 | $malIDArr = [ |
@@ -289,9 +289,9 @@ discard block |
||
289 | 289 | //TODO: Remove after a few weeks! |
290 | 290 | if(is_null($malIDArr)) { |
291 | 291 | $queryC2 = $this->db->select('tags') |
292 | - ->where('user_id', $userID) |
|
293 | - ->where('title_id', $titleID) |
|
294 | - ->get('tracker_chapters'); |
|
292 | + ->where('user_id', $userID) |
|
293 | + ->where('title_id', $titleID) |
|
294 | + ->get('tracker_chapters'); |
|
295 | 295 | |
296 | 296 | if($queryC2->num_rows() > 0 && ($tag_string = $queryC2->row()->tags) && !is_null($tag_string)) { |
297 | 297 | $arr = preg_grep('/^mal:([0-9]+|none)$/', explode(',', $tag_string)); |
@@ -309,9 +309,9 @@ discard block |
||
309 | 309 | public function setMalID(int $userID, int $chapterID, ?int $malID) : bool { |
310 | 310 | //TODO: Handle NULL? |
311 | 311 | $success = (bool) $this->db->set(['mal_id' => $malID, 'active' => 'Y', 'last_updated' => NULL]) |
312 | - ->where('user_id', $userID) |
|
313 | - ->where('id', $chapterID) |
|
314 | - ->update('tracker_chapters'); |
|
312 | + ->where('user_id', $userID) |
|
313 | + ->where('id', $chapterID) |
|
314 | + ->update('tracker_chapters'); |
|
315 | 315 | |
316 | 316 | if($success) { |
317 | 317 | //MAL id update was successful, update history |
@@ -72,8 +72,12 @@ discard block |
||
72 | 72 | |
73 | 73 | $arr['series'][$row->category]['manga'][] = $data; |
74 | 74 | |
75 | - if(!$arr['has_inactive']) $arr['has_inactive'] = !$data['title_data']['active']; |
|
76 | - if($arr['has_inactive']) $arr['inactive_titles'][$data['full_title_url']] = $data['title_data']['title']; |
|
75 | + if(!$arr['has_inactive']) { |
|
76 | + $arr['has_inactive'] = !$data['title_data']['active']; |
|
77 | + } |
|
78 | + if($arr['has_inactive']) { |
|
79 | + $arr['inactive_titles'][$data['full_title_url']] = $data['title_data']['title']; |
|
80 | + } |
|
77 | 81 | } |
78 | 82 | |
79 | 83 | //FIXME: This is not good for speed, but we're kind of required to do this for UX purposes. |
@@ -107,11 +111,15 @@ discard block |
||
107 | 111 | |
108 | 112 | if($sortOrder == 'asc') { |
109 | 113 | $unreadSort = ($a_text <=> $b_text); |
110 | - if($unreadSort) return $unreadSort; |
|
114 | + if($unreadSort) { |
|
115 | + return $unreadSort; |
|
116 | + } |
|
111 | 117 | return $a_text2 <=> $b_text2; |
112 | 118 | } else { |
113 | 119 | $unreadSort = ($a_text <=> $b_text); |
114 | - if($unreadSort) return $unreadSort; |
|
120 | + if($unreadSort) { |
|
121 | + return $unreadSort; |
|
122 | + } |
|
115 | 123 | return $b_text2 <=> $a_text2; |
116 | 124 | } |
117 | 125 | }); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_List_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | ]; |
30 | 30 | } |
31 | 31 | if($query->num_rows() > 0) { |
32 | - foreach ($query->result() as $row) { |
|
32 | + foreach($query->result() as $row) { |
|
33 | 33 | $is_unread = intval(($row->latest_chapter == $row->ignore_chapter) || ($row->latest_chapter == $row->current_chapter) ? '1' : '0'); |
34 | 34 | $arr['series'][$row->category]['unread_count'] = (($arr['series'][$row->category]['unread_count'] ?? 0) + !$is_unread); |
35 | 35 | $data = [ |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $sortOrder = $this->User_Options->get('list_sort_order', $userID); |
85 | 85 | switch($this->User_Options->get('list_sort_type', $userID)) { |
86 | 86 | case 'unread': |
87 | - foreach (array_keys($arr['series']) as $category) { |
|
88 | - usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) { |
|
87 | + foreach(array_keys($arr['series']) as $category) { |
|
88 | + usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
|
89 | 89 | $a_text = strtolower("{$a['new_chapter_exists']} - {$a['title_data']['title']}"); |
90 | 90 | $b_text = strtolower("{$b['new_chapter_exists']} - {$b['title_data']['title']}"); |
91 | 91 | |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | break; |
100 | 100 | |
101 | 101 | case 'unread_latest': |
102 | - foreach (array_keys($arr['series']) as $category) { |
|
103 | - usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) { |
|
102 | + foreach(array_keys($arr['series']) as $category) { |
|
103 | + usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
|
104 | 104 | $a_text = $a['new_chapter_exists']; |
105 | 105 | $b_text = $b['new_chapter_exists']; |
106 | 106 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | break; |
122 | 122 | |
123 | 123 | case 'alphabetical': |
124 | - foreach (array_keys($arr['series']) as $category) { |
|
124 | + foreach(array_keys($arr['series']) as $category) { |
|
125 | 125 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
126 | 126 | $a_text = strtolower("{$a['title_data']['title']}"); |
127 | 127 | $b_text = strtolower("{$b['title_data']['title']}"); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | break; |
137 | 137 | |
138 | 138 | case 'my_status': |
139 | - foreach (array_keys($arr['series']) as $category) { |
|
139 | + foreach(array_keys($arr['series']) as $category) { |
|
140 | 140 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
141 | 141 | $a_text = strtolower("{$a['generated_current_data']['number']}"); |
142 | 142 | $b_text = strtolower("{$b['generated_current_data']['number']}"); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | break; |
152 | 152 | |
153 | 153 | case 'latest': |
154 | - foreach (array_keys($arr['series']) as $category) { |
|
154 | + foreach(array_keys($arr['series']) as $category) { |
|
155 | 155 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
156 | 156 | $a_text = new DateTime("{$a['title_data']['last_updated']}"); |
157 | 157 | $b_text = new DateTime("{$b['title_data']['last_updated']}"); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | return $status; |
284 | 284 | } |
285 | 285 | |
286 | - public function getMalID(int $userID, int $titleID) : ?array{ |
|
286 | + public function getMalID(int $userID, int $titleID) : ? array{ |
|
287 | 287 | $malIDArr = NULL; |
288 | 288 | |
289 | 289 | //NEW METHOD |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | ->get('tracker_chapters'); |
322 | 322 | |
323 | 323 | if($queryC2->num_rows() > 0 && ($tag_string = $queryC2->row()->tags) && !is_null($tag_string)) { |
324 | - $arr = preg_grep('/^mal:([0-9]+|none)$/', explode(',', $tag_string)); |
|
324 | + $arr = preg_grep('/^mal:([0-9]+|none)$/', explode(',', $tag_string)); |
|
325 | 325 | if(!empty($arr)) { |
326 | 326 | $malIDArr = [ |
327 | 327 | 'id' => explode(':', $arr[0])[1], |
@@ -1,4 +1,4 @@ |
||
1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | $active_group = 'default'; |
4 | 4 | $query_builder = TRUE; |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | | always be used to set the mode correctly. |
27 | 27 | | |
28 | 28 | */ |
29 | -defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644); |
|
29 | +defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644); |
|
30 | 30 | defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666); |
31 | -defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755); |
|
32 | -defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755); |
|
31 | +defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755); |
|
32 | +defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755); |
|
33 | 33 | |
34 | 34 | /* |
35 | 35 | |-------------------------------------------------------------------------- |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | | These modes are used when working with fopen()/popen() |
40 | 40 | | |
41 | 41 | */ |
42 | -defined('FOPEN_READ') OR define('FOPEN_READ', 'rb'); |
|
43 | -defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b'); |
|
44 | -defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
|
42 | +defined('FOPEN_READ') OR define('FOPEN_READ', 'rb'); |
|
43 | +defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b'); |
|
44 | +defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
|
45 | 45 | defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care |
46 | -defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab'); |
|
47 | -defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
|
48 | -defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
|
49 | -defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
|
46 | +defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab'); |
|
47 | +defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
|
48 | +defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
|
49 | +defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
|
50 | 50 | |
51 | 51 | /* |
52 | 52 | |-------------------------------------------------------------------------- |
@@ -73,18 +73,18 @@ discard block |
||
73 | 73 | | http://tldp.org/LDP/abs/html/exitcodes.html |
74 | 74 | | |
75 | 75 | */ |
76 | -defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors |
|
77 | -defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error |
|
78 | -defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error |
|
79 | -defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
80 | -defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
76 | +defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors |
|
77 | +defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error |
|
78 | +defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error |
|
79 | +defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
80 | +defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
81 | 81 | defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member |
82 | -defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input |
|
83 | -defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error |
|
84 | -defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
85 | -defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
82 | +defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input |
|
83 | +defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error |
|
84 | +defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
85 | +defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
86 | 86 | |
87 | 87 | /***** TIMEAGO CONSTANTS *****/ |
88 | 88 | defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago |
89 | -defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago |
|
90 | -defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago |
|
89 | +defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago |
|
90 | +defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | +defined('BASEPATH') or exit('No direct script access allowed'); |
|
3 | 3 | |
4 | 4 | /* |
5 | 5 | |-------------------------------------------------------------------------- |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | | of this setting |
12 | 12 | | |
13 | 13 | */ |
14 | -defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE); |
|
14 | +defined('SHOW_DEBUG_BACKTRACE') or define('SHOW_DEBUG_BACKTRACE', TRUE); |
|
15 | 15 | |
16 | 16 | /* |
17 | 17 | |-------------------------------------------------------------------------- |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | | always be used to set the mode correctly. |
27 | 27 | | |
28 | 28 | */ |
29 | -defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644); |
|
30 | -defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666); |
|
31 | -defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755); |
|
32 | -defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755); |
|
29 | +defined('FILE_READ_MODE') or define('FILE_READ_MODE', 0644); |
|
30 | +defined('FILE_WRITE_MODE') or define('FILE_WRITE_MODE', 0666); |
|
31 | +defined('DIR_READ_MODE') or define('DIR_READ_MODE', 0755); |
|
32 | +defined('DIR_WRITE_MODE') or define('DIR_WRITE_MODE', 0755); |
|
33 | 33 | |
34 | 34 | /* |
35 | 35 | |-------------------------------------------------------------------------- |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | | These modes are used when working with fopen()/popen() |
40 | 40 | | |
41 | 41 | */ |
42 | -defined('FOPEN_READ') OR define('FOPEN_READ', 'rb'); |
|
43 | -defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b'); |
|
44 | -defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
|
45 | -defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care |
|
46 | -defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab'); |
|
47 | -defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
|
48 | -defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
|
49 | -defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
|
42 | +defined('FOPEN_READ') or define('FOPEN_READ', 'rb'); |
|
43 | +defined('FOPEN_READ_WRITE') or define('FOPEN_READ_WRITE', 'r+b'); |
|
44 | +defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') or define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
|
45 | +defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') or define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care |
|
46 | +defined('FOPEN_WRITE_CREATE') or define('FOPEN_WRITE_CREATE', 'ab'); |
|
47 | +defined('FOPEN_READ_WRITE_CREATE') or define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
|
48 | +defined('FOPEN_WRITE_CREATE_STRICT') or define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
|
49 | +defined('FOPEN_READ_WRITE_CREATE_STRICT') or define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
|
50 | 50 | |
51 | 51 | /* |
52 | 52 | |-------------------------------------------------------------------------- |
@@ -73,18 +73,18 @@ discard block |
||
73 | 73 | | http://tldp.org/LDP/abs/html/exitcodes.html |
74 | 74 | | |
75 | 75 | */ |
76 | -defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors |
|
77 | -defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error |
|
78 | -defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error |
|
79 | -defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
80 | -defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
81 | -defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member |
|
82 | -defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input |
|
83 | -defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error |
|
84 | -defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
85 | -defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
76 | +defined('EXIT_SUCCESS') or define('EXIT_SUCCESS', 0); // no errors |
|
77 | +defined('EXIT_ERROR') or define('EXIT_ERROR', 1); // generic error |
|
78 | +defined('EXIT_CONFIG') or define('EXIT_CONFIG', 3); // configuration error |
|
79 | +defined('EXIT_UNKNOWN_FILE') or define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
80 | +defined('EXIT_UNKNOWN_CLASS') or define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
81 | +defined('EXIT_UNKNOWN_METHOD') or define('EXIT_UNKNOWN_METHOD', 6); // unknown class member |
|
82 | +defined('EXIT_USER_INPUT') or define('EXIT_USER_INPUT', 7); // invalid user input |
|
83 | +defined('EXIT_DATABASE') or define('EXIT_DATABASE', 8); // database error |
|
84 | +defined('EXIT__AUTO_MIN') or define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
85 | +defined('EXIT__AUTO_MAX') or define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
86 | 86 | |
87 | 87 | /***** TIMEAGO CONSTANTS *****/ |
88 | -defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago |
|
89 | -defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago |
|
90 | -defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago |
|
88 | +defined('TIMEAGO_MONTH') or define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago |
|
89 | +defined('TIMEAGO_WEEK') or define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago |
|
90 | +defined('TIMEAGO_3DAY') or define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago |
@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | $usedCategories = $this->Tracker->category->getUsed($this->User->id); |
17 | 17 | |
18 | 18 | //NOTE: The checkbox validation is handled in run() |
19 | - $this->form_validation->set_rules('category_custom_1_text', 'Custom Category 1 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
20 | - $this->form_validation->set_rules('category_custom_2_text', 'Custom Category 2 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
21 | - $this->form_validation->set_rules('category_custom_3_text', 'Custom Category 3 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
19 | + $this->form_validation->set_rules('category_custom_1_text', 'Custom Category 1 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
20 | + $this->form_validation->set_rules('category_custom_2_text', 'Custom Category 2 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
21 | + $this->form_validation->set_rules('category_custom_3_text', 'Custom Category 3 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
22 | 22 | $this->form_validation->set_rules('default_series_category', 'Default Series Category', 'required|is_valid_option_value[default_series_category]'); |
23 | - $this->form_validation->set_rules('list_sort_type', 'List Sort Type', 'required|is_valid_option_value[list_sort_type]'); |
|
24 | - $this->form_validation->set_rules('list_sort_order', 'List Sort Order', 'required|is_valid_option_value[list_sort_order]'); |
|
25 | - $this->form_validation->set_rules('theme', 'Theme', 'required|is_valid_option_value[theme]'); |
|
26 | - $this->form_validation->set_rules('mal_sync', 'MAL Sync', 'required|is_valid_option_value[mal_sync]'); |
|
23 | + $this->form_validation->set_rules('list_sort_type', 'List Sort Type', 'required|is_valid_option_value[list_sort_type]'); |
|
24 | + $this->form_validation->set_rules('list_sort_order', 'List Sort Order', 'required|is_valid_option_value[list_sort_order]'); |
|
25 | + $this->form_validation->set_rules('theme', 'Theme', 'required|is_valid_option_value[theme]'); |
|
26 | + $this->form_validation->set_rules('mal_sync', 'MAL Sync', 'required|is_valid_option_value[mal_sync]'); |
|
27 | 27 | |
28 | - if ($isValid = $this->form_validation->run() === TRUE) { |
|
28 | + if($isValid = $this->form_validation->run() === TRUE) { |
|
29 | 29 | foreach($customCategories as $categoryK => $category) { |
30 | 30 | if(!in_array($categoryK, $usedCategories)) { |
31 | 31 | $this->User_Options->set($category, $this->input->post($category) ? 'enabled' : 'disabled'); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | $this->User_Options->set('enable_live_countdown_timer', $this->input->post('enable_live_countdown_timer')); |
40 | 40 | |
41 | - $this->User_Options->set('list_sort_type', $this->input->post('list_sort_type')); |
|
41 | + $this->User_Options->set('list_sort_type', $this->input->post('list_sort_type')); |
|
42 | 42 | $this->User_Options->set('list_sort_order', $this->input->post('list_sort_order')); |
43 | 43 | |
44 | 44 | $this->User_Options->set('theme', $this->input->post('theme')); |