@@ -65,8 +65,7 @@ discard block |
||
| 65 | 65 | for ($chr = 0; $chr < $encodedLength; $chr++) { |
| 66 | 66 | $decoded .= ( |
| 67 | 67 | $encoded[$chr] == '=' ? |
| 68 | - chr((ord($encoded[$chr]) - 42) % 256) : |
|
| 69 | - chr((((ord($encoded[++$chr]) - 64) % 256) - 42) % 256) |
|
| 68 | + chr((ord($encoded[$chr]) - 42) % 256) : chr((((ord($encoded[++$chr]) - 64) % 256) - 42) % 256) |
|
| 70 | 69 | ); |
| 71 | 70 | } |
| 72 | 71 | |
@@ -129,8 +128,7 @@ discard block |
||
| 129 | 128 | for ($chr = 0; $chr < $length; $chr++) { |
| 130 | 129 | $text .= ( |
| 131 | 130 | $input[$chr] == '=' ? |
| 132 | - chr((((ord($input[++$chr]) - 64) % 256) - 42) % 256) : |
|
| 133 | - chr((ord($input[$chr]) - 42) % 256) |
|
| 131 | + chr((((ord($input[++$chr]) - 64) % 256) - 42) % 256) : chr((ord($input[$chr]) - 42) % 256) |
|
| 134 | 132 | ); |
| 135 | 133 | } |
| 136 | 134 | } |
@@ -64,8 +64,8 @@ |
||
| 64 | 64 | |
| 65 | 65 | const NFO_FAILED = -9; // We failed to get a NFO after admin set max retries. |
| 66 | 66 | const NFO_UNPROC = -1; // Release has not been processed yet. |
| 67 | - const NFO_NONFO = 0; // Release has no NFO. |
|
| 68 | - const NFO_FOUND = 1; // Release has an NFO. |
|
| 67 | + const NFO_NONFO = 0; // Release has no NFO. |
|
| 68 | + const NFO_FOUND = 1; // Release has an NFO. |
|
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Default constructor. |
@@ -14,42 +14,42 @@ |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) { |
| 17 | - case 'add': |
|
| 18 | - $page->title = "User Roles Add"; |
|
| 19 | - $role = [ |
|
| 20 | - 'id' => '', |
|
| 21 | - 'name' => '', |
|
| 22 | - 'apirequests' => '', |
|
| 23 | - 'downloadrequests' => '', |
|
| 24 | - 'defaultinvites' => '', |
|
| 25 | - 'canpreview' => 0 |
|
| 26 | - ]; |
|
| 27 | - break; |
|
| 28 | - |
|
| 29 | - case 'submit': |
|
| 30 | - if ($_POST["id"] == "") { |
|
| 31 | - $ret = $page->users->addRole($_POST['name'], $_POST['apirequests'], $_POST['downloadrequests'], |
|
| 32 | - $_POST['defaultinvites'], $_POST['canpreview'] |
|
| 33 | - ); |
|
| 34 | - header("Location:" . WWW_TOP . "/role-list.php"); |
|
| 35 | - } else { |
|
| 36 | - $ret = $page->users->updateRole($_POST['id'], $_POST['name'], $_POST['apirequests'], |
|
| 37 | - $_POST['downloadrequests'], $_POST['defaultinvites'], $_POST['isdefault'], $_POST['canpreview'] |
|
| 38 | - ); |
|
| 39 | - header("Location:" . WWW_TOP . "/role-list.php"); |
|
| 40 | - |
|
| 41 | - $_POST['exccat'] = (!isset($_POST['exccat']) || !is_array($_POST['exccat'])) ? [] : $_POST['exccat']; |
|
| 42 | - $page->users->addRoleCategoryExclusions($_POST['id'], $_POST['exccat']); |
|
| 43 | - } |
|
| 44 | - break; |
|
| 45 | - |
|
| 46 | - case 'view': |
|
| 47 | - default: |
|
| 48 | - if (isset($_GET["id"])) { |
|
| 49 | - $page->title = "User Roles Edit"; |
|
| 50 | - $role = $page->users->getRoleById($_GET["id"]); |
|
| 51 | - } |
|
| 52 | - break; |
|
| 17 | + case 'add': |
|
| 18 | + $page->title = "User Roles Add"; |
|
| 19 | + $role = [ |
|
| 20 | + 'id' => '', |
|
| 21 | + 'name' => '', |
|
| 22 | + 'apirequests' => '', |
|
| 23 | + 'downloadrequests' => '', |
|
| 24 | + 'defaultinvites' => '', |
|
| 25 | + 'canpreview' => 0 |
|
| 26 | + ]; |
|
| 27 | + break; |
|
| 28 | + |
|
| 29 | + case 'submit': |
|
| 30 | + if ($_POST["id"] == "") { |
|
| 31 | + $ret = $page->users->addRole($_POST['name'], $_POST['apirequests'], $_POST['downloadrequests'], |
|
| 32 | + $_POST['defaultinvites'], $_POST['canpreview'] |
|
| 33 | + ); |
|
| 34 | + header("Location:" . WWW_TOP . "/role-list.php"); |
|
| 35 | + } else { |
|
| 36 | + $ret = $page->users->updateRole($_POST['id'], $_POST['name'], $_POST['apirequests'], |
|
| 37 | + $_POST['downloadrequests'], $_POST['defaultinvites'], $_POST['isdefault'], $_POST['canpreview'] |
|
| 38 | + ); |
|
| 39 | + header("Location:" . WWW_TOP . "/role-list.php"); |
|
| 40 | + |
|
| 41 | + $_POST['exccat'] = (!isset($_POST['exccat']) || !is_array($_POST['exccat'])) ? [] : $_POST['exccat']; |
|
| 42 | + $page->users->addRoleCategoryExclusions($_POST['id'], $_POST['exccat']); |
|
| 43 | + } |
|
| 44 | + break; |
|
| 45 | + |
|
| 46 | + case 'view': |
|
| 47 | + default: |
|
| 48 | + if (isset($_GET["id"])) { |
|
| 49 | + $page->title = "User Roles Edit"; |
|
| 50 | + $role = $page->users->getRoleById($_GET["id"]); |
|
| 51 | + } |
|
| 52 | + break; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $page->smarty->assign('role', $role); |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) { |
| 17 | - case 'add': |
|
| 18 | - $page->title = "User Roles Add"; |
|
| 17 | + case 'add' : $page->title = "User Roles Add"; |
|
| 19 | 18 | $role = [ |
| 20 | 19 | 'id' => '', |
| 21 | 20 | 'name' => '', |
@@ -54,7 +53,7 @@ discard block |
||
| 54 | 53 | |
| 55 | 54 | $page->smarty->assign('role', $role); |
| 56 | 55 | $page->smarty->assign('roleexccat', $page->users->getRoleCategoryExclusion($_GET["id"])); |
| 57 | -$page->smarty->assign('catlist',$category->getForSelect(false)); |
|
| 56 | +$page->smarty->assign('catlist', $category->getForSelect(false)); |
|
| 58 | 57 | $page->smarty->assign('yesno_ids', [1, 0]); |
| 59 | 58 | $page->smarty->assign('yesno_names', ['Yes', 'No']); |
| 60 | 59 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | if (isset($id) && !empty($_POST['addMessage'])) { |
| 13 | 13 | $parent = $forum->getPost($id); |
| 14 | 14 | $forum->editPost($id, $_POST['addMessage'], $page->users->currentUserId()); |
| 15 | - if($parent['parentid'] != 0) { |
|
| 15 | + if ($parent['parentid'] != 0) { |
|
| 16 | 16 | header("Location:" . WWW_TOP . "/forumpost/" . $parent['parentid'] . "#last"); |
| 17 | 17 | } else { |
| 18 | 18 | header("Location:" . WWW_TOP . "/forumpost/" . $id); |
@@ -63,8 +63,7 @@ |
||
| 63 | 63 | $nntp = null; |
| 64 | 64 | if ($args[$argv[1]] === true) { |
| 65 | 65 | $nntp = new NNTP(['Settings' => $pdo]); |
| 66 | - if ((Settings::value('..alternate_nntp') == 1 ? $nntp->doConnect(true, true) : |
|
| 67 | - $nntp->doConnect()) !== |
|
| 66 | + if ((Settings::value('..alternate_nntp') == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== |
|
| 68 | 67 | true) { |
| 69 | 68 | exit($pdo->log->error("Unable to connect to usenet." . PHP_EOL)); |
| 70 | 69 | } |
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | } else if (isset($pieces[1]) && $pieces[0] == 'par2') { |
| 62 | 62 | //echo PHP_EOL . microtime(); |
| 63 | 63 | $nntp = new NNTP(['Settings' => $pdo]); |
| 64 | - if ((Settings::value('..alternate_nntp') == 1 ? $nntp->doConnect(true, true) : |
|
| 65 | - $nntp->doConnect()) !== true) { |
|
| 64 | + if ((Settings::value('..alternate_nntp') == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { |
|
| 66 | 65 | exit($pdo->log->error("Unable to connect to usenet.")); |
| 67 | 66 | } |
| 68 | 67 | |
@@ -85,8 +84,7 @@ discard block |
||
| 85 | 84 | |
| 86 | 85 | } else if (isset($pieces[1]) && $pieces[0] == 'miscsorter') { |
| 87 | 86 | $nntp = new NNTP(['Settings' => $pdo]); |
| 88 | - if ((Settings::value('..alternate_nntp') == 1 ? $nntp->doConnect(true, true) : |
|
| 89 | - $nntp->doConnect()) !== true) { |
|
| 87 | + if ((Settings::value('..alternate_nntp') == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { |
|
| 90 | 88 | exit($pdo->log->error("Unable to connect to usenet.")); |
| 91 | 89 | } |
| 92 | 90 | |
@@ -38,8 +38,7 @@ |
||
| 38 | 38 | $nntp = null; |
| 39 | 39 | if ($argv[1] == 7 || $argv[1] == 8) { |
| 40 | 40 | $nntp = new NNTP(['Settings' => $pdo]); |
| 41 | - if ((Settings::value('..alternate_nntp') == '1' ? $nntp->doConnect(true, true) : |
|
| 42 | - $nntp->doConnect()) !== true) { |
|
| 41 | + if ((Settings::value('..alternate_nntp') == '1' ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { |
|
| 43 | 42 | echo $pdo->log->error("Unable to connect to usenet.\n"); |
| 44 | 43 | return; |
| 45 | 44 | } |
@@ -8,9 +8,9 @@ |
||
| 8 | 8 | // Test if your amazon keys are working. |
| 9 | 9 | |
| 10 | 10 | $pdo = new DB(); |
| 11 | -$pubkey = Settings::value('APIs..amazonpubkey'); |
|
| 12 | -$privkey = Settings::value('APIs..amazonprivkey'); |
|
| 13 | -$asstag = Settings::value('APIs..amazonassociatetag'); |
|
| 11 | +$pubkey = Settings::value('APIs..amazonpubkey'); |
|
| 12 | +$privkey = Settings::value('APIs..amazonprivkey'); |
|
| 13 | +$asstag = Settings::value('APIs..amazonassociatetag'); |
|
| 14 | 14 | $obj = new AmazonProductAPI($pubkey, $privkey, $asstag); |
| 15 | 15 | |
| 16 | 16 | $e = null; |
@@ -23,173 +23,173 @@ |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | switch ($action) { |
| 26 | - case 'delete': |
|
| 27 | - $show = $us->getShow($page->users->currentUserId(), $videoId); |
|
| 28 | - if (isset($_REQUEST['from'])) { |
|
| 29 | - header("Location:" . WWW_TOP . $_REQUEST['from']); |
|
| 30 | - } else { |
|
| 31 | - header("Location:" . WWW_TOP . "/myshows"); |
|
| 32 | - } |
|
| 33 | - if (!$show) { |
|
| 34 | - $page->show404('Not subscribed'); |
|
| 35 | - } else { |
|
| 36 | - $us->delShow($page->users->currentUserId(), $videoId); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - break; |
|
| 40 | - case 'add': |
|
| 41 | - case 'doadd': |
|
| 42 | - $show = $us->getShow($page->users->currentUserId(), $videoId); |
|
| 43 | - if ($show) { |
|
| 44 | - $page->show404('Already subscribed'); |
|
| 45 | - } else { |
|
| 46 | - $show = $tv->getByVideoID($videoId); |
|
| 47 | - if (!$show) { |
|
| 48 | - $page->show404('No matching show.'); |
|
| 49 | - } |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - if ($action == 'doadd') { |
|
| 53 | - $category = (isset($_REQUEST['category']) && is_array($_REQUEST['category']) && !empty($_REQUEST['category'])) ? $_REQUEST['category'] : array(); |
|
| 54 | - $us->addShow($page->users->currentUserId(), $videoId, $category); |
|
| 26 | + case 'delete': |
|
| 27 | + $show = $us->getShow($page->users->currentUserId(), $videoId); |
|
| 55 | 28 | if (isset($_REQUEST['from'])) { |
| 56 | 29 | header("Location:" . WWW_TOP . $_REQUEST['from']); |
| 57 | 30 | } else { |
| 58 | 31 | header("Location:" . WWW_TOP . "/myshows"); |
| 59 | 32 | } |
| 60 | - } else { |
|
| 61 | - $cat = new Category(['Settings' => $page->settings]); |
|
| 62 | - $tmpcats = $cat->getChildren(Category::TV_ROOT); |
|
| 63 | - $categories = array(); |
|
| 64 | - foreach ($tmpcats as $c) { |
|
| 65 | - // If TV WEB-DL categorization is disabled, don't include it as an option |
|
| 66 | - if (Settings::value('indexer.categorise.catwebdl') == 0 && $c['id'] == Category::TV_WEBDL) { |
|
| 67 | - continue; |
|
| 33 | + if (!$show) { |
|
| 34 | + $page->show404('Not subscribed'); |
|
| 35 | + } else { |
|
| 36 | + $us->delShow($page->users->currentUserId(), $videoId); |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + break; |
|
| 40 | + case 'add': |
|
| 41 | + case 'doadd': |
|
| 42 | + $show = $us->getShow($page->users->currentUserId(), $videoId); |
|
| 43 | + if ($show) { |
|
| 44 | + $page->show404('Already subscribed'); |
|
| 45 | + } else { |
|
| 46 | + $show = $tv->getByVideoID($videoId); |
|
| 47 | + if (!$show) { |
|
| 48 | + $page->show404('No matching show.'); |
|
| 68 | 49 | } |
| 69 | - $categories[$c['id']] = $c['title']; |
|
| 70 | 50 | } |
| 71 | - $page->smarty->assign('type', 'add'); |
|
| 72 | - $page->smarty->assign('cat_ids', array_keys($categories)); |
|
| 73 | - $page->smarty->assign('cat_names', $categories); |
|
| 74 | - $page->smarty->assign('cat_selected', array()); |
|
| 75 | - $page->smarty->assign('video', $videoId); |
|
| 76 | - $page->smarty->assign('show', $show); |
|
| 77 | - $page->content = $page->smarty->fetch('myshows-add.tpl'); |
|
| 78 | - $page->render(); |
|
| 79 | - } |
|
| 80 | - break; |
|
| 81 | - case 'edit': |
|
| 82 | - case 'doedit': |
|
| 83 | - $show = $us->getShow($page->users->currentUserId(), $videoId); |
|
| 84 | - |
|
| 85 | - if (!$show) { |
|
| 86 | - $page->show404(); |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - if ($action == 'doedit') { |
|
| 90 | - $category = (isset($_REQUEST['category']) && is_array($_REQUEST['category']) && !empty($_REQUEST['category'])) ? $_REQUEST['category'] : array(); |
|
| 91 | - $us->updateShow($page->users->currentUserId(), $videoId, $category); |
|
| 92 | - if (isset($_REQUEST['from'])) { |
|
| 93 | - header("Location:" . WWW_TOP . $_REQUEST['from']); |
|
| 51 | + |
|
| 52 | + if ($action == 'doadd') { |
|
| 53 | + $category = (isset($_REQUEST['category']) && is_array($_REQUEST['category']) && !empty($_REQUEST['category'])) ? $_REQUEST['category'] : array(); |
|
| 54 | + $us->addShow($page->users->currentUserId(), $videoId, $category); |
|
| 55 | + if (isset($_REQUEST['from'])) { |
|
| 56 | + header("Location:" . WWW_TOP . $_REQUEST['from']); |
|
| 57 | + } else { |
|
| 58 | + header("Location:" . WWW_TOP . "/myshows"); |
|
| 59 | + } |
|
| 94 | 60 | } else { |
| 95 | - header("Location:" . WWW_TOP . "/myshows"); |
|
| 61 | + $cat = new Category(['Settings' => $page->settings]); |
|
| 62 | + $tmpcats = $cat->getChildren(Category::TV_ROOT); |
|
| 63 | + $categories = array(); |
|
| 64 | + foreach ($tmpcats as $c) { |
|
| 65 | + // If TV WEB-DL categorization is disabled, don't include it as an option |
|
| 66 | + if (Settings::value('indexer.categorise.catwebdl') == 0 && $c['id'] == Category::TV_WEBDL) { |
|
| 67 | + continue; |
|
| 68 | + } |
|
| 69 | + $categories[$c['id']] = $c['title']; |
|
| 70 | + } |
|
| 71 | + $page->smarty->assign('type', 'add'); |
|
| 72 | + $page->smarty->assign('cat_ids', array_keys($categories)); |
|
| 73 | + $page->smarty->assign('cat_names', $categories); |
|
| 74 | + $page->smarty->assign('cat_selected', array()); |
|
| 75 | + $page->smarty->assign('video', $videoId); |
|
| 76 | + $page->smarty->assign('show', $show); |
|
| 77 | + $page->content = $page->smarty->fetch('myshows-add.tpl'); |
|
| 78 | + $page->render(); |
|
| 79 | + } |
|
| 80 | + break; |
|
| 81 | + case 'edit': |
|
| 82 | + case 'doedit': |
|
| 83 | + $show = $us->getShow($page->users->currentUserId(), $videoId); |
|
| 84 | + |
|
| 85 | + if (!$show) { |
|
| 86 | + $page->show404(); |
|
| 96 | 87 | } |
| 97 | - } else { |
|
| 98 | - $cat = new Category(['Settings' => $page->settings]); |
|
| 99 | 88 | |
| 89 | + if ($action == 'doedit') { |
|
| 90 | + $category = (isset($_REQUEST['category']) && is_array($_REQUEST['category']) && !empty($_REQUEST['category'])) ? $_REQUEST['category'] : array(); |
|
| 91 | + $us->updateShow($page->users->currentUserId(), $videoId, $category); |
|
| 92 | + if (isset($_REQUEST['from'])) { |
|
| 93 | + header("Location:" . WWW_TOP . $_REQUEST['from']); |
|
| 94 | + } else { |
|
| 95 | + header("Location:" . WWW_TOP . "/myshows"); |
|
| 96 | + } |
|
| 97 | + } else { |
|
| 98 | + $cat = new Category(['Settings' => $page->settings]); |
|
| 99 | + |
|
| 100 | + $tmpcats = $cat->getChildren(Category::TV_ROOT); |
|
| 101 | + $categories = array(); |
|
| 102 | + foreach ($tmpcats as $c) { |
|
| 103 | + $categories[$c['id']] = $c['title']; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + $page->smarty->assign('type', 'edit'); |
|
| 107 | + $page->smarty->assign('cat_ids', array_keys($categories)); |
|
| 108 | + $page->smarty->assign('cat_names', $categories); |
|
| 109 | + $page->smarty->assign('cat_selected', explode('|', $show['categories'])); |
|
| 110 | + $page->smarty->assign('video', $videoId); |
|
| 111 | + $page->smarty->assign('show', $show); |
|
| 112 | + $page->content = $page->smarty->fetch('myshows-add.tpl'); |
|
| 113 | + $page->render(); |
|
| 114 | + } |
|
| 115 | + break; |
|
| 116 | + case 'browse': |
|
| 117 | + |
|
| 118 | + $page->title = "Browse My Shows"; |
|
| 119 | + $page->meta_title = "My Shows"; |
|
| 120 | + $page->meta_keywords = "search,add,to,cart,nzb,description,details"; |
|
| 121 | + $page->meta_description = "Browse Your Shows"; |
|
| 122 | + |
|
| 123 | + $shows = $us->getShows($page->users->currentUserId()); |
|
| 124 | + |
|
| 125 | + $releases = new Releases(['Settings' => $page->settings]); |
|
| 126 | + $browsecount = $releases->getShowsCount($shows, -1, $page->userdata["categoryexclusions"]); |
|
| 127 | + |
|
| 128 | + $offset = (isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset'])) ? $_REQUEST["offset"] : 0; |
|
| 129 | + $ordering = $releases->getBrowseOrdering(); |
|
| 130 | + $orderby = isset($_REQUEST["ob"]) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST["ob"] : ''; |
|
| 131 | + |
|
| 132 | + $results = array(); |
|
| 133 | + $results = $releases->getShowsRange($shows, $offset, ITEMS_PER_PAGE, $orderby, -1, $page->userdata["categoryexclusions"]); |
|
| 134 | + |
|
| 135 | + $page->smarty->assign('pagertotalitems', $browsecount); |
|
| 136 | + $page->smarty->assign('pageroffset', $offset); |
|
| 137 | + $page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE); |
|
| 138 | + $page->smarty->assign('pagerquerybase', WWW_TOP . "/myshows/browse?ob=" . $orderby . "&offset="); |
|
| 139 | + $page->smarty->assign('pagerquerysuffix', "#results"); |
|
| 140 | + $page->smarty->assign('covgroup', ''); |
|
| 141 | + |
|
| 142 | + $pager = $page->smarty->fetch("pager.tpl"); |
|
| 143 | + $page->smarty->assign('pager', $pager); |
|
| 144 | + |
|
| 145 | + foreach ($ordering as $ordertype) { |
|
| 146 | + $page->smarty->assign('orderby' . $ordertype, WWW_TOP . "/myshows/browse?ob=" . $ordertype . "&offset=0"); |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + $page->smarty->assign('lastvisit', $page->userdata['lastlogin']); |
|
| 150 | + |
|
| 151 | + $page->smarty->assign('results', $results); |
|
| 152 | + |
|
| 153 | + $page->smarty->assign('shows', true); |
|
| 154 | + |
|
| 155 | + $page->content = $page->smarty->fetch('browse.tpl'); |
|
| 156 | + $page->render(); |
|
| 157 | + break; |
|
| 158 | + default: |
|
| 159 | + |
|
| 160 | + $page->title = "My Shows"; |
|
| 161 | + $page->meta_title = "My Shows"; |
|
| 162 | + $page->meta_keywords = "search,add,to,cart,nzb,description,details"; |
|
| 163 | + $page->meta_description = "Manage Your Shows"; |
|
| 164 | + |
|
| 165 | + $cat = new Category(['Settings' => $page->settings]); |
|
| 100 | 166 | $tmpcats = $cat->getChildren(Category::TV_ROOT); |
| 101 | 167 | $categories = array(); |
| 102 | 168 | foreach ($tmpcats as $c) { |
| 103 | 169 | $categories[$c['id']] = $c['title']; |
| 104 | 170 | } |
| 105 | 171 | |
| 106 | - $page->smarty->assign('type', 'edit'); |
|
| 107 | - $page->smarty->assign('cat_ids', array_keys($categories)); |
|
| 108 | - $page->smarty->assign('cat_names', $categories); |
|
| 109 | - $page->smarty->assign('cat_selected', explode('|', $show['categories'])); |
|
| 110 | - $page->smarty->assign('video', $videoId); |
|
| 111 | - $page->smarty->assign('show', $show); |
|
| 112 | - $page->content = $page->smarty->fetch('myshows-add.tpl'); |
|
| 113 | - $page->render(); |
|
| 114 | - } |
|
| 115 | - break; |
|
| 116 | - case 'browse': |
|
| 117 | - |
|
| 118 | - $page->title = "Browse My Shows"; |
|
| 119 | - $page->meta_title = "My Shows"; |
|
| 120 | - $page->meta_keywords = "search,add,to,cart,nzb,description,details"; |
|
| 121 | - $page->meta_description = "Browse Your Shows"; |
|
| 122 | - |
|
| 123 | - $shows = $us->getShows($page->users->currentUserId()); |
|
| 124 | - |
|
| 125 | - $releases = new Releases(['Settings' => $page->settings]); |
|
| 126 | - $browsecount = $releases->getShowsCount($shows, -1, $page->userdata["categoryexclusions"]); |
|
| 127 | - |
|
| 128 | - $offset = (isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset'])) ? $_REQUEST["offset"] : 0; |
|
| 129 | - $ordering = $releases->getBrowseOrdering(); |
|
| 130 | - $orderby = isset($_REQUEST["ob"]) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST["ob"] : ''; |
|
| 131 | - |
|
| 132 | - $results = array(); |
|
| 133 | - $results = $releases->getShowsRange($shows, $offset, ITEMS_PER_PAGE, $orderby, -1, $page->userdata["categoryexclusions"]); |
|
| 134 | - |
|
| 135 | - $page->smarty->assign('pagertotalitems', $browsecount); |
|
| 136 | - $page->smarty->assign('pageroffset', $offset); |
|
| 137 | - $page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE); |
|
| 138 | - $page->smarty->assign('pagerquerybase', WWW_TOP . "/myshows/browse?ob=" . $orderby . "&offset="); |
|
| 139 | - $page->smarty->assign('pagerquerysuffix', "#results"); |
|
| 140 | - $page->smarty->assign('covgroup', ''); |
|
| 141 | - |
|
| 142 | - $pager = $page->smarty->fetch("pager.tpl"); |
|
| 143 | - $page->smarty->assign('pager', $pager); |
|
| 144 | - |
|
| 145 | - foreach ($ordering as $ordertype) { |
|
| 146 | - $page->smarty->assign('orderby' . $ordertype, WWW_TOP . "/myshows/browse?ob=" . $ordertype . "&offset=0"); |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - $page->smarty->assign('lastvisit', $page->userdata['lastlogin']); |
|
| 150 | - |
|
| 151 | - $page->smarty->assign('results', $results); |
|
| 152 | - |
|
| 153 | - $page->smarty->assign('shows', true); |
|
| 154 | - |
|
| 155 | - $page->content = $page->smarty->fetch('browse.tpl'); |
|
| 156 | - $page->render(); |
|
| 157 | - break; |
|
| 158 | - default: |
|
| 159 | - |
|
| 160 | - $page->title = "My Shows"; |
|
| 161 | - $page->meta_title = "My Shows"; |
|
| 162 | - $page->meta_keywords = "search,add,to,cart,nzb,description,details"; |
|
| 163 | - $page->meta_description = "Manage Your Shows"; |
|
| 164 | - |
|
| 165 | - $cat = new Category(['Settings' => $page->settings]); |
|
| 166 | - $tmpcats = $cat->getChildren(Category::TV_ROOT); |
|
| 167 | - $categories = array(); |
|
| 168 | - foreach ($tmpcats as $c) { |
|
| 169 | - $categories[$c['id']] = $c['title']; |
|
| 170 | - } |
|
| 171 | - |
|
| 172 | - $shows = $us->getShows($page->users->currentUserId()); |
|
| 173 | - $results = array(); |
|
| 174 | - foreach ($shows as $showk => $show) { |
|
| 175 | - $showcats = explode('|', $show['categories']); |
|
| 176 | - if (is_array($showcats) && sizeof($showcats) > 0) { |
|
| 177 | - $catarr = array(); |
|
| 178 | - foreach ($showcats as $scat) { |
|
| 179 | - if (!empty($scat)) { |
|
| 180 | - $catarr[] = $categories[$scat]; |
|
| 172 | + $shows = $us->getShows($page->users->currentUserId()); |
|
| 173 | + $results = array(); |
|
| 174 | + foreach ($shows as $showk => $show) { |
|
| 175 | + $showcats = explode('|', $show['categories']); |
|
| 176 | + if (is_array($showcats) && sizeof($showcats) > 0) { |
|
| 177 | + $catarr = array(); |
|
| 178 | + foreach ($showcats as $scat) { |
|
| 179 | + if (!empty($scat)) { |
|
| 180 | + $catarr[] = $categories[$scat]; |
|
| 181 | + } |
|
| 181 | 182 | } |
| 183 | + $show['categoryNames'] = implode(', ', $catarr); |
|
| 184 | + } else { |
|
| 185 | + $show['categoryNames'] = ''; |
|
| 182 | 186 | } |
| 183 | - $show['categoryNames'] = implode(', ', $catarr); |
|
| 184 | - } else { |
|
| 185 | - $show['categoryNames'] = ''; |
|
| 186 | - } |
|
| 187 | 187 | |
| 188 | - $results[$showk] = $show; |
|
| 189 | - } |
|
| 190 | - $page->smarty->assign('shows', $results); |
|
| 188 | + $results[$showk] = $show; |
|
| 189 | + } |
|
| 190 | + $page->smarty->assign('shows', $results); |
|
| 191 | 191 | |
| 192 | - $page->content = $page->smarty->fetch('myshows.tpl'); |
|
| 193 | - $page->render(); |
|
| 194 | - break; |
|
| 192 | + $page->content = $page->smarty->fetch('myshows.tpl'); |
|
| 193 | + $page->render(); |
|
| 194 | + break; |
|
| 195 | 195 | } |