@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * |
| 134 | 134 | * @return void |
| 135 | 135 | */ |
| 136 | - public function backfillAllGroups($groupName = '', $articles ='', $type = '') |
|
| 136 | + public function backfillAllGroups($groupName = '', $articles = '', $type = '') |
|
| 137 | 137 | { |
| 138 | 138 | $res = []; |
| 139 | 139 | if ($groupName !== '') { |
@@ -275,8 +275,7 @@ discard block |
||
| 275 | 275 | $dMessage = |
| 276 | 276 | "We have hit the maximum we can backfill for " . |
| 277 | 277 | $groupName . |
| 278 | - ($this->_disableBackfillGroup ? ", disabling backfill on it." : |
|
| 279 | - ", skipping it, consider disabling backfill on it."); |
|
| 278 | + ($this->_disableBackfillGroup ? ", disabling backfill on it." : ", skipping it, consider disabling backfill on it."); |
|
| 280 | 279 | if ($this->_debug) { |
| 281 | 280 | $this->_debugging->log(get_class(), __FUNCTION__, $dMessage, Logger::LOG_NOTICE); |
| 282 | 281 | } |
@@ -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/'); |
@@ -281,7 +281,7 @@ |
||
| 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 { |
@@ -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 { |
@@ -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 | } |
@@ -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; |
@@ -783,8 +783,7 @@ |
||
| 783 | 783 | 'release_id' => 0, |
| 784 | 784 | 'method' => '' |
| 785 | 785 | ] |
| 786 | - ) |
|
| 787 | - { |
|
| 786 | + ) { |
|
| 788 | 787 | echo |
| 789 | 788 | PHP_EOL . |
| 790 | 789 | ColorCLI::headerOver('New name: ') . ColorCLI::primaryOver($data['new_name']) . PHP_EOL . |
@@ -1734,7 +1734,7 @@ discard block |
||
| 1734 | 1734 | ); |
| 1735 | 1735 | |
| 1736 | 1736 | if ($result instanceof \Traversable) { |
| 1737 | - foreach ($result AS $res) { |
|
| 1737 | + foreach ($result as $res) { |
|
| 1738 | 1738 | $floor = round(($res['relsize'] - $release['relsize']) / $res['relsize'] * 100, 1); |
| 1739 | 1739 | if ($floor >= -5 && $floor <= 5) { |
| 1740 | 1740 | $this->updateRelease( |
@@ -1784,7 +1784,7 @@ discard block |
||
| 1784 | 1784 | ); |
| 1785 | 1785 | |
| 1786 | 1786 | if ($result instanceof \Traversable) { |
| 1787 | - foreach ($result AS $res) { |
|
| 1787 | + foreach ($result as $res) { |
|
| 1788 | 1788 | if (preg_match('/^.+?SDPORN/i', $res["textstring"], $match)) { |
| 1789 | 1789 | $this->updateRelease( |
| 1790 | 1790 | $release, |
@@ -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) |
@@ -37,10 +37,11 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | private function getListQuery($type = '', $activeonly = false) |
| 39 | 39 | { |
| 40 | - if (!empty($type)) |
|
| 41 | - $typesql = sprintf(" AND g.type = %d", $type); |
|
| 42 | - else |
|
| 43 | - $typesql = ''; |
|
| 40 | + if (!empty($type)) { |
|
| 41 | + $typesql = sprintf(" AND g.type = %d", $type); |
|
| 42 | + } else { |
|
| 43 | + $typesql = ''; |
|
| 44 | + } |
|
| 44 | 45 | |
| 45 | 46 | if ($activeonly) { |
| 46 | 47 | $sql = sprintf(" |
@@ -81,13 +82,14 @@ discard block |
||
| 81 | 82 | |
| 82 | 83 | public function getCount($type = '', $activeonly = false) |
| 83 | 84 | { |
| 84 | - if (!empty($type)) |
|
| 85 | - $typesql = sprintf(" AND g.type = %d", $type); |
|
| 86 | - else |
|
| 87 | - $typesql = ''; |
|
| 85 | + if (!empty($type)) { |
|
| 86 | + $typesql = sprintf(" AND g.type = %d", $type); |
|
| 87 | + } else { |
|
| 88 | + $typesql = ''; |
|
| 89 | + } |
|
| 88 | 90 | |
| 89 | - if ($activeonly) |
|
| 90 | - $sql = sprintf(" |
|
| 91 | + if ($activeonly) { |
|
| 92 | + $sql = sprintf(" |
|
| 91 | 93 | SELECT COUNT(id) AS num |
| 92 | 94 | FROM genres g |
| 93 | 95 | INNER JOIN |
@@ -107,8 +109,9 @@ discard block |
||
| 107 | 109 | ON x.genres_id = g.id %1\$s", |
| 108 | 110 | $typesql |
| 109 | 111 | ); |
| 110 | - else |
|
| 111 | - $sql = sprintf("SELECT COUNT(g.id) AS num FROM genres g WHERE 1 %s ORDER BY g.title", $typesql); |
|
| 112 | + } else { |
|
| 113 | + $sql = sprintf("SELECT COUNT(g.id) AS num FROM genres g WHERE 1 %s ORDER BY g.title", $typesql); |
|
| 114 | + } |
|
| 112 | 115 | |
| 113 | 116 | $res = $this->pdo->queryOneRow($sql); |
| 114 | 117 | |
@@ -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 |
@@ -15,26 +15,24 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | function smarty_modifier_daysAgo($date) |
| 17 | 17 | { |
| 18 | - if ($date == "") |
|
| 19 | - return "n/a"; |
|
| 18 | + if ($date == "") { |
|
| 19 | + return "n/a"; |
|
| 20 | + } |
|
| 20 | 21 | $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 | 22 | $min = $sec / 60; |
| 22 | 23 | $hrs = $min / 60; |
| 23 | 24 | $days = $sec/60/60/24; |
| 24 | - if ( $hrs <= 24) return ' Today'; |
|
| 25 | - if ($days >= 365) |
|
| 26 | - { |
|
| 25 | + if ( $hrs <= 24) { |
|
| 26 | + return ' Today'; |
|
| 27 | + } |
|
| 28 | + if ($days >= 365) { |
|
| 27 | 29 | $years = round(($days/365), 1); |
| 28 | 30 | return $years.' Yr'.($years!=1?"s":"").' ago'; |
| 29 | - } |
|
| 30 | - else if ($days >= 90) |
|
| 31 | - { |
|
| 31 | + } else if ($days >= 90) { |
|
| 32 | 32 | return round($days/7).' Wks ago'; |
| 33 | - } |
|
| 34 | - else if ($days <= 2) |
|
| 35 | - return 'Yesterday'; |
|
| 36 | - else |
|
| 37 | - { |
|
| 33 | + } else if ($days <= 2) { |
|
| 34 | + return 'Yesterday'; |
|
| 35 | + } else { |
|
| 38 | 36 | return round($days, 0).'d ago'; |
| 39 | 37 | } |
| 40 | 38 | } |