Passed
Push — dev ( 8c58d8...9b6cb9 )
by Darko
09:10
created
www/pages/movies.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 $moviecats = $cat->getChildren(Category::MOVIE_ROOT);
17 17
 $mtmp = [];
18
-foreach($moviecats as $mcat) {
18
+foreach ($moviecats as $mcat) {
19 19
 	$mtmp[$mcat['id']] = $mcat;
20 20
 }
21 21
 
@@ -72,18 +72,18 @@  discard block
 block discarded – undo
72 72
 $page->smarty->assign('genres', $genres);
73 73
 $page->smarty->assign('genre', $genre);
74 74
 
75
-$years = range(1903, (date("Y")+1));
75
+$years = range(1903, (date("Y") + 1));
76 76
 rsort($years);
77 77
 $year = (isset($_REQUEST['year']) && in_array($_REQUEST['year'], $years)) ? $_REQUEST['year'] : '';
78 78
 $page->smarty->assign('years', $years);
79 79
 $page->smarty->assign('year', $year);
80 80
 
81
-$browseby_link = '&title='.$title.'&actors='.$actors.'&director='.$director.'&rating='.$rating.'&genre='.$genre.'&year='.$year;
81
+$browseby_link = '&title=' . $title . '&actors=' . $actors . '&director=' . $director . '&rating=' . $rating . '&genre=' . $genre . '&year=' . $year;
82 82
 
83 83
 $page->smarty->assign('pagertotalitems', isset($results[0]['_totalcount']) ? $results[0]['_totalcount'] : 0);
84
-$page->smarty->assign('pageroffset',$offset);
85
-$page->smarty->assign('pageritemsperpage',ITEMS_PER_COVER_PAGE);
86
-$page->smarty->assign('pagerquerybase', WWW_TOP."/movies?t=".$category.$browseby_link."&ob=".$orderby."&offset=");
84
+$page->smarty->assign('pageroffset', $offset);
85
+$page->smarty->assign('pageritemsperpage', ITEMS_PER_COVER_PAGE);
86
+$page->smarty->assign('pagerquerybase', WWW_TOP . "/movies?t=" . $category . $browseby_link . "&ob=" . $orderby . "&offset=");
87 87
 $page->smarty->assign('pagerquerysuffix', "#results");
88 88
 
89 89
 $pager = $page->smarty->fetch("pager.tpl");
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 	}
102 102
 }
103 103
 
104
-foreach($ordering as $ordertype) {
104
+foreach ($ordering as $ordertype) {
105 105
 	$page->smarty->assign('orderby' . $ordertype, WWW_TOP . "/movies?t=" . $category . $browseby_link . "&ob=" . $ordertype . "&offset=0");
106 106
 }
107 107
 
108
-$page->smarty->assign('results',$movies);
108
+$page->smarty->assign('results', $movies);
109 109
 
110 110
 $page->meta_title = "Browse Nzbs";
111 111
 $page->meta_keywords = "browse,nzb,description,details";
Please login to merge, or discard this patch.
www/pages/sitemap.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $arPages[] = buildURL("Home", "Home Page", "/", 'daily', '1.0');
11 11
 
12 12
 
13
-$role=0;
13
+$role = 0;
14 14
 if ($page->userdata != null)
15 15
 	$role = $page->userdata["role"];
16 16
 
@@ -18,19 +18,19 @@  discard block
 block discarded – undo
18 18
 // useful links
19 19
 //
20 20
 $contents = new Contents();
21
-$contentlist =  $contents->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role);
21
+$contentlist = $contents->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role);
22 22
 foreach ($contentlist as $content)
23 23
 {
24
-	$arPages[] = buildURL("Useful Links", $content["title"], '/content/'.$content["id"].$content["url"], 'monthly', '0.50');
24
+	$arPages[] = buildURL("Useful Links", $content["title"], '/content/' . $content["id"] . $content["url"], 'monthly', '0.50');
25 25
 }
26 26
 
27 27
 //
28 28
 // articles
29 29
 //
30
-$contentlist =  $contents->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role);
30
+$contentlist = $contents->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role);
31 31
 foreach ($contentlist as $content)
