Passed
Branch dev (a25f63)
by Darko
15:17
created
nntmux/ReleaseImage.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.
Please login to merge, or discard this patch.
nntmux/TmuxRun.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
nntmux/constants.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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/');
Please login to merge, or discard this patch.
nntmux/Greenlight.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
nntmux/NameFixer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
nntmux/Genres.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
build/postInstall.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
www/autoloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
www/plugins/modifier.daysago.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,25 +17,25 @@
 block discarded – undo
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
Please login to merge, or discard this patch.