@@ -1215,7 +1215,7 @@ |
||
| 1215 | 1215 | * Get list of user signups by month. |
| 1216 | 1216 | * |
| 1217 | 1217 | * @return array |
| 1218 | - */ |
|
| 1218 | + */ |
|
| 1219 | 1219 | public function getUsersByMonth() |
| 1220 | 1220 | { |
| 1221 | 1221 | return $this->pdo->query(" |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | $user = $this->getById($userID); |
| 898 | 898 | $secure_cookie = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? '1' : '0'); |
| 899 | 899 | setcookie('uid', $userID, (time() + 2592000), '/', null, $secure_cookie, true); |
| 900 | - setcookie('idh', ($this->hashSHA1($user['userseed'] . $userID)), (time() + 2592000), '/', null, $secure_cookie, true); } |
|
| 900 | + setcookie('idh', ($this->hashSHA1($user['userseed'] . $userID)), (time() + 2592000), '/', null, $secure_cookie, true); } |
|
| 901 | 901 | |
| 902 | 902 | /** |
| 903 | 903 | * Add a release to the user's cart. |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | $userID |
| 1419 | 1419 | ) |
| 1420 | 1420 | ); |
| 1421 | - return ($value === false ? 0 : (int) $value['num']); |
|
| 1421 | + return ($value === false ? 0 : (int)$value['num']); |
|
| 1422 | 1422 | } |
| 1423 | 1423 | |
| 1424 | 1424 | /** |
@@ -1464,7 +1464,7 @@ discard block |
||
| 1464 | 1464 | ) |
| 1465 | 1465 | ); |
| 1466 | 1466 | |
| 1467 | - return ((integer)$result['role'] == (integer) $roleID) ? true : false; |
|
| 1467 | + return ((integer)$result['role'] == (integer)$roleID) ? true : false; |
|
| 1468 | 1468 | } |
| 1469 | 1469 | |
| 1470 | 1470 | /** |
@@ -1474,7 +1474,7 @@ discard block |
||
| 1474 | 1474 | * @return bool |
| 1475 | 1475 | */ |
| 1476 | 1476 | public function isAdmin($userID) { |
| 1477 | - return $this->roleCheck(self::ROLE_ADMIN, (integer) $userID); |
|
| 1477 | + return $this->roleCheck(self::ROLE_ADMIN, (integer)$userID); |
|
| 1478 | 1478 | } |
| 1479 | 1479 | |
| 1480 | 1480 | /** |
@@ -1484,6 +1484,6 @@ discard block |
||
| 1484 | 1484 | * @return bool |
| 1485 | 1485 | */ |
| 1486 | 1486 | public function isModerator($userId) { |
| 1487 | - return $this->roleCheck(self::ROLE_MODERATOR, (integer) $userId); |
|
| 1487 | + return $this->roleCheck(self::ROLE_MODERATOR, (integer)$userId); |
|
| 1488 | 1488 | } |
| 1489 | 1489 | } |
@@ -1050,8 +1050,9 @@ discard block |
||
| 1050 | 1050 | { |
| 1051 | 1051 | $ret = []; |
| 1052 | 1052 | $data = $this->pdo->query(sprintf("SELECT categories_id FROM role_excluded_categories WHERE role = %d", $role)); |
| 1053 | - foreach ($data as $d) |
|
| 1054 | - $ret[] = $d["categories_id"]; |
|
| 1053 | + foreach ($data as $d) { |
|
| 1054 | + $ret[] = $d["categories_id"]; |
|
| 1055 | + } |
|
| 1055 | 1056 | |
| 1056 | 1057 | return $ret; |
| 1057 | 1058 | } |
@@ -1501,7 +1502,8 @@ discard block |
||
| 1501 | 1502 | * @param string|int $user |
| 1502 | 1503 | * @return bool |
| 1503 | 1504 | */ |
| 1504 | - public function roleCheck($roleID, $user) { |
|
| 1505 | + public function roleCheck($roleID, $user) |
|
| 1506 | + { |
|
| 1505 | 1507 | |
| 1506 | 1508 | if (is_string($user) && strlen($user) > 0) { |
| 1507 | 1509 | $user = $this->pdo->escapeString($user); |
@@ -1528,7 +1530,8 @@ discard block |
||
| 1528 | 1530 | * @param int $userID |
| 1529 | 1531 | * @return bool |
| 1530 | 1532 | */ |
| 1531 | - public function isAdmin($userID) { |
|
| 1533 | + public function isAdmin($userID) |
|
| 1534 | + { |
|
| 1532 | 1535 | return $this->roleCheck(self::ROLE_ADMIN, (integer) $userID); |
| 1533 | 1536 | } |
| 1534 | 1537 | |
@@ -1538,7 +1541,8 @@ discard block |
||
| 1538 | 1541 | * @param int $userId |
| 1539 | 1542 | * @return bool |
| 1540 | 1543 | */ |
| 1541 | - public function isModerator($userId) { |
|
| 1544 | + public function isModerator($userId) |
|
| 1545 | + { |
|
| 1542 | 1546 | return $this->roleCheck(self::ROLE_MODERATOR, (integer) $userId); |
| 1543 | 1547 | } |
| 1544 | 1548 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @package nzedb |
| 10 | 10 | */ |
| 11 | -Class Videos |
|
| 11 | +class Videos |
|
| 12 | 12 | { |
| 13 | 13 | /** |
| 14 | 14 | * @param array $options |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | return null; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - $limit = $options['limit'] > 0 ? "LIMIT {$options['limit']}" : ''; |
|
| 96 | + $limit = $options['limit'] > 0 ? "limit {$options['limit']}" : ''; |
|
| 97 | 97 | |
| 98 | 98 | $enclosedby = empty($options['enclosedby']) ? '' : "ENCLOSED BY {$this->escapeString($options['enclosedby'])}"; |
| 99 | 99 | |
@@ -307,7 +307,7 @@ |
||
| 307 | 307 | 'unrarpath' => '', |
| 308 | 308 | 'yydecoderpath' => '', |
| 309 | 309 | ]; |
| 310 | - $fields += $defaults; // Make sure keys exist to avoid error notices. |
|
| 310 | + $fields += $defaults; // Make sure keys exist to avoid error notices. |
|
| 311 | 311 | ksort($fields); |
| 312 | 312 | // Validate settings |
| 313 | 313 | $fields['nzbpath'] = Text::trailingSlash($fields['nzbpath']); |
@@ -215,7 +215,7 @@ |
||
| 215 | 215 | |
| 216 | 216 | $table = $this->table(); |
| 217 | 217 | $this->queryExec( |
| 218 | - sprintf("UPDATE $table SET value = CASE setting %s END WHERE setting IN (%s)", |
|
| 218 | + sprintf("update $table SET value = CASE setting %s END WHERE setting IN (%s)", |
|
| 219 | 219 | implode(' ', $sql), |
| 220 | 220 | implode(', ', $sqlKeys) |
| 221 | 221 | ) |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | abstract class Videos |
| 31 | 31 | { |
| 32 | 32 | // Video Type Identifiers |
| 33 | - const TYPE_TV = 0; // Type of video is a TV Programme/Show |
|
| 33 | + const TYPE_TV = 0; // Type of video is a TV Programme/Show |
|
| 34 | 34 | const TYPE_FILM = 1; // Type of video is a Film/Movie |
| 35 | 35 | const TYPE_ANIME = 2; // Type of video is a Anime |
| 36 | 36 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | protected function getSiteIDFromVideoID($siteColumn, $videoID) |
| 93 | 93 | { |
| 94 | 94 | if (in_array($siteColumn, $this->sites)) { |
| 95 | - $result = $this->pdo->queryOneRow("SELECT $siteColumn FROM videos WHERE id = $videoID"); |
|
| 95 | + $result = $this->pdo->queryOneRow("select $siteColumn FROM videos WHERE id = $videoID"); |
|
| 96 | 96 | |
| 97 | 97 | return isset($result[$siteColumn]) ? $result[$siteColumn] : false; |
| 98 | 98 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | public function addAliases($videoId, array $aliases = []) |
| 259 | 259 | { |
| 260 | 260 | if (!empty($aliases) && $videoId > 0) { |
| 261 | - foreach ($aliases AS $key => $title) { |
|
| 261 | + foreach ($aliases as $key => $title) { |
|
| 262 | 262 | // Check for tvmaze style aka |
| 263 | 263 | if (is_array($title) && !empty($title['name'])) { |
| 264 | 264 | $title = $title['name']; |
@@ -178,7 +178,7 @@ |
||
| 178 | 178 | $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); |
| 179 | 179 | $this->titleCache[] = $release['cleanname']; |
| 180 | 180 | } |
| 181 | - } else{ |
|
| 181 | + } else { |
|
| 182 | 182 | //Processing failed, set the episode ID to the next processing group |
| 183 | 183 | $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); |
| 184 | 184 | $this->titleCache[] = $release['cleanname']; |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | $highestMatch = 0; |
| 264 | 264 | |
| 265 | 265 | $show = []; |
| 266 | - foreach ($shows AS $show) { |
|
| 266 | + foreach ($shows as $show) { |
|
| 267 | 267 | if ($this->checkRequiredAttr($show, 'tmdbS')) { |
| 268 | 268 | // Check for exact title match first and then terminate if found |
| 269 | 269 | if (strtolower($show['name']) === strtolower($cleanName)) { |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | if ($showAlternativeTitles !== null && is_array($showAlternativeTitles)) { |
| 297 | - foreach ($showAlternativeTitles AS $aka) { |
|
| 297 | + foreach ($showAlternativeTitles as $aka) { |
|
| 298 | 298 | $highest['alternative_titles'][] = $aka['title']; |
| 299 | 299 | } |
| 300 | 300 | $highest['network'] = isset($show['networks'][0]['name']) ? $show['networks'][0]['name'] : ''; |
@@ -216,7 +216,7 @@ |
||
| 216 | 216 | $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); |
| 217 | 217 | $this->titleCache[] = $release['cleanname']; |
| 218 | 218 | } |
| 219 | - } else{ |
|
| 219 | + } else { |
|
| 220 | 220 | //Processing failed, set the episode ID to the next processing group |
| 221 | 221 | $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); |
| 222 | 222 | $this->titleCache[] = $release['cleanname']; |
@@ -121,16 +121,16 @@ |
||
| 121 | 121 | abstract protected function formatEpisodeInfo($episode); |
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | - * Retrieve releases for TV processing |
|
| 125 | - * Returns a PDO Object of rows or false if none found |
|
| 126 | - * |
|
| 127 | - * @param string $groupID -- ID of the usenet group to process |
|
| 128 | - * @param string $guidChar -- threading method by first guid character |
|
| 129 | - * @param int $lookupSetting -- whether or not to use the API |
|
| 130 | - * @param int $status -- release processing status of tv_episodes_id |
|
| 131 | - * |
|
| 132 | - * @return false|int|\PDOStatement |
|
| 133 | - */ |
|
| 124 | + * Retrieve releases for TV processing |
|
| 125 | + * Returns a PDO Object of rows or false if none found |
|
| 126 | + * |
|
| 127 | + * @param string $groupID -- ID of the usenet group to process |
|
| 128 | + * @param string $guidChar -- threading method by first guid character |
|
| 129 | + * @param int $lookupSetting -- whether or not to use the API |
|
| 130 | + * @param int $status -- release processing status of tv_episodes_id |
|
| 131 | + * |
|
| 132 | + * @return false|int|\PDOStatement |
|
| 133 | + */ |
|
| 134 | 134 | public function getTvReleases($groupID = '', $guidChar = '', $lookupSetting = 1, $status = 0) |
| 135 | 135 | { |
| 136 | 136 | $ret = 0; |
@@ -13,25 +13,25 @@ |
||
| 13 | 13 | abstract class TV extends Videos |
| 14 | 14 | { |
| 15 | 15 | // Television Sources |
| 16 | - const SOURCE_NONE = 0; // No Scrape source |
|
| 17 | - const SOURCE_TVDB = 1; // Scrape source was TVDB |
|
| 18 | - const SOURCE_TVMAZE = 2; // Scrape source was TVMAZE |
|
| 19 | - const SOURCE_TMDB = 3; // Scrape source was TMDB |
|
| 20 | - const SOURCE_TRAKT = 4; // Scrape source was Trakt |
|
| 21 | - const SOURCE_IMDB = 5; // Scrape source was IMDB |
|
| 22 | - const SOURCE_TVRAGE = 6; // Scrape source was TvRage |
|
| 16 | + const SOURCE_NONE = 0; // No Scrape source |
|
| 17 | + const SOURCE_TVDB = 1; // Scrape source was TVDB |
|
| 18 | + const SOURCE_TVMAZE = 2; // Scrape source was TVMAZE |
|
| 19 | + const SOURCE_TMDB = 3; // Scrape source was TMDB |
|
| 20 | + const SOURCE_TRAKT = 4; // Scrape source was Trakt |
|
| 21 | + const SOURCE_IMDB = 5; // Scrape source was IMDB |
|
| 22 | + const SOURCE_TVRAGE = 6; // Scrape source was TvRage |
|
| 23 | 23 | |
| 24 | 24 | // Anime Sources |
| 25 | - const SOURCE_ANIDB = 10; // Scrape source was AniDB |
|
| 25 | + const SOURCE_ANIDB = 10; // Scrape source was AniDB |
|
| 26 | 26 | |
| 27 | 27 | // Processing signifiers |
| 28 | - const PROCESS_TVDB = 0; // Process TVDB First |
|
| 29 | - const PROCESS_TVMAZE = -1; // Process TVMaze Second |
|
| 30 | - const PROCESS_TMDB = -2; // Process TMDB Third |
|
| 31 | - const PROCESS_TRAKT = -3; // Process Trakt Fourth |
|
| 32 | - const PROCESS_IMDB = -4; // Process IMDB Fifth |
|
| 33 | - const PROCESS_TVRAGE = -5; // Process TvRage Sixth |
|
| 34 | - const NO_MATCH_FOUND = -6; // Failed All Methods |
|
| 28 | + const PROCESS_TVDB = 0; // Process TVDB First |
|
| 29 | + const PROCESS_TVMAZE = -1; // Process TVMaze Second |
|
| 30 | + const PROCESS_TMDB = -2; // Process TMDB Third |
|
| 31 | + const PROCESS_TRAKT = -3; // Process Trakt Fourth |
|
| 32 | + const PROCESS_IMDB = -4; // Process IMDB Fifth |
|
| 33 | + const PROCESS_TVRAGE = -5; // Process TvRage Sixth |
|
| 34 | + const NO_MATCH_FOUND = -6; // Failed All Methods |
|
| 35 | 35 | const FAILED_PARSE = -100; // Failed Parsing |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * These constants are bitwise for checking what was changed. |
| 14 | 14 | */ |
| 15 | - const UPDATED_GIT_COMMIT = 1; |
|
| 16 | - const UPDATED_GIT_TAG = 2; |
|
| 17 | - const UPDATED_SQL_DB_PATCH = 4; |
|
| 18 | - const UPDATED_SQL_FILE_LAST = 8; |
|
| 15 | + const UPDATED_GIT_COMMIT = 1; |
|
| 16 | + const UPDATED_GIT_TAG = 2; |
|
| 17 | + const UPDATED_SQL_DB_PATCH = 4; |
|
| 18 | + const UPDATED_SQL_FILE_LAST = 8; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @var \nzedb\utility\Git instance variable. |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | case 'binary_blacklist_delete': |
| 23 | 23 | $id = (int)$_GET['row_id']; |
| 24 | 24 | (new Binaries($settings))->deleteBlacklist($id); |
| 25 | - print "Blacklist $id deleted."; |
|
| 25 | + print "blacklist $id deleted."; |
|
| 26 | 26 | break; |
| 27 | 27 | |
| 28 | 28 | case 'category_regex_delete': |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | (new Regexes([ |
| 31 | 31 | 'Settings' => $admin->settings, 'Table_Name' => 'category_regexes' |
| 32 | 32 | ]))->deleteRegex($id); |
| 33 | - print "Regex $id deleted."; |
|
| 33 | + print "regex $id deleted."; |
|
| 34 | 34 | break; |
| 35 | 35 | |
| 36 | 36 | case 'collection_regex_delete': |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | (new Regexes([ |
| 39 | 39 | 'Settings' => $admin->settings, 'Table_Name' => 'collection_regexes' |
| 40 | 40 | ]))->deleteRegex($id); |
| 41 | - print "Regex $id deleted."; |
|
| 41 | + print "regex $id deleted."; |
|
| 42 | 42 | break; |
| 43 | 43 | |
| 44 | 44 | case 'release_naming_regex_delete': |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | (new Regexes([ |
| 47 | 47 | 'Settings' => $admin->settings, 'Table_Name' => 'release_naming_regexes' |
| 48 | 48 | ]))->deleteRegex($id); |
| 49 | - print "Regex $id deleted."; |
|
| 49 | + print "regex $id deleted."; |
|
| 50 | 50 | break; |
| 51 | 51 | |
| 52 | 52 | case 'group_edit_purge_all': |
@@ -64,21 +64,21 @@ discard block |
||
| 64 | 64 | $id = (int)$_GET['group_id']; |
| 65 | 65 | session_write_close(); |
| 66 | 66 | (new Groups($settings))->purge($id); |
| 67 | - print "Group $id purged."; |
|
| 67 | + print "group $id purged."; |
|
| 68 | 68 | break; |
| 69 | 69 | |
| 70 | 70 | case 'group_edit_reset_single': |
| 71 | 71 | $id = (int)$_GET['group_id']; |
| 72 | 72 | session_write_close(); |
| 73 | 73 | (new Groups($settings))->reset($id); |
| 74 | - print "Group $id reset."; |
|
| 74 | + print "group $id reset."; |
|
| 75 | 75 | break; |
| 76 | 76 | |
| 77 | 77 | case 'group_edit_delete_single': |
| 78 | 78 | $id = (int)$_GET['group_id']; |
| 79 | 79 | session_write_close(); |
| 80 | 80 | (new Groups($settings))->delete($id); |
| 81 | - print "Group $id deleted."; |
|
| 81 | + print "group $id deleted."; |
|
| 82 | 82 | break; |
| 83 | 83 | |
| 84 | 84 | case 'toggle_group_active_status': |