@@ -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_Favourites_Model extends Tracker_Base_Model { |
| 4 | 4 | public function __construct() { |
@@ -71,31 +71,31 @@ |
||
| 71 | 71 | |
| 72 | 72 | ////We need the series to be tracked |
| 73 | 73 | $idCQuery = $this->db->select('id') |
| 74 | - ->where('user_id', $userID) |
|
| 75 | - ->where('title_id', $titleID) |
|
| 76 | - ->get('tracker_chapters'); |
|
| 74 | + ->where('user_id', $userID) |
|
| 75 | + ->where('title_id', $titleID) |
|
| 76 | + ->get('tracker_chapters'); |
|
| 77 | 77 | if(!($idCQuery->num_rows() > 0)) { |
| 78 | 78 | //NOTE: This pretty much repeats a lot of what we already did above. Is there a better way to do this? |
| 79 | 79 | $this->Tracker->list->update($userID, $site, $title, $chapter, FALSE); |
| 80 | 80 | |
| 81 | 81 | $idCQuery = $this->db->select('id') |
| 82 | - ->where('user_id', $userID) |
|
| 83 | - ->where('title_id', $titleID) |
|
| 84 | - ->get('tracker_chapters'); |
|
| 82 | + ->where('user_id', $userID) |
|
| 83 | + ->where('title_id', $titleID) |
|
| 84 | + ->get('tracker_chapters'); |
|
| 85 | 85 | } |
| 86 | 86 | if($idCQuery->num_rows() > 0) { |
| 87 | 87 | $idCQueryRow = $idCQuery->row(); |
| 88 | 88 | |
| 89 | 89 | //Check if it is already favourited |
| 90 | 90 | $idFQuery = $this->db->select('id') |
| 91 | - ->where('chapter_id', $idCQueryRow->id) |
|
| 92 | - ->get('tracker_favourites'); |
|
| 91 | + ->where('chapter_id', $idCQueryRow->id) |
|
| 92 | + ->get('tracker_favourites'); |
|
| 93 | 93 | if($idFQuery->num_rows() > 0) { |
| 94 | 94 | //Chapter is already favourited, so remove it from DB |
| 95 | 95 | $idFQueryRow = $idFQuery->row(); |
| 96 | 96 | |
| 97 | 97 | $isSuccess = (bool) $this->db->where('id', $idFQueryRow->id) |
| 98 | - ->delete('tracker_favourites'); |
|
| 98 | + ->delete('tracker_favourites'); |
|
| 99 | 99 | |
| 100 | 100 | if($isSuccess) { |
| 101 | 101 | $success = array( |
@@ -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_Favourites_Model extends Tracker_Base_Model { |
| 4 | 4 | public function __construct() { |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | tf.chapter, tf.updated_at', FALSE) |
| 15 | 15 | ->from('tracker_favourites AS tf') |
| 16 | 16 | ->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left') |
| 17 | - ->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left') |
|
| 18 | - ->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left') |
|
| 17 | + ->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left') |
|
| 18 | + ->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left') |
|
| 19 | 19 | ->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites? |
| 20 | 20 | ->order_by('tf.id DESC') |
| 21 | 21 | ->limit($rowsPerPage, ($rowsPerPage * ($page - 1))) |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | return $favourites; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public function set(string $site, string $title, string $chapter, ?int $userID = NULL) : array { |
|
| 46 | + public function set(string $site, string $title, string $chapter, ? int $userID = NULL) : array { |
|
| 47 | 47 | $success = array( |
| 48 | 48 | 'status' => 'Something went wrong', |
| 49 | 49 | 'bool' => FALSE |
@@ -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 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public function getEnabledCategories(?int $userID = NULL) : array { |
|
| 37 | + public function getEnabledCategories(? int $userID = NULL) : array { |
|
| 38 | 38 | $userID = (is_null($userID) ? (int) $this->User->id : $userID); |
| 39 | 39 | |
| 40 | 40 | $enabledCategories = []; |
@@ -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() { |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | //Make sure last_checked is always updated on successful run. |
| 76 | 76 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
| 77 | 77 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
| 78 | - ->where('id', $row->id) |
|
| 79 | - ->update('tracker_titles'); |
|
| 78 | + ->where('id', $row->id) |
|
| 79 | + ->update('tracker_titles'); |
|
| 80 | 80 | |
| 81 | 81 | print " - ({$titleData['latest_chapter']})\n"; |
| 82 | 82 | } else { |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function updateCustom() { |
| 98 | 98 | $query = $this->db->select('*') |
| 99 | - ->from('tracker_sites') |
|
| 100 | - ->where('status', 'enabled') |
|
| 101 | - ->get(); |
|
| 99 | + ->from('tracker_sites') |
|
| 100 | + ->where('status', 'enabled') |
|
| 101 | + ->get(); |
|
| 102 | 102 | |
| 103 | 103 | $sites = $query->result_array(); |
| 104 | 104 | foreach ($sites as $site) { |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | //Make sure last_checked is always updated on successful run. |
| 114 | 114 | //CHECK: Is there a reason we aren't just doing this in updateByID? |
| 115 | 115 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
| 116 | - ->where('id', $titleID) |
|
| 117 | - ->update('tracker_titles'); |
|
| 116 | + ->where('id', $titleID) |
|
| 117 | + ->update('tracker_titles'); |
|
| 118 | 118 | |
| 119 | 119 | print " - ({$titleData['latest_chapter']})\n"; |
| 120 | 120 | } else { |
@@ -138,13 +138,13 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | public function refollowCustom() { |
| 140 | 140 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
| 141 | - ->from('tracker_titles') |
|
| 142 | - ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
|
| 143 | - ->where('tracker_titles.followed','N') |
|
| 144 | - ->where('tracker_titles !=', '255') |
|
| 145 | - ->where('tracker_sites.status', 'enabled') |
|
| 146 | - ->where('tracker_sites.use_custom', 'Y') |
|
| 147 | - ->get(); |
|
| 141 | + ->from('tracker_titles') |
|
| 142 | + ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
|
| 143 | + ->where('tracker_titles.followed','N') |
|
| 144 | + ->where('tracker_titles !=', '255') |
|
| 145 | + ->where('tracker_sites.status', 'enabled') |
|
| 146 | + ->where('tracker_sites.use_custom', 'Y') |
|
| 147 | + ->get(); |
|
| 148 | 148 | |
| 149 | 149 | if($query->num_rows() > 0) { |
| 150 | 150 | foreach($query->result() as $row) { |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | if(!empty($titleData)) { |
| 157 | 157 | $this->db->set($titleData) |
| 158 | - ->where('id', $row->id) |
|
| 159 | - ->update('tracker_titles'); |
|
| 158 | + ->where('id', $row->id) |
|
| 159 | + ->update('tracker_titles'); |
|
| 160 | 160 | |
| 161 | 161 | print "> {$row->site_class}:{$row->id}:{$row->title_url} FOLLOWED\n"; |
| 162 | 162 | } else { |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
| 205 | 205 | if($titleData['title'] !== $row->title) { |
| 206 | 206 | $this->db->set('title', $titleData['title']) |
| 207 | - ->where('id', $row->id) |
|
| 208 | - ->update('tracker_titles'); |
|
| 207 | + ->where('id', $row->id) |
|
| 208 | + ->update('tracker_titles'); |
|
| 209 | 209 | //TODO: Add to history somehow? |
| 210 | 210 | print " - NEW TITLE ({$titleData['title']})\n"; |
| 211 | 211 | } else { |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | //We might as well try to update as well. |
| 216 | 216 | if($this->Tracker->title->updateByID((int) $row->id, $titleData['latest_chapter'])) { |
| 217 | 217 | $this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE) |
| 218 | - ->where('id', $row->id) |
|
| 219 | - ->update('tracker_titles'); |
|
| 218 | + ->where('id', $row->id) |
|
| 219 | + ->update('tracker_titles'); |
|
| 220 | 220 | } |
| 221 | 221 | } else { |
| 222 | 222 | 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() { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | // @formatter:on |
| 66 | 66 | |
| 67 | 67 | if($query->num_rows() > 0) { |
| 68 | - foreach ($query->result() as $row) { |
|
| 68 | + foreach($query->result() as $row) { |
|
| 69 | 69 | print "> {$row->title} <{$row->site_class}> | <{$row->id}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
| 70 | 70 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
| 71 | 71 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | ->get(); |
| 102 | 102 | |
| 103 | 103 | $sites = $query->result_array(); |
| 104 | - foreach ($sites as $site) { |
|
| 104 | + foreach($sites as $site) { |
|
| 105 | 105 | if($titleDataList = $this->sites->{$site['site_class']}->doCustomUpdate()) { |
| 106 | - foreach ($titleDataList as $titleURL => $titleData) { |
|
| 106 | + foreach($titleDataList as $titleURL => $titleData) { |
|
| 107 | 107 | print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
| 108 | 108 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
| 109 | 109 | if($dbTitleData = $this->Tracker->title->getID($titleURL, (int) $site['id'], FALSE, TRUE)) { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
| 141 | 141 | ->from('tracker_titles') |
| 142 | 142 | ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
| 143 | - ->where('tracker_titles.followed','N') |
|
| 143 | + ->where('tracker_titles.followed', 'N') |
|
| 144 | 144 | ->where('tracker_titles !=', '255') |
| 145 | 145 | ->where('tracker_sites.status', 'enabled') |
| 146 | 146 | ->where('tracker_sites.use_custom', 'Y') |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | // @formatter:on |
| 199 | 199 | |
| 200 | 200 | if($query->num_rows() > 0) { |
| 201 | - foreach ($query->result() as $row) { |
|
| 201 | + foreach($query->result() as $row) { |
|
| 202 | 202 | print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
| 203 | 203 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
| 204 | 204 | 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 |
@@ -1,11 +1,11 @@ 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() { |
| 5 | 5 | parent::__construct(); |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | - public function get(?int $userID = NULL) { |
|
| 8 | + public function get(? int $userID = NULL) { |
|
| 9 | 9 | $userID = (is_null($userID) ? (int) $this->User->id : $userID); |
| 10 | 10 | |
| 11 | 11 | $query = $this->db |
@@ -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 = [ |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | $sortOrder = $this->User_Options->get('list_sort_order', $userID); |
| 83 | 83 | switch($this->User_Options->get('list_sort_type', $userID)) { |
| 84 | 84 | case 'unread': |
| 85 | - foreach (array_keys($arr['series']) as $category) { |
|
| 86 | - usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) { |
|
| 85 | + foreach(array_keys($arr['series']) as $category) { |
|
| 86 | + usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
|
| 87 | 87 | $a_text = strtolower("{$a['new_chapter_exists']} - {$a['title_data']['title']}"); |
| 88 | 88 | $b_text = strtolower("{$b['new_chapter_exists']} - {$b['title_data']['title']}"); |
| 89 | 89 | |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | break; |
| 98 | 98 | |
| 99 | 99 | case 'unread_latest': |
| 100 | - foreach (array_keys($arr['series']) as $category) { |
|
| 101 | - usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) { |
|
| 100 | + foreach(array_keys($arr['series']) as $category) { |
|
| 101 | + usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
|
| 102 | 102 | $a_text = $a['new_chapter_exists']; |
| 103 | 103 | $b_text = $b['new_chapter_exists']; |
| 104 | 104 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | break; |
| 120 | 120 | |
| 121 | 121 | case 'alphabetical': |
| 122 | - foreach (array_keys($arr['series']) as $category) { |
|
| 122 | + foreach(array_keys($arr['series']) as $category) { |
|
| 123 | 123 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
| 124 | 124 | $a_text = strtolower("{$a['title_data']['title']}"); |
| 125 | 125 | $b_text = strtolower("{$b['title_data']['title']}"); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | break; |
| 135 | 135 | |
| 136 | 136 | case 'my_status': |
| 137 | - foreach (array_keys($arr['series']) as $category) { |
|
| 137 | + foreach(array_keys($arr['series']) as $category) { |
|
| 138 | 138 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
| 139 | 139 | $a_text = strtolower("{$a['generated_current_data']['number']}"); |
| 140 | 140 | $b_text = strtolower("{$b['generated_current_data']['number']}"); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | break; |
| 150 | 150 | |
| 151 | 151 | case 'latest': |
| 152 | - foreach (array_keys($arr['series']) as $category) { |
|
| 152 | + foreach(array_keys($arr['series']) as $category) { |
|
| 153 | 153 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
| 154 | 154 | $a_text = new DateTime("{$a['title_data']['last_updated']}"); |
| 155 | 155 | $b_text = new DateTime("{$b['title_data']['last_updated']}"); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | return $status; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - public function getMalID(int $userID, int $titleID) : ?array{ |
|
| 284 | + public function getMalID(int $userID, int $titleID) : ? array{ |
|
| 285 | 285 | $malIDArr = NULL; |
| 286 | 286 | |
| 287 | 287 | //NEW METHOD |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | ->get('tracker_chapters'); |
| 320 | 320 | |
| 321 | 321 | if($queryC2->num_rows() > 0 && ($tag_string = $queryC2->row()->tags) && !is_null($tag_string)) { |
| 322 | - $arr = preg_grep('/^mal:([0-9]+|none)$/', explode(',', $tag_string)); |
|
| 322 | + $arr = preg_grep('/^mal:([0-9]+|none)$/', explode(',', $tag_string)); |
|
| 323 | 323 | if(!empty($arr)) { |
| 324 | 324 | $malIDArr = [ |
| 325 | 325 | 'id' => explode(':', $arr[0])[1], |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | return $malIDArr; |
| 333 | 333 | } |
| 334 | - public function setMalID(int $userID, int $chapterID, ?int $malID) : bool { |
|
| 334 | + public function setMalID(int $userID, int $chapterID, ? int $malID) : bool { |
|
| 335 | 335 | //TODO: Handle NULL? |
| 336 | 336 | $success = (bool) $this->db->set(['mal_id' => $malID, 'active' => 'Y', 'last_updated' => NULL]) |
| 337 | 337 | ->where('user_id', $userID) |
@@ -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 @@ |
||
| 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')); |