@@ -30,20 +30,19 @@ discard block |
||
| 30 | 30 | $matchagainstbins = isset($_REQUEST['matchagainstbins']) ? $_REQUEST['matchagainstbins'] : ''; |
| 31 | 31 | $numarticles = (isset($_REQUEST['numarticles']) && !empty($_REQUEST['numarticles'])) ? $_REQUEST['numarticles'] : $numarticlesdefault; |
| 32 | 32 | $clearexistingbins = isset($_REQUEST['clearexistingbins']) ? true : false; |
| 33 | -foreach($groupList as $grp) |
|
| 34 | -{ |
|
| 33 | +foreach($groupList as $grp) { |
|
| 35 | 34 | $gid[$grp["id"]] = $grp["id"]; |
| 36 | 35 | $gnames[$grp["id"]] = $grp["name"]; |
| 37 | 36 | } |
| 38 | 37 | |
| 39 | 38 | $group = $groupname; |
| 40 | -if ($group == '') |
|
| 41 | -{ |
|
| 42 | - if ($groupID == 0) |
|
| 43 | - $group = 0; |
|
| 44 | - else |
|
| 45 | - $group = $gnames[$groupID]; |
|
| 46 | -} |
|
| 39 | +if ($group == '') { |
|
| 40 | + if ($groupID == 0) { |
|
| 41 | + $group = 0; |
|
| 42 | + } else { |
|
| 43 | + $group = $gnames[$groupID]; |
|
| 44 | + } |
|
| 45 | + } |
|
| 47 | 46 | |
| 48 | 47 | $page->smarty->assign('gid', $gid); |
| 49 | 48 | $page->smarty->assign('gnames', $gnames); |
@@ -56,11 +55,9 @@ discard block |
||
| 56 | 55 | $page->smarty->assign('matchagainstbins', $matchagainstbins); |
| 57 | 56 | $page->smarty->assign('numarticles', $numarticles); |
| 58 | 57 | |
| 59 | -switch($action) |
|
| 60 | -{ |
|
| 58 | +switch($action) { |
|
| 61 | 59 | case 'test': |
| 62 | - if (isset($_REQUEST["regex"])) |
|
| 63 | - { |
|
| 60 | + if (isset($_REQUEST["regex"])) { |
|
| 64 | 61 | $matches = $reg->testRegex($_REQUEST['regex'], $group, $poster, $unreleased, $matchagainstbins); |
| 65 | 62 | |
| 66 | 63 | $offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0; |
@@ -13,8 +13,9 @@ |
||
| 13 | 13 | $page->title = "AniDB List"; |
| 14 | 14 | |
| 15 | 15 | $aname = ""; |
| 16 | -if (isset($_REQUEST['animetitle']) && !empty($_REQUEST['animetitle'])) |
|
| 16 | +if (isset($_REQUEST['animetitle']) && !empty($_REQUEST['animetitle'])) { |
|
| 17 | 17 | $aname = $_REQUEST['animetitle']; |
| 18 | +} |
|
| 18 | 19 | |
| 19 | 20 | $animecount = $AniDB->getAnimeCount($aname); |
| 20 | 21 | |
@@ -6,18 +6,14 @@ |
||
| 6 | 6 | |
| 7 | 7 | $page = new AdminPage(); |
| 8 | 8 | |
| 9 | -if (isset($_GET['id'])) |
|
| 10 | -{ |
|
| 9 | +if (isset($_GET['id'])) { |
|
| 11 | 10 | $users = new Users(); |
| 12 | 11 | $users->delete($_GET['id']); |
| 13 | 12 | } |
| 14 | 13 | |
| 15 | -if (isset($_GET['redir'])) |
|
| 16 | -{ |
|
| 14 | +if (isset($_GET['redir'])) { |
|
| 17 | 15 | header("Location: " . $_GET['redir']); |
| 18 | -} |
|
| 19 | -else |
|
| 20 | -{ |
|
| 16 | +} else { |
|
| 21 | 17 | $referrer = $_SERVER['HTTP_REFERER']; |
| 22 | 18 | header("Location: " . $referrer); |
| 23 | 19 | } |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | // set the current action |
| 13 | 13 | $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view'; |
| 14 | 14 | |
| 15 | -switch($action) |
|
| 16 | -{ |
|
| 15 | +switch($action) { |
|
| 17 | 16 | case 'add': |
| 18 | 17 | $page->title = "Spotnab Source Add"; |
| 19 | 18 | $source = []; |
@@ -28,13 +27,10 @@ discard block |
||
| 28 | 27 | $page->smarty->assign('source', $source); |
| 29 | 28 | break; |
| 30 | 29 | case 'submit': |
| 31 | - if ($_POST["id"] == "") |
|
| 32 | - { |
|
| 30 | + if ($_POST["id"] == "") { |
|
| 33 | 31 | $ret = $spotnab->addSource($_POST['description'], $_POST['username'], $_POST['useremail'], $_POST['usenetgroup'], $_POST['publickey']); |
| 34 | 32 | header("Location:".WWW_TOP."/spotnab-list.php"); |
| 35 | - } |
|
| 36 | - else |
|
| 37 | - { |
|
| 33 | + } else { |
|
| 38 | 34 | $ret = $spotnab->updateSource($_POST['id'],$_POST['description'], $_POST['username'], $_POST['useremail'], $_POST['usenetgroup'], $_POST['publickey']); |
| 39 | 35 | header("Location:".WWW_TOP."/spotnab-list.php"); |
| 40 | 36 | } |
@@ -42,8 +38,7 @@ discard block |
||
| 42 | 38 | case 'view': |
| 43 | 39 | default: |
| 44 | 40 | |
| 45 | - if (isset($_GET["id"])) |
|
| 46 | - { |
|
| 41 | + if (isset($_GET["id"])) { |
|
| 47 | 42 | $page->title = "Spotnab Source Edit"; |
| 48 | 43 | $id = $_GET["id"]; |
| 49 | 44 | $source = $spotnab->getSourceByID($id); |
@@ -18,74 +18,56 @@ |
||
| 18 | 18 | } else { |
| 19 | 19 | print 'Deactivated site ' . $_GET['site_ID']; |
| 20 | 20 | } |
| 21 | -} |
|
| 22 | - |
|
| 23 | -else if (isset($_GET['enabled_status'])) { |
|
| 21 | +} else if (isset($_GET['enabled_status'])) { |
|
| 24 | 22 | $db->queryExec(sprintf('UPDATE sharing SET enabled = %d', $_GET['enabled_status'])); |
| 25 | 23 | if ($_GET['enabled_status'] == 1) { |
| 26 | 24 | print 'Enabled sharing!'; |
| 27 | 25 | } else { |
| 28 | 26 | print 'Disabled sharing!'; |
| 29 | 27 | } |
| 30 | -} |
|
| 31 | - |
|
| 32 | -else if (isset($_GET['posting_status'])) { |
|
| 28 | +} else if (isset($_GET['posting_status'])) { |
|
| 33 | 29 | $db->queryExec(sprintf('UPDATE sharing SET posting = %d', $_GET['posting_status'])); |
| 34 | 30 | if ($_GET['posting_status'] == 1) { |
| 35 | 31 | print 'Enabled posting!'; |
| 36 | 32 | } else { |
| 37 | 33 | print 'Disabled posting!'; |
| 38 | 34 | } |
| 39 | -} |
|
| 40 | - |
|
| 41 | -else if (isset($_GET['fetching_status'])) { |
|
| 35 | +} else if (isset($_GET['fetching_status'])) { |
|
| 42 | 36 | $db->queryExec(sprintf('UPDATE sharing SET fetching = %d', $_GET['fetching_status'])); |
| 43 | 37 | if ($_GET['fetching_status'] == 1) { |
| 44 | 38 | print 'Enabled fetching!'; |
| 45 | 39 | } else { |
| 46 | 40 | print 'Disabled fetching!'; |
| 47 | 41 | } |
| 48 | -} |
|
| 49 | - |
|
| 50 | -else if (isset($_GET['auto_status'])) { |
|
| 42 | +} else if (isset($_GET['auto_status'])) { |
|
| 51 | 43 | $db->queryExec(sprintf('UPDATE sharing SET auto_enable = %d', $_GET['auto_status'])); |
| 52 | 44 | if ($_GET['auto_status'] == 1) { |
| 53 | 45 | print 'Enabled automatic site enabling!'; |
| 54 | 46 | } else { |
| 55 | 47 | print 'Disabled automatic site enabling!'; |
| 56 | 48 | } |
| 57 | -} |
|
| 58 | - |
|
| 59 | -else if (isset($_GET['hide_status'])) { |
|
| 49 | +} else if (isset($_GET['hide_status'])) { |
|
| 60 | 50 | $db->queryExec(sprintf('UPDATE sharing SET hide_users = %d', $_GET['hide_status'])); |
| 61 | 51 | if ($_GET['hide_status'] == 1) { |
| 62 | 52 | print 'Enabled hiding of user names!'; |
| 63 | 53 | } else { |
| 64 | 54 | print 'Disabled hiding of user names!'; |
| 65 | 55 | } |
| 66 | -} |
|
| 67 | - |
|
| 68 | -else if (isset($_GET['start_position'])) { |
|
| 56 | +} else if (isset($_GET['start_position'])) { |
|
| 69 | 57 | $db->queryExec(sprintf('UPDATE sharing SET start_position = %d', $_GET['start_position'])); |
| 70 | 58 | if ($_GET['start_position'] == 1) { |
| 71 | 59 | print 'Enabled fetching from start of group!'; |
| 72 | 60 | } else { |
| 73 | 61 | print 'Disabled fetching from start of group!'; |
| 74 | 62 | } |
| 75 | -} |
|
| 76 | - |
|
| 77 | -else if (isset($_GET['toggle_all'])) { |
|
| 63 | +} else if (isset($_GET['toggle_all'])) { |
|
| 78 | 64 | $db->queryExec(sprintf('UPDATE sharing_sites SET enabled = %d', $_GET['toggle_all'])); |
| 79 | -} |
|
| 80 | - |
|
| 81 | -else if (isset($_GET['reset_settings'])) { |
|
| 65 | +} else if (isset($_GET['reset_settings'])) { |
|
| 82 | 66 | $guid = $db->queryOneRow('SELECT site_guid FROM sharing'); |
| 83 | 67 | $guid = ($guid === false ? '' : $guid['site_guid']); |
| 84 | 68 | (new Sharing(['Settings' => $admin->settings]))->initSettings($guid); |
| 85 | 69 | print 'Re-initiated sharing settings!'; |
| 86 | -} |
|
| 87 | - |
|
| 88 | -else if (isset($_GET['purge_site'])) { |
|
| 70 | +} else if (isset($_GET['purge_site'])) { |
|
| 89 | 71 | $guid = $db->queryOneRow(sprintf('SELECT site_guid FROM sharing_sites WHERE id = %d', $_GET['purge_site'])); |
| 90 | 72 | if ($guid === false) { |
| 91 | 73 | print 'Error purging site ' . $_GET['purge_site'] . '!'; |
@@ -12,19 +12,21 @@ |
||
| 12 | 12 | $releases = new Releases; |
| 13 | 13 | $nzb = new NZB; |
| 14 | 14 | |
| 15 | -if (!$users->isLoggedIn()) |
|
| 15 | +if (!$users->isLoggedIn()) { |
|
| 16 | 16 | $page->show403(); |
| 17 | +} |
|
| 17 | 18 | |
| 18 | -if (isset($_GET["id"])) |
|
| 19 | -{ |
|
| 19 | +if (isset($_GET["id"])) { |
|
| 20 | 20 | $rel = $releases->getByGuid($_GET["id"]); |
| 21 | - if (!$rel) |
|
| 22 | - $page->show404(); |
|
| 21 | + if (!$rel) { |
|
| 22 | + $page->show404(); |
|
| 23 | + } |
|
| 23 | 24 | |
| 24 | 25 | $nzbpath = $nzb->getNZBPath($_GET["id"], $page->settings->getSetting('nzbpath')); |
| 25 | 26 | |
| 26 | - if (!file_exists($nzbpath)) |
|
| 27 | - $page->show404(); |
|
| 27 | + if (!file_exists($nzbpath)) { |
|
| 28 | + $page->show404(); |
|
| 29 | + } |
|
| 28 | 30 | |
| 29 | 31 | ob_start(); |
| 30 | 32 | @readgzfile($nzbpath); |
@@ -15,8 +15,7 @@ |
||
| 15 | 15 | $id = $_REQUEST['id']; |
| 16 | 16 | |
| 17 | 17 | $movCheck = $movie->getMovieInfo($id); |
| 18 | - if (!$movCheck || (isset($_REQUEST['update']) && $_REQUEST['update'] == 1)) |
|
| 19 | - { |
|
| 18 | + if (!$movCheck || (isset($_REQUEST['update']) && $_REQUEST['update'] == 1)) { |
|
| 20 | 19 | if($movie->updateMovieInfo($id)) { |
| 21 | 20 | header("Location:".WWW_TOP."/movie-list.php"); |
| 22 | 21 | die(); |
@@ -10,8 +10,7 @@ |
||
| 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; |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | $admin = new AdminPage; |
| 9 | 9 | $s = new Sites(); |
| 10 | 10 | |
| 11 | -if (isset($_GET['action'])) |
|
| 12 | -{ |
|
| 13 | - if ($_GET['action'] == "1") |
|
| 14 | - $s->updateItem("showadminwelcome", 1); |
|
| 15 | - else |
|
| 16 | - $s->updateItem("showadminwelcome", 0); |
|
| 17 | -} |
|
| 11 | +if (isset($_GET['action'])) { |
|
| 12 | + if ($_GET['action'] == "1") { |
|
| 13 | + $s->updateItem("showadminwelcome", 1); |
|
| 14 | + } else { |
|
| 15 | + $s->updateItem("showadminwelcome", 0); |
|
| 16 | + } |
|
| 17 | + } |
|
| 18 | 18 | |