@@ -25,9 +25,9 @@ |
||
25 | 25 | // main switch for running tmux panes |
26 | 26 | public function runPane($cmdParam, &$runVar) |
27 | 27 | { |
28 | - switch ((int) $runVar['constants']['sequential']) { |
|
28 | + switch ((int)$runVar['constants']['sequential']) { |
|
29 | 29 | case 0: |
30 | - switch ((string) $cmdParam) { |
|
30 | + switch ((string)$cmdParam) { |
|
31 | 31 | case 'amazon': |
32 | 32 | $this->_runAmazon($runVar); |
33 | 33 | break; |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | define('NN_NIX', NN_UPDATE . 'nix' . DS); |
29 | 29 | |
30 | 30 | // /misc/update/nix/multiprocessing |
31 | -define('NN_MULTI', NN_UPDATE . 'nix' . DS. 'multiprocessing' . DS); |
|
31 | +define('NN_MULTI', NN_UPDATE . 'nix' . DS . 'multiprocessing' . DS); |
|
32 | 32 | |
33 | 33 | // /misc/update/nix/tmux/ |
34 | -define('NN_TMUX', NN_UPDATE . 'nix' . DS . 'tmux'. DS); |
|
34 | +define('NN_TMUX', NN_UPDATE . 'nix' . DS . 'tmux' . DS); |
|
35 | 35 | |
36 | 36 | // /misc/update/nix/multiprocessing/ |
37 | 37 | define('NN_MULTIPROCESSING', NN_NIX . 'multiprocessing' . DS); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | define('NN_SMARTY_CACHE', NN_RES . 'smarty' . DS . 'cache/'); |
50 | 50 | |
51 | 51 | // Smarty's configuration files. |
52 | -define('NN_SMARTY_CONFIGS', NN_RES .'smarty' . DS . 'configs/'); |
|
52 | +define('NN_SMARTY_CONFIGS', NN_RES . 'smarty' . DS . 'configs/'); |
|
53 | 53 | |
54 | 54 | // Smarty's compiled template cache. |
55 | 55 | define('NN_SMARTY_TEMPLATES', NN_RES . 'smarty' . DS . 'templates_c/'); |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | public function images() |
100 | 100 | { |
101 | 101 | if ($ret = $this->_html->find("div.workshopItemPreviewImageMain", 0)) { |
102 | - if(preg_match('#\'(?<largeimage>.*)\'#i', $ret->outertext, $matches)){ |
|
102 | + if (preg_match('#\'(?<largeimage>.*)\'#i', $ret->outertext, $matches)) { |
|
103 | 103 | $this->_res['cover'] = trim($matches['largeimage']); |
104 | - }else{ |
|
104 | + } else { |
|
105 | 105 | $this->_res['cover'] = $this->_html->find("img#previewImageMain", 0)->src; |
106 | 106 | } |
107 | 107 | } |
108 | 108 | if ($ret = $this->_html->find("div.screenshot_holder", 0)) { |
109 | 109 | if ($ret = $ret->find("a", 0)) { |
110 | - if(preg_match('#\'(?<backdropimage>.*)\'#', $ret->outertext, $matches)){ |
|
110 | + if (preg_match('#\'(?<backdropimage>.*)\'#', $ret->outertext, $matches)) { |
|
111 | 111 | $this->_res['backdrop'] = trim($matches['backdropimage']); |
112 | 112 | } |
113 | 113 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $result = true; |
188 | 188 | break; |
189 | 189 | } |
190 | - }else{ |
|
190 | + } else { |
|
191 | 191 | $result = false; |
192 | 192 | } |
193 | 193 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | { |
282 | 282 | $title = preg_replace('/[^\w]/', '', $title); |
283 | 283 | $searchtitle = preg_replace('/[^\w]/', '', $searchtitle); |
284 | - similar_text($title , $searchtitle, $p); |
|
284 | + similar_text($title, $searchtitle, $p); |
|
285 | 285 | if ($p == 100) { |
286 | 286 | return true; |
287 | 287 | } else { |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | |
645 | 645 | $this->fixed++; |
646 | 646 | |
647 | - if(!empty($release['fromname']) && preg_match('/oz@lot[.]com/i', $release['fromname'])) { |
|
647 | + if (!empty($release['fromname']) && preg_match('/oz@lot[.]com/i', $release['fromname'])) { |
|
648 | 648 | $newName = preg_replace('/KTR$/', 'SDCLiP', $newName); |
649 | 649 | } |
650 | 650 | $newName = explode("\\", $newName); |
@@ -948,10 +948,10 @@ discard block |
||
948 | 948 | $this->_fileName = $this->_cleanMatchFiles($release['filename']); |
949 | 949 | $pre = false; |
950 | 950 | $preMatch = preg_match('/(\d{2}\.\d{2}\.\d{2})+[\w-.]+[\w]$/i', $this->_fileName, $match); |
951 | - if($preMatch) { |
|
951 | + if ($preMatch) { |
|
952 | 952 | $result = $this->pdo->queryOneRow(sprintf("SELECT filename AS filename FROM predb WHERE MATCH(filename) AGAINST ('$match[0]' IN BOOLEAN MODE)")); |
953 | 953 | $preFTmatch = preg_match('/(\d{2}\.\d{2}\.\d{2})+[\w-.]+[\w]$/i', $result['filename'], $match1); |
954 | - if($preFTmatch) { |
|
954 | + if ($preFTmatch) { |
|
955 | 955 | if ($match[0] == $match1[0]) { |
956 | 956 | $this->_fileName = $result['filename']; |
957 | 957 | } |
@@ -1646,7 +1646,7 @@ discard block |
||
1646 | 1646 | $this->updateRelease($release, $result["4"], $method = "fileCheck: Generic movie 1", $echo, $type, $namestatus, $show); |
1647 | 1647 | break; |
1648 | 1648 | case preg_match('/^([a-z0-9\.\-_]+(19|20)\d\d[a-z0-9\.\-_]+[\.\-_ ](720p|1080p|BDRip|bluray|DVDRip|x264|XviD)[a-z0-9\.\-_]+)\.[a-z]{2,}$/i', $release["textstring"], $result): |
1649 | - $this->updateRelease($release, $result["1"], $method = "fileCheck: Generic movie 2", $echo, $type, $namestatus, $show); break; |
|
1649 | + $this->updateRelease($release, $result["1"], $method = "fileCheck: Generic movie 2", $echo, $type, $namestatus, $show); break; |
|
1650 | 1650 | case preg_match('/(.+?([\.\-_ ](CD|FM)|[\.\-_ ]\dCD|CDR|FLAC|SAT|WEB).+?(19|20)\d\d.+?)\\\\.+/i', $release["textstring"], $result): |
1651 | 1651 | $this->updateRelease($release, $result["1"], $method = "fileCheck: Generic music", $echo, $type, $namestatus, $show); |
1652 | 1652 | break; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | public function getGenres($type = '', $activeonly = false) |
34 | 34 | { |
35 | - return $this->pdo->query($this->getListQuery($type, $activeonly), true,NN_CACHE_EXPIRY_LONG); |
|
35 | + return $this->pdo->query($this->getListQuery($type, $activeonly), true, NN_CACHE_EXPIRY_LONG); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | private function getListQuery($type = '', $activeonly = false) |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | $updates = NN_CONFIGS . 'updates.json'; |
23 | 23 | if (!file_exists($updates)) { |
24 | - $json = [ 'script' => time()]; |
|
24 | + $json = ['script' => time()]; |
|
25 | 25 | file_put_contents(json_encode($json, JSON_PRETTY_PRINT)); |
26 | 26 | } |
27 | 27 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | spl_autoload_register( |
4 | - function ($className) { |
|
4 | + function($className) { |
|
5 | 5 | $paths = [ |
6 | 6 | NN_WWW . 'pages' . DS, |
7 | 7 | NN_WWW . 'pages' . DS . 'admin' . DS, |
@@ -17,25 +17,25 @@ |
||
17 | 17 | { |
18 | 18 | if ($date == "") |
19 | 19 | return "n/a"; |
20 | - $sec = mktime(0,0,0,date("m"), date("d"), date("Y")) - (( strtotime($date)) ? strtotime(date("Y-m-d", strtotime($date))) : strtotime(date("Y-m-d", $date))); |
|
20 | + $sec = mktime(0, 0, 0, date("m"), date("d"), date("Y")) - ((strtotime($date)) ? strtotime(date("Y-m-d", strtotime($date))) : strtotime(date("Y-m-d", $date))); |
|
21 | 21 | $min = $sec / 60; |
22 | 22 | $hrs = $min / 60; |
23 | - $days = $sec/60/60/24; |
|
24 | - if ( $hrs <= 24) return ' Today'; |
|
23 | + $days = $sec / 60 / 60 / 24; |
|
24 | + if ($hrs <= 24) return ' Today'; |
|
25 | 25 | if ($days >= 365) |
26 | 26 | { |
27 | - $years = round(($days/365), 1); |
|
28 | - return $years.' Yr'.($years!=1?"s":"").' ago'; |
|
27 | + $years = round(($days / 365), 1); |
|
28 | + return $years . ' Yr' . ($years != 1 ? "s" : "") . ' ago'; |
|
29 | 29 | } |
30 | 30 | else if ($days >= 90) |
31 | 31 | { |
32 | - return round($days/7).' Wks ago'; |
|
32 | + return round($days / 7) . ' Wks ago'; |
|
33 | 33 | } |
34 | 34 | else if ($days <= 2) |
35 | 35 | return 'Yesterday'; |
36 | 36 | else |
37 | 37 | { |
38 | - return round($days, 0).'d ago'; |
|
38 | + return round($days, 0) . 'd ago'; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | ?> |
42 | 42 | \ No newline at end of file |
@@ -52,31 +52,31 @@ |
||
52 | 52 | * @return string|void |
53 | 53 | * @uses smarty_make_timestamp() |
54 | 54 | */ |
55 | -function smarty_modifier_phpdate_format($string, $format="Y/m/d H:i:s", $default_date=null) |
|
55 | +function smarty_modifier_phpdate_format($string, $format = "Y/m/d H:i:s", $default_date = null) |
|
56 | 56 | { |
57 | 57 | /* if (substr(PHP_OS,0,3) == 'WIN') { |
58 | 58 | $_win_from = array ('%e', '%T', '%D'); |
59 | 59 | $_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y'); |
60 | 60 | $format = str_replace($_win_from, $_win_to, $format); |
61 | 61 | }*/ |
62 | - if (substr($format,0,5)=='DATE_'){ |
|
63 | - switch ($format){ |
|
64 | - case 'DATE_ATOM': $nformat=DATE_ATOM; break; |
|
65 | - case 'DATE_COOKIE': $nformat=DATE_COOKIE; break; |
|
66 | - case 'DATE_ISO8601': $nformat=DATE_ISO8601; break; |
|
67 | - case 'DATE_RFC822': $nformat="D, d M y H:i:s O"; break; //The php constant is not quite right - as the time-zone comes out with invalid values like "UTC"... |
|
68 | - case 'DATE_RFC850': $nformat=DATE_RFC850; break; |
|
69 | - case 'DATE_RFC1036': $nformat=DATE_RFC1036; break; |
|
70 | - case 'DATE_RFC1123': $nformat=DATE_RFC1123; break; |
|
71 | - case 'DATE_RFC2822': $nformat=DATE_RFC2822; break; |
|
72 | - case 'DATE_RFC3339': $nformat=DATE_RFC3339; break; |
|
73 | - case 'DATE_RSS': $nformat="D, d M Y H:i:s O"; break; //as rfc822 ... |
|
74 | - case 'DATE_W3C': $nformat=DATE_W3C; break; |
|
62 | + if (substr($format, 0, 5) == 'DATE_') { |
|
63 | + switch ($format) { |
|
64 | + case 'DATE_ATOM': $nformat = DATE_ATOM; break; |
|
65 | + case 'DATE_COOKIE': $nformat = DATE_COOKIE; break; |
|
66 | + case 'DATE_ISO8601': $nformat = DATE_ISO8601; break; |
|
67 | + case 'DATE_RFC822': $nformat = "D, d M y H:i:s O"; break; //The php constant is not quite right - as the time-zone comes out with invalid values like "UTC"... |
|
68 | + case 'DATE_RFC850': $nformat = DATE_RFC850; break; |
|
69 | + case 'DATE_RFC1036': $nformat = DATE_RFC1036; break; |
|
70 | + case 'DATE_RFC1123': $nformat = DATE_RFC1123; break; |
|
71 | + case 'DATE_RFC2822': $nformat = DATE_RFC2822; break; |
|
72 | + case 'DATE_RFC3339': $nformat = DATE_RFC3339; break; |
|
73 | + case 'DATE_RSS': $nformat = "D, d M Y H:i:s O"; break; //as rfc822 ... |
|
74 | + case 'DATE_W3C': $nformat = DATE_W3C; break; |
|
75 | 75 | } |
76 | 76 | } else { |
77 | - $nformat=$format; |
|
77 | + $nformat = $format; |
|
78 | 78 | } |
79 | - if($string != '') { |
|
79 | + if ($string != '') { |
|
80 | 80 | return date($nformat, smarty_make_timestamp($string)); |
81 | 81 | } elseif (isset($default_date) && $default_date != '') { |
82 | 82 | return date($nformat, smarty_make_timestamp($default_date)); |