@@ -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')); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | case 'csv': |
| 33 | 33 | $this->output->set_content_type('text/csv', 'utf-8'); |
| 34 | - $this->_render_content($this->arrayToCSVRecursive($historyData), 'csv',TRUE, 'tracker-history'); |
|
| 34 | + $this->_render_content($this->arrayToCSVRecursive($historyData), 'csv', TRUE, 'tracker-history'); |
|
| 35 | 35 | break; |
| 36 | 36 | |
| 37 | 37 | default: |
@@ -50,15 +50,15 @@ discard block |
||
| 50 | 50 | $enclosure_esc = preg_quote($enclosure, '/'); |
| 51 | 51 | |
| 52 | 52 | $output = array(); |
| 53 | - foreach ($fields as $field) { |
|
| 54 | - if ($field === NULL && $nullToMysqlNull) { |
|
| 53 | + foreach($fields as $field) { |
|
| 54 | + if($field === NULL && $nullToMysqlNull) { |
|
| 55 | 55 | $output[] = 'NULL'; |
| 56 | 56 | continue; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Enclose fields containing $delimiter, $enclosure or whitespace |
| 60 | - if ($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) { |
|
| 61 | - $output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure; |
|
| 60 | + if($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) { |
|
| 61 | + $output[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $field).$enclosure; |
|
| 62 | 62 | } else { |
| 63 | 63 | $output[] = $field; |
| 64 | 64 | } |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | $csvArr = [ |
| 71 | 71 | 'Date/Time,Title,URL,Site,Status' |
| 72 | 72 | ]; |
| 73 | - foreach ($fields as $field) { |
|
| 74 | - $csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure,$encloseAll,$nullToMysqlNull); |
|
| 73 | + foreach($fields as $field) { |
|
| 74 | + $csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure, $encloseAll, $nullToMysqlNull); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - return implode(PHP_EOL,$csvArr); |
|
| 77 | + return implode(PHP_EOL, $csvArr); |
|
| 78 | 78 | } |
| 79 | 79 | } |
@@ -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 UpdateStatus extends MY_Controller { |
| 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 AdminPanel extends Admin_Controller { |
| 4 | 4 | public function __construct() { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | if(!empty($matches)) { |
| 82 | 82 | $malID = ($matches[1] !== 'none' ? $matches[1] : '0'); |
| 83 | - $new_tags = implode(',', array_diff( explode(',', $row->tags), [$matches[0]])); |
|
| 83 | + $new_tags = implode(',', array_diff(explode(',', $row->tags), [$matches[0]])); |
|
| 84 | 84 | |
| 85 | 85 | $this->db->set(['mal_id' => $malID, 'tags' => $new_tags, 'last_updated' => NULL]) |
| 86 | 86 | ->where('id', $row->id) |
@@ -6,7 +6,7 @@ discard block |
||
| 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 | $this->load->driver('cache', array('adapter' => 'file', 'backup' => 'apc')); //Sadly we can't autoload this with params |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | $this->global_data['analytics_tracking_id'] = $this->config->item('tracking_id'); |
| 21 | 21 | |
| 22 | 22 | $css_path = "css/main.{$this->User_Options->get('theme')}"; |
| 23 | - $this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH . "../public/assets/{$css_path}.css").".css"; |
|
| 23 | + $this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH."../public/assets/{$css_path}.css").".css"; |
|
| 24 | 24 | |
| 25 | 25 | $js_path = 'js/compiled.min'; |
| 26 | - $this->global_data['complied_js_path'] = asset_url()."{$js_path}.".filemtime(APPPATH . "../public/assets/{$js_path}.js").".js"; |
|
| 26 | + $this->global_data['complied_js_path'] = asset_url()."{$js_path}.".filemtime(APPPATH."../public/assets/{$js_path}.js").".js"; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function _render_page(/*(array) $paths*/) : void { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $json = is_array($json_input) ? json_encode($json_input) : $json_input; |
| 48 | 48 | |
| 49 | 49 | $this->output->set_content_type('application/json', 'utf-8'); |
| 50 | - $this->_render_content($json,'json', $download, $filenamePrefix); |
|
| 50 | + $this->_render_content($json, 'json', $download, $filenamePrefix); |
|
| 51 | 51 | } |
| 52 | 52 | public function _render_content(string $content, string $filenameExt, bool $download = FALSE, string $filenamePrefix = 'tracker') : void { |
| 53 | 53 | if($download) { |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | * URL: /ajax/update_inline |
| 27 | 27 | */ |
| 28 | 28 | public function update() : void { |
| 29 | - $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
| 30 | - $this->form_validation->set_rules('chapter', 'Chapter', 'required'); |
|
| 29 | + $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
| 30 | + $this->form_validation->set_rules('chapter', 'Chapter', 'required'); |
|
| 31 | 31 | |
| 32 | 32 | if($this->form_validation->run() === TRUE) { |
| 33 | 33 | $success = $this->Tracker->list->updateByID($this->userID, $this->input->post('id'), $this->input->post('chapter')); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * URL: /tag_update |
| 123 | 123 | */ |
| 124 | 124 | public function tag_update() : void { |
| 125 | - $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
| 125 | + $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
| 126 | 126 | $this->form_validation->set_rules('tag_string', 'Tag String', 'max_length[255]|is_valid_tag_string|not_equals[none]'); |
| 127 | 127 | |
| 128 | 128 | if($this->form_validation->run() === TRUE) { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | * URL: /set_category |
| 170 | 170 | */ |
| 171 | 171 | public function set_category() : void { |
| 172 | - $this->form_validation->set_rules('id[]', 'List of IDs', 'required|ctype_digit'); |
|
| 172 | + $this->form_validation->set_rules('id[]', 'List of IDs', 'required|ctype_digit'); |
|
| 173 | 173 | $this->form_validation->set_rules('category', 'Category Name', 'required|is_valid_category'); |
| 174 | 174 | |
| 175 | 175 | if($this->form_validation->run() === TRUE) { |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | * URL: /ajax/ignore_inline |
| 216 | 216 | */ |
| 217 | 217 | public function ignore() : void { |
| 218 | - $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
| 219 | - $this->form_validation->set_rules('chapter', 'Chapter', 'required'); |
|
| 218 | + $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
| 219 | + $this->form_validation->set_rules('chapter', 'Chapter', 'required'); |
|
| 220 | 220 | |
| 221 | 221 | if($this->form_validation->run() === TRUE) { |
| 222 | 222 | $success = $this->Tracker->list->ignoreByID($this->userID, $this->input->post('id'), $this->input->post('chapter')); |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | * URL: /set_mal_id |
| 239 | 239 | */ |
| 240 | 240 | public function set_mal_id() : void { |
| 241 | - $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
| 242 | - $this->form_validation->set_rules('mal_id', 'MAL ID', 'regex_match[/^[0-9]*$/]'); |
|
| 241 | + $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
| 242 | + $this->form_validation->set_rules('mal_id', 'MAL ID', 'regex_match[/^[0-9]*$/]'); |
|
| 243 | 243 | |
| 244 | 244 | if($this->form_validation->run() === TRUE) { |
| 245 | 245 | $malID = (is_numeric($this->input->post('mal_id')) ? $this->input->post('mal_id') : NULL); |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | public function report_bug() : void { |
| 79 | 79 | $this->load->library('user_agent'); |
| 80 | 80 | if($this->output->is_custom_header_set()) { $this->output->reset_status_header(); return; } |
| 81 | - $this->form_validation->set_rules('bug[url]', 'Bug [URL]', 'required'); |
|
| 81 | + $this->form_validation->set_rules('bug[url]', 'Bug [URL]', 'required'); |
|
| 82 | 82 | $this->form_validation->set_rules('bug[text]', 'Bug [Text]', 'required'); |
| 83 | 83 | |
| 84 | 84 | if($this->form_validation->run() === TRUE) { |
@@ -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 | /** |
| 4 | 4 | * Checks if view file exists. |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @return bool |
| 7 | 7 | */ |
| 8 | 8 | function view_exists(string $path) : bool { |
| 9 | - return file_exists(APPPATH . "/views/{$path}.php"); |
|
| 9 | + return file_exists(APPPATH."/views/{$path}.php"); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | function get_time_class(string $time_string) : string { |
@@ -32,19 +32,19 @@ discard block |
||
| 32 | 32 | return $time_string; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917 |
|
| 36 | - function http_parse_headers (string $raw_headers) : array { |
|
| 35 | +if(!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917 |
|
| 36 | + function http_parse_headers(string $raw_headers) : array { |
|
| 37 | 37 | $headers = array(); // $headers = []; |
| 38 | - foreach (explode("\n", $raw_headers) as $i => $h) { |
|
| 38 | + foreach(explode("\n", $raw_headers) as $i => $h) { |
|
| 39 | 39 | $h = explode(':', $h, 2); |
| 40 | - if (isset($h[1])){ |
|
| 41 | - if(!isset($headers[$h[0]])){ |
|
| 40 | + if(isset($h[1])) { |
|
| 41 | + if(!isset($headers[$h[0]])) { |
|
| 42 | 42 | $headers[$h[0]] = trim($h[1]); |
| 43 | - }else if(is_array($headers[$h[0]])){ |
|
| 44 | - $tmp = array_merge($headers[$h[0]],array(trim($h[1]))); |
|
| 43 | + } else if(is_array($headers[$h[0]])) { |
|
| 44 | + $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); |
|
| 45 | 45 | $headers[$h[0]] = $tmp; |
| 46 | - }else{ |
|
| 47 | - $tmp = array_merge(array($headers[$h[0]]),array(trim($h[1]))); |
|
| 46 | + } else { |
|
| 47 | + $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); |
|
| 48 | 48 | $headers[$h[0]] = $tmp; |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -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') |