@@ -1,5 +1,5 @@ |
||
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 | | ------------------------------------------------------------------- |
@@ -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 | /* |
4 | 4 | | ------------------------------------------------------------------------- |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $route['ajax/hide_notice']['post'] = 'Ajax/TrackerInline/hide_notice'; |
97 | 97 | $route['ajax/set_mal_id']['post'] = 'Ajax/TrackerInline/set_mal_id'; |
98 | 98 | |
99 | -$route['export_list'] = 'Ajax/TrackerInline/export'; |
|
99 | +$route['export_list'] = 'Ajax/TrackerInline/export'; |
|
100 | 100 | //$route['import_list']['post'] = 'Ajax/TrackerInline/import'; |
101 | 101 | |
102 | 102 | $route['import_amr'] = 'Import_AMR'; |
@@ -76,7 +76,7 @@ |
||
76 | 76 | 'jpeg' => array('image/jpeg', 'image/pjpeg'), |
77 | 77 | 'jpg' => array('image/jpeg', 'image/pjpeg'), |
78 | 78 | 'jpe' => array('image/jpeg', 'image/pjpeg'), |
79 | - 'png' => array('image/png', 'image/x-png'), |
|
79 | + 'png' => array('image/png', 'image/x-png'), |
|
80 | 80 | 'tiff' => 'image/tiff', |
81 | 81 | 'tif' => 'image/tiff', |
82 | 82 | 'css' => array('text/css', 'text/plain'), |
@@ -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 | /* |
4 | 4 | | ------------------------------------------------------------------- |
@@ -1,5 +1,5 @@ |
||
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 | $_doctypes = array( |
5 | 5 | 'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', |
@@ -17,48 +17,48 @@ |
||
17 | 17 | |
18 | 18 | // smiley image name width height alt |
19 | 19 | |
20 | - ':-)' => array('grin.gif', '19', '19', 'grin'), |
|
21 | - ':lol:' => array('lol.gif', '19', '19', 'LOL'), |
|
22 | - ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), |
|
23 | - ':)' => array('smile.gif', '19', '19', 'smile'), |
|
24 | - ';-)' => array('wink.gif', '19', '19', 'wink'), |
|
25 | - ';)' => array('wink.gif', '19', '19', 'wink'), |
|
26 | - ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), |
|
27 | - ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), |
|
28 | - ':-S' => array('confused.gif', '19', '19', 'confused'), |
|
29 | - ':wow:' => array('surprise.gif', '19', '19', 'surprised'), |
|
30 | - ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), |
|
31 | - ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), |
|
32 | - '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), |
|
33 | - ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), |
|
34 | - ':P' => array('raspberry.gif', '19', '19', 'raspberry'), |
|
35 | - ':blank:' => array('blank.gif', '19', '19', 'blank stare'), |
|
36 | - ':long:' => array('longface.gif', '19', '19', 'long face'), |
|
37 | - ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), |
|
38 | - ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), |
|
39 | - ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), |
|
40 | - '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), |
|
41 | - ':down:' => array('downer.gif', '19', '19', 'downer'), |
|
42 | - ':red:' => array('embarrassed.gif', '19', '19', 'red face'), |
|
43 | - ':sick:' => array('sick.gif', '19', '19', 'sick'), |
|
44 | - ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), |
|
45 | - ':-/' => array('hmm.gif', '19', '19', 'hmmm'), |
|
46 | - '>:(' => array('mad.gif', '19', '19', 'mad'), |
|
47 | - ':mad:' => array('mad.gif', '19', '19', 'mad'), |
|
48 | - '>:-(' => array('angry.gif', '19', '19', 'angry'), |
|
49 | - ':angry:' => array('angry.gif', '19', '19', 'angry'), |
|
50 | - ':zip:' => array('zip.gif', '19', '19', 'zipper'), |
|
51 | - ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), |
|
52 | - ':ahhh:' => array('shock.gif', '19', '19', 'shock'), |
|
53 | - ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), |
|
54 | - ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), |
|
55 | - ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), |
|
56 | - ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), |
|
57 | - ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), |
|
58 | - ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), |
|
59 | - ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), |
|
60 | - ':snake:' => array('snake.gif', '19', '19', 'snake'), |
|
61 | - ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'), |
|
62 | - ':question:' => array('question.gif', '19', '19', 'question') |
|
20 | + ':-)' => array('grin.gif', '19', '19', 'grin'), |
|
21 | + ':lol:' => array('lol.gif', '19', '19', 'LOL'), |
|
22 | + ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), |
|
23 | + ':)' => array('smile.gif', '19', '19', 'smile'), |
|
24 | + ';-)' => array('wink.gif', '19', '19', 'wink'), |
|
25 | + ';)' => array('wink.gif', '19', '19', 'wink'), |
|
26 | + ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), |
|
27 | + ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), |
|
28 | + ':-S' => array('confused.gif', '19', '19', 'confused'), |
|
29 | + ':wow:' => array('surprise.gif', '19', '19', 'surprised'), |
|
30 | + ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), |
|
31 | + ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), |
|
32 | + '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), |
|
33 | + ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), |
|
34 | + ':P' => array('raspberry.gif', '19', '19', 'raspberry'), |
|
35 | + ':blank:' => array('blank.gif', '19', '19', 'blank stare'), |
|
36 | + ':long:' => array('longface.gif', '19', '19', 'long face'), |
|
37 | + ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), |
|
38 | + ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), |
|
39 | + ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), |
|
40 | + '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), |
|
41 | + ':down:' => array('downer.gif', '19', '19', 'downer'), |
|
42 | + ':red:' => array('embarrassed.gif', '19', '19', 'red face'), |
|
43 | + ':sick:' => array('sick.gif', '19', '19', 'sick'), |
|
44 | + ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), |
|
45 | + ':-/' => array('hmm.gif', '19', '19', 'hmmm'), |
|
46 | + '>:(' => array('mad.gif', '19', '19', 'mad'), |
|
47 | + ':mad:' => array('mad.gif', '19', '19', 'mad'), |
|
48 | + '>:-(' => array('angry.gif', '19', '19', 'angry'), |
|
49 | + ':angry:' => array('angry.gif', '19', '19', 'angry'), |
|
50 | + ':zip:' => array('zip.gif', '19', '19', 'zipper'), |
|
51 | + ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), |
|
52 | + ':ahhh:' => array('shock.gif', '19', '19', 'shock'), |
|
53 | + ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), |
|
54 | + ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), |
|
55 | + ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), |
|
56 | + ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), |
|
57 | + ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), |
|
58 | + ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), |
|
59 | + ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), |
|
60 | + ':snake:' => array('snake.gif', '19', '19', 'snake'), |
|
61 | + ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'), |
|
62 | + ':question:' => array('question.gif', '19', '19', 'question') |
|
63 | 63 | |
64 | 64 | ); |
@@ -1,5 +1,5 @@ |
||
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 | | ------------------------------------------------------------------- |
@@ -245,7 +245,7 @@ |
||
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
248 | - * @param $md5 |
|
248 | + * @param string $md5 |
|
249 | 249 | * |
250 | 250 | * @return array |
251 | 251 | */ |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @since Version 1.0.0 |
36 | 36 | * @filesource |
37 | 37 | */ |
38 | -defined('BASEPATH') OR exit('No direct script access allowed'); |
|
38 | +defined('BASEPATH') or exit('No direct script access allowed'); |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Database Cache Class |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $last_key = 0; |
255 | 255 | $last_value = 0; |
256 | 256 | |
257 | - foreach($this->CI->config->item('multi_level_cache_folders') AS $key => $value) { |
|
257 | + foreach($this->CI->config->item('multi_level_cache_folders') as $key => $value) { |
|
258 | 258 | if($key != 0) { |
259 | 259 | $key = $last_key + $last_value; |
260 | 260 | } |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function __construct(&$db) { |
76 | 76 | // Assign the main CI object to $this->CI and load the file helper since we use it a lot |
77 | - $this->CI =& get_instance(); |
|
78 | - $this->db =& $db; |
|
77 | + $this->CI = & get_instance(); |
|
78 | + $this->db = & $db; |
|
79 | 79 | $this->CI->load->helper('file'); |
80 | 80 | |
81 | 81 | $this->check_path(); |
@@ -102,18 +102,18 @@ discard block |
||
102 | 102 | |
103 | 103 | // Add a trailing slash to the path if needed |
104 | 104 | $path = realpath($path) |
105 | - ? rtrim(realpath($path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR |
|
106 | - : rtrim($path, '/') . '/'; |
|
105 | + ? rtrim(realpath($path), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR |
|
106 | + : rtrim($path, '/').'/'; |
|
107 | 107 | |
108 | 108 | if(!is_dir($path)) { |
109 | - log_message('debug', 'DB cache path error: ' . $path); |
|
109 | + log_message('debug', 'DB cache path error: '.$path); |
|
110 | 110 | |
111 | 111 | // If the path is wrong we'll turn off caching |
112 | 112 | return $this->db->cache_off(); |
113 | 113 | } |
114 | 114 | |
115 | 115 | if(!is_really_writable($path)) { |
116 | - log_message('debug', 'DB cache dir not writable: ' . $path); |
|
116 | + log_message('debug', 'DB cache dir not writable: '.$path); |
|
117 | 117 | |
118 | 118 | // If the path is not really writable we'll turn off caching |
119 | 119 | return $this->db->cache_off(); |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | // BEGIN --- modification for supporting multi-level cache folders |
144 | 144 | |
145 | 145 | if(is_array($this->CI->config->item('multi_level_cache_folders'))) { |
146 | - $uri_md5 = md5($segment_one . '+' . $segment_two); |
|
146 | + $uri_md5 = md5($segment_one.'+'.$segment_two); |
|
147 | 147 | $layer = $this->get_folder_layers($uri_md5); |
148 | - $filepath = $this->db->cachedir . $segment_one . '/' . $segment_two . '/' . trim(implode('/', $layer), '/') . '/' . $uri_md5; |
|
148 | + $filepath = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'.trim(implode('/', $layer), '/').'/'.$uri_md5; |
|
149 | 149 | } else { |
150 | - $filepath = $this->db->cachedir . $segment_one . '/' . $segment_two . '/' . md5($sql); |
|
150 | + $filepath = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'.md5($sql); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | // END --- modification for supporting multi-level cache folders |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | // BEGIN --- modification for supporting multi-level cache folders |
179 | 179 | |
180 | 180 | if(is_array($this->CI->config->item('multi_level_cache_folders'))) { |
181 | - $uri_md5 = md5($segment_one . '+' . $segment_two); |
|
181 | + $uri_md5 = md5($segment_one.'+'.$segment_two); |
|
182 | 182 | $layer = $this->get_folder_layers($uri_md5); |
183 | - $dir_path = $this->db->cachedir . $segment_one . '/' . $segment_two . '/' . trim(implode('/', $layer), '/') . '/'; |
|
183 | + $dir_path = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'.trim(implode('/', $layer), '/').'/'; |
|
184 | 184 | |
185 | 185 | if(!is_dir($dir_path)) { |
186 | 186 | $old = umask(0); |
@@ -188,18 +188,18 @@ discard block |
||
188 | 188 | umask($old); |
189 | 189 | } |
190 | 190 | } else { |
191 | - $dir_path = $this->db->cachedir . $segment_one . '/' . $segment_two . '/'; |
|
191 | + $dir_path = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | $filename = md5($sql); |
195 | 195 | |
196 | 196 | // END --- modification for supporting multi-level cache folders |
197 | 197 | |
198 | - if(write_file($dir_path . $filename, serialize($object)) === FALSE) { |
|
198 | + if(write_file($dir_path.$filename, serialize($object)) === FALSE) { |
|
199 | 199 | return FALSE; |
200 | 200 | } |
201 | 201 | |
202 | - chmod($dir_path . $filename, 0640); |
|
202 | + chmod($dir_path.$filename, 0640); |
|
203 | 203 | return TRUE; |
204 | 204 | } |
205 | 205 | |
@@ -223,11 +223,11 @@ discard block |
||
223 | 223 | } |
224 | 224 | |
225 | 225 | if(is_array($this->CI->config->item('multi_level_cache_folders'))) { |
226 | - $uri_md5 = md5($segment_one . '+' . $segment_two); |
|
226 | + $uri_md5 = md5($segment_one.'+'.$segment_two); |
|
227 | 227 | $layer = $this->get_folder_layers($uri_md5); |
228 | - $dir_path = $this->db->cachedir . $segment_one . '/' . $segment_two . '/' . trim(implode('/', $layer), '/') . '/'; |
|
228 | + $dir_path = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'.trim(implode('/', $layer), '/').'/'; |
|
229 | 229 | } else { |
230 | - $dir_path = $this->db->cachedir . $segment_one . '/' . $segment_two . '/'; |
|
230 | + $dir_path = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'; |
|
231 | 231 | } |
232 | 232 | delete_files($dir_path, TRUE); |
233 | 233 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | // if this class is already loaded before instantiating it. Loading it now |
23 | 23 | // makes sure our version is used when a controller enables query caching |
24 | 24 | if(!class_exists('CI_DB_Cache')) { |
25 | - @include(APPPATH . 'libraries/MY_DB_cache.php'); |
|
25 | + @include(APPPATH.'libraries/MY_DB_cache.php'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | // call the parent method to retain the CI functionality |
@@ -137,7 +137,9 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | $success = $this->set_db($idData, $valueData); |
140 | - if($success) $this->session->unset_tempdata("option_{$option}"); |
|
140 | + if($success) { |
|
141 | + $this->session->unset_tempdata("option_{$option}"); |
|
142 | + } |
|
141 | 143 | } else { |
142 | 144 | $success = FALSE; |
143 | 145 | } |
@@ -164,7 +166,9 @@ discard block |
||
164 | 166 | } |
165 | 167 | |
166 | 168 | //Overall fallback method. |
167 | - if(!isset($value)) $value = $this->options[$option]['default']; |
|
169 | + if(!isset($value)) { |
|
170 | + $value = $this->options[$option]['default']; |
|
171 | + } |
|
168 | 172 | } else { |
169 | 173 | $value = FALSE; |
170 | 174 | } |
@@ -215,7 +219,10 @@ discard block |
||
215 | 219 | //This should never happen. |
216 | 220 | break; |
217 | 221 | } |
218 | - if(!isset($value)) $value = FALSE; //FIXME: This won't play nice with BOOL type false? |
|
222 | + if(!isset($value)) { |
|
223 | + $value = FALSE; |
|
224 | + } |
|
225 | + //FIXME: This won't play nice with BOOL type false? |
|
219 | 226 | |
220 | 227 | return $value; |
221 | 228 | } |
@@ -114,7 +114,7 @@ |
||
114 | 114 | * @param string $option |
115 | 115 | * @param int|null $userID |
116 | 116 | * |
117 | - * @return mixed Returns option value as STRING, or FALSE if option does not exist. |
|
117 | + * @return string Returns option value as STRING, or FALSE if option does not exist. |
|
118 | 118 | */ |
119 | 119 | public function get(string $option, ?int $userID = NULL) { |
120 | 120 | $userID = (is_null($userID) ? (int) $this->User->id : $userID); |
@@ -188,18 +188,18 @@ |
||
188 | 188 | //FIXME: Query duplication. |
189 | 189 | if($this->User->id !== $userID) { |
190 | 190 | $query = $this->db->select('value_str, value_int') |
191 | - ->from('user_options') |
|
192 | - ->where('user_id', $userID) |
|
193 | - ->where('name', $option) |
|
194 | - ->limit(1); |
|
191 | + ->from('user_options') |
|
192 | + ->where('user_id', $userID) |
|
193 | + ->where('name', $option) |
|
194 | + ->limit(1); |
|
195 | 195 | $data = $query->get()->row_array(); |
196 | 196 | } else { |
197 | 197 | if(!($data = $this->session->tempdata("option_{$option}"))) { |
198 | 198 | $query = $this->db->select('value_str, value_int') |
199 | - ->from('user_options') |
|
200 | - ->where('user_id', $userID) |
|
201 | - ->where('name', $option) |
|
202 | - ->limit(1); |
|
199 | + ->from('user_options') |
|
200 | + ->where('user_id', $userID) |
|
201 | + ->where('name', $option) |
|
202 | + ->limit(1); |
|
203 | 203 | $data = $query->get()->row_array(); |
204 | 204 | $this->session->set_tempdata("option_{$option}", $data, 3600); |
205 | 205 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $query = $this->db->select('value_str, value_int') |
201 | 201 | ->from('user_options') |
202 | 202 | ->where('user_id', $userID) |
203 | - ->where('name', $option) |
|
203 | + ->where('name', $option) |
|
204 | 204 | ->limit(1); |
205 | 205 | $data = $query->get()->row_array(); |
206 | 206 | } else { |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $query = $this->db->select('value_str, value_int') |
209 | 209 | ->from('user_options') |
210 | 210 | ->where('user_id', $userID) |
211 | - ->where('name', $option) |
|
211 | + ->where('name', $option) |
|
212 | 212 | ->limit(1); |
213 | 213 | $data = $query->get()->row_array(); |
214 | 214 | $this->session->set_tempdata("option_{$option}", $data, 3600); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | ); |
262 | 262 | //FIXME: Get a better solution than str_replace for removing special characters |
263 | 263 | $elements = array(); |
264 | - foreach (array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
264 | + foreach(array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
265 | 265 | $elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array( |
266 | 266 | 'value' => $valid_option |
267 | 267 | )); |
@@ -9,9 +9,9 @@ |
||
9 | 9 | $success = FALSE; |
10 | 10 | if(preg_match("/^[a-z0-9\\-_,:]{0,255}$/", $tag_string)) { |
11 | 11 | $success = (bool) $this->db->set(['tags' => $tag_string, 'active' => 'Y', 'last_updated' => NULL]) |
12 | - ->where('user_id', $userID) |
|
13 | - ->where('id', $chapterID) |
|
14 | - ->update('tracker_chapters'); |
|
12 | + ->where('user_id', $userID) |
|
13 | + ->where('id', $chapterID) |
|
14 | + ->update('tracker_chapters'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | if($success) { |
@@ -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_Tag_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |