@@ -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 HotChocolateScans extends Base_FoolSlide_Site_Model { |
4 | 4 | public $baseURL = 'http://hotchocolatescans.com/fs'; |
@@ -63,12 +63,12 @@ |
||
63 | 63 | if($show_404) show_404(); |
64 | 64 | } |
65 | 65 | |
66 | - private function _walk_recursive_remove (array $array, callable $callback) : array { |
|
67 | - foreach ($array as $k => $v) { |
|
68 | - if (is_array($v)) { |
|
66 | + private function _walk_recursive_remove(array $array, callable $callback) : array { |
|
67 | + foreach($array as $k => $v) { |
|
68 | + if(is_array($v)) { |
|
69 | 69 | $array[$k] = $this->_walk_recursive_remove($v, $callback); |
70 | 70 | } else { |
71 | - if ($callback($v, $k)) { |
|
71 | + if($callback($v, $k)) { |
|
72 | 72 | unset($array[$k]); |
73 | 73 | } |
74 | 74 | } |
@@ -136,7 +136,7 @@ |
||
136 | 136 | | |
137 | 137 | <a href="#" class="set-mal-id" data-mal-id="<?=$row['mal_id']?>" data-mal-type="<?=$row['mal_type']?>">Set MAL ID</a> <?php if(!is_null($row['mal_id']) && $row['mal_type'] == 'chapter') { ?><span>(<small><?=($row['mal_id'] !== '0' ? $row['mal_id'] : 'none')?></small>)</span><?php } ?> |
138 | 138 | | |
139 | - Tags (<a href="#" class="edit-tags small">Edit</a>): <span class="text-lowercase tag-list"><?=($row['has_tags'] ? implode("", array_map(function ($str) { return "<i class='tag'>{$str}</i>"; }, explode(",", $row['tag_list']))) : "none")?></span> |
|
139 | + Tags (<a href="#" class="edit-tags small">Edit</a>): <span class="text-lowercase tag-list"><?=($row['has_tags'] ? implode("", array_map(function($str) { return "<i class='tag'>{$str}</i>"; }, explode(",", $row['tag_list']))) : "none")?></span> |
|
140 | 140 | <div class="input-group hidden tag-edit"> |
141 | 141 | <input type="text" class="form-control" placeholder="tag1,tag2,tag3" maxlength="255" pattern='[a-z0-9-_,]{0,255}' value="<?=$row['tag_list']?>"> |
142 | 142 | <span class="input-group-btn"> |
@@ -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 YummyGummyScans extends Base_FoolSlide_Site_Model { |
4 | 4 | public $baseURL = 'http://reader.ygscans.com'; |
@@ -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 MerakiScans extends Base_Site_Model { |
4 | 4 | public $titleFormat = '/^[a-zA-Z0-9_-]+$/'; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | ]; |
16 | 16 | } |
17 | 17 | |
18 | - public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array { |
|
18 | + public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array { |
|
19 | 19 | $titleData = []; |
20 | 20 | |
21 | 21 | $fullURL = $this->getFullTitleURL($title_url); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $titleData['latest_chapter'] = preg_replace('/^.*\/([0-9\.]+)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href')); |
38 | 38 | |
39 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) substr($data['nodes_latest']->getAttribute('title'), 13))); |
|
39 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) substr($data['nodes_latest']->getAttribute('title'), 13))); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return (!empty($titleData) ? $titleData : NULL); |
@@ -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 Batoto extends Base_Site_Model { |
4 | 4 | //Batoto is a bit tricky to track. Unlike MangaFox and MangaHere, it doesn't store anything in the title_url, which means we have to get the data via other methods. |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | |
26 | 26 | $chapter_parts = explode(':--:', $chapter); |
27 | 27 | return [ |
28 | - 'url' => "https://bato.to/reader#" . $chapter_parts[0], |
|
28 | + 'url' => "https://bato.to/reader#".$chapter_parts[0], |
|
29 | 29 | 'number' => $chapter_parts[1] |
30 | 30 | ]; |
31 | 31 | } |
32 | 32 | |
33 | - public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array { |
|
33 | + public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array { |
|
34 | 34 | $titleData = []; |
35 | 35 | |
36 | 36 | $title_parts = explode(':--:', $title_url); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | preg_match('/^(?:Vol\.(?<volume>\S+) )?(?:Ch.(?<chapter>[^\s:]+)(?:\s?-\s?(?<extra>[0-9]+))?):?.*/', trim($data['nodes_chapter']->nodeValue), $text); |
62 | 62 | $chapter_url = $data['nodes_chapter']->getAttribute('href'); |
63 | - $titleData['latest_chapter'] = substr($chapter_url, strpos($chapter_url, "reader#") + 7) . ':--:' . ((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '') . 'c'.$text['chapter'] . (!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
63 | + $titleData['latest_chapter'] = substr($chapter_url, strpos($chapter_url, "reader#") + 7).':--:'.((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '').'c'.$text['chapter'].(!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
64 | 64 | |
65 | 65 | $dateString = $data['nodes_latest']->nodeValue; |
66 | 66 | if($dateString == 'An hour ago') { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $chapter = $nodes_chapter->item(0); |
171 | 171 | preg_match('/^(?:Vol\.(?<volume>\S+) )?(?:Ch.(?<chapter>[^\s:]+)(?:\s?-\s?(?<extra>[0-9]+))?):?.*/', trim($chapter->nodeValue), $text); |
172 | 172 | $chapter_url = $chapter->getAttribute('href'); |
173 | - $titleData['latest_chapter'] = substr($chapter_url, strpos($chapter_url, "reader#") + 7) . ':--:' . ((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '') . 'c'.$text['chapter'] . (!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
173 | + $titleData['latest_chapter'] = substr($chapter_url, strpos($chapter_url, "reader#") + 7).':--:'.((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '').'c'.$text['chapter'].(!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
174 | 174 | |
175 | 175 | $dateString = $nodes_latest->item(0)->nodeValue; |
176 | 176 | if($dateString == 'An hour ago') { |
@@ -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'])) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $query = $query->get(); |
143 | 143 | |
144 | 144 | if($query->num_rows() > 0) { |
145 | - foreach ($query->result() as $row) { |
|
145 | + foreach($query->result() as $row) { |
|
146 | 146 | 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 |
147 | 147 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
148 | 148 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -183,10 +183,10 @@ discard block |
||
183 | 183 | ->get(); |
184 | 184 | |
185 | 185 | $sites = $query->result_array(); |
186 | - foreach ($sites as $site) { |
|
186 | + foreach($sites as $site) { |
|
187 | 187 | $siteClass = $this->sites->{$site['site_class']}; |
188 | 188 | if($titleDataList = $siteClass->doCustomUpdate()) { |
189 | - foreach ($titleDataList as $titleURL => $titleData) { |
|
189 | + foreach($titleDataList as $titleURL => $titleData) { |
|
190 | 190 | print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
191 | 191 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
192 | 192 | if($dbTitleData = $this->Tracker->title->getID($titleURL, (int) $site['id'], FALSE, TRUE)) { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
227 | 227 | ->from('tracker_titles') |
228 | 228 | ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
229 | - ->where('tracker_titles.followed','N') |
|
229 | + ->where('tracker_titles.followed', 'N') |
|
230 | 230 | ->where('tracker_titles !=', '255') |
231 | 231 | ->where('tracker_sites.status', 'enabled') |
232 | 232 | ->where('tracker_sites.use_custom', 'Y') |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | // @formatter:on |
285 | 285 | |
286 | 286 | if($query->num_rows() > 0) { |
287 | - foreach ($query->result() as $row) { |
|
287 | + foreach($query->result() as $row) { |
|
288 | 288 | print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
289 | 289 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
290 | 290 | if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -19,17 +19,17 @@ discard block |
||
19 | 19 | function __construct() { |
20 | 20 | $this->ci = & get_instance(); |
21 | 21 | $this->ci->load->config('recaptcha', TRUE); |
22 | - if ($this->ci->config->item('recaptcha_secretkey', 'recaptcha') == NULL || $this->ci->config->item('recaptcha_secretkey', 'recaptcha') == "") { |
|
22 | + if($this->ci->config->item('recaptcha_secretkey', 'recaptcha') == NULL || $this->ci->config->item('recaptcha_secretkey', 'recaptcha') == "") { |
|
23 | 23 | die("To use reCAPTCHA you must get an API key from <a href='" |
24 | - . $this->signup_url . "'>" . $this->signup_url . "</a>"); |
|
24 | + . $this->signup_url."'>".$this->signup_url."</a>"); |
|
25 | 25 | } |
26 | - if ($this->ci->config->item('recaptcha_sitekey', 'recaptcha') == NULL || $this->ci->config->item('recaptcha_sitekey', 'recaptcha') == "") { |
|
26 | + if($this->ci->config->item('recaptcha_sitekey', 'recaptcha') == NULL || $this->ci->config->item('recaptcha_sitekey', 'recaptcha') == "") { |
|
27 | 27 | die("To use reCAPTCHA you must get an API key from <a href='" |
28 | - . $this->signup_url . "'>" . $this->signup_url . "</a>"); |
|
28 | + . $this->signup_url."'>".$this->signup_url."</a>"); |
|
29 | 29 | } |
30 | 30 | $this->_secret = $this->ci->config->item('recaptcha_secretkey', 'recaptcha'); |
31 | 31 | $this->_sitekey = $this->ci->config->item('recaptcha_sitekey', 'recaptcha'); |
32 | - if ($this->ci->config->item('lang', 'recaptcha') == NULL || $this->ci->config->item('lang', 'recaptcha') == "") { |
|
32 | + if($this->ci->config->item('lang', 'recaptcha') == NULL || $this->ci->config->item('lang', 'recaptcha') == "") { |
|
33 | 33 | $this->_lang = 'en'; |
34 | 34 | } else { |
35 | 35 | $this->_lang = $this->ci->config->item('lang', 'recaptcha'); |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | */ |
44 | 44 | private function _encodeQS($data) { |
45 | 45 | $req = ""; |
46 | - foreach ($data as $key => $value) { |
|
47 | - $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; |
|
46 | + foreach($data as $key => $value) { |
|
47 | + $req .= $key.'='.urlencode(stripslashes($value)).'&'; |
|
48 | 48 | } |
49 | 49 | return substr($req, 0, strlen($req) - 1); |
50 | 50 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | private function _submitHTTPGet($path, $data) { |
59 | 59 | $req = $this->_encodeQS($data); |
60 | - $response = file_get_contents($path . $req); |
|
60 | + $response = file_get_contents($path.$req); |
|
61 | 61 | return $response; |
62 | 62 | } |
63 | 63 | |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | * @return string embedded HTML |
68 | 68 | */ |
69 | 69 | public function render() { |
70 | - $return = '<div class="g-recaptcha" data-sitekey="' . $this->_sitekey . '"></div> |
|
71 | - <script src="https://www.google.com/recaptcha/api.js?hl=' . $this->_lang . '" async defer></script>'; |
|
70 | + $return = '<div class="g-recaptcha" data-sitekey="'.$this->_sitekey.'"></div> |
|
71 | + <script src="https://www.google.com/recaptcha/api.js?hl=' . $this->_lang.'" async defer></script>'; |
|
72 | 72 | return $return; |
73 | 73 | } |
74 | 74 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @return array Array of response |
80 | 80 | */ |
81 | 81 | public function verifyResponse($response, $remoteIp = NULL) { |
82 | - if ($response == null || strlen($response) == 0) { |
|
82 | + if($response == null || strlen($response) == 0) { |
|
83 | 83 | // Empty user's input |
84 | 84 | $return = array( |
85 | 85 | 'success' => FALSE, |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | ); |
98 | 98 | $answers = json_decode($getResponse, TRUE); |
99 | 99 | |
100 | - if (trim($answers ['success']) == true) { |
|
100 | + if(trim($answers ['success']) == true) { |
|
101 | 101 | // Right captcha! |
102 | 102 | $return = array( |
103 | 103 | 'success' => TRUE, |
@@ -6,7 +6,7 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | $config['table'] = 'rate_limit'; |
9 | -$config['base_limit'] = 0; // Infinite |
|
9 | +$config['base_limit'] = 0; // Infinite |
|
10 | 10 | $config['header_show'] = TRUE; // Should a rate limit info header be injected? |
11 | 11 | $config['header_prefix'] = 'X-RateLimit-'; |
12 | 12 | $config['whitelist'] = array('127.0.0.1'); // Clients ignored by the limiter |