32 32
 {
33
-	$arPages[] = buildURL("Articles", $content["title"], '/content/'.$content["id"].$content["url"], 'monthly', '0.50');
33
+	$arPages[] = buildURL("Articles", $content["title"], '/content/' . $content["id"] . $content["url"], 'monthly', '0.50');
34 34
 }
35 35
 
36 36
 //
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
 }
77 77
 else
78 78
 {
79
-	$page->title = $page->settings->getSetting('title'). " site map";
80
-	$page->meta_title = $page->settings->getSetting('title'). " site map";
79
+	$page->title = $page->settings->getSetting('title') . " site map";
80
+	$page->meta_title = $page->settings->getSetting('title') . " site map";
81 81
 	$page->meta_keywords = "sitemap,site,map";
82
-	$page->meta_description = $page->settings->getSetting('title')." site map shows all our pages.";
82
+	$page->meta_description = $page->settings->getSetting('title') . " site map shows all our pages.";
83 83
 	$page->content = $page->smarty->fetch('sitemap.tpl');
84 84
 	$page->render();
85 85
 }
86 86
 
87
-function buildURL($type, $name, $url, $freq='daily', $p='1.0')
87
+function buildURL($type, $name, $url, $freq = 'daily', $p = '1.0')
88 88
 {
89 89
 	$s = new Sitemap($type, $name, $url, $freq, $p);
90 90
 	return $s;
Please login to merge, or discard this patch.
Braces   +7 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,16 +11,16 @@  discard block
 block discarded – undo
11 11
 
12 12
 
13 13
 $role=0;
14
-if ($page->userdata != null)
14
+if ($page->userdata != null) {
15 15
 	$role = $page->userdata["role"];
16
+}
16 17
 
17 18
 //
18 19
 // useful links
19 20
 //
20 21
 $contents = new Contents();
21 22
 $contentlist =  $contents->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role);
22
-foreach ($contentlist as $content)
23
-{
23
+foreach ($contentlist as $content) {
24 24
 	$arPages[] = buildURL("Useful Links", $content["title"], '/content/'.$content["id"].$content["url"], 'monthly', '0.50');
25 25
 }
26 26
 
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
 // articles
29 29
 //
30 30
 $contentlist =  $contents->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role);
