@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | } |
59 | 59 | // Table | Column |
60 | 60 | $this->audSavePath = NN_COVERS . 'audiosample' . DS; // releases guid |
61 | - $this->imgSavePath = NN_COVERS . 'preview' . DS; // releases guid |
|
62 | - $this->jpgSavePath = NN_COVERS . 'sample' . DS; // releases guid |
|
63 | - $this->movieImgSavePath = NN_COVERS . 'movies' . DS; // releases imdbid |
|
64 | - $this->vidSavePath = NN_COVERS . 'video' . DS; // releases guid |
|
61 | + $this->imgSavePath = NN_COVERS . 'preview' . DS; // releases guid |
|
62 | + $this->jpgSavePath = NN_COVERS . 'sample' . DS; // releases guid |
|
63 | + $this->movieImgSavePath = NN_COVERS . 'movies' . DS; // releases imdbid |
|
64 | + $this->vidSavePath = NN_COVERS . 'video' . DS; // releases guid |
|
65 | 65 | |
66 | 66 | /* For reference. * |
67 | 67 | $this->anidbImgPath = NN_COVERS . 'anime' . DS; // anidb anidbid | used in populate_anidb.php, not anidb.php |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @return int 1 on success, 0 on failure Used on site to check if there is an image. |
114 | 114 | */ |
115 | - public function saveImage($imgName, $imgLoc, $imgSavePath, $imgMaxWidth='', $imgMaxHeight='', $saveThumb=false) |
|
115 | + public function saveImage($imgName, $imgLoc, $imgSavePath, $imgMaxWidth = '', $imgMaxHeight = '', $saveThumb = false) |
|
116 | 116 | { |
117 | 117 | // Try to get the image as a string. |
118 | 118 | $cover = $this->fetchImage($imgLoc); |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | $im = @imagecreatefromstring($cover); |
126 | 126 | $width = @imagesx($im); |
127 | 127 | $height = @imagesy($im); |
128 | - $ratio = min($imgMaxHeight/$height, $imgMaxWidth/$width); |
|
128 | + $ratio = min($imgMaxHeight / $height, $imgMaxWidth / $width); |
|
129 | 129 | // New dimensions |
130 | - $new_width = intval($ratio*$width); |
|
131 | - $new_height = intval($ratio*$height); |
|
130 | + $new_width = intval($ratio * $width); |
|
131 | + $new_height = intval($ratio * $height); |
|
132 | 132 | if ($new_width < $width && $new_width > 10 && $new_height > 10) { |
133 | 133 | $new_image = @imagecreatetruecolor($new_width, $new_height); |
134 | 134 | @imagecopyresampled($new_image, $im, 0, 0, 0, 0, $new_width, $new_height, $width, $height); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | @imagedestroy($new_image); |
139 | 139 | |
140 | 140 | if ($saveThumb) { |
141 | - @file_put_contents($imgSavePath.$imgName.'_thumb.jpg', $thumb); |
|
141 | + @file_put_contents($imgSavePath . $imgName . '_thumb.jpg', $thumb); |
|
142 | 142 | } else { |
143 | 143 | $cover = $thumb; |
144 | 144 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | @imagedestroy($im); |
149 | 149 | } |
150 | 150 | // Store it on the hard drive. |
151 | - $coverPath = $imgSavePath.$imgName.'.jpg'; |
|
151 | + $coverPath = $imgSavePath . $imgName . '.jpg'; |
|
152 | 152 | $coverSave = @file_put_contents($coverPath, $cover); |
153 | 153 | |
154 | 154 | // Check if it's on the drive. |
@@ -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 |