31
-foreach ($contentlist as $content)
32
-{
31
+foreach ($contentlist as $content) {
33 32
 	$arPages[] = buildURL("Articles", $content["title"], '/content/'.$content["id"].$content["url"], 'monthly', '0.50');
34 33
 }
35 34
 
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
 $arPages[] = buildURL("Useful Links", "Contact Us", "/contact-us", 'yearly', '0.30');
40 39
 $arPages[] = buildURL("Useful Links", "Site Map", "/sitemap", 'weekly', '0.50');
41 40
 
42
-if ($page->userdata != null)
43
-{
41
+if ($page->userdata != null) {
44 42
 	$arPages[] = buildURL("Useful Links", "Rss Feeds", "/rss", 'weekly', '0.50');
45 43
 	$arPages[] = buildURL("Useful Links", "API", "/apihelp", 'weekly', '0.50');
46 44
 
@@ -70,12 +68,9 @@  discard block
 block discarded – undo
70 68
 	]
71 69
 );
72 70
 
73
-if (isset($_GET["type"]) && $_GET["type"] == "xml")
74
-{
71
+if (isset($_GET["type"]) && $_GET["type"] == "xml") {
75 72
 	echo $page->smarty->fetch('sitemap-xml.tpl');
76
-}
77
-else
78
-{
73
+} else {
79 74
 	$page->title = $page->settings->getSetting('title'). " site map";
80 75
 	$page->meta_title = $page->settings->getSetting('title'). " site map";
81 76
 	$page->meta_keywords = "sitemap,site,map";
Please login to merge, or discard this patch.
www/pages/BasePage.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	//
205 205
 	public function addToHead($headcontent)
206 206
 	{
207
-		$this->head = $this->head."\n".$headcontent;
207
+		$this->head = $this->head . "\n" . $headcontent;
208 208
 	}
209 209
 
210 210
 	//
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	//
213 213
 	public function addToBody($attr)
214 214
 	{
215
-		$this->body = $this->body." ".$attr;
215
+		$this->body = $this->body . " " . $attr;
216 216
 	}
217 217
 
218 218
 	/**
@@ -287,11 +287,11 @@  discard block
 block discarded – undo
287 287
 		);
288 288
 	}
289 289
 
290
-	public function show429($retry='')
290
+	public function show429($retry = '')
291 291
 	{
292 292
 		header('HTTP/1.1 429 Too Many Requests');
293 293
 		if ($retry != '')
294
-			header('Retry-After: '.$retry);
294
+			header('Retry-After: ' . $retry);
295 295
 
296 296
 		echo "
297 297
 			<html>
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 			<body>
303 303
 				<h1>Too Many Requests</h1>
304 304
 
305
-				<p>Wait ".(($retry != '') ? ceil($retry/60).' minutes ' : '')."or risk being temporarily banned.</p>
305
+				<p>Wait ".(($retry != '') ? ceil($retry / 60) . ' minutes ' : '') . "or risk being temporarily banned.</p>
306 306
 
307 307
 			</body>
308 308
 			</html>";
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 			$this->users->updateSiteAccessed($this->userdata['id']);
342 342
 		}
343 343
 
344
-		$this->smarty->assign('userdata',$this->userdata);
345
-		$this->smarty->assign('loggedin',"true");
344
+		$this->smarty->assign('userdata', $this->userdata);
345
+		$this->smarty->assign('loggedin', "true");
346 346
 
347 347
 		if ($this->userdata['nzbvortex_api_key'] != '' && $this->userdata['nzbvortex_server_url'] != '') {
348 348
 			$this->smarty->assign('weHasVortex', true);
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -290,8 +290,9 @@  discard block
 block discarded – undo
290 290
 	public function show429($retry='')
291 291
 	{
292 292
 		header('HTTP/1.1 429 Too Many Requests');
293
-		if ($retry != '')
294
-			header('Retry-After: '.$retry);
293
+		if ($retry != '') {
294
+					header('Retry-After: '.$retry);
295
+		}
295 296
 
296 297
 		echo "
297 298
 			<html>
@@ -363,8 +364,7 @@  discard block
 block discarded – undo
363 364
 				$this->smarty->assign('ismod', 'true');
364 365
 		}
365 366
 
366
-		if ($this->userdata["hideads"] == "1")
367
-		{
367
+		if ($this->userdata["hideads"] == "1") {
368 368
 			$this->settings->setSetting(['adheader', '']);
369 369
 			$this->settings->setSetting(['adbrowse', '']);
370 370
 			$this->settings->setSetting(['addetail', '']);
Please login to merge, or discard this patch.
www/pages/sendtonzbget.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 	$page->show404();
18 18
 
19 19
 if (empty($nzbget->password))
20
-    $page->show404();
20
+	$page->show404();
21 21
 
22 22
 $guid = $_GET["id"];
23 23
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,22 +2,27 @@
 block discarded – undo
2 2
 
3 3
 use nntmux\NZBGet;
4 4
 
5
-if (!$page->users->isLoggedIn())
5
+if (!$page->users->isLoggedIn()) {
6 6
 	$page->show403();
7
+}
7 8
 
8
-if (empty($_GET["id"]))
9
+if (empty($_GET["id"])) {
9 10
 	$page->show404();
11
+}
10 12
 
11 13
 $nzbget = new NZBGet($page);
12 14
 
13
-if (empty($nzbget->url))
15
+if (empty($nzbget->url)) {
14 16
 	$page->show404();
17
+}
15 18
 
16
-if (empty($nzbget->username))
19
+if (empty($nzbget->username)) {
17 20
 	$page->show404();
21
+}
18 22
 
19
-if (empty($nzbget->password))
23
+if (empty($nzbget->password)) {
20 24
     $page->show404();
25
+}
21 26
 
22 27
 $guid = $_GET["id"];
23 28
 
Please login to merge, or discard this patch.
www/pages/ajax_resetusergrabs-admin.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
9 9
 $id = (isset($_REQUEST['id'])) ? $_REQUEST['id'] : '';
10 10
 
11
-switch($action)
11
+switch ($action)
12 12
 {
13 13
 	case 'grabs':
14 14
 		$u->delDownloadRequests($id);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
10 10
 // set the current action
11 11
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
12 12
 
13
-switch($action)
14
-{
13
+switch($action) {
15 14
 	case 'submit':
16 15
 		if (isset($_POST['groupfilter']) && !empty($_POST['groupfilter'])) {
17 16
 			$groups = new Groups;
Please login to merge, or discard this patch.
www/pages/ajax_rarfilelist.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,6 +17,6 @@
 block discarded – undo
17 17
 	//print "<h3 class=\"tooltiphead\">rar archive contains...</h3>\n";
18 18
 	print "<ul>\n";
19 19
 	foreach ($files as $f)
20
-		print "<li>".htmlentities($f["name"], ENT_QUOTES)."&nbsp;".($f["passworded"] == 1?"<img width=\"12\" src=\"".WWW_TOP."/themes/shared/images/icons/lock.gif\" />":"")."</li>\n";
20
+		print "<li>" . htmlentities($f["name"], ENT_QUOTES) . "&nbsp;" . ($f["passworded"] == 1 ? "<img width=\"12\" src=\"" . WWW_TOP . "/themes/shared/images/icons/lock.gif\" />" : "") . "</li>\n";
21 21
 	print "</ul>";
22 22
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,22 +1,24 @@
 block discarded – undo
1 1
 <?php
2 2
 use nntmux\ReleaseFiles;
3 3
 
4
-if (!$page->users->isLoggedIn())
4
+if (!$page->users->isLoggedIn()) {
5 5
 	$page->show403();
6
+}
6 7
 
7
-if (!isset($_REQUEST["id"]))
8
+if (!isset($_REQUEST["id"])) {
8 9
 	$page->show404();
10
+}
9 11
 
10 12
 $rf = new ReleaseFiles();
11 13
 $files = $rf->getByGuid($_REQUEST["id"]);
12 14
 
13
-if (count($files) == 0)
15
+if (count($files) == 0) {
14 16
 	print "No files";
15
-else
16
-{
17
+} else {
17 18
 	//print "<h3 class=\"tooltiphead\">rar archive contains...</h3>\n";
18 19
 	print "<ul>\n";
19
-	foreach ($files as $f)
20
-		print "<li>".htmlentities($f["name"], ENT_QUOTES)."&nbsp;".($f["passworded"] == 1?"<img width=\"12\" src=\"".WWW_TOP."/themes/shared/images/icons/lock.gif\" />":"")."</li>\n";
20
+	foreach ($files as $f) {
21
+			print "<li>".htmlentities($f["name"], ENT_QUOTES)."&nbsp;".($f["passworded"] == 1?"<img width=\"12\" src=\"".WWW_TOP."/themes/shared/images/icons/lock.gif\" />":"")."</li>\n";
22
+	}
21 23
 	print "</ul>";
22 24
 }
Please login to merge, or discard this patch.
www/pages/search.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	$page->show403();
10 10
 }
11 11
 
12
-$groups      = new Groups(['Settings' => $page->settings]);
12
+$groups = new Groups(['Settings' => $page->settings]);
13 13
 $releases = new Releases(['Groups' => $groups, 'Settings' => $page->settings]);
14 14
 
15 15
 $page->meta_title       = "Search Nzbs";
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 	$searchString = '';
40 40
 	switch (true) {
41 41
 		case isset($_REQUEST["subject"]):
42
-			$searchString = (string) $_REQUEST["subject"];
42
+			$searchString = (string)$_REQUEST["subject"];
43 43
 			$page->smarty->assign('subject', $searchString);
44 44
 			break;
45 45
 		case isset($_REQUEST["id"]):
46
-			$searchString =(string) $_REQUEST["id"];
46
+			$searchString = (string)$_REQUEST["id"];
47 47
 			$page->smarty->assign('search', $searchString);
48 48
 			break;
49 49
 	}
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
 	'searchadvsizeto' => '', 'searchadvhasnfo' => '', 'searchadvhascomments' => ''
88 88
 ];
89 89
 
90
-foreach($searchVars as $searchVarKey => $searchVar) {
91
-	$searchVars[$searchVarKey] = (isset($_REQUEST[$searchVarKey]) ? (string) $_REQUEST[$searchVarKey] : '');
90
+foreach ($searchVars as $searchVarKey => $searchVar) {
91
+	$searchVars[$searchVarKey] = (isset($_REQUEST[$searchVarKey]) ? (string)$_REQUEST[$searchVarKey] : '');
92 92
 }
93 93
 
94 94
 $searchVars['selectedgroup'] = $searchVars['searchadvgroups'];
95 95
 $searchVars['selectedcat'] = $searchVars['searchadvcat'];
96 96
 $searchVars['selectedsizefrom'] = $searchVars['searchadvsizefrom'];
97 97
 $searchVars['selectedsizeto'] = $searchVars['searchadvsizeto'];
98
-foreach($searchVars as $searchVarKey => $searchVar) {
98
+foreach ($searchVars as $searchVarKey => $searchVar) {
99 99
 	$page->smarty->assign($searchVarKey, $searchVars[$searchVarKey]);
100 100
 }
101 101
 
Please login to merge, or discard this patch.
www/pages/ajax_tvinfo.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
18 18
 {
19 19
 
20 20
 	print "<ul class=\"ui-tooltip-nntmux\">\n";
21
-	print "<li>".htmlentities($rel["title"], ENT_QUOTES)."</li>\n";
22
-	print "<li>Aired on ".date("F j, Y", strtotime($rel["firstaired"]))."</li>\n";
21
+	print "<li>" . htmlentities($rel["title"], ENT_QUOTES) . "</li>\n";
22
+	print "<li>Aired on " . date("F j, Y", strtotime($rel["firstaired"])) . "</li>\n";
23 23
 	print "</ul>";
24 24
 
25 25
 	if (isset($rel["videos_id"]) && $rel["videos_id"] > 0)
Please login to merge, or discard this patch.
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,33 +3,33 @@
 block discarded – undo
3 3
 use nntmux\Releases;
4 4
 use nntmux\Videos;
5 5
 
6
-if (!$page->users->isLoggedIn())
6
+if (!$page->users->isLoggedIn()) {
7 7
 	$page->show403();
8
+}
8 9
 
9
-if (!isset($_REQUEST["id"]))
10
+if (!isset($_REQUEST["id"])) {
10 11
 	$page->show404();
12
+}
11 13
 
12 14
 $r = new Releases();
13 15
 $rel = $r->getByGuid($_REQUEST["id"]);
14 16
 
15
-if (!$rel)
17
+if (!$rel) {
16 18
 	print "No tv info";
17
-else
18
-{
19
+} else {
19 20
 
20 21
 	print "<ul class=\"ui-tooltip-nntmux\">\n";
21 22
 	print "<li>".htmlentities($rel["title"], ENT_QUOTES)."</li>\n";
22 23
 	print "<li>Aired on ".date("F j, Y", strtotime($rel["firstaired"]))."</li>\n";
23 24
 	print "</ul>";
24 25
 
25
-	if (isset($rel["videos_id"]) && $rel["videos_id"] > 0)
26
-	{
26
+	if (isset($rel["videos_id"]) && $rel["videos_id"] > 0) {
27 27
 		$t = new Videos();
28 28
 		$show = $t->getByVideoID($rel["videos_id"]);
29
-		if (count($show) > 0)
30
-		{
31
-			if ($show["image"] != "0")
32
-				print "<img class=\"shadow\" src=\"/covers/tvshows/" . $show["id"] . ".jpg\" width=\"180\"/>";
29
+		if (count($show) > 0) {
30
+			if ($show["image"] != "0") {
31
+							print "<img class=\"shadow\" src=\"/covers/tvshows/" . $show["id"] . ".jpg\" width=\"180\"/>";
32
+			}
33 33
 		}
34 34
 	}
35 35
 }
Please login to merge, or discard this patch.
www/pages/xxxmodal.php 1 patch
Braces   +2 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,14 +26,11 @@
 block discarded – undo
26 26
 	$page->meta_description = "";
27 27
 	$page->smarty->registerPlugin('modifier', 'ss', 'stripslashes');
28 28
 
29
-	if (isset($_GET['modal']))
30
-	{
29
+	if (isset($_GET['modal'])) {
31 30
 		$page->content = $page->smarty->fetch('viewxxx.tpl');
32 31
 		$page->smarty->assign('modal', true);
33 32
 		echo $page->content;
34
-	}
35
-	else
36
-	{
33
+	} else {
37 34
 		$page->content = $page->smarty->fetch('viewxxxfull.tpl');
38 35
 		$page->render();
39 36
 	}
Please login to merge, or discard this patch.