diff --git a/bin/fixreleasenames.php b/bin/fixreleasenames.php index 7cacb209f..105a8d91b 100644 --- a/bin/fixreleasenames.php +++ b/bin/fixreleasenames.php @@ -18,11 +18,11 @@ if (!isset($argv[1])) { $pieces = explode(' ', $argv[1]); if (isset($pieces[1]) && $pieces[0] == 'nfo') { $release = $pieces[1]; - if ($res = $db->queryOneRow(sprintf('SELECT rel.guid AS guid, nfo.releaseID AS nfoid, rel.groupID, rel.categoryID, rel.name, rel.searchname, uncompress(nfo) AS textstring, rel.ID AS releaseID FROM releases rel INNER JOIN releasenfo nfo ON (nfo.releaseID = rel.ID) WHERE rel.ID = %d', $release))) { + if ($res = $db->queryOneRow(sprintf('SELECT rel.guid AS guid, nfo.releaseid AS nfoid, rel.groupid, rel.categoryid, rel.name, rel.searchname, uncompress(nfo) AS textstring, rel.id AS releaseid FROM releases rel INNER JOIN releasenfo nfo ON (nfo.releaseid = rel.id) WHERE rel.id = %d', $release))) { //ignore encrypted nfos if (preg_match('/^=newz\[NZB\]=\w+/', $res['textstring'])) { $namefixer->done = $namefixer->matched = false; - $db->queryDirect(sprintf('UPDATE releases SET proc_nfo = 1 WHERE ID = %d', $res['releaseID'])); + $db->queryDirect(sprintf('UPDATE releases SET proc_nfo = 1 WHERE id = %d', $res['releaseid'])); $namefixer->checked++; echo '.'; } else { @@ -36,9 +36,9 @@ if (!isset($argv[1])) { } } else if (isset($pieces[1]) && $pieces[0] == 'filename') { $release = $pieces[1]; - if ($res = $db->queryOneRow(sprintf('SELECT relfiles.name AS textstring, rel.categoryID, rel.searchname, ' - . 'rel.groupID, relfiles.releaseID AS fileid, rel.ID AS releaseID, rel.name FROM releases rel ' - . 'INNER JOIN releasefiles relfiles ON (relfiles.releaseID = rel.ID) WHERE rel.ID = %d', $release))) { + if ($res = $db->queryOneRow(sprintf('SELECT relfiles.name AS textstring, rel.categoryid, rel.searchname, ' + . 'rel.groupid, relfiles.releaseid AS fileid, rel.id AS releaseid, rel.name FROM releases rel ' + . 'INNER JOIN releasefiles relfiles ON (relfiles.releaseid = rel.id) WHERE rel.id = %d', $release))) { $namefixer->done = $namefixer->matched = false; if ($namefixer->checkName($res, true, 'Filenames, ', 1, 1) !== true) { echo '.'; @@ -47,13 +47,13 @@ if (!isset($argv[1])) { } } else if (isset($pieces[1]) && $pieces[0] == 'md5') { $release = $pieces[1]; - if ($res = $db->queryOneRow(sprintf('SELECT r.ID AS releaseID, r.name, r.searchname, r.categoryID, r.groupID, dehashstatus, rf.name AS filename FROM releases r LEFT JOIN releasefiles rf ON r.ID = rf.releaseID WHERE r.ID = %d', $release))) { + if ($res = $db->queryOneRow(sprintf('SELECT r.id AS releaseid, r.name, r.searchname, r.categoryid, r.groupid, dehashstatus, rf.name AS filename FROM releases r LEFT JOIN releasefiles rf ON r.id = rf.releaseid WHERE r.id = %d', $release))) { if (preg_match('/[a-fA-F0-9]{32,40}/i', $res['name'], $matches)) { $namefixer->matchPredbHash($matches[0], $res, 1, 1, true, 1); } else if (preg_match('/[a-fA-F0-9]{32,40}/i', $res['filename'], $matches)) { $namefixer->matchPredbHash($matches[0], $res, 1, 1, true, 1); } else { - $db->queryExec(sprintf("UPDATE releases SET dehashstatus = %d - 1 WHERE ID = %d", $res['dehashstatus'], $res['releaseID'])); + $db->queryExec(sprintf("UPDATE releases SET dehashstatus = %d - 1 WHERE id = %d", $res['dehashstatus'], $res['releaseid'])); echo '.'; } } @@ -76,8 +76,8 @@ if (!isset($argv[1])) { } else if (isset($pieces[1]) && $pieces[0] == 'predbft') { $pre = $pieces[1]; - if ($res = $db->queryOneRow(sprintf('SELECT ID AS preid, title, source, searched FROM prehash ' - . 'WHERE ID = %d', $pre + if ($res = $db->queryOneRow(sprintf('SELECT id AS preid, title, source, searched FROM prehash ' + . 'WHERE id = %d', $pre ) ) ) { @@ -93,7 +93,7 @@ if (!isset($argv[1])) { $searched = $res['searched'] - 1; echo "."; } - $db->queryExec(sprintf("UPDATE prehash SET searched = %d WHERE ID = %d", $searched, $res['preid'])); + $db->queryExec(sprintf("UPDATE prehash SET searched = %d WHERE id = %d", $searched, $res['preid'])); $namefixer->checked++; } diff --git a/bin/groupfixrelnames.php b/bin/groupfixrelnames.php index 6c41faa21..5f198cbcf 100644 --- a/bin/groupfixrelnames.php +++ b/bin/groupfixrelnames.php @@ -25,15 +25,15 @@ if (!isset($argv[1])) { case $pieces[0] === 'nfo' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun): $releases = $pdo->queryDirect( sprintf(' - SELECT r.ID AS releaseID, r.guid, r.groupID, r.categoryID, r.name, r.searchname, + SELECT r.id AS releaseid, r.guid, r.groupid, r.categoryid, r.name, r.searchname, uncompress(nfo) AS textstring FROM releases r - INNER JOIN releasenfo rn ON r.ID = rn.releaseID + INNER JOIN releasenfo rn ON r.id = rn.releaseid WHERE r.guid %s AND r.nzbstatus = 1 AND r.proc_nfo = 0 AND r.nfostatus = 1 - AND r.prehashID = 0 + AND r.prehashid = 0 ORDER BY r.postdate DESC LIMIT %s', $pdo->likeString($guidChar, false, true), @@ -45,7 +45,7 @@ if (!isset($argv[1])) { foreach ($releases as $release) { if (preg_match('/^=newz\[NZB\]=\w+/', $release['textstring'])) { $namefixer->done = $namefixer->matched = false; - $pdo->queryDirect(sprintf('UPDATE releases SET proc_nfo = 1 WHERE ID = %d', $release['releaseID'])); + $pdo->queryDirect(sprintf('UPDATE releases SET proc_nfo = 1 WHERE id = %d', $release['releaseid'])); $namefixer->checked++; echo '.'; } else { @@ -61,13 +61,13 @@ if (!isset($argv[1])) { case $pieces[0] === 'filename' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun): $releases = $pdo->queryDirect( sprintf(' - SELECT rf.name AS textstring, rf.releaseID AS fileid, - r.ID AS releaseID, r.name, r.searchname, r.categoryID, r.groupID + SELECT rf.name AS textstring, rf.releaseid AS fileid, + r.id AS releaseid, r.name, r.searchname, r.categoryid, r.groupid FROM releases r - INNER JOIN releasefiles rf ON r.ID = rf.releaseID + INNER JOIN releasefiles rf ON r.id = rf.releaseid WHERE r.guid %s AND r.nzbstatus = 1 AND r.proc_files = 0 - AND r.prehashID = 0 + AND r.prehashid = 0 ORDER BY r.postdate ASC LIMIT %s', $pdo->likeString($guidChar, false, true), @@ -88,14 +88,14 @@ if (!isset($argv[1])) { case $pieces[0] === 'md5' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun): $releases = $pdo->queryDirect( sprintf(' - SELECT DISTINCT r.ID AS releaseID, r.name, r.searchname, r.categoryID, r.groupID, r.dehashstatus, + SELECT DISTINCT r.id AS releaseid, r.name, r.searchname, r.categoryid, r.groupid, r.dehashstatus, rf.name AS filename FROM releases r - LEFT OUTER JOIN releasefiles rf ON r.ID = rf.releaseID AND rf.ishashed = 1 + LEFT OUTER JOIN releasefiles rf ON r.id = rf.releaseid AND rf.ishashed = 1 WHERE r.guid %s AND nzbstatus = 1 AND r.ishashed = 1 AND r.dehashstatus BETWEEN -6 AND 0 - AND r.prehashID = 0 + AND r.prehashid = 0 ORDER BY r.dehashstatus DESC, r.postdate ASC LIMIT %s', $pdo->likeString($guidChar, false, true), @@ -110,7 +110,7 @@ if (!isset($argv[1])) { } else if (preg_match('/[a-fA-F0-9]{32,40}/i', $release['filename'], $matches)) { $namefixer->matchPredbHash($matches[0], $release, 1, 1, true, 1); } else { - $pdo->queryExec(sprintf("UPDATE releases SET dehashstatus = %d - 1 WHERE ID = %d", $release['dehashstatus'], $release['releaseID'])); + $pdo->queryExec(sprintf("UPDATE releases SET dehashstatus = %d - 1 WHERE id = %d", $release['dehashstatus'], $release['releaseid'])); echo '.'; } } @@ -119,12 +119,12 @@ if (!isset($argv[1])) { case $pieces[0] === 'par2' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun): $releases = $pdo->queryDirect( sprintf(' - SELECT r.ID AS releaseID, r.guid, r.groupID + SELECT r.id AS releaseid, r.guid, r.groupid FROM releases r WHERE r.guid %s AND r.nzbstatus = 1 AND r.proc_par2 = 0 - AND r.prehashID = 0 + AND r.prehashid = 0 ORDER BY r.postdate ASC LIMIT %s', $pdo->likeString($guidChar, false, true), @@ -146,7 +146,7 @@ if (!isset($argv[1])) { ) ); foreach ($releases as $release) { - $res = $nzbcontents->checkPAR2($release['guid'], $release['releaseID'], $release['groupID'], 1, 1); + $res = $nzbcontents->checkPAR2($release['guid'], $release['releaseid'], $release['groupid'], 1, 1); if ($res === false) { echo '.'; } @@ -156,12 +156,12 @@ if (!isset($argv[1])) { case $pieces[0] === 'miscsorter' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun): $releases = $pdo->queryDirect( sprintf(' - SELECT r.ID AS releaseID + SELECT r.id AS releaseid FROM releases r WHERE r.guid %s AND r.nzbstatus = 1 AND r.nfostatus = 1 AND r.proc_sorter = 0 AND r.isrenamed = 0 - AND r.prehashID = 0 + AND r.prehashid = 0 ORDER BY r.postdate DESC LIMIT %s', $pdo->likeString($guidChar, false, true), @@ -172,14 +172,14 @@ if (!isset($argv[1])) { if ($releases instanceof Traversable) { $sorter = new MiscSorter(true, $pdo); foreach ($releases as $release) { - $res = $sorter->nfosorter(null, $release['releaseID']); + $res = $sorter->nfosorter(null, $release['releaseid']); } } break; case $pieces[0] === 'predbft' && isset($maxperrun) && is_numeric($maxperrun) && isset($thread) && is_numeric($thread): $pres = $pdo->queryDirect( sprintf(' - SELECT p.ID AS prehashID, p.title, p.source, p.searched + SELECT p.id AS prehashid, p.title, p.source, p.searched FROM prehash p WHERE LENGTH(title) >= 15 AND title NOT REGEXP "[\"\<\> ]" AND searched = 0 @@ -206,7 +206,7 @@ if (!isset($argv[1])) { $searched = $pre['searched'] - 1; echo "."; } - $pdo->queryExec(sprintf("UPDATE prehash SET searched = %d WHERE ID = %d", $searched, $pre['prehashID'])); + $pdo->queryExec(sprintf("UPDATE prehash SET searched = %d WHERE id = %d", $searched, $pre['prehashid'])); $namefixer->checked++; } } diff --git a/bin/monitor.php b/bin/monitor.php index a1840e724..16eec9669 100644 --- a/bin/monitor.php +++ b/bin/monitor.php @@ -35,8 +35,8 @@ $tRun->runPane('scraper', $runVar); //get list of panes by name $runVar['panes'] = $tRun->getListOfPanes($runVar['constants']); -//totals per category in db, results by parentID -$catcntqry = "SELECT c.parentID AS parentID, COUNT(r.ID) AS count FROM category c, releases r WHERE r.categoryID = c.ID GROUP BY c.parentID"; +//totals per category in db, results by parentid +$catcntqry = "SELECT c.parentid AS parentid, COUNT(r.id) AS count FROM category c, releases r WHERE r.categoryid = c.id GROUP BY c.parentid"; //create timers and set to now $runVar['timers']['timer1'] = $runVar['timers']['timer2'] = $runVar['timers']['timer3'] = @@ -196,7 +196,7 @@ while ($runVar['counts']['iterations'] > 0) { foreach ($tables as $row) { $cntsql = ''; - $tbl = $row['Name']; + $tbl = $row['name']; $stamp = 'UNIX_TIMESTAMP(MIN(dateadded))'; $orderlim = ''; $cntsql = sprintf(' diff --git a/bin/update_releases.php b/bin/update_releases.php index 4799eae81..bfdf432f7 100644 --- a/bin/update_releases.php +++ b/bin/update_releases.php @@ -42,7 +42,7 @@ if (isset($argv[1]) && isset($argv[2])) { } else if ($argv[1] == 5 && ($argv[2] == 'true' || $argv[2] == 'false')) { echo $pdo->log->header("Categorizing all non-categorized releases in other->misc using usenet subject. This can take a while, be patient."); $timestart = TIME(); - $relcount = $releases->categorizeRelease('name', 'WHERE iscategorized = 0 AND categoryID = 8010'); + $relcount = $releases->categorizeRelease('name', 'WHERE iscategorized = 0 AND categoryid = 8010'); $time = $consoletools->convertTime(TIME() - $timestart); echo $pdo->log->primary("\n" . 'Finished categorizing ' . $relcount . ' releases in ' . $time . " seconds, using the usenet subject."); } else if ($argv[1] == 6 && $argv[2] == 'true') { @@ -55,7 +55,7 @@ if (isset($argv[1]) && isset($argv[2])) { } else if ($argv[1] == 6 && $argv[2] == 'false') { echo $pdo->log->header("Categorizing releases in misc sections using the searchname. This can take a while, be patient."); $timestart = TIME(); - $relcount = $releases->categorizeRelease('searchname', 'WHERE categoryID IN (1090, 2020, 3050, 5050, 6050, 8010)'); + $relcount = $releases->categorizeRelease('searchname', 'WHERE categoryid IN (1090, 2020, 3050, 5050, 6050, 8010)'); $consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]); $time = $consoletools->convertTime(TIME() - $timestart); echo $pdo->log->primary("\n" . 'Finished categorizing ' . $relcount . ' releases in ' . $time . " seconds, using the search name."); diff --git a/lib/DB/db.sql b/lib/DB/db.sql index 00181fc52..dcfe80f61 100644 --- a/lib/DB/db.sql +++ b/lib/DB/db.sql @@ -5,7 +5,7 @@ ADD `jpgstatus` TINYINT(1) NOT NULL DEFAULT 0, ADD `audiostatus` TINYINT(1) NOT NULL DEFAULT 0, ADD `videostatus` TINYINT(1) NOT NULL DEFAULT 0, ADD `reqidstatus` TINYINT(1) NOT NULL DEFAULT 0, -ADD `prehashID` INT UNSIGNED NOT NULL DEFAULT 0, +ADD `prehashid` INT UNSIGNED NOT NULL DEFAULT 0, ADD `iscategorized` BIT NOT NULL DEFAULT 0, ADD `isrenamed` BIT NOT NULL DEFAULT 0, ADD `ishashed` BIT NOT NULL DEFAULT 0, @@ -21,14 +21,14 @@ ADD `proc_sorter` TINYINT(1) NOT NULL DEFAULT '0'; CREATE INDEX `ix_releases_nfostatus` ON `releases` (`nfostatus` ASC) USING HASH; CREATE INDEX `ix_releases_reqidstatus` ON `releases` (`reqidstatus` ASC) USING HASH; CREATE INDEX `ix_releases_passwordstatus` ON `releases` (`passwordstatus`); -CREATE INDEX `ix_releases_releasenfoID` ON `releases` (`releasenfoID`); +CREATE INDEX `ix_releases_releasenfoID` ON `releases` (`releasenfoid`); CREATE INDEX `ix_releases_dehashstatus` ON `releases` (`dehashstatus`); CREATE INDEX `ix_releases_haspreview` ON `releases` (`haspreview` ASC) USING HASH; CREATE INDEX `ix_releases_postdate_name` ON `releases` (`postdate`, `name`); -CREATE INDEX `ix_releases_prehashid_searchname` ON `releases` (`prehashID`, `searchname`); +CREATE INDEX `ix_releases_prehashid_searchname` ON `releases` (`prehashid`, `searchname`); CREATE INDEX `ix_releases_gamesinfo_id` ON `releases` (`gamesinfo_id`); CREATE INDEX `ix_releases_xxxinfo_id` ON `releases` (`xxxinfo_id`); -CREATE INDEX `ix_releases_status` ON `releases` (`nzbstatus`, `iscategorized`, `isrenamed`, `nfostatus`, `ishashed`, `passwordstatus`, `dehashstatus`, `releasenfoID`, `musicinfoID`, `consoleinfoID`, `bookinfoID`, `haspreview`, `categoryID`, `imdbID`, `rageID`); +CREATE INDEX `ix_releases_status` ON `releases` (`nzbstatus`, `iscategorized`, `isrenamed`, `nfostatus`, `ishashed`, `passwordstatus`, `dehashstatus`, `releasenfoid`, `musicinfoid`, `consoleinfoid`, `bookinfoid`, `haspreview`, `categoryid`, `imdbid`, `rageid`); UPDATE releases SET `nzbstatus` = 1 WHERE `nzbstatus` = 0; ALTER TABLE users ADD COLUMN gameview INT AFTER consoleview; @@ -40,7 +40,7 @@ ALTER TABLE users ADD COLUMN queuetype TINYINT(1) NOT NULL DEFAULT 1; DROP TABLE IF EXISTS prehash; CREATE TABLE prehash ( - ID INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, filename VARCHAR(255) NOT NULL DEFAULT '', title VARCHAR(255) NOT NULL DEFAULT '', nfo VARCHAR(255) NULL, @@ -48,13 +48,13 @@ CREATE TABLE prehash ( category VARCHAR(255) NULL, predate DATETIME DEFAULT NULL, source VARCHAR(50) NOT NULL DEFAULT '', - requestID INT(10) UNSIGNED NOT NULL DEFAULT '0', - groupID INT(10) UNSIGNED NOT NULL DEFAULT '0', + requestid INT(10) UNSIGNED NOT NULL DEFAULT '0', + groupid INT(10) UNSIGNED NOT NULL DEFAULT '0', nuked TINYINT(1) NOT NULL DEFAULT '0', nukereason VARCHAR(255) NULL, files VARCHAR(50) NULL, searched TINYINT(1) NOT NULL DEFAULT '0', - PRIMARY KEY (ID) + PRIMARY KEY (id) ) ENGINE =INNODB DEFAULT CHARACTER SET utf8 @@ -66,20 +66,20 @@ CREATE UNIQUE INDEX `ix_prehash_title` ON `prehash` (`title`); CREATE INDEX `ix_prehash_nfo` ON `prehash` (`nfo`); CREATE INDEX `ix_prehash_predate` ON `prehash` (`predate`); CREATE INDEX `ix_prehash_source` ON `prehash` (`source`); -CREATE INDEX `ix_prehash_requestid` ON `prehash` (`requestID`, `groupID`); +CREATE INDEX `ix_prehash_requestid` ON `prehash` (`requestid`, `groupid`); CREATE INDEX `ix_prehash_size` ON `prehash` (`size`); CREATE INDEX `ix_prehash_category` ON `prehash` (`category`); CREATE INDEX `ix_prehash_searched` ON `prehash` (`searched`); DROP TABLE IF EXISTS tmux; CREATE TABLE tmux ( - ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, setting VARCHAR(64) COLLATE utf8_unicode_ci NOT NULL, value VARCHAR(19000) COLLATE utf8_unicode_ci DEFAULT NULL, updateddate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (ID), + PRIMARY KEY (id), UNIQUE KEY setting (setting) ) ENGINE =INNODB @@ -209,12 +209,12 @@ INSERT INTO tmux (setting, value) VALUES ('defrag_cache', '900'), DROP TABLE IF EXISTS releasesearch; CREATE TABLE releasesearch ( - ID INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - releaseID INT(11) UNSIGNED NOT NULL, + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + releaseid INT(11) UNSIGNED NOT NULL, guid VARCHAR(50) NOT NULL, name VARCHAR(255) NOT NULL DEFAULT '', searchname VARCHAR(255) NOT NULL DEFAULT '', - PRIMARY KEY (ID) + PRIMARY KEY (id) ) ENGINE =MYISAM DEFAULT CHARSET =utf8 @@ -222,15 +222,15 @@ CREATE TABLE releasesearch ( AUTO_INCREMENT =1; CREATE FULLTEXT INDEX ix_releasesearch_name_searchname_ft ON releasesearch (name, searchname); -CREATE INDEX ix_releasesearch_releaseid ON releasesearch (releaseID); +CREATE INDEX ix_releasesearch_releaseid ON releasesearch (releaseid); CREATE INDEX ix_releasesearch_guid ON releasesearch (guid); DROP TABLE IF EXISTS country; CREATE TABLE country ( - ID INT(11) NOT NULL AUTO_INCREMENT, + id INT(11) NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL DEFAULT "", code CHAR(2) NOT NULL DEFAULT "", - PRIMARY KEY (ID) + PRIMARY KEY (id) ) ENGINE =INNODB DEFAULT CHARACTER SET utf8 @@ -337,7 +337,7 @@ INSERT INTO country (code, name) VALUES ('AF', 'Afghanistan'), ('HU', 'Hungary'), ('IS', 'Iceland'), ('IN', 'India'), -('ID', 'Indonesia'), +('id', 'Indonesia'), ('IR', 'Iran'), ('IQ', 'Iraq'), ('IE', 'Ireland'), @@ -531,14 +531,14 @@ CREATE TABLE xxxinfo ( DROP TABLE IF EXISTS `genres`; CREATE TABLE IF NOT EXISTS `genres` ( - `ID` int(11) NOT NULL AUTO_INCREMENT, + `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `type` int(4) DEFAULT NULL, `disabled` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`ID`) + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC AUTO_INCREMENT=635; -INSERT IGNORE INTO `genres` (`ID`, `title`, `type`, `disabled`) VALUES +INSERT IGNORE INTO `genres` (`id`, `title`, `type`, `disabled`) VALUES (150, 'Blues', 3000, 0), (151, 'Classic Rock', 3000, 0), (152, 'Country', 3000, 0), @@ -1027,27 +1027,27 @@ INSERT IGNORE INTO `genres` (`ID`, `title`, `type`, `disabled`) VALUES DROP TABLE IF EXISTS shortgroups; CREATE TABLE shortgroups ( - ID INT(11) NOT NULL AUTO_INCREMENT, + id INT(11) NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL DEFAULT "", first_record BIGINT UNSIGNED NOT NULL DEFAULT "0", last_record BIGINT UNSIGNED NOT NULL DEFAULT "0", updated DATETIME DEFAULT NULL, - PRIMARY KEY (ID) + PRIMARY KEY (id) ) ENGINE =InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AUTO_INCREMENT =1; -CREATE INDEX ix_shortgroups_id ON shortgroups (ID); +CREATE INDEX ix_shortgroups_id ON shortgroups (id); CREATE INDEX ix_shortgroups_name ON shortgroups (name); DROP TABLE IF EXISTS `category`; CREATE TABLE category ( - `ID` INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + `id` INT PRIMARY KEY NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) NOT NULL, - `parentID` INT NULL, + `parentid` INT NULL, `status` INT NOT NULL DEFAULT '1', `minsizetoformrelease` BIGINT UNSIGNED NOT NULL DEFAULT '0', `maxsizetoformrelease` BIGINT UNSIGNED NOT NULL DEFAULT '0', @@ -1059,90 +1059,90 @@ CREATE TABLE category COLLATE utf8_unicode_ci AUTO_INCREMENT =100000; -INSERT INTO category (ID, title) VALUES (1000, 'Console'); -INSERT INTO category (ID, title) VALUES (2000, 'Movies'); -INSERT INTO category (ID, title) VALUES (3000, 'Audio'); -INSERT INTO category (ID, title) VALUES (4000, 'PC'); -INSERT INTO category (ID, title) VALUES (5000, 'TV'); -INSERT INTO category (ID, title) VALUES (6000, 'XXX'); -INSERT INTO category (ID, title) VALUES (7000, 'Books'); -INSERT INTO category (ID, title) VALUES (8000, 'Other'); +INSERT INTO category (id, title) VALUES (1000, 'Console'); +INSERT INTO category (id, title) VALUES (2000, 'Movies'); +INSERT INTO category (id, title) VALUES (3000, 'Audio'); +INSERT INTO category (id, title) VALUES (4000, 'PC'); +INSERT INTO category (id, title) VALUES (5000, 'TV'); +INSERT INTO category (id, title) VALUES (6000, 'XXX'); +INSERT INTO category (id, title) VALUES (7000, 'Books'); +INSERT INTO category (id, title) VALUES (8000, 'Other'); -INSERT INTO category (ID, title, parentID) VALUES (1010, 'NDS', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1020, 'PSP', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1030, 'Wii', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1040, 'Xbox', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1050, 'Xbox 360', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1060, 'WiiWare/VC', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1070, 'XBOX 360 DLC', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1080, 'PS3', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1090, 'Other', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1110, '3DS', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1120, 'PS Vita', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1130, 'WiiU', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1140, 'Xbox One', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1180, 'PS4', 1000); +INSERT INTO category (id, title, parentid) VALUES (1010, 'NDS', 1000); +INSERT INTO category (id, title, parentid) VALUES (1020, 'PSP', 1000); +INSERT INTO category (id, title, parentid) VALUES (1030, 'Wii', 1000); +INSERT INTO category (id, title, parentid) VALUES (1040, 'Xbox', 1000); +INSERT INTO category (id, title, parentid) VALUES (1050, 'Xbox 360', 1000); +INSERT INTO category (id, title, parentid) VALUES (1060, 'WiiWare/VC', 1000); +INSERT INTO category (id, title, parentid) VALUES (1070, 'XBOX 360 DLC', 1000); +INSERT INTO category (id, title, parentid) VALUES (1080, 'PS3', 1000); +INSERT INTO category (id, title, parentid) VALUES (1090, 'Other', 1000); +INSERT INTO category (id, title, parentid) VALUES (1110, '3DS', 1000); +INSERT INTO category (id, title, parentid) VALUES (1120, 'PS Vita', 1000); +INSERT INTO category (id, title, parentid) VALUES (1130, 'WiiU', 1000); +INSERT INTO category (id, title, parentid) VALUES (1140, 'Xbox One', 1000); +INSERT INTO category (id, title, parentid) VALUES (1180, 'PS4', 1000); -INSERT INTO category (ID, title, parentID) VALUES (2010, 'Foreign', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2020, 'Other', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2030, 'SD', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2040, 'HD', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2050, '3D', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2060, 'BluRay', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2070, 'DVD', 2000); +INSERT INTO category (id, title, parentid) VALUES (2010, 'Foreign', 2000); +INSERT INTO category (id, title, parentid) VALUES (2020, 'Other', 2000); +INSERT INTO category (id, title, parentid) VALUES (2030, 'SD', 2000); +INSERT INTO category (id, title, parentid) VALUES (2040, 'HD', 2000); +INSERT INTO category (id, title, parentid) VALUES (2050, '3D', 2000); +INSERT INTO category (id, title, parentid) VALUES (2060, 'BluRay', 2000); +INSERT INTO category (id, title, parentid) VALUES (2070, 'DVD', 2000); -INSERT INTO category (ID, title, parentID) VALUES (3010, 'MP3', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3020, 'Video', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3030, 'Audiobook', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3040, 'Lossless', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3050, 'Other', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3060, 'Foreign', 3000); +INSERT INTO category (id, title, parentid) VALUES (3010, 'MP3', 3000); +INSERT INTO category (id, title, parentid) VALUES (3020, 'Video', 3000); +INSERT INTO category (id, title, parentid) VALUES (3030, 'Audiobook', 3000); +INSERT INTO category (id, title, parentid) VALUES (3040, 'Lossless', 3000); +INSERT INTO category (id, title, parentid) VALUES (3050, 'Other', 3000); +INSERT INTO category (id, title, parentid) VALUES (3060, 'Foreign', 3000); -INSERT INTO category (ID, title, parentID) VALUES (4010, '0day', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4020, 'ISO', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4030, 'Mac', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4040, 'Mobile-Other', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4050, 'Games', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4060, 'Mobile-iOS', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4070, 'Mobile-Android', 4000); +INSERT INTO category (id, title, parentid) VALUES (4010, '0day', 4000); +INSERT INTO category (id, title, parentid) VALUES (4020, 'ISO', 4000); +INSERT INTO category (id, title, parentid) VALUES (4030, 'Mac', 4000); +INSERT INTO category (id, title, parentid) VALUES (4040, 'Mobile-Other', 4000); +INSERT INTO category (id, title, parentid) VALUES (4050, 'Games', 4000); +INSERT INTO category (id, title, parentid) VALUES (4060, 'Mobile-iOS', 4000); +INSERT INTO category (id, title, parentid) VALUES (4070, 'Mobile-Android', 4000); -INSERT INTO category (ID, title, parentID) VALUES (5010, 'WEB-DL', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5020, 'Foreign', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5030, 'SD', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5040, 'HD', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5050, 'Other', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5060, 'Sport', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5070, 'Anime', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5080, 'Documentary', 5000); +INSERT INTO category (id, title, parentid) VALUES (5010, 'WEB-DL', 5000); +INSERT INTO category (id, title, parentid) VALUES (5020, 'Foreign', 5000); +INSERT INTO category (id, title, parentid) VALUES (5030, 'SD', 5000); +INSERT INTO category (id, title, parentid) VALUES (5040, 'HD', 5000); +INSERT INTO category (id, title, parentid) VALUES (5050, 'Other', 5000); +INSERT INTO category (id, title, parentid) VALUES (5060, 'Sport', 5000); +INSERT INTO category (id, title, parentid) VALUES (5070, 'Anime', 5000); +INSERT INTO category (id, title, parentid) VALUES (5080, 'Documentary', 5000); -INSERT INTO category (ID, title, parentID) VALUES (6010, 'DVD', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6020, 'WMV', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6030, 'XviD', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6040, 'x264', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6050, 'Pack', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6060, 'ImgSet', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6070, 'Other', 6000); +INSERT INTO category (id, title, parentid) VALUES (6010, 'DVD', 6000); +INSERT INTO category (id, title, parentid) VALUES (6020, 'WMV', 6000); +INSERT INTO category (id, title, parentid) VALUES (6030, 'XviD', 6000); +INSERT INTO category (id, title, parentid) VALUES (6040, 'x264', 6000); +INSERT INTO category (id, title, parentid) VALUES (6050, 'Pack', 6000); +INSERT INTO category (id, title, parentid) VALUES (6060, 'ImgSet', 6000); +INSERT INTO category (id, title, parentid) VALUES (6070, 'Other', 6000); -INSERT INTO category (ID, title, parentID) VALUES (7010, 'Mags', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7020, 'Ebook', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7030, 'Comics', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7040, 'Technical', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7050, 'Other', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7060, 'Foreign', 7000); +INSERT INTO category (id, title, parentid) VALUES (7010, 'Mags', 7000); +INSERT INTO category (id, title, parentid) VALUES (7020, 'Ebook', 7000); +INSERT INTO category (id, title, parentid) VALUES (7030, 'Comics', 7000); +INSERT INTO category (id, title, parentid) VALUES (7040, 'Technical', 7000); +INSERT INTO category (id, title, parentid) VALUES (7050, 'Other', 7000); +INSERT INTO category (id, title, parentid) VALUES (7060, 'Foreign', 7000); -INSERT INTO category (ID, title, parentID) VALUES (8010, 'Misc', 8000); -INSERT INTO category (ID, title, parentID) VALUES (8020, 'Hashed', 8000); +INSERT INTO category (id, title, parentid) VALUES (8010, 'Misc', 8000); +INSERT INTO category (id, title, parentid) VALUES (8020, 'Hashed', 8000); DROP TABLE IF EXISTS sharing_sites; CREATE TABLE sharing_sites ( - ID INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, site_name VARCHAR(255) NOT NULL DEFAULT '', site_guid VARCHAR(40) NOT NULL DEFAULT '', last_time DATETIME DEFAULT NULL, first_time DATETIME DEFAULT NULL, enabled TINYINT(1) NOT NULL DEFAULT '0', comments MEDIUMINT UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (ID) + PRIMARY KEY (id) ) ENGINE =InnoDB DEFAULT CHARACTER SET utf8 @@ -1195,7 +1195,7 @@ CREATE TABLE predbhash ( COLLATE =utf8mb4_unicode_ci; INSERT INTO predbhash (pre_id, hashes) (SELECT - ID, + id, CONCAT_WS(',', MD5(title), MD5(MD5(title)), SHA1(title)) FROM prehash); @@ -1221,14 +1221,14 @@ ALTER TABLE animetitles CHANGE createddate unixtime INT(12) UNSIGNED NOT NULL; DROP TRIGGER IF EXISTS insert_hashes; DELIMITER $$ -CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT INTO predbhash (pre_id, hashes) VALUES (NEW.ID, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)));END; +CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT INTO predbhash (pre_id, hashes) VALUES (NEW.id, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)));END; $$ DELIMITER ; DROP TRIGGER IF EXISTS update_hashes; DELIMITER $$ -CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)) WHERE pre_id = OLD.ID; END IF; +CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)) WHERE pre_id = OLD.id; END IF; END; $$ DELIMITER ; @@ -1236,7 +1236,7 @@ DELIMITER ; DROP TRIGGER IF EXISTS delete_hashes; DELIMITER $$ -CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash WHERE pre_id = OLD.ID; END; +CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash WHERE pre_id = OLD.id; END; $$ DELIMITER ; @@ -1263,14 +1263,14 @@ CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW. ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;END IF; END; $$ -CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseID, guid, name, searchname) VALUES (NEW.ID, NEW.guid, NEW.name, NEW.searchname); +CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseid, guid, name, searchname) VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname); END; $$ -CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseID = OLD.ID; END IF; -IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseID = OLD.ID; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseID = OLD.ID; END IF; +CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseid = OLD.id; END IF; +IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseid = OLD.id; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseid = OLD.id; END IF; END; $$ -CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch WHERE releaseID = OLD.ID; END; +CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch WHERE releaseid = OLD.id; END; $$ DELIMITER ; diff --git a/lib/DB/patches/0008_releases.sql b/lib/DB/patches/0008_releases.sql index afc0e996a..df3af6e57 100644 --- a/lib/DB/patches/0008_releases.sql +++ b/lib/DB/patches/0008_releases.sql @@ -1,3 +1,3 @@ -ALTER TABLE `releases` ADD `prehashID` INT(12) NULL DEFAULT NULL; +ALTER TABLE `releases` ADD `prehashid` INT(12) NULL DEFAULT NULL; UPDATE `tmux` set `value` = '8' where `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0009_releases.sql b/lib/DB/patches/0009_releases.sql index b449eed2a..912b67608 100644 --- a/lib/DB/patches/0009_releases.sql +++ b/lib/DB/patches/0009_releases.sql @@ -1,2 +1,2 @@ -ALTER TABLE `releases` CHANGE COLUMN `prehashID` `prehashID` INT UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `releases` CHANGE COLUMN `prehashid` `prehashid` INT UNSIGNED NOT NULL DEFAULT '0'; UPDATE `tmux` set `value` = '9' where `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0010_releases.sql b/lib/DB/patches/0010_releases.sql index c6911f711..a342cca19 100644 --- a/lib/DB/patches/0010_releases.sql +++ b/lib/DB/patches/0010_releases.sql @@ -1,2 +1,2 @@ -ALTER TABLE `releases` ADD INDEX `ix_releases_prehashid_searchname` (`prehashID`, `searchname`); +ALTER TABLE `releases` ADD INDEX `ix_releases_prehashid_searchname` (`prehashid`, `searchname`); UPDATE `tmux` set `value` = '10' where `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0015_sharing.sql b/lib/DB/patches/0015_sharing.sql index c3646e3da..1810b8dd4 100644 --- a/lib/DB/patches/0015_sharing.sql +++ b/lib/DB/patches/0015_sharing.sql @@ -1,13 +1,13 @@ DROP TABLE IF EXISTS sharing_sites; CREATE TABLE sharing_sites ( - ID INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, site_name VARCHAR(255) NOT NULL DEFAULT '', site_guid VARCHAR(40) NOT NULL DEFAULT '', last_time DATETIME DEFAULT NULL, first_time DATETIME DEFAULT NULL, enabled TINYINT(1) NOT NULL DEFAULT '0', comments MEDIUMINT UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (ID) + PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AUTO_INCREMENT=1 ; DROP TABLE IF EXISTS sharing; diff --git a/lib/DB/patches/0019_sharing.sql b/lib/DB/patches/0019_sharing.sql index afcecf879..31bbd6f19 100644 --- a/lib/DB/patches/0019_sharing.sql +++ b/lib/DB/patches/0019_sharing.sql @@ -1,4 +1,4 @@ -UPDATE releasecomment SET username = (SELECT username FROM users WHERE users.ID = releasecomment.userID); +UPDATE releasecomment SET username = (SELECT username FROM users WHERE users.id = releasecomment.userid); DELETE FROM users WHERE email = 'sharing@nZEDb.com' AND role = 0; diff --git a/lib/DB/patches/0022_releases.sql b/lib/DB/patches/0022_releases.sql index f1a7013a4..83a028d39 100644 --- a/lib/DB/patches/0022_releases.sql +++ b/lib/DB/patches/0022_releases.sql @@ -1,3 +1,3 @@ -ALTER TABLE `releases` ADD INDEX `ix_releases_releasenfoID` (`releasenfoID`); +ALTER TABLE `releases` ADD INDEX `ix_releases_releasenfoID` (`releasenfoid`); UPDATE `tmux` set `value` = '22' where `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0029_releases.sql b/lib/DB/patches/0029_releases.sql index 0773c8ff0..b7cb1a3fe 100644 --- a/lib/DB/patches/0029_releases.sql +++ b/lib/DB/patches/0029_releases.sql @@ -1,7 +1,7 @@ ALTER TABLE `releases` ADD COLUMN `nzbstatus` TINYINT(1) NOT NULL DEFAULT 1; ALTER TABLE `releases` ADD COLUMN `nzb_guid` VARCHAR(50) NULL; ALTER TABLE `releases` DROP INDEX `ix_releases_status`; -ALTER TABLE `releases` ADD INDEX `ix_releases_status` (`nzbstatus`, `iscategorized`, `isrenamed`, `nfostatus`, `ishashed`, `passwordstatus`, `dehashstatus`, `releasenfoID`, `musicinfoID`, `consoleinfoID`, `bookinfoID`, `haspreview`, `categoryID`, `imdbID`, `rageID`); +ALTER TABLE `releases` ADD INDEX `ix_releases_status` (`nzbstatus`, `iscategorized`, `isrenamed`, `nfostatus`, `ishashed`, `passwordstatus`, `dehashstatus`, `releasenfoid`, `musicinfoid`, `consoleinfoid`, `bookinfoid`, `haspreview`, `categoryid`, `imdbid`, `rageid`); CREATE INDEX `ix_releases_nzb_guid` ON `releases` (`nzb_guid`); UPDATE `releases` SET nzbstatus = 1 WHERE nzbstatus = 0; diff --git a/lib/DB/patches/0032_releases.sql b/lib/DB/patches/0032_releases.sql index 0c04c3e29..f8ab3093b 100644 --- a/lib/DB/patches/0032_releases.sql +++ b/lib/DB/patches/0032_releases.sql @@ -2,8 +2,8 @@ DROP TRIGGER IF EXISTS check_insert; DROP TRIGGER IF EXISTS check_update; DELIMITER $$ -CREATE TRIGGER check_insert BEFORE INSERT ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\[ ?([[:digit:]]{4,6}) ?\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoID = 0 THEN SET NEW.nfostatus = -1; END IF; END;$$ -CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\[ ?([[:digit:]]{4,6}) ?\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoID = 0 THEN SET NEW.nfostatus = -1; END IF; END;$$ +CREATE TRIGGER check_insert BEFORE INSERT ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\[ ?([[:digit:]]{4,6}) ?\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoid = 0 THEN SET NEW.nfostatus = -1; END IF; END;$$ +CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\[ ?([[:digit:]]{4,6}) ?\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoid = 0 THEN SET NEW.nfostatus = -1; END IF; END;$$ DELIMITER ; UPDATE `tmux` set `value` = '32' where `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0033_releases.sql b/lib/DB/patches/0033_releases.sql index 062ae93fc..e984cbf24 100644 --- a/lib/DB/patches/0033_releases.sql +++ b/lib/DB/patches/0033_releases.sql @@ -1,8 +1,8 @@ DROP TRIGGER IF EXISTS check_insert; DROP TRIGGER IF EXISTS check_update; -CREATE TRIGGER check_insert BEFORE INSERT ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoID = 0 THEN SET NEW.nfostatus = -1; END IF; END; -CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoID = 0 THEN SET NEW.nfostatus = -1; END IF; END; +CREATE TRIGGER check_insert BEFORE INSERT ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoid = 0 THEN SET NEW.nfostatus = -1; END IF; END; +CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoid = 0 THEN SET NEW.nfostatus = -1; END IF; END; UPDATE releases set isrequestid = 1 WHERE name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' diff --git a/lib/DB/patches/0038_releasesearch.sql b/lib/DB/patches/0038_releasesearch.sql index dc673bac0..657f26bfd 100644 --- a/lib/DB/patches/0038_releasesearch.sql +++ b/lib/DB/patches/0038_releasesearch.sql @@ -1,24 +1,24 @@ DROP TABLE IF EXISTS releasesearch; CREATE TABLE releasesearch ( - ID INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - releaseID INT(11) UNSIGNED NOT NULL, + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + releaseid INT(11) UNSIGNED NOT NULL, guid VARCHAR(50) NOT NULL, name VARCHAR(255) NOT NULL DEFAULT '', searchname VARCHAR(255) NOT NULL DEFAULT '', - PRIMARY KEY (ID) + PRIMARY KEY (id) ) ENGINE =MyISAM DEFAULT CHARSET =utf8 COLLATE =utf8_unicode_ci AUTO_INCREMENT =1; CREATE FULLTEXT INDEX ix_releasesearch_name_searchname_ft ON releasesearch (name, searchname); -CREATE INDEX ix_releasesearch_releaseid ON releasesearch (releaseID); +CREATE INDEX ix_releasesearch_releaseid ON releasesearch (releaseid); CREATE INDEX ix_releasesearch_guid ON releasesearch (guid); ALTER TABLE `releases` ADD `proc_filenames` BIT NOT NULL DEFAULT 0; DELIMITER $$ -CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseID, guid, name, searchname) VALUES (NEW.ID, NEW.guid, NEW.name, NEW.searchname);END;$$ -CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseID = OLD.ID; END IF; IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseID = OLD.ID; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseID = OLD.ID; END IF;END;$$ -CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch WHERE releaseID = OLD.ID;END;$$ +CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseid, guid, name, searchname) VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname);END;$$ +CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseid = OLD.id; END IF; IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseid = OLD.id; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseid = OLD.id; END IF;END;$$ +CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch WHERE releaseid = OLD.id;END;$$ DELIMITER ; UPDATE `tmux` SET value = '38' WHERE `setting` = 'sqlpatch'; diff --git a/lib/DB/patches/0041_predbhash.sql b/lib/DB/patches/0041_predbhash.sql index 33f9c46db..cd84d124c 100644 --- a/lib/DB/patches/0041_predbhash.sql +++ b/lib/DB/patches/0041_predbhash.sql @@ -10,7 +10,7 @@ CREATE TABLE predbhash ( COLLATE =utf8mb4_unicode_ci; INSERT INTO predbhash (pre_id, hashes) (SELECT - ID, + id, CONCAT_WS(',', MD5(title), MD5(MD5(title)), SHA1(title)) FROM prehash); @@ -21,7 +21,7 @@ DROP TRIGGER IF EXISTS insert_hashes; DELIMITER $$ CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT INTO predbhash (pre_id, hashes) -VALUES (NEW.ID, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title))); +VALUES (NEW.id, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title))); END; $$ DELIMITER ; @@ -40,7 +40,7 @@ DROP TRIGGER IF EXISTS delete_hashes; DELIMITER $$ CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash -WHERE pre_id = OLD.ID; +WHERE pre_id = OLD.id; END; $$ DELIMITER ; diff --git a/lib/DB/patches/0042_predbhash.sql b/lib/DB/patches/0042_predbhash.sql index 1f3302359..fc9ae3c54 100644 --- a/lib/DB/patches/0042_predbhash.sql +++ b/lib/DB/patches/0042_predbhash.sql @@ -3,7 +3,7 @@ DELIMITER $$ CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)) -WHERE pre_id = OLD.ID; END IF; +WHERE pre_id = OLD.id; END IF; END; $$ DELIMITER ; diff --git a/lib/DB/patches/0044_releasecomment.sql b/lib/DB/patches/0044_releasecomment.sql index c64fcf867..aa4733108 100644 --- a/lib/DB/patches/0044_releasecomment.sql +++ b/lib/DB/patches/0044_releasecomment.sql @@ -1,5 +1,5 @@ ALTER TABLE releasecomment MODIFY text varchar(255); DROP INDEX ix_releasecomment_text_releaseID ON releasecomment; -CREATE UNIQUE INDEX ix_releasecomment_text_releaseID ON releasecomment (text, releaseID); +CREATE UNIQUE INDEX ix_releasecomment_text_releaseID ON releasecomment (text, releaseid); UPDATE `tmux` SET value = '44' WHERE `setting` = 'sqlpatch'; diff --git a/lib/DB/patches/0046_releasecomment.sql b/lib/DB/patches/0046_releasecomment.sql index 601477a00..881821860 100644 --- a/lib/DB/patches/0046_releasecomment.sql +++ b/lib/DB/patches/0046_releasecomment.sql @@ -3,5 +3,5 @@ DROP TRIGGER IF EXISTS insert_MD5; CREATE TRIGGER insert_MD5 BEFORE INSERT ON releasecomment FOR EACH ROW SET NEW.text_hash = MD5(NEW.text); UPDATE releasecomment SET text_hash = MD5(text); -ALTER IGNORE TABLE releasecomment ADD UNIQUE INDEX ix_releasecomment_hash_releaseID (text_hash, releaseID); +ALTER IGNORE TABLE releasecomment ADD UNIQUE INDEX ix_releasecomment_hash_releaseID (text_hash, releaseid); UPDATE `tmux` SET `value` = '46' WHERE `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0050_category.sql b/lib/DB/patches/0050_category.sql index a4adb48ba..4575ba3ad 100644 --- a/lib/DB/patches/0050_category.sql +++ b/lib/DB/patches/0050_category.sql @@ -1,9 +1,9 @@ DROP TABLE IF EXISTS `category`; CREATE TABLE category ( - `ID` INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + `id` INT PRIMARY KEY NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) NOT NULL, - `parentID` INT NULL, + `parentid` INT NULL, `status` INT NOT NULL DEFAULT '1', `minsizetoformrelease` BIGINT UNSIGNED NOT NULL DEFAULT '0', `maxsizetoformrelease` BIGINT UNSIGNED NOT NULL DEFAULT '0', @@ -15,79 +15,79 @@ CREATE TABLE category COLLATE utf8_unicode_ci AUTO_INCREMENT =100000; -INSERT INTO category (ID, title) VALUES (1000, 'Console'); -INSERT INTO category (ID, title) VALUES (2000, 'Movies'); -INSERT INTO category (ID, title) VALUES (3000, 'Audio'); -INSERT INTO category (ID, title) VALUES (4000, 'PC'); -INSERT INTO category (ID, title) VALUES (5000, 'TV'); -INSERT INTO category (ID, title) VALUES (6000, 'XXX'); -INSERT INTO category (ID, title) VALUES (7000, 'Books'); -INSERT INTO category (ID, title) VALUES (8000, 'Other'); +INSERT INTO category (id, title) VALUES (1000, 'Console'); +INSERT INTO category (id, title) VALUES (2000, 'Movies'); +INSERT INTO category (id, title) VALUES (3000, 'Audio'); +INSERT INTO category (id, title) VALUES (4000, 'PC'); +INSERT INTO category (id, title) VALUES (5000, 'TV'); +INSERT INTO category (id, title) VALUES (6000, 'XXX'); +INSERT INTO category (id, title) VALUES (7000, 'Books'); +INSERT INTO category (id, title) VALUES (8000, 'Other'); -INSERT INTO category (ID, title, parentID) VALUES (1010, 'NDS', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1020, 'PSP', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1030, 'Wii', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1040, 'Xbox', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1050, 'Xbox 360', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1060, 'WiiWare/VC', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1070, 'XBOX 360 DLC', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1080, 'PS3', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1090, 'Other', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1110, '3DS', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1120, 'PS Vita', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1130, 'WiiU', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1140, 'Xbox One', 1000); -INSERT INTO category (ID, title, parentID) VALUES (1180, 'PS4', 1000); +INSERT INTO category (id, title, parentid) VALUES (1010, 'NDS', 1000); +INSERT INTO category (id, title, parentid) VALUES (1020, 'PSP', 1000); +INSERT INTO category (id, title, parentid) VALUES (1030, 'Wii', 1000); +INSERT INTO category (id, title, parentid) VALUES (1040, 'Xbox', 1000); +INSERT INTO category (id, title, parentid) VALUES (1050, 'Xbox 360', 1000); +INSERT INTO category (id, title, parentid) VALUES (1060, 'WiiWare/VC', 1000); +INSERT INTO category (id, title, parentid) VALUES (1070, 'XBOX 360 DLC', 1000); +INSERT INTO category (id, title, parentid) VALUES (1080, 'PS3', 1000); +INSERT INTO category (id, title, parentid) VALUES (1090, 'Other', 1000); +INSERT INTO category (id, title, parentid) VALUES (1110, '3DS', 1000); +INSERT INTO category (id, title, parentid) VALUES (1120, 'PS Vita', 1000); +INSERT INTO category (id, title, parentid) VALUES (1130, 'WiiU', 1000); +INSERT INTO category (id, title, parentid) VALUES (1140, 'Xbox One', 1000); +INSERT INTO category (id, title, parentid) VALUES (1180, 'PS4', 1000); -INSERT INTO category (ID, title, parentID) VALUES (2010, 'Foreign', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2020, 'Other', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2030, 'SD', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2040, 'HD', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2050, '3D', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2060, 'BluRay', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2070, 'DVD', 2000); -INSERT INTO category (ID, title, parentID) VALUES (2080, 'WEB-DL', 2000); +INSERT INTO category (id, title, parentid) VALUES (2010, 'Foreign', 2000); +INSERT INTO category (id, title, parentid) VALUES (2020, 'Other', 2000); +INSERT INTO category (id, title, parentid) VALUES (2030, 'SD', 2000); +INSERT INTO category (id, title, parentid) VALUES (2040, 'HD', 2000); +INSERT INTO category (id, title, parentid) VALUES (2050, '3D', 2000); +INSERT INTO category (id, title, parentid) VALUES (2060, 'BluRay', 2000); +INSERT INTO category (id, title, parentid) VALUES (2070, 'DVD', 2000); +INSERT INTO category (id, title, parentid) VALUES (2080, 'WEB-DL', 2000); -INSERT INTO category (ID, title, parentID) VALUES (3010, 'MP3', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3020, 'Video', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3030, 'Audiobook', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3040, 'Lossless', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3050, 'Other', 3000); -INSERT INTO category (ID, title, parentID) VALUES (3060, 'Foreign', 3000); +INSERT INTO category (id, title, parentid) VALUES (3010, 'MP3', 3000); +INSERT INTO category (id, title, parentid) VALUES (3020, 'Video', 3000); +INSERT INTO category (id, title, parentid) VALUES (3030, 'Audiobook', 3000); +INSERT INTO category (id, title, parentid) VALUES (3040, 'Lossless', 3000); +INSERT INTO category (id, title, parentid) VALUES (3050, 'Other', 3000); +INSERT INTO category (id, title, parentid) VALUES (3060, 'Foreign', 3000); -INSERT INTO category (ID, title, parentID) VALUES (4010, '0day', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4020, 'ISO', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4030, 'Mac', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4040, 'Mobile-Other', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4050, 'Games', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4060, 'Mobile-iOS', 4000); -INSERT INTO category (ID, title, parentID) VALUES (4070, 'Mobile-Android', 4000); +INSERT INTO category (id, title, parentid) VALUES (4010, '0day', 4000); +INSERT INTO category (id, title, parentid) VALUES (4020, 'ISO', 4000); +INSERT INTO category (id, title, parentid) VALUES (4030, 'Mac', 4000); +INSERT INTO category (id, title, parentid) VALUES (4040, 'Mobile-Other', 4000); +INSERT INTO category (id, title, parentid) VALUES (4050, 'Games', 4000); +INSERT INTO category (id, title, parentid) VALUES (4060, 'Mobile-iOS', 4000); +INSERT INTO category (id, title, parentid) VALUES (4070, 'Mobile-Android', 4000); -INSERT INTO category (ID, title, parentID) VALUES (5010, 'WEB-DL', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5020, 'Foreign', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5030, 'SD', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5040, 'HD', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5050, 'Other', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5060, 'Sport', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5070, 'Anime', 5000); -INSERT INTO category (ID, title, parentID) VALUES (5080, 'Documentary', 5000); +INSERT INTO category (id, title, parentid) VALUES (5010, 'WEB-DL', 5000); +INSERT INTO category (id, title, parentid) VALUES (5020, 'Foreign', 5000); +INSERT INTO category (id, title, parentid) VALUES (5030, 'SD', 5000); +INSERT INTO category (id, title, parentid) VALUES (5040, 'HD', 5000); +INSERT INTO category (id, title, parentid) VALUES (5050, 'Other', 5000); +INSERT INTO category (id, title, parentid) VALUES (5060, 'Sport', 5000); +INSERT INTO category (id, title, parentid) VALUES (5070, 'Anime', 5000); +INSERT INTO category (id, title, parentid) VALUES (5080, 'Documentary', 5000); -INSERT INTO category (ID, title, parentID) VALUES (6010, 'DVD', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6020, 'WMV', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6030, 'XviD', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6040, 'x264', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6050, 'Pack', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6060, 'ImgSet', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6070, 'Other', 6000); +INSERT INTO category (id, title, parentid) VALUES (6010, 'DVD', 6000); +INSERT INTO category (id, title, parentid) VALUES (6020, 'WMV', 6000); +INSERT INTO category (id, title, parentid) VALUES (6030, 'XviD', 6000); +INSERT INTO category (id, title, parentid) VALUES (6040, 'x264', 6000); +INSERT INTO category (id, title, parentid) VALUES (6050, 'Pack', 6000); +INSERT INTO category (id, title, parentid) VALUES (6060, 'ImgSet', 6000); +INSERT INTO category (id, title, parentid) VALUES (6070, 'Other', 6000); -INSERT INTO category (ID, title, parentID) VALUES (7010, 'Mags', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7020, 'Ebook', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7030, 'Comics', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7040, 'Technical', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7050, 'Other', 7000); -INSERT INTO category (ID, title, parentID) VALUES (7060, 'Foreign', 7000); +INSERT INTO category (id, title, parentid) VALUES (7010, 'Mags', 7000); +INSERT INTO category (id, title, parentid) VALUES (7020, 'Ebook', 7000); +INSERT INTO category (id, title, parentid) VALUES (7030, 'Comics', 7000); +INSERT INTO category (id, title, parentid) VALUES (7040, 'Technical', 7000); +INSERT INTO category (id, title, parentid) VALUES (7050, 'Other', 7000); +INSERT INTO category (id, title, parentid) VALUES (7060, 'Foreign', 7000); -INSERT INTO category (ID, title, parentID) VALUES (8010, 'Misc', 8000); -INSERT INTO category (ID, title, parentID) VALUES (8020, 'Hashed', 8000); +INSERT INTO category (id, title, parentid) VALUES (8010, 'Misc', 8000); +INSERT INTO category (id, title, parentid) VALUES (8020, 'Hashed', 8000); UPDATE `tmux` SET `value` = '50' WHERE `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0054~releases.sql b/lib/DB/patches/0054~releases.sql index 3e59e2db5..948ea1e66 100644 --- a/lib/DB/patches/0054~releases.sql +++ b/lib/DB/patches/0054~releases.sql @@ -1,3 +1,3 @@ -ALTER TABLE releases ADD COLUMN gamesinfo_id INT AFTER consoleinfoID; +ALTER TABLE releases ADD COLUMN gamesinfo_id INT AFTER consoleinfoid; CREATE INDEX ix_releases_gamesinfo_id ON releases (gamesinfo_id); UPDATE `tmux` SET `value` = '54' WHERE `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0066~genres.sql b/lib/DB/patches/0066~genres.sql index e94ff0df1..ad313c0a4 100644 --- a/lib/DB/patches/0066~genres.sql +++ b/lib/DB/patches/0066~genres.sql @@ -1,13 +1,13 @@ DROP TABLE IF EXISTS `genres`; CREATE TABLE IF NOT EXISTS `genres` ( - `ID` int(11) NOT NULL AUTO_INCREMENT, + `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `type` int(4) DEFAULT NULL, `disabled` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`ID`) + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC AUTO_INCREMENT=635; -INSERT IGNORE INTO `genres` (`ID`, `title`, `type`, `disabled`) VALUES +INSERT IGNORE INTO `genres` (`id`, `title`, `type`, `disabled`) VALUES (150, 'Blues', 3000, 0), (151, 'Classic Rock', 3000, 0), (152, 'Country', 3000, 0), diff --git a/lib/DB/patches/0072~site.sql b/lib/DB/patches/0072~site.sql index fa38c25ef..2ea46b68e 100644 --- a/lib/DB/patches/0072~site.sql +++ b/lib/DB/patches/0072~site.sql @@ -8,16 +8,16 @@ DROP TRIGGER IF EXISTS check_update; DROP TRIGGER IF EXISTS insert_MD5; DELIMITER $$ -CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT INTO predbhash (pre_id, hashes) VALUES (NEW.ID, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)));END;$$ -CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)) WHERE pre_id = OLD.ID; END IF;END;$$ -CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash WHERE pre_id = OLD.ID; END;$$ +CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT INTO predbhash (pre_id, hashes) VALUES (NEW.id, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)));END;$$ +CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)) WHERE pre_id = OLD.id; END IF;END;$$ +CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash WHERE pre_id = OLD.id; END;$$ CREATE TRIGGER check_rfinsert BEFORE INSERT ON releasefiles FOR EACH ROW BEGIN IF NEW.name REGEXP '[a-fA-F0-9]{32}'THEN SET NEW.ishashed = 1; END IF;END;$$ CREATE TRIGGER check_rfupdate BEFORE UPDATE ON releasefiles FOR EACH ROW BEGIN IF NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1; END IF; END;$$ CREATE TRIGGER check_insert BEFORE INSERT ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1; END IF; END;$$ CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;END IF;END;$$ -CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseID, guid, name, searchname) VALUES (NEW.ID, NEW.guid, NEW.name, NEW.searchname);END;$$ -CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseID = OLD.ID; END IF;IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseID = OLD.ID; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseID = OLD.ID; END IF;END;$$ -CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch WHERE releaseID = OLD.ID; END;$$ +CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseid, guid, name, searchname) VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname);END;$$ +CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseid = OLD.id; END IF;IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseid = OLD.id; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseid = OLD.id; END IF;END;$$ +CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch WHERE releaseid = OLD.id; END;$$ CREATE TRIGGER insert_MD5 BEFORE INSERT ON releasecomment FOR EACH ROW SET NEW.text_hash = MD5(NEW.text);$$ DELIMITER ; diff --git a/lib/DB/patches/0086~category.sql b/lib/DB/patches/0086~category.sql index 49e3733a6..cf4b5f42b 100644 --- a/lib/DB/patches/0086~category.sql +++ b/lib/DB/patches/0086~category.sql @@ -1,2 +1,2 @@ -INSERT INTO category (ID, title, parentID) VALUES (2080, 'WEB-DL', 2000); +INSERT INTO category (id, title, parentid) VALUES (2080, 'WEB-DL', 2000); UPDATE `tmux` SET `value` = '86' WHERE `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0091~releasesearch.sql b/lib/DB/patches/0091~releasesearch.sql index 5c96eac56..cd4b0ac74 100644 --- a/lib/DB/patches/0091~releasesearch.sql +++ b/lib/DB/patches/0091~releasesearch.sql @@ -1,5 +1,5 @@ ALTER TABLE releasesearch ADD COLUMN fromname VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL; -UPDATE releasesearch rs INNER JOIN releases r ON rs.releaseID = r.ID SET rs.fromname = r.fromname; +UPDATE releasesearch rs INNER JOIN releases r ON rs.releaseid = r.id SET rs.fromname = r.fromname; ALTER TABLE releasesearch DROP INDEX ix_releasesearch_name_searchname_ft; ALTER TABLE releasesearch ADD FULLTEXT INDEX ix_releasesearch_name_ft (name); @@ -9,7 +9,7 @@ ALTER TABLE releasesearch ADD FULLTEXT INDEX ix_releasesearch_fromname_ft (fromn DROP TRIGGER IF EXISTS insert_search; DROP TRIGGER IF EXISTS update_search; -CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseID, guid, name, searchname, fromname) VALUES (NEW.ID, NEW.guid, NEW.name, NEW.searchname, NEW.fromname); END; -CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseID = OLD.ID; END IF; IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseID = OLD.ID; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseID = OLD.ID; END IF; IF NEW.fromname != OLD.fromname THEN UPDATE releasesearch SET fromname = NEW.fromname WHERE releaseID = OLD.ID; END IF; END; +CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseid, guid, name, searchname, fromname) VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname, NEW.fromname); END; +CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseid = OLD.id; END IF; IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseid = OLD.id; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseid = OLD.id; END IF; IF NEW.fromname != OLD.fromname THEN UPDATE releasesearch SET fromname = NEW.fromname WHERE releaseid = OLD.id; END IF; END; UPDATE `tmux` SET `value` = '91' WHERE `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0093~anidb.sql b/lib/DB/patches/0093~anidb.sql index 7893c952a..1b69be901 100644 --- a/lib/DB/patches/0093~anidb.sql +++ b/lib/DB/patches/0093~anidb.sql @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS anidb_episodes; CREATE TABLE anidb_episodes ( anidbid INT(10) UNSIGNED NOT NULL - COMMENT 'ID of title from AniDB', + COMMENT 'id of title from AniDB', episodeid INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'anidb id for this episode', episode_no SMALLINT(5) UNSIGNED NOT NULL @@ -20,7 +20,7 @@ CREATE TABLE anidb_episodes ( DROP TABLE IF EXISTS anidb_info; CREATE TABLE anidb_info ( anidbid INT(10) UNSIGNED NOT NULL - COMMENT 'ID of title from AniDB', + COMMENT 'id of title from AniDB', type VARCHAR(32) COLLATE utf8_unicode_ci DEFAULT NULL, startdate DATE DEFAULT NULL, @@ -53,7 +53,7 @@ CREATE TABLE anidb_info ( DROP TABLE IF EXISTS anidb_titles; CREATE TABLE anidb_titles ( anidbid INT(10) UNSIGNED NOT NULL - COMMENT 'ID of title from AniDB', + COMMENT 'id of title from AniDB', type VARCHAR(25) COLLATE utf8_unicode_ci NOT NULL COMMENT 'type of title.', diff --git a/lib/DB/patches/0099~releases.sql b/lib/DB/patches/0099~releases.sql index 6df5b6d43..5531fdd92 100644 --- a/lib/DB/patches/0099~releases.sql +++ b/lib/DB/patches/0099~releases.sql @@ -23,12 +23,12 @@ DROP INDEX ix_releases_nzb_guid ON releases; DROP INDEX ix_releases_prehashid_searchname ON releases; DROP INDEX idx_releases_multi_name_fromname_size ON releases; -ALTER TABLE releases MODIFY ID INT(11) UNSIGNED NOT NULL; +ALTER TABLE releases MODIFY id INT(11) UNSIGNED NOT NULL; ALTER TABLE releases DROP PRIMARY KEY; -ALTER TABLE releases ADD PRIMARY KEY (ID, categoryID); -ALTER TABLE releases MODIFY ID INT(11) UNSIGNED NOT NULL AUTO_INCREMENT; +ALTER TABLE releases ADD PRIMARY KEY (id, categoryid); +ALTER TABLE releases MODIFY id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT; -ALTER TABLE releases PARTITION BY RANGE (categoryID) ( +ALTER TABLE releases PARTITION BY RANGE (categoryid) ( PARTITION unused VALUES LESS THAN (1000), PARTITION console VALUES LESS THAN (2000), PARTITION movies VALUES LESS THAN (3000), @@ -40,21 +40,21 @@ PARTITION books VALUES LESS THAN (8000), PARTITION misc VALUES LESS THAN (9000) ); ALTER TABLE releases ADD INDEX ix_releases_adddate (adddate); -ALTER TABLE releases ADD INDEX ix_releases_rageid (rageID); -ALTER TABLE releases ADD INDEX ix_releases_imdbid (imdbID); +ALTER TABLE releases ADD INDEX ix_releases_rageid (rageid); +ALTER TABLE releases ADD INDEX ix_releases_imdbid (imdbid); ALTER TABLE releases ADD INDEX ix_releases_guid (guid); ALTER TABLE releases ADD INDEX ix_releases_name (name); -ALTER TABLE releases ADD INDEX ix_releases_groupid (groupID); +ALTER TABLE releases ADD INDEX ix_releases_groupid (groupid); ALTER TABLE releases ADD INDEX ix_releases_dehashstatus (dehashstatus); ALTER TABLE releases ADD INDEX ix_releases_reqidstatus (reqidstatus); ALTER TABLE releases ADD INDEX ix_releases_nfostatus (nfostatus); -ALTER TABLE releases ADD INDEX ix_releases_musicinfoid (musicinfoID); -ALTER TABLE releases ADD INDEX ix_releases_consoleinfoid (consoleinfoID); -ALTER TABLE releases ADD INDEX ix_releases_bookinfoid (bookinfoID); +ALTER TABLE releases ADD INDEX ix_releases_musicinfoid (musicinfoid); +ALTER TABLE releases ADD INDEX ix_releases_consoleinfoid (consoleinfoid); +ALTER TABLE releases ADD INDEX ix_releases_bookinfoid (bookinfoid); ALTER TABLE releases ADD INDEX ix_releases_haspreview_passwordstatus (haspreview, passwordstatus); -ALTER TABLE releases ADD INDEX ix_releases_status (nzbstatus, iscategorized, isrenamed, nfostatus, ishashed, isrequestid, passwordstatus, dehashstatus, reqidstatus, musicinfoID, consoleinfoID, bookinfoID, haspreview, categoryID, imdbID, rageID); +ALTER TABLE releases ADD INDEX ix_releases_status (nzbstatus, iscategorized, isrenamed, nfostatus, ishashed, isrequestid, passwordstatus, dehashstatus, reqidstatus, musicinfoid, consoleinfoid, bookinfoid, haspreview, categoryid, imdbid, rageid); ALTER TABLE releases ADD INDEX ix_releases_postdate_searchname (postdate, searchname); ALTER TABLE releases ADD INDEX ix_releases_nzb_guid (nzb_guid); -ALTER TABLE releases ADD INDEX ix_releases_prehash_searchname (prehashID, searchname); +ALTER TABLE releases ADD INDEX ix_releases_prehash_searchname (prehashid, searchname); UPDATE tmux set value = '99' where setting = 'sqlpatch'; diff --git a/lib/DB/patches/0100~binaries.sql b/lib/DB/patches/0100~binaries.sql index f1dc636ff..7fdba70d3 100644 --- a/lib/DB/patches/0100~binaries.sql +++ b/lib/DB/patches/0100~binaries.sql @@ -1,5 +1,5 @@ DROP TRIGGER IF EXISTS delete_binaries; -CREATE TRIGGER delete_binaries BEFORE DELETE ON binaries FOR EACH ROW BEGIN DELETE FROM parts WHERE binaryID = OLD.ID; END; +CREATE TRIGGER delete_binaries BEFORE DELETE ON binaries FOR EACH ROW BEGIN DELETE FROM parts WHERE binaryID = OLD.id; END; UPDATE tmux set value = '100' where setting = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0106~category.sql b/lib/DB/patches/0106~category.sql index e34d61e4e..593c4e8d0 100644 --- a/lib/DB/patches/0106~category.sql +++ b/lib/DB/patches/0106~category.sql @@ -1,2 +1,2 @@ -INSERT INTO category (ID, title, parentID) VALUES (6080, 'SD', 6000); +INSERT INTO category (id, title, parentid) VALUES (6080, 'SD', 6000); UPDATE `tmux` SET `value` = '106' WHERE `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0108~category.sql b/lib/DB/patches/0108~category.sql index 9c1b93612..a366bc6b7 100644 --- a/lib/DB/patches/0108~category.sql +++ b/lib/DB/patches/0108~category.sql @@ -1,3 +1,3 @@ -INSERT INTO category (ID, title, parentID) VALUES (6041, 'HD Clips', 6000); -INSERT INTO category (ID, title, parentID) VALUES (6042, 'SD Clips', 6000); +INSERT INTO category (id, title, parentid) VALUES (6041, 'HD Clips', 6000); +INSERT INTO category (id, title, parentid) VALUES (6042, 'SD Clips', 6000); UPDATE `tmux` SET `value` = '108' WHERE `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/DB/patches/0109~category.sql b/lib/DB/patches/0109~category.sql index 12c1c4521..a02e80520 100644 --- a/lib/DB/patches/0109~category.sql +++ b/lib/DB/patches/0109~category.sql @@ -1,2 +1,2 @@ -INSERT INTO category (ID, title, parentID) VALUES (6090, 'WEB-DL', 6000); +INSERT INTO category (id, title, parentid) VALUES (6090, 'WEB-DL', 6000); UPDATE `tmux` SET `value` = '109' WHERE `setting` = 'sqlpatch'; \ No newline at end of file diff --git a/lib/Enzebe.php b/lib/Enzebe.php index 4ee183c3a..f3fac2e29 100644 --- a/lib/Enzebe.php +++ b/lib/Enzebe.php @@ -121,8 +121,8 @@ class Enzebe $this->_binariesQuery = sprintf( 'SELECT %s.*, UNIX_TIMESTAMP(%s.date) AS udate, groups.name AS groupname FROM %s - INNER JOIN groups ON %s.groupID = groups.ID - WHERE %s.releaseID = ', + INNER JOIN groups ON %s.groupid = groups.ID + WHERE %s.releaseid = ', $bName, $bName, $bName, diff --git a/lib/Film.php b/lib/Film.php index 9be10691b..bd50335b0 100644 --- a/lib/Film.php +++ b/lib/Film.php @@ -192,7 +192,7 @@ class Film */ public function getMovieInfo($imdbId) { - return $this->pdo->queryOneRow(sprintf("SELECT * FROM movieinfo WHERE imdbID = %d", $imdbId)); + return $this->pdo->queryOneRow(sprintf("SELECT * FROM movieinfo WHERE imdbid = %d", $imdbId)); } /** @@ -206,10 +206,10 @@ class Film { return $this->pdo->query( sprintf(" - SELECT DISTINCT movieinfo.*, releases.imdbID AS relimdb + SELECT DISTINCT movieinfo.*, releases.imdbid AS relimdb FROM movieinfo - LEFT OUTER JOIN releases ON releases.imdbID = movieinfo.imdbID - WHERE movieinfo.imdbID IN (%s)", + LEFT OUTER JOIN releases ON releases.imdbid = movieinfo.imdbid + WHERE movieinfo.imdbid IN (%s)", str_replace( ',,', ',', @@ -272,11 +272,11 @@ class Film $res = $this->pdo->queryOneRow( sprintf(" - SELECT COUNT(DISTINCT r.imdbID) AS num + SELECT COUNT(DISTINCT r.imdbid) AS num FROM releases r - INNER JOIN movieinfo m ON m.imdbID = r.imdbID + INNER JOIN movieinfo m ON m.imdbid = r.imdbid WHERE r.nzbstatus = 1 - AND r.imdbID != '0000000' + AND r.imdbid != '0000000' AND m.cover = 1 AND m.title != '' AND r.passwordstatus <= %d @@ -285,7 +285,7 @@ class Film $this->getBrowseBy(), $catsrch, ($maxAge > 0 ? 'AND r.postdate > NOW() - INTERVAL ' . $maxAge . ' DAY' : ''), - (count($excludedCats) > 0 ? ' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')' : '') + (count($excludedCats) > 0 ? ' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')' : '') ) ); @@ -328,13 +328,13 @@ class Film GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments, GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, m.*, groups.name AS group_name, rn.ID as nfoid FROM releases r - LEFT OUTER JOIN groups ON groups.ID = r.groupID - LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID - INNER JOIN movieinfo m ON m.imdbID = r.imdbID - WHERE r.nzbstatus = 1 AND r.imdbID != '0000000' + LEFT OUTER JOIN groups ON groups.ID = r.groupid + LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.ID + INNER JOIN movieinfo m ON m.imdbid = r.imdbid + WHERE r.nzbstatus = 1 AND r.imdbid != '0000000' AND m.title != '' AND r.passwordstatus <= %d AND %s %s %s %s - GROUP BY m.imdbID ORDER BY %s %s %s", + GROUP BY m.imdbid ORDER BY %s %s %s", $this->showPasswords, $this->getBrowseBy(), $catsrch, @@ -342,7 +342,7 @@ class Film ? 'AND r.postdate > NOW() - INTERVAL ' . $maxAge . 'DAY ' : '' ), - (count($excludedCats) > 0 ? ' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')' : ''), + (count($excludedCats) > 0 ? ' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')' : ''), $order[0], $order[1], ($start === false ? '' : ' LIMIT ' . $num . ' OFFSET ' . $start) @@ -466,7 +466,7 @@ class Film sprintf(" UPDATE movieinfo SET %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, updateddate = NOW() - WHERE imdbID = %d", + WHERE imdbid = %d", (empty($title) ? '' : 'title = ' . $this->pdo->escapeString($title)), (empty($tagLine) ? '' : 'tagline = ' . $this->pdo->escapeString($tagLine)), (empty($plot) ? '' : 'plot = ' . $this->pdo->escapeString($plot)), @@ -611,12 +611,12 @@ class Film $movieID = $this->pdo->queryInsert( sprintf(" INSERT INTO movieinfo - (imdbID, tmdbID, title, rating, tagline, plot, year, genre, type, + (imdbid, tmdbID, title, rating, tagline, plot, year, genre, type, director, actors, language, cover, backdrop, createddate, updateddate) VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, NOW(), NOW()) ON DUPLICATE KEY UPDATE - imdbID = %d, tmdbID = %s, title = %s, rating = %s, tagline = %s, plot = %s, year = %s, genre = %s, + imdbid = %d, tmdbID = %s, title = %s, rating = %s, tagline = %s, plot = %s, year = %s, genre = %s, type = %s, director = %s, actors = %s, language = %s, cover = %d, backdrop = %d, updateddate = NOW()", $mov['imdbid'], $mov['tmdbid'], @@ -901,14 +901,14 @@ class Film $this->pdo->log->doEcho($this->pdo->log->headerOver($service . ' found IMDBid: ') . $this->pdo->log->primary('tt' . $imdbID)); } - $this->pdo->queryExec(sprintf('UPDATE releases SET imdbID = %s WHERE ID = %d', $this->pdo->escapeString($imdbID), $id)); + $this->pdo->queryExec(sprintf('UPDATE releases SET imdbid = %s WHERE ID = %d', $this->pdo->escapeString($imdbID), $id)); // If set, scan for imdb info. if ($processImdb == 1) { $movCheck = $this->getMovieInfo($imdbID); if ($movCheck === false || (isset($movCheck['updateddate']) && (time() - strtotime($movCheck['updateddate'])) > 2592000)) { if ($this->updateMovieInfo($imdbID) === false) { - $this->pdo->queryExec(sprintf('UPDATE releases SET imdbID = %s WHERE ID = %d', 0000000, $id)); + $this->pdo->queryExec(sprintf('UPDATE releases SET imdbid = %s WHERE ID = %d', 0000000, $id)); } } } @@ -935,12 +935,12 @@ class Film sprintf(" SELECT r.searchname, r.ID FROM releases r - WHERE r.imdbID IS NULL + WHERE r.imdbid IS NULL AND r.nzbstatus = 1 - AND r.categoryID BETWEEN 2000 AND 2999 + AND r.categoryid BETWEEN 2000 AND 2999 %s %s %s LIMIT %d", - ($groupID === '' ? '' : ('AND r.groupID = ' . $groupID)), + ($groupID === '' ? '' : ('AND r.groupid = ' . $groupID)), ($guidChar === '' ? '' : ('AND r.guid ' . $this->pdo->likeString($guidChar, false, true))), ($lookupIMDB == 2 ? 'AND r.isrenamed = 1' : ''), $this->movieqty @@ -958,7 +958,7 @@ class Film // Try to get a name/year. if ($this->parseMovieSearchName($arr['searchname']) === false) { //We didn't find a name, so set to all 0's so we don't parse again. - $this->pdo->queryExec(sprintf("UPDATE releases SET imdbID = 0000000 WHERE ID = %d", $arr["ID"])); + $this->pdo->queryExec(sprintf("UPDATE releases SET imdbid = 0000000 WHERE ID = %d", $arr["ID"])); continue; } else { @@ -996,8 +996,8 @@ class Film if ($buffer !== false) { $getIMDBid = json_decode($buffer); - if (isset($getIMDBid->imdbID)) { - $imdbID = $this->doMovieUpdate($getIMDBid->imdbID, 'OMDbAPI', $arr['ID']); + if (isset($getIMDBid->imdbid)) { + $imdbID = $this->doMovieUpdate($getIMDBid->imdbid, 'OMDbAPI', $arr['ID']); if ($imdbID !== false) { continue; } @@ -1021,7 +1021,7 @@ class Film } // We failed to get an IMDB id from all sources. - $this->pdo->queryExec(sprintf("UPDATE releases SET imdbID = 0000000 WHERE ID = %d", $arr["ID"])); + $this->pdo->queryExec(sprintf("UPDATE releases SET imdbid = 0000000 WHERE ID = %d", $arr["ID"])); } } } @@ -1030,11 +1030,11 @@ class Film /** * Try to fetch an IMDB id locally. * - * @return int|bool Int, the imdbID when true, Bool when false. + * @return int|bool Int, the imdbid when true, Bool when false. */ protected function localIMDBsearch() { - $query = 'SELECT imdbID FROM movieinfo'; + $query = 'SELECT imdbid FROM movieinfo'; $andYearIn = ''; //If we found a year, try looking in a 4 year range. @@ -1094,8 +1094,8 @@ class Film return ( ($IMDBCheck === false ? false - : (is_numeric($IMDBCheck['imdbID']) - ? (int)$IMDBCheck['imdbID'] + : (is_numeric($IMDBCheck['imdbid']) + ? (int)$IMDBCheck['imdbid'] : false ) ) diff --git a/lib/IRCScraper.php b/lib/IRCScraper.php index cd2404ee1..4034183cc 100644 --- a/lib/IRCScraper.php +++ b/lib/IRCScraper.php @@ -286,8 +286,8 @@ class IRCScraper extends IRCClient $query .= (!empty($this->_curPre['source']) ? 'source, ' : ''); $query .= (!empty($this->_curPre['reason']) ? 'nukereason, ' : ''); $query .= (!empty($this->_curPre['files']) ? 'files, ' : ''); - $query .= (!empty($this->_curPre['reqid']) ? 'requestID, ' : ''); - $query .= (!empty($this->_curPre['group_id']) ? 'groupID, ' : ''); + $query .= (!empty($this->_curPre['reqid']) ? 'requestid, ' : ''); + $query .= (!empty($this->_curPre['group_id']) ? 'groupid, ' : ''); $query .= (!empty($this->_curPre['nuked']) ? 'nuked, ' : ''); $query .= (!empty($this->_curPre['filename']) ? 'filename, ' : ''); @@ -335,8 +335,8 @@ class IRCScraper extends IRCClient $query .= (!empty($this->_curPre['source']) ? 'source = ' . $this->_pdo->escapeString($this->_curPre['source']) . ', ' : ''); $query .= (!empty($this->_curPre['files']) ? 'files = ' . $this->_pdo->escapeString($this->_curPre['files']) . ', ' : ''); $query .= (!empty($this->_curPre['reason']) ? 'nukereason = ' . $this->_pdo->escapeString($this->_curPre['reason']) . ', ' : ''); - $query .= (!empty($this->_curPre['reqid']) ? 'requestID = ' . $this->_curPre['reqid'] . ', ' : ''); - $query .= (!empty($this->_curPre['group_id']) ? 'groupID = ' . $this->_curPre['group_id'] . ', ' : ''); + $query .= (!empty($this->_curPre['reqid']) ? 'requestid = ' . $this->_curPre['reqid'] . ', ' : ''); + $query .= (!empty($this->_curPre['group_id']) ? 'groupid = ' . $this->_curPre['group_id'] . ', ' : ''); $query .= (!empty($this->_curPre['predate']) ? 'predate = ' . $this->_curPre['predate'] . ', ' : ''); $query .= (!empty($this->_curPre['nuked']) ? 'nuked = ' . $this->_curPre['nuked'] . ', ' : ''); $query .= (!empty($this->_curPre['filename']) ? 'filename = ' . $this->_pdo->escapeString($this->_curPre['filename']) . ', ' : ''); diff --git a/lib/Info.php b/lib/Info.php index ccdb38dc5..0bc50445b 100644 --- a/lib/Info.php +++ b/lib/Info.php @@ -205,11 +205,11 @@ class Info { if ($release['ID'] > 0 && $this->isNFO($nfo, $release['guid'])) { - $check = $this->pdo->queryOneRow(sprintf('SELECT ID FROM releasenfo WHERE releaseID = %d', $release['ID'])); + $check = $this->pdo->queryOneRow(sprintf('SELECT ID FROM releasenfo WHERE releaseid = %d', $release['ID'])); if ($check === false) { $this->pdo->queryInsert( - sprintf('INSERT INTO releasenfo (nfo, releaseID) VALUES (compress(%s), %d)', + sprintf('INSERT INTO releasenfo (nfo, releaseid) VALUES (compress(%s), %d)', $this->pdo->escapeString($nfo), $release['ID'] ) @@ -232,7 +232,7 @@ class Info 'PostProcess' => new PProcess(['Echo' => $this->echo, 'Settings' => $this->pdo, 'Nfo' => $this]) ] ); - $nzbContents->parseNZB($release['guid'], $release['ID'], $release['groupID']); + $nzbContents->parseNZB($release['guid'], $release['ID'], $release['groupid']); } return true; } @@ -286,12 +286,12 @@ class Info { $ret = 0; $guidCharQuery = ($guidChar === '' ? '' : 'AND r.guid ' . $this->pdo->likeString($guidChar, false, true)); - $groupIDQuery = ($groupID === '' ? '' : 'AND r.groupID = ' . $groupID); + $groupIDQuery = ($groupID === '' ? '' : 'AND r.groupid = ' . $groupID); $optionsQuery = self::NfoQueryString($this->pdo); $res = $this->pdo->query( sprintf(' - SELECT r.ID, r.guid, r.groupID, r.name + SELECT r.ID, r.guid, r.groupid, r.name FROM releases r WHERE 1=1 %s %s %s ORDER BY r.nfostatus ASC, r.postdate DESC @@ -353,15 +353,15 @@ class Info $tvRage = new TvAnger(['Echo' => $this->echo, 'Settings' => $this->pdo]); foreach ($res as $arr) { - $fetchedBinary = $nzbContents->getNFOfromNZB($arr['guid'], $arr['ID'], $arr['groupID'], $groups->getByNameByID($arr['groupID'])); + $fetchedBinary = $nzbContents->getNFOfromNZB($arr['guid'], $arr['ID'], $arr['groupid'], $groups->getByNameByID($arr['groupid'])); if ($fetchedBinary !== false) { // Insert nfo into database. $cp = 'COMPRESS(%s)'; $nc = $this->pdo->escapeString($fetchedBinary); - $ckreleaseid = $this->pdo->queryOneRow(sprintf('SELECT ID FROM releasenfo WHERE releaseID = %d', $arr['ID'])); + $ckreleaseid = $this->pdo->queryOneRow(sprintf('SELECT ID FROM releasenfo WHERE releaseid = %d', $arr['ID'])); if (!isset($ckreleaseid['ID'])) { - $this->pdo->queryInsert(sprintf('INSERT INTO releasenfo (nfo, releaseID) VALUES (' . $cp . ', %d)', $nc, $arr['ID'])); + $this->pdo->queryInsert(sprintf('INSERT INTO releasenfo (nfo, releaseid) VALUES (' . $cp . ', %d)', $nc, $arr['ID'])); } $this->pdo->queryExec(sprintf('UPDATE releases SET nfostatus = %d WHERE ID = %d', self::NFO_FOUND, $arr['ID'])); $ret++; @@ -405,7 +405,7 @@ class Info if ($releases instanceof Traversable) { foreach ($releases as $release) { $this->pdo->queryExec( - sprintf('DELETE FROM releasenfo WHERE nfo IS NULL AND releaseID = %d', $release['ID']) + sprintf('DELETE FROM releasenfo WHERE nfo IS NULL AND releaseid = %d', $release['ID']) ); } } diff --git a/lib/Konsole.php b/lib/Konsole.php index 58705ef7a..7c3a42b64 100644 --- a/lib/Konsole.php +++ b/lib/Konsole.php @@ -151,16 +151,16 @@ class Konsole $res = $this->pdo->queryOneRow( sprintf(" - SELECT COUNT(DISTINCT r.consoleinfoID) AS num + SELECT COUNT(DISTINCT r.consoleinfoid) AS num FROM releases r - INNER JOIN consoleinfo con ON con.ID = r.consoleinfoID AND con.title != '' AND con.cover = 1 + INNER JOIN consoleinfo con ON con.ID = r.consoleinfoid AND con.title != '' AND con.cover = 1 WHERE r.nzbstatus = 1 AND r.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') AND %s %s %s %s", $this->getBrowseBy(), $catsrch, ($maxage > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxage) : ''), - (count($excludedcats) > 0 ? (' AND r.categoryID NOT IN (' . implode(',', $excludedcats) . ')') : '') + (count($excludedcats) > 0 ? (' AND r.categoryid NOT IN (' . implode(',', $excludedcats) . ')') : '') ) ); return ($res === false ? 0 : $res["num"]); @@ -184,7 +184,7 @@ class Konsole $exccatlist = ""; if (count($excludedcats) > 0) { - $exccatlist = " AND r.categoryID NOT IN (" . implode(",", $excludedcats) . ")"; + $exccatlist = " AND r.categoryid NOT IN (" . implode(",", $excludedcats) . ")"; } $order = $this->getConsoleOrder($orderby); @@ -203,10 +203,10 @@ class Konsole . "GROUP_CONCAT(r.totalpart ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_totalparts, " . "GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments, " . "GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, " - . "con.*, r.consoleinfoID, groups.name AS group_name, rn.ID as nfoid FROM releases r " - . "LEFT OUTER JOIN groups ON groups.ID = r.groupID " - . "LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID " - . "INNER JOIN consoleinfo con ON con.ID = r.consoleinfoID " + . "con.*, r.consoleinfoid, groups.name AS group_name, rn.ID as nfoid FROM releases r " + . "LEFT OUTER JOIN groups ON groups.ID = r.groupid " + . "LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.ID " + . "INNER JOIN consoleinfo con ON con.ID = r.consoleinfoid " . "INNER JOIN genres ON con.genreID = genres.ID " . "WHERE r.nzbstatus = 1 AND con.title != '' AND " . "r.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') AND %s %s @@ -681,8 +681,8 @@ class Konsole SELECT searchname, ID FROM releases WHERE nzbstatus = %d %s - AND consoleinfoID IS NULL - AND categoryID BETWEEN 1000 AND 1999 + AND consoleinfoid IS NULL + AND categoryid BETWEEN 1000 AND 1999 ORDER BY postdate DESC LIMIT %d', \Enzebe::NZB_ADDED, @@ -740,7 +740,7 @@ class Konsole $this->pdo->queryExec( sprintf(' UPDATE releases - SET consoleinfoID = %d + SET consoleinfoid = %d WHERE ID = %d', $gameId, $arr['ID'] @@ -819,7 +819,7 @@ class Konsole array_map("trim", $result); /* Make sure we got a title and platform otherwise the resulting lookup will probably be shit. - Other option is to pass the $release->categoryID here if we don't find a platform but that + Other option is to pass the $release->categoryid here if we don't find a platform but that would require an extra lookup to determine the name. In either case we should have a title at the minimum. */ return (isset($result['title']) && !empty($result['title']) && isset($result['platform'])) ? $result : false; diff --git a/lib/MiscSorter.php b/lib/MiscSorter.php index 3b034cea8..94e6bd91c 100644 --- a/lib/MiscSorter.php +++ b/lib/MiscSorter.php @@ -59,18 +59,18 @@ class MiscSorter public function nfosorter($category = 0, $id = 0) { $idarr = ($id != 0 ? sprintf('AND r.ID = %d', $id) : ''); - $cat = ($category = 0 ? sprintf('AND r.categoryID = %d', Category::CAT_MISC) : sprintf('AND r.categoryID = %d', $category)); + $cat = ($category = 0 ? sprintf('AND r.categoryid = %d', Category::CAT_MISC) : sprintf('AND r.categoryid = %d', $category)); $res = $this->pdo->queryDirect( sprintf(" SELECT UNCOMPRESS(rn.nfo) AS nfo, r.ID, r.name, r.searchname FROM releasenfo rn - INNER JOIN releases r ON rn.releaseID = r.ID - INNER JOIN groups g ON r.groupID = g.ID + INNER JOIN releases r ON rn.releaseid = r.ID + INNER JOIN groups g ON r.groupid = g.ID WHERE rn.nfo IS NOT NULL AND r.proc_sorter = %d - AND r.prehashID = 0 %s", + AND r.prehashid = 0 %s", self::PROC_SORTER_NONE, ($idarr = '' ? $cat : $idarr) ) @@ -354,8 +354,8 @@ class MiscSorter $release = $this->pdo->queryOneRow( sprintf(" - SELECT r.ID AS releaseID, r.searchname AS searchname, - r.name AS name, r.categoryID, r.groupID + SELECT r.ID AS releaseid, r.searchname AS searchname, + r.name AS name, r.categoryid, r.groupid FROM releases r WHERE r.ID = %d", $id @@ -369,7 +369,7 @@ class MiscSorter $this->_setProcSorter(self::PROC_SORTER_DONE, $id); } - if ($type !== '' && in_array($type, ['bookinfoID', 'consoleinfoID', 'imdbID', 'musicinfoID'])) { + if ($type !== '' && in_array($type, ['bookinfoid', 'consoleinfoid', 'imdbid', 'musicinfoid'])) { $this->pdo->queryExec( sprintf(' UPDATE releases @@ -460,7 +460,7 @@ class MiscSorter { $imdb = $this->movie->doMovieUpdate($nfo, "sorter", $row['ID']); if (isset($imdb) && $imdb > 0) { - return $this->dodbupdate($row['ID'], $this->moviename($row['ID'], $row['searchname']), $imdb, 'imdbID'); + return $this->dodbupdate($row['ID'], $this->moviename($row['ID'], $row['searchname']), $imdb, 'imdbid'); } return false; @@ -649,10 +649,10 @@ class MiscSorter $rel = $this->_doAmazonLocal('musicinfo', (string)$amaz->Items->Item->ASIN); if ($rel !== false) { - $ok = $this->dodbupdate($id, $name, $rel['ID'], 'musicinfoID'); + $ok = $this->dodbupdate($id, $name, $rel['ID'], 'musicinfoid'); } else { $musicId = $this->music->updateMusicInfo('', '', $amaz); - $ok = $this->dodbupdate($id, $name, $musicId, 'musicinfoID'); + $ok = $this->dodbupdate($id, $name, $musicId, 'musicinfoid'); } return $ok; @@ -680,7 +680,7 @@ class MiscSorter $rel = $this->_doAmazonLocal('consoleinfo', (string)$amaz->Items->Item->ASIN); if ($rel !== false) { - $ok = $this->dodbupdate($id, $name, $rel['ID'], 'consoleinfoID'); + $ok = $this->dodbupdate($id, $name, $rel['ID'], 'consoleinfoid'); } else { $consoleId = $this->console-> updateConsoleInfo([ @@ -689,7 +689,7 @@ class MiscSorter 'platform' => (string)$amaz->Items->Item->ItemAttributes->Platform ] ); - $ok = $this->dodbupdate($id, $name, $consoleId, 'consoleinfoID'); + $ok = $this->dodbupdate($id, $name, $consoleId, 'consoleinfoid'); } return $ok; diff --git a/lib/Pprocess.php b/lib/Pprocess.php index 7415cb1cd..4df420623 100644 --- a/lib/Pprocess.php +++ b/lib/Pprocess.php @@ -357,7 +357,7 @@ class PProcess $query = $this->pdo->queryOneRow( sprintf(' - SELECT ID, groupID, categoryID, name, searchname, UNIX_TIMESTAMP(postdate) AS post_date, ID AS releaseID + SELECT ID, groupid, categoryid, name, searchname, UNIX_TIMESTAMP(postdate) AS post_date, ID AS releaseid FROM releases WHERE isrenamed = 0 AND ID = %d', @@ -372,7 +372,7 @@ class PProcess // Only get a new name if the category is OTHER. $foundName = true; if (!in_array( - (int)$query['categoryID'], + (int)$query['categoryid'], array( Category::CAT_BOOK_OTHER, Category::CAT_GAME_OTHER, @@ -426,7 +426,7 @@ class PProcess sprintf(' SELECT ID FROM releasefiles - WHERE releaseID = %d + WHERE releaseid = %d AND name = %s', $relID, $this->pdo->escapeString($file['name']) diff --git a/lib/ProcessAdditional.php b/lib/ProcessAdditional.php index 4f976473c..b16480d2e 100644 --- a/lib/ProcessAdditional.php +++ b/lib/ProcessAdditional.php @@ -468,7 +468,7 @@ Class ProcessAdditional $this->_mainTmpPath .= DS; } - // If we are doing per group, use the groupID has a inner path, so other scripts don't delete the files we are working on. + // If we are doing per group, use the groupid has a inner path, so other scripts don't delete the files we are working on. if ($groupID !== '') { $this->_mainTmpPath .= ($groupID . DS); } else if ($guidChar !== '') { @@ -523,9 +523,9 @@ Class ProcessAdditional $this->_releases = $this->pdo->query( sprintf( ' - SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupID, r.nfostatus, r.completion, r.categoryID, r.searchname, r.prehashID + SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupid, r.nfostatus, r.completion, r.categoryid, r.searchname, r.prehashid FROM releases r - LEFT JOIN category c ON c.ID = r.categoryID + LEFT JOIN category c ON c.ID = r.categoryid WHERE r.nzbstatus = 1 %s %s %s %s AND r.passwordstatus BETWEEN -6 AND -1 @@ -535,7 +535,7 @@ Class ProcessAdditional LIMIT %d', $this->_maxSize, $this->_minSize, - ($groupID === '' ? '' : 'AND r.groupID = ' . $groupID), + ($groupID === '' ? '' : 'AND r.groupid = ' . $groupID), ($guidChar === '' ? '' : 'AND r.guid ' . $this->pdo->likeString($guidChar, false, true)), $this->_queryLimit ) @@ -1092,7 +1092,7 @@ Class ProcessAdditional sprintf( ' SELECT ID FROM releasefiles - WHERE releaseID = %d + WHERE releaseid = %d AND name = %s AND size = %d', $this->_release['ID'], $this->pdo->escapeString($file['name']), $file['size'] @@ -1117,7 +1117,7 @@ Class ProcessAdditional } //Run a PreDB filename check on insert to try and match the release else if (strpos($file['name'], '.') != 0 && strlen($file['name']) > 0) { $this->_release['filename'] = $file['name']; - $this->_release['releaseID'] = $this->_release['ID']; + $this->_release['releaseid'] = $this->_release['ID']; $this->_nameFixer->matchPredbFiles($this->_release, 1, 1, true, 1); } } @@ -1212,7 +1212,7 @@ Class ProcessAdditional } // Check if it's alt.binaries.u4e file. else if (in_array($this->_releaseGroupName, ['alt.binaries.u4e', 'alt.binaries.mom']) && preg_match('/Linux_2rename\.sh/i', $file) && - ($this->_release['categoryID'] == \Category::CAT_MISC_HASHED || $this->_release['categoryID'] == \Category::CAT_MISC_OTHER) + ($this->_release['categoryid'] == \Category::CAT_MISC_HASHED || $this->_release['categoryid'] == \Category::CAT_MISC_OTHER) ) { $this->_processU4ETitle($file); } @@ -1512,10 +1512,10 @@ Class ProcessAdditional $releaseFiles = $this->pdo->queryOneRow( sprintf( ' - SELECT COUNT(releasefiles.releaseID) AS count, + SELECT COUNT(releasefiles.releaseid) AS count, SUM(releasefiles.size) AS size FROM releasefiles - WHERE releaseID = %d', + WHERE releaseid = %d', $this->_release['ID'] ) ); @@ -1623,7 +1623,7 @@ Class ProcessAdditional // Make sure the category is music or other. $rQuery = $this->pdo->queryOneRow( sprintf( - 'SELECT searchname, categoryID AS id, groupID FROM releases WHERE proc_pp = 0 AND ID = %d', + 'SELECT searchname, categoryid AS id, groupid FROM releases WHERE proc_pp = 0 AND ID = %d', $this->_release['ID'] ) ); @@ -1663,7 +1663,7 @@ Class ProcessAdditional if (isset($track['Album']) && isset($track['Performer'])) { - if (NN_RENAME_MUSIC_MEDIAINFO && $this->_release['prehashID'] == 0) { + if (NN_RENAME_MUSIC_MEDIAINFO && $this->_release['prehashid'] == 0) { // Make the extension upper case. $ext = strtoupper($fileExtension); @@ -1680,7 +1680,7 @@ Class ProcessAdditional } else if ($ext === 'FLAC') { $newCat = Category::CAT_MUSIC_LOSSLESS; } else { - $newCat = $this->_categorize->determineCategory($rQuery['groupID'],$newName); + $newCat = $this->_categorize->determineCategory($rQuery['groupid'],$newName); } $newTitle = $this->pdo->escapeString(substr($newName, 0, 255)); @@ -1689,7 +1689,7 @@ Class ProcessAdditional sprintf( ' UPDATE releases - SET searchname = %s, categoryID = %d, iscategorized = 1, isrenamed = 1, proc_pp = 1 + SET searchname = %s, categoryid = %d, iscategorized = 1, isrenamed = 1, proc_pp = 1 WHERE ID = %d', $newTitle, $newCat, @@ -1706,7 +1706,7 @@ Class ProcessAdditional 'old_name' => $rQuery['searchname'], 'new_category' => $newCat, 'old_category' => $rQuery['id'], - 'group' => $rQuery['groupID'], + 'group' => $rQuery['groupid'], 'release_id' => $this->_release['ID'], 'method' => 'ProcessAdditional->_getAudioInfo' ) @@ -2127,7 +2127,7 @@ Class ProcessAdditional if (NN_RENAME_PAR2 && $releaseInfo['proc_pp'] == 0 && in_array( - ((int)$this->_release['categoryID']), + ((int)$this->_release['categoryid']), array( Category::CAT_BOOK_OTHER, Category::CAT_GAME_OTHER, @@ -2163,7 +2163,7 @@ Class ProcessAdditional if ($filesAdded < 11 && $this->pdo->queryOneRow( sprintf( - 'SELECT ID FROM releasefiles WHERE releaseID = %d AND name = %s', + 'SELECT ID FROM releasefiles WHERE releaseid = %d AND name = %s', $this->_release['ID'], $this->pdo->escapeString($file['name']) ) ) === false @@ -2181,7 +2181,7 @@ Class ProcessAdditional // Try to get a new name. if ($foundName === false) { $this->_release['textstring'] = $file['name']; - $this->_release['releaseID'] = $this->_release['ID']; + $this->_release['releaseid'] = $this->_release['ID']; if ($this->_nameFixer->checkName($this->_release, ($this->_echoCLI ? 1 : 0), 'PAR2, ', 1, 1) === true) { $foundName = true; } @@ -2266,7 +2266,7 @@ Class ProcessAdditional } // Get a new category ID. - $newCategory = $this->_categorize->determineCategory($this->_release['groupID'], $newName); + $newCategory = $this->_categorize->determineCategory($this->_release['groupid'], $newName); $newTitle = $this->pdo->escapeString(substr($newName, 0, 255)); // Update the release with the data. @@ -2274,10 +2274,10 @@ Class ProcessAdditional sprintf( ' UPDATE releases - SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, - tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, - consoleinfoID = NULL, bookinfoID = NULL, anidbid = NULL, prehashID = 0, - searchname = %s, isrenamed = 1, iscategorized = 1, proc_files = 1, categoryID = %d + SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, + tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, + consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, prehashid = 0, + searchname = %s, isrenamed = 1, iscategorized = 1, proc_files = 1, categoryid = %d WHERE ID = %d', $newTitle, $newCategory, @@ -2293,8 +2293,8 @@ Class ProcessAdditional 'new_name' => $newName, 'old_name' => $this->_release['searchname'], 'new_category' => $newCategory, - 'old_category' => $this->_release['categoryID'], - 'group' => $this->_release['groupID'], + 'old_category' => $this->_release['categoryid'], + 'group' => $this->_release['groupid'], 'release_id' => $this->_release['ID'], 'method' => 'ProcessAdditional->_processU4ETitle' ) @@ -2509,7 +2509,7 @@ Class ProcessAdditional $this->_passwordStatus = array(Releases::PASSWD_NONE); $this->_releaseHasPassword = false; - $this->_releaseGroupName = $this->_groups->getByNameByID($this->_release['groupID']); + $this->_releaseGroupName = $this->_groups->getByNameByID($this->_release['groupid']); $this->_releaseHasNoNFO = false; // Make sure we don't already have an nfo. diff --git a/lib/ReleaseCleaner.php b/lib/ReleaseCleaner.php index 07dc61ffd..7697fefd7 100644 --- a/lib/ReleaseCleaner.php +++ b/lib/ReleaseCleaner.php @@ -108,13 +108,13 @@ class ReleaseCleaning "properlynamed" => true, "increment" => false, "predb" => $title['ID'], - "requestID" => false + "requestid" => false ); } } } } - // Get pre style name from requestID + // Get pre style name from requestid if (preg_match('/^\[ ?(\d{4,6}) ?\]/', $this->subject, $match) || preg_match('/^REQ\s*(\d{4,6})/i', $this->subject, $match) || preg_match('/^(\d{4,6})-\d{1}\[/', $this->subject, $match) || @@ -122,7 +122,7 @@ class ReleaseCleaning ) { $title = $this->pdo->queryOneRow( sprintf( - 'SELECT p.title , p.ID from prehash p INNER JOIN groups g on g.ID = p.groupID WHERE p.requestID = %d and g.name = %s', + 'SELECT p.title , p.ID from prehash p INNER JOIN groups g on g.ID = p.groupid WHERE p.requestid = %d and g.name = %s', $match[1], $this->pdo->escapeString($this->groupName) ) @@ -152,8 +152,8 @@ class ReleaseCleaning if ($title === false && !empty($reqGname)) { $title = $this->pdo->queryOneRow( sprintf( - "SELECT p.title as title, p.ID as ID from prehash p INNER JOIN groups g on g.ID = p.groupID - WHERE p.requestID = %d and g.name = %s", + "SELECT p.title as title, p.ID as ID from prehash p INNER JOIN groups g on g.ID = p.groupid + WHERE p.requestid = %d and g.name = %s", $match[1], $this->pdo->escapeString($reqGname) ) @@ -169,7 +169,7 @@ class ReleaseCleaning "properlynamed" => true, "increment" => false, "predb" => $title['ID'], - "requestID" => true + "requestid" => true ); } } diff --git a/lib/ReleaseRemover.php b/lib/ReleaseRemover.php index 4348be54b..32564d2d1 100644 --- a/lib/ReleaseRemover.php +++ b/lib/ReleaseRemover.php @@ -350,7 +350,7 @@ class ReleaseRemover WHERE r.nfostatus = 0 AND r.iscategorized = 1 AND r.rarinnerfilecount = 0 - AND r.categoryID NOT IN (%d) + AND r.categoryid NOT IN (%d) AND r.searchname REGEXP '^[a-zA-Z0-9]{15,}$' %s", \Category::CAT_MISC_HASHED, @@ -378,7 +378,7 @@ class ReleaseRemover WHERE r.nfostatus = 0 AND r.iscategorized = 1 AND r.rarinnerfilecount = 0 - AND r.categoryID NOT IN (%d, %d) + AND r.categoryid NOT IN (%d, %d) AND r.searchname REGEXP '[a-zA-Z0-9]{25,}' %s", \Category::CAT_MISC_OTHER, \Category::CAT_MISC_HASHED, $this->crapTime @@ -405,7 +405,7 @@ class ReleaseRemover WHERE r.nfostatus = 0 AND r.iscategorized = 1 AND r.rarinnerfilecount = 0 - AND r.categoryID NOT IN (%d) + AND r.categoryid NOT IN (%d) AND r.searchname REGEXP '^[a-zA-Z0-9]{0,5}$' %s", \Category::CAT_MISC_OTHER, $this->crapTime @@ -429,10 +429,10 @@ class ReleaseRemover $this->query = sprintf( "SELECT r.guid, r.searchname, r.ID FROM releases r - INNER JOIN releasefiles rf ON rf.releaseID = r.ID + INNER JOIN releasefiles rf ON rf.releaseid = r.ID WHERE r.searchname NOT LIKE %s AND rf.name LIKE %s - AND r.categoryID NOT IN (%d, %d, %d, %d, %d, %d) %s", + AND r.categoryid NOT IN (%d, %d, %d, %d, %d, %d) %s", "'%.exes%'", "'%.exe%'", \Category::CAT_PC_0DAY, @@ -462,7 +462,7 @@ class ReleaseRemover $this->query = sprintf( "SELECT r.guid, r.searchname, r.ID FROM releases r - INNER JOIN releasefiles rf ON rf.releaseID = r.ID + INNER JOIN releasefiles rf ON rf.releaseid = r.ID WHERE rf.name LIKE %s %s", "'%install.bin%'", $this->crapTime @@ -486,7 +486,7 @@ class ReleaseRemover $this->query = sprintf( "SELECT r.guid, r.searchname, r.ID FROM releases r - INNER JOIN releasefiles rf ON rf.releaseID = r.ID + INNER JOIN releasefiles rf ON rf.releaseid = r.ID WHERE rf.name LIKE %s %s", "'%password.url%'", $this->crapTime @@ -518,7 +518,7 @@ class ReleaseRemover AND r.searchname NOT LIKE %s AND r.searchname NOT LIKE %s AND r.nzbstatus = 1 - AND r.categoryID NOT IN (%d, %d, %d, %d, %d, %d, %d, %d, %d) %s", + AND r.categoryid NOT IN (%d, %d, %d, %d, %d, %d, %d, %d, %d) %s", // Matches passwort / passworded / etc also. "'%passwor%'", "'%advanced%'", @@ -559,7 +559,7 @@ class ReleaseRemover FROM releases r WHERE r.totalpart = 1 AND r.size < 2097152 - AND r.categoryID NOT IN (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d) %s", + AND r.categoryid NOT IN (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d) %s", \Category::CAT_MUSIC_MP3, \Category::CAT_BOOK_COMICS, \Category::CAT_BOOK_EBOOK, @@ -618,7 +618,7 @@ class ReleaseRemover WHERE r.totalpart > 1 AND r.size < 40000000 AND r.name LIKE %s - AND r.categoryID IN (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d) %s", + AND r.categoryid IN (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d) %s", "'%sample%'", \Category::CAT_TV_ANIME, \Category::CAT_TV_DOCU, @@ -656,7 +656,7 @@ class ReleaseRemover $this->query = sprintf( "SELECT r.guid, r.searchname, r.ID FROM releases r - LEFT JOIN releasefiles rf on rf.releaseID = r.ID + LEFT JOIN releasefiles rf on rf.releaseid = r.ID WHERE (rf.name REGEXP '[.]scr[$ \"]' OR r.name REGEXP '[.]scr[$ \"]') %s", $this->crapTime @@ -817,7 +817,7 @@ class ReleaseRemover $groupIDs = (substr($string, 0, -1)); } - $groupID = ' AND r.groupID in (' . $groupIDs . ') '; + $groupID = ' AND r.groupid in (' . $groupIDs . ') '; } $this->method = 'Blacklist [' . $regex['ID'] . ']'; @@ -888,7 +888,7 @@ class ReleaseRemover foreach ($allRegex as $regex) { - $regexSQL = sprintf("LEFT JOIN releasefiles rf ON r.ID = rf.releaseID + $regexSQL = sprintf("LEFT JOIN releasefiles rf ON r.ID = rf.releaseid WHERE rf.name REGEXP %s ", $this->pdo->escapeString($regex['regex']) ); @@ -916,7 +916,7 @@ class ReleaseRemover $groupIDs = (substr($string, 0, -1)); } - $groupID = ' AND r.groupID in (' . $groupIDs . ') '; + $groupID = ' AND r.groupid in (' . $groupIDs . ') '; } $this->method = 'Blacklist ' . $regex['ID']; @@ -954,7 +954,7 @@ class ReleaseRemover $frenchv = '%Lisez moi si le film ne demarre pas.txt%'; $nl = '%lees me als de film niet spelen.txt%'; $german = '%Lesen Sie mir wenn der Film nicht abgespielt.txt%'; - $categories = sprintf("r.categoryID IN (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d) AND", + $categories = sprintf("r.categoryid IN (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d) AND", \Category::CAT_MOVIE_3D, \Category::CAT_MOVIE_BLURAY, \Category::CAT_MOVIE_DVD, @@ -968,12 +968,12 @@ class ReleaseRemover \Category::CAT_XXX_OTHER ); $codeclike = sprintf("UNION SELECT r.guid, r.searchname, r.ID FROM releases r - LEFT JOIN releasefiles rf ON r.ID = rf.releaseID + LEFT JOIN releasefiles rf ON r.ID = rf.releaseid WHERE %s rf.name LIKE '%s' OR rf.name LIKE '%s' OR rf.name LIKE '%s' OR rf.name LIKE '%s' OR rf.name LIKE '%s' OR rf.name LIKE '%s'", $categories, $codec, $iferror, $ifnotplaying, $frenchv, $nl, $german ); $this->query = sprintf( "SELECT r.guid, r.searchname, r.ID FROM releases - r INNER JOIN releasefiles rf ON (rf.releaseID = r.ID) + r INNER JOIN releasefiles rf ON (rf.releaseid = r.ID) WHERE %s %s OR %s %s %s %s", $categories, $regex, $regex2, $this->crapTime, $codeclike, $this->crapTime ); @@ -1057,7 +1057,7 @@ class ReleaseRemover case 'categoryid': switch ($args[1]) { case 'equals': - return ' AND categoryID = ' . $args[2]; + return ' AND categoryid = ' . $args[2]; default: break; } @@ -1066,10 +1066,10 @@ class ReleaseRemover switch ($args[1]) { case 'equals': if ($args[2] === 'NULL') { - return ' AND imdbID IS NULL '; + return ' AND imdbid IS NULL '; } else { - return ' AND imdbID = ' . $args[2]; + return ' AND imdbid = ' . $args[2]; } default: break; @@ -1086,7 +1086,7 @@ class ReleaseRemover case 'rageid': switch ($args[1]) { case 'equals': - return ' AND rageID = ' . $args[2]; + return ' AND rageid = ' . $args[2]; default: break; } @@ -1120,14 +1120,14 @@ class ReleaseRemover break; } - return ' AND groupID = ' . $group['ID']; + return ' AND groupid = ' . $group['ID']; case 'like': $groups = $this->pdo->query('SELECT ID FROM groups WHERE name ' . $this->formatLike($args[2], 'name')); if (count($groups) === 0) { $this->error = 'No groups were found with this pattern in your database: ' . $args[2] . PHP_EOL; break; } - $gQuery = ' AND groupID IN ('; + $gQuery = ' AND groupid IN ('; foreach ($groups as $group) { $gQuery .= $group['ID'] . ','; } diff --git a/lib/Sharing.php b/lib/Sharing.php index 00f96c4f9..e4cc4e03f 100644 --- a/lib/Sharing.php +++ b/lib/Sharing.php @@ -532,7 +532,7 @@ Class Sharing if ($this->pdo->queryExec( sprintf(' INSERT IGNORE INTO releasecomment - (text, createddate, issynced, shareid, cid, gid, nzb_guid, siteid, username, userid, releaseid, shared, host, sourceID) + (text, createddate, issynced, shareid, cid, gid, nzb_guid, siteid, username, userid, releaseid, shared, host, sourceid) VALUES (%s, %s, 1, %s, %s, %s, %s, %s, %s, 0, 0, 2, "", 999)', $this->pdo->escapeString($body['BODY']), $this->pdo->from_unixtime(($body['TIME'] > time() ? time() : $body['TIME'])), diff --git a/lib/TvAnger.php b/lib/TvAnger.php index 64349efa6..41e90afa3 100644 --- a/lib/TvAnger.php +++ b/lib/TvAnger.php @@ -73,7 +73,7 @@ class TvAnger */ public function getByRageID($id) { - return $this->pdo->query(sprintf("SELECT * FROM tvrage WHERE rageID = %d", $id)); + return $this->pdo->query(sprintf("SELECT * FROM tvrage WHERE rageid = %d", $id)); } /** @@ -89,25 +89,25 @@ class TvAnger $string = '"\'"'; // Check if we already have an entry for this show. - $res = $this->pdo->queryOneRow(sprintf("SELECT rageID FROM tvrage WHERE LOWER(releasetitle) = LOWER(%s)", $this->pdo->escapeString($title))); - if (isset($res['rageID'])) { - return $res['rageID']; + $res = $this->pdo->queryOneRow(sprintf("SELECT rageid FROM tvrage WHERE LOWER(releasetitle) = LOWER(%s)", $this->pdo->escapeString($title))); + if (isset($res['rageid'])) { + return $res['rageid']; } $title2 = str_replace(' and ', ' & ', $title); if ($title != $title2) { - $res = $this->pdo->queryOneRow(sprintf("SELECT rageID FROM tvrage WHERE LOWER(releasetitle) = LOWER(%s)", $this->pdo->escapeString($title2))); - if (isset($res['rageID'])) { - return $res['rageID']; + $res = $this->pdo->queryOneRow(sprintf("SELECT rageid FROM tvrage WHERE LOWER(releasetitle) = LOWER(%s)", $this->pdo->escapeString($title2))); + if (isset($res['rageid'])) { + return $res['rageid']; } $pieces = explode(' ', $title2); $title4 = '%'; foreach ($pieces as $piece) { $title4 .= str_replace(array("'", "!"), "", $piece) . '%'; } - $res = $this->pdo->queryOneRow(sprintf("SELECT rageID FROM tvrage WHERE replace(replace(releasetitle, %s, ''), '!', '') LIKE %s", $string ,$this->pdo->escapeString($title4))); - if (isset($res['rageID'])) { - return $res['rageID']; + $res = $this->pdo->queryOneRow(sprintf("SELECT rageid FROM tvrage WHERE replace(replace(releasetitle, %s, ''), '!', '') LIKE %s", $string ,$this->pdo->escapeString($title4))); + if (isset($res['rageid'])) { + return $res['rageid']; } } @@ -115,18 +115,18 @@ class TvAnger // example theatre and theater $title3 = str_replace('er', 're', $title); if ($title != $title3) { - $res = $this->pdo->queryOneRow(sprintf("SELECT rageID FROM tvrage WHERE LOWER(releasetitle) = LOWER(%s)", $this->pdo->escapeString($title3))); - if (isset($res['rageID'])) { - return $res['rageID']; + $res = $this->pdo->queryOneRow(sprintf("SELECT rageid FROM tvrage WHERE LOWER(releasetitle) = LOWER(%s)", $this->pdo->escapeString($title3))); + if (isset($res['rageid'])) { + return $res['rageid']; } $pieces = explode(' ', $title3); $title4 = '%'; foreach ($pieces as $piece) { $title4 .= str_replace(array("'", "!"), "", $piece) . '%'; } - $res = $this->pdo->queryOneRow(sprintf("SELECT rageID FROM tvrage WHERE replace(replace(releasetitle, %s, ''), '!', '') LIKE %s", $string ,$this->pdo->escapeString($title4))); - if (isset($res['rageID'])) { - return $res['rageID']; + $res = $this->pdo->queryOneRow(sprintf("SELECT rageid FROM tvrage WHERE replace(replace(releasetitle, %s, ''), '!', '') LIKE %s", $string ,$this->pdo->escapeString($title4))); + if (isset($res['rageid'])) { + return $res['rageid']; } } @@ -139,9 +139,9 @@ class TvAnger foreach ($pieces as $piece) { $title4 .= str_replace(array("'", "!"), "", $piece) . '%'; } - $res = $this->pdo->queryOneRow(sprintf("SELECT rageID FROM tvrage WHERE replace(replace(releasetitle, %s, ''), '!', '') LIKE %s", $string, $this->pdo->escapeString($title4))); - if (isset($res['rageID'])) { - return $res['rageID']; + $res = $this->pdo->queryOneRow(sprintf("SELECT rageid FROM tvrage WHERE replace(replace(releasetitle, %s, ''), '!', '') LIKE %s", $string, $this->pdo->escapeString($title4))); + if (isset($res['rageid'])) { + return $res['rageid']; } } @@ -174,13 +174,13 @@ class TvAnger $country = $this->countryCode($country); if ($rageID != -2) { - $ckid = $this->pdo->queryOneRow('SELECT ID FROM tvrage WHERE rageID = ' . $rageID); + $ckid = $this->pdo->queryOneRow('SELECT ID FROM tvrage WHERE rageid = ' . $rageID); } else { $ckid = $this->pdo->queryOneRow('SELECT ID FROM tvrage WHERE releasetitle = ' . $this->pdo->escapeString($releasename)); } if (!isset($ckid['ID'])) { - $this->pdo->queryExec(sprintf('INSERT INTO tvrage (rageID, releasetitle, description, genre, country, createddate, imgdata) VALUES (%s, %s, %s, %s, %s, NOW(), %s)', $rageID, $this->pdo->escapeString($releasename), $this->pdo->escapeString(substr($desc, 0, 10000)), $this->pdo->escapeString(substr($genre, 0, 64)), $this->pdo->escapeString($country), $this->pdo->escapeString($imgbytes))); + $this->pdo->queryExec(sprintf('INSERT INTO tvrage (rageid, releasetitle, description, genre, country, createddate, imgdata) VALUES (%s, %s, %s, %s, %s, NOW(), %s)', $rageID, $this->pdo->escapeString($releasename), $this->pdo->escapeString(substr($desc, 0, 10000)), $this->pdo->escapeString(substr($genre, 0, 64)), $this->pdo->escapeString($country), $this->pdo->escapeString($imgbytes))); } else { $this->pdo->queryExec(sprintf('UPDATE tvrage SET releasetitle = %s, description = %s, genre = %s, country = %s, createddate = NOW(), imgdata = %sWHERE ID = %d', $this->pdo->escapeString($releasename), $this->pdo->escapeString(substr($desc, 0, 10000)), $this->pdo->escapeString(substr($genre, 0, 64)), $this->pdo->escapeString($country), $this->pdo->escapeString($imgbytes), $ckid['ID'])); } @@ -193,7 +193,7 @@ class TvAnger $imgbytes = ', imgdata = ' . $this->pdo->escapeString($imgbytes); } - $this->pdo->queryExec(sprintf('UPDATE tvrage SET rageID = %d, releasetitle = %s, description = %s, genre = %s, country = %s %sWHERE ID = %d', $rageID, $this->pdo->escapeString($releasename), $this->pdo->escapeString(substr($desc, 0, 10000)), $this->pdo->escapeString($genre), $this->pdo->escapeString($country), $imgbytes, $id)); + $this->pdo->queryExec(sprintf('UPDATE tvrage SET rageid = %d, releasetitle = %s, description = %s, genre = %s, country = %s %sWHERE ID = %d', $rageID, $this->pdo->escapeString($releasename), $this->pdo->escapeString(substr($desc, 0, 10000)), $this->pdo->escapeString($genre), $this->pdo->escapeString($country), $imgbytes, $id)); } public function delete($id) @@ -223,7 +223,7 @@ class TvAnger switch ($sec) { case 'Show ID': - $ret['rageID'] = $val; + $ret['rageid'] = $val; break; case 'Show Name': $ret['name'] = $val; @@ -295,7 +295,7 @@ class TvAnger $rsql .= sprintf("AND tvrage.releasetitle LIKE %s ", $this->pdo->escapeString("%" . $ragename . "%")); } - return $this->pdo->query(sprintf("SELECT ID, rageID, releasetitle, description, createddate FROM tvrage WHERE 1=1 %s ORDER BY rageID ASC" . $limit, $rsql)); + return $this->pdo->query(sprintf("SELECT ID, rageid, releasetitle, description, createddate FROM tvrage WHERE 1=1 %s ORDER BY rageid ASC" . $limit, $rsql)); } public function getCount($ragename = "") @@ -335,14 +335,14 @@ class TvAnger return $this->pdo->query( sprintf(" - SELECT tvrage.ID, tvrage.rageID, tvrage.releasetitle, tvrage.genre, tvrage.country, tvrage.createddate, tvrage.prevdate, tvrage.nextdate, + SELECT tvrage.ID, tvrage.rageid, tvrage.releasetitle, tvrage.genre, tvrage.country, tvrage.createddate, tvrage.prevdate, tvrage.nextdate, userseries.ID AS userseriesid FROM tvrage - LEFT OUTER JOIN userseries ON userseries.userID = %d - AND userseries.rageID = tvrage.rageID - WHERE tvrage.rageID IN (SELECT DISTINCT rageID FROM releases WHERE categoryID BETWEEN 5000 AND 5999 AND rageID > 0) - AND tvrage.rageID > 0 %s %s - GROUP BY tvrage.rageID + LEFT OUTER JOIN userseries ON userseries.userid = %d + AND userseries.rageid = tvrage.rageid + WHERE tvrage.rageid IN (SELECT DISTINCT rageid FROM releases WHERE categoryid BETWEEN 5000 AND 5999 AND rageid > 0) + AND tvrage.rageid > 0 %s %s + GROUP BY tvrage.rageid ORDER BY tvrage.releasetitle ASC", $uid, $rsql, @@ -354,10 +354,10 @@ class TvAnger public function updateSchedule() { $countries = $this->pdo->query("SELECT DISTINCT(country) AS country FROM tvrage WHERE country != ''"); - $showsindb = $this->pdo->query("SELECT DISTINCT(rageID) AS rageID FROM tvrage"); + $showsindb = $this->pdo->query("SELECT DISTINCT(rageid) AS rageid FROM tvrage"); $showarray = array(); foreach ($showsindb as $show) { - $showarray[] = $show['rageID']; + $showarray[] = $show['rageid']; } foreach ($countries as $country) { if ($this->echooutput) { @@ -391,14 +391,14 @@ class TvAnger // Only stick current shows and new shows in there. if (in_array($currShowId, $showarray)) { - $this->pdo->queryExec(sprintf("INSERT INTO tvrageepisodes (rageID, showtitle, fullep, airdate, link, eptitle) VALUES (%d, %s, %s, %s, %s, %s) ON DUPLICATE KEY UPDATE airdate = %s, link = %s ,eptitle = %s, showtitle = %s", $sShow->sid, $this->pdo->escapeString($currShowName), $this->pdo->escapeString($sShow->ep), $this->pdo->escapeString(date("Y-m-d H:i:s", $day_time)), $this->pdo->escapeString($sShow->link), $this->pdo->escapeString($sShow->title), $this->pdo->escapeString(date("Y-m-d H:i:s", $day_time)), $this->pdo->escapeString($sShow->link), $this->pdo->escapeString($sShow->title), $this->pdo->escapeString($currShowName))); + $this->pdo->queryExec(sprintf("INSERT INTO tvrageepisodes (rageid, showtitle, fullep, airdate, link, eptitle) VALUES (%d, %s, %s, %s, %s, %s) ON DUPLICATE KEY UPDATE airdate = %s, link = %s ,eptitle = %s, showtitle = %s", $sShow->sid, $this->pdo->escapeString($currShowName), $this->pdo->escapeString($sShow->ep), $this->pdo->escapeString(date("Y-m-d H:i:s", $day_time)), $this->pdo->escapeString($sShow->link), $this->pdo->escapeString($sShow->title), $this->pdo->escapeString(date("Y-m-d H:i:s", $day_time)), $this->pdo->escapeString($sShow->link), $this->pdo->escapeString($sShow->title), $this->pdo->escapeString($currShowName))); } } } } // Update series info. foreach ($xmlSchedule as $showId => $epInfo) { - $res = $this->pdo->query(sprintf("SELECT * FROM tvrage WHERE rageID = %d", $showId)); + $res = $this->pdo->query(sprintf("SELECT * FROM tvrage WHERE rageid = %d", $showId)); if (sizeof($res) > 0) { foreach ($res as $arr) { $prev_ep = $next_ep = ""; @@ -564,9 +564,9 @@ class TvAnger $tvairdate = (!empty($epinfo['airdate'])) ? $this->pdo->escapeString($epinfo['airdate']) : "NULL"; $tvtitle = (!empty($epinfo['title'])) ? $this->pdo->escapeString($epinfo['title']) : "NULL"; - $this->pdo->queryExec(sprintf("UPDATE releases set tvtitle = %s, tvairdate = %s, rageID = %d where ID = %d", $this->pdo->escapeString(trim($tvtitle)), $tvairdate, $tvrShow['showid'], $relid)); + $this->pdo->queryExec(sprintf("UPDATE releases set tvtitle = %s, tvairdate = %s, rageid = %d where ID = %d", $this->pdo->escapeString(trim($tvtitle)), $tvairdate, $tvrShow['showid'], $relid)); } else { - $this->pdo->queryExec(sprintf("UPDATE releases SET rageID = %d WHERE ID = %d", $tvrShow['showid'], $relid)); + $this->pdo->queryExec(sprintf("UPDATE releases SET rageid = %d WHERE ID = %d", $tvrShow['showid'], $relid)); } $genre = ''; @@ -609,9 +609,9 @@ class TvAnger if ($epinfo !== false) { $tvairdate = (!empty($epinfo['airdate'])) ? $this->pdo->escapeString($epinfo['airdate']) : "NULL"; $tvtitle = (!empty($epinfo['title'])) ? $this->pdo->escapeString($epinfo['title']) : "NULL"; - $this->pdo->queryExec(sprintf("UPDATE releases SET tvtitle = %s, tvairdate = %s, rageID = %d WHERE ID = %d", $this->pdo->escapeString(trim($tvtitle)), $tvairdate, $traktArray['show']['tvrage_id'], $relid)); + $this->pdo->queryExec(sprintf("UPDATE releases SET tvtitle = %s, tvairdate = %s, rageid = %d WHERE ID = %d", $this->pdo->escapeString(trim($tvtitle)), $tvairdate, $traktArray['show']['tvrage_id'], $relid)); } else { - $this->pdo->queryExec(sprintf("UPDATE releases SET rageID = %d WHERE ID = %d", $traktArray['show']['tvrage_id'], $relid)); + $this->pdo->queryExec(sprintf("UPDATE releases SET rageid = %d WHERE ID = %d", $traktArray['show']['tvrage_id'], $relid)); } $genre = ''; @@ -652,20 +652,20 @@ class TvAnger } $trakt = new \TraktTv(['Settings' => $this->pdo]); - // Get all releases without a rageID which are in a tv category. + // Get all releases without a rageid which are in a tv category. $res = $this->pdo->query( sprintf(" SELECT r.searchname, r.ID FROM releases r WHERE r.nzbstatus = 1 - AND r.rageID = -1 + AND r.rageid = -1 AND r.size > 1048576 - AND r.categoryID BETWEEN 5000 AND 5999 + AND r.categoryid BETWEEN 5000 AND 5999 %s %s %s ORDER BY r.postdate DESC LIMIT %d", - ($groupID === '' ? '' : 'AND r.groupID = ' . $groupID), + ($groupID === '' ? '' : 'AND r.groupid = ' . $groupID), ($guidChar === '' ? '' : 'AND r.guid ' . $this->pdo->likeString($guidChar, false, true)), ($lookupTvRage == 2 ? 'AND r.isrenamed = 1' : ''), $this->rageqty @@ -683,7 +683,7 @@ class TvAnger // Update release with season, ep, and airdate info (if available) from releasetitle. $this->updateEpInfo($show, $arr['ID']); - // Find the rageID. + // Find the rageid. $id = $this->getByTitle($show['cleanname']); // Force local lookup only @@ -711,12 +711,12 @@ class TvAnger } $this->updateRageInfoTrakt($traktArray['show']['tvrage_id'], $show, $traktArray, $arr['ID']); } - // No match, add to tvrage with rageID = -2 and $show['cleanname'] title only. + // No match, add to tvrage with rageid = -2 and $show['cleanname'] title only. else { $this->add(-2, $show['cleanname'], '', '', '', ''); } } - // No match, add to tvrage with rageID = -2 and $show['cleanname'] title only. + // No match, add to tvrage with rageid = -2 and $show['cleanname'] title only. else { $this->add(-2, $show['cleanname'], '', '', '', ''); } @@ -744,17 +744,17 @@ class TvAnger } } if ($tvairdate == "NULL") { - $this->pdo->queryExec(sprintf('UPDATE releases SET tvtitle = %s, rageID = %d WHERE ID = %d', $tvtitle, $id, $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET tvtitle = %s, rageid = %d WHERE ID = %d', $tvtitle, $id, $arr['ID'])); } else { - $this->pdo->queryExec(sprintf('UPDATE releases SET tvtitle = %s, tvairdate = %s, rageID = %d WHERE ID = %d', $tvtitle, $tvairdate, $id, $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET tvtitle = %s, tvairdate = %s, rageid = %d WHERE ID = %d', $tvtitle, $tvairdate, $id, $arr['ID'])); } - // Cant find rageID, so set rageID to n/a. + // Cant find rageid, so set rageid to n/a. } else { - $this->pdo->queryExec(sprintf('UPDATE releases SET rageID = -2 WHERE ID = %d', $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET rageid = -2 WHERE ID = %d', $arr['ID'])); } - // Not a tv episode, so set rageID to n/a. + // Not a tv episode, so set rageid to n/a. } else { - $this->pdo->queryExec(sprintf('UPDATE releases SET rageID = -2 WHERE ID = %d', $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET rageid = -2 WHERE ID = %d', $arr['ID'])); } $ret++; } diff --git a/lib/copy_this/misc/sphinxsearch/sphinx.conf b/lib/copy_this/misc/sphinxsearch/sphinx.conf index debae5393..0d6e18503 100644 --- a/lib/copy_this/misc/sphinxsearch/sphinx.conf +++ b/lib/copy_this/misc/sphinxsearch/sphinx.conf @@ -137,7 +137,7 @@ searchd # !*: http://sphinxsearch.com/docs/current.html#conf-max-children # max_children = 0 - # PID file, searchd process ID file name + # PID file, searchd process id file name # mandatory # !*: Sphinx will not start if this folder does not exist. # !*: http://sphinxsearch.com/docs/current.html#conf-pid-file diff --git a/lib/copy_this/misc/sphinxsearch/toggle_search_type.php b/lib/copy_this/misc/sphinxsearch/toggle_search_type.php index 57bb1184b..17ed8f767 100644 --- a/lib/copy_this/misc/sphinxsearch/toggle_search_type.php +++ b/lib/copy_this/misc/sphinxsearch/toggle_search_type.php @@ -64,17 +64,17 @@ function revertToStandard($pdo) $pdo->queryExec( sprintf(" CREATE TABLE releasesearch ( - ID INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - releaseID INT(11) UNSIGNED NOT NULL, + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + releaseid INT(11) UNSIGNED NOT NULL, guid VARCHAR(50) NOT NULL, name VARCHAR(255) NOT NULL DEFAULT '', searchname VARCHAR(255) NOT NULL DEFAULT '', fromname VARCHAR(255) DEFAULT NULL, - PRIMARY KEY (ID), + PRIMARY KEY (id), FULLTEXT INDEX ix_releasesearch_name_ft (name), FULLTEXT INDEX ix_releasesearch_searchname_ft (searchname), FULLTEXT INDEX ix_releasesearch_fromname_ft (fromname), - INDEX ix_releasesearch_releaseid (releaseID), + INDEX ix_releasesearch_releaseid (releaseid), INDEX ix_releasesearch_guid (guid) ) %s @@ -86,8 +86,8 @@ function revertToStandard($pdo) ); echo $pdo->log->info('Populating the releasearch table with initial data. (Slow)' . PHP_EOL); - $pdo->queryInsert('INSERT INTO releasesearch (releaseID, guid, name, searchname, fromname) - SELECT ID, guid, name, searchname, fromname FROM releases'); + $pdo->queryInsert('INSERT INTO releasesearch (releaseid, guid, name, searchname, fromname) + SELECT id, guid, name, searchname, fromname FROM releases'); echo $pdo->log->info('Adding the auto-population triggers. (Quick)' . PHP_EOL); @@ -96,8 +96,8 @@ function revertToStandard($pdo) $pdo->exec(' CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN - INSERT INTO releasesearch (releaseID, guid, name, searchname, fromname) - VALUES (NEW.ID, NEW.guid, NEW.name, NEW.searchname, NEW.fromname); + INSERT INTO releasesearch (releaseid, guid, name, searchname, fromname) + VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname, NEW.fromname); END; CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW @@ -105,24 +105,24 @@ function revertToStandard($pdo) IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid - WHERE releaseID = OLD.ID; + WHERE releaseid = OLD.id; END IF; IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name - WHERE releaseID = OLD.ID; + WHERE releaseid = OLD.id; END IF; IF NEW.fromname != OLD.fromname THEN UPDATE releasesearch SET fromname = NEW.fromname - WHERE releaseID = OLD.id; + WHERE releaseid = OLD.id; END IF; END; CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch - WHERE releaseID = OLD.ID; + WHERE releaseid = OLD.id; END;' ); echo $pdo->log->header('Standard search should once again be available.' . PHP_EOL); diff --git a/lib/copy_this/misc/update_scripts/import.php b/lib/copy_this/misc/update_scripts/import.php index abeb2b36d..460053d9e 100644 --- a/lib/copy_this/misc/update_scripts/import.php +++ b/lib/copy_this/misc/update_scripts/import.php @@ -35,9 +35,9 @@ if (empty($argc) || $argc <= 1) { $categoryoverride = $argv[5]; } -$groups = $db->query("SELECT ID, name FROM groups"); +$groups = $db->query("SELECT id, name FROM groups"); foreach ($groups as $group) - $siteGroups[$group["name"]] = $group["ID"]; + $siteGroups[$group["name"]] = $group["id"]; echo "\nUsage: php import.php [path(string)] [usefilename(true/false)] [dupecheck(true/false)] [movefiles(true/false)] [overridecategory(number)]\n"; @@ -101,7 +101,7 @@ foreach ($filestoprocess as $nzbFile) { $name = $releases->cleanReleaseName(str_replace(".nzb", "", basename($nzbFile))); $catId = $cat->determineCategory($groupName, $name); $relid = $releases->insertRelease($name, $nzbInfo->filecount, $groupID, $relguid, $catId, "", date("Y-m-d H:i:s", $nzbInfo->postedlast), $nzbInfo->poster, "", $page->site); - $db->queryExec(sprintf("update releases set totalpart = %d, size = %s, completion = %d, GID=%s where ID = %d", $nzbInfo->filecount, $nzbInfo->filesize, $nzbInfo->completion, $db->escapeString($nzbInfo->gid), $relid)); + $db->queryExec(sprintf("update releases set totalpart = %d, size = %s, completion = %d, GID=%s where id = %d", $nzbInfo->filecount, $nzbInfo->filesize, $nzbInfo->completion, $db->escapeString($nzbInfo->gid), $relid)); $nzbfilename = $nzb->getNZBPath($relguid, $page->site->nzbpath, true); $fp = gzopen($nzbfilename, "w"); @@ -141,8 +141,8 @@ foreach ($filestoprocess as $nzbFile) { $relparts = explode("/", $regexMatches['parts']); $regexMatches['regcatid'] = ($categoryoverride != -1 ? $categoryoverride : $regexMatches['regcatid']); - $sql = sprintf("INSERT INTO binaries (name, fromname, date, xref, totalParts, groupID, binaryhash, dateadded, - categoryID, regexID, reqID, procstat, relpart, reltotalpart, relname) + $sql = sprintf("INSERT INTO binaries (name, fromname, date, xref, totalParts, groupid, binaryhash, dateadded, + categoryid, regexid, reqid, procstat, relpart, reltotalpart, relname) values (%s, %s, %s, %s, %d, %d, %s, NOW(), %s, %d, %s, %d, %d, %d, %s )", $db->escapeString($postFile["subject"]), $db->escapeString($postFile["poster"]), $db->escapeString(date("Y-m-d H:i:s", $postFile["posted"])), @@ -150,7 +150,7 @@ foreach ($filestoprocess as $nzbFile) { $postFile["segmenttotal"], $groupID, $db->escapeString(md5($postFile["subject"] . $postFile["poster"] . $groupID)), $regexMatches['regcatid'], - $regexMatches['regexID'], $db->escapeString($regexMatches['reqID']), + $regexMatches['regexid'], $db->escapeString($regexMatches['reqid']), Releases::PROCSTAT_TITLEMATCHED, $relparts[0], $relparts[1], $db->escapeString(str_replace('_', ' ', $regexMatches['name'])) ); $binaryId = $db->queryInsert($sql); @@ -167,7 +167,7 @@ foreach ($filestoprocess as $nzbFile) { } } if ($binaryId != 0) { - echo sprintf("%0" . $digits . "d %.2f%% Imported %s (%d:%s-%d/%d)\n", $items - $num, $num / $items * 100, basename($nzbFile), $regexMatches['regcatid'], $regexMatches['regexID'], $numbins, $numparts); + echo sprintf("%0" . $digits . "d %.2f%% Imported %s (%d:%s-%d/%d)\n", $items - $num, $num / $items * 100, basename($nzbFile), $regexMatches['regcatid'], $regexMatches['regexid'], $numbins, $numparts); if ($movefiles) { if (!file_exists($importedpath)) mkdir($importedpath); if (!file_exists($importedpath . basename($nzbFile))) rename($nzbFile, $importedpath . basename($nzbFile)); diff --git a/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/.do_not_run/switch.php b/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/.do_not_run/switch.php index 8b323e0ff..676cbc101 100644 --- a/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/.do_not_run/switch.php +++ b/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/.do_not_run/switch.php @@ -93,10 +93,10 @@ switch ($options[1]) { ); $columns[2] = sprintf('last_record = %s', $return['lastArticleNumber']); $query = sprintf( - 'UPDATE groups SET %s, %s, last_updated = NOW() WHERE ID = %d AND last_record < %s', + 'UPDATE groups SET %s, %s, last_updated = NOW() WHERE id = %d AND last_record < %s', $columns[1], $columns[2], - $groupMySQL['ID'], + $groupMySQL['id'], $return['lastArticleNumber'] ); break; @@ -112,10 +112,10 @@ switch ($options[1]) { ); $columns[2] = sprintf('first_record = %s', $return['firstArticleNumber']); $query = sprintf( - 'UPDATE groups SET %s, %s, last_updated = NOW() WHERE ID = %d AND first_record > %s', + 'UPDATE groups SET %s, %s, last_updated = NOW() WHERE id = %d AND first_record > %s', $columns[1], $columns[2], - $groupMySQL['ID'], + $groupMySQL['id'], $return['firstArticleNumber'] ); break; @@ -145,7 +145,7 @@ switch ($options[1]) { break; // Process releases. - // $options[2] => (string)groupCount, number of groups terminated by _ | (int)groupID, group to work on + // $options[2] => (string)groupCount, number of groups terminated by _ | (int)groupid, group to work on case 'releases': $pdo = new \DB(); $releases = new \Releases(['Settings' => $pdo]); @@ -169,8 +169,8 @@ switch ($options[1]) { } break; - // Process all local requestID for a single group. - // $options[2] => (int)groupID, group to work on + // Process all local requestid for a single group. + // $options[2] => (int)groupid, group to work on case 'requestid': if (is_numeric($options[2])) { (new \RequestIDLocal(['Echo' => true]))->lookupRequestIDs(['GroupID' => $options[2], 'limit' => 5000]); @@ -191,17 +191,17 @@ switch ($options[1]) { // Do a single group (update_binaries/backFill/update_releases/postprocess). - // $options[2] => (int)groupID, group to work on + // $options[2] => (int)groupid, group to work on case 'update_per_group': if (is_numeric($options[2])) { $pdo = new \DB(); // Get the group info from MySQL. - $groupMySQL = $pdo->queryOneRow(sprintf('SELECT * FROM groups WHERE ID = %d', $options[2])); + $groupMySQL = $pdo->queryOneRow(sprintf('SELECT * FROM groups WHERE id = %d', $options[2])); if ($groupMySQL === false) { - exit('ERROR: Group not found with ID ' . $options[2] . PHP_EOL); + exit('ERROR: Group not found with id ' . $options[2] . PHP_EOL); } // Connect to NNTP. @@ -268,7 +268,7 @@ switch ($options[1]) { } /** - * Create / process releases for a groupID. + * Create / process releases for a groupid. * * @param \Releases $releases * @param int $groupID @@ -304,7 +304,7 @@ function charCheck($char) */ function collectionCheck(&$pdo, $groupID) { - if ($pdo->queryOneRow(sprintf('SELECT ID FROM collections_%d LIMIT 1', $groupID)) === false) { + if ($pdo->queryOneRow(sprintf('SELECT id FROM collections_%d LIMIT 1', $groupID)) === false) { exit(); } } diff --git a/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/Forking.php b/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/Forking.php index dbd113d31..4ee323e4a 100644 --- a/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/Forking.php +++ b/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/Forking.php @@ -16,8 +16,8 @@ require_once(NN_TMUX . 'lib' . DS . 'Enzebe.php'); * * This forks various newznab scripts. * - * For example, you get all the ID's of the active groups in the groups table, you then iterate over them and spawn - * processes of misc/update_binaries.php passing the group ID's. + * For example, you get all the id's of the active groups in the groups table, you then iterate over them and spawn + * processes of misc/update_binaries.php passing the group id's. * * @package nzedb\libraries */ @@ -363,8 +363,8 @@ class Forking extends \fork_daemon ); $count = 0; - if ($data['Name']) { - $this->safeBackfillGroup = $data['Name']; + if ($data['name']) { + $this->safeBackfillGroup = $data['name']; $count = ($data['our_first'] - $data['their_first']); } @@ -378,7 +378,7 @@ class Forking extends \fork_daemon $queue = array(); for ($i = 0; $i <= $geteach - 1; $i++) { - $queue[$i] = sprintf("get_range backfill %s %s %s %s", $data['Name'], $data['our_first'] - $i * $run[0]['maxmsgs'] - $run[0]['maxmsgs'], $data['our_first'] - $i * $run[0]['maxmsgs'] - 1, $i + 1); + $queue[$i] = sprintf("get_range backfill %s %s %s %s", $data['name'], $data['our_first'] - $i * $run[0]['maxmsgs'] - $run[0]['maxmsgs'], $data['our_first'] - $i * $run[0]['maxmsgs'] - 1, $i + 1); } $this->work = $queue; } @@ -493,7 +493,7 @@ class Forking extends \fork_daemon $groupby = "GROUP BY guidchar"; $orderby = "ORDER BY guidchar ASC"; $rowLimit = "LIMIT 16"; - $extrawhere = "AND r.prehashID = 0 AND r.nzbstatus = 1"; + $extrawhere = "AND r.prehashid = 0 AND r.nzbstatus = 1"; $select = "DISTINCT LEFT(r.guid, 1) AS guidchar, COUNT(*) AS count"; @@ -505,7 +505,7 @@ class Forking extends \fork_daemon } switch($this->workTypeOptions[0]) { case "md5": - $join = "LEFT OUTER JOIN releasefiles rf ON r.ID = rf.releaseID AND rf.ishashed = 1"; + $join = "LEFT OUTER JOIN releasefiles rf ON r.id = rf.releaseid AND rf.ishashed = 1"; $where = "r.ishashed = 1 AND r.dehashstatus BETWEEN -6 AND 0"; break; @@ -514,7 +514,7 @@ class Forking extends \fork_daemon break; case "filename": - $join = "INNER JOIN releasefiles rf ON r.ID = rf.releaseID"; + $join = "INNER JOIN releasefiles rf ON r.id = rf.releaseid"; $where = "r.proc_files = 0"; break; @@ -578,12 +578,12 @@ class Forking extends \fork_daemon $this->tablePerGroup = ($this->site->tablepergroup == 1 ? true : false); if ($this->tablePerGroup === true) { - $groups = $this->pdo->queryDirect('SELECT ID FROM groups WHERE (active = 1 OR backfill = 1)'); + $groups = $this->pdo->queryDirect('SELECT id FROM groups WHERE (active = 1 OR backfill = 1)'); if ($groups instanceof \Traversable) { foreach($groups as $group) { - if ($this->pdo->queryOneRow(sprintf('SELECT ID FROM binaries_%d LIMIT 1',$group['ID'])) !== false) { - $this->work[] = ['ID' => $group['ID']]; + if ($this->pdo->queryOneRow(sprintf('SELECT id FROM binaries_%d LIMIT 1',$group['id'])) !== false) { + $this->work[] = ['id' => $group['id']]; } } } @@ -599,7 +599,7 @@ class Forking extends \fork_daemon foreach ($groups as $group) { if ($this->tablePerGroup === true) { $this->_executeCommand( - $this->dnr_path . 'releases ' . $group['ID'] . '"' + $this->dnr_path . 'releases ' . $group['id'] . '"' ); } else { $this->_executeCommand( @@ -635,7 +635,7 @@ class Forking extends \fork_daemon if ($type !== '') { $this->_executeCommand( - $this->dnr_path . $type . $group['ID'] . (isset($group['renamed']) ? (' ' . $group['renamed']) : '') . '"' + $this->dnr_path . $type . $group['id'] . (isset($group['renamed']) ? (' ' . $group['renamed']) : '') . '"' ); } } @@ -659,9 +659,9 @@ class Forking extends \fork_daemon return ( $this->pdo->queryOneRow( sprintf(' - SELECT r.ID + SELECT r.id FROM releases r - LEFT JOIN category c ON c.ID = r.categoryID + LEFT JOIN category c ON c.id = r.categoryid WHERE r.nzbstatus = %d AND r.passwordstatus BETWEEN -6 AND -1 AND r.haspreview = -1 @@ -684,9 +684,9 @@ class Forking extends \fork_daemon $this->register_child_run([0 => $this, 1 => 'postProcessChildWorker']); $this->work = $this->pdo->query( sprintf(' - SELECT LEFT(r.guid, 1) AS ID + SELECT LEFT(r.guid, 1) AS id FROM releases r - LEFT JOIN category c ON c.ID = r.categoryID + LEFT JOIN category c ON c.id = r.categoryid WHERE r.nzbstatus = %d AND r.passwordstatus BETWEEN -6 AND -1 AND r.haspreview = -1 @@ -717,7 +717,7 @@ class Forking extends \fork_daemon return ( $this->pdo->queryOneRow( sprintf( - 'SELECT r.ID FROM releases r WHERE 1=1 %s LIMIT 1', + 'SELECT r.id FROM releases r WHERE 1=1 %s LIMIT 1', $this->nfoQueryString ) ) === false ? false : true @@ -734,7 +734,7 @@ class Forking extends \fork_daemon $this->register_child_run([0 => $this, 1 => 'postProcessChildWorker']); $this->work = $this->pdo->query( sprintf(' - SELECT LEFT(r.guid, 1) AS ID + SELECT LEFT(r.guid, 1) AS id FROM releases r WHERE 1=1 %s GROUP BY LEFT(r.guid, 1) @@ -757,11 +757,11 @@ class Forking extends \fork_daemon return ( $this->pdo->queryOneRow( sprintf(' - SELECT ID + SELECT id FROM releases WHERE nzbstatus = %d - AND imdbID IS NULL - AND categoryID BETWEEN 2000 AND 2999 + AND imdbid IS NULL + AND categoryid BETWEEN 2000 AND 2999 %s %s LIMIT 1', \Enzebe::NZB_ADDED, @@ -782,11 +782,11 @@ class Forking extends \fork_daemon $this->register_child_run([0 => $this, 1 => 'postProcessChildWorker']); $this->work = $this->pdo->query( sprintf(' - SELECT LEFT(guid, 1) AS ID, %d AS renamed + SELECT LEFT(guid, 1) AS id, %d AS renamed FROM releases WHERE nzbstatus = %d - AND imdbID IS NULL - AND categoryID BETWEEN 2000 AND 2999 + AND imdbid IS NULL + AND categoryid BETWEEN 2000 AND 2999 %s %s GROUP BY LEFT(guid, 1) LIMIT 16', @@ -811,12 +811,12 @@ class Forking extends \fork_daemon return ( $this->pdo->queryOneRow( sprintf(' - SELECT ID + SELECT id FROM releases WHERE nzbstatus = %d AND size > 1048576 - AND rageID = -1 - AND categoryID BETWEEN 5000 AND 5999 + AND rageid = -1 + AND categoryid BETWEEN 5000 AND 5999 %s %s LIMIT 1', \Enzebe::NZB_ADDED, @@ -837,12 +837,12 @@ class Forking extends \fork_daemon $this->register_child_run([0 => $this, 1 => 'postProcessChildWorker']); $this->work = $this->pdo->query( sprintf(' - SELECT LEFT(guid, 1) AS ID, %d AS renamed + SELECT LEFT(guid, 1) AS id, %d AS renamed FROM releases WHERE nzbstatus = %d - AND rageID = -1 + AND rageid = -1 AND size > 1048576 - AND categoryID BETWEEN 5000 AND 5999 + AND categoryid BETWEEN 5000 AND 5999 %s %s GROUP BY LEFT(guid, 1) LIMIT 16', @@ -893,7 +893,7 @@ class Forking extends \fork_daemon } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////// All requestID code goes here //////////////////////////////////////////////// + ////////////////////////////////////// All requestid code goes here //////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private function requestIDMainMethod() @@ -901,12 +901,12 @@ class Forking extends \fork_daemon $this->register_child_run([0 => $this, 1 => 'requestIDChildWorker']); $this->work = $this->pdo->query( sprintf(' - SELECT DISTINCT(g.ID) + SELECT DISTINCT(g.id) FROM groups g - INNER JOIN releases r ON r.groupID = g.ID + INNER JOIN releases r ON r.groupid = g.id WHERE g.active = 1 AND r.nzbstatus = %d - AND r.prehashID = 0 + AND r.prehashid = 0 AND r.isrequestid = 1 AND r.reqidstatus = %d', \Enzebe::NZB_ADDED, @@ -920,7 +920,7 @@ class Forking extends \fork_daemon { foreach ($groups as $group) { $this->_executeCommand( - $this->dnr_path . 'requestid ' . $group['ID'] . '"' + $this->dnr_path . 'requestid ' . $group['id'] . '"' ); } } @@ -932,7 +932,7 @@ class Forking extends \fork_daemon private function updatePerGroupMainMethod() { $this->register_child_run([0 => $this, 1 => 'updatePerGroupChildWorker']); - $this->work = $this->pdo->query('SELECT ID FROM groups WHERE (active = 1 OR backfill = 1)'); + $this->work = $this->pdo->query('SELECT id FROM groups WHERE (active = 1 OR backfill = 1)'); return $this->site->releasethreads; } @@ -940,7 +940,7 @@ class Forking extends \fork_daemon { foreach ($groups as $group) { $this->_executeCommand( - $this->dnr_path . 'update_per_group ' . $group['ID'] . '"' + $this->dnr_path . 'update_per_group ' . $group['id'] . '"' ); } } @@ -1020,7 +1020,7 @@ class Forking extends \fork_daemon if (NN_ECHOCLI) { $this->_colorCLI->doEcho( $this->_colorCLI->header( - 'Process ID #' . $pid . ' has completed.' . PHP_EOL . + 'Process id #' . $pid . ' has completed.' . PHP_EOL . 'There are ' . ($this->forked_children_count - 1) . ' process(es) still active with ' . (--$this->_workCount) . ' job(s) left in the queue.' . PHP_EOL ) diff --git a/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/README.md b/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/README.md index 0e4c98e30..54d031838 100644 --- a/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/README.md +++ b/lib/copy_this/misc/update_scripts/nix_scripts/multiprocessing/README.md @@ -8,12 +8,12 @@ You can pass a argument, a number to limit the max amount of new headers to down ####releases.php This is identical to the python releases_threaded.py -This will create new releases/delete unwanted releases, process requestID's, categorize releases by group +This will create new releases/delete unwanted releases, process requestid's, categorize releases by group using your release threads site setting. ####update_per_group.php: This is identical to the python update_threaded.py This will download new headers for all active groups, backfill 20k headers from all backfill enabled groups, -create new releases/delete unwanted releases, process requestID's, categorize releases, process additional and NFO +create new releases/delete unwanted releases, process requestid's, categorize releases, process additional and NFO by group using your release threads site setting. \ No newline at end of file diff --git a/lib/copy_this/www/admin/ajax_sharing_settings.php b/lib/copy_this/www/admin/ajax_sharing_settings.php index dad41f941..905b20107 100644 --- a/lib/copy_this/www/admin/ajax_sharing_settings.php +++ b/lib/copy_this/www/admin/ajax_sharing_settings.php @@ -9,7 +9,7 @@ $admin = new AdminPage; $db = new DB(); if (isset($_GET['site_ID']) && isset($_GET['site_status'])) { - $db->queryExec(sprintf('UPDATE sharing_sites SET enabled = %d WHERE ID = %d', $_GET['site_status'], $_GET['site_ID'])); + $db->queryExec(sprintf('UPDATE sharing_sites SET enabled = %d WHERE id = %d', $_GET['site_status'], $_GET['site_ID'])); if ($_GET['site_status'] == 1) { print 'Activated site ' . $_GET['site_ID']; } else { @@ -83,19 +83,19 @@ else if (isset($_GET['reset_settings'])) { } else if (isset($_GET['purge_site'])) { - $guid = $db->queryOneRow(sprintf('SELECT site_guid FROM sharing_sites WHERE ID = %d', $_GET['purge_site'])); + $guid = $db->queryOneRow(sprintf('SELECT site_guid FROM sharing_sites WHERE id = %d', $_GET['purge_site'])); if ($guid === false) { print 'Error purging site ' . $_GET['purge_site'] . '!'; } else { - $ids = $db->query(sprintf('SELECT ID FROM releasecomment WHERE siteID = %s', $db->escapeString($guid['site_guid']))); + $ids = $db->query(sprintf('SELECT id FROM releasecomment WHERE siteID = %s', $db->escapeString($guid['site_guid']))); $total = count($ids); if ($total > 0) { $rc = new ReleaseComments(); foreach ($ids as $id) { - $rc->deleteComment($id['ID']); + $rc->deleteComment($id['id']); } } - $db->queryExec(sprintf('UPDATE sharing_sites SET comments = 0 WHERE ID = %d', $_GET['purge_site'])); + $db->queryExec(sprintf('UPDATE sharing_sites SET comments = 0 WHERE id = %d', $_GET['purge_site'])); print 'Deleted ' . $total . ' comments for site ' . $_GET['purge_site']; } } \ No newline at end of file diff --git a/lib/copy_this/www/admin/sharing.php b/lib/copy_this/www/admin/sharing.php index 462485ddd..7dee3a966 100644 --- a/lib/copy_this/www/admin/sharing.php +++ b/lib/copy_this/www/admin/sharing.php @@ -10,7 +10,7 @@ $db = new DB(); $offset = (isset($_GET['offset']) ? $_GET['offset'] : 0); -$allSites = $db->query(sprintf('SELECT * FROM sharing_sites ORDER BY ID LIMIT %d OFFSET %d', 25, $offset)); +$allSites = $db->query(sprintf('SELECT * FROM sharing_sites ORDER BY id LIMIT %d OFFSET %d', 25, $offset)); if (count($allSites) === 0) { $allSites = false; } diff --git a/lib/copy_this/www/admin/site-edit.php b/lib/copy_this/www/admin/site-edit.php index 2f337b253..90913a8c1 100644 --- a/lib/copy_this/www/admin/site-edit.php +++ b/lib/copy_this/www/admin/site-edit.php @@ -47,7 +47,7 @@ switch($action) { $site = $ret; $returnid = $site->id; - header("Location:".WWW_TOP."/site-edit.php?ID=".$returnid); + header("Location:".WWW_TOP."/site-edit.php?id=".$returnid); } else { @@ -122,14 +122,14 @@ $page->smarty->assign('lookup_reqids_ids', array(0,1,2)); $page->smarty->assign('lookup_reqids_names', array('Disabled', 'Lookup Request IDs', 'Lookup Request IDs Threaded')); // return a list of audiobooks, ebooks, technical and foreign books -$result = $page->settings->query("SELECT ID, title FROM category WHERE ID in (3030, 7010, 7040, 7060)"); +$result = $page->settings->query("SELECT id, title FROM category WHERE id in (3030, 7010, 7040, 7060)"); // setup the display lists for these categories, this could have been static, but then if names changed they would be wrong $book_reqids_ids = array(); $book_reqids_names = array(); foreach ($result as $bookcategory) { - $book_reqids_ids[] = $bookcategory["ID"]; + $book_reqids_ids[] = $bookcategory["id"]; $book_reqids_names[] = $bookcategory["title"]; } diff --git a/lib/copy_this/www/admin/user-edit.php b/lib/copy_this/www/admin/user-edit.php index d90afbd00..cd150367b 100644 --- a/lib/copy_this/www/admin/user-edit.php +++ b/lib/copy_this/www/admin/user-edit.php @@ -17,9 +17,9 @@ $roles = array(); $defaultrole = Users::ROLE_USER; $defaultinvites = Users::DEFAULT_INVITES; foreach ($userroles as $r) { - $roles[$r['ID']] = $r['name']; + $roles[$r['id']] = $r['name']; if ($r['isdefault'] == 1) { - $defaultrole = $r['ID']; + $defaultrole = $r['id']; $defaultinvites = $r['defaultinvites']; } } @@ -43,7 +43,7 @@ switch ($action) { if ($_POST["id"] == "") { $invites = $defaultinvites; foreach ($userroles as $role) { - if ($role['ID'] == $_POST['role']) + if ($role['id'] == $_POST['role']) $invites = $role['defaultinvites']; } $ret = $users->signup($_POST["username"], $_POST["password"], $_POST["email"], '', $_POST["role"], $_POST["notes"], $invites, "", true, false, false, true); @@ -77,7 +77,7 @@ switch ($action) { break; } $user = array(); - $user["ID"] = $_POST["id"]; + $user["id"] = $_POST["id"]; $user["username"] = $_POST["username"]; $user["email"] = $_POST["email"]; $user["grabs"] = (isset($_POST["grabs"]) ? $_POST["grabs"] : "0"); diff --git a/lib/copy_this/www/lib/Books.php b/lib/copy_this/www/lib/Books.php index 2dc141c7f..63890280c 100644 --- a/lib/copy_this/www/lib/Books.php +++ b/lib/copy_this/www/lib/Books.php @@ -93,7 +93,7 @@ class Books public function getBookInfo($id) { - return $this->pdo->queryOneRow(sprintf('SELECT bookinfo.* FROM bookinfo WHERE bookinfo.ID = %d', $id)); + return $this->pdo->queryOneRow(sprintf('SELECT bookinfo.* FROM bookinfo WHERE bookinfo.id = %d', $id)); } public function getBookInfoByName($author, $title) @@ -143,7 +143,7 @@ class Books public function getCount() { - $res = $this->pdo->queryOneRow('SELECT COUNT(ID) AS num FROM bookinfo'); + $res = $this->pdo->queryOneRow('SELECT COUNT(id) AS num FROM bookinfo'); return $res['num']; } @@ -166,13 +166,13 @@ class Books $exccatlist = ''; if (count($excludedcats) > 0) { - $exccatlist = ' AND r.categoryID NOT IN (' . implode(',', $excludedcats) . ')'; + $exccatlist = ' AND r.categoryid NOT IN (' . implode(',', $excludedcats) . ')'; } $res = $this->pdo->queryOneRow( sprintf( - "SELECT COUNT(DISTINCT r.bookinfoID) AS num FROM releases r " - . "INNER JOIN bookinfo boo ON boo.ID = r.bookinfoID AND boo.title != '' and boo.cover = 1 " + "SELECT COUNT(DISTINCT r.bookinfoid) AS num FROM releases r " + . "INNER JOIN bookinfo boo ON boo.id = r.bookinfoid AND boo.title != '' and boo.cover = 1 " . "WHERE r.nzbstatus = 1 AND r.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') " . "AND %s %s %s %s", $browseby, $catsrch, $maxage, $exccatlist ) @@ -203,17 +203,17 @@ class Books $exccatlist = ''; if (count($excludedcats) > 0) { - $exccatlist = ' AND r.categoryID NOT IN (' . implode(',', $excludedcats) . ')'; + $exccatlist = ' AND r.categoryid NOT IN (' . implode(',', $excludedcats) . ')'; } $order = $this->getBookOrder($orderby); $sql = sprintf( - "SELECT GROUP_CONCAT(r.ID ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, " + "SELECT GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, " . "GROUP_CONCAT(r.rarinnerfilecount ORDER BY r.postdate DESC SEPARATOR ',') as grp_rarinnerfilecount, " . "GROUP_CONCAT(r.haspreview ORDER BY r.postdate DESC SEPARATOR ',') AS grp_haspreview, " . "GROUP_CONCAT(r.passwordstatus ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_password, " . "GROUP_CONCAT(r.guid ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_guid, " - . "GROUP_CONCAT(rn.ID ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, " + . "GROUP_CONCAT(rn.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, " . "GROUP_CONCAT(groups.name ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grpname, " . "GROUP_CONCAT(r.searchname ORDER BY r.postdate DESC SEPARATOR '#') AS grp_release_name, " . "GROUP_CONCAT(r.postdate ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_postdate, " @@ -221,13 +221,13 @@ class Books . "GROUP_CONCAT(r.totalpart ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_totalparts, " . "GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments, " . "GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, " - . "boo.*, r.bookinfoID, groups.name AS group_name, rn.ID as nfoid FROM releases r " - . "LEFT OUTER JOIN groups ON groups.ID = r.groupID " - . "LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.ID " - . "INNER JOIN bookinfo boo ON boo.ID = r.bookinfoID " + . "boo.*, r.bookinfoid, groups.name AS group_name, rn.id as nfoid FROM releases r " + . "LEFT OUTER JOIN groups ON groups.id = r.groupid " + . "LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id " + . "INNER JOIN bookinfo boo ON boo.id = r.bookinfoid " . "WHERE r.nzbstatus = 1 AND boo.cover = 1 AND boo.title != '' AND " . "r.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') AND %s %s %s %s " - . "GROUP BY boo.ID ORDER BY %s %s" . $limit, $browseby, $catsrch, $maxage, $exccatlist, $order[0], $order[1] + . "GROUP BY boo.id ORDER BY %s %s" . $limit, $browseby, $catsrch, $maxage, $exccatlist, $order[0], $order[1] ); return $this->pdo->queryDirect($sql); @@ -334,11 +334,11 @@ class Books $this->processBookReleasesHelper( $this->pdo->queryDirect( sprintf(' - SELECT searchname, ID, categoryID + SELECT searchname, id, categoryid FROM releases WHERE nzbstatus = 1 %s - AND bookinfoID IS NULL - AND categoryID in (%s) + AND bookinfoid IS NULL + AND categoryid in (%s) ORDER BY postdate DESC LIMIT %d', $this->renamed, $bookids[$i], $this->bookqty) ), $bookids[$i] @@ -358,19 +358,19 @@ class Books { if ($res instanceof \Traversable && $res->rowCount() > 0) { if ($this->echooutput) { - $this->pdo->log->doEcho($this->pdo->log->header("\nProcessing " . $res->rowCount() . ' book release(s) for category ID ' . $categoryID)); + $this->pdo->log->doEcho($this->pdo->log->header("\nProcessing " . $res->rowCount() . ' book release(s) for category id ' . $categoryID)); } foreach ($res as $arr) { $startTime = microtime(true); $usedAmazon = false; // audiobooks are also books and should be handled in an identical manor, even though it falls under a music category - if ($arr['categoryID'] == '3030') { + if ($arr['categoryid'] == '3030') { // audiobook - $bookInfo = $this->parseTitle($arr['searchname'], $arr['ID'], 'audiobook'); + $bookInfo = $this->parseTitle($arr['searchname'], $arr['id'], 'audiobook'); } else { // ebook - $bookInfo = $this->parseTitle($arr['searchname'], $arr['ID'], 'ebook'); + $bookInfo = $this->parseTitle($arr['searchname'], $arr['id'], 'ebook'); } if ($bookInfo !== false) { @@ -388,13 +388,13 @@ class Books $bookId = -2; } } else { - $bookId = $bookCheck['ID']; + $bookId = $bookCheck['id']; } // Update release. - $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfoID = %d WHERE ID = %d', $bookId, $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfoid = %d WHERE id = %d', $bookId, $arr['id'])); } else { // Could not parse release title. - $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfoID = %d WHERE ID = %d', -2, $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfoid = %d WHERE id = %d', -2, $arr['id'])); if ($this->echooutput) { echo '.'; } @@ -431,7 +431,7 @@ class Books $this->pdo->log->headerOver('Changing category to misc books: ') . $this->pdo->log->primary($releasename) ); } - $this->pdo->queryExec(sprintf('UPDATE releases SET categoryID = %d WHERE ID = %d', 7050, $releaseID)); + $this->pdo->queryExec(sprintf('UPDATE releases SET categoryid = %d WHERE id = %d', 7050, $releaseID)); return false; } else if (preg_match('/^([a-z0-9ü!]+ ){1,2}(N|Vol)?\d{1,4}(a|b|c)?$|^([a-z0-9]+ ){1,2}(Jan( |unar|$)|Feb( |ruary|$)|Mar( |ch|$)|Apr( |il|$)|May(?![a-z0-9])|Jun( |e|$)|Jul( |y|$)|Aug( |ust|$)|Sep( |tember|$)|O(c|k)t( |ober|$)|Nov( |ember|$)|De(c|z)( |ember|$))/i', $releasename) && !preg_match('/Part \d+/i', $releasename)) { @@ -440,7 +440,7 @@ class Books $this->pdo->log->headerOver('Changing category to magazines: ') . $this->pdo->log->primary($releasename) ); } - $this->pdo->queryExec(sprintf('UPDATE releases SET categoryID = %d WHERE ID = %d', 7030, $releaseID)); + $this->pdo->queryExec(sprintf('UPDATE releases SET categoryid = %d WHERE id = %d', 7030, $releaseID)); return false; } else if (!empty($releasename) && !preg_match('/^[a-z0-9]+$|^([0-9]+ ){1,}$|Part \d+/i', $releasename)) { return $releasename; @@ -535,7 +535,7 @@ class Books $book['cover'] = 0; } - $check = $this->pdo->queryOneRow(sprintf('SELECT ID FROM bookinfo WHERE asin = %s', $this->pdo->escapeString($book['asin']))); + $check = $this->pdo->queryOneRow(sprintf('SELECT id FROM bookinfo WHERE asin = %s', $this->pdo->escapeString($book['asin']))); if ($check === false) { $bookId = $this->pdo->queryInsert( sprintf(" @@ -553,13 +553,13 @@ class Books ) ); } else { - $bookId = $check['ID']; + $bookId = $check['id']; $this->pdo->queryExec( sprintf(' UPDATE bookinfo SET title = %s, author = %s, asin = %s, isbn = %s, ean = %s, url = %s, salesrank = %s, publisher = %s, publishdate = %s, pages = %s, overview = %s, genre = %s, cover = %d, updateddate = NOW() - WHERE ID = %d', + WHERE id = %d', $this->pdo->escapeString($book['title']), $this->pdo->escapeString($book['author']), $this->pdo->escapeString($book['asin']), $this->pdo->escapeString($book['isbn']), $this->pdo->escapeString($book['ean']), $this->pdo->escapeString($book['url']), diff --git a/lib/copy_this/www/lib/Categorize.php b/lib/copy_this/www/lib/Categorize.php index a5b6d133c..872b41802 100644 --- a/lib/copy_this/www/lib/Categorize.php +++ b/lib/copy_this/www/lib/Categorize.php @@ -32,7 +32,7 @@ class Categorize extends Category public $releaseName; /** - * Group ID of the releasename we are sorting through. + * Group id of the releasename we are sorting through. * @var int|string */ public $groupID; @@ -58,9 +58,9 @@ class Categorize extends Category * Returns Category::CAT_MISC_OTHER if no category is appropriate. * * @param string $releaseName The name to parse. - * @param int|string $groupID The groupID. + * @param int|string $groupID The groupid. * - * @return int The categoryID. + * @return int The categoryid. */ public function determineCategory($groupID, $releaseName = '') { @@ -92,7 +92,7 @@ class Categorize extends Category */ public function byGroup() { - $group = $this->pdo->queryOneRow(sprintf('SELECT LOWER(name) AS name FROM groups WHERE ID = %d', $this->groupID)); + $group = $this->pdo->queryOneRow(sprintf('SELECT LOWER(name) AS name FROM groups WHERE id = %d', $this->groupID)); if ($group !== false) { $group = $group['name']; switch (true) { diff --git a/lib/copy_this/www/lib/Games.php b/lib/copy_this/www/lib/Games.php index d6cc29a8c..789783fbb 100644 --- a/lib/copy_this/www/lib/Games.php +++ b/lib/copy_this/www/lib/Games.php @@ -15,11 +15,11 @@ require_once(WWW_DIR . "/lib/ColorCLI.php"); class Games { - const REQID_FOUND = 1; // Request ID found and release was updated. - const REQID_NO_LOCAL = -1; // Request ID was not found via local lookup. - const REQID_NONE = -3; // The Request ID was not found locally or via web lookup. + const REQID_FOUND = 1; // Request id found and release was updated. + const REQID_NO_LOCAL = -1; // Request id was not found via local lookup. + const REQID_NONE = -3; // The Request id was not found locally or via web lookup. const REQID_UNPROCESSED = 0; // Release has not been processed. - const REQID_ZERO = -2; // The Request ID was 0. + const REQID_ZERO = -2; // The Request id was 0. /** * @var string @@ -134,7 +134,7 @@ class Games sprintf(" SELECT gamesinfo.*, genres.title AS genres FROM gamesinfo - LEFT OUTER JOIN genres ON genres.ID = gamesinfo.genre_id + LEFT OUTER JOIN genres ON genres.id = gamesinfo.genre_id WHERE gamesinfo.id = %d", $id ) @@ -157,7 +157,7 @@ class Games { return $this->pdo->query( sprintf( - "SELECT gi.*, g.title AS genretitle FROM gamesinfo gi INNER JOIN genres g ON gi.genre_id = g.ID ORDER BY createddate DESC %s", + "SELECT gi.*, g.title AS genretitle FROM gamesinfo gi INNER JOIN genres g ON gi.genre_id = g.id ORDER BY createddate DESC %s", ($start === false ? '' : 'LIMIT ' . $num . ' OFFSET ' . $start) ) ); @@ -189,7 +189,7 @@ class Games $this->getBrowseBy(), $catsrch, ($maxage > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxage) : ''), - (count($excludedcats) > 0 ? " AND r.categoryID NOT IN (" . implode(",", $excludedcats) . ")" : '') + (count($excludedcats) > 0 ? " AND r.categoryid NOT IN (" . implode(",", $excludedcats) . ")" : '') ) ); @@ -219,19 +219,19 @@ class Games $exccatlist = ""; if (count($excludedcats) > 0) { - $exccatlist = " AND r.categoryID NOT IN (" . implode(",", $excludedcats) . ")"; + $exccatlist = " AND r.categoryid NOT IN (" . implode(",", $excludedcats) . ")"; } $order = $this->getGamesOrder($orderby); return $this->pdo->query( sprintf( - "SELECT GROUP_CONCAT(r.ID ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, " + "SELECT GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, " . "GROUP_CONCAT(r.rarinnerfilecount ORDER BY r.postdate DESC SEPARATOR ',') as grp_rarinnerfilecount, " . "GROUP_CONCAT(r.haspreview ORDER BY r.postdate DESC SEPARATOR ',') AS grp_haspreview, " . "GROUP_CONCAT(r.passwordstatus ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_password, " . "GROUP_CONCAT(r.guid ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_guid, " - . "GROUP_CONCAT(rn.ID ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, " + . "GROUP_CONCAT(rn.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, " . "GROUP_CONCAT(groups.name ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grpname, " . "GROUP_CONCAT(r.searchname ORDER BY r.postdate DESC SEPARATOR '#') AS grp_release_name, " . "GROUP_CONCAT(r.postdate ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_postdate, " @@ -240,9 +240,9 @@ class Games . "GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments, " . "GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, " . "con.*, YEAR (con.releasedate) as year, r.gamesinfo_id, groups.name AS group_name, - rn.ID as nfoid FROM releases r " - . "LEFT OUTER JOIN groups ON groups.ID = r.groupID " - . "LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.ID " + rn.id as nfoid FROM releases r " + . "LEFT OUTER JOIN groups ON groups.id = r.groupid " + . "LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id " . "INNER JOIN gamesinfo con ON con.id = r.gamesinfo_id " . "WHERE r.nzbstatus = 1 AND con.title != '' AND " . "r.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') AND %s %s %s %s " @@ -600,7 +600,7 @@ class Games $defaultGenres = $gen->getGenres(\Genres::GAME_TYPE); $genreassoc = array(); foreach ($defaultGenres as $dg) { - $genreassoc[$dg['ID']] = strtolower($dg['title']); + $genreassoc[$dg['id']] = strtolower($dg['title']); } // Prepare database values. @@ -733,7 +733,7 @@ class Games } /** - * Get Giantbomb ID from title + * Get Giantbomb id from title * * @param string $title * @@ -811,11 +811,11 @@ class Games { $res = $this->pdo->queryDirect( sprintf(' - SELECT searchname, ID + SELECT searchname, id FROM releases WHERE nzbstatus = 1 %s AND gamesinfo_id = 0 - AND categoryID = 4050 + AND categoryid = 4050 ORDER BY postdate DESC LIMIT %d', $this->renamed, @@ -863,10 +863,10 @@ class Games $gameId = $gameCheck['id']; } // Update release. - $this->pdo->queryExec(sprintf('UPDATE releases SET gamesinfo_id = %d WHERE ID = %d', $gameId, $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET gamesinfo_id = %d WHERE id = %d', $gameId, $arr['id'])); } else { // Could not parse release title. - $this->pdo->queryExec(sprintf('UPDATE releases SET gamesinfo_id = %d WHERE ID = %d', -2, $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET gamesinfo_id = %d WHERE id = %d', -2, $arr['id'])); if ($this->echoOutput) { echo '.'; diff --git a/lib/copy_this/www/lib/GiantBombAPI.php b/lib/copy_this/www/lib/GiantBombAPI.php index 96ba3d650..9f01a8876 100644 --- a/lib/copy_this/www/lib/GiantBombAPI.php +++ b/lib/copy_this/www/lib/GiantBombAPI.php @@ -158,7 +158,7 @@ class GiantBomb * Get information about given object type * * @param string $type - * @param string $id string ID to request + * @param string $id string id to request * @param array $field_list array list of fields to response * * @return array response @@ -184,7 +184,7 @@ class GiantBomb * @param $filter array filter by given values - no "," accepted * @param $limit integer limit result count by given limit * @param $offset integer offset of results - * @param $platform integer ID of platform to limit + * @param $platform integer id of platform to limit * @param $sort array list of keys to sort, format key => asc/desc, * @param $field_list array list of field to result * @@ -209,7 +209,7 @@ class GiantBomb /** * Get information about a game * - * @param $id string ID to request + * @param $id string id to request * @param $field_list array list of fields to response * * @return array response @@ -225,7 +225,7 @@ class GiantBomb * @param $filter array filter by given values - no "," accepted * @param $limit integer limit result count by given limit * @param $offset integer offset of results - * @param $platform integer ID of platform to limit + * @param $platform integer id of platform to limit * @param $sort array list of keys to sort, format key => asc/desc, * @param $field_list array list of field to result * @@ -240,7 +240,7 @@ class GiantBomb /** * Get review by id * - * @param $review_id string ID to request + * @param $review_id string id to request * @param $field_list array list of fields to response * * @return array response @@ -253,7 +253,7 @@ class GiantBomb /** * Get game_rating by id * - * @param $rating_id string ID to request + * @param $rating_id string id to request * @param $field_list array list of fields to response * * @return array response @@ -266,7 +266,7 @@ class GiantBomb /** * Get company by id * - * @param $company_id string ID to request + * @param $company_id string id to request * @param $field_list array list of fields to response * * @return array response @@ -279,7 +279,7 @@ class GiantBomb /** * Get character by id * - * @param $character_id string ID to request + * @param $character_id string id to request * @param $field_list array list of fields to response * * @return array response diff --git a/lib/copy_this/www/lib/Logger.php b/lib/copy_this/www/lib/Logger.php index 4ab77eef8..b12fe39ac 100644 --- a/lib/copy_this/www/lib/Logger.php +++ b/lib/copy_this/www/lib/Logger.php @@ -656,7 +656,7 @@ class Logger // Resource usage (user time, system time, major page faults, memory swaps). (($this->showResourceUsage && !$this->isWindows) ? ' [' . $this->getResUsage() . ']' : '') . - // Running process ID. + // Running process id. ($pid ? ' [PID:' . $pid . ']' : '') . // The class/function. diff --git a/lib/copy_this/www/lib/Musik.php b/lib/copy_this/www/lib/Musik.php index 008b6ef5f..ad6c515fe 100644 --- a/lib/copy_this/www/lib/Musik.php +++ b/lib/copy_this/www/lib/Musik.php @@ -92,7 +92,7 @@ class Musik */ public function getMusicInfo($id) { - return $this->pdo->queryOneRow(sprintf("SELECT musicinfo.*, genres.title AS genres FROM musicinfo LEFT OUTER JOIN genres ON genres.ID = musicinfo.genreID WHERE musicinfo.ID = %d ", $id)); + return $this->pdo->queryOneRow(sprintf("SELECT musicinfo.*, genres.title AS genres FROM musicinfo LEFT OUTER JOIN genres ON genres.id = musicinfo.genreID WHERE musicinfo.id = %d ", $id)); } /** @@ -160,7 +160,7 @@ class Musik public function getCount() { - $res = $this->pdo->queryOneRow("SELECT COUNT(ID) AS num FROM musicinfo"); + $res = $this->pdo->queryOneRow("SELECT COUNT(id) AS num FROM musicinfo"); return $res["num"]; } @@ -190,10 +190,10 @@ class Musik $exccatlist = ""; if (count($excludedcats) > 0) { - $exccatlist = " AND r.categoryID NOT IN (" . implode(",", $excludedcats) . ")"; + $exccatlist = " AND r.categoryid NOT IN (" . implode(",", $excludedcats) . ")"; } - $sql = sprintf("SELECT COUNT(DISTINCT r.musicinfoID) AS num FROM releases r INNER JOIN musicinfo m ON m.ID = r.musicinfoID AND m.title != '' AND m.cover = 1 WHERE nzbstatus = 1 AND r.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') AND %s %s %s %s", $browseby, $catsrch, $maxage, $exccatlist); + $sql = sprintf("SELECT COUNT(DISTINCT r.musicinfoid) AS num FROM releases r INNER JOIN musicinfo m ON m.id = r.musicinfoid AND m.title != '' AND m.cover = 1 WHERE nzbstatus = 1 AND r.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') AND %s %s %s %s", $browseby, $catsrch, $maxage, $exccatlist); $res = $this->pdo->queryOneRow($sql); return $res["num"]; } @@ -226,16 +226,16 @@ class Musik $exccatlist = ""; if (count($excludedcats) > 0) { - $exccatlist = " AND r.categoryID NOT IN (" . implode(",", $excludedcats) . ")"; + $exccatlist = " AND r.categoryid NOT IN (" . implode(",", $excludedcats) . ")"; } $order = $this->getMusicOrder($orderby); - return $this->pdo->query(sprintf("SELECT GROUP_CONCAT(r.ID ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, " + return $this->pdo->query(sprintf("SELECT GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, " . "GROUP_CONCAT(r.rarinnerfilecount ORDER BY r.postdate DESC SEPARATOR ',') as grp_rarinnerfilecount, " . "GROUP_CONCAT(r.haspreview ORDER BY r.postdate DESC SEPARATOR ',') AS grp_haspreview, " . "GROUP_CONCAT(r.passwordstatus ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_password, " . "GROUP_CONCAT(r.guid ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_guid, " - . "GROUP_CONCAT(rn.ID ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, " + . "GROUP_CONCAT(rn.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, " . "GROUP_CONCAT(groups.name ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grpname, " . "GROUP_CONCAT(r.searchname ORDER BY r.postdate DESC SEPARATOR '#') AS grp_release_name, " . "GROUP_CONCAT(r.postdate ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_postdate, " @@ -243,13 +243,13 @@ class Musik . "GROUP_CONCAT(r.totalpart ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_totalparts, " . "GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments, " . "GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, " - . "m.*, r.musicinfoID, groups.name AS group_name, rn.ID as nfoid FROM releases r " - . "LEFT OUTER JOIN groups ON groups.ID = r.groupID " - . "LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID " - . "INNER JOIN musicinfo m ON m.ID = r.musicinfoID " + . "m.*, r.musicinfoid, groups.name AS group_name, rn.id as nfoid FROM releases r " + . "LEFT OUTER JOIN groups ON groups.id = r.groupid " + . "LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id " + . "INNER JOIN musicinfo m ON m.id = r.musicinfoid " . "WHERE r.nzbstatus = 1 AND m.title != '' AND " . "r.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') AND %s %s %s " - . "GROUP BY m.ID ORDER BY %s %s" . $limit, $browseby, $catsrch, $exccatlist, $order[0], $order[1])); + . "GROUP BY m.id ORDER BY %s %s" . $limit, $browseby, $catsrch, $exccatlist, $order[0], $order[1])); } /** @@ -367,7 +367,7 @@ class Musik UPDATE musicinfo SET title = %s, asin = %s, url = %s, salesrank = %s, artist = %s, publisher = %s, releasedate = %s, year = %s, tracks = %s, cover = %d, genreID = %d, updateddate = NOW() - WHERE ID = %d", + WHERE id = %d", $this->pdo->escapeString($title), $this->pdo->escapeString($asin), $this->pdo->escapeString($url), $salesrank, $this->pdo->escapeString($artist), $this->pdo->escapeString($publisher), $this->pdo->escapeString($releasedate), @@ -415,7 +415,7 @@ class Musik $defaultGenres = $gen->getGenres(\Genres::MUSIC_TYPE); $genreassoc = array(); foreach ($defaultGenres as $dg) { - $genreassoc[$dg['ID']] = strtolower($dg['title']); + $genreassoc[$dg['id']] = strtolower($dg['title']); } // Get album properties. @@ -518,7 +518,7 @@ class Musik $musicId = $check['id']; $this->pdo->queryExec(sprintf('UPDATE musicinfo SET title = %s, asin = %s, url = %s, salesrank = %s, artist = %s, ' . 'publisher = %s, releasedate = %s, review = %s, year = %s, genreID = %s, tracks = %s, cover = %s, ' - . 'updateddate = NOW() WHERE ID = %d', $this->pdo->escapeString($mus['title']), $this->pdo->escapeString($mus['asin']), $this->pdo->escapeString($mus['url']), $mus['salesrank'], $this->pdo->escapeString($mus['artist']), $this->pdo->escapeString($mus['publisher']), $mus['releasedate'], $this->pdo->escapeString($mus['review']), $this->pdo->escapeString($mus['year']), ($mus['musicgenreid'] == -1 ? "null" : $mus['musicgenreid']), $this->pdo->escapeString($mus['tracks']), $mus['cover'], $musicId)); + . 'updateddate = NOW() WHERE id = %d', $this->pdo->escapeString($mus['title']), $this->pdo->escapeString($mus['asin']), $this->pdo->escapeString($mus['url']), $mus['salesrank'], $this->pdo->escapeString($mus['artist']), $this->pdo->escapeString($mus['publisher']), $mus['releasedate'], $this->pdo->escapeString($mus['review']), $this->pdo->escapeString($mus['year']), ($mus['musicgenreid'] == -1 ? "null" : $mus['musicgenreid']), $this->pdo->escapeString($mus['tracks']), $mus['cover'], $musicId)); } if ($musicId) { @@ -611,8 +611,8 @@ class Musik */ public function processMusicReleases($local = false) { - $res = $this->pdo->queryDirect(sprintf('SELECT searchname, ID FROM releases ' - . 'WHERE musicinfoID IS NULL AND nzbstatus = 1 %s AND categoryID IN (3010, 3040, 3050) ' + $res = $this->pdo->queryDirect(sprintf('SELECT searchname, id FROM releases ' + . 'WHERE musicinfoid IS NULL AND nzbstatus = 1 %s AND categoryid IN (3010, 3040, 3050) ' . 'ORDER BY postdate DESC LIMIT %d', $this->renamed, $this->musicqty)); if ($res instanceof \Traversable && $res->rowCount() > 0) { if ($this->echooutput) { @@ -643,14 +643,14 @@ class Musik $albumId = -2; } } else { - $albumId = $musicCheck['ID']; + $albumId = $musicCheck['id']; } // Update release. - $this->pdo->queryExec(sprintf("UPDATE releases SET musicinfoID = %d WHERE ID = %d", $albumId, $arr["ID"])); + $this->pdo->queryExec(sprintf("UPDATE releases SET musicinfoid = %d WHERE id = %d", $albumId, $arr["id"])); } // No album found. else { - $this->pdo->queryExec(sprintf("UPDATE releases SET musicinfoID = %d WHERE ID = %d", -2, $arr["ID"])); + $this->pdo->queryExec(sprintf("UPDATE releases SET musicinfoid = %d WHERE id = %d", -2, $arr["id"])); echo '.'; } @@ -712,7 +712,7 @@ class Musik public function getGenres($activeOnly = false) { if ($activeOnly) { - return $this->pdo->query("SELECT musicgenre.* FROM musicgenre INNER JOIN (SELECT DISTINCT musicgenreid FROM musicinfo) x ON x.musicgenreID = musicgenre.ID ORDER BY title"); + return $this->pdo->query("SELECT musicgenre.* FROM musicgenre INNER JOIN (SELECT DISTINCT musicgenreid FROM musicinfo) x ON x.musicgenreID = musicgenre.id ORDER BY title"); } else { return $this->pdo->query("SELECT * FROM musicgenre ORDER BY title"); } diff --git a/lib/copy_this/www/lib/NZBImport.php b/lib/copy_this/www/lib/NZBImport.php index 6d9cb4299..581a2953b 100644 --- a/lib/copy_this/www/lib/NZBImport.php +++ b/lib/copy_this/www/lib/NZBImport.php @@ -287,12 +287,12 @@ class NZBImport // Make a fake message array to use to check the blacklist. $msg = array("Subject" => (string) $file->attributes()->subject, "From" => (string) $file->attributes()->poster, "Message-ID" => ""); - // Get the group names, groupID, check if it's blacklisted. + // Get the group names, groupid, check if it's blacklisted. $groupArr = array(); foreach ($file->groups->group as $group) { $group = (string) $group; - // If groupID is -1 try to get a groupID. + // If groupid is -1 try to get a groupid. if ($groupID === -1) { if (array_key_exists($group, $this->allGroups)) { $groupID = $this->allGroups[$group]; @@ -340,7 +340,7 @@ class NZBImport 'useFName' => $useNzbName, 'postDate' => (empty($postDate) ? date("Y-m-d H:i:s") : $postDate), 'from' => (empty($posterName) ? '' : $posterName), - 'groupID' => $groupID, + 'groupid' => $groupID, 'groupName' => $groupName, 'totalFiles' => $totalFiles, 'totalSize' => $totalSize @@ -387,7 +387,7 @@ class NZBImport // Look for a duplicate on name, poster and size. $dupeCheck = $this->pdo->queryOneRow( sprintf( - 'SELECT ID FROM releases WHERE name = %s AND fromname = %s AND size BETWEEN %s AND %s', + 'SELECT id FROM releases WHERE name = %s AND fromname = %s AND size BETWEEN %s AND %s', $escapedSubject, $escapedFromName, $this->pdo->escapeString($nzbDetails['totalSize'] * 0.99), @@ -403,18 +403,18 @@ class NZBImport 'name' => $escapedSubject, 'searchname' => $escapedSearchName, 'totalpart' => $nzbDetails['totalFiles'], - 'groupID' => $nzbDetails['groupID'], + 'groupid' => $nzbDetails['groupid'], 'guid' => $this->pdo->escapeString($this->relGuid), - 'regexID' => NULL, + 'regexid' => NULL, 'postdate' => $this->pdo->escapeString($nzbDetails['postDate']), 'fromname' => $escapedFromName, - 'reqID' => NULL, + 'reqid' => NULL, 'passwordstatus' => ($this->site->checkpasswordedrar > 0 ? -1 : 0), 'size' => $this->pdo->escapeString($nzbDetails['totalSize']), - 'categoryID' => $this->category->determineCategory($nzbDetails['groupID'], $cleanName), + 'categoryid' => $this->category->determineCategory($nzbDetails['groupid'], $cleanName), 'isrenamed' => $renamed, 'reqidstatus' => 0, - 'prehashID' => 0, + 'prehashid' => 0, 'nzbstatus' => \Enzebe::NZB_ADDED ] ); @@ -438,9 +438,9 @@ class NZBImport protected function getAllGroups() { $this->allGroups = []; - $groups = $this->pdo->query("SELECT ID, name FROM groups"); + $groups = $this->pdo->query("SELECT id, name FROM groups"); foreach ($groups as $group) { - $this->allGroups[$group["name"]] = $group["ID"]; + $this->allGroups[$group["name"]] = $group["id"]; } if (count($this->allGroups) === 0) { diff --git a/lib/copy_this/www/lib/Net_NNTP/NNTP/Client.php b/lib/copy_this/www/lib/Net_NNTP/NNTP/Client.php index 09977752f..8ca7b96f0 100644 --- a/lib/copy_this/www/lib/Net_NNTP/NNTP/Client.php +++ b/lib/copy_this/www/lib/Net_NNTP/NNTP/Client.php @@ -277,7 +277,7 @@ class Net_NNTP_Client extends Net_NNTP_Protocol_Client * * @return mixed * - (integer) Article number, if $ret=0 (default) - * - (string) Message-id, if $ret=1 + * - (string) Message-ID, if $ret=1 * - (array) Both article number and message-id, if $ret=-1 * - (bool) False if no previous article exists * - (object) Pear_Error on failure @@ -317,7 +317,7 @@ class Net_NNTP_Client extends Net_NNTP_Protocol_Client * * @return mixed * - (integer) Article number, if $ret=0 (default) - * - (string) Message-id, if $ret=1 + * - (string) Message-ID, if $ret=1 * - (array) Both article number and message-id, if $ret=-1 * - (bool) False if no further articles exist * - (object) Pear_Error on unexpected failure diff --git a/lib/copy_this/www/lib/ReleaseSearch.php b/lib/copy_this/www/lib/ReleaseSearch.php index 860780472..2a79cf7cf 100644 --- a/lib/copy_this/www/lib/ReleaseSearch.php +++ b/lib/copy_this/www/lib/ReleaseSearch.php @@ -33,11 +33,11 @@ class ReleaseSearch $this->fullTextJoinString = ''; break; case self::SPHINX: - $this->fullTextJoinString = 'INNER JOIN releases_se rse ON rse.id = r.ID'; + $this->fullTextJoinString = 'INNER JOIN releases_se rse ON rse.id = r.id'; break; case self::FULLTEXT: default: - $this->fullTextJoinString = 'INNER JOIN releasesearch rs on rs.releaseID = r.ID'; + $this->fullTextJoinString = 'INNER JOIN releasesearch rs on rs.releaseid = r.id'; break; } diff --git a/lib/copy_this/www/lib/RequestID.php b/lib/copy_this/www/lib/RequestID.php index fe9ad9bc9..2ae04a8c0 100644 --- a/lib/copy_this/www/lib/RequestID.php +++ b/lib/copy_this/www/lib/RequestID.php @@ -7,13 +7,13 @@ require_once (NN_LIB . 'SphinxSearch.php'); abstract class RequestID { - // Request ID. + // Request id. const REQID_OLD = -4; // We rechecked the web a second time and didn't find a title so don't process it again. - const REQID_NONE = -3; // The Request ID was not found locally or via web lookup. - const REQID_ZERO = -2; // The Request ID was 0. - const REQID_NOLL = -1; // Request ID was not found via local lookup. + const REQID_NONE = -3; // The Request id was not found locally or via web lookup. + const REQID_ZERO = -2; // The Request id was 0. + const REQID_NOLL = -1; // Request id was not found via local lookup. const REQID_UPROC = 0; // Release has not been processed. - const REQID_FOUND = 1; // Request ID found and release was updated. + const REQID_FOUND = 1; // Request id found and release was updated. /** * @var Groups @@ -44,11 +44,11 @@ abstract class RequestID } /** - * Look up request ID's for releases. + * Look up request id's for releases. * * @param array $options * - * @return int Quantity of releases matched to a request ID. + * @return int Quantity of releases matched to a request id. */ public function lookupRequestIDs(array $options = array()) { @@ -89,19 +89,19 @@ abstract class RequestID } /** - * Fetch releases with requestID's from MySQL. + * Fetch releases with requestid's from MySQL. */ protected function _getReleases() { } /** - * Process releases for requestID's. + * Process releases for requestid's. * * @return int How many did we rename? */ protected function _processReleases() { } /** - * No request ID was found, update the release. + * No request id was found, update the release. * * @param int $releaseID * @param int $status @@ -114,14 +114,14 @@ abstract class RequestID $this->pdo->queryExec( sprintf(' - UPDATE releases SET reqidstatus = %d WHERE ID = %d', + UPDATE releases SET reqidstatus = %d WHERE id = %d', $status, $releaseID ) ); } /** - * Get a new title / pre ID for a release. + * Get a new title / pre id for a release. * * @return array|bool */ @@ -174,19 +174,19 @@ abstract class RequestID protected $colorCLI; /** - * The found request ID for the release. + * The found request id for the release. * @var int */ protected $_requestID = self::REQID_ZERO; /** - * The title found from a request ID lookup. + * The title found from a request id lookup. * @var bool|string|array */ protected $_newTitle = false; /** - * Releases with potential Request ID's we can work on. + * Releases with potential Request id's we can work on. * @var \PDOStatement|bool */ protected $_releases; diff --git a/lib/copy_this/www/lib/RequestIDLocal.php b/lib/copy_this/www/lib/RequestIDLocal.php index c79f825c8..5f3abe373 100644 --- a/lib/copy_this/www/lib/RequestIDLocal.php +++ b/lib/copy_this/www/lib/RequestIDLocal.php @@ -2,7 +2,7 @@ require_once (NN_LIB . 'RequestID.php'); /** - * Attempts to find a PRE name for a release using a request ID from our local pre database, + * Attempts to find a PRE name for a release using a request id from our local pre database, * or internet request id database using a Standalone -- more intensive methods * * Class RequestIDLocal @@ -18,21 +18,21 @@ class RequestIDLocal extends RequestID } /** - * Fetch releases with requestID's from MySQL. + * Fetch releases with requestid's from MySQL. */ protected function _getReleases() { $query = ( - 'SELECT r.ID, r.name, r.categoryID, r.reqidstatus, g.name AS groupname, g.ID as gid + 'SELECT r.id, r.name, r.categoryid, r.reqidstatus, g.name AS groupname, g.id as gid FROM releases r - INNER JOIN groups g ON r.groupID = g.ID + INNER JOIN groups g ON r.groupid = g.id WHERE r.nzbstatus = 1 - AND r.prehashID = 0 + AND r.prehashid = 0 AND r.isrequestID = 1' ); $query .= ($this->_charGUID === '' ? '' : ' AND r.guid ' . $this->pdo->likeString($this->_charGUID, false, true)); - $query .= ($this->_groupID === '' ? '' : ' AND r.groupID = ' . $this->_groupID); + $query .= ($this->_groupID === '' ? '' : ' AND r.groupid = ' . $this->_groupID); $query .= ($this->_maxTime === 0 ? '' : sprintf(' AND r.adddate > NOW() - INTERVAL %d HOUR', $this->_maxTime)); switch ($this->_limit) { @@ -61,7 +61,7 @@ class RequestIDLocal extends RequestID } /** - * Process releases for requestID's. + * Process releases for requestid's. * * @return int How many did we rename? */ @@ -79,7 +79,7 @@ class RequestIDLocal extends RequestID $this->_updateRelease(); $renamed++; } else { - $this->_requestIdNotFound($this->_release['ID'], ($this->_release['reqidstatus'] == self::REQID_UPROC ? self::REQID_NOLL : self::REQID_NONE)); + $this->_requestIdNotFound($this->_release['id'], ($this->_release['reqidstatus'] == self::REQID_UPROC ? self::REQID_NOLL : self::REQID_NONE)); } if ($this->echoOutput && $this->_show === 0) { @@ -96,7 +96,7 @@ class RequestIDLocal extends RequestID } /** - * Get a new title / pre ID for a release. + * Get a new title / pre id for a release. * * @return array|bool */ @@ -108,7 +108,7 @@ class RequestIDLocal extends RequestID $check = $this->pdo->queryDirect( sprintf( - 'SELECT ID, title FROM prehash WHERE requestID = %d AND groupID = %d', + 'SELECT id, title FROM prehash WHERE requestid = %d AND groupid = %d', $this->_requestID, $this->_release['gid'] ) @@ -120,7 +120,7 @@ class RequestIDLocal extends RequestID if (preg_match('/s\d+/i', $row['title']) && !preg_match('/s\d+e\d+/i', $row['title'])) { return false; } - return array('title' => $row['title'], 'id' => $row['ID']); + return array('title' => $row['title'], 'id' => $row['id']); } } else { //Prevents multiple releases with the same request id/group from being renamed to the same Pre. @@ -128,7 +128,7 @@ class RequestIDLocal extends RequestID } } else { $result = $this->_singleAltLookup(); - if (is_array($result) && is_numeric($result['ID']) && $result['title'] !== '') { + if (is_array($result) && is_numeric($result['id']) && $result['title'] !== '') { return $result; } else { return $this->_multiLookup(); @@ -165,7 +165,7 @@ class RequestIDLocal extends RequestID case preg_match($regex2, $this->_release['name'], $matches): $check = $this->pdo->queryOneRow( sprintf( - "SELECT ID, title FROM prehash WHERE title = %s OR filename = %s %s", + "SELECT id, title FROM prehash WHERE title = %s OR filename = %s %s", $this->pdo->escapeString($matches['title']), $this->pdo->escapeString($matches['title']), ( @@ -181,7 +181,7 @@ class RequestIDLocal extends RequestID ) ); if ($check !== false) { - return array('title' => $check['title'], 'id' => $check['ID']); + return array('title' => $check['title'], 'id' => $check['id']); } continue; default: @@ -193,7 +193,7 @@ class RequestIDLocal extends RequestID private $groupIDCache = array(); /** - * Attempts to remap the release groupID by extracting the new group name from the release usenet name. + * Attempts to remap the release groupid by extracting the new group name from the release usenet name. * * @return array|bool */ @@ -237,55 +237,55 @@ class RequestIDLocal extends RequestID } $check = $this->pdo->queryOneRow( sprintf(" - SELECT ID, title FROM prehash WHERE requestID = %d AND groupID = %d", + SELECT id, title FROM prehash WHERE requestid = %d AND groupid = %d", $this->_requestID, ($groupID === '' ? 0 : $groupID) ) ); if ($check !== false) { - return array('title' => $check['title'], 'id' => $check['ID']); + return array('title' => $check['title'], 'id' => $check['id']); } return false; } /** - * Updates release information when a proper Request ID match is found. + * Updates release information when a proper Request id match is found. */ protected function _updateRelease() { $determinedCat = $this->category->determineCategory($this->_release['gid'], $this->_newTitle['title']); - if ($determinedCat == $this->_release['categoryID']) { + if ($determinedCat == $this->_release['categoryid']) { $newTitle = $this->pdo->escapeString($this->_newTitle['title']); $this->pdo->queryExec( sprintf(' UPDATE releases - SET prehashID = %d, reqidstatus = %d, isrenamed = 1, iscategorized = 1, searchname = %s - WHERE ID = %d', + SET prehashid = %d, reqidstatus = %d, isrenamed = 1, iscategorized = 1, searchname = %s + WHERE id = %d', $this->_newTitle['id'], self::REQID_FOUND, $newTitle, - $this->_release['ID'] + $this->_release['id'] ) ); - $this->sphinx->updateReleaseSearchName($this->_release['ID'], $newTitle); + $this->sphinx->updateReleaseSearchName($this->_release['id'], $newTitle); } else { $newTitle = $this->pdo->escapeString($this->_newTitle['title']); $this->pdo->queryExec( sprintf(' UPDATE releases SET - rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, - tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, consoleinfoID = NULL, - bookinfoID = NULL, anidbid = NULL, prehashID = %d, reqidstatus = %d, isrenamed = 1, - iscategorized = 1, searchname = %s, categoryID = %d - WHERE ID = %d', + rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, + tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, + bookinfoid = NULL, anidbid = NULL, prehashid = %d, reqidstatus = %d, isrenamed = 1, + iscategorized = 1, searchname = %s, categoryid = %d + WHERE id = %d', $this->_newTitle['id'], self::REQID_FOUND, $newTitle, $determinedCat, - $this->_release['ID'] + $this->_release['id'] ) ); - $this->sphinx->updateReleaseSearchName($this->_release['ID'], $newTitle); + $this->sphinx->updateReleaseSearchName($this->_release['id'], $newTitle); } if ($this->_release['name'] !== $this->_newTitle['title'] && $this->_show == 1) { @@ -294,9 +294,9 @@ class RequestIDLocal extends RequestID 'new_name' => $this->_newTitle['title'], 'old_name' => $this->_release['name'], 'new_category' => $this->category->getNameByID($determinedCat), - 'old_category' => $this->category->getNameByID($this->_release['categoryID']), + 'old_category' => $this->category->getNameByID($this->_release['categoryid']), 'group' => $this->_release['groupname'], - 'release_id' => $this->_release['ID'], + 'release_id' => $this->_release['id'], 'method' => 'RequestIDLocal' ) ); diff --git a/lib/copy_this/www/lib/RequestIDWeb.php b/lib/copy_this/www/lib/RequestIDWeb.php index 3b09ce496..356440e67 100644 --- a/lib/copy_this/www/lib/RequestIDWeb.php +++ b/lib/copy_this/www/lib/RequestIDWeb.php @@ -4,17 +4,17 @@ require_once (NN_LIB . 'util.php'); require_once (NN_LIB . 'RequestID.php'); /** - * Attempts to find a PRE name for a release using a request ID from our local pre database, + * Attempts to find a PRE name for a release using a request id from our local pre database, * or internet request id database. * * Class RequestIDWeb */ class RequestIDWeb extends RequestID { - const MAX_WEB_LOOKUPS = 100; // Please don't exceed this, not to be to harsh on the Request ID server. + const MAX_WEB_LOOKUPS = 100; // Please don't exceed this, not to be to harsh on the Request id server. /** - * The ID of the PRE entry the found request ID belongs to. + * The id of the PRE entry the found request id belongs to. * @var bool|int */ protected $_preDbID = false; @@ -38,17 +38,17 @@ class RequestIDWeb extends RequestID } /** - * Get all results from the releases table that have request ID's to be processed. + * Get all results from the releases table that have request id's to be processed. */ protected function _getReleases() { $this->_releases = $this->pdo->queryDirect( sprintf (' - SELECT r.ID, r.name, r.searchname, g.name AS groupname, r.groupID, r.categoryID + SELECT r.id, r.name, r.searchname, g.name AS groupname, r.groupid, r.categoryid FROM releases r - INNER JOIN groups g ON r.groupID = g.ID + INNER JOIN groups g ON r.groupid = g.id WHERE r.nzbstatus = 1 - AND r.prehashID = 0 + AND r.prehashid = 0 AND r.isrequestID = 1 AND ( r.reqidstatus = %d @@ -60,7 +60,7 @@ class RequestIDWeb extends RequestID self::REQID_NOLL, self::REQID_NONE, $this->_request_hours, - (empty($this->_groupID) ? '' : ('AND r.groupID = ' . $this->_groupID)), + (empty($this->_groupID) ? '' : ('AND r.groupid = ' . $this->_groupID)), $this->_getReqIdGroups(), ($this->_maxTime === '' ? '' : sprintf(' AND r.adddate > NOW() - INTERVAL %d HOUR', $this->_maxTime)), $this->_limit @@ -69,8 +69,8 @@ class RequestIDWeb extends RequestID } /** - * Create "AND" part of query for request ID groups. - * Less load on the request ID web server, by limiting results. + * Create "AND" part of query for request id groups. + * Less load on the request id web server, by limiting results. * * @return string */ @@ -102,7 +102,7 @@ class RequestIDWeb extends RequestID } /** - * Process releases for requestID's. + * Process releases for requestid's. * * @return int How many did we rename? */ @@ -116,12 +116,12 @@ class RequestIDWeb extends RequestID foreach($this->_releases as $release) { $this->_release['name'] = $release['name']; - // Try to find a request ID for the release. + // Try to find a request id for the release. $requestId = $this->_siftReqId(); // If there's none, update the release and continue. if ($requestId === self::REQID_ZERO) { - $this->_requestIdNotFound($release['ID'], self::REQID_NONE); + $this->_requestIdNotFound($release['id'], self::REQID_NONE); if ($this->echoOutput) { echo '-'; } @@ -133,10 +133,10 @@ class RequestIDWeb extends RequestID $release['groupname'] = 'alt.binaries.teevee'; } - // Send the release ID so we can track the return data. - $requestArray[$release['ID']] = array( + // Send the release id so we can track the return data. + $requestArray[$release['id']] = array( 'reqid' => $requestId, - 'ident' => $release['ID'], + 'ident' => $release['id'], 'group' => $release['groupname'], 'sname' => $release['searchname'] ); @@ -174,24 +174,24 @@ class RequestIDWeb extends RequestID if (isset($result['name']) && isset($result['ident']) && (int)$result['ident'] > 0) { $this->_newTitle['title'] = (string)$result['name']; $this->_requestID = (int)$result['reqid']; - $this->_release['ID'] = (int)$result['ident']; + $this->_release['id'] = (int)$result['ident']; - // Buffer groupID queries. + // Buffer groupid queries. $this->_release['groupname'] = $requestArray[(int)$result['ident']]['group']; if (isset($groupIDarray[$this->_release['groupname']])) { - $this->_release['groupID'] = $groupIDArray[$this->_release['groupname']]; + $this->_release['groupid'] = $groupIDArray[$this->_release['groupname']]; } else { - $this->_release['groupID'] = $this->groups->getIDByName($this->_release['groupname']); - $groupIDArray[$this->_release['groupname']] = $this->_release['groupID']; + $this->_release['groupid'] = $this->groups->getIDByName($this->_release['groupname']); + $groupIDArray[$this->_release['groupname']] = $this->_release['groupid']; } - $this->_release['gid'] = $this->_release['groupID']; + $this->_release['gid'] = $this->_release['groupid']; $this->_release['searchname'] = $requestArray[(int)$result['ident']]['sname']; $this->_insertIntoPreDB(); if ($this->_preDbID === false) { $this->_preDbID = 0; } - $this->_newTitle['ID'] = $this->_preDbID; + $this->_newTitle['id'] = $this->_preDbID; $this->_updateRelease(); $renamed++; if ($this->echoOutput) { @@ -215,7 +215,7 @@ class RequestIDWeb extends RequestID $addDate = $this->pdo->queryOneRow( sprintf( - 'SELECT UNIX_TIMESTAMP(adddate) AS adddate FROM releases WHERE ID = %d', $request['ident'] + 'SELECT UNIX_TIMESTAMP(adddate) AS adddate FROM releases WHERE id = %d', $request['ident'] ) ); @@ -242,13 +242,13 @@ class RequestIDWeb extends RequestID } /** - * If we found a request ID on the internet, check if our PRE database has it, insert it if not. + * If we found a request id on the internet, check if our PRE database has it, insert it if not. */ protected function _insertIntoPreDB() { $dupeCheck = $this->pdo->queryOneRow( sprintf(' - SELECT ID AS prehashID, requestID, groupID + SELECT id AS prehashid, requestid, groupid FROM prehash WHERE title = %s', $this->pdo->escapeString($this->_newTitle['title']) @@ -258,23 +258,23 @@ class RequestIDWeb extends RequestID if ($dupeCheck === false) { $this->_preDbID = (int)$this->pdo->queryInsert( sprintf(" - INSERT INTO prehash (title, source, requestID, groupID, predate) + INSERT INTO prehash (title, source, requestid, groupid, predate) VALUES (%s, %s, %d, %d, NOW())", $this->pdo->escapeString($this->_newTitle['title']), $this->pdo->escapeString('requestWEB'), $this->_requestID, - $this->_release['groupID'] + $this->_release['groupid'] ) ); } else { - $this->_preDbID = $dupeCheck['prehashID']; + $this->_preDbID = $dupeCheck['prehashid']; $this->pdo->queryExec( sprintf(' UPDATE prehash - SET requestID = %d, groupID = %d - WHERE ID = %d', + SET requestid = %d, groupid = %d + WHERE id = %d', $this->_requestID, - $this->_release['groupID'], + $this->_release['groupid'], $this->_preDbID ) ); @@ -286,24 +286,24 @@ class RequestIDWeb extends RequestID */ protected function _updateRelease() { - $determinedCategory = $this->category->determineCategory($this->_release['groupID'], $this->_newTitle['title']); + $determinedCategory = $this->category->determineCategory($this->_release['groupid'], $this->_newTitle['title']); $newTitle = $this->pdo->escapeString($this->_newTitle['title']); $this->pdo->queryExec( sprintf(' UPDATE releases - SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, - tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, consoleinfoID = NULL, bookinfoID = NULL, anidbid = NULL, - reqidstatus = %d, isrenamed = 1, proc_files = 1, searchname = %s, categoryID = %d, - prehashID = %d - WHERE ID = %d', + SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, + tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, + reqidstatus = %d, isrenamed = 1, proc_files = 1, searchname = %s, categoryid = %d, + prehashid = %d + WHERE id = %d', self::REQID_FOUND, $newTitle, $determinedCategory, $this->_preDbID, - $this->_release['ID'] + $this->_release['id'] ) ); - $this->sphinx->updateReleaseSearchName($this->_release['ID'], $newTitle); + $this->sphinx->updateReleaseSearchName($this->_release['id'], $newTitle); if ($this->echoOutput) { \NameFixer::echoChangedReleaseName(array( @@ -312,7 +312,7 @@ class RequestIDWeb extends RequestID 'new_category' => $this->category->getNameByID($determinedCategory), 'old_category' => '', 'group' => $this->_release['groupname'], - 'release_id' => $this->_release['ID'], + 'release_id' => $this->_release['id'], 'method' => 'RequestID->updateRelease' ) ); diff --git a/lib/copy_this/www/lib/SphinxSearch.php b/lib/copy_this/www/lib/SphinxSearch.php index c670679cd..8a89bd5b1 100644 --- a/lib/copy_this/www/lib/SphinxSearch.php +++ b/lib/copy_this/www/lib/SphinxSearch.php @@ -66,7 +66,7 @@ class SphinxSearch if (!is_null($this->sphinxQL)) { if ($identifiers['i'] === false) { $identifiers['i'] = $pdo->queryOneRow( - sprintf('SELECT ID FROM releases WHERE guid = %s', $pdo->escapeString($identifiers['g'])) + sprintf('SELECT id FROM releases WHERE guid = %s', $pdo->escapeString($identifiers['g'])) ); if ($identifiers['i'] !== false) { $identifiers['i'] = $identifiers['i']['id']; diff --git a/lib/copy_this/www/lib/Tmux.php b/lib/copy_this/www/lib/Tmux.php index 9707e218c..0f6154320 100644 --- a/lib/copy_this/www/lib/Tmux.php +++ b/lib/copy_this/www/lib/Tmux.php @@ -380,20 +380,20 @@ class Tmux switch ((int) $qry) { case 1: return sprintf("SELECT - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryID BETWEEN 5000 AND 5999 AND rageID = -1) AS processtvrage, - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryID = 5070 AND anidbid IS NULL) AS processanime, - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryID BETWEEN 2000 AND 2999 AND imdbID IS NULL) AS processmovies, - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryID IN (3010, 3040, 3050) AND musicinfoID IS NULL) AS processmusic, - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryID BETWEEN 1000 AND 1999 AND consoleinfoID IS NULL) AS processconsole, - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryID IN (%s) AND bookinfoID IS NULL) AS processbooks, - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryID = 4050 AND gamesinfo_id = 0) AS processgames, - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryID BETWEEN 6000 AND 6040 AND xxxinfo_id = 0) AS processxxx, + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryid BETWEEN 5000 AND 5999 AND rageid = -1) AS processtvrage, + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryid = 5070 AND anidbid IS NULL) AS processanime, + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryid BETWEEN 2000 AND 2999 AND imdbid IS NULL) AS processmovies, + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryid IN (3010, 3040, 3050) AND musicinfoid IS NULL) AS processmusic, + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryid BETWEEN 1000 AND 1999 AND consoleinfoid IS NULL) AS processconsole, + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryid IN (%s) AND bookinfoid IS NULL) AS processbooks, + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryid = 4050 AND gamesinfo_id = 0) AS processgames, + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categoryid BETWEEN 6000 AND 6040 AND xxxinfo_id = 0) AS processxxx, (SELECT COUNT(*) FROM releases r WHERE 1=1 %s) AS processnfo", $bookreqids, \Info::NfoQueryString($this->pdo)); case 2: return "SELECT (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND nfostatus = 1) AS nfo, (SELECT COUNT(*) FROM releases r - INNER JOIN category c ON c.ID = r.categoryID + INNER JOIN category c ON c.id = r.categoryid WHERE r.nzbstatus = 1 AND r.passwordstatus BETWEEN -6 AND -1 AND r.haspreview = -1 AND c.disablepreview = 0 ) AS work, @@ -401,17 +401,17 @@ class Tmux (SELECT COUNT(*) FROM groups WHERE name IS NOT NULL) AS all_groups"; case 3: return sprintf("SELECT - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND isrequestid = 1 AND prehashID = 0 AND reqidstatus = 0) + - (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND isrequestid = 1 AND prehashID = 0 AND reqidstatus = -1) + + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND isrequestid = 1 AND prehashid = 0 AND reqidstatus = 0) + + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND isrequestid = 1 AND prehashid = 0 AND reqidstatus = -1) + (SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 - AND isrequestid = 1 AND prehashID = 0 AND reqidstatus = -3 AND adddate > NOW() - INTERVAL %s HOUR + AND isrequestid = 1 AND prehashid = 0 AND reqidstatus = -3 AND adddate > NOW() - INTERVAL %s HOUR ) AS requestid_inprogress, - (SELECT COUNT(*) FROM releases WHERE prehashID > 0 AND nzbstatus = 1 AND isrequestid = 1 AND reqidstatus = 1) AS requestid_matched, - (SELECT COUNT(*) FROM releases WHERE prehashID > 0 AND searchname IS NOT NULL) AS prehash_matched, + (SELECT COUNT(*) FROM releases WHERE prehashid > 0 AND nzbstatus = 1 AND isrequestid = 1 AND reqidstatus = 1) AS requestid_matched, + (SELECT COUNT(*) FROM releases WHERE prehashid > 0 AND searchname IS NOT NULL) AS prehash_matched, (SELECT COUNT(*) FROM releases WHERE preid > 0 AND searchname IS NOT NULL) AS predb_matched, (SELECT COUNT(DISTINCT(preid)) FROM releases WHERE preid > 0 AND searchname IS NOT NULL) AS distinct_predb_matched, - (SELECT COUNT(DISTINCT(prehashID)) FROM releases WHERE prehashID > 0 AND searchname IS NOT NULL) AS distinct_prehash_matched", $request_hours); + (SELECT COUNT(DISTINCT(prehashid)) FROM releases WHERE prehashid > 0 AND searchname IS NOT NULL) AS distinct_prehash_matched", $request_hours); case 4: return sprintf(" SELECT @@ -430,10 +430,10 @@ class Tmux ); case 6: return "SELECT - (SELECT searchname FROM releases ORDER BY ID DESC LIMIT 1) AS newestrelname, + (SELECT searchname FROM releases ORDER BY id DESC LIMIT 1) AS newestrelname, (SELECT UNIX_TIMESTAMP(MAX(predate)) FROM prehash) AS newestprehash, (SELECT UNIX_TIMESTAMP(MAX(ctime)) FROM predb) AS newestpredb, - (SELECT UNIX_TIMESTAMP(adddate) FROM releases ORDER BY ID DESC LIMIT 1) AS newestrelease"; + (SELECT UNIX_TIMESTAMP(adddate) FROM releases ORDER BY id DESC LIMIT 1) AS newestrelease"; default: return false; } diff --git a/lib/copy_this/www/lib/TmuxOutput.php b/lib/copy_this/www/lib/TmuxOutput.php index d1a4cd7d4..f0d372da1 100644 --- a/lib/copy_this/www/lib/TmuxOutput.php +++ b/lib/copy_this/www/lib/TmuxOutput.php @@ -117,7 +117,7 @@ class TmuxOutput extends Tmux $buffer = ''; $state = ($this->runVar['settings']['is_running'] == 1) ? 'Running' : 'Disabled'; //$version = $this->_tvers . 'r' . $this->_vers; - $tversion = '0.5r01174'; + $tversion = '0.5r01185'; $buffer .= sprintf($this->tmpMasks[2], "Monitor $state v$tversion @ $this->_tvers [" . $this->_vers ."]: ", @@ -231,7 +231,7 @@ class TmuxOutput extends Tmux ) ); $buffer .= sprintf($this->tmpMasks[4], - "requestID", + "requestid", sprintf( "%s(%s)", number_format($this->runVar['counts']['now']['requestid_inprogress']), diff --git a/lib/copy_this/www/lib/XXX.php b/lib/copy_this/www/lib/XXX.php index 61d1132e9..e1c192cfa 100644 --- a/lib/copy_this/www/lib/XXX.php +++ b/lib/copy_this/www/lib/XXX.php @@ -168,7 +168,7 @@ class XXX ? 'AND r.postdate > NOW() - INTERVAL ' . $maxAge . 'DAY ' : '' ), - (count($excludedCats) > 0 ? ' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')' : '') + (count($excludedCats) > 0 ? ' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')' : '') ) ); return ($res === false ? 0 : $res['num']); @@ -196,12 +196,12 @@ class XXX $order = $this->getXXXOrder($orderBy); $sql = sprintf(" SELECT - GROUP_CONCAT(r.ID ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, + GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, GROUP_CONCAT(r.rarinnerfilecount ORDER BY r.postdate DESC SEPARATOR ',') as grp_rarinnerfilecount, GROUP_CONCAT(r.haspreview ORDER BY r.postdate DESC SEPARATOR ',') AS grp_haspreview, GROUP_CONCAT(r.passwordstatus ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_password, GROUP_CONCAT(r.guid ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_guid, - GROUP_CONCAT(rn.ID ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, + GROUP_CONCAT(rn.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, GROUP_CONCAT(groups.name ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grpname, GROUP_CONCAT(r.searchname ORDER BY r.postdate DESC SEPARATOR '#') AS grp_release_name, GROUP_CONCAT(r.postdate ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_postdate, @@ -209,9 +209,9 @@ class XXX GROUP_CONCAT(r.totalpart ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_totalparts, GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments, GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, - xxx.*, UNCOMPRESS(xxx.plot) AS plot, groups.name AS group_name, rn.ID as nfoid FROM releases r - LEFT OUTER JOIN groups ON groups.ID = r.groupID - LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID + xxx.*, UNCOMPRESS(xxx.plot) AS plot, groups.name AS group_name, rn.id as nfoid FROM releases r + LEFT OUTER JOIN groups ON groups.id = r.groupid + LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id INNER JOIN xxxinfo xxx ON xxx.id = r.xxxinfo_id WHERE r.nzbstatus = 1 AND xxx.title != '' @@ -224,7 +224,7 @@ class XXX ? 'AND r.postdate > NOW() - INTERVAL ' . $maxAge . 'DAY ' : '' ), - (count($excludedCats) > 0 ? ' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')' : ''), + (count($excludedCats) > 0 ? ' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')' : ''), $order[0], $order[1], ($start === false ? '' : ' LIMIT ' . $num . ' OFFSET ' . $start) @@ -553,11 +553,11 @@ class XXX public function processXXXReleases() { $res = $this->pdo->query(sprintf(" - SELECT r.searchname, r.ID + SELECT r.searchname, r.id FROM releases r WHERE r.nzbstatus = 1 AND r.xxxinfo_id = 0 - AND r.categoryID IN (6010, 6020, 6030, 6040, 6041, 6042, 6080, 6090) + AND r.categoryid IN (6010, 6020, 6030, 6040, 6041, 6042, 6080, 6090) LIMIT %d", $this->movieqty ) @@ -579,7 +579,7 @@ class XXX if ($this->parseXXXSearchName($arr['searchname']) !== false) { $check = $this->checkXXXInfoExists($this->currentTitle); if ($check === false) { - $this->currentRelID = $arr['ID']; + $this->currentRelID = $arr['id']; $movieName = $this->currentTitle; if ($this->debug && $this->echooutput) { $this->pdo->log->doEcho("DB name: " . $arr['searchname'], true); @@ -595,7 +595,7 @@ class XXX } else { $this->pdo->log->doEcho(".", true); } - $this->pdo->queryExec(sprintf('UPDATE releases SET xxxinfo_id = %d WHERE ID = %d', $idcheck, $arr['ID'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET xxxinfo_id = %d WHERE id = %d', $idcheck, $arr['id'])); } } elseif ($this->echooutput) { $this->pdo->log->doEcho($this->pdo->log->header('No xxx releases to process.')); @@ -679,7 +679,7 @@ class XXX } /** - * Get Genres for activeonly and/or an ID + * Get Genres for activeonly and/or an id * * @param bool $activeOnly * @param null $gid @@ -702,7 +702,7 @@ class XXX } /** - * Get Genre ID's Of the title + * Get Genre id's Of the title * * @param $arr - Array or String * @@ -713,16 +713,16 @@ class XXX $ret = null; if (!is_array($arr)) { - $res = $this->pdo->queryOneRow("SELECT ID FROM genres WHERE title = " . $this->pdo->escapeString($arr)); + $res = $this->pdo->queryOneRow("SELECT id FROM genres WHERE title = " . $this->pdo->escapeString($arr)); if ($res !== false) { - return $res["ID"]; + return $res["id"]; } } foreach ($arr as $key => $value) { - $res = $this->pdo->queryOneRow("SELECT ID FROM genres WHERE title = " . $this->pdo->escapeString($value)); + $res = $this->pdo->queryOneRow("SELECT id FROM genres WHERE title = " . $this->pdo->escapeString($value)); if ($res !== false) { - $ret .= "," . $res["ID"]; + $ret .= "," . $res["id"]; } else { $ret .= "," . $this->insertGenre($value); } @@ -733,7 +733,7 @@ class XXX } /** - * Inserts Genre and returns last affected row (Genre ID) + * Inserts Genre and returns last affected row (Genre id) * * @param $genre * diff --git a/lib/copy_this/www/lib/anidb.php b/lib/copy_this/www/lib/anidb.php index 55c627c39..78bc00af4 100644 --- a/lib/copy_this/www/lib/anidb.php +++ b/lib/copy_this/www/lib/anidb.php @@ -178,7 +178,7 @@ class AniDB } /** - * Retrieves all info for a specific AniDB ID + * Retrieves all info for a specific AniDB id * * @param int $anidbID * @return diff --git a/lib/copy_this/www/lib/backfill.php b/lib/copy_this/www/lib/backfill.php index 6513e0471..b7653680e 100644 --- a/lib/copy_this/www/lib/backfill.php +++ b/lib/copy_this/www/lib/backfill.php @@ -349,10 +349,10 @@ class Backfill sprintf(' UPDATE groups SET first_record_postdate = %s, first_record = %s, last_updated = NOW() - WHERE ID = %d', + WHERE id = %d', $this->pdo->from_unixtime($newdate), $this->pdo->escapeString($first), - $groupArr['ID']) + $groupArr['id']) ); if ($first == $targetpost) { $done = true; diff --git a/lib/copy_this/www/lib/binaries.php b/lib/copy_this/www/lib/binaries.php index 3f84fa20b..f063d380d 100644 --- a/lib/copy_this/www/lib/binaries.php +++ b/lib/copy_this/www/lib/binaries.php @@ -280,9 +280,9 @@ class Binaries sprintf(' UPDATE groups SET first_record_postdate = %s - WHERE ID = %d', + WHERE id = %d', $this->_pdo->from_unixtime($groupMySQL['first_record_postdate']), - $groupMySQL['ID'] + $groupMySQL['id'] ) ); } @@ -405,10 +405,10 @@ class Binaries sprintf(' UPDATE groups SET first_record = %s, first_record_postdate = %s - WHERE ID = %d', + WHERE id = %d', $scanSummary['firstArticleNumber'], $this->_pdo->from_unixtime($this->_pdo->escapeString($groupMySQL['first_record_postdate'])), - $groupMySQL['ID'] + $groupMySQL['id'] ) ); } @@ -423,10 +423,10 @@ class Binaries sprintf(' UPDATE groups SET last_record = %s, last_record_postdate = %s, last_updated = NOW() - WHERE ID = %d', + WHERE id = %d', $this->_pdo->escapeString($scanSummary['lastArticleNumber']), $this->_pdo->from_unixtime($scanSummary['lastArticleDate']), - $groupMySQL['ID'] + $groupMySQL['id'] ) ); } else { @@ -435,9 +435,9 @@ class Binaries sprintf(' UPDATE groups SET last_record = %s, last_updated = NOW() - WHERE ID = %d', + WHERE id = %d', $this->_pdo->escapeString($last), - $groupMySQL['ID'] + $groupMySQL['id'] ) ); } @@ -486,7 +486,7 @@ class Binaries $releaseRegex = new ReleaseRegex; $n = $this->n; // Check if MySQL tables exist, create if they do not, get their names at the same time. - $tableNames = $this->_groups->getCBPTableNames($this->_tablePerGroup, $groupArr['ID']); + $tableNames = $this->_groups->getCBPTableNames($this->_tablePerGroup, $groupArr['id']); $partRepair = ($type === 'partrepair'); $returnArray = []; @@ -505,9 +505,9 @@ class Binaries if ($partRepair === true) { $this->_pdo->queryExec( sprintf( - 'UPDATE %s SET attempts = attempts + 1 WHERE groupID = %d AND numberID %s', + 'UPDATE %s SET attempts = attempts + 1 WHERE groupid = %d AND numberID %s', $tableNames['prname'], - $groupArr['ID'], + $groupArr['id'], ($first == $last ? '= ' . $first : 'IN (' . implode(',', range($first, $last)) . ')') ) ); @@ -647,7 +647,7 @@ class Binaries case 'partrepair': case 'update': default: - $this->addMissingParts($rangenotreceived, $tableNames['prname'], $groupArr['ID']); + $this->addMissingParts($rangenotreceived, $tableNames['prname'], $groupArr['id']); break; } echo "Server did not return " . count($rangenotreceived) . " article(s).$n"; @@ -665,7 +665,7 @@ class Binaries $partIds = array(); foreach ($data['Parts'] as $partdata) $partIds[] = $partdata['number']; - $db->queryExec(sprintf("DELETE FROM %s WHERE numberID IN (%s) AND groupID=%d", $tableNames['prname'], implode(',', $partIds), $groupArr['ID'])); + $db->queryExec(sprintf("DELETE FROM %s WHERE numberID IN (%s) AND groupid=%d", $tableNames['prname'], implode(',', $partIds), $groupArr['id'])); } continue; } @@ -673,8 +673,8 @@ class Binaries if (isset($data['Parts']) && count($data['Parts']) > 0 && $subject != '') { //Check for existing binary $binaryID = 0; - $binaryHash = md5($subject . $data['From'] . $groupArr['ID']); - $res = $db->queryOneRow(sprintf("SELECT ID FROM %s WHERE binaryhash = %s", $tableNames['bname'], $db->escapeString($binaryHash))); + $binaryHash = md5($subject . $data['From'] . $groupArr['id']); + $res = $db->queryOneRow(sprintf("SELECT id FROM %s WHERE binaryhash = %s", $tableNames['bname'], $db->escapeString($binaryHash))); if (!$res) { //Apply Regexes @@ -690,15 +690,15 @@ class Binaries $sql = ''; if (!empty($regexMatches)) { $relparts = explode("/", $regexMatches['parts']); - $sql = sprintf('INSERT INTO %s (name, fromname, date, xref, totalparts, groupID, procstat, categoryID, regexID, reqID, relpart, reltotalpart, binaryhash, relname, dateadded) VALUES (%s, %s, FROM_UNIXTIME(%s), %s, %s, %d, %d, %s, %d, %s, %d, %d, %s, %s, now())', $tableNames['bname'], $db->escapeString($subject), $db->escapeString(utf8_encode($data['From'])), $db->escapeString($data['Date']), $db->escapeString($data['Xref']), $db->escapeString($data['MaxParts']), $groupArr['ID'], Releases::PROCSTAT_TITLEMATCHED, $regexMatches['regcatid'], $regexMatches['regexID'], $db->escapeString($regexMatches['reqID']), $relparts[0], $relparts[1], $db->escapeString($binaryHash), $db->escapeString(str_replace('_', ' ', $regexMatches['name']))); + $sql = sprintf('INSERT INTO %s (name, fromname, date, xref, totalparts, groupid, procstat, categoryid, regexid, reqid, relpart, reltotalpart, binaryhash, relname, dateadded) VALUES (%s, %s, FROM_UNIXTIME(%s), %s, %s, %d, %d, %s, %d, %s, %d, %d, %s, %s, now())', $tableNames['bname'], $db->escapeString($subject), $db->escapeString(utf8_encode($data['From'])), $db->escapeString($data['Date']), $db->escapeString($data['Xref']), $db->escapeString($data['MaxParts']), $groupArr['id'], Releases::PROCSTAT_TITLEMATCHED, $regexMatches['regcatid'], $regexMatches['regexid'], $db->escapeString($regexMatches['reqid']), $relparts[0], $relparts[1], $db->escapeString($binaryHash), $db->escapeString(str_replace('_', ' ', $regexMatches['name']))); } elseif ($this->onlyProcessRegexBinaries === false) { - $sql = sprintf('INSERT INTO %s (name, fromname, date, xref, totalparts, groupID, binaryhash, dateadded) VALUES (%s, %s, FROM_UNIXTIME(%s), %s, %s, %d, %s, now())', $tableNames['bname'], $db->escapeString($subject), $db->escapeString(utf8_encode($data['From'])), $db->escapeString($data['Date']), $db->escapeString($data['Xref']), $db->escapeString($data['MaxParts']), $groupArr['ID'], $db->escapeString($binaryHash)); + $sql = sprintf('INSERT INTO %s (name, fromname, date, xref, totalparts, groupid, binaryhash, dateadded) VALUES (%s, %s, FROM_UNIXTIME(%s), %s, %s, %d, %s, now())', $tableNames['bname'], $db->escapeString($subject), $db->escapeString(utf8_encode($data['From'])), $db->escapeString($data['Date']), $db->escapeString($data['Xref']), $db->escapeString($data['MaxParts']), $groupArr['id'], $db->escapeString($binaryHash)); } //onlyProcessRegexBinaries is true, there was no regex match and we are doing part repair so delete them elseif ($type == 'partrepair') { $partIds = array(); foreach ($data['Parts'] as $partdata) $partIds[] = $partdata['number']; - $db->queryExec(sprintf('DELETE FROM %s WHERE numberID IN (%s) AND groupID = %d', $tableNames['prname'], implode(',', $partIds), $groupArr['ID'])); + $db->queryExec(sprintf('DELETE FROM %s WHERE numberID IN (%s) AND groupid = %d', $tableNames['prname'], implode(',', $partIds), $groupArr['id'])); continue; } if ($sql != '') { @@ -707,7 +707,7 @@ class Binaries //if ($count % 500 == 0) echo "$count bin adds..."; } } else { - $binaryID = $res["ID"]; + $binaryID = $res["id"]; $updatecount++; //if ($updatecount % 500 == 0) echo "$updatecount bin updates..."; } @@ -735,7 +735,7 @@ class Binaries //TODO: determine whether to add to missing articles if insert failed if (sizeof($msgsnotinserted) > 0) { echo 'WARNING: ' . count($msgsnotinserted) . ' Parts failed to insert' . $n; - $this->addMissingParts($msgsnotinserted, $tableNames['prname'], $groupArr['ID']); + $this->addMissingParts($msgsnotinserted, $tableNames['prname'], $groupArr['id']); } if (($count >= 500) || ($updatecount >= 500)) { echo $n; @@ -787,15 +787,15 @@ class Binaries */ public function partRepair($groupArr) { - $tableNames = $this->_groups->getCBPTableNames($this->_tablePerGroup, $groupArr['ID']); + $tableNames = $this->_groups->getCBPTableNames($this->_tablePerGroup, $groupArr['id']); // Get all parts in partrepair table. $missingParts = $this->_pdo->query( sprintf(' SELECT * FROM %s - WHERE groupID = %d AND attempts < %d + WHERE groupid = %d AND attempts < %d ORDER BY numberID ASC LIMIT %d', $tableNames['prname'], - $groupArr['ID'], + $groupArr['id'], $this->_partRepairMaxTries, $this->_partRepairLimit ) @@ -857,12 +857,12 @@ class Binaries // Calculate parts repaired $result = $this->_pdo->queryOneRow( sprintf(' - SELECT COUNT(ID) AS num + SELECT COUNT(id) AS num FROM %s - WHERE groupID = %d + WHERE groupid = %d AND numberID <= %d', $tableNames['prname'], - $groupArr['ID'], + $groupArr['id'], $missingParts[$missingCount - 1]['numberID'] ) ); @@ -873,15 +873,15 @@ class Binaries } // Update attempts on remaining parts for active group - if (isset($missingParts[$missingCount - 1]['ID'])) { + if (isset($missingParts[$missingCount - 1]['id'])) { $this->_pdo->queryExec( sprintf(' UPDATE %s SET attempts = attempts + 1 - WHERE groupID = %d + WHERE groupid = %d AND numberID <= %d', $tableNames['prname'], - $groupArr['ID'], + $groupArr['id'], $missingParts[$missingCount - 1]['numberID'] ) ); @@ -901,10 +901,10 @@ class Binaries // Remove articles that we cant fetch after x attempts. $this->_pdo->queryExec( sprintf( - 'DELETE FROM %s WHERE attempts >= %d AND groupID = %d', + 'DELETE FROM %s WHERE attempts >= %d AND groupid = %d', $tableNames['prname'], $this->_partRepairMaxTries, - $groupArr['ID'] + $groupArr['id'] ) ); } @@ -916,13 +916,13 @@ class Binaries { $db = new DB(); $added = false; - $insertStr = "INSERT INTO $tablename (numberID, groupID) VALUES "; + $insertStr = "INSERT INTO $tablename (numberID, groupid) VALUES "; foreach ($numbers as $number) { if ($number > 0) { - $checksql = sprintf("select numberID from $tablename where numberID = %u and groupID = %d", $number, $groupID); + $checksql = sprintf("select numberID from $tablename where numberID = %u and groupid = %d", $number, $groupID); $chkrow = $db->queryOneRow($checksql); if ($chkrow) { - $updsql = sprintf('update ' . $tablename . ' set attempts = attempts + 1 where numberID = %u and groupID = %d', $number, $groupID); + $updsql = sprintf('update ' . $tablename . ' set attempts = attempts + 1 where numberID = %u and groupid = %d', $number, $groupID); $db->queryExec($updsql); } else { $added = true; @@ -1040,16 +1040,16 @@ class Binaries $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and b.categoryID not in (" . implode(",", $excludedcats) . ") "; + $exccatlist = " and b.categoryid not in (" . implode(",", $excludedcats) . ") "; $res = $db->query(sprintf(" SELECT b.*, g.name AS group_name, r.guid, - (SELECT COUNT(ID) FROM parts p where p.binaryID = b.ID) as 'binnum' + (SELECT COUNT(id) FROM parts p where p.binaryID = b.id) as 'binnum' FROM binaries b - INNER JOIN groups g ON g.ID = b.groupID - LEFT OUTER JOIN releases r ON r.ID = b.releaseID + INNER JOIN groups g ON g.id = b.groupid + LEFT OUTER JOIN releases r ON r.id = b.releaseid WHERE 1=1 %s %s order by DATE DESC LIMIT %d ", $searchsql, $exccatlist, $limit ) @@ -1065,7 +1065,7 @@ class Binaries { $db = new DB(); - return $db->query(sprintf("select binaries.* from binaries where releaseID = %d order by relpart", $id)); + return $db->query(sprintf("select binaries.* from binaries where releaseid = %d order by relpart", $id)); } /** @@ -1075,7 +1075,7 @@ class Binaries { $db = new DB(); - return $db->queryOneRow(sprintf("select binaries.*, groups.name as groupname from binaries left outer join groups on binaries.groupID = groups.ID where binaries.ID = %d ", $id)); + return $db->queryOneRow(sprintf("select binaries.*, groups.name as groupname from binaries left outer join groups on binaries.groupid = groups.id where binaries.id = %d ", $id)); } /** @@ -1089,8 +1089,8 @@ class Binaries if ($activeonly) $where = " where binaryblacklist.status = 1 "; - return $db->query("SELECT binaryblacklist.ID, binaryblacklist.optype, binaryblacklist.status, binaryblacklist.description, binaryblacklist.groupname AS groupname, binaryblacklist.regex, - groups.ID AS groupID, binaryblacklist.msgcol FROM binaryblacklist + return $db->query("SELECT binaryblacklist.id, binaryblacklist.optype, binaryblacklist.status, binaryblacklist.description, binaryblacklist.groupname AS groupname, binaryblacklist.regex, + groups.id AS groupid, binaryblacklist.msgcol FROM binaryblacklist left outer JOIN groups ON groups.name = binaryblacklist.groupname " . $where . " ORDER BY coalesce(groupname,'zzz')" @@ -1104,7 +1104,7 @@ class Binaries { $db = new DB(); - return $db->queryOneRow(sprintf("select * from binaryblacklist where ID = %d ", $id)); + return $db->queryOneRow(sprintf("select * from binaryblacklist where id = %d ", $id)); } /** @@ -1114,7 +1114,7 @@ class Binaries { $db = new DB(); - return $db->queryExec(sprintf("DELETE from binaryblacklist where ID = %d", $id)); + return $db->queryExec(sprintf("DELETE from binaryblacklist where id = %d", $id)); } /** @@ -1132,7 +1132,7 @@ class Binaries $groupname = sprintf("%s", $db->escapeString($groupname)); } - $db->queryExec(sprintf("update binaryblacklist set groupname=%s, regex=%s, status=%d, description=%s, optype=%d, msgcol=%d where ID = %d ", $groupname, $db->escapeString($regex["regex"]), $regex["status"], $db->escapeString($regex["description"]), $regex["optype"], $regex["msgcol"], $regex["id"])); + $db->queryExec(sprintf("update binaryblacklist set groupname=%s, regex=%s, status=%d, description=%s, optype=%d, msgcol=%d where id = %d ", $groupname, $db->escapeString($regex["regex"]), $regex["status"], $db->escapeString($regex["description"]), $regex["optype"], $regex["msgcol"], $regex["id"])); } /** @@ -1163,7 +1163,7 @@ class Binaries { $db = new DB(); $db->queryExec(sprintf("DELETE from parts where binaryID = %d", $id)); - $db->queryExec(sprintf("DELETE from binaries where ID = %d", $id)); + $db->queryExec(sprintf("DELETE from binaries where id = %d", $id)); } # http://php.net/manual/en/function.array-unique.php#97285 @@ -1315,8 +1315,8 @@ class Binaries sprintf(' SELECT b.date AS date FROM %s b, %s p - WHERE b.ID = p.binaryID - AND b.groupID = %s + WHERE b.id = p.binaryID + AND b.groupid = %s AND p.number = %s LIMIT 1', $group['bname'], $group['pname'], @@ -1409,9 +1409,9 @@ class Binaries } /** - * Delete all Binaries/Parts for a group ID. + * Delete all Binaries/Parts for a group id. * - * @param int $groupID The ID of the group. + * @param int $groupID The id of the group. * * @note A trigger automatically deletes the parts. * @@ -1419,6 +1419,6 @@ class Binaries */ public function purgeGroup($groupID) { - $this->_pdo->queryExec(sprintf('DELETE b FROM binaries b WHERE b.groupID = %d', $groupID)); + $this->_pdo->queryExec(sprintf('DELETE b FROM binaries b WHERE b.groupid = %d', $groupID)); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/book.php b/lib/copy_this/www/lib/book.php index c3f7adbeb..3da302454 100644 --- a/lib/copy_this/www/lib/book.php +++ b/lib/copy_this/www/lib/book.php @@ -29,12 +29,12 @@ class Book } /** - * Get bookinfo row for ID. + * Get bookinfo row for id. */ public function getBookInfo($id) { $db = new DB(); - return $db->queryOneRow(sprintf("SELECT bookinfo.*, genres.title as genres FROM bookinfo left outer join genres on genres.ID = bookinfo.genreID where bookinfo.ID = %d ", $id)); + return $db->queryOneRow(sprintf("SELECT bookinfo.*, genres.title as genres FROM bookinfo left outer join genres on genres.id = bookinfo.genreID where bookinfo.id = %d ", $id)); } /** @@ -67,7 +67,7 @@ class Book public function getCount() { $db = new DB(); - $res = $db->queryOneRow("select count(ID) as num from bookinfo"); + $res = $db->queryOneRow("select count(id) as num from bookinfo"); return $res["num"]; } @@ -85,7 +85,7 @@ class Book else $maxage = ""; - $sql = sprintf("select count(distinct r.bookinfoID) as num from releases r inner join bookinfo b on b.ID = r.bookinfoID and b.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') %s %s", $browseby, $maxage); + $sql = sprintf("select count(distinct r.bookinfoid) as num from releases r inner join bookinfo b on b.id = r.bookinfoid and b.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') %s %s", $browseby, $maxage); $res = $db->queryOneRow($sql, true); return $res["num"]; @@ -110,7 +110,7 @@ class Book $maxagesql = sprintf(" and r.postdate > now() - interval %d day ", $maxage); $order = $this->getBrowseOrder($orderby); - $sql = sprintf(" SELECT r.bookinfoID, max(postdate), b.* from releases r inner join bookinfo b on b.ID = r.bookinfoID and b.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') %s %s group by r.bookinfoID order by %s %s".$limit, $browseby, $maxagesql, $order[0], $order[1]); + $sql = sprintf(" SELECT r.bookinfoid, max(postdate), b.* from releases r inner join bookinfo b on b.id = r.bookinfoid and b.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') %s %s group by r.bookinfoid order by %s %s".$limit, $browseby, $maxagesql, $order[0], $order[1]); $rows = $db->query($sql, true); // @@ -118,7 +118,7 @@ class Book // $ids = ""; foreach ($rows as $row) - $ids .= $row["bookinfoID"]. ", "; + $ids .= $row["bookinfoid"]. ", "; if (strlen($ids) > 0) { @@ -127,7 +127,7 @@ class Book // // get all releases matching these ids // - $sql = sprintf("select r.*, releasenfo.ID as nfoID, groups.name as grpname from releases r left outer join releasenfo on releasenfo.releaseID = r.ID left outer join groups on groups.ID = r.groupID where bookinfoID in (%s) %s order by r.postdate desc", $ids, $maxagesql); + $sql = sprintf("select r.*, releasenfo.id as nfoid, groups.name as grpname from releases r left outer join releasenfo on releasenfo.releaseid = r.id left outer join groups on groups.id = r.groupid where bookinfoid in (%s) %s order by r.postdate desc", $ids, $maxagesql); $allrows = $db->query($sql, true); $arr = array(); @@ -136,20 +136,20 @@ class Book // foreach ($allrows as &$allrow) { - $arr[$allrow["bookinfoID"]]["ID"] = (isset($arr[$allrow["bookinfoID"]]["ID"]) ? $arr[$allrow["bookinfoID"]]["ID"] : "") . $allrow["ID"] . ","; - $arr[$allrow["bookinfoID"]]["rarinnerfilecount"] = (isset($arr[$allrow["bookinfoID"]]["rarinnerfilecount"]) ? $arr[$allrow["bookinfoID"]]["rarinnerfilecount"] : "") . $allrow["rarinnerfilecount"] . ","; - $arr[$allrow["bookinfoID"]]["haspreview"] = (isset($arr[$allrow["bookinfoID"]]["haspreview"]) ? $arr[$allrow["bookinfoID"]]["haspreview"] : "") . $allrow["haspreview"] . ","; - $arr[$allrow["bookinfoID"]]["passwordstatus"] = (isset($arr[$allrow["bookinfoID"]]["passwordstatus"]) ? $arr[$allrow["bookinfoID"]]["passwordstatus"] : "") . $allrow["passwordstatus"] . ","; - $arr[$allrow["bookinfoID"]]["guid"] = (isset($arr[$allrow["bookinfoID"]]["guid"]) ? $arr[$allrow["bookinfoID"]]["guid"] : "") . $allrow["guid"] . ","; - $arr[$allrow["bookinfoID"]]["nfoID"] = (isset($arr[$allrow["bookinfoID"]]["nfoID"]) ? $arr[$allrow["bookinfoID"]]["nfoID"] : "") . $allrow["nfoID"] . ","; - $arr[$allrow["bookinfoID"]]["grpname"] = (isset($arr[$allrow["bookinfoID"]]["grpname"]) ? $arr[$allrow["bookinfoID"]]["grpname"] : "") . $allrow["grpname"] . ","; - $arr[$allrow["bookinfoID"]]["searchname"] = (isset($arr[$allrow["bookinfoID"]]["searchname"]) ? $arr[$allrow["bookinfoID"]]["searchname"] : "") . $allrow["searchname"] . "#"; - $arr[$allrow["bookinfoID"]]["postdate"] = (isset($arr[$allrow["bookinfoID"]]["postdate"]) ? $arr[$allrow["bookinfoID"]]["postdate"] : "") . $allrow["postdate"] . ","; - $arr[$allrow["bookinfoID"]]["size"] = (isset($arr[$allrow["bookinfoID"]]["size"]) ? $arr[$allrow["bookinfoID"]]["size"] : "") . $allrow["size"] . ","; - $arr[$allrow["bookinfoID"]]["totalpart"] = (isset($arr[$allrow["bookinfoID"]]["totalpart"]) ? $arr[$allrow["bookinfoID"]]["totalpart"] : "") . $allrow["totalpart"] . ","; - $arr[$allrow["bookinfoID"]]["comments"] = (isset($arr[$allrow["bookinfoID"]]["comments"]) ? $arr[$allrow["bookinfoID"]]["comments"] : "") . $allrow["comments"] . ","; - $arr[$allrow["bookinfoID"]]["grabs"] = (isset($arr[$allrow["bookinfoID"]]["grabs"]) ? $arr[$allrow["bookinfoID"]]["grabs"] : "") . $allrow["grabs"] . ","; - $arr[$allrow["bookinfoID"]]["categoryID"] = (isset($arr[$allrow["bookinfoID"]]["categoryID"]) ? $arr[$allrow["bookinfoID"]]["categoryID"] : "") . $allrow["categoryID"] . ","; + $arr[$allrow["bookinfoid"]]["id"] = (isset($arr[$allrow["bookinfoid"]]["id"]) ? $arr[$allrow["bookinfoid"]]["id"] : "") . $allrow["id"] . ","; + $arr[$allrow["bookinfoid"]]["rarinnerfilecount"] = (isset($arr[$allrow["bookinfoid"]]["rarinnerfilecount"]) ? $arr[$allrow["bookinfoid"]]["rarinnerfilecount"] : "") . $allrow["rarinnerfilecount"] . ","; + $arr[$allrow["bookinfoid"]]["haspreview"] = (isset($arr[$allrow["bookinfoid"]]["haspreview"]) ? $arr[$allrow["bookinfoid"]]["haspreview"] : "") . $allrow["haspreview"] . ","; + $arr[$allrow["bookinfoid"]]["passwordstatus"] = (isset($arr[$allrow["bookinfoid"]]["passwordstatus"]) ? $arr[$allrow["bookinfoid"]]["passwordstatus"] : "") . $allrow["passwordstatus"] . ","; + $arr[$allrow["bookinfoid"]]["guid"] = (isset($arr[$allrow["bookinfoid"]]["guid"]) ? $arr[$allrow["bookinfoid"]]["guid"] : "") . $allrow["guid"] . ","; + $arr[$allrow["bookinfoid"]]["nfoid"] = (isset($arr[$allrow["bookinfoid"]]["nfoid"]) ? $arr[$allrow["bookinfoid"]]["nfoid"] : "") . $allrow["nfoid"] . ","; + $arr[$allrow["bookinfoid"]]["grpname"] = (isset($arr[$allrow["bookinfoid"]]["grpname"]) ? $arr[$allrow["bookinfoid"]]["grpname"] : "") . $allrow["grpname"] . ","; + $arr[$allrow["bookinfoid"]]["searchname"] = (isset($arr[$allrow["bookinfoid"]]["searchname"]) ? $arr[$allrow["bookinfoid"]]["searchname"] : "") . $allrow["searchname"] . "#"; + $arr[$allrow["bookinfoid"]]["postdate"] = (isset($arr[$allrow["bookinfoid"]]["postdate"]) ? $arr[$allrow["bookinfoid"]]["postdate"] : "") . $allrow["postdate"] . ","; + $arr[$allrow["bookinfoid"]]["size"] = (isset($arr[$allrow["bookinfoid"]]["size"]) ? $arr[$allrow["bookinfoid"]]["size"] : "") . $allrow["size"] . ","; + $arr[$allrow["bookinfoid"]]["totalpart"] = (isset($arr[$allrow["bookinfoid"]]["totalpart"]) ? $arr[$allrow["bookinfoid"]]["totalpart"] : "") . $allrow["totalpart"] . ","; + $arr[$allrow["bookinfoid"]]["comments"] = (isset($arr[$allrow["bookinfoid"]]["comments"]) ? $arr[$allrow["bookinfoid"]]["comments"] : "") . $allrow["comments"] . ","; + $arr[$allrow["bookinfoid"]]["grabs"] = (isset($arr[$allrow["bookinfoid"]]["grabs"]) ? $arr[$allrow["bookinfoid"]]["grabs"] : "") . $allrow["grabs"] . ","; + $arr[$allrow["bookinfoid"]]["categoryid"] = (isset($arr[$allrow["bookinfoid"]]["categoryid"]) ? $arr[$allrow["bookinfoid"]]["categoryid"] : "") . $allrow["categoryid"] . ","; } // @@ -157,20 +157,20 @@ class Book // foreach ($rows as &$row) { - $row["grp_release_id"] = substr($arr[$row["bookinfoID"]]["ID"], 0, -1); - $row["grp_rarinnerfilecount"] = substr($arr[$row["bookinfoID"]]["rarinnerfilecount"], 0, -1); - $row["grp_haspreview"] = substr($arr[$row["bookinfoID"]]["haspreview"], 0, -1); - $row["grp_release_password"] = substr($arr[$row["bookinfoID"]]["passwordstatus"], 0, -1); - $row["grp_release_guid"] = substr($arr[$row["bookinfoID"]]["guid"], 0, -1); - $row["grp_release_nfoID"] = substr($arr[$row["bookinfoID"]]["nfoID"], 0, -1); - $row["grp_release_grpname"] = substr($arr[$row["bookinfoID"]]["grpname"], 0, -1); - $row["grp_release_name"] = substr($arr[$row["bookinfoID"]]["searchname"], 0, -1); - $row["grp_release_postdate"] = substr($arr[$row["bookinfoID"]]["postdate"], 0, -1); - $row["grp_release_size"] = substr($arr[$row["bookinfoID"]]["size"], 0, -1); - $row["grp_release_totalparts"] = substr($arr[$row["bookinfoID"]]["totalpart"], 0, -1); - $row["grp_release_comments"] = substr($arr[$row["bookinfoID"]]["comments"], 0, -1); - $row["grp_release_grabs"] = substr($arr[$row["bookinfoID"]]["grabs"], 0, -1); - $row["grp_release_categoryID"] = substr($arr[$row["bookinfoID"]]["categoryID"], 0, -1); + $row["grp_release_id"] = substr($arr[$row["bookinfoid"]]["id"], 0, -1); + $row["grp_rarinnerfilecount"] = substr($arr[$row["bookinfoid"]]["rarinnerfilecount"], 0, -1); + $row["grp_haspreview"] = substr($arr[$row["bookinfoid"]]["haspreview"], 0, -1); + $row["grp_release_password"] = substr($arr[$row["bookinfoid"]]["passwordstatus"], 0, -1); + $row["grp_release_guid"] = substr($arr[$row["bookinfoid"]]["guid"], 0, -1); + $row["grp_release_nfoID"] = substr($arr[$row["bookinfoid"]]["nfoid"], 0, -1); + $row["grp_release_grpname"] = substr($arr[$row["bookinfoid"]]["grpname"], 0, -1); + $row["grp_release_name"] = substr($arr[$row["bookinfoid"]]["searchname"], 0, -1); + $row["grp_release_postdate"] = substr($arr[$row["bookinfoid"]]["postdate"], 0, -1); + $row["grp_release_size"] = substr($arr[$row["bookinfoid"]]["size"], 0, -1); + $row["grp_release_totalparts"] = substr($arr[$row["bookinfoid"]]["totalpart"], 0, -1); + $row["grp_release_comments"] = substr($arr[$row["bookinfoid"]]["comments"], 0, -1); + $row["grp_release_grabs"] = substr($arr[$row["bookinfoid"]]["grabs"], 0, -1); + $row["grp_release_categoryID"] = substr($arr[$row["bookinfoid"]]["categoryid"], 0, -1); } } return $rows; @@ -250,7 +250,7 @@ class Book { $db = new DB(); - $db->queryExec(sprintf("update bookinfo SET title=%s, asin=%s, url=%s, author=%s, publisher=%s, publishdate='%s', cover=%d, updateddate=NOW() WHERE ID = %d", + $db->queryExec(sprintf("update bookinfo SET title=%s, asin=%s, url=%s, author=%s, publisher=%s, publishdate='%s', cover=%d, updateddate=NOW() WHERE id = %d", $db->escapeString($title), $db->escapeString($asin), $db->escapeString($url), $db->escapeString($author), $db->escapeString($publisher), $publishdate, $cover, $id)); } @@ -371,7 +371,7 @@ class Book $db = new DB(); $numlookedup = 0; - $res = $db->queryDirect(sprintf("SELECT searchname, ID from releases where bookinfoID IS NULL and categoryID = %d ORDER BY postdate DESC LIMIT 100", Category::CAT_BOOK_EBOOK)); + $res = $db->queryDirect(sprintf("SELECT searchname, id from releases where bookinfoid IS NULL and categoryid = %d ORDER BY postdate DESC LIMIT 100", Category::CAT_BOOK_EBOOK)); if ($db->getNumRows($res) > 0) { if ($this->echooutput) @@ -406,10 +406,10 @@ class Book } else { - $bookId = $bookCheck["ID"]; + $bookId = $bookCheck["id"]; } } - $db->queryExec(sprintf("update releases SET bookinfoID = %d WHERE ID = %d", $bookId, $arr["ID"])); + $db->queryExec(sprintf("update releases SET bookinfoid = %d WHERE id = %d", $bookId, $arr["id"])); } } } diff --git a/lib/copy_this/www/lib/category.php b/lib/copy_this/www/lib/category.php index 3179dd92a..c95ddb7e2 100644 --- a/lib/copy_this/www/lib/category.php +++ b/lib/copy_this/www/lib/category.php @@ -103,14 +103,14 @@ class Category $children = $this->getChildren($category); foreach ($children as $child) { - $chlist .= ', ' . $child['ID']; + $chlist .= ', ' . $child['id']; } } if ($chlist != '-99') { - $catsrch .= ' r.categoryID IN (' . $chlist . ') OR '; + $catsrch .= ' r.categoryid IN (' . $chlist . ') OR '; } else { - $catsrch .= sprintf(' r.categoryID = %d OR ', $category); + $catsrch .= sprintf(' r.categoryid = %d OR ', $category); } $catsrch .= '1=2 )'; } @@ -124,7 +124,7 @@ class Category public function isParent($cid) { $db = new DB(); - $ret = $db->queryOneRow(sprintf("select count(*) as count from category where ID = %d and parentID is null", $cid), true); + $ret = $db->queryOneRow(sprintf("select count(*) as count from category where id = %d and parentid is null", $cid), true); if ($ret['count']) return true; else @@ -138,7 +138,7 @@ class Category { $db = new DB(); - return $db->query(sprintf("select c.* from category c where parentID = %d", $cid), true); + return $db->query(sprintf("select c.* from category c where parentid = %d", $cid), true); } /** @@ -151,7 +151,7 @@ class Category if ($activeonly) $act = sprintf(" where c.status = %d ", Category::STATUS_ACTIVE); - return $db->query("select c.*, (SELECT title FROM category WHERE ID=c.parentID) AS parentName from category c " . $act . " ORDER BY c.ID"); + return $db->query("select c.*, (SELECT title FROM category WHERE id=c.parentid) AS parentName from category c " . $act . " ORDER BY c.id"); } /** @@ -163,11 +163,11 @@ class Category { $db = new DB(); - return $db->query("SELECT title FROM category WHERE parentID IS NULL AND status = 1"); + return $db->query("SELECT title FROM category WHERE parentid IS NULL AND status = 1"); } /** - * Returns category ID's for site disabled categories. + * Returns category id's for site disabled categories. * * @return array */ @@ -175,23 +175,23 @@ class Category { $db = new DB(); - return $db->query("SELECT ID FROM category WHERE status = 2 OR parentID IN (SELECT ID FROM category WHERE status = 2 AND parentID IS NULL)"); + return $db->query("SELECT id FROM category WHERE status = 2 OR parentid IN (SELECT id FROM category WHERE status = 2 AND parentid IS NULL)"); } /** - * Get a category row by its ID. + * Get a category row by its id. */ public function getById($id) { $db = new DB(); - return $db->queryOneRow(sprintf("SELECT c.disablepreview, c.ID, c.description, c.minsizetoformrelease, c.maxsizetoformrelease, CONCAT(COALESCE(cp.title,'') , CASE WHEN cp.title IS NULL THEN '' ELSE ' > ' END , c.title) as title, c.status, c.parentID from category c left outer join category cp on cp.ID = c.parentID where c.ID = %d", $id)); + return $db->queryOneRow(sprintf("SELECT c.disablepreview, c.id, c.description, c.minsizetoformrelease, c.maxsizetoformrelease, CONCAT(COALESCE(cp.title,'') , CASE WHEN cp.title IS NULL THEN '' ELSE ' > ' END , c.title) as title, c.status, c.parentid from category c left outer join category cp on cp.id = c.parentid where c.id = %d", $id)); } public function getSizeRangeById($id) { $db = new DB(); $res = $db->queryOneRow(sprintf("SELECT c.minsizetoformrelease, c.maxsizetoformrelease, cp.minsizetoformrelease as p_minsizetoformrelease, cp.maxsizetoformrelease as p_maxsizetoformrelease" . - " from category c left outer join category cp on cp.ID = c.parentID where c.ID = %d", $id + " from category c left outer join category cp on cp.id = c.parentid where c.id = %d", $id ) ); if (!$res) @@ -237,14 +237,14 @@ class Category { $db = new DB(); - return $db->query(sprintf("SELECT concat(cp.title, ' > ',c.title) as title from category c inner join category cp on cp.ID = c.parentID where c.ID in (%s)", implode(',', $ids))); + return $db->query(sprintf("SELECT concat(cp.title, ' > ',c.title) as title from category c inner join category cp on cp.id = c.parentid where c.id in (%s)", implode(',', $ids))); } public function getNameByID($ID) { $db = new DB(); - $parent = $db->queryOneRow(sprintf("SELECT title FROM category WHERE ID = %d", substr($ID, 0, 1) . "000")); - $cat = $db->queryOneRow(sprintf("SELECT title FROM category WHERE ID = %d", $ID)); + $parent = $db->queryOneRow(sprintf("SELECT title FROM category WHERE id = %d", substr($ID, 0, 1) . "000")); + $cat = $db->queryOneRow(sprintf("SELECT title FROM category WHERE id = %d", $ID)); return $parent["title"] . " " . $cat["title"]; } @@ -256,7 +256,7 @@ class Category { $db = new DB(); - return $db->queryExec(sprintf("update category set disablepreview = %d, status = %d, minsizetoformrelease = %d, maxsizetoformrelease = %d, description = %s where ID = %d", $disablepreview, $status, $minsize, $maxsize, $db->escapeString($desc), $id)); + return $db->queryExec(sprintf("update category set disablepreview = %d, status = %d, minsizetoformrelease = %d, maxsizetoformrelease = %d, description = %s where id = %d", $disablepreview, $status, $minsize, $maxsize, $db->escapeString($desc), $id)); } /** @@ -269,18 +269,18 @@ class Category $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and ID not in (" . implode(",", $excludedcats) . ")"; + $exccatlist = " and id not in (" . implode(",", $excludedcats) . ")"; $arr = $db->query(sprintf("select * from category where status = %d %s", Category::STATUS_ACTIVE, $exccatlist), true); foreach ($arr as $a) - if ($a["parentID"] == "") + if ($a["parentid"] == "") $ret[] = $a; foreach ($ret as $key => $parent) { $subcatlist = array(); $subcatnames = array(); foreach ($arr as $a) { - if ($a["parentID"] == $parent["ID"]) { + if ($a["parentid"] == $parent["id"]) { $subcatlist[] = $a; $subcatnames[] = $a["title"]; } @@ -310,7 +310,7 @@ class Category } foreach ($categories as $category) - $temp_array[$category["ID"]] = $category["title"]; + $temp_array[$category["id"]] = $category["title"]; return $temp_array; } @@ -324,7 +324,7 @@ class Category $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and c.ID not in (" . implode(",", $excludedcats) . ")"; + $exccatlist = " and c.id not in (" . implode(",", $excludedcats) . ")"; $act = ""; if ($activeonly) @@ -333,7 +333,7 @@ class Category if ($exccatlist != "") $act .= $exccatlist; - return $db->query("select c.ID, concat(cp.title, ' > ',c.title) as title, cp.ID as parentID, c.status from category c inner join category cp on cp.ID = c.parentID " . $act . " ORDER BY c.ID", true); + return $db->query("select c.id, concat(cp.title, ' > ',c.title) as title, cp.id as parentid, c.status from category c inner join category cp on cp.id = c.parentid " . $act . " ORDER BY c.id", true); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/console.php b/lib/copy_this/www/lib/console.php index 5adc2a28f..a723e7636 100644 --- a/lib/copy_this/www/lib/console.php +++ b/lib/copy_this/www/lib/console.php @@ -31,12 +31,12 @@ class Console } /** - * Get consoleinfo row by ID. + * Get consoleinfo row by id. */ public function getConsoleInfo($id) { $db = new DB(); - return $db->queryOneRow(sprintf("SELECT consoleinfo.*, genres.title as genres FROM consoleinfo left outer join genres on genres.ID = consoleinfo.genreID where consoleinfo.ID = %d ", $id)); + return $db->queryOneRow(sprintf("SELECT consoleinfo.*, genres.title as genres FROM consoleinfo left outer join genres on genres.id = consoleinfo.genreID where consoleinfo.id = %d ", $id)); } /** @@ -69,7 +69,7 @@ class Console public function getCount() { $db = new DB(); - $res = $db->queryOneRow("select count(ID) as num from consoleinfo"); + $res = $db->queryOneRow("select count(id) as num from consoleinfo"); return $res["num"]; } @@ -96,14 +96,14 @@ class Console $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist.=", ".$child["ID"]; + $chlist.=", ".$child["id"]; if ($chlist != "-99") - $catsrch .= " r.categoryID in (".$chlist.") or "; + $catsrch .= " r.categoryid in (".$chlist.") or "; } else { - $catsrch .= sprintf(" r.categoryID = %d or ", $category); + $catsrch .= sprintf(" r.categoryid = %d or ", $category); } } } @@ -117,9 +117,9 @@ class Console $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and r.categoryID not in (".implode(",", $excludedcats).")"; + $exccatlist = " and r.categoryid not in (".implode(",", $excludedcats).")"; - $sql = sprintf("select count(r.ID) as num from releases r inner join consoleinfo con on con.ID = r.consoleinfoID and con.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s", $browseby, $catsrch, $maxage, $exccatlist); + $sql = sprintf("select count(r.id) as num from releases r inner join consoleinfo con on con.id = r.consoleinfoid and con.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s", $browseby, $catsrch, $maxage, $exccatlist); $res = $db->queryOneRow($sql, true); return $res["num"]; } @@ -152,14 +152,14 @@ class Console $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist.=", ".$child["ID"]; + $chlist.=", ".$child["id"]; if ($chlist != "-99") - $catsrch .= " r.categoryID in (".$chlist.") or "; + $catsrch .= " r.categoryid in (".$chlist.") or "; } else { - $catsrch .= sprintf(" r.categoryID = %d or ", $category); + $catsrch .= sprintf(" r.categoryid = %d or ", $category); } } } @@ -172,10 +172,10 @@ class Console $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and r.categoryID not in (".implode(",", $excludedcats).")"; + $exccatlist = " and r.categoryid not in (".implode(",", $excludedcats).")"; $order = $this->getConsoleOrder($orderby); - $sql = sprintf(" SELECT r.*, r.ID as releaseID, con.*, g.title as genre, groups.name as group_name, concat(cp.title, ' > ', c.title) as category_name, concat(cp.ID, ',', c.ID) as category_ids, rn.ID as nfoID from releases r left outer join groups on groups.ID = r.groupID inner join consoleinfo con on con.ID = r.consoleinfoID left outer join releasenfo rn on rn.releaseID = r.ID and rn.nfo is not null left outer join category c on c.ID = r.categoryID left outer join category cp on cp.ID = c.parentID left outer join genres g on g.ID = con.genreID where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s order by %s %s".$limit, $browseby, $catsrch, $maxagesql, $exccatlist, $order[0], $order[1]); + $sql = sprintf(" SELECT r.*, r.id as releaseid, con.*, g.title as genre, groups.name as group_name, concat(cp.title, ' > ', c.title) as category_name, concat(cp.id, ',', c.id) as category_ids, rn.id as nfoid from releases r left outer join groups on groups.id = r.groupid inner join consoleinfo con on con.id = r.consoleinfoid left outer join releasenfo rn on rn.releaseid = r.id and rn.nfo is not null left outer join category c on c.id = r.categoryid left outer join category cp on cp.id = c.parentid left outer join genres g on g.id = con.genreID where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s order by %s %s".$limit, $browseby, $catsrch, $maxagesql, $exccatlist, $order[0], $order[1]); return $db->query($sql, true); } @@ -258,7 +258,7 @@ class Console { $db = new DB(); - $db->queryExec(sprintf("update consoleinfo SET title=%s, asin=%s, url=%s, salesrank=%s, platform=%s, publisher=%s, releasedate='%s', esrb=%s, cover=%d, genreID=%d, updateddate=NOW() WHERE ID = %d", + $db->queryExec(sprintf("update consoleinfo SET title=%s, asin=%s, url=%s, salesrank=%s, platform=%s, publisher=%s, releasedate='%s', esrb=%s, cover=%d, genreID=%d, updateddate=NOW() WHERE id = %d", $db->escapeString($title), $db->escapeString($asin), $db->escapeString($url), $salesrank, $db->escapeString($platform), $db->escapeString($publisher), $releasedate, $db->escapeString($esrb), $cover, $genreID, $id)); } @@ -280,7 +280,7 @@ class Console $defaultGenres = $gen->getGenres(Genres::CONSOLE_TYPE); $genreassoc = array(); foreach($defaultGenres as $dg) { - $genreassoc[$dg['ID']] = strtolower($dg['title']); + $genreassoc[$dg['id']] = strtolower($dg['title']); } // @@ -523,7 +523,7 @@ class Console $db = new DB(); $numlookedup = 0; - $res = $db->queryDirect(sprintf("SELECT searchname, ID from releases where consoleinfoID IS NULL and categoryID in ( select ID from category where parentID = %d ) ORDER BY postdate DESC LIMIT 100", Category::CAT_PARENT_GAME)); + $res = $db->queryDirect(sprintf("SELECT searchname, id from releases where consoleinfoid IS NULL and categoryid in ( select id from category where parentid = %d ) ORDER BY postdate DESC LIMIT 100", Category::CAT_PARENT_GAME)); if ( $db->getNumRows($res) > 0) { if ($this->echooutput) @@ -555,16 +555,16 @@ class Console } else { - $gameId = $gameCheck["ID"]; + $gameId = $gameCheck["id"]; } //update release - $db->queryExec(sprintf("update releases SET consoleinfoID = %d WHERE ID = %d", $gameId, $arr["ID"])); + $db->queryExec(sprintf("update releases SET consoleinfoid = %d WHERE id = %d", $gameId, $arr["id"])); } else { //could not parse release title - $db->queryExec(sprintf("update releases SET consoleinfoID = %d WHERE ID = %d", -2, $arr["ID"])); + $db->queryExec(sprintf("update releases SET consoleinfoid = %d WHERE id = %d", -2, $arr["id"])); } } } @@ -624,7 +624,7 @@ class Console $result['release'] = $releasename; array_map("trim", $result); //make sure we got a title and platform otherwise the resulting lookup will probably be shit - //other option is to pass the $release->categoryID here if we dont find a platform but that would require an extra lookup to determine the name + //other option is to pass the $release->categoryid here if we dont find a platform but that would require an extra lookup to determine the name //in either case we should have a title at the minimum return (isset($result['title']) && !empty($result['title']) && isset($result['platform'])) ? $result : false; } diff --git a/lib/copy_this/www/lib/content.php b/lib/copy_this/www/lib/content.php index 6975b571b..0727348f7 100644 --- a/lib/copy_this/www/lib/content.php +++ b/lib/copy_this/www/lib/content.php @@ -80,7 +80,7 @@ class Contents } /** - * Get a content row by its ID. + * Get a content row by its id. */ public function getByID($id, $role) { diff --git a/lib/copy_this/www/lib/episode.php b/lib/copy_this/www/lib/episode.php index c579965bb..00d5d0f59 100644 --- a/lib/copy_this/www/lib/episode.php +++ b/lib/copy_this/www/lib/episode.php @@ -7,12 +7,12 @@ require_once(WWW_DIR."/lib/framework/db.php"); class Episode { /** - * Get an episodeinfo row by ID. + * Get an episodeinfo row by id. */ public function getEpisodeInfoByID($episodeinfoID) { $db = new DB(); - return $db->queryOneRow(sprintf('SELECT * FROM episodeinfo WHERE ID = %d', $episodeinfoID)); + return $db->queryOneRow(sprintf('SELECT * FROM episodeinfo WHERE id = %d', $episodeinfoID)); } /** diff --git a/lib/copy_this/www/lib/forum.php b/lib/copy_this/www/lib/forum.php index 8d8c12d9b..4f7d7ea71 100644 --- a/lib/copy_this/www/lib/forum.php +++ b/lib/copy_this/www/lib/forum.php @@ -22,10 +22,10 @@ class Forum if ($par == false) return -1; - $db->queryExec(sprintf("update forumpost set replies = replies + 1, updateddate = now() where ID = %d", $parentid)); + $db->queryExec(sprintf("update forumpost set replies = replies + 1, updateddate = now() where id = %d", $parentid)); } - $db->queryInsert(sprintf("INSERT INTO `forumpost` (`forumID`,`parentID`,`userID`,`subject`,`message`, `locked`, `sticky`, `replies`, `createddate`, `updateddate`) VALUES ( 1, %d, %d, %s, %s, %d, %d, %d,NOW(), NOW())", + $db->queryInsert(sprintf("INSERT INTO `forumpost` (`forumID`,`parentid`,`userid`,`subject`,`message`, `locked`, `sticky`, `replies`, `createddate`, `updateddate`) VALUES ( 1, %d, %d, %s, %s, %d, %d, %d,NOW(), NOW())", $parentid, $userid, $db->escapeString($subject) , $db->escapeString($message), $locked, $sticky, $replies)); } @@ -35,7 +35,7 @@ class Forum public function getParent($parent) { $db = new DB(); - return $db->queryOneRow(sprintf(" SELECT forumpost.*, users.username from forumpost left outer join users on users.ID = forumpost.userID where forumpost.ID = %d ", $parent)); + return $db->queryOneRow(sprintf(" SELECT forumpost.*, users.username from forumpost left outer join users on users.id = forumpost.userid where forumpost.id = %d ", $parent)); } /** @@ -44,7 +44,7 @@ class Forum public function getRecentPosts($limit) { $db = new DB(); - return $db->query(sprintf("select forumpost.*, users.username from forumpost join (select case when parentID = 0 then ID else parentID end as ID, max(createddate) from forumpost group by case when parentID = 0 then ID else parentID end order by max(createddate) desc) x on x.ID = forumpost.ID inner join users on userID = users.ID limit %d", $limit)); + return $db->query(sprintf("select forumpost.*, users.username from forumpost join (select case when parentid = 0 then id else parentid end as id, max(createddate) from forumpost group by case when parentid = 0 then id else parentid end order by max(createddate) desc) x on x.id = forumpost.id inner join users on userid = users.id limit %d", $limit)); } @@ -54,16 +54,16 @@ class Forum public function getPosts($parent) { $db = new DB(); - return $db->query(sprintf(" SELECT forumpost.*, CASE WHEN role=%d THEN 1 ELSE 0 END AS 'isadmin', users.username from forumpost left outer join users on users.ID = forumpost.userID where forumpost.ID = %d or parentID = %d order by createddate asc limit 250", Users::ROLE_ADMIN, $parent, $parent)); + return $db->query(sprintf(" SELECT forumpost.*, CASE WHEN role=%d THEN 1 ELSE 0 END AS 'isadmin', users.username from forumpost left outer join users on users.id = forumpost.userid where forumpost.id = %d or parentid = %d order by createddate asc limit 250", Users::ROLE_ADMIN, $parent, $parent)); } /** - * Get a forumpost by its ID. + * Get a forumpost by its id. */ public function getPost($id) { $db = new DB(); - return $db->queryOneRow(sprintf(" SELECT * from forumpost where ID = %d", $id)); + return $db->queryOneRow(sprintf(" SELECT * from forumpost where id = %d", $id)); } /** @@ -72,7 +72,7 @@ class Forum public function getBrowseCount() { $db = new DB(); - $res = $db->queryOneRow(sprintf("select count(ID) as num from forumpost where parentID = 0")); + $res = $db->queryOneRow(sprintf("select count(id) as num from forumpost where parentid = 0")); return $res["num"]; } @@ -88,7 +88,7 @@ class Forum else $limit = " LIMIT ".$start.",".$num; - return $db->query(sprintf(" SELECT forumpost.*, users.username from forumpost left outer join users on users.ID = forumpost.userID where parentID = 0 order by updateddate desc".$limit )); + return $db->query(sprintf(" SELECT forumpost.*, users.username from forumpost left outer join users on users.id = forumpost.userid where parentid = 0 order by updateddate desc".$limit )); } /** @@ -97,7 +97,7 @@ class Forum public function deleteParent($parent) { $db = new DB(); - $db->queryExec(sprintf("DELETE from forumpost where ID = %d or parentID = %d", $parent, $parent)); + $db->queryExec(sprintf("DELETE from forumpost where id = %d or parentid = %d", $parent, $parent)); } /** @@ -109,10 +109,10 @@ class Forum $post = $this->getPost($id); if ($post) { - if ($post["parentID"] == "0") + if ($post["parentid"] == "0") $this->deleteParent($id); else - $db->queryExec(sprintf("DELETE from forumpost where ID = %d", $id)); + $db->queryExec(sprintf("DELETE from forumpost where id = %d", $id)); } } @@ -122,7 +122,7 @@ class Forum public function deleteUser($id) { $db = new DB(); - $db->queryExec(sprintf("DELETE from forumpost where userID = %d", $id)); + $db->queryExec(sprintf("DELETE from forumpost where userid = %d", $id)); } /** @@ -131,7 +131,7 @@ class Forum public function getCountForUser($uid) { $db = new DB(); - $res = $db->queryOneRow(sprintf("select count(ID) as num from forumpost where userID = %d", $uid)); + $res = $db->queryOneRow(sprintf("select count(id) as num from forumpost where userid = %d", $uid)); return $res["num"]; } @@ -147,6 +147,6 @@ class Forum else $limit = " LIMIT ".$start.",".$num; - return $db->query(sprintf(" SELECT forumpost.*, users.username FROM forumpost LEFT OUTER JOIN users ON users.ID = forumpost.userID where userID = %d order by forumpost.createddate desc ".$limit, $uid)); + return $db->query(sprintf(" SELECT forumpost.*, users.username FROM forumpost LEFT OUTER JOIN users ON users.id = forumpost.userid where userid = %d order by forumpost.createddate desc ".$limit, $uid)); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/framework/basepage.php b/lib/copy_this/www/lib/framework/basepage.php index 04c6249a0..4e86ab874 100644 --- a/lib/copy_this/www/lib/framework/basepage.php +++ b/lib/copy_this/www/lib/framework/basepage.php @@ -93,7 +93,7 @@ class BasePage //update lastlogin every 15 mins if (strtotime($this->userdata['now'])-900 > strtotime($this->userdata['lastlogin'])) - $users->updateSiteAccessed($this->userdata['ID']); + $users->updateSiteAccessed($this->userdata['id']); $this->smarty->assign('userdata',$this->userdata); $this->smarty->assign('loggedin',"true"); diff --git a/lib/copy_this/www/lib/framework/db.php b/lib/copy_this/www/lib/framework/db.php index e5d2893a5..05d31f9ed 100644 --- a/lib/copy_this/www/lib/framework/db.php +++ b/lib/copy_this/www/lib/framework/db.php @@ -862,7 +862,7 @@ class DB extends \PDO $tableNames = ''; foreach ($tableArray as $table) { - $tableNames .= $table['Name'] . ','; + $tableNames .= $table['name'] . ','; } $tableNames = rtrim($tableNames, ','); @@ -878,7 +878,7 @@ class DB extends \PDO if ($myIsamTables instanceof \Traversable && $myIsamTables->rowCount()) { $tableNames = ''; foreach ($myIsamTables as $table) { - $tableNames .= $table['Name'] . ','; + $tableNames .= $table['name'] . ','; } $tableNames = rtrim($tableNames, ','); $this->queryExec(sprintf('REPAIR %s TABLE %s', $local, $tableNames)); diff --git a/lib/copy_this/www/lib/genres.php b/lib/copy_this/www/lib/genres.php index 50843c79a..d97f14729 100644 --- a/lib/copy_this/www/lib/genres.php +++ b/lib/copy_this/www/lib/genres.php @@ -48,19 +48,19 @@ class Genres FROM genres g INNER JOIN (SELECT DISTINCT genreID FROM musicinfo) x - ON x.genreID = g.ID %1\$s + ON x.genreID = g.id %1\$s UNION SELECT g.* FROM genres g INNER JOIN (SELECT DISTINCT genreID FROM consoleinfo) x - ON x.genreID = g.ID %1\$s + ON x.genreID = g.id %1\$s UNION SELECT g.* FROM genres g INNER JOIN (SELECT DISTINCT genre_id FROM gamesinfo) x - ON x.genre_id = g.ID %1\$s + ON x.genre_id = g.id %1\$s ORDER BY title", $typesql ); @@ -92,23 +92,23 @@ class Genres FROM genres g INNER JOIN (SELECT DISTINCT genreID FROM musicinfo) x - ON x.genreID = g.ID %1\$s + ON x.genreID = g.id %1\$s + SELECT COUNT(*) AS num FROM genres g INNER JOIN (SELECT DISTINCT genreID FROM consoleinfo) y - ON y.genreID = g.ID %1\$s + ON y.genreID = g.id %1\$s + SELECT COUNT(*) AS num FROM genres g INNER JOIN (SELECT DISTINCT genre_id FROM gamesinfo) x - ON x.genre_id = g.ID %1\$s", + ON x.genre_id = g.id %1\$s", $typesql ); else - $sql = sprintf("SELECT COUNT(g.ID) AS num FROM genres g WHERE 1 %s ORDER BY g.title", $typesql); + $sql = sprintf("SELECT COUNT(g.id) AS num FROM genres g WHERE 1 %s ORDER BY g.title", $typesql); $res = $this->pdo->queryOneRow($sql); @@ -117,16 +117,16 @@ class Genres public function getById($id) { - return $this->pdo->queryOneRow(sprintf("SELECT * FROM genres WHERE ID = %d", $id)); + return $this->pdo->queryOneRow(sprintf("SELECT * FROM genres WHERE id = %d", $id)); } public function update($id, $disabled) { - return $this->pdo->queryExec(sprintf("UPDATE genres SET disabled = %d WHERE ID = %d", $disabled, $id)); + return $this->pdo->queryExec(sprintf("UPDATE genres SET disabled = %d WHERE id = %d", $disabled, $id)); } public function getDisabledIDs() { - return $this->pdo->query("SELECT ID FROM genres WHERE disabled = 1"); + return $this->pdo->query("SELECT id FROM genres WHERE disabled = 1"); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/groups.php b/lib/copy_this/www/lib/groups.php index 5f018e8e1..487006f96 100644 --- a/lib/copy_this/www/lib/groups.php +++ b/lib/copy_this/www/lib/groups.php @@ -62,7 +62,7 @@ class Groups return $this->pdo->query(sprintf("SELECT groups.*, COALESCE(rel.num, 0) AS num_releases FROM groups LEFT OUTER JOIN - ( SELECT groupID, COUNT(ID) AS num FROM releases group by groupID ) rel ON rel.groupID = groups.ID + ( SELECT groupid, COUNT(id) AS num FROM releases group by groupid ) rel ON rel.groupid = groups.id ORDER BY %s", $orderby ) ); @@ -86,13 +86,13 @@ class Groups } /** - * Get a group row by its ID. + * Get a group row by its id. */ public function getByID($id) { - return $this->pdo->queryOneRow(sprintf("select * from groups where ID = %d ", $id)); + return $this->pdo->queryOneRow(sprintf("select * from groups where id = %d ", $id)); } /** @@ -115,16 +115,16 @@ class Groups } /** - * Get a group name using its ID. + * Get a group name using its id. * - * @param int|string $id The group ID. + * @param int|string $id The group id. * * @return string Empty string on failure, groupName on success. */ public function getByNameByID($id) { - $res = $this->pdo->queryOneRow(sprintf("SELECT name FROM groups WHERE ID = %d ", $id)); + $res = $this->pdo->queryOneRow(sprintf("SELECT name FROM groups WHERE id = %d ", $id)); return ($res === false ? '' : $res["name"]); } @@ -133,13 +133,13 @@ class Groups * * @param string $name The group name. * - * @return string Empty string on failure, groupID on success. + * @return string Empty string on failure, groupid on success. */ public function getIDByName($name) { - $res = $this->pdo->queryOneRow(sprintf("SELECT ID FROM groups WHERE name = %s", $this->pdo->escapeString($name))); - return ($res === false ? '' : $res["ID"]); + $res = $this->pdo->queryOneRow(sprintf("SELECT id FROM groups WHERE name = %s", $this->pdo->escapeString($name))); + return ($res === false ? '' : $res["id"]); } /** @@ -156,7 +156,7 @@ class Groups if ($activeonly == true) $grpsql .= "and active=1 "; - $res = $this->pdo->queryOneRow(sprintf("select count(ID) as num from groups where 1=1 %s", $grpsql)); + $res = $this->pdo->queryOneRow(sprintf("select count(id) as num from groups where 1=1 %s", $grpsql)); return $res["num"]; } @@ -182,8 +182,8 @@ class Groups FROM groups LEFT OUTER JOIN ( - SELECT groupID, COUNT(ID) AS num FROM releases group by groupID - ) rel ON rel.groupID = groups.ID WHERE 1=1 %s ORDER BY groups.name " . $limit, $grpsql + SELECT groupid, COUNT(id) AS num FROM releases group by groupid + ) rel ON rel.groupid = groups.id WHERE 1=1 %s ORDER BY groups.name " . $limit, $grpsql ); return $this->pdo->query($sql); @@ -216,7 +216,7 @@ class Groups "UPDATE groups SET name = %s, description = %s, backfill_target = %s, first_record = %s, last_record = %s, last_updated = NOW(), active = %s, backfill = %s, %s %s, regexmatchonly = %s - WHERE ID = %d", + WHERE id = %d", $this->pdo->escapeString(trim($group["name"])), $this->pdo->escapeString(trim($group["description"])), $this->formatNumberString($group["backfill_target"]), @@ -304,13 +304,13 @@ class Groups public function delete($id) { - return $this->pdo->queryExec(sprintf("DELETE from groups where ID = %d", $id)); + return $this->pdo->queryExec(sprintf("DELETE from groups where id = %d", $id)); } /** * Reset a group. * - * @param string|int $id The group ID. + * @param string|int $id The group id. * * @return bool */ @@ -320,7 +320,7 @@ class Groups (new \Binaries(['Groups' => $this, 'Settings' => $this->pdo]))->purgeGroup($id); // Remove rows from part repair. - $this->pdo->queryExec(sprintf("DELETE FROM partrepair WHERE groupID = %d", $id)); + $this->pdo->queryExec(sprintf("DELETE FROM partrepair WHERE groupid = %d", $id)); $this->pdo->queryExec(sprintf('DROP TABLE IF EXISTS binaries_%d', $id)); $this->pdo->queryExec(sprintf('DROP TABLE IF EXISTS parts_%d', $id)); @@ -332,7 +332,7 @@ class Groups UPDATE groups SET backfill_target = 0, first_record = 0, first_record_postdate = NULL, last_record = 0, last_record_postdate = NULL, last_updated = NULL - WHERE ID = %d", $id) + WHERE id = %d", $id) ); } @@ -346,11 +346,11 @@ class Groups $this->pdo->queryExec("TRUNCATE TABLE binaries"); $this->pdo->queryExec("TRUNCATE TABLE parts"); $this->pdo->queryExec("TRUNCATE TABLE partrepair"); - $groups = $this->pdo->query("SELECT ID FROM groups"); + $groups = $this->pdo->query("SELECT id FROM groups"); foreach ($groups as $group) { - $this->pdo->queryExec('DROP TABLE IF EXISTS binaries_' . $group['ID']); - $this->pdo->queryExec('DROP TABLE IF EXISTS parts_' . $group['ID']); - $this->pdo->queryExec('DROP TABLE IF EXISTS partrepair_' . $group['ID']); + $this->pdo->queryExec('DROP TABLE IF EXISTS binaries_' . $group['id']); + $this->pdo->queryExec('DROP TABLE IF EXISTS parts_' . $group['id']); + $this->pdo->queryExec('DROP TABLE IF EXISTS partrepair_' . $group['id']); } // Reset the group stats. @@ -388,10 +388,10 @@ class Groups foreach ($groups AS $group) { if (preg_match($regfilter, $group['group']) > 0) { - $res = $this->pdo->queryOneRow(sprintf("SELECT ID FROM groups WHERE name = %s ", $this->pdo->escapeString($group['group']))); + $res = $this->pdo->queryOneRow(sprintf("SELECT id FROM groups WHERE name = %s ", $this->pdo->escapeString($group['group']))); if ($res) { - $this->pdo->queryExec(sprintf("update groups SET active = %d where ID = %d", $active, $res["ID"])); + $this->pdo->queryExec(sprintf("update groups SET active = %d where id = %d", $active, $res["id"])); $ret[] = array('group' => $group['group'], 'msg' => 'Updated'); } else { $desc = ""; @@ -413,7 +413,7 @@ class Groups */ public function updateGroupStatus($id, $status = 0) { - $this->pdo->queryExec(sprintf("UPDATE groups SET active = %d WHERE ID = %d", $status, $id)); + $this->pdo->queryExec(sprintf("UPDATE groups SET active = %d WHERE id = %d", $status, $id)); return "Group $id has been " . (($status == 0) ? 'deactivated' : 'activated') . '.'; } @@ -425,7 +425,7 @@ class Groups */ public function updateBackfillStatus($id, $status = 0) { - $this->pdo->queryExec(sprintf("UPDATE groups SET backfill = %d WHERE ID = %d", $status, $id)); + $this->pdo->queryExec(sprintf("UPDATE groups SET backfill = %d WHERE id = %d", $status, $id)); return "Group $id has been " . (($status == 0) ? 'deactivated' : 'activated') . '.'; } @@ -452,10 +452,10 @@ class Groups /** * Get the names of the binaries/parts/part repair tables. - * If TPG is on, try to create new tables for the groupID, if we fail, log the error and exit. + * If TPG is on, try to create new tables for the groupid, if we fail, log the error and exit. * * @param bool $tpgSetting false, tpg is off in site setting, true tpg is on in site setting. - * @param int $groupID ID of the group. + * @param int $groupID id of the group. * * @return array The table names. */ @@ -479,7 +479,7 @@ class Groups } if ($this->createNewTPGTables($groupID) === false && NN_ECHOCLI) { - exit('There is a problem creating new TPG tables for this group ID: ' . $groupID . PHP_EOL); + exit('There is a problem creating new TPG tables for this group id: ' . $groupID . PHP_EOL); } $groupEnding = '_' . $groupID; @@ -499,7 +499,7 @@ class Groups */ public function getActiveIDs() { - return $this->pdo->query("SELECT ID FROM groups WHERE active = 1 ORDER BY name"); + return $this->pdo->query("SELECT id FROM groups WHERE active = 1 ORDER BY name"); } /** @@ -530,7 +530,7 @@ class Groups $this->pdo->queryExec( sprintf( 'CREATE TRIGGER delete_binaries_%s BEFORE DELETE ON binaries_%s FOR EACH ROW BEGIN' . - ' DELETE FROM parts_%s WHERE binaryID = OLD.ID; END', + ' DELETE FROM parts_%s WHERE binaryID = OLD.id; END', $groupID, $groupID, $groupID ) ); @@ -544,7 +544,7 @@ class Groups /** * Purge a single group or all groups. * - * @param int|string|bool $id The group ID. If false, purge all groups. + * @param int|string|bool $id The group id. If false, purge all groups. */ public function purge($id = false) { @@ -555,7 +555,7 @@ class Groups } $releaseArray = $this->pdo->queryDirect( - sprintf("SELECT ID, guid FROM releases %s", ($id === false ? '' : 'WHERE groupID = ' . $id)) + sprintf("SELECT id, guid FROM releases %s", ($id === false ? '' : 'WHERE groupid = ' . $id)) ); if ($releaseArray instanceof \Traversable) { @@ -563,7 +563,7 @@ class Groups $nzb = new \NZB($this->pdo); $releaseImage = new \ReleaseImage($this->pdo); foreach ($releaseArray as $release) { - $releases->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $nzb, $releaseImage); + $releases->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $nzb, $releaseImage); } } } @@ -577,7 +577,7 @@ class Groups { $res = $this->pdo->queryOneRow( sprintf(" - SELECT COUNT(ID) AS num + SELECT COUNT(id) AS num FROM groups WHERE 1 = 1 %s AND active = 1", @@ -603,7 +603,7 @@ class Groups { $res = $this->pdo->queryOneRow( sprintf(" - SELECT COUNT(ID) AS num + SELECT COUNT(id) AS num FROM groups WHERE 1 = 1 %s AND active = 0", @@ -634,11 +634,11 @@ class Groups SELECT groups.*, COALESCE(rel.num, 0) AS num_releases FROM groups LEFT OUTER JOIN - (SELECT groupID, COUNT(ID) AS num + (SELECT groupid, COUNT(id) AS num FROM releases - GROUP BY groupID + GROUP BY groupid ) rel - ON rel.groupID = groups.ID + ON rel.groupid = groups.id WHERE 1 = 1 %s AND active = 1 ORDER BY groups.name " . ($start === false ? '' : " LIMIT " . $num . " OFFSET " .$start), @@ -668,11 +668,11 @@ class Groups SELECT groups.*, COALESCE(rel.num, 0) AS num_releases FROM groups LEFT OUTER JOIN - (SELECT groupID, COUNT(ID) AS num + (SELECT groupid, COUNT(id) AS num FROM releases - GROUP BY groupID + GROUP BY groupid ) rel - ON rel.groupID = groups.ID + ON rel.groupid = groups.id WHERE 1 = 1 %s AND active = 0 ORDER BY groups.name " . ($start === false ? '' : " LIMIT ".$num." OFFSET ".$start), diff --git a/lib/copy_this/www/lib/menu.php b/lib/copy_this/www/lib/menu.php index fd3669325..b88ff7f16 100644 --- a/lib/copy_this/www/lib/menu.php +++ b/lib/copy_this/www/lib/menu.php @@ -51,12 +51,12 @@ class Menu } /** - * Get a menu row by its ID. + * Get a menu row by its id. */ public function getById($id) { $db = new DB(); - return $db->queryOneRow(sprintf("select * from menu where ID = %d", $id)); + return $db->queryOneRow(sprintf("select * from menu where id = %d", $id)); } /** @@ -65,7 +65,7 @@ class Menu public function delete($id) { $db = new DB(); - return $db->queryExec(sprintf("DELETE from menu where ID = %d", $id)); + return $db->queryExec(sprintf("DELETE from menu where id = %d", $id)); } /** @@ -84,6 +84,6 @@ class Menu public function update($menu) { $db = new DB(); - return $db->queryExec(sprintf("update menu set href = %s, title = %s, tooltip = %s, role = %d, ordinal = %d, menueval = %s, newwindow=%d where ID = %d ", $db->escapeString($menu["href"]), $db->escapeString($menu["title"]), $db->escapeString($menu["tooltip"]), $menu["role"] , $menu["ordinal"], $db->escapeString($menu["menueval"]), $menu["newwindow"], $menu["id"] )); + return $db->queryExec(sprintf("update menu set href = %s, title = %s, tooltip = %s, role = %d, ordinal = %d, menueval = %s, newwindow=%d where id = %d ", $db->escapeString($menu["href"]), $db->escapeString($menu["title"]), $db->escapeString($menu["tooltip"]), $menu["role"] , $menu["ordinal"], $db->escapeString($menu["menueval"]), $menu["newwindow"], $menu["id"] )); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/movie.php b/lib/copy_this/www/lib/movie.php index ce91f7038..c7cb9abb5 100644 --- a/lib/copy_this/www/lib/movie.php +++ b/lib/copy_this/www/lib/movie.php @@ -34,12 +34,12 @@ class Movie } /** - * Get a movieinfo row by its imdbID. + * Get a movieinfo row by its imdbid. */ public function getMovieInfo($imdbId) { $db = new DB(); - return $db->queryOneRow(sprintf("SELECT * FROM movieinfo where imdbID = %d", $imdbId)); + return $db->queryOneRow(sprintf("SELECT * FROM movieinfo where imdbid = %d", $imdbId)); } /** @@ -49,19 +49,19 @@ class Movie { $db = new DB(); $allids = implode(",", array_filter($imdbIds)); - $sql = sprintf("SELECT DISTINCT movieinfo.*, releases.imdbID AS relimdb FROM movieinfo LEFT OUTER JOIN releases ON releases.imdbID = movieinfo.imdbID WHERE movieinfo.imdbID IN (%s)", $allids); + $sql = sprintf("SELECT DISTINCT movieinfo.*, releases.imdbid AS relimdb FROM movieinfo LEFT OUTER JOIN releases ON releases.imdbid = movieinfo.imdbid WHERE movieinfo.imdbid IN (%s)", $allids); return $db->query($sql); } /** - * Delete movieinfo row by its imdbID. + * Delete movieinfo row by its imdbid. */ public function delete($imdbId) { $db = new DB(); @unlink($this->imgSavePath.$imdbId.'-cover.jpg'); @unlink($this->imgSavePath.$imdbId.'-backdrop.jpg'); - return $db->queryOneRow(sprintf("delete FROM movieinfo where imdbID = %d", $imdbId)); + return $db->queryOneRow(sprintf("delete FROM movieinfo where imdbid = %d", $imdbId)); } /** @@ -105,7 +105,7 @@ class Movie if ($moviename != "") $rsql .= sprintf("and movieinfo.title like %s ", $db->escapeString("%".$moviename."%")); - $res = $db->queryOneRow(sprintf("select count(ID) as num from movieinfo where 1=1 %s ", $rsql)); + $res = $db->queryOneRow(sprintf("select count(id) as num from movieinfo where 1=1 %s ", $rsql)); return $res["num"]; } @@ -132,14 +132,14 @@ class Movie $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist.=", ".$child["ID"]; + $chlist.=", ".$child["id"]; if ($chlist != "-99") - $catsrch .= " r.categoryID in (".$chlist.") or "; + $catsrch .= " r.categoryid in (".$chlist.") or "; } else { - $catsrch .= sprintf(" r.categoryID = %d or ", $category); + $catsrch .= sprintf(" r.categoryid = %d or ", $category); } } } @@ -155,9 +155,9 @@ class Movie $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and r.categoryID not in (".implode(",", $excludedcats).")"; + $exccatlist = " and r.categoryid not in (".implode(",", $excludedcats).")"; - $sql = sprintf("select count(distinct r.imdbID) as num from releases r inner join movieinfo m on m.imdbID = r.imdbID and m.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s ", $browseby, $catsrch, $maxage, $exccatlist); + $sql = sprintf("select count(distinct r.imdbid) as num from releases r inner join movieinfo m on m.imdbid = r.imdbid and m.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s ", $browseby, $catsrch, $maxage, $exccatlist); $res = $db->queryOneRow($sql, true); return $res["num"]; } @@ -190,14 +190,14 @@ class Movie $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist.=", ".$child["ID"]; + $chlist.=", ".$child["id"]; if ($chlist != "-99") - $catsrch .= " r.categoryID in (".$chlist.") or "; + $catsrch .= " r.categoryid in (".$chlist.") or "; } else { - $catsrch .= sprintf(" r.categoryID = %d or ", $category); + $catsrch .= sprintf(" r.categoryid = %d or ", $category); } } } @@ -212,10 +212,10 @@ class Movie $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and r.categoryID not in (".implode(",", $excludedcats).")"; + $exccatlist = " and r.categoryid not in (".implode(",", $excludedcats).")"; $order = $this->getMovieOrder($orderby); - $sql = sprintf(" SELECT r.imdbID, max(r.postdate) as postdate, m.* from releases r inner join movieinfo m on m.imdbID = r.imdbID where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and m.title != '' and r.imdbID != 0000000 and %s %s %s %s group by r.imdbID order by %s %s".$limit, $browseby, $catsrch, $maxagesql, $exccatlist, $order[0], $order[1]); + $sql = sprintf(" SELECT r.imdbid, max(r.postdate) as postdate, m.* from releases r inner join movieinfo m on m.imdbid = r.imdbid where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and m.title != '' and r.imdbid != 0000000 and %s %s %s %s group by r.imdbid order by %s %s".$limit, $browseby, $catsrch, $maxagesql, $exccatlist, $order[0], $order[1]); $rows = $db->query($sql, true); // @@ -223,7 +223,7 @@ class Movie // $imdbds = ""; foreach ($rows as $row) - $imdbds .= $row["imdbID"]. ", "; + $imdbds .= $row["imdbid"]. ", "; if (strlen($imdbds) > 0) { @@ -232,7 +232,7 @@ class Movie // // get all releases matching these ids // - $sql = sprintf("select r.*, releasenfo.ID as nfoID, groups.name as grpname, concat(cp.title, ' > ', c.title) as categoryName from releases r left outer join category c on c.ID = r.categoryID left outer join category cp on cp.ID = c.parentID left outer join releasenfo on releasenfo.releaseID = r.ID left outer join groups on groups.ID = r.groupID where imdbID in (%s) and %s %s %s order by r.postdate desc", $imdbds, $catsrch, $maxagesql, $exccatlist); + $sql = sprintf("select r.*, releasenfo.id as nfoid, groups.name as grpname, concat(cp.title, ' > ', c.title) as categoryname from releases r left outer join category c on c.id = r.categoryid left outer join category cp on cp.id = c.parentid left outer join releasenfo on releasenfo.releaseid = r.id left outer join groups on groups.id = r.groupid where imdbid in (%s) and %s %s %s order by r.postdate desc", $imdbds, $catsrch, $maxagesql, $exccatlist); $allrows = $db->query($sql, true); $arr = array(); @@ -241,21 +241,21 @@ class Movie // foreach ($allrows as &$allrow) { - $arr[$allrow["imdbID"]]["ID"] = (isset($arr[$allrow["imdbID"]]["ID"]) ? $arr[$allrow["imdbID"]]["ID"] : "") . $allrow["ID"] . ","; - $arr[$allrow["imdbID"]]["rarinnerfilecount"] = (isset($arr[$allrow["imdbID"]]["rarinnerfilecount"]) ? $arr[$allrow["imdbID"]]["rarinnerfilecount"] : "") . $allrow["rarinnerfilecount"] . ","; - $arr[$allrow["imdbID"]]["haspreview"] = (isset($arr[$allrow["imdbID"]]["haspreview"]) ? $arr[$allrow["imdbID"]]["haspreview"] : "") . $allrow["haspreview"] . ","; - $arr[$allrow["imdbID"]]["passwordstatus"] = (isset($arr[$allrow["imdbID"]]["passwordstatus"]) ? $arr[$allrow["imdbID"]]["passwordstatus"] : "") . $allrow["passwordstatus"] . ","; - $arr[$allrow["imdbID"]]["guid"] = (isset($arr[$allrow["imdbID"]]["guid"]) ? $arr[$allrow["imdbID"]]["guid"] : "") . $allrow["guid"] . ","; - $arr[$allrow["imdbID"]]["nfoID"] = (isset($arr[$allrow["imdbID"]]["nfoID"]) ? $arr[$allrow["imdbID"]]["nfoID"] : "") . $allrow["nfoID"] . ","; - $arr[$allrow["imdbID"]]["grpname"] = (isset($arr[$allrow["imdbID"]]["grpname"]) ? $arr[$allrow["imdbID"]]["grpname"] : "") . $allrow["grpname"] . ","; - $arr[$allrow["imdbID"]]["searchname"] = (isset($arr[$allrow["imdbID"]]["searchname"]) ? $arr[$allrow["imdbID"]]["searchname"] : "") . $allrow["searchname"] . "#"; - $arr[$allrow["imdbID"]]["postdate"] = (isset($arr[$allrow["imdbID"]]["postdate"]) ? $arr[$allrow["imdbID"]]["postdate"] : "") . $allrow["postdate"] . ","; - $arr[$allrow["imdbID"]]["size"] = (isset($arr[$allrow["imdbID"]]["size"]) ? $arr[$allrow["imdbID"]]["size"] : "") . $allrow["size"] . ","; - $arr[$allrow["imdbID"]]["totalpart"] = (isset($arr[$allrow["imdbID"]]["totalpart"]) ? $arr[$allrow["imdbID"]]["totalpart"] : "") . $allrow["totalpart"] . ","; - $arr[$allrow["imdbID"]]["comments"] = (isset($arr[$allrow["imdbID"]]["comments"]) ? $arr[$allrow["imdbID"]]["comments"] : "") . $allrow["comments"] . ","; - $arr[$allrow["imdbID"]]["grabs"] = (isset($arr[$allrow["imdbID"]]["grabs"]) ? $arr[$allrow["imdbID"]]["grabs"] : "") . $allrow["grabs"] . ","; - $arr[$allrow["imdbID"]]["categoryID"] = (isset($arr[$allrow["imdbID"]]["categoryID"]) ? $arr[$allrow["imdbID"]]["categoryID"] : "") . $allrow["categoryID"] . ","; - $arr[$allrow["imdbID"]]["categoryName"] = (isset($arr[$allrow["imdbID"]]["categoryName"]) ? $arr[$allrow["imdbID"]]["categoryName"] : "") . $allrow["categoryName"] . ","; + $arr[$allrow["imdbid"]]["id"] = (isset($arr[$allrow["imdbid"]]["id"]) ? $arr[$allrow["imdbid"]]["id"] : "") . $allrow["id"] . ","; + $arr[$allrow["imdbid"]]["rarinnerfilecount"] = (isset($arr[$allrow["imdbid"]]["rarinnerfilecount"]) ? $arr[$allrow["imdbid"]]["rarinnerfilecount"] : "") . $allrow["rarinnerfilecount"] . ","; + $arr[$allrow["imdbid"]]["haspreview"] = (isset($arr[$allrow["imdbid"]]["haspreview"]) ? $arr[$allrow["imdbid"]]["haspreview"] : "") . $allrow["haspreview"] . ","; + $arr[$allrow["imdbid"]]["passwordstatus"] = (isset($arr[$allrow["imdbid"]]["passwordstatus"]) ? $arr[$allrow["imdbid"]]["passwordstatus"] : "") . $allrow["passwordstatus"] . ","; + $arr[$allrow["imdbid"]]["guid"] = (isset($arr[$allrow["imdbid"]]["guid"]) ? $arr[$allrow["imdbid"]]["guid"] : "") . $allrow["guid"] . ","; + $arr[$allrow["imdbid"]]["nfoid"] = (isset($arr[$allrow["imdbid"]]["nfoid"]) ? $arr[$allrow["imdbid"]]["nfoid"] : "") . $allrow["nfoid"] . ","; + $arr[$allrow["imdbid"]]["grpname"] = (isset($arr[$allrow["imdbid"]]["grpname"]) ? $arr[$allrow["imdbid"]]["grpname"] : "") . $allrow["grpname"] . ","; + $arr[$allrow["imdbid"]]["searchname"] = (isset($arr[$allrow["imdbid"]]["searchname"]) ? $arr[$allrow["imdbid"]]["searchname"] : "") . $allrow["searchname"] . "#"; + $arr[$allrow["imdbid"]]["postdate"] = (isset($arr[$allrow["imdbid"]]["postdate"]) ? $arr[$allrow["imdbid"]]["postdate"] : "") . $allrow["postdate"] . ","; + $arr[$allrow["imdbid"]]["size"] = (isset($arr[$allrow["imdbid"]]["size"]) ? $arr[$allrow["imdbid"]]["size"] : "") . $allrow["size"] . ","; + $arr[$allrow["imdbid"]]["totalpart"] = (isset($arr[$allrow["imdbid"]]["totalpart"]) ? $arr[$allrow["imdbid"]]["totalpart"] : "") . $allrow["totalpart"] . ","; + $arr[$allrow["imdbid"]]["comments"] = (isset($arr[$allrow["imdbid"]]["comments"]) ? $arr[$allrow["imdbid"]]["comments"] : "") . $allrow["comments"] . ","; + $arr[$allrow["imdbid"]]["grabs"] = (isset($arr[$allrow["imdbid"]]["grabs"]) ? $arr[$allrow["imdbid"]]["grabs"] : "") . $allrow["grabs"] . ","; + $arr[$allrow["imdbid"]]["categoryid"] = (isset($arr[$allrow["imdbid"]]["categoryid"]) ? $arr[$allrow["imdbid"]]["categoryid"] : "") . $allrow["categoryid"] . ","; + $arr[$allrow["imdbid"]]["categoryname"] = (isset($arr[$allrow["imdbid"]]["categoryname"]) ? $arr[$allrow["imdbid"]]["categoryname"] : "") . $allrow["categoryname"] . ","; } // @@ -263,21 +263,21 @@ class Movie // foreach ($rows as &$row) { - $row["grp_release_id"] = substr($arr[$row["imdbID"]]["ID"], 0, -1); - $row["grp_rarinnerfilecount"] = substr($arr[$row["imdbID"]]["rarinnerfilecount"], 0, -1); - $row["grp_haspreview"] = substr($arr[$row["imdbID"]]["haspreview"], 0, -1); - $row["grp_release_password"] = substr($arr[$row["imdbID"]]["passwordstatus"], 0, -1); - $row["grp_release_guid"] = substr($arr[$row["imdbID"]]["guid"], 0, -1); - $row["grp_release_nfoID"] = substr($arr[$row["imdbID"]]["nfoID"], 0, -1); - $row["grp_release_grpname"] = substr($arr[$row["imdbID"]]["grpname"], 0, -1); - $row["grp_release_name"] = substr($arr[$row["imdbID"]]["searchname"], 0, -1); - $row["grp_release_postdate"] = substr($arr[$row["imdbID"]]["postdate"], 0, -1); - $row["grp_release_size"] = substr($arr[$row["imdbID"]]["size"], 0, -1); - $row["grp_release_totalparts"] = substr($arr[$row["imdbID"]]["totalpart"], 0, -1); - $row["grp_release_comments"] = substr($arr[$row["imdbID"]]["comments"], 0, -1); - $row["grp_release_grabs"] = substr($arr[$row["imdbID"]]["grabs"], 0, -1); - $row["grp_release_categoryID"] = substr($arr[$row["imdbID"]]["categoryID"], 0, -1); - $row["grp_release_categoryName"] = substr($arr[$row["imdbID"]]["categoryName"], 0, -1); + $row["grp_release_id"] = substr($arr[$row["imdbid"]]["id"], 0, -1); + $row["grp_rarinnerfilecount"] = substr($arr[$row["imdbid"]]["rarinnerfilecount"], 0, -1); + $row["grp_haspreview"] = substr($arr[$row["imdbid"]]["haspreview"], 0, -1); + $row["grp_release_password"] = substr($arr[$row["imdbid"]]["passwordstatus"], 0, -1); + $row["grp_release_guid"] = substr($arr[$row["imdbid"]]["guid"], 0, -1); + $row["grp_release_nfoID"] = substr($arr[$row["imdbid"]]["nfoid"], 0, -1); + $row["grp_release_grpname"] = substr($arr[$row["imdbid"]]["grpname"], 0, -1); + $row["grp_release_name"] = substr($arr[$row["imdbid"]]["searchname"], 0, -1); + $row["grp_release_postdate"] = substr($arr[$row["imdbid"]]["postdate"], 0, -1); + $row["grp_release_size"] = substr($arr[$row["imdbid"]]["size"], 0, -1); + $row["grp_release_totalparts"] = substr($arr[$row["imdbid"]]["totalpart"], 0, -1); + $row["grp_release_comments"] = substr($arr[$row["imdbid"]]["comments"], 0, -1); + $row["grp_release_grabs"] = substr($arr[$row["imdbid"]]["grabs"], 0, -1); + $row["grp_release_categoryID"] = substr($arr[$row["imdbid"]]["categoryid"], 0, -1); + $row["grp_release_categoryName"] = substr($arr[$row["imdbid"]]["categoryname"], 0, -1); } } return $rows; @@ -340,7 +340,7 @@ class Movie $bbv = stripslashes($_REQUEST[$bb]); if ($bb == 'rating') { $bbv .= '.'; } if ($bb == 'imdb') { - $browseby .= "m.{$bb}ID = $bbv AND "; + $browseby .= "m.{$bb}id = $bbv AND "; } else { $browseby .= "m.$bb LIKE(".$db->escapeString('%'.$bbv.'%').") AND "; } @@ -375,7 +375,7 @@ class Movie { $db = new DB(); - $db->queryExec(sprintf("update movieinfo SET title=%s, tagline=%s, plot=%s, year=%s, rating=%s, genre=%s, director=%s, actors=%s, language=%s, cover=%d, backdrop=%d, updateddate=NOW() WHERE imdbID = %d", + $db->queryExec(sprintf("update movieinfo SET title=%s, tagline=%s, plot=%s, year=%s, rating=%s, genre=%s, director=%s, actors=%s, language=%s, cover=%d, backdrop=%d, updateddate=NOW() WHERE imdbid = %d", $db->escapeString($title), $db->escapeString($tagline), $db->escapeString($plot), $db->escapeString($year), $db->escapeString($rating), $db->escapeString($genre), $db->escapeString($director), $db->escapeString($actors), $db->escapeString($language), $cover, $backdrop, $id)); } @@ -495,11 +495,11 @@ class Movie $db = new DB(); $query = sprintf(" INSERT INTO movieinfo - (imdbID, tmdbID, title, rating, tagline, trailer, plot, year, genre, director, actors, language, cover, backdrop, createddate, updateddate) + (imdbid, tmdbID, title, rating, tagline, trailer, plot, year, genre, director, actors, language, cover, backdrop, createddate, updateddate) VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, NOW(), NOW()) ON DUPLICATE KEY UPDATE - imdbID=%d, tmdbID=%s, title=%s, rating=%s, tagline=%s, trailer=%s, plot=%s, year=%s, genre=%s, director=%s, actors=%s, language=%s, cover=%d, backdrop=%d, updateddate=NOW()", + imdbid=%d, tmdbID=%s, title=%s, rating=%s, tagline=%s, trailer=%s, plot=%s, year=%s, genre=%s, director=%s, actors=%s, language=%s, cover=%d, backdrop=%d, updateddate=NOW()", $mov['imdb_id'], $mov['tmdb_id'], $db->escapeString($mov['title']), $db->escapeString($mov['rating']), $db->escapeString($mov['tagline']), $db->escapeString($mov['trailer']), $db->escapeString($mov['plot']), $db->escapeString($mov['year']), $db->escapeString($mov['genre']), $db->escapeString($mov['director']), $db->escapeString($mov['actors']), $db->escapeString($mov['language']), $mov['cover'], $mov['backdrop'], $mov['imdb_id'], $mov['tmdb_id'], $db->escapeString($mov['title']), $db->escapeString($mov['rating']), $db->escapeString($mov['tagline']), $db->escapeString($mov['trailer']), $db->escapeString($mov['plot']), $db->escapeString($mov['year']), $db->escapeString($mov['genre']), $db->escapeString($mov['director']), $db->escapeString($mov['actors']), $db->escapeString($mov['language']), $mov['cover'], $mov['backdrop']); @@ -509,7 +509,7 @@ class Movie } /** - * Lookup a movie on tmdb by ID + * Lookup a movie on tmdb by id */ public function fetchTmdbProperties($id, $isImdbId=true) { @@ -671,7 +671,7 @@ class Movie $db = new DB(); $nfo = new Nfo(); - $res = $db->queryDirect(sprintf("SELECT searchname, ID from releases where imdbID IS NULL and categoryID in ( select ID from category where parentID = %d ) ORDER BY postdate DESC LIMIT 100", Category::CAT_PARENT_MOVIE)); + $res = $db->queryDirect(sprintf("SELECT searchname, id from releases where imdbid IS NULL and categoryid in ( select id from category where parentid = %d ) ORDER BY postdate DESC LIMIT 100", Category::CAT_PARENT_MOVIE)); if ($db->getNumRows($res) > 0) { if ($this->echooutput) @@ -680,14 +680,14 @@ class Movie while ($arr = $db->getAssocArray($res)) { $imdbID = false; - /* Preliminary IMDB ID Detection from NFO file */ + /* Preliminary IMDB id Detection from NFO file */ $rawnfo = ''; - if($nfo->getNfo($arr['ID'], $rawnfo)) + if($nfo->getNfo($arr['id'], $rawnfo)) $imdbID = $this->parseImdbFromNfo($rawnfo); if($imdbID !== false){ // Set IMDB (if found in nfo) and move along - $db->queryExec(sprintf("update releases set imdbID = %s where ID = %d", $db->escapeString($imdbID), $arr["ID"])); + $db->queryExec(sprintf("update releases set imdbid = %s where id = %d", $db->escapeString($imdbID), $arr["id"])); //check for existing movie entry $movCheck = $this->getMovieInfo($imdbID); if ($movCheck === false || (isset($movCheck['updateddate']) && (time() - strtotime($movCheck['updateddate'])) > 2592000)) @@ -713,7 +713,7 @@ class Movie if ($imdbId !== false) { //update release with imdb id - $db->queryExec(sprintf("update releases SET imdbID = %s WHERE ID = %d", $db->escapeString($imdbId), $arr["ID"])); + $db->queryExec(sprintf("update releases SET imdbid = %s WHERE id = %d", $db->escapeString($imdbId), $arr["id"])); //check for existing movie entry $movCheck = $this->getMovieInfo($imdbId); @@ -724,7 +724,7 @@ class Movie } else { //no imdb id found, set to all zeros so we dont process again - $db->queryExec(sprintf("update releases SET imdbID = %d WHERE ID = %d", 0, $arr["ID"])); + $db->queryExec(sprintf("update releases SET imdbid = %d WHERE id = %d", 0, $arr["id"])); } } else { @@ -734,7 +734,7 @@ class Movie } else { //no valid movie name found, set to all zeros so we dont process again - $db->queryExec(sprintf("update releases SET imdbID = %d WHERE ID = %d", 0, $arr["ID"])); + $db->queryExec(sprintf("update releases SET imdbid = %d WHERE id = %d", 0, $arr["id"])); } } } diff --git a/lib/copy_this/www/lib/music.php b/lib/copy_this/www/lib/music.php index 51a4c3da5..92dce7e6c 100644 --- a/lib/copy_this/www/lib/music.php +++ b/lib/copy_this/www/lib/music.php @@ -30,12 +30,12 @@ class Music } /** - * Get musicinfo row by ID. + * Get musicinfo row by id. */ public function getMusicInfo($id) { $db = new DB(); - return $db->queryOneRow(sprintf("SELECT musicinfo.*, genres.title as genres FROM musicinfo left outer join genres on genres.ID = musicinfo.genreID where musicinfo.ID = %d ", $id)); + return $db->queryOneRow(sprintf("SELECT musicinfo.*, genres.title as genres FROM musicinfo left outer join genres on genres.id = musicinfo.genreID where musicinfo.id = %d ", $id)); } /** @@ -68,7 +68,7 @@ class Music public function getCount() { $db = new DB(); - $res = $db->queryOneRow("select count(ID) as num from musicinfo"); + $res = $db->queryOneRow("select count(id) as num from musicinfo"); return $res["num"]; } @@ -95,14 +95,14 @@ class Music $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist.=", ".$child["ID"]; + $chlist.=", ".$child["id"]; if ($chlist != "-99") - $catsrch .= " r.categoryID in (".$chlist.") or "; + $catsrch .= " r.categoryid in (".$chlist.") or "; } else { - $catsrch .= sprintf(" r.categoryID = %d or ", $category); + $catsrch .= sprintf(" r.categoryid = %d or ", $category); } } } @@ -116,9 +116,9 @@ class Music $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and r.categoryID not in (".implode(",", $excludedcats).")"; + $exccatlist = " and r.categoryid not in (".implode(",", $excludedcats).")"; - $sql = sprintf("select count(r.ID) as num from releases r inner join musicinfo m on m.ID = r.musicinfoID and m.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s", $browseby, $catsrch, $maxage, $exccatlist); + $sql = sprintf("select count(r.id) as num from releases r inner join musicinfo m on m.id = r.musicinfoid and m.title != '' where r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s", $browseby, $catsrch, $maxage, $exccatlist); $res = $db->queryOneRow($sql, true); return $res["num"]; } @@ -151,14 +151,14 @@ class Music $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist.=", ".$child["ID"]; + $chlist.=", ".$child["id"]; if ($chlist != "-99") - $catsrch .= " r.categoryID in (".$chlist.") or "; + $catsrch .= " r.categoryid in (".$chlist.") or "; } else { - $catsrch .= sprintf(" r.categoryID = %d or ", $category); + $catsrch .= sprintf(" r.categoryid = %d or ", $category); } } } @@ -171,11 +171,11 @@ class Music $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and r.categoryID not in (".implode(",", $excludedcats).")"; + $exccatlist = " and r.categoryid not in (".implode(",", $excludedcats).")"; $order = $this->getMusicOrder($orderby); // query modified to join to musicinfo after limiting releases as performance issue prevented sane sql. - $sql = sprintf(" SELECT r.*, r.ID as releaseID, m.*, g.title as genre, groups.name as group_name, concat(cp.title, ' > ', c.title) as category_name, concat(cp.ID, ',', c.ID) as category_ids, rn.ID as nfoID from releases r left outer join groups on groups.ID = r.groupID inner join musicinfo m on m.ID = r.musicinfoID and m.title != '' left outer join releasenfo rn on rn.releaseID = r.ID and rn.nfo is not null left outer join category c on c.ID = r.categoryID left outer join category cp on cp.ID = c.parentID left outer join genres g on g.ID = m.genreID inner join (select r.ID from releases r inner join musicinfo m ON m.ID = r.musicinfoID and m.title != '' where r.musicinfoID > 0 and r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s order by %s %s %s) x on x.ID = r.ID order by %s %s", $browseby, $catsrch, $maxagesql, $exccatlist, $order[0], $order[1], $limit, $order[0], $order[1]); + $sql = sprintf(" SELECT r.*, r.id as releaseid, m.*, g.title as genre, groups.name as group_name, concat(cp.title, ' > ', c.title) as category_name, concat(cp.id, ',', c.id) as category_ids, rn.id as nfoid from releases r left outer join groups on groups.id = r.groupid inner join musicinfo m on m.id = r.musicinfoid and m.title != '' left outer join releasenfo rn on rn.releaseid = r.id and rn.nfo is not null left outer join category c on c.id = r.categoryid left outer join category cp on cp.id = c.parentid left outer join genres g on g.id = m.genreID inner join (select r.id from releases r inner join musicinfo m ON m.id = r.musicinfoid and m.title != '' where r.musicinfoid > 0 and r.passwordstatus <= (select value from site where setting='showpasswordedrelease') and %s %s %s %s order by %s %s %s) x on x.id = r.id order by %s %s", $browseby, $catsrch, $maxagesql, $exccatlist, $order[0], $order[1], $limit, $order[0], $order[1]); return $db->query($sql, true); } @@ -260,7 +260,7 @@ class Music { $db = new DB(); - $db->queryExec(sprintf("update musicinfo SET title=%s, asin=%s, url=%s, salesrank=%s, artist=%s, publisher=%s, releasedate='%s', year=%s, tracks=%s, cover=%d, genreID=%d, updateddate=NOW() WHERE ID = %d", + $db->queryExec(sprintf("update musicinfo SET title=%s, asin=%s, url=%s, salesrank=%s, artist=%s, publisher=%s, releasedate='%s', year=%s, tracks=%s, cover=%d, genreID=%d, updateddate=NOW() WHERE id = %d", $db->escapeString($title), $db->escapeString($asin), $db->escapeString($url), $salesrank, $db->escapeString($artist), $db->escapeString($publisher), $releasedate, $db->escapeString($year), $db->escapeString($tracks), $cover, $genreID, $id)); } @@ -284,7 +284,7 @@ class Music $defaultGenres = $gen->getGenres(Genres::MUSIC_TYPE); $genreassoc = array(); foreach($defaultGenres as $dg) { - $genreassoc[$dg['ID']] = strtolower($dg['title']); + $genreassoc[$dg['id']] = strtolower($dg['title']); } // @@ -438,7 +438,7 @@ class Music $db = new DB(); $numlookedup = 0; - $res = $db->queryDirect(sprintf("SELECT searchname, ID from releases where musicinfoID IS NULL and categoryID in ( select ID from category where parentID = %d ) ORDER BY postdate DESC LIMIT 1000", Category::CAT_PARENT_MUSIC)); + $res = $db->queryDirect(sprintf("SELECT searchname, id from releases where musicinfoid IS NULL and categoryid in ( select id from category where parentid = %d ) ORDER BY postdate DESC LIMIT 1000", Category::CAT_PARENT_MUSIC)); if ($db->getNumRows($res) > 0) { if ($this->echooutput) @@ -473,11 +473,11 @@ class Music } else { - $albumId = $albumCheck["ID"]; + $albumId = $albumCheck["id"]; } } - $db->queryExec(sprintf("update releases SET musicinfoID = %d WHERE ID = %d", $albumId, $arr["ID"])); + $db->queryExec(sprintf("update releases SET musicinfoid = %d WHERE id = %d", $albumId, $arr["id"])); } } } @@ -555,12 +555,12 @@ class Music } /** - * Process all releases tagged as musicinfoID -2 to attempt to retrieve properties from mediainfo xml. + * Process all releases tagged as musicinfoid -2 to attempt to retrieve properties from mediainfo xml. */ public function processMusicReleaseFromMediaInfo() { $db = new DB(); - $res = $db->query("SELECT r.searchname, ref.releaseID, ref.mediainfo FROM releaseextrafull ref INNER JOIN releases r ON r.ID = ref.releaseID WHERE r.musicinfoID = -2"); + $res = $db->query("SELECT r.searchname, ref.releaseid, ref.mediainfo FROM releaseextrafull ref INNER JOIN releases r ON r.id = ref.releaseid WHERE r.musicinfoid = -2"); $rescount = sizeof($res); if ($rescount > 0) @@ -573,7 +573,7 @@ class Music $defaultGenres = $gen->getGenres(Genres::MUSIC_TYPE); $genreassoc = array(); foreach($defaultGenres as $dg) - $genreassoc[$dg['ID']] = strtolower($dg['title']); + $genreassoc[$dg['id']] = strtolower($dg['title']); foreach($res as $rel) { @@ -601,11 +601,11 @@ class Music } else { - $albumId = $albumCheck["ID"]; + $albumId = $albumCheck["id"]; } } - $sql = sprintf("update releases set musicinfoID = %d where ID = %d", $albumId, $rel["releaseID"]); + $sql = sprintf("update releases set musicinfoid = %d where id = %d", $albumId, $rel["releaseid"]); $db->queryExec($sql); } diff --git a/lib/copy_this/www/lib/nfo.php b/lib/copy_this/www/lib/nfo.php index e76201d3f..d37282b74 100644 --- a/lib/copy_this/www/lib/nfo.php +++ b/lib/copy_this/www/lib/nfo.php @@ -227,14 +227,14 @@ class Nfo $db = new DB(); foreach($blobhash as $uid => $blob){ $query = sprintf( - "REPLACE INTO releasenfo (ID, releaseID, binaryID, nfo) ". + "REPLACE INTO releasenfo (id, releaseid, binaryID, nfo) ". "VALUES (NULL, %d, 0, compress(%s));", $uid, $db->escapeString($blob)); $id = $db->queryInsert($query); if(!$id){ if($this->verbose) echo "!"; }else{ - $query = sprintf("UPDATE releases SET releasenfoID = %d WHERE ID = %d LIMIT 1", + $query = sprintf("UPDATE releases SET releasenfoid = %d WHERE id = %d LIMIT 1", $id, $uid); $res = $db->queryExec($query); if($this->verbose) echo "s"; @@ -260,12 +260,12 @@ class Nfo // $nfoblob is expected as follows // // $nfoblob = array( - // [] = array( + // [] = array( // [0] = , // [1] = , // ... // ), - // [] = array( + // [] = array( // [0] = , // ), // ... @@ -273,7 +273,7 @@ class Nfo // // Meanwhile, $nfometa is expected as follows: // $nfometa = array( - // [] = array( + // [] = array( // [groups] = array( // "alt.binaries.mygroupa", // "alt.binaries.mygroupb", @@ -287,7 +287,7 @@ class Nfo // ... // ) // ), - // [] = array( + // [] = array( // [groups] = array( // "alt.binaries.mygroupa", // ... @@ -383,7 +383,7 @@ class Nfo // back of the array // // $nfometa = array( - // [] = array( + // [] = array( // [groups] = array( // "alt.binaries.mygroupa", // "alt.binaries.mygroupb", @@ -397,7 +397,7 @@ class Nfo // ... // ) // ), - // [] = array( + // [] = array( // [groups] = array( // "alt.binaries.mygroupa", // ... @@ -498,8 +498,8 @@ class Nfo $nfometa = array(); // Missing NFO Query (oldest first so they don't expire on us) - $mnfo = "SELECT ID,guid, name FROM releases r ". - "WHERE r.releasenfoID = ".Nfo::FLAG_NFO_PENDING. + $mnfo = "SELECT id,guid, name FROM releases r ". + "WHERE r.releasenfoid = ".Nfo::FLAG_NFO_PENDING. " ORDER BY postdate DESC"; if ($limit !==Null and $limit > 0) @@ -511,8 +511,8 @@ class Nfo $nzbfile = $nzb->getNZBPath($r["guid"]); if(!is_file($nzbfile)){ if($this->verbose) echo sprintf("%s Missing NZB File: %d/%s ...\n", - 'NfoProc', intval($r["ID"]), $r["name"]); - $this->setNfoMissing($r["ID"]); + 'NfoProc', intval($r["id"]), $r["name"]); + $this->setNfoMissing($r["id"]); continue; } @@ -520,8 +520,8 @@ class Nfo if (!$nzbInfo->loadFromFile($nzbfile)) { if($this->verbose) echo sprintf("%s Unable to parse NZB File: %d/%s ...\n", - 'NfoProc', intval($r["ID"]), $r["name"]); - $this->setNfoMissing($r["ID"]); + 'NfoProc', intval($r["id"]), $r["name"]); + $this->setNfoMissing($r["id"]); continue; } @@ -535,19 +535,19 @@ class Nfo if(is_array($matches)){ if(!count($matches)){ if($this->verbose) echo "nfo missing.\n"; - $this->setNfoMissing($r["ID"]); + $this->setNfoMissing($r["id"]); continue; } }else{ if($this->verbose) echo "corrupt nzb.\n"; - $this->setNfoMissing($r["ID"]); + $this->setNfoMissing($r["id"]); continue; } if($this->verbose) echo count($matches)." possible nfo(s).\n"; $processed++; - // Hash Matches by Release ID - $nfometa[(string)$r["ID"]] = $matches; + // Hash Matches by Release id + $nfometa[(string)$r["id"]] = $matches; if(!($processed%$batch)) { @@ -588,7 +588,7 @@ class Nfo public function deleteReleaseNfo($relid) { $db = new DB(); - return $db->queryExec(sprintf("DELETE from releasenfo where releaseID = %d", $relid)); + return $db->queryExec(sprintf("DELETE from releasenfo where releaseid = %d", $relid)); } /** @@ -597,8 +597,8 @@ class Nfo private function setNfoMissing($relid) { $db = new DB(); - $q = sprintf("UPDATE releases SET releasenfoID = %d ". - "WHERE ID = %d", Nfo::FLAG_NFO_MISSING, $relid); + $q = sprintf("UPDATE releases SET releasenfoid = %d ". + "WHERE id = %d", Nfo::FLAG_NFO_MISSING, $relid); return $db->queryExec($q); } @@ -610,8 +610,8 @@ class Nfo $db = new DB(); // Has NFO Query $mnfo = "SELECT uncompress(rn.nfo) as nfo FROM releases r ". - "INNER JOIN releasenfo rn ON rn.releaseID = r.ID AND rn.ID = r.releasenfoID ". - "WHERE rn.nfo IS NOT NULL AND r.ID = %d LIMIT 1"; + "INNER JOIN releasenfo rn ON rn.releaseid = r.id AND rn.id = r.releasenfoid ". + "WHERE rn.nfo IS NOT NULL AND r.id = %d LIMIT 1"; $res = $db->queryOneRow(sprintf($mnfo, $relid)); if($res && isset($res['nfo'])) { diff --git a/lib/copy_this/www/lib/nntp.php b/lib/copy_this/www/lib/nntp.php index 700ebc318..871c0017e 100644 --- a/lib/copy_this/www/lib/nntp.php +++ b/lib/copy_this/www/lib/nntp.php @@ -562,7 +562,7 @@ class NNTP extends Net_NNTP_Client $loops = $messageSize = 0; - // Loop over the message-ID's or article numbers. + // Loop over the message-id's or article numbers. foreach ($identifiers as $wanted) { /* This is to attempt to prevent string size overflow. @@ -632,7 +632,7 @@ class NNTP extends Net_NNTP_Client } } - // If it's a string check if it's a valid message-ID. + // If it's a string check if it's a valid message-id. } else if (is_string($identifiers) || is_numeric($identifiers)) { $body = $this->_getMessage($groupName, $identifiers); if ($alternate === true && $this->isError($body)) { @@ -662,7 +662,7 @@ class NNTP extends Net_NNTP_Client * associated values, optionally decode the body using yEnc. * * @param string $groupName The name of the group the article is in. - * @param mixed $identifier (string)The message-ID of the article to download. + * @param mixed $identifier (string)The message-id of the article to download. * (int) The article number. * @param bool $yEnc Attempt to yEnc decode the body. * @@ -691,9 +691,9 @@ class NNTP extends Net_NNTP_Client } } - // Check if it's an article number or message-ID. + // Check if it's an article number or message-id. if (!is_numeric($identifier)) { - // If it's a message-ID, check if it has the required triangular brackets. + // If it's a message-id, check if it has the required triangular brackets. $identifier = $this->_formatMessageID($identifier); } @@ -746,7 +746,7 @@ class NNTP extends Net_NNTP_Client * Download a full article header. * * @param string $groupName The name of the group the article is in. - * @param mixed $identifier (string) The message-ID of the article to download. + * @param mixed $identifier (string) The message-id of the article to download. * (int) The article number. * * @return mixed On success : (array) The header. @@ -1493,7 +1493,7 @@ class NNTP extends Net_NNTP_Client * Download an article body (an article without the header). * * @param string $groupName The name of the group the article is in. - * @param mixed $identifier (string) The message-ID of the article to download. + * @param mixed $identifier (string) The message-id of the article to download. * (int) The article number. * * @return mixed On success : (string) The article's body. diff --git a/lib/copy_this/www/lib/nzb.php b/lib/copy_this/www/lib/nzb.php index 220ccb500..5e78002b6 100644 --- a/lib/copy_this/www/lib/nzb.php +++ b/lib/copy_this/www/lib/nzb.php @@ -66,7 +66,7 @@ class NZB gzwrite($fp, " " . htmlspecialchars($name, ENT_QUOTES, 'utf-8') . "\n"); gzwrite($fp, "\n\n"); - $result = $db->queryDirect(sprintf("SELECT %s.*, UNIX_TIMESTAMP(date) AS unixdate, groups.name as groupname FROM %s inner join groups on %s.groupID = groups.ID WHERE %s.releaseID = %d ORDER BY %s.name", + $result = $db->queryDirect(sprintf("SELECT %s.*, UNIX_TIMESTAMP(date) AS unixdate, groups.name as groupname FROM %s inner join groups on %s.groupid = groups.id WHERE %s.releaseid = %d ORDER BY %s.name", $bName, $bName, $bName, @@ -92,7 +92,7 @@ class NZB $resparts = $db->queryDirect(sprintf("SELECT DISTINCT(messageID), size, partnumber FROM %s WHERE binaryID = %d ORDER BY partnumber", $pName, - $binrow["ID"])); + $binrow["id"])); while ($partsrow = $db->getAssocArray($resparts)) { gzwrite($fp, " " . htmlspecialchars($partsrow["messageID"], ENT_QUOTES, 'utf-8') . "\n"); } @@ -104,7 +104,7 @@ class NZB if (is_file($path)) { $db->queryExec( sprintf(' - UPDATE releases SET nzbstatus = %d WHERE ID = %d', + UPDATE releases SET nzbstatus = %d WHERE id = %d', Enzebe::NZB_ADDED, $relid ) diff --git a/lib/copy_this/www/lib/nzbvortex.php b/lib/copy_this/www/lib/nzbvortex.php index eab364004..d1fcec437 100644 --- a/lib/copy_this/www/lib/nzbvortex.php +++ b/lib/copy_this/www/lib/nzbvortex.php @@ -7,7 +7,7 @@ final class NZBVortex { protected $nonce = null; protected $session = null; - + public function __construct() { if (is_null($this->session)) @@ -16,7 +16,7 @@ final class NZBVortex $this->login(); } } - + /** * get text for state * @param int $code @@ -52,11 +52,11 @@ final class NZBVortex 23 => 'Move failed', 24 => 'Badly encoded download (uuencoded)' ); - + return (isset($states[$code])) ? $states[$code] : -1; } - + /** * get overview of NZB's in queue * @return array @@ -70,10 +70,10 @@ final class NZBVortex $nzb['original_state'] = $nzb['state']; $nzb['state'] = (1 == $nzb['isPaused']) ? 'Paused' : $this->getState($nzb['state']); } - + return $response; } - + /** * add NZB to queue @@ -86,21 +86,21 @@ final class NZBVortex { $page = new Page; $user = new Users; - + $host = $page->serverurl; $data = $user->getById($user->currentUserId()); - $url = sprintf("%sgetnzb/%s.nzb&i=%s&r=%s", $host, $nzb, $data['ID'], $data['rsstoken']); - + $url = sprintf("%sgetnzb/%s.nzb&i=%s&r=%s", $host, $nzb, $data['id'], $data['rsstoken']); + $params = array ( 'sessionid' => $this->session, 'url' => $url ); - + $response = $this->sendRequest('nzb/add', $params); } } - + /** * resume NZB @@ -132,13 +132,13 @@ final class NZBVortex $response = $this->sendRequest(sprintf('nzb/%s/pause', $id), $params); } } - + /** * move NZB up in queue * @param int $id * @return void - */ + */ public function moveUp($id = 0) { if ($id > 0) @@ -148,8 +148,8 @@ final class NZBVortex $response = $this->sendRequest(sprintf('nzb/%s/moveup', $id), $params); } } - - + + /** * move NZB down in queue * @param int $id @@ -196,7 +196,7 @@ final class NZBVortex $response = $this->sendRequest(sprintf('nzb/%s/cancelDelete', $id), $params); } } - + /** * move NZB to top of queue @@ -212,8 +212,8 @@ final class NZBVortex $response = $this->sendRequest(sprintf('nzb/%s/movetop', $id), $params); } } - - + + /** * get filelist for nzb * @param int $id @@ -228,11 +228,11 @@ final class NZBVortex $response = $this->sendRequest(sprintf('file/%s', $id), $params); return $response; } - + return false; } - - + + /** * get /auth/nonce * @return void @@ -245,7 +245,7 @@ final class NZBVortex /** * @return void - */ + */ protected function login() { $user = new Users(); @@ -253,22 +253,22 @@ final class NZBVortex $cnonce = generateUuid(); $hash = hash('sha256', sprintf("%s:%s:%s", $this->nonce, $cnonce, $data['nzbvortex_api_key']), true); $hash = base64_encode($hash); - + $params = array ( 'nonce' => $this->nonce, 'cnonce' => $cnonce, 'hash' => $hash ); - + $response = $this->sendRequest('auth/login', $params); if ('successful' == $response['loginResult']) $this->session = $response['sessionID']; - + if ('failed' == $response['loginResult']) { } } - + /** * sendRequest() * @return array @@ -277,44 +277,44 @@ final class NZBVortex { $user = new Users; $data = $user->getById($user->currentUserId()); - + $url = sprintf('%s/api', $data['nzbvortex_server_url']); $params = http_build_query($params); $ch = curl_init(sprintf("%s/%s?%s", $url, $path, $params)); - + curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); - + #curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); #curl_setopt($ch, CURLOPT_PROXY, 'localhost:8888'); - + $response = curl_exec($ch); $response = json_decode($response, true); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); - + curl_close($ch); - + switch ($status) { case 0: throw new Exception(sprintf('Unable to connect. Is NZBVortex running? Is your API key correct? Is something blocking ports? (Err: %s)', $error)); break; - + case 200: return $response; break; - + case 403: throw new Exception('Unable to login. Is your API key correct?'); break; - + default: throw new Exception(sprintf("%s (%s): %s", $path, $status, $response['result'])); break; - } + } } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/parsing.php b/lib/copy_this/www/lib/parsing.php index 5173d4f66..7ae3a09fd 100644 --- a/lib/copy_this/www/lib/parsing.php +++ b/lib/copy_this/www/lib/parsing.php @@ -45,17 +45,17 @@ class Parsing $db = new DB(); // Default query for both full db and last 4 hours. - $sql = "SELECT r.searchname, r.name, r.fromname, r.ID as RID, r.categoryID, r.guid, r.postdate, - rn.ID as nfoID, + $sql = "SELECT r.searchname, r.name, r.fromname, r.id as RID, r.categoryid, r.guid, r.postdate, + rn.id as nfoid, g.name as groupname, GROUP_CONCAT(rf.name) as filenames FROM releases r - LEFT JOIN releasenfo rn ON (rn.releaseID = r.ID) - LEFT JOIN groups g ON (g.ID = r.groupID) - LEFT JOIN releasefiles rf ON (rf.releaseID = r.ID) - WHERE r.categoryID in (" . Category::CAT_TV_OTHER . "," . Category::CAT_MOVIE_OTHER . "," . Category::CAT_MISC_OTHER . "," . Category::CAT_XXX_OTHER . ") + LEFT JOIN releasenfo rn ON (rn.releaseid = r.id) + LEFT JOIN groups g ON (g.id = r.groupid) + LEFT JOIN releasefiles rf ON (rf.releaseid = r.id) + WHERE r.categoryid in (" . Category::CAT_TV_OTHER . "," . Category::CAT_MOVIE_OTHER . "," . Category::CAT_MISC_OTHER . "," . Category::CAT_XXX_OTHER . ") %s - GROUP BY r.ID"; + GROUP BY r.id"; $res = $db->query(sprintf($sql, $this->limited ? "AND r.adddate BETWEEN NOW() - INTERVAL 4 HOUR AND NOW()" : "")); $this->releasestocheck = sizeof($res); @@ -90,7 +90,7 @@ class Parsing /// ///Use the Nfo to try to get the proper Releasename. /// - $nfo = $db->queryOneRow(sprintf("select uncompress(nfo) as nfo from releasenfo where releaseID = %d", $rel['RID'])); + $nfo = $db->queryOneRow(sprintf("select uncompress(nfo) as nfo from releasenfo where releaseid = %d", $rel['RID'])); if ($nfo && $foundName == "") { $this->nfosprocessed++; $nfo = $nfo['nfo']; @@ -799,7 +799,7 @@ class Parsing if (($methodused == 'a.b.hdtv.x264') && ($rel['groupname'] == 'alt.binaries.hdtv.x264')) { $categoryID = Category::CAT_MOVIE_HD; } - if (($categoryID == $rel['categoryID'] || $categoryID == '7900') || ($foundName == $rel['name'] || $foundName == $rel['searchname'])) { + if (($categoryID == $rel['categoryid'] || $categoryID == '7900') || ($foundName == $rel['name'] || $foundName == $rel['searchname'])) { $foundName = null; $methodused = null; } else { @@ -813,14 +813,14 @@ class Parsing echo ' Old SearchName: ' . $rel['searchname'] . "\n"; echo ' New Name: ' . $name . "\n"; echo ' New SearchName: ' . $searchname . "\n"; - echo ' Old Cat: ' . $rel['categoryID'] . "\n"; + echo ' Old Cat: ' . $rel['categoryid'] . "\n"; echo ' New Cat: ' . $categoryID . "\n"; echo ' Method: ' . $methodused . "\n"; echo " Status: Release changed\n\n"; } if (!$this->echoonly) { $db = new DB(); - $db->queryExec(sprintf("update releases SET name = %s, searchname = %s, categoryID = %d, imdbID = NULL, rageID = -1, bookinfoID = NULL, musicinfoID = NULL, consoleinfoID = NULL WHERE releases.ID = %d", $db->escapeString($name), $db->escapeString($searchname), $categoryID, $rel['RID'])); + $db->queryExec(sprintf("update releases SET name = %s, searchname = %s, categoryid = %d, imdbid = NULL, rageid = -1, bookinfoid = NULL, musicinfoid = NULL, consoleinfoid = NULL WHERE releases.id = %d", $db->escapeString($name), $db->escapeString($searchname), $categoryID, $rel['RID'])); } $this->numupdated++; } @@ -834,10 +834,10 @@ class Parsing echo "PostPrc : Performing cleanup \n"; $db = new Db; - $catsql = "select ID from groups"; + $catsql = "select id from groups"; $res = $db->query($catsql); foreach ($res as $r2) { - $sql = sprintf("select r.ID, name, searchname, categoryID, size, totalpart, musicinfoID, preID, groupID, rn.id as nfoID from releases r left outer join releasenfo rn ON rn.releaseID = r.ID where groupid = %d", $r2['ID']) . " %s "; + $sql = sprintf("select r.id, name, searchname, categoryid, size, totalpart, musicinfoid, preID, groupid, rn.id as nfoid from releases r left outer join releasenfo rn ON rn.releaseid = r.id where groupid = %d", $r2['id']) . " %s "; $unbuf = $db->queryDirect(sprintf($sql, ($this->limited ? " and r.adddate BETWEEN NOW() - INTERVAL 1 DAY AND NOW() " : ""))); while ($r = $db->getAssocArray($unbuf)) { @@ -871,7 +871,7 @@ class Parsing //Remove releases if it starts with a IMDBID. if (preg_match('/^tt\d{6}/i', $r['name'])) { - $this->handleClean($r, "Modifying Release because it starts with a IMDB ID: " . $r['name'] . " - "); + $this->handleClean($r, "Modifying Release because it starts with a IMDB id: " . $r['name'] . " - "); continue; } @@ -883,7 +883,7 @@ class Parsing //Remove releases if the name contains http(s): . // try stripos, its faster than preg_match - if (preg_match('/sample/i', $r['name']) && $r['categoryID'] > 5000 && $r['categoryID'] < 5999) { + if (preg_match('/sample/i', $r['name']) && $r['categoryid'] > 5000 && $r['categoryid'] < 5999) { $this->handleClean($r, "Modifying Release because it contains Sample in the Release Name: " . $r['name'] . " - ", true); continue; } @@ -896,7 +896,7 @@ class Parsing ///This section will cleanup releases based on the category and things such as release size and release name length /// - switch ($r['categoryID']) { + switch ($r['categoryid']) { //CONSOLE case Category::CAT_GAME_NDS: //NDS if ($r['size'] < 2000000) { @@ -1064,7 +1064,7 @@ class Parsing $this->handleClean($r, "Modifying Release Audio MP3 Size: " . $r['name'] . " - ", true); continue; } - if (strlen($r['name']) < 25 && !preg_match('/(discography|\b((19|20)\d{2})\b)/i', $r['name']) && $r['musicinfoID'] == '-2' && !$r['preID']) { + if (strlen($r['name']) < 25 && !preg_match('/(discography|\b((19|20)\d{2})\b)/i', $r['name']) && $r['musicinfoid'] == '-2' && !$r['preID']) { $this->handleClean($r, "Modifying Release Audio MP3 ReleaseLEN: " . $r['name'] . " - "); continue; } @@ -1075,7 +1075,7 @@ class Parsing $this->handleClean($r, "Modifying Release Audio Video Size: " . $r['name'] . " - ", true); continue; } - if (strlen($r['name']) < 20 && !preg_match('/(discography|\b((19|20)\d{2})\b)/i', $r['name']) && $r['musicinfoID'] == '-2' && !$r['preID']) { + if (strlen($r['name']) < 20 && !preg_match('/(discography|\b((19|20)\d{2})\b)/i', $r['name']) && $r['musicinfoid'] == '-2' && !$r['preID']) { //echo "Modifying Release Audio Video ReleaseLEN: ".$r['name']." - "; //handleClean($r); not sure what to continue; @@ -1087,7 +1087,7 @@ class Parsing $this->handleClean($r, "Modifying Release Audiobook Size: " . $r['name'] . " - ", true); continue; } - if (strlen($r['name']) < 20 && !preg_match('/(discography|\b((19|20)\d{2})\b)/i', $r['name']) && $r['musicinfoID'] == '-2' && !$r['preID']) { + if (strlen($r['name']) < 20 && !preg_match('/(discography|\b((19|20)\d{2})\b)/i', $r['name']) && $r['musicinfoid'] == '-2' && !$r['preID']) { $this->handleClean($r, "Modifying Release Audiobook ReleaseLEN: " . $r['name'] . " - "); continue; } @@ -1099,7 +1099,7 @@ class Parsing //handleClean($r,true); continue; } - if (strlen($r['name']) < 20 && !preg_match('/(discography|\b((19|20)\d{2})\b)/i', $r['name']) && $r['musicinfoID'] == '-2' && !$r['preID']) { + if (strlen($r['name']) < 20 && !preg_match('/(discography|\b((19|20)\d{2})\b)/i', $r['name']) && $r['musicinfoid'] == '-2' && !$r['preID']) { //echo "Modifying Release Audio Lossless ReleaseLEN: ".$r['name']." - "; //handleClean($r); continue; @@ -1112,7 +1112,7 @@ class Parsing $this->handleClean($r, "Modifying Release PC 0Day Size: " . $r['name'] . " - ", true); continue; } - if (strlen($r['name']) < 20 && $r['nfoID'] == null && !$r['preID']) { + if (strlen($r['name']) < 20 && $r['nfoid'] == null && !$r['preID']) { $this->handleClean($r, "Modifying Release PC 0Day ReleaseLEN: " . $r['name'] . " - "); continue; } @@ -1387,10 +1387,10 @@ class Parsing private function handleClean($row, $reason = "", $forceNuke = false) { if (!$forceNuke) { - $this->cleanup['misc'][$row['ID']] = true; + $this->cleanup['misc'][$row['id']] = true; if ($this->verbose) echo $reason . "Moving to Misc Other\n"; } else { - $this->cleanup['nuke'][$row['ID']] = true; + $this->cleanup['nuke'][$row['id']] = true; if ($this->verbose) echo $reason . "Removing Release\n"; } } @@ -1412,7 +1412,7 @@ class Parsing } if (count($this->cleanup['misc'])) { - $sql = 'update releases set categoryID = ' . Category::CAT_MISC_OTHER . ' where categoryID != ' . Category::CAT_MISC_OTHER . ' and id in (' . implode(array_keys($this->cleanup['misc']), ',') . ')'; + $sql = 'update releases set categoryid = ' . Category::CAT_MISC_OTHER . ' where categoryid != ' . Category::CAT_MISC_OTHER . ' and id in (' . implode(array_keys($this->cleanup['misc']), ',') . ')'; $db->queryExec($sql); } } @@ -1427,7 +1427,7 @@ class Parsing { $db = new Db; - $sql = "select ID, searchname from releases where 1 = 1 "; + $sql = "select id, searchname from releases where 1 = 1 "; $sql .= ($this->limited ? "AND adddate BETWEEN NOW() - INTERVAL 1 DAY AND NOW()" : ""); $sql .= " order by postdate desc"; @@ -1439,43 +1439,43 @@ class Parsing while (preg_match('/^(\:|\"|\-| |\_)+/', $r['searchname'])) { $r['searchname'] = substr($r['searchname'], 1); } - $this->updateName($db, $r['ID'], $oldname, $r['searchname']); + $this->updateName($db, $r['id'], $oldname, $r['searchname']); } if (preg_match('/^000\-/', $r['searchname'])) { while (preg_match('/^000\-/', $r['searchname'])) { $r['searchname'] = substr($r['searchname'], 4); } - $this->updateName($db, $r['ID'], $oldname, $r['searchname']); + $this->updateName($db, $r['id'], $oldname, $r['searchname']); } if (preg_match('/(\:|\"|\-| |\/)$/', $r['searchname'])) { while (preg_match('/(\:|\"|\-| |\/)$/', $r['searchname'])) { $r['searchname'] = substr($r['searchname'], 0, -1); } - $this->updateName($db, $r['ID'], $oldname, $r['searchname']); + $this->updateName($db, $r['id'], $oldname, $r['searchname']); } if (preg_match('/\"/', $r['searchname'])) { while (preg_match('/\"/', $r['searchname'])) { $r['searchname'] = str_replace('"', '', $r['searchname']); } - $this->updateName($db, $r['ID'], $oldname, $r['searchname']); + $this->updateName($db, $r['id'], $oldname, $r['searchname']); } if (preg_match('/\-\d{1}$/', $r['searchname'])) { while (preg_match('/\-\d{1}$/', $r['searchname'])) { $r['searchname'] = preg_replace('/\-\d{1}$/', '', $r['searchname']); } - $this->updateName($db, $r['ID'], $oldname, $r['searchname']); + $this->updateName($db, $r['id'], $oldname, $r['searchname']); } if (preg_match('/\!+.*?mom.*?\!+/i', $r['searchname'])) { while (preg_match('/\!+.*?mom.*?\!+/i', $r['searchname'])) { $r['searchname'] = preg_replace('/\!+.*?mom.*?\!+/i', '', $r['searchname']); } - $this->updateName($db, $r['ID'], $oldname, $r['searchname']); + $this->updateName($db, $r['id'], $oldname, $r['searchname']); } if (preg_match('/(\\/)/i', $r['searchname'])) { while (preg_match('/(\\/)/i', $r['searchname'])) { $r['searchname'] = preg_replace('/(\\/)/i', '', $r['searchname']); } - $this->updateName($db, $r['ID'], $oldname, $r['searchname']); + $this->updateName($db, $r['id'], $oldname, $r['searchname']); } } } @@ -1489,6 +1489,6 @@ class Parsing echo sprintf("OLD : %s\nNEW : %s\n\n", $oldname, $newname); if (!$this->echoonly) - $db->queryExec(sprintf("update releases set name=%s, searchname = %s WHERE ID = %d", $db->escapeString($newname), $db->escapeString($newname), $id)); + $db->queryExec(sprintf("update releases set name=%s, searchname = %s WHERE id = %d", $db->escapeString($newname), $db->escapeString($newname), $id)); } } diff --git a/lib/copy_this/www/lib/postprocess.php b/lib/copy_this/www/lib/postprocess.php index 5130b5288..1b1a42a00 100644 --- a/lib/copy_this/www/lib/postprocess.php +++ b/lib/copy_this/www/lib/postprocess.php @@ -72,9 +72,9 @@ class PostProcess if($this->site->deletepasswordedrelease == 1) { echo "PostPrc : Removing unwanted releases\n"; - $result = $db->query("select ID from releases where passwordstatus > 0"); + $result = $db->query("select id from releases where passwordstatus > 0"); foreach ($result as $row) - $r->delete($row["ID"]); + $r->delete($row["id"]); } // @@ -84,9 +84,9 @@ class PostProcess { echo "PostPrc : Deleting releases older than ".$this->site->releaseretentiondays." days\n"; - $result = $db->query(sprintf("select ID from releases where postdate < %s - interval %d day", $db->escapeString($currTime_ori["now"]), $this->site->releaseretentiondays)); + $result = $db->query(sprintf("select id from releases where postdate < %s - interval %d day", $db->escapeString($currTime_ori["now"]), $this->site->releaseretentiondays)); foreach ($result as $row) - $r->delete($row["ID"]); + $r->delete($row["id"]); } // @@ -94,7 +94,7 @@ class PostProcess // if($this->site->audiopreviewprune > 0) { - $result = $db->query(sprintf("select guid from releases where categoryID in (select ID from category where parentID = ".Category::CAT_PARENT_MUSIC.") and haspreview = 2 and adddate < %s - interval %d day", $db->escapeString($currTime_ori["now"]), $this->site->audiopreviewprune)); + $result = $db->query(sprintf("select guid from releases where categoryid in (select id from category where parentid = ".Category::CAT_PARENT_MUSIC.") and haspreview = 2 and adddate < %s - interval %d day", $db->escapeString($currTime_ori["now"]), $this->site->audiopreviewprune)); if (sizeof($result) > 0) { @@ -117,7 +117,7 @@ class PostProcess // // all releases where the only file inside the rars is *.exe and they are not in the PC category // - $sql = "select releasefiles.releaseID as ID from releasefiles inner join ( select releaseID, count(*) as totnum from releasefiles group by releaseID ) x on x.releaseID = releasefiles.releaseID and x.totnum = 1 inner join releases on releases.ID = releasefiles.releaseID left join releasenfo on releasenfo.releaseID = releases.ID where (releasefiles.name like '%.exe' or releasefiles.name like '%.scr') and (releases.categoryID not in (select ID from category where parentID = ".Category::CAT_PARENT_PC.") or (releases.categoryID in (select ID from category where parentID = ".Category::CAT_PARENT_PC.") and releasenfo.ID is null)) group by releasefiles.releaseID"; + $sql = "select releasefiles.releaseid as id from releasefiles inner join ( select releaseid, count(*) as totnum from releasefiles group by releaseid ) x on x.releaseid = releasefiles.releaseid and x.totnum = 1 inner join releases on releases.id = releasefiles.releaseid left join releasenfo on releasenfo.releaseid = releases.id where (releasefiles.name like '%.exe' or releasefiles.name like '%.scr') and (releases.categoryid not in (select id from category where parentid = ".Category::CAT_PARENT_PC.") or (releases.categoryid in (select id from category where parentid = ".Category::CAT_PARENT_PC.") and releasenfo.id is null)) group by releasefiles.releaseid"; $result = $db->query($sql); $spamIDs = array_merge($result, $spamIDs); @@ -126,7 +126,7 @@ class PostProcess // if ($this->site->exepermittedcategories != '') { - $sql = sprintf("select releasefiles.releaseID as ID from releasefiles inner join releases on releases.ID = releasefiles.releaseID left join releasenfo on releasenfo.releaseID = releases.ID where releasefiles.name like '%%.exe' and releases.categoryID not in (%s) group by releasefiles.releaseID", $this->site->exepermittedcategories); + $sql = sprintf("select releasefiles.releaseid as id from releasefiles inner join releases on releases.id = releasefiles.releaseid left join releasenfo on releasenfo.releaseid = releases.id where releasefiles.name like '%%.exe' and releases.categoryid not in (%s) group by releasefiles.releaseid", $this->site->exepermittedcategories); $result = $db->query($sql); $spamIDs = array_merge($result, $spamIDs); } @@ -134,21 +134,21 @@ class PostProcess // // delete all releases which contain a file with password.url in it // - $sql = "select distinct releasefiles.releaseID as ID from releasefiles where name = 'password.url'"; + $sql = "select distinct releasefiles.releaseid as id from releasefiles where name = 'password.url'"; $result = $db->query($sql); $spamIDs = array_merge($result, $spamIDs); // // all releases where the only file inside the rars is *.rar // - $sql = "select releasefiles.releaseID as ID from releasefiles inner join ( select releaseID, count(*) as totnum from releasefiles group by releaseID ) x on x.releaseID = releasefiles.releaseID and x.totnum = 1 inner join releases on releases.ID = releasefiles.releaseID where releasefiles.name like '%.rar' group by releasefiles.releaseID"; + $sql = "select releasefiles.releaseid as id from releasefiles inner join ( select releaseid, count(*) as totnum from releasefiles group by releaseid ) x on x.releaseid = releasefiles.releaseid and x.totnum = 1 inner join releases on releases.id = releasefiles.releaseid where releasefiles.name like '%.rar' group by releasefiles.releaseid"; $result = $db->query($sql); $spamIDs = array_merge($result, $spamIDs); // // all audio which contains a file with .exe in // - $sql = "select distinct r.ID from releasefiles rf inner join releases r on r.id = rf.releaseID and r.categoryID in (select ID from category where parentID = ".Category::CAT_PARENT_MUSIC.") where (rf.name like '%.exe' or rf.name like '%.bin')"; + $sql = "select distinct r.id from releasefiles rf inner join releases r on r.id = rf.releaseid and r.categoryid in (select id from category where parentid = ".Category::CAT_PARENT_MUSIC.") where (rf.name like '%.exe' or rf.name like '%.bin')"; $result = $db->query($sql); $spamIDs = array_merge($result, $spamIDs); @@ -156,7 +156,7 @@ class PostProcess { echo "PostPrc : Deleting ".count($spamIDs)." spam releases\n" ; foreach ($spamIDs as $row) - $r->delete($row["ID"]); + $r->delete($row["id"]); } } } @@ -244,20 +244,20 @@ class PostProcess public function processUnknownCategory() { $db = new DB(); - $sql = sprintf("select ID from releases where categoryID = %d", Category::CAT_NOT_DETERMINED); + $sql = sprintf("select id from releases where categoryid = %d", Category::CAT_NOT_DETERMINED); $result = $db->query($sql); $rescount = sizeof($result); if ($rescount > 0) { echo "PostPrc : Attempting to fix ".$rescount." uncategorised release(s)\n"; - $sql = sprintf("update releases inner join releasevideo rv on rv.releaseID = releases.ID set releases.categoryID = %d where imdbid is not null and categoryid = %d and videocodec = 'XVID'", Category::CAT_MOVIE_SD, Category::CAT_NOT_DETERMINED); + $sql = sprintf("update releases inner join releasevideo rv on rv.releaseid = releases.id set releases.categoryid = %d where imdbid is not null and categoryid = %d and videocodec = 'XVID'", Category::CAT_MOVIE_SD, Category::CAT_NOT_DETERMINED); $db->queryExec($sql); - $sql = sprintf("update releases inner join releasevideo rv on rv.releaseID = releases.ID set releases.categoryID = %d where imdbid is not null and categoryid = %d and videocodec = 'V_MPEG4/ISO/AVC'", Category::CAT_MOVIE_HD, Category::CAT_NOT_DETERMINED); + $sql = sprintf("update releases inner join releasevideo rv on rv.releaseid = releases.id set releases.categoryid = %d where imdbid is not null and categoryid = %d and videocodec = 'V_MPEG4/ISO/AVC'", Category::CAT_MOVIE_HD, Category::CAT_NOT_DETERMINED); $db->queryExec($sql); - $sql = sprintf("update releases set categoryID = %d where categoryID = %d", Category::CAT_MISC_OTHER, Category::CAT_NOT_DETERMINED); + $sql = sprintf("update releases set categoryid = %d where categoryid = %d", Category::CAT_MISC_OTHER, Category::CAT_NOT_DETERMINED); $db->queryExec($sql); } } @@ -343,8 +343,8 @@ class PostProcess // // Get out all releases which have not been checked more than max attempts for password. // - $sql = sprintf("select r.ID, r.guid, r.name, c.disablepreview from releases r - left join category c on c.ID = r.categoryID + $sql = sprintf("select r.id, r.guid, r.name, c.disablepreview from releases r + left join category c on c.id = r.categoryid where (r.passwordstatus between %d and -1) or (r.haspreview = -1 and c.disablepreview = 0) order by r.postdate desc limit %d ", ($maxattemptstocheckpassworded + 1) * -1, $numtoProcess); $result = $db->query($sql); @@ -365,7 +365,7 @@ class PostProcess $blnTookSample = ($rel['disablepreview'] == 1) ? true : false; //only attempt sample if not disabled if ($blnTookSample) - $db->queryExec(sprintf("update releases set haspreview = 0 where id = %d", $rel['ID'])); + $db->queryExec(sprintf("update releases set haspreview = 0 where id = %d", $rel['id'])); // // Go through the binaries for this release looking for a rar, a sample, and a mediafile @@ -446,7 +446,7 @@ class PostProcess } if ($processMediainfo) - $blnTookMediainfo = $this->getMediainfo($tmpPath, $this->site->mediainfopath, $rel['ID']); + $blnTookMediainfo = $this->getMediainfo($tmpPath, $this->site->mediainfopath, $rel['id']); unlink($mediafile); } @@ -478,7 +478,7 @@ class PostProcess $this->updateReleaseHasPreview($rel['guid'], 2); if ($processMediainfo) - $blnTookMediainfo = $this->getMediainfo($tmpPath, $this->site->mediainfopath, $rel['ID']); + $blnTookMediainfo = $this->getMediainfo($tmpPath, $this->site->mediainfopath, $rel['id']); if ($this->site->lamepath != "") $this->lameAudioSample($this->site->lamepath, $rel['guid']); @@ -511,12 +511,12 @@ class PostProcess if ($fetchedBinary === false) { //echo "\nPostPrc : Failed fetching rar file\n"; - $db->queryExec(sprintf("update releases set passwordstatus = passwordstatus - 1 where ID = %d", $rel['ID'])); + $db->queryExec(sprintf("update releases set passwordstatus = passwordstatus - 1 where id = %d", $rel['id'])); continue; } else { - $relFiles = $this->processReleaseFiles($fetchedBinary, $rel['ID']); + $relFiles = $this->processReleaseFiles($fetchedBinary, $rel['id']); if ($this->site->checkpasswordedrar > 0 && $processPasswords) { @@ -553,7 +553,7 @@ class PostProcess if ($processMediainfo && $blnTookMediainfo === false) { - $blnTookMediainfo = $this->getMediainfo($tmpPath, $this->site->mediainfopath, $rel['ID']); + $blnTookMediainfo = $this->getMediainfo($tmpPath, $this->site->mediainfopath, $rel['id']); } // @@ -583,7 +583,7 @@ class PostProcess if (!$blnTookSample) $hpsql = ', haspreview = 0'; - $sql = sprintf("update releases set passwordstatus = %d %s where ID = %d", max($passStatus), $hpsql, $rel["ID"]); + $sql = sprintf("update releases set passwordstatus = %d %s where id = %d", max($passStatus), $hpsql, $rel["id"]); $db->queryExec($sql); } //end foreach result diff --git a/lib/copy_this/www/lib/powerprocess.php b/lib/copy_this/www/lib/powerprocess.php index c3c5a46b8..880d4862f 100644 --- a/lib/copy_this/www/lib/powerprocess.php +++ b/lib/copy_this/www/lib/powerprocess.php @@ -1,25 +1,25 @@ - * @link https://github.com/lordgnu/PowerProcess * @license MIT License * @version 2.0 - * + * * @copyright * Copyright (c) 2011 Don Bauer * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -28,13 +28,13 @@ declare(ticks = 1); * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE @@ -46,243 +46,243 @@ class PowerProcess { const CALLBACK_CONTINUE = 1; const CALLBACK_SHUTDOWN = 2; const CALLBACK_RESTART = 3; - + /** * Current PowerProcess version - * + * * @var string */ public static $version = '2.1'; - + /** * Data store for data that is to be passed to the child process which is to be spawned - * + * * @var mixed */ public $threadData; - + /** * Boolean variable which determines whether or not to shutdown the control process (parent) - * + * * @var boolean */ public $complete; - + /** * Callback array for setting callback functions based on signals that can be sent to the parent process - * + * * @var array */ public $callbacks; - + /** * The name of the current thread. Used by WhoAmI() - * + * * @var string */ public $currentThread; - - /** + + /** * Whether to log internal debug message - * + * * @var boolean */ public $debugLogging; - + /** * The maximum number of concurrent threads that can be running at any given time. - * + * * This setting has an impact on performance for PowerProcess so play * with it on the system you are on to determine a good value. * 10 is a good place to start - * + * * @var integer */ public $maxThreads; - + /** * Array which stores the thread data for the control process (parent) to manage running child threads - * + * * @var array */ public $myThreads; - + /** - * Session ID of parent session when process is daemonized - * + * Session id of parent session when process is daemonized + * * @var integer */ public $parentSID; - - /** + + /** * The pid of the parent process - * + * * Used after a process is forked to * determine whether the new thread is to run the thread code - * + * * @var integer */ public $parentPID; - + /** * Sleep timer in micro seconds for the parent process to sleep between status checks using Tick() - * + * * @var integer */ public $tickCount = 100; - + /** * Whether to add a timestamp to log output - * + * * @var boolean */ public $timeStampLogs = true; - + /** * The maximum number of seconds a thread will be allowed to run. - * + * * Set to 0 to disable a time limit (use with caution) - * + * * @var integer */ public $threadTimeLimit; - + /** - * Location to log information messages to. - * + * Location to log information messages to. + * * Can be a file or php://stdout, php://stderr. * Set to false to disable - * + * * @var mixed */ public $logTo; - + /** * When logging is enabled, this points to the socket in which to write log messages. - * + * * @var resource */ public $logSocket; - + /** - * Signals to install for SignalDispatcher. - * + * Signals to install for SignalDispatcher. + * * You can use any signal constant PNCTL supports * @link http://us3.php.net/manual/en/pcntl.constants.php - * + * * @var array */ public $signalArray = array( SIGUSR1, // User-Defined 1 SIGUSR2 // User-Defined 2 ); - + static public function SignalName($signal) { switch ($signal) { - case SIGHUP: + case SIGHUP: return 'SIGHUP'; - case SIGINT: + case SIGINT: return 'SIGINT'; - case SIGQUIT: + case SIGQUIT: return 'SIGQUIT'; - case SIGILL: + case SIGILL: return 'SIGILL'; - case SIGTRAP: + case SIGTRAP: return 'SIGTRAP'; - case SIGABRT: + case SIGABRT: return 'SIGABRT'; - case SIGIOT: + case SIGIOT: return 'SIGIOT'; - case SIGBUS: + case SIGBUS: return 'SIGBUS'; - case SIGFPE: + case SIGFPE: return 'SIGFPE'; - case SIGUSR1: + case SIGUSR1: return 'SIGUSR1'; - case SIGSEGV: + case SIGSEGV: return 'SIGSEGV'; - case SIGUSR2: + case SIGUSR2: return 'SIGUSR2'; - case SIGPIPE: + case SIGPIPE: return 'SIGPIPE'; - case SIGALRM: + case SIGALRM: return 'SIGALRM'; - case SIGTERM: + case SIGTERM: return 'SIGTERM'; - case SIGSTKFLT: + case SIGSTKFLT: return 'SIGSTKFLT'; - case SIGCLD: + case SIGCLD: return 'SIGCLD'; - case SIGCHLD: + case SIGCHLD: return 'SIGCHLD'; - case SIGCONT: + case SIGCONT: return 'SIGCONT'; - case SIGTSTP: + case SIGTSTP: return 'SIGTSTP'; - case SIGTTIN: + case SIGTTIN: return 'SIGTTIN'; - case SIGTTOU: + case SIGTTOU: return 'SIGTTOU'; - case SIGURG: + case SIGURG: return 'SIGURG'; - case SIGXCPU: + case SIGXCPU: return 'SIGXCPU'; - case SIGXFSZ: + case SIGXFSZ: return 'SIGXFSZ'; - case SIGVTALRM: + case SIGVTALRM: return 'SIGVTALRM'; - case SIGPROF: + case SIGPROF: return 'SIGPROF'; - case SIGWINCH: + case SIGWINCH: return 'SIGWINCH'; - case SIGPOLL: + case SIGPOLL: return 'SIGPOLL'; - case SIGIO: + case SIGIO: return 'SIGIO'; - case SIGPWR: + case SIGPWR: return 'SIGPWR'; - case SIGSYS: + case SIGSYS: return 'SIGSYS'; - case SIGBABY: + case SIGBABY: return 'SIGBABY'; - case SIG_BLOCK: + case SIG_BLOCK: return 'SIG_BLOCK'; - case SIG_UNBLOCK: + case SIG_UNBLOCK: return 'SIG_UNBLOCK'; - case SIG_SETMASK: + case SIG_SETMASK: return 'SIG_SETMASK'; default: return "Signal # {$signal}"; } } - + /** - * PowerProcess constructor. - * + * PowerProcess constructor. + * * Returns an instanced PowerProcess object or dies on failure - * + * * @param integer $maxThreads Max number of concurrent threads to allow at any given time * @param integer $threadTimeLimit Maximum number of seconds a thread is allowed to live * @param boolean $daemon Whether to start as a deamon or just a normal script * @param string $logTo What stream to log output to * @param boolean $debugLogging Whether to enable debug logging - * + * * @return object Instanced PowerProcess object */ public function __construct($maxThreads = 10, $threadTimeLimit = 300, $daemon = false, $logTo = false, $debugLogging = false) { if (function_exists('pcntl_fork') && function_exists('posix_getpid')) { // Set the current thread name $this->currentThread = 'CONTROL'; - + // Set the max threads setting $this->SetMaxThreads($maxThreads); - + // Set the thread time limit setting $this->SetThreadTimeLimit($threadTimeLimit); - + // Init the logger $this->InitializeLogger($logTo, $debugLogging); - + if ($daemon) { // Attempt to daemonize if (!$this->Daemonize()) { @@ -296,39 +296,39 @@ class PowerProcess { $this->parentSID = false; $this->Log("Parent PID detected as {$this->parentPID}",true); } - + // The the complete flag to false $this->complete = false; - + // Install the signal handler $this->InstallSignalHandler(); - + // Init the Thread Queue $this->myThreads = array(); - + // Log completion of startup $this->Log("Startup process complete",true); } else { die("PowerProcess requires both the POSIX and PCNTL extensions to operate.\n"); } } - + /** * Frees up memory */ public function __destruct() { unset($this->callbacks); unset($this->myThreads); - + // Handle any remaining signals pcntl_signal_dispatch(); - + $this->RemoveLogger(); } - + /** * Executes specified program in the current process space - * + * * @param string $process Path to the binary process to execute * @param array $args Array of argument strings to pass to the program */ @@ -339,28 +339,28 @@ class PowerProcess { pcntl_exec($process, $args); } } - + /** * Returns the PID of the current process - * + * * @return integer */ public function GetPID() { return posix_getpid(); } - + /** * Returns the PID of the process that spawned this one - * + * * @return integer */ public function GetControlPID() { return posix_getppid(); } - + /** * Get the status of a running thread by name or PID - * + * * @param string|integer $name The name or PID of the process for which you want status information * @return array|boolean */ @@ -372,19 +372,19 @@ class PowerProcess { return false; } } - + /** * Determine whether the control process is daemonized - * + * * @return boolean */ public function IsDaemon() { return $this->parentSID !== false; } - + /** * Log a message - * + * * @param string $msg The message to log * @param boolean $internal Whether this is an internal debug logging message */ @@ -399,7 +399,7 @@ class PowerProcess { } } } - + /** * Restarts the control process */ @@ -412,48 +412,48 @@ class PowerProcess { $this->Log("Can not restart - Shutting down", true); return $this->Shutdown(); } - + // Wait for threads to complete while ($this->ThreadCount()) { $this->CheckThreads(); $this->Tick(); } - + // Remove the first arg if this is a stand-alone if ($cmd == $_SERVER['argv'][0]) unset($_SERVER['argv'][0]); - + // Execute Restart $this->Exec($cmd, $_SERVER['argv']); $this->Shutdown(true); return self::CALLBACK_IGNORE; } - + /** * Registers a callback function for the signal dispatcher or for special signals used by PowerProcess - * + * * Special signals are: * - 'shutdown' : Triggered on completion of the Shutdown() method * - 'threadotl' : Triggered on killing a thread due to exceeding time limit - * + * * @param int|string $signal The signal to register a callback for * @param callback $callback The callback function */ public function RegisterCallback($signal, $callback = false) { if ($callback !== false) $this->callbacks[$signal][] = $callback; - + // Register with PCNTL if (is_int($signal)) { $this->Log("Registering signal {$signal} with dispatcher",true); pcntl_signal($signal, array(&$this, 'SignalDispatch')); - + // Unblock the Signal pcntl_sigprocmask(SIG_UNBLOCK,array($signal)); } } - + /** * Determines whether we should be running the control code or the thread code - * + * * @return boolean */ public function RunControlCode() { @@ -465,19 +465,19 @@ class PowerProcess { return false; } } - + /** * Determines whether we should be running the child code - * + * * @return boolean */ public function RunThreadCode() { return !$this->ControlCheck(); } - + /** * Send a signal to a process - * + * * @param integer $pid * @param integer $signal */ @@ -488,65 +488,65 @@ class PowerProcess { return false; } } - + /** * Set the max number of threads that can be running concurrently - * + * * @param integer $maxThreads The max number of threads to run concurrently */ public function SetMaxThreads($maxThreads = 10) { $this->maxThreads = $maxThreads; } - + /** * Set the max number of seconds a thread can run before being terminated - * + * * @param integer $threadTimeLimit The max number of seconds a thread can run */ public function SetThreadTimeLimit($threadTimeLimit = 300) { $this->threadTimeLimit = $threadTimeLimit; } - + /** * Initiates the shutdown procedure for PowerProcess - * + * * @param boolean $exit When set to true, Shutdown causes the script to exit */ public function Shutdown($exit = false) { $this->Log("Initiating shutdown",true); - + while ($this->ThreadCount()) { $this->CheckThreads(); $this->Tick(); } - + $this->complete = true; - + // Send custom shutdown signal $this->SignalDispatch('shutdown'); - + $this->Log("Shutdown Complete"); if ($exit) exit; - + return self::CALLBACK_IGNORE; } - + /** * Determines if a new process can be spawned - * + * * @return boolean */ public function SpawnReady() { $this->Tick(); return ($this->ThreadCount() < $this->maxThreads); } - + /** * Spawn a new thread - * + * * @param string $name The name of the thread to be spawned * @param boolean $returnPid Whether to return the pid instead of boolean - * + * * @return boolean|integer */ public function SpawnThread($name = false, $returnPid = false) { @@ -556,7 +556,7 @@ class PowerProcess { $this->Tick(); return false; } - + if ($name !== false) { // Check to make sure there is not already a named thread with this name if ($this->GetThreadStatus($name) !== false) { @@ -565,9 +565,9 @@ class PowerProcess { return false; } } - + $pid = pcntl_fork(); - + if ($pid) { // We are the control thread so log the child in a queue $index = ($name === false) ? $pid : $name; @@ -586,43 +586,43 @@ class PowerProcess { return ($returnPid) ? $pid : true; } } - + /** * Get the count of running threads - * + * * @return integer */ public function ThreadCount() { return count($this->myThreads); } - + /** * Process signals to be dispatched and sleep for a number of microseconds */ public function Tick() { // Dispatch Pending Signals pcntl_signal_dispatch(); - + // Check Running Threads if ($this->parentPID == $this->GetPID()) $this->CheckThreads(); - + // Tick usleep($this->tickCount); } - + /** * Get the name of the current thread - * + * * @return string The name of the current thread */ public function WhoAmI() { return $this->currentThread; } - + // All Private Functions Below Here /** * Checks all running threads to make sure they are still running and their time limit has not been exceeded - * + * * If a thread has exceeded it's time limit, this method will kill that process * and dispatch the special signal 'threadotl' */ @@ -642,46 +642,46 @@ class PowerProcess { } } } - + /** * Check if the current process is the control process - * + * * @return boolean */ private function ControlCheck() { return $this->parentPID == $this->GetPID(); } - + /** * Attempts to daemonize the current process - * + * * @return integer */ private function Daemonize() { $this->Log("Attempting to Daemonize",true); - + // First need to fork $pid = pcntl_fork(); - + // Tick to catch signals $this->Tick(); - + if ($pid < 0) exit; // Error if ($pid) exit; // Parent - + $this->parentSID = posix_setsid(); - + // Need to reset the parent PID $this->parentPID = $this->GetPID(); $this->Log("Parent PID {$this->parentPID}",true); $this->Log("Parent SID {$this->parentSID}",true); - + return ($this->parentSID > 0); } - + /** * Initialize the logging stream if enabled - * + * * @param string|boolean $logTo The path or stream to log to or false to disable */ private function InitializeLogger($logTo, $debugLogging) { @@ -693,7 +693,7 @@ class PowerProcess { $this->debugLogging = false; } } - + /** * Installs the default signal handlers */ @@ -701,34 +701,34 @@ class PowerProcess { // Register the callback for thread completion $this->RegisterCallback(SIGCHLD, array($this,'CheckThreads')); $this->Log("SIGCHLD callback registered",true); - + // Register the callback for restart requests $this->RegisterCallback(SIGHUP, array($this, 'Restart')); $this->Log("SIGHUP callback registered",true); - + // Register the callback for shutdown requests $this->RegisterCallback(SIGTERM, array($this, 'Shutdown')); $this->Log("SIGTERM callback registered",true); - + // Install the signal handler foreach ($this->signalArray as $signal) $this->RegisterCallback($signal); $this->Log("Signal Dispatcher installed",true); } - + /** * Kill a thread by PID - * + * * @param integer $pid The PID of the thread to kill */ private function KillThread($pid = 0) { $this->SendSignal($pid, SIGTERM); } - + /** * Determine whether a child pid has exited - * + * * Returns the PID of child which exited or 0 - * + * * @param integer $pid The PID to check * @return integer */ @@ -739,7 +739,7 @@ class PowerProcess { return 0; } } - + /** * Closes the logging stream */ @@ -748,36 +748,36 @@ class PowerProcess { @fclose($this->logSocket); } } - + /** * Handles dispatching of signals to user-defined callbacks - * + * * @param integer|string $signal */ public function SignalDispatch($signal) { // Log Dispatch $signalName = self::SignalName($signal); $this->Log("Received signal: {$signalName}",true); - + // Check the callback array for this signal number if (isset($this->callbacks[$signal])) { // Execute the callback $callStack = $this->callbacks[$signal]; - + // Run last added callbacks first (FILO) $i = count($callStack); while ($callback = array_pop($callStack)) { $this->Log("Running Callback[{$i}] for signal: {$signalName}", true); --$i; $status = call_user_func($callback); - + // Check if we should continue if ($status == self::CALLBACK_STOP_PROPOGATION) { // Break out of loop $this->Log("Callback[{$i}] for signal '{$signalName}' has stopped propogation of further callbacks", true); break; } - + // OK, now switch on the status switch ($status) { case self::CALLBACK_RESTART: @@ -793,16 +793,16 @@ class PowerProcess { default: $this->Log("Callback[{$i}] for signal '{$signalName}' did not return a valid status"); } - + // Continue the loop } } else { // No callback registered $this->Log("There is no callback registered for signal {$signalName}",true); } - + // Handle SIGTERM for threads if ($signal == 15) exit(0); } - + } diff --git a/lib/copy_this/www/lib/predb.php b/lib/copy_this/www/lib/predb.php index ed7735a1b..501a4c75a 100644 --- a/lib/copy_this/www/lib/predb.php +++ b/lib/copy_this/www/lib/predb.php @@ -17,12 +17,12 @@ class PreDB } /** - * Get a predb row by ID. + * Get a predb row by id. */ public function getByID($preID) { $db = new DB(); - $predbQuery = $db->query(sprintf("SELECT * FROM predb WHERE ID = %s LIMIT %d", $preID, 1)); + $predbQuery = $db->query(sprintf("SELECT * FROM predb WHERE id = %s LIMIT %d", $preID, 1)); return isset($predbQuery[0]) ? $predbQuery[0] : false; } @@ -63,7 +63,7 @@ class PreDB $dirname = empty($dirname) ? '' : sprintf("WHERE dirname LIKE %s", $db->escapeString('%'.$dirname.'%')); $category = empty($category) ? '' : sprintf((empty($dirname) ? 'WHERE' : ' AND')." category = %s", $db->escapeString($category)); - $predbQuery = $db->queryOneRow(sprintf('SELECT COUNT(ID) AS num FROM predb %s %s', $dirname, $category), true); + $predbQuery = $db->queryOneRow(sprintf('SELECT COUNT(id) AS num FROM predb %s %s', $dirname, $category), true); return $predbQuery['num']; } @@ -93,7 +93,7 @@ class PreDB $dirname = empty($dirname) ? '' : sprintf('WHERE dirname LIKE %s', $db->escapeString('%'.$dirname.'%')); $category = empty($category) ? '' : sprintf((empty($dirname) ? 'WHERE' : ' AND')." category = %s", $db->escapeString($category)); - $sql = sprintf('SELECT p.*, r.guid FROM predb p left outer join releases r on p.ID = r.preID %s %s ORDER BY ctime DESC LIMIT %d,%d', $dirname, $category, $start, $num); + $sql = sprintf('SELECT p.*, r.guid FROM predb p left outer join releases r on p.id = r.preID %s %s ORDER BY ctime DESC LIMIT %d,%d', $dirname, $category, $start, $num); return $db->query($sql, true); } @@ -109,16 +109,16 @@ class PreDB echo "Predb : Updating releases with pre data\n"; $matched = 0; - $releasesQuery = $db->queryDirect(sprintf('SELECT ID, searchname FROM releases WHERE preID IS NULL AND adddate > DATE_SUB(NOW(), INTERVAL %d DAY)', $daysback)); + $releasesQuery = $db->queryDirect(sprintf('SELECT id, searchname FROM releases WHERE preID IS NULL AND adddate > DATE_SUB(NOW(), INTERVAL %d DAY)', $daysback)); while($arr = $db->getAssocArray($releasesQuery)) { $arr['searchname'] = str_replace(' ', '_', $arr['searchname']); - $sql = sprintf("SELECT ID FROM predb WHERE dirname = %s LIMIT 1", $db->escapeString($arr['searchname'])); + $sql = sprintf("SELECT id FROM predb WHERE dirname = %s LIMIT 1", $db->escapeString($arr['searchname'])); $predbQuery = $db->queryOneRow($sql); if($predbQuery) { - $db->queryExec(sprintf('UPDATE releases SET preID = %d WHERE ID = %d', $predbQuery['ID'], $arr['ID'])); + $db->queryExec(sprintf('UPDATE releases SET preID = %d WHERE id = %d', $predbQuery['id'], $arr['id'])); $matched++; } diff --git a/lib/copy_this/www/lib/releasecomments.php b/lib/copy_this/www/lib/releasecomments.php index 2ce8c4934..7c6a150d3 100644 --- a/lib/copy_this/www/lib/releasecomments.php +++ b/lib/copy_this/www/lib/releasecomments.php @@ -8,12 +8,12 @@ require_once(WWW_DIR."/lib/site.php"); class ReleaseComments { /** - * Get a comment by ID. + * Get a comment by id. */ public function getCommentById($id) { $db = new DB(); - return $db->queryOneRow(sprintf("SELECT * FROM releasecomment WHERE ID = %d", $id)); + return $db->queryOneRow(sprintf("SELECT * FROM releasecomment WHERE id = %d", $id)); } /** @@ -22,7 +22,7 @@ class ReleaseComments public function getCommentsByGid($gid) { $db = new DB(); - return $db->query(sprintf("SELECT rc.id, text, createddate, sourceid, CASE WHEN sourceid = 0 THEN (SELECT username FROM users WHERE id = userid) ELSE username END AS username, CASE WHEN sourceid = 0 THEN (SELECT role FROM users WHERE id = userid) ELSE '-1' END AS role, CASE WHEN sourceid =0 THEN (SELECT r.name AS rolename FROM users AS u LEFT JOIN userroles AS r ON r.ID = u.role WHERE u.id = userid) ELSE (SELECT description AS rolename FROM spotnabsources WHERE ID = sourceid) END AS rolename FROM releasecomment rc WHERE isvisible = 1 AND gid = %s AND (userID IN (SELECT id FROM users) OR rc.username IS NOT NULL) ORDER BY createddate DESC LIMIT 100", $db->escapeString($gid))); + return $db->query(sprintf("SELECT rc.id, text, createddate, sourceid, CASE WHEN sourceid = 0 THEN (SELECT username FROM users WHERE id = userid) ELSE username END AS username, CASE WHEN sourceid = 0 THEN (SELECT role FROM users WHERE id = userid) ELSE '-1' END AS role, CASE WHEN sourceid =0 THEN (SELECT r.name AS rolename FROM users AS u LEFT JOIN userroles AS r ON r.id = u.role WHERE u.id = userid) ELSE (SELECT description AS rolename FROM spotnabsources WHERE id = sourceid) END AS rolename FROM releasecomment rc WHERE isvisible = 1 AND gid = %s AND (userid IN (SELECT id FROM users) OR rc.username IS NOT NULL) ORDER BY createddate DESC LIMIT 100", $db->escapeString($gid))); } /** @@ -31,7 +31,7 @@ class ReleaseComments public function getCommentsByGuid($guid) { $db = new DB(); - return $db->query(sprintf("SELECT rc.id, text, createddate, sourceid, CASE WHEN sourceid = 0 THEN (SELECT username FROM users WHERE id = userid) ELSE username END AS username FROM releasecomment rc LEFT JOIN releases r ON r.gid = rc.gid WHERE isvisible = 1 AND guid = %s AND (userID IN (SELECT id FROM users) OR rc.username IS NOT NULL) ORDER BY createddate DESC LIMIT 100", $db->escapeString($guid))); + return $db->query(sprintf("SELECT rc.id, text, createddate, sourceid, CASE WHEN sourceid = 0 THEN (SELECT username FROM users WHERE id = userid) ELSE username END AS username FROM releasecomment rc LEFT JOIN releases r ON r.gid = rc.gid WHERE isvisible = 1 AND guid = %s AND (userid IN (SELECT id FROM users) OR rc.username IS NOT NULL) ORDER BY createddate DESC LIMIT 100", $db->escapeString($guid))); } /** @@ -53,7 +53,7 @@ class ReleaseComments } } - $q = "SELECT count(ID) AS num FROM releasecomment"; + $q = "SELECT count(id) AS num FROM releasecomment"; $clause = array(); if($refdate !== Null) $clause[] = "createddate >= '$refdate'"; @@ -62,9 +62,9 @@ class ReleaseComments // set localOnly to true to only receive local comment count // set localOnly to false to only receive remote comment count if($localOnly === true){ - $clause[] = "sourceID = 0"; + $clause[] = "sourceid = 0"; }else if($localOnly === false){ - $clause[] = "sourceID != 0"; + $clause[] = "sourceid != 0"; } if(count($clause)) @@ -89,7 +89,7 @@ class ReleaseComments } /** - * Delete all comments for a release.ID. + * Delete all comments for a release.id. */ public function deleteCommentsForRelease($id) { @@ -103,7 +103,7 @@ class ReleaseComments } /** - * Delete all comments for a users.ID. + * Delete all comments for a users.id. */ public function deleteCommentsForUser($id) { @@ -115,7 +115,7 @@ class ReleaseComments $comments = $this->getCommentsForUserRange($id, 0, $numcomments); foreach ($comments as $comment) { - $this->deleteComment($comment["ID"]); + $this->deleteComment($comment["id"]); $this->updateReleaseCommentCount($comment["gid"]); } } @@ -136,7 +136,7 @@ class ReleaseComments if ($s->storeuserips != "1") $host = ""; - $comid = $db->queryInsert(sprintf("INSERT INTO releasecomment (releaseID, gid, text, userID, createddate, host) VALUES (%d, %s, %s, %d, now(), %s)", $id, $db->escapeString($gid), $db->escapeString($text), $userid, $db->escapeString($host))); + $comid = $db->queryInsert(sprintf("INSERT INTO releasecomment (releaseid, gid, text, userid, createddate, host) VALUES (%d, %s, %s, %d, now(), %s)", $id, $db->escapeString($gid), $db->escapeString($text), $userid, $db->escapeString($host))); $this->updateReleaseCommentCount($gid); return $comid; } @@ -153,7 +153,7 @@ class ReleaseComments else $limit = " LIMIT ".$start.",".$num; - $sql = "SELECT rc.ID, userID, guid, text, createddate, sourceid, CASE WHEN sourceID = 0 THEN (SELECT username FROM users WHERE id = userID) ELSE username END AS username, CASE WHEN sourceid = 0 THEN (SELECT role FROM users WHERE id = userid) ELSE '-1' END AS role, CASE WHEN sourceid =0 THEN (SELECT r.name AS rolename FROM users AS u LEFT JOIN userroles AS r ON r.ID = u.role WHERE u.id = userid) ELSE (SELECT description AS rolename FROM spotnabsources WHERE ID = sourceid) END AS rolename FROM releasecomment rc LEFT JOIN releases r ON r.gid = rc.gid WHERE isvisible = 1 AND (userID IN (SELECT id FROM users) OR rc.username IS NOT NULL) ORDER BY createddate DESC ".$limit; + $sql = "SELECT rc.id, userid, guid, text, createddate, sourceid, CASE WHEN sourceid = 0 THEN (SELECT username FROM users WHERE id = userid) ELSE username END AS username, CASE WHEN sourceid = 0 THEN (SELECT role FROM users WHERE id = userid) ELSE '-1' END AS role, CASE WHEN sourceid =0 THEN (SELECT r.name AS rolename FROM users AS u LEFT JOIN userroles AS r ON r.id = u.role WHERE u.id = userid) ELSE (SELECT description AS rolename FROM spotnabsources WHERE id = sourceid) END AS rolename FROM releasecomment rc LEFT JOIN releases r ON r.gid = rc.gid WHERE isvisible = 1 AND (userid IN (SELECT id FROM users) OR rc.username IS NOT NULL) ORDER BY createddate DESC ".$limit; return $db->query($sql); } @@ -164,7 +164,7 @@ class ReleaseComments { $db = new DB(); $db->queryExec(sprintf("update releases - SET comments = (SELECT count(ID) FROM releasecomment WHERE releasecomment.gid = releases.gid AND isvisible = 1) + SET comments = (SELECT count(id) FROM releasecomment WHERE releasecomment.gid = releases.gid AND isvisible = 1) WHERE releases.gid = %s", $db->escapeString($gid) )); } @@ -174,7 +174,7 @@ class ReleaseComments public function getCommentCountForUser($uid) { $db = new DB(); - $res = $db->queryOneRow(sprintf("SELECT count(ID) AS num FROM releasecomment WHERE userID = %d AND isvisible = 1", $uid)); + $res = $db->queryOneRow(sprintf("SELECT count(id) AS num FROM releasecomment WHERE userid = %d AND isvisible = 1", $uid)); return $res["num"]; } @@ -190,6 +190,6 @@ class ReleaseComments else $limit = " LIMIT ".$start.",".$num; - return $db->query(sprintf("SELECT releasecomment.*, r.guid, r.searchname, users.username FROM releasecomment INNER JOIN releases r ON r.ID = releasecomment.releaseID LEFT OUTER JOIN users ON users.ID = releasecomment.userID WHERE userID = %d ORDER BY releasecomment.createddate DESC ".$limit, $uid)); + return $db->query(sprintf("SELECT releasecomment.*, r.guid, r.searchname, users.username FROM releasecomment INNER JOIN releases r ON r.id = releasecomment.releaseid LEFT OUTER JOIN users ON users.id = releasecomment.userid WHERE userid = %d ORDER BY releasecomment.createddate DESC ".$limit, $uid)); } } diff --git a/lib/copy_this/www/lib/releaseextra.php b/lib/copy_this/www/lib/releaseextra.php index c969d913e..240e09c4f 100644 --- a/lib/copy_this/www/lib/releaseextra.php +++ b/lib/copy_this/www/lib/releaseextra.php @@ -42,23 +42,23 @@ class ReleaseExtra { $db = new DB(); - return $db->query(sprintf("select * from releaseaudio where releaseID = %d order by audioID ASC", $id)); + return $db->query(sprintf("select * from releaseaudio where releaseid = %d order by audioID ASC", $id)); } public function getBriefByGuid($guid) { $db = new DB(); - return $db->queryOneRow(sprintf("select containerformat,videocodec,videoduration,videoaspect, concat(releasevideo.videowidth,'x',releasevideo.videoheight,' @',format(videoframerate,0),'fps') as size, group_concat(distinct releaseaudio.audiolanguage SEPARATOR ', ') as audio, group_concat(distinct releaseaudio.audiobitrate SEPARATOR ', ') as audiobitrate, group_concat(distinct releaseaudio.audioformat SEPARATOR ', ') as audioformat, group_concat(distinct releaseaudio.audiomode SEPARATOR ', ') as audiomode, group_concat(distinct releaseaudio.audiobitratemode SEPARATOR ', ') as audiobitratemode, group_concat(distinct releasesubs.subslanguage SEPARATOR ', ') as subs from releaseaudio left outer join releasesubs on releaseaudio.releaseID = releasesubs.releaseID left outer join releasevideo on releasevideo.releaseID = releaseaudio.releaseID inner join releases r on r.ID = releaseaudio.releaseID where r.guid = %s group by r.ID", $db->escapeString($guid))); + return $db->queryOneRow(sprintf("select containerformat,videocodec,videoduration,videoaspect, concat(releasevideo.videowidth,'x',releasevideo.videoheight,' @',format(videoframerate,0),'fps') as size, group_concat(distinct releaseaudio.audiolanguage SEPARATOR ', ') as audio, group_concat(distinct releaseaudio.audiobitrate SEPARATOR ', ') as audiobitrate, group_concat(distinct releaseaudio.audioformat SEPARATOR ', ') as audioformat, group_concat(distinct releaseaudio.audiomode SEPARATOR ', ') as audiomode, group_concat(distinct releaseaudio.audiobitratemode SEPARATOR ', ') as audiobitratemode, group_concat(distinct releasesubs.subslanguage SEPARATOR ', ') as subs from releaseaudio left outer join releasesubs on releaseaudio.releaseid = releasesubs.releaseid left outer join releasevideo on releasevideo.releaseid = releaseaudio.releaseid inner join releases r on r.id = releaseaudio.releaseid where r.guid = %s group by r.id", $db->escapeString($guid))); } public function delete($id) { $db = new DB(); - $db->queryExec(sprintf("DELETE from releaseaudio where releaseID = %d", $id)); - $db->queryExec(sprintf("DELETE from releasesubs where releaseID = %d", $id)); - $db->queryExec(sprintf("DELETE from releaseextrafull where releaseID = %d", $id)); - $db->queryExec(sprintf("DELETE from releasevideo where releaseID = %d", $id)); + $db->queryExec(sprintf("DELETE from releaseaudio where releaseid = %d", $id)); + $db->queryExec(sprintf("DELETE from releasesubs where releaseid = %d", $id)); + $db->queryExec(sprintf("DELETE from releaseextrafull where releaseid = %d", $id)); + $db->queryExec(sprintf("DELETE from releasevideo where releaseid = %d", $id)); } /** @@ -177,7 +177,7 @@ class ReleaseExtra $videoframerate = 0.0; $sql = sprintf("insert into releasevideo - (releaseID, containerformat, overallbitrate, videoduration, + (releaseid, containerformat, overallbitrate, videoduration, videoformat, videocodec, videowidth, videoheight, videoaspect, videoframerate, videolibrary, definition) values ( %d, %s, %s, %s, %s, %s, %d, %d, %s, %s, %s, %d )", @@ -193,7 +193,7 @@ class ReleaseExtra { $db = new DB(); - return $db->queryOneRow(sprintf("select * from releasevideo where releaseID = %d", $id)); + return $db->queryOneRow(sprintf("select * from releasevideo where releaseid = %d", $id)); } /** @@ -246,7 +246,7 @@ class ReleaseExtra return -1; $sql = sprintf("insert into releaseaudio - (releaseID, audioID,audioformat,audiomode, audiobitratemode, audiobitrate, + (releaseid, audioID,audioformat,audiomode, audiobitratemode, audiobitrate, audiochannels,audiosamplerate,audiolibrary,audiolanguage,audiotitle) values ( %d, %d, %s, %s, %s, %s, %s, %s, %s, %s, %s )", $releaseID, $audioID, $db->escapeString($audioformat), $db->escapeString($audiomode), $db->escapeString($audiobitratemode), @@ -261,7 +261,7 @@ class ReleaseExtra { $db = new DB(); - return $db->queryOneRow(sprintf("select * from releaseaudio where releaseID = %d and audioID = %d", $rid, $aid)); + return $db->queryOneRow(sprintf("select * from releaseaudio where releaseid = %d and audioID = %d", $rid, $aid)); } public function addSubs($releaseID, $subsID, $subslanguage) @@ -271,7 +271,7 @@ class ReleaseExtra if ($row) return -1; - $sql = sprintf("insert into releasesubs (releaseID, subsID, subslanguage) values ( %d, %d, %s)", $releaseID, $subsID, $db->escapeString($subslanguage)); + $sql = sprintf("insert into releasesubs (releaseid, subsID, subslanguage) values ( %d, %d, %s)", $releaseID, $subsID, $db->escapeString($subslanguage)); return $db->queryInsert($sql); } @@ -280,14 +280,14 @@ class ReleaseExtra { $db = new DB(); - return $db->queryOneRow(sprintf("SELECT group_concat(subslanguage SEPARATOR ', ') as subs FROM `releasesubs` WHERE `releaseID` = %d ORDER BY `subsID` ASC", $id)); + return $db->queryOneRow(sprintf("SELECT group_concat(subslanguage SEPARATOR ', ') as subs FROM `releasesubs` WHERE `releaseid` = %d ORDER BY `subsID` ASC", $id)); } public function deleteFull($id) { $db = new DB(); - return $db->queryExec(sprintf("DELETE from releaseextrafull where releaseID = %d", $id)); + return $db->queryExec(sprintf("DELETE from releaseextrafull where releaseid = %d", $id)); } public function addFull($id, $xml) @@ -297,13 +297,13 @@ class ReleaseExtra if ($row) return -1; - return $db->queryInsert(sprintf("insert into releaseextrafull (releaseID, mediainfo) values (%d, %s)", $id, $db->escapeString($xml))); + return $db->queryInsert(sprintf("insert into releaseextrafull (releaseid, mediainfo) values (%d, %s)", $id, $db->escapeString($xml))); } public function getFull($id) { $db = new DB(); - return $db->queryOneRow(sprintf("select * from releaseextrafull where releaseID = %d", $id)); + return $db->queryOneRow(sprintf("select * from releaseextrafull where releaseid = %d", $id)); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/releasefiles.php b/lib/copy_this/www/lib/releasefiles.php index ec95fb823..df5f23049 100644 --- a/lib/copy_this/www/lib/releasefiles.php +++ b/lib/copy_this/www/lib/releasefiles.php @@ -7,12 +7,12 @@ require_once(WWW_DIR."/lib/framework/db.php"); class ReleaseFiles { /** - * Get releasefiles row by ID. + * Get releasefiles row by id. */ public function get($id) { $db = new DB(); - return $db->query(sprintf("select * from releasefiles where releaseID = %d order by releasefiles.name ", $id)); + return $db->query(sprintf("select * from releasefiles where releaseid = %d order by releasefiles.name ", $id)); } /** @@ -21,7 +21,7 @@ class ReleaseFiles public function getByGuid($guid) { $db = new DB(); - return $db->query(sprintf("select releasefiles.* from releasefiles inner join releases r on r.ID = releasefiles.releaseID where r.guid = %s order by releasefiles.name ", $db->escapeString($guid))); + return $db->query(sprintf("select releasefiles.* from releasefiles inner join releases r on r.id = releasefiles.releaseid where r.guid = %s order by releasefiles.name ", $db->escapeString($guid))); } /** @@ -30,7 +30,7 @@ class ReleaseFiles public function delete($id) { $db = new DB(); - return $db->queryExec(sprintf("DELETE from releasefiles where releaseID = %d", $id)); + return $db->queryExec(sprintf("DELETE from releasefiles where releaseid = %d", $id)); } /** @@ -39,7 +39,7 @@ class ReleaseFiles public function add($id, $name, $size, $createddate, $passworded) { $db = new DB(); - $sql = sprintf("INSERT INTO releasefiles (releaseID, name, size, createddate, passworded) VALUES (%d, %s, %s, from_unixtime(%d), %d)", $id, $db->escapeString($name), $db->escapeString($size), $createddate, $passworded ); + $sql = sprintf("INSERT INTO releasefiles (releaseid, name, size, createddate, passworded) VALUES (%d, %s, %s, from_unixtime(%d), %d)", $id, $db->escapeString($name), $db->escapeString($size), $createddate, $passworded ); return $db->queryInsert($sql); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/releaseregex.php b/lib/copy_this/www/lib/releaseregex.php index 464672dc1..51e57cdad 100644 --- a/lib/copy_this/www/lib/releaseregex.php +++ b/lib/copy_this/www/lib/releaseregex.php @@ -37,23 +37,23 @@ class ReleaseRegex $where .= sprintf(" and releaseregex.groupname = %s", $db->escapeString($groupname)); if ($userReleaseRegex === true) { - $where .= ' AND releaseregex.ID >= 100000'; + $where .= ' AND releaseregex.id >= 100000'; } else if ($userReleaseRegex === false) { - $where .= ' AND releaseregex.ID < 100000'; + $where .= ' AND releaseregex.id < 100000'; } $relcountjoin = ""; $relcountcol = ""; if ($blnIncludeReleaseCount) { $relcountcol = " , coalesce(x.count, 0) as num_releases, coalesce(x.adddate, 'n/a') as max_releasedate "; - $relcountjoin = " left outer join ( select regexID, max(adddate) adddate, count(ID) as count from releases group by regexID) x on x.regexID = releaseregex.ID "; + $relcountjoin = " left outer join ( select regexid, max(adddate) adddate, count(id) as count from releases group by regexid) x on x.regexid = releaseregex.id "; } - $this->regexes = $db->query("SELECT releaseregex.ID, releaseregex.categoryID, category.title as categoryTitle, releaseregex.status, releaseregex.description, releaseregex.groupname AS groupname, releaseregex.regex, - groups.ID AS groupID, releaseregex.ordinal " . $relcountcol . " + $this->regexes = $db->query("SELECT releaseregex.id, releaseregex.categoryid, category.title as categoryTitle, releaseregex.status, releaseregex.description, releaseregex.groupname AS groupname, releaseregex.regex, + groups.id AS groupid, releaseregex.ordinal " . $relcountcol . " FROM releaseregex left outer JOIN groups ON groups.name = releaseregex.groupname - left outer join category on category.ID = releaseregex.categoryID + left outer join category on category.id = releaseregex.categoryid " . $relcountjoin . " where 1=1 " . $where . " ORDER BY groupname LIKE '%*' ASC, coalesce(groupname,'zzz') DESC, ordinal ASC" @@ -81,17 +81,17 @@ class ReleaseRegex } /** - * Get a releaseregex row by ID. + * Get a releaseregex row by id. */ public function getByID($id) { $db = new DB(); - return $db->queryOneRow(sprintf("select * from releaseregex where ID = %d ", $id)); + return $db->queryOneRow(sprintf("select * from releaseregex where id = %d ", $id)); } /** - * Get a releaseregex row by ID. + * Get a releaseregex row by id. */ public function getForGroup($groupname) { @@ -103,7 +103,7 @@ class ReleaseRegex if ($outcome) $ret[] = $groupRegex; elseif ($outcome === false) - echo "ERROR: " . ($groupRegex["ID"] < 10000 ? "System" : "Custom") . " release regex '" . $groupRegex["ID"] . "'. Group name '" . $groupRegex["groupname"] . "' should be a valid regex.\n"; + echo "ERROR: " . ($groupRegex["id"] < 10000 ? "System" : "Custom") . " release regex '" . $groupRegex["id"] . "'. Group name '" . $groupRegex["groupname"] . "' should be a valid regex.\n"; } } @@ -117,7 +117,7 @@ class ReleaseRegex { $db = new DB(); - return $db->queryExec(sprintf("DELETE from releaseregex where ID = %d", $id)); + return $db->queryExec(sprintf("DELETE from releaseregex where id = %d", $id)); } /** @@ -139,7 +139,7 @@ class ReleaseRegex else $catid = sprintf("%d", $regex["category"]); - $db->queryExec(sprintf("update releaseregex set groupname=%s, regex=%s, ordinal=%d, status=%d, description=%s, categoryID=%s where ID = %d ", + $db->queryExec(sprintf("update releaseregex set groupname=%s, regex=%s, ordinal=%d, status=%d, description=%s, categoryid=%s where id = %d ", $groupname, $db->escapeString($regex["regex"]), $regex["ordinal"], $regex["status"], $db->escapeString($regex["description"]), $catid, $regex["id"] ) ); @@ -164,7 +164,7 @@ class ReleaseRegex else $catid = sprintf("%d", $regex["category"]); - return $db->queryInsert(sprintf("insert into releaseregex (groupname, regex, ordinal, status, description, categoryID) values (%s, %s, %d, %d, %s, %s) ", + return $db->queryInsert(sprintf("insert into releaseregex (groupname, regex, ordinal, status, description, categoryid) values (%s, %s, %d, %d, %s, %s) ", $groupname, $db->escapeString($regex["regex"]), $regex["ordinal"], $regex["status"], $db->escapeString($regex["description"]), $catid ) ); @@ -177,9 +177,9 @@ class ReleaseRegex $outcome = @preg_match($regexArr["regex"], $binarySubject, $matches); if ($outcome === false) { - echo "ERROR: " . ($regexArr["ID"] < 10000 ? "System" : "Custom") . " release regex '" . $regexArr["ID"] . "' is not a valid regex.\n"; + echo "ERROR: " . ($regexArr["id"] < 10000 ? "System" : "Custom") . " release regex '" . $regexArr["id"] . "' is not a valid regex.\n"; $db = new DB(); - $db->queryExec(sprintf("update releaseregex set status=0 where ID = %d and status=1", $regexArr["ID"])); + $db->queryExec(sprintf("update releaseregex set status=0 where id = %d and status=1", $regexArr["id"])); return $ret; } @@ -194,7 +194,7 @@ class ReleaseRegex // Check that the regex provided the correct parameters if (!isset($matches['name']) || empty($matches['name'])) { - //echo "ERROR: Regex applied which didnt return right number of capture groups - '".$regexArr["ID"]."'\n"; + //echo "ERROR: Regex applied which didnt return right number of capture groups - '".$regexArr["id"]."'\n"; return $ret; } @@ -208,8 +208,8 @@ class ReleaseRegex } $regcatid = "null "; - if ($regexArr["categoryID"] != "") - $regcatid = $regexArr["categoryID"]; + if ($regexArr["categoryid"] != "") + $regcatid = $regexArr["categoryid"]; //override if ($regcatid == Category::CAT_PC_0DAY) { if ($cat->isPhone($matches['name'])) @@ -238,8 +238,8 @@ class ReleaseRegex } $matches['regcatid'] = $regcatid; - $matches['regexID'] = $regexArr['ID']; - $matches['reqID'] = $reqID; + $matches['regexid'] = $regexArr['id']; + $matches['reqid'] = $reqID; $ret = $matches; } @@ -265,17 +265,17 @@ class ReleaseRegex $groupname = '.*'; if ($matchagainstbins !== '') - $sql = sprintf("select b.*, '0' as size, '0' as blacklistID, g.name as groupname from %s b left join groups g on g.ID = b.groupID where b.groupID IN (select g.ID from groups g where g.name REGEXP %s) order by b.date desc", $group['bname'], $db->escapeString('^' . $groupname . '$')); + $sql = sprintf("select b.*, '0' as size, '0' as blacklistID, g.name as groupname from %s b left join groups g on g.id = b.groupid where b.groupid IN (select g.id from groups g where g.name REGEXP %s) order by b.date desc", $group['bname'], $db->escapeString('^' . $groupname . '$')); else $sql = sprintf("select rrt.* from releaseregextesting rrt where rrt.groupname REGEXP %s order by rrt.date desc", $db->escapeString('^' . $groupname . '$')); $resbin = $db->queryDirect($sql); while ($rowbin = $db->getAssocArray($resbin)) { - if ($ignorematched !== '' && ($rowbin['regexID'] != '' || $rowbin['blacklistID'] == 1)) + if ($ignorematched !== '' && ($rowbin['regexid'] != '' || $rowbin['blacklistID'] == 1)) continue; - $regexarr = array("ID" => "", 'regex' => $regex, 'poster' => $poster, "categoryID" => ""); + $regexarr = array("id" => "", 'regex' => $regex, 'poster' => $poster, "categoryid" => ""); $regexCheck = $this->performMatch($regexarr, $rowbin['name'], $rowbin['fromname']); if ($regexCheck !== false) { @@ -294,7 +294,7 @@ class ReleaseRegex $matches[$relname]['relparts'][$relparts[1]] = $relparts[1]; $matches[$relname]['reltotalparts'] = array_sum($matches[$relname]['relparts']); - $matches[$relname]['regexID'] = $regexCheck['regexID']; + $matches[$relname]['regexid'] = $regexCheck['regexid']; if (ctype_digit($regexCheck['regcatid'])) $matches[$relname]['catname'] = $catList[$regexCheck['regcatid']]; @@ -416,9 +416,9 @@ class ReleaseRegex 'date' => $data['Date'], 'binaryhash' => md5($subject . $data['From'] . $group), 'groupname' => $group, - 'regexID' => "null", - 'categoryID' => "null", - 'reqID' => "null", + 'regexid' => "null", + 'categoryid' => "null", + 'reqid' => "null", 'blacklistID' => 0, 'size' => $data['Size'], 'relname' => "null", @@ -439,9 +439,9 @@ class ReleaseRegex if ($regexCheck !== false) { $regexMatches = $regexCheck; - $binData['regexID'] = $regexCheck['regexID']; - $binData['categoryID'] = $regexCheck['regcatid']; - $binData['reqID'] = empty($regexCheck['reqID']) ? "null" : $regexCheck['reqID']; + $binData['regexid'] = $regexCheck['regexid']; + $binData['categoryid'] = $regexCheck['regcatid']; + $binData['reqid'] = empty($regexCheck['reqid']) ? "null" : $regexCheck['reqid']; $binData['relname'] = $regexCheck['name']; break; } @@ -455,9 +455,9 @@ class ReleaseRegex foreach ($binChunks as $binChunk) { foreach ($binChunk as $chunk) { - $binParams[] = sprintf("(%s, %s, FROM_UNIXTIME(%s), %s, %s, %s, %s, %s, %d, %d, now())", $db->escapeString($chunk['name']), $db->escapeString($chunk['fromname']), $db->escapeString($chunk['date']), $db->escapeString($chunk['binaryhash']), $db->escapeString($chunk['groupname']), $chunk['regexID'], $chunk['categoryID'], $chunk['reqID'], $chunk['blacklistID'], $chunk['size']); + $binParams[] = sprintf("(%s, %s, FROM_UNIXTIME(%s), %s, %s, %s, %s, %s, %d, %d, now())", $db->escapeString($chunk['name']), $db->escapeString($chunk['fromname']), $db->escapeString($chunk['date']), $db->escapeString($chunk['binaryhash']), $db->escapeString($chunk['groupname']), $chunk['regexid'], $chunk['categoryid'], $chunk['reqid'], $chunk['blacklistID'], $chunk['size']); } - $binSql = "INSERT IGNORE INTO releaseregextesting (name, fromname, date, binaryhash, groupname, regexID, categoryID, reqID, blacklistID, size, dateadded) VALUES " . implode(', ', $binParams); + $binSql = "INSERT IGNORE INTO releaseregextesting (name, fromname, date, binaryhash, groupname, regexid, categoryid, reqid, blacklistID, size, dateadded) VALUES " . implode(', ', $binParams); //echo $binSql; $db->queryExec($binSql); } diff --git a/lib/copy_this/www/lib/releases.php b/lib/copy_this/www/lib/releases.php index 49d67264a..8d2c89a14 100644 --- a/lib/copy_this/www/lib/releases.php +++ b/lib/copy_this/www/lib/releases.php @@ -211,17 +211,17 @@ class Releases } $sql = sprintf(" SELECT releases.*, CONCAT(cp.title, ' > ', c.title) AS category_name, - m.ID AS movie_id, m.title, m.rating, m.cover, m.plot, m.year, m.genre, m.director, m.actors, m.tagline, - mu.ID AS music_id, mu.title AS mu_title, mu.cover AS mu_cover, mu.year AS mu_year, mu.artist AS mu_artist, mu.tracks AS mu_tracks, mu.review AS mu_review, - ep.ID AS ep_id, ep.showtitle AS ep_showtitle, ep.airdate AS ep_airdate, ep.fullep AS ep_fullep, ep.overview AS ep_overview, - tvrage.imgdata AS rage_imgdata, tvrage.ID AS rg_ID + m.id AS movie_id, m.title, m.rating, m.cover, m.plot, m.year, m.genre, m.director, m.actors, m.tagline, + mu.id AS music_id, mu.title AS mu_title, mu.cover AS mu_cover, mu.year AS mu_year, mu.artist AS mu_artist, mu.tracks AS mu_tracks, mu.review AS mu_review, + ep.id AS ep_id, ep.showtitle AS ep_showtitle, ep.airdate AS ep_airdate, ep.fullep AS ep_fullep, ep.overview AS ep_overview, + tvrage.imgdata AS rage_imgdata, tvrage.id AS rg_ID FROM releases - LEFT OUTER JOIN category c ON c.ID = releases.categoryID - LEFT OUTER JOIN category cp ON cp.ID = c.parentID - LEFT OUTER JOIN movieinfo m ON m.imdbID = releases.imdbID - LEFT OUTER JOIN musicinfo mu ON mu.ID = releases.musicinfoID - LEFT OUTER JOIN episodeinfo ep ON ep.ID = releases.episodeinfoID - LEFT OUTER JOIN tvrage ON tvrage.rageID = releases.rageID + LEFT OUTER JOIN category c ON c.id = releases.categoryid + LEFT OUTER JOIN category cp ON cp.id = c.parentid + LEFT OUTER JOIN movieinfo m ON m.imdbid = releases.imdbid + LEFT OUTER JOIN musicinfo mu ON mu.id = releases.musicinfoid + LEFT OUTER JOIN episodeinfo ep ON ep.id = releases.episodeinfoid + LEFT OUTER JOIN tvrage ON tvrage.rageid = releases.rageid WHERE %s", $nsql ); @@ -234,7 +234,7 @@ class Releases public function getCount() { - $res = $this->pdo->queryOneRow("SELECT count(ID) AS num FROM releases"); + $res = $this->pdo->queryOneRow("SELECT count(id) AS num FROM releases"); return $res["num"]; } @@ -251,7 +251,7 @@ class Releases else $limit = " LIMIT " . $start . "," . $num; - return $this->pdo->query(" SELECT releases.*, concat(cp.title, ' > ', c.title) AS category_name FROM releases LEFT OUTER JOIN category c ON c.ID = releases.categoryID LEFT OUTER JOIN category cp ON cp.ID = c.parentID ORDER BY postdate DESC" . $limit); + return $this->pdo->query(" SELECT releases.*, concat(cp.title, ' > ', c.title) AS category_name FROM releases LEFT OUTER JOIN category c ON c.id = releases.categoryid LEFT OUTER JOIN category cp ON cp.id = c.parentid ORDER BY postdate DESC" . $limit); } /** @@ -271,19 +271,19 @@ class Releases $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist .= ", " . $child["ID"]; + $chlist .= ", " . $child["id"]; if ($chlist != "-99") - $catsrch .= " releases.categoryID in (" . $chlist . ") or "; + $catsrch .= " releases.categoryid in (" . $chlist . ") or "; } else { - $catsrch .= sprintf(" releases.categoryID = %d or ", $category); + $catsrch .= sprintf(" releases.categoryid = %d or ", $category); } } } $catsrch .= "1=2 )"; } - $sql = sprintf("SELECT count(ID) AS num FROM releases WHERE haspreview = %d %s ", $previewtype, $catsrch); + $sql = sprintf("SELECT count(id) AS num FROM releases WHERE haspreview = %d %s ", $previewtype, $catsrch); $res = $this->pdo->queryOneRow($sql); return $res["num"]; @@ -306,12 +306,12 @@ class Releases $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist .= ", " . $child["ID"]; + $chlist .= ", " . $child["id"]; if ($chlist != "-99") - $catsrch .= " releases.categoryID in (" . $chlist . ") or "; + $catsrch .= " releases.categoryid in (" . $chlist . ") or "; } else { - $catsrch .= sprintf(" releases.categoryID = %d or ", $category); + $catsrch .= sprintf(" releases.categoryid = %d or ", $category); } } } @@ -323,7 +323,7 @@ class Releases else $limit = " LIMIT " . $start . "," . $num; - $sql = sprintf(" SELECT releases.*, concat(cp.title, ' > ', c.title) AS category_name FROM releases LEFT OUTER JOIN category c ON c.ID = releases.categoryID LEFT OUTER JOIN category cp ON cp.ID = c.parentID WHERE haspreview = %d %s ORDER BY postdate DESC %s", $previewtype, $catsrch, $limit); + $sql = sprintf(" SELECT releases.*, concat(cp.title, ' > ', c.title) AS category_name FROM releases LEFT OUTER JOIN category c ON c.id = releases.categoryid LEFT OUTER JOIN category cp ON cp.id = c.parentid WHERE haspreview = %d %s ORDER BY postdate DESC %s", $previewtype, $catsrch, $limit); return $this->pdo->query($sql); } @@ -349,13 +349,13 @@ class Releases WHERE r.nzbstatus = %d AND r.passwordstatus %s %s %s %s %s', - ($groupName != '' ? 'INNER JOIN groups g ON g.ID = r.groupID' : ''), + ($groupName != '' ? 'INNER JOIN groups g ON g.id = r.groupid' : ''), Enzebe::NZB_ADDED, $this->showPasswords(), ($groupName != '' ? sprintf(' AND g.name = %s', $this->pdo->escapeString($groupName)) : ''), $this->categorySQL($cat), ($maxAge > 0 ? (' AND r.postdate > NOW() - INTERVAL ' . $maxAge . ' DAY ') : ''), - (count($excludedCats) ? (' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')') : '') + (count($excludedCats) ? (' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')') : '') ) ); } @@ -380,16 +380,16 @@ class Releases sprintf( "SELECT r.*, CONCAT(cp.title, ' > ', c.title) AS category_name, - CONCAT(cp.id, ',', c.ID) AS category_ids, + CONCAT(cp.id, ',', c.id) AS category_ids, g.name AS group_name, - rn.ID AS nfoid, - re.releaseID AS reid + rn.id AS nfoid, + re.releaseid AS reid FROM releases r - STRAIGHT_JOIN groups g ON g.ID = r.groupID - STRAIGHT_JOIN category c ON c.ID = r.categoryID - INNER JOIN category cp ON cp.ID = c.parentID - LEFT OUTER JOIN releasevideo re ON re.releaseID = r.ID - LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID + STRAIGHT_JOIN groups g ON g.id = r.groupid + STRAIGHT_JOIN category c ON c.id = r.categoryid + INNER JOIN category cp ON cp.id = c.parentid + LEFT OUTER JOIN releasevideo re ON re.releaseid = r.id + LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id AND rn.nfo IS NOT NULL WHERE r.nzbstatus = %d AND r.passwordstatus %s @@ -399,7 +399,7 @@ class Releases $this->showPasswords(), $this->categorySQL($cat), ($maxAge > 0 ? (" AND postdate > NOW() - INTERVAL " . $maxAge . ' DAY ') : ''), - (count($excludedCats) ? (' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')') : ''), + (count($excludedCats) ? (' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')') : ''), ($groupName != '' ? sprintf(' AND g.name = %s ', $this->pdo->escapeString($groupName)) : ''), $orderBy[0], $orderBy[1], @@ -418,7 +418,7 @@ class Releases $orderArr = explode("_", $order); switch ($orderArr[0]) { case 'cat': - $orderfield = 'categoryID'; + $orderfield = 'categoryid'; break; case 'name': $orderfield = 'searchname'; @@ -488,16 +488,16 @@ class Releases } if ($group != "" && $group != "-1") - $group = sprintf(" and groupID = %d ", $group); + $group = sprintf(" and groupid = %d ", $group); else $group = ""; if ($cat != "" && $cat != "-1") - $cat = sprintf(" and categoryID = %d ", $cat); + $cat = sprintf(" and categoryid = %d ", $cat); else $cat = ""; - return $this->pdo->queryDirect(sprintf("SELECT searchname, guid, CONCAT(cp.title,'_',category.title) AS catName FROM releases INNER JOIN category ON releases.categoryID = category.ID LEFT OUTER JOIN category cp ON cp.ID = category.parentID WHERE 1 = 1 %s %s %s %s", $postfrom, $postto, $group, $cat)); + return $this->pdo->queryDirect(sprintf("SELECT searchname, guid, CONCAT(cp.title,'_',category.title) AS catName FROM releases INNER JOIN category ON releases.categoryid = category.id LEFT OUTER JOIN category cp ON cp.id = category.parentid WHERE 1 = 1 %s %s %s %s", $postfrom, $postto, $group, $cat)); } /** @@ -528,14 +528,14 @@ class Releases public function getReleasedGroupsForSelect($blnIncludeAll = true) { - $groups = $this->pdo->query("SELECT DISTINCT groups.ID, groups.name FROM releases INNER JOIN groups ON groups.ID = releases.groupID"); + $groups = $this->pdo->query("SELECT DISTINCT groups.id, groups.name FROM releases INNER JOIN groups ON groups.id = releases.groupid"); $temp_array = array(); if ($blnIncludeAll) $temp_array[-1] = "--All Groups--"; foreach ($groups as $group) - $temp_array[$group["ID"]] = $group["name"]; + $temp_array[$group["id"]] = $group["name"]; return $temp_array; } @@ -554,7 +554,7 @@ class Releases if (count($cat) > 0) { if ($cat[0] == -2) { - $cartsrch = sprintf(" inner join usercart on usercart.userID = %d and usercart.releaseID = releases.ID ", $uid); + $cartsrch = sprintf(" inner join usercart on usercart.userid = %d and usercart.releaseid = releases.id ", $uid); } elseif ($cat[0] == -1) { } else { $catsrch = " and ("; @@ -565,12 +565,12 @@ class Releases $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist .= ", " . $child["ID"]; + $chlist .= ", " . $child["id"]; if ($chlist != "-99") - $catsrch .= " releases.categoryID in (" . $chlist . ") or "; + $catsrch .= " releases.categoryid in (" . $chlist . ") or "; } else { - $catsrch .= sprintf(" releases.categoryID = %d or ", $category); + $catsrch .= sprintf(" releases.categoryid = %d or ", $category); } } } @@ -578,11 +578,11 @@ class Releases } } - $rage = ($rageid > -1) ? sprintf(" and releases.rageID = %d ", $rageid) : ''; + $rage = ($rageid > -1) ? sprintf(" and releases.rageid = %d ", $rageid) : ''; $anidb = ($anidbid > -1) ? sprintf(" and releases.anidbid = %d ", $anidbid) : ''; $airdate = ($airdate > -1) ? sprintf(" and releases.tvairdate >= DATE_SUB(CURDATE(), INTERVAL %d DAY) ", $airdate) : ''; - $sql = sprintf(" SELECT releases.*, rn.ID AS nfoID, m.title AS imdbtitle, m.cover, m.imdbID, m.rating, m.plot, m.year, m.genre, m.director, m.actors, g.name AS group_name, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.ID, ',', c.ID) AS category_ids, coalesce(cp.ID,0) AS parentCategoryID, mu.title AS mu_title, mu.url AS mu_url, mu.artist AS mu_artist, mu.publisher AS mu_publisher, mu.releasedate AS mu_releasedate, mu.review AS mu_review, mu.tracks AS mu_tracks, mu.cover AS mu_cover, mug.title AS mu_genre, co.title AS co_title, co.url AS co_url, co.publisher AS co_publisher, co.releasedate AS co_releasedate, co.review AS co_review, co.cover AS co_cover, cog.title AS co_genre, bo.title AS bo_title, bo.url AS bo_url, bo.publisher AS bo_publisher, bo.author AS bo_author, bo.publishdate AS bo_publishdate, bo.review AS bo_review, bo.cover AS bo_cover FROM releases LEFT OUTER JOIN category c ON c.ID = releases.categoryID LEFT OUTER JOIN category cp ON cp.ID = c.parentID LEFT OUTER JOIN groups g ON g.ID = releases.groupID LEFT OUTER JOIN releasenfo rn ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL LEFT OUTER JOIN movieinfo m ON m.imdbID = releases.imdbID AND m.title != '' LEFT OUTER JOIN musicinfo mu ON mu.ID = releases.musicinfoID LEFT OUTER JOIN genres mug ON mug.ID = mu.genreID LEFT OUTER JOIN bookinfo bo ON bo.ID = releases.bookinfoID LEFT OUTER JOIN consoleinfo co ON co.ID = releases.consoleinfoID LEFT OUTER JOIN genres cog ON cog.ID = co.genreID %s WHERE releases.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') %s %s %s %s ORDER BY postdate DESC %s", $cartsrch, $catsrch, $rage, $anidb, $airdate, $limit); + $sql = sprintf(" SELECT releases.*, rn.id AS nfoid, m.title AS imdbtitle, m.cover, m.imdbid, m.rating, m.plot, m.year, m.genre, m.director, m.actors, g.name AS group_name, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.id, ',', c.id) AS category_ids, coalesce(cp.id,0) AS parentCategoryID, mu.title AS mu_title, mu.url AS mu_url, mu.artist AS mu_artist, mu.publisher AS mu_publisher, mu.releasedate AS mu_releasedate, mu.review AS mu_review, mu.tracks AS mu_tracks, mu.cover AS mu_cover, mug.title AS mu_genre, co.title AS co_title, co.url AS co_url, co.publisher AS co_publisher, co.releasedate AS co_releasedate, co.review AS co_review, co.cover AS co_cover, cog.title AS co_genre, bo.title AS bo_title, bo.url AS bo_url, bo.publisher AS bo_publisher, bo.author AS bo_author, bo.publishdate AS bo_publishdate, bo.review AS bo_review, bo.cover AS bo_cover FROM releases LEFT OUTER JOIN category c ON c.id = releases.categoryid LEFT OUTER JOIN category cp ON cp.id = c.parentid LEFT OUTER JOIN groups g ON g.id = releases.groupid LEFT OUTER JOIN releasenfo rn ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL LEFT OUTER JOIN movieinfo m ON m.imdbid = releases.imdbid AND m.title != '' LEFT OUTER JOIN musicinfo mu ON mu.id = releases.musicinfoid LEFT OUTER JOIN genres mug ON mug.id = mu.genreID LEFT OUTER JOIN bookinfo bo ON bo.id = releases.bookinfoid LEFT OUTER JOIN consoleinfo co ON co.id = releases.consoleinfoid LEFT OUTER JOIN genres cog ON cog.id = co.genreID %s WHERE releases.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') %s %s %s %s ORDER BY postdate DESC %s", $cartsrch, $catsrch, $rage, $anidb, $airdate, $limit); return $this->pdo->query($sql, true); } @@ -596,18 +596,18 @@ class Releases $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and releases.categoryID not in (" . implode(",", $excludedcats) . ")"; + $exccatlist = " and releases.categoryid not in (" . implode(",", $excludedcats) . ")"; - $usershows = $this->pdo->query(sprintf("SELECT rageID, categoryID FROM userseries WHERE userID = %d", $uid), true); + $usershows = $this->pdo->query(sprintf("SELECT rageid, categoryid FROM userseries WHERE userid = %d", $uid), true); $usql = '(1=2 '; foreach ($usershows as $ushow) { - $usql .= sprintf('or (releases.rageID = %d', $ushow['rageID']); - if ($ushow['categoryID'] != '') { - $catsArr = explode('|', $ushow['categoryID']); + $usql .= sprintf('or (releases.rageid = %d', $ushow['rageid']); + if ($ushow['categoryid'] != '') { + $catsArr = explode('|', $ushow['categoryid']); if (count($catsArr) > 1) - $usql .= sprintf(' and releases.categoryID in (%s)', implode(',', $catsArr)); + $usql .= sprintf(' and releases.categoryid in (%s)', implode(',', $catsArr)); else - $usql .= sprintf(' and releases.categoryID = %d', $catsArr[0]); + $usql .= sprintf(' and releases.categoryid = %d', $catsArr[0]); } $usql .= ') '; } @@ -617,18 +617,18 @@ class Releases $limit = " LIMIT 0," . ($num > 100 ? 100 : $num); - $sql = sprintf(" SELECT releases.*, tvr.rageID, tvr.releasetitle, epinfo.overview, epinfo.director, epinfo.gueststars, epinfo.writer, epinfo.rating, epinfo.fullep, epinfo.showtitle, epinfo.tvdbID AS ep_tvdbID, g.name AS group_name, concat(cp.title, '-', c.title) AS category_name, concat(cp.ID, ',', c.ID) AS category_ids, coalesce(cp.ID,0) AS parentCategoryID + $sql = sprintf(" SELECT releases.*, tvr.rageid, tvr.releasetitle, epinfo.overview, epinfo.director, epinfo.gueststars, epinfo.writer, epinfo.rating, epinfo.fullep, epinfo.showtitle, epinfo.tvdbid AS ep_tvdbID, g.name AS group_name, concat(cp.title, '-', c.title) AS category_name, concat(cp.id, ',', c.id) AS category_ids, coalesce(cp.id,0) AS parentCategoryID FROM releases FORCE INDEX (ix_releases_rageID) - LEFT OUTER JOIN category c ON c.ID = releases.categoryID - LEFT OUTER JOIN category cp ON cp.ID = c.parentID - LEFT OUTER JOIN groups g ON g.ID = releases.groupID - LEFT OUTER JOIN (SELECT ID, releasetitle, rageid FROM tvrage GROUP BY rageid) tvr ON tvr.rageID = releases.rageID - LEFT OUTER JOIN episodeinfo epinfo ON epinfo.ID = releases.episodeinfoID + LEFT OUTER JOIN category c ON c.id = releases.categoryid + LEFT OUTER JOIN category cp ON cp.id = c.parentid + LEFT OUTER JOIN groups g ON g.id = releases.groupid + LEFT OUTER JOIN (SELECT id, releasetitle, rageid FROM tvrage GROUP BY rageid) tvr ON tvr.rageid = releases.rageid + LEFT OUTER JOIN episodeinfo epinfo ON epinfo.id = releases.episodeinfoid INNER JOIN - ( SELECT ID FROM - ( SELECT id, rageID, categoryID, season, episode FROM releases WHERE %s ORDER BY season DESC, episode DESC, postdate ASC ) releases - GROUP BY rageID, season, episode, categoryID - ) z ON z.ID = releases.ID + ( SELECT id FROM + ( SELECT id, rageid, categoryid, season, episode FROM releases WHERE %s ORDER BY season DESC, episode DESC, postdate ASC ) releases + GROUP BY rageid, season, episode, categoryid + ) z ON z.id = releases.id WHERE %s %s %s AND releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') ORDER BY postdate DESC %s", $usql, $usql, $exccatlist, $airdate, $limit @@ -646,18 +646,18 @@ class Releases $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and releases.categoryID not in (" . implode(",", $excludedcats) . ")"; + $exccatlist = " and releases.categoryid not in (" . implode(",", $excludedcats) . ")"; - $usermovies = $this->pdo->query(sprintf("SELECT imdbID, categoryID FROM usermovies WHERE userID = %d", $uid), true); + $usermovies = $this->pdo->query(sprintf("SELECT imdbid, categoryid FROM usermovies WHERE userid = %d", $uid), true); $usql = '(1=2 '; foreach ($usermovies as $umov) { - $usql .= sprintf('or (releases.imdbID = %d', $umov['imdbID']); - if ($umov['categoryID'] != '') { - $catsArr = explode('|', $umov['categoryID']); + $usql .= sprintf('or (releases.imdbid = %d', $umov['imdbid']); + if ($umov['categoryid'] != '') { + $catsArr = explode('|', $umov['categoryid']); if (count($catsArr) > 1) - $usql .= sprintf(' and releases.categoryID in (%s)', implode(',', $catsArr)); + $usql .= sprintf(' and releases.categoryid in (%s)', implode(',', $catsArr)); else - $usql .= sprintf(' and releases.categoryID = %d', $catsArr[0]); + $usql .= sprintf(' and releases.categoryid = %d', $catsArr[0]); } $usql .= ') '; } @@ -665,12 +665,12 @@ class Releases $limit = " LIMIT 0," . ($num > 100 ? 100 : $num); - $sql = sprintf(" SELECT releases.*, mi.title AS releasetitle, g.name AS group_name, concat(cp.title, '-', c.title) AS category_name, concat(cp.ID, ',', c.ID) AS category_ids, coalesce(cp.ID,0) AS parentCategoryID + $sql = sprintf(" SELECT releases.*, mi.title AS releasetitle, g.name AS group_name, concat(cp.title, '-', c.title) AS category_name, concat(cp.id, ',', c.id) AS category_ids, coalesce(cp.id,0) AS parentCategoryID FROM releases - LEFT OUTER JOIN category c ON c.ID = releases.categoryID - LEFT OUTER JOIN category cp ON cp.ID = c.parentID - LEFT OUTER JOIN groups g ON g.ID = releases.groupID - LEFT OUTER JOIN movieinfo mi ON mi.imdbID = releases.imdbID + LEFT OUTER JOIN category c ON c.id = releases.categoryid + LEFT OUTER JOIN category cp ON cp.id = c.parentid + LEFT OUTER JOIN groups g ON g.id = releases.groupid + LEFT OUTER JOIN movieinfo mi ON mi.imdbid = releases.imdbid WHERE %s %s AND releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') ORDER BY postdate DESC %s", $usql, $exccatlist, $limit @@ -693,17 +693,17 @@ class Releases $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and releases.categoryID not in (" . implode(",", $excludedcats) . ")"; + $exccatlist = " and releases.categoryid not in (" . implode(",", $excludedcats) . ")"; $usql = '(1=2 '; foreach ($usershows as $ushow) { - $usql .= sprintf('or (releases.rageID = %d', $ushow['rageID']); - if ($ushow['categoryID'] != '') { - $catsArr = explode('|', $ushow['categoryID']); + $usql .= sprintf('or (releases.rageid = %d', $ushow['rageid']); + if ($ushow['categoryid'] != '') { + $catsArr = explode('|', $ushow['categoryid']); if (count($catsArr) > 1) - $usql .= sprintf(' and releases.categoryID in (%s)', implode(',', $catsArr)); + $usql .= sprintf(' and releases.categoryid in (%s)', implode(',', $catsArr)); else - $usql .= sprintf(' and releases.categoryID = %d', $catsArr[0]); + $usql .= sprintf(' and releases.categoryid = %d', $catsArr[0]); } $usql .= ') '; } @@ -714,7 +714,7 @@ class Releases $maxagesql = sprintf(" and releases.postdate > now() - interval %d day ", $maxage); $order = $this->getBrowseOrder($orderby); - $sql = sprintf(" SELECT releases.*, concat(cp.title, '-', c.title) AS category_name, concat(cp.ID, ',', c.ID) AS category_ids, groups.name AS group_name, pre.ctime, pre.nuketype, rn.ID AS nfoID, re.releaseID AS reID FROM releases LEFT OUTER JOIN releasevideo re ON re.releaseID = releases.ID LEFT OUTER JOIN groups ON groups.ID = releases.groupID LEFT OUTER JOIN releasenfo rn ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL LEFT OUTER JOIN category c ON c.ID = releases.categoryID LEFT OUTER JOIN predb pre ON pre.ID = releases.preID LEFT OUTER JOIN category cp ON cp.ID = c.parentID WHERE %s %s AND releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') %s ORDER BY %s %s" . $limit, $usql, $exccatlist, $maxagesql, $order[0], $order[1]); + $sql = sprintf(" SELECT releases.*, concat(cp.title, '-', c.title) AS category_name, concat(cp.id, ',', c.id) AS category_ids, groups.name AS group_name, pre.ctime, pre.nuketype, rn.id AS nfoid, re.releaseid AS reID FROM releases LEFT OUTER JOIN releasevideo re ON re.releaseid = releases.id LEFT OUTER JOIN groups ON groups.id = releases.groupid LEFT OUTER JOIN releasenfo rn ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL LEFT OUTER JOIN category c ON c.id = releases.categoryid LEFT OUTER JOIN predb pre ON pre.id = releases.preID LEFT OUTER JOIN category cp ON cp.id = c.parentid WHERE %s %s AND releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') %s ORDER BY %s %s" . $limit, $usql, $exccatlist, $maxagesql, $order[0], $order[1]); return $this->pdo->query($sql, true); } @@ -728,17 +728,17 @@ class Releases $exccatlist = ""; if (count($excludedcats) > 0) - $exccatlist = " and releases.categoryID not in (" . implode(",", $excludedcats) . ")"; + $exccatlist = " and releases.categoryid not in (" . implode(",", $excludedcats) . ")"; $usql = '(1=2 '; foreach ($usershows as $ushow) { - $usql .= sprintf('or (releases.rageID = %d', $ushow['rageID']); - if ($ushow['categoryID'] != '') { - $catsArr = explode('|', $ushow['categoryID']); + $usql .= sprintf('or (releases.rageid = %d', $ushow['rageid']); + if ($ushow['categoryid'] != '') { + $catsArr = explode('|', $ushow['categoryid']); if (count($catsArr) > 1) - $usql .= sprintf(' and releases.categoryID in (%s)', implode(',', $catsArr)); + $usql .= sprintf(' and releases.categoryid in (%s)', implode(',', $catsArr)); else - $usql .= sprintf(' and releases.categoryID = %d', $catsArr[0]); + $usql .= sprintf(' and releases.categoryid = %d', $catsArr[0]); } $usql .= ') '; } @@ -748,7 +748,7 @@ class Releases if ($maxage > 0) $maxagesql = sprintf(" and releases.postdate > now() - interval %d day ", $maxage); - $res = $this->pdo->queryOneRow(sprintf(" SELECT count(releases.ID) AS num FROM releases WHERE %s %s AND releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') %s", $usql, $exccatlist, $maxagesql), true); + $res = $this->pdo->queryOneRow(sprintf(" SELECT count(releases.id) AS num FROM releases WHERE %s %s AND releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') %s", $usql, $exccatlist, $maxagesql), true); return $res["num"]; } @@ -779,7 +779,7 @@ class Releases { - $this->pdo->queryExec(sprintf("UPDATE releases SET name=%s, searchname=%s, fromname=%s, categoryID=%d, totalpart=%d, grabs=%d, size=%s, postdate=%s, adddate=%s, rageID=%d, seriesfull=%s, season=%s, episode=%s, imdbID=%d, anidbid=%d, tvdbID=%d,consoleinfoID=%d WHERE id = %d", + $this->pdo->queryExec(sprintf("UPDATE releases SET name=%s, searchname=%s, fromname=%s, categoryid=%d, totalpart=%d, grabs=%d, size=%s, postdate=%s, adddate=%s, rageid=%d, seriesfull=%s, season=%s, episode=%s, imdbid=%d, anidbid=%d, tvdbid=%d,consoleinfoid=%d WHERE id = %d", $this->pdo->escapeString($name), $this->pdo->escapeString($searchname), $this->pdo->escapeString($fromname), $category, $parts, $grabs, $this->pdo->escapeString($size), $this->pdo->escapeString($posteddate), $this->pdo->escapeString($addeddate), $rageid, $this->pdo->escapeString($seriesfull), $this->pdo->escapeString($season), $this->pdo->escapeString($episode), $imdbid, $anidbid, $tvdbid, $consoleinfoid, $id ) ); @@ -795,11 +795,11 @@ class Releases return false; $update = array( - 'categoryID' => (($category == '-1') ? '' : $category), + 'categoryid' => (($category == '-1') ? '' : $category), 'grabs' => $grabs, - 'rageID' => $rageid, + 'rageid' => $rageid, 'season' => $season, - 'imdbID' => $imdbid + 'imdbid' => $imdbid ); @@ -841,13 +841,13 @@ class Releases { $whereSql = sprintf( "%s - WHERE r.categoryID BETWEEN 5000 AND 5999 + WHERE r.categoryid BETWEEN 5000 AND 5999 AND r.nzbstatus = %d AND r.passwordstatus %s %s %s %s %s %s %s", ($name !== '' ? $this->releaseSearch->getFullTextJoinString() : ''), Enzebe::NZB_ADDED, $this->showPasswords(), - ($rageId != -1 ? sprintf(' AND rageID = %d ', $rageId) : ''), + ($rageId != -1 ? sprintf(' AND rageid = %d ', $rageId) : ''), ($series != '' ? sprintf(' AND UPPER(r.season) = UPPER(%s)', $this->pdo->escapeString(((is_numeric($series) && strlen($series) != 4) ? sprintf('S%02d', $series) : $series))) : ''), ($episode != '' ? sprintf(' AND r.episode %s', $this->pdo->likeString((is_numeric($episode) ? sprintf('E%02d', $episode) : $episode))) : ''), ($name !== '' ? $this->releaseSearch->getSearchSQL(['searchname' => $name]) : ''), @@ -858,16 +858,16 @@ class Releases $baseSql = sprintf( "SELECT r.*, concat(cp.title, ' > ', c.title) AS category_name, - CONCAT(cp.ID, ',', c.ID) AS category_ids, + CONCAT(cp.id, ',', c.id) AS category_ids, groups.name AS group_name, - rn.ID AS nfoid, - re.releaseID AS reid + rn.id AS nfoid, + re.releaseid AS reid FROM releases r - INNER JOIN category c ON c.ID = r.categoryID - INNER JOIN groups ON groups.ID = r.groupID - LEFT OUTER JOIN releasevideo re ON re.releaseID = r.ID - LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID AND rn.nfo IS NOT NULL - INNER JOIN category cp ON cp.ID = c.parentID + INNER JOIN category c ON c.id = r.categoryid + INNER JOIN groups ON groups.id = r.groupid + LEFT OUTER JOIN releasevideo re ON re.releaseid = r.id + LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id AND rn.nfo IS NOT NULL + INNER JOIN category cp ON cp.id = c.parentid %s", $whereSql ); @@ -906,7 +906,7 @@ class Releases ($name !== '' ? $this->releaseSearch->getFullTextJoinString() : ''), $this->showPasswords(), Enzebe::NZB_ADDED, - ($aniDbID > -1 ? sprintf(' AND anidbID = %d ', $aniDbID) : ''), + ($aniDbID > -1 ? sprintf(' AND anidbid = %d ', $aniDbID) : ''), (is_numeric($episodeNumber) ? sprintf(" AND r.episode '%s' ", $this->pdo->likeString($episodeNumber)) : ''), ($name !== '' ? $this->releaseSearch->getSearchSQL(['searchname' => $name]) : ''), $this->categorySQL($cat), @@ -916,14 +916,14 @@ class Releases $baseSql = sprintf( "SELECT r.*, CONCAT(cp.title, ' > ', c.title) AS category_name, - CONCAT(cp.ID, ',', c.ID) AS category_ids, + CONCAT(cp.id, ',', c.id) AS category_ids, groups.name AS group_name, - rn.ID AS nfoid + rn.id AS nfoid FROM releases r - INNER JOIN category c ON c.ID = r.categoryID - INNER JOIN groups ON groups.ID = r.groupID - LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID AND rn.nfo IS NOT NULL - INNER JOIN category cp ON cp.ID = c.parentID + INNER JOIN category c ON c.id = r.categoryid + INNER JOIN groups ON groups.id = r.groupid + LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id AND rn.nfo IS NOT NULL + INNER JOIN category cp ON cp.id = c.parentid %s", $whereSql ); @@ -957,7 +957,7 @@ class Releases { $whereSql = sprintf( "%s - WHERE r.categoryID BETWEEN 2000 AND 2999 + WHERE r.categoryid BETWEEN 2000 AND 2999 AND r.nzbstatus = %d AND r.passwordstatus %s %s %s %s %s", @@ -965,7 +965,7 @@ class Releases Enzebe::NZB_ADDED, $this->showPasswords(), ($name !== '' ? $this->releaseSearch->getSearchSQL(['searchname' => $name]) : ''), - (($imDbId != '-1' && is_numeric($imDbId)) ? sprintf(' AND imdbID = %d ', str_pad($imDbId, 7, '0', STR_PAD_LEFT)) : ''), + (($imDbId != '-1' && is_numeric($imDbId)) ? sprintf(' AND imdbid = %d ', str_pad($imDbId, 7, '0', STR_PAD_LEFT)) : ''), $this->categorySQL($cat), ($maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '') ); @@ -973,14 +973,14 @@ class Releases $baseSql = sprintf( "SELECT r.*, concat(cp.title, ' > ', c.title) AS category_name, - CONCAT(cp.ID, ',', c.ID) AS category_ids, + CONCAT(cp.id, ',', c.id) AS category_ids, g.name AS group_name, rn.id AS nfoid FROM releases r - INNER JOIN groups g ON g.ID = r.groupID - INNER JOIN category c ON c.ID = r.categoryID - LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID AND rn.nfo IS NOT NULL - INNER JOIN category cp ON cp.ID = c.parentID + INNER JOIN groups g ON g.id = r.groupid + INNER JOIN category c ON c.id = r.categoryid + LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id AND rn.nfo IS NOT NULL + INNER JOIN category cp ON cp.id = c.parentid %s", $whereSql ); @@ -1040,12 +1040,12 @@ class Releases $children = $categ->getChildren($category); $chlist = "-99"; foreach ($children as $child) - $chlist .= ", " . $child["ID"]; + $chlist .= ", " . $child["id"]; if ($chlist != "-99") - $catsrch .= " releases.categoryID in (" . $chlist . ") or "; + $catsrch .= " releases.categoryid in (" . $chlist . ") or "; } else { - $catsrch .= sprintf(" releases.categoryID = %d or ", $category); + $catsrch .= sprintf(" releases.categoryid = %d or ", $category); } } } @@ -1067,10 +1067,10 @@ class Releases $genresql .= "1=2 )"; } - $sql = sprintf("SELECT releases.*, musicinfo.cover AS mi_cover, musicinfo.review AS mi_review, musicinfo.tracks AS mi_tracks, musicinfo.publisher AS mi_publisher, musicinfo.title AS mi_title, musicinfo.artist AS mi_artist, genres.title AS music_genrename, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.ID, ',', c.ID) AS category_ids, groups.name AS group_name, rn.ID AS nfoID FROM releases %s LEFT OUTER JOIN musicinfo ON musicinfo.ID = releases.musicinfoID LEFT JOIN genres ON genres.ID = musicinfo.genreID LEFT OUTER JOIN groups ON groups.ID = releases.groupID LEFT OUTER JOIN category c ON c.ID = releases.categoryID LEFT OUTER JOIN releasenfo rn ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL LEFT OUTER JOIN category cp ON cp.ID = c.parentID WHERE releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') %s %s %s %s ORDER BY postdate DESC LIMIT %d, %d ", $usecatindex, $searchsql, $catsrch, $maxage, $genresql, $offset, $limit); + $sql = sprintf("SELECT releases.*, musicinfo.cover AS mi_cover, musicinfo.review AS mi_review, musicinfo.tracks AS mi_tracks, musicinfo.publisher AS mi_publisher, musicinfo.title AS mi_title, musicinfo.artist AS mi_artist, genres.title AS music_genrename, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.id, ',', c.id) AS category_ids, groups.name AS group_name, rn.id AS nfoid FROM releases %s LEFT OUTER JOIN musicinfo ON musicinfo.id = releases.musicinfoid LEFT JOIN genres ON genres.id = musicinfo.genreID LEFT OUTER JOIN groups ON groups.id = releases.groupid LEFT OUTER JOIN category c ON c.id = releases.categoryid LEFT OUTER JOIN releasenfo rn ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL LEFT OUTER JOIN category cp ON cp.id = c.parentid WHERE releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') %s %s %s %s ORDER BY postdate DESC LIMIT %d, %d ", $usecatindex, $searchsql, $catsrch, $maxage, $genresql, $offset, $limit); $orderpos = strpos($sql, "order by"); $wherepos = strpos($sql, "where"); - $sqlcount = "SELECT count(releases.ID) AS num FROM releases INNER JOIN musicinfo ON musicinfo.ID = releases.musicinfoID " . substr($sql, $wherepos, $orderpos - $wherepos); + $sqlcount = "SELECT count(releases.id) AS num FROM releases INNER JOIN musicinfo ON musicinfo.id = releases.musicinfoid " . substr($sql, $wherepos, $orderpos - $wherepos); $countres = $this->pdo->queryOneRow($sqlcount, true); $res = $this->pdo->query($sql, true); @@ -1107,10 +1107,10 @@ class Releases else $maxage = ""; - $sql = sprintf("SELECT releases.*, bookinfo.cover AS bi_cover, bookinfo.review AS bi_review, bookinfo.publisher AS bi_publisher, bookinfo.pages AS bi_pages, bookinfo.publishdate AS bi_publishdate, bookinfo.title AS bi_title, bookinfo.author AS bi_author, genres.title AS book_genrename, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.ID, ',', c.ID) AS category_ids, groups.name AS group_name, rn.ID AS nfoID FROM releases LEFT OUTER JOIN bookinfo ON bookinfo.ID = releases.bookinfoID LEFT JOIN genres ON genres.ID = bookinfo.genreID LEFT OUTER JOIN groups ON groups.ID = releases.groupID LEFT OUTER JOIN category c ON c.ID = releases.categoryID LEFT OUTER JOIN releasenfo rn ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL LEFT OUTER JOIN category cp ON cp.ID = c.parentID WHERE releases.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') %s %s ORDER BY postdate DESC LIMIT %d, %d ", $searchsql, $maxage, $offset, $limit); + $sql = sprintf("SELECT releases.*, bookinfo.cover AS bi_cover, bookinfo.review AS bi_review, bookinfo.publisher AS bi_publisher, bookinfo.pages AS bi_pages, bookinfo.publishdate AS bi_publishdate, bookinfo.title AS bi_title, bookinfo.author AS bi_author, genres.title AS book_genrename, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.id, ',', c.id) AS category_ids, groups.name AS group_name, rn.id AS nfoid FROM releases LEFT OUTER JOIN bookinfo ON bookinfo.id = releases.bookinfoid LEFT JOIN genres ON genres.id = bookinfo.genreID LEFT OUTER JOIN groups ON groups.id = releases.groupid LEFT OUTER JOIN category c ON c.id = releases.categoryid LEFT OUTER JOIN releasenfo rn ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL LEFT OUTER JOIN category cp ON cp.id = c.parentid WHERE releases.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') %s %s ORDER BY postdate DESC LIMIT %d, %d ", $searchsql, $maxage, $offset, $limit); $orderpos = strpos($sql, "order by"); $wherepos = strpos($sql, "where"); - $sqlcount = "SELECT count(releases.ID) AS num FROM releases INNER JOIN bookinfo ON bookinfo.ID = releases.bookinfoID " . substr($sql, $wherepos, $orderpos - $wherepos); + $sqlcount = "SELECT count(releases.id) AS num FROM releases INNER JOIN bookinfo ON bookinfo.id = releases.bookinfoid " . substr($sql, $wherepos, $orderpos - $wherepos); $countres = $this->pdo->queryOneRow($sqlcount, true); $res = $this->pdo->query($sql, true); @@ -1132,8 +1132,8 @@ class Releases { // Get the category for the parent of this release. $currRow = $this->getById($currentID); - $catRow = (new \Category(['Settings' => $this->pdo]))->getById($currRow['categoryID']); - $parentCat = $catRow['parentID']; + $catRow = (new \Category(['Settings' => $this->pdo]))->getById($currRow['categoryid']); + $parentCat = $catRow['parentid']; $results = $this->search( $this->getSimilarName($name), -1, -1, -1, [$parentCat], -1, -1, 0, 0, -1, -1, 0, $limit, '', -1, $excludedCats @@ -1221,32 +1221,32 @@ class Releases $releaseSearch->getFullTextJoinString(), Enzebe::NZB_ADDED, ($maxAge > 0 ? sprintf(' AND r.postdate > (NOW() - INTERVAL %d DAY) ', $maxAge) : ''), - ($groupName != -1 ? sprintf(' AND r.groupID = %d ', $groups->getIDByName($groupName)) : ''), + ($groupName != -1 ? sprintf(' AND r.groupid = %d ', $groups->getIDByName($groupName)) : ''), (in_array($sizeFrom, $sizeRange) ? ' AND r.size > ' . (string)(104857600 * (int)$sizeFrom) . ' ' : ''), (in_array($sizeTo, $sizeRange) ? ' AND r.size < ' . (string)(104857600 * (int)$sizeTo) . ' ' : ''), ($hasNfo != 0 ? ' AND r.nfostatus = 1 ' : ''), ($hasComments != 0 ? ' AND r.comments > 0 ' : ''), - ($type !== 'advanced' ? $this->categorySQL($cat) : ($cat[0] != '-1' ? sprintf(' AND (r.categoryID = %d) ', $cat[0]) : '')), + ($type !== 'advanced' ? $this->categorySQL($cat) : ($cat[0] != '-1' ? sprintf(' AND (r.categoryid = %d) ', $cat[0]) : '')), ($daysNew != -1 ? sprintf(' AND r.postdate < (NOW() - INTERVAL %d DAY) ', $daysNew) : ''), ($daysOld != -1 ? sprintf(' AND r.postdate > (NOW() - INTERVAL %d DAY) ', $daysOld) : ''), - (count($excludedCats) > 0 ? ' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')' : ''), + (count($excludedCats) > 0 ? ' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')' : ''), (count($searchOptions) > 0 ? $releaseSearch->getSearchSQL($searchOptions) : '') ); $baseSql = sprintf( "SELECT r.*, CONCAT(cp.title, ' > ', c.title) AS category_name, - CONCAT(cp.ID, ',', c.ID) AS category_ids, + CONCAT(cp.id, ',', c.id) AS category_ids, groups.name AS group_name, - rn.ID AS nfoid, - re.releaseID AS reid, - cp.ID AS categoryParentID + rn.id AS nfoid, + re.releaseid AS reid, + cp.id AS categoryParentID FROM releases r - LEFT OUTER JOIN releasevideo re ON re.releaseID = r.ID - LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID - INNER JOIN groups ON groups.ID = r.groupID - INNER JOIN category c ON c.ID = r.categoryID - INNER JOIN category cp ON cp.ID = c.parentID + LEFT OUTER JOIN releasevideo re ON re.releaseid = r.id + LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id + INNER JOIN groups ON groups.id = r.groupid + INNER JOIN category c ON c.id = r.categoryid + INNER JOIN category cp ON cp.id = c.parentid %s", $whereSql ); @@ -1284,7 +1284,7 @@ class Releases $count = $this->pdo->queryOneRow( sprintf( 'SELECT COUNT(*) AS count FROM (%s LIMIT %s) z', - preg_replace('/SELECT.+?FROM\s+releases/is', 'SELECT r.ID FROM releases', $query), + preg_replace('/SELECT.+?FROM\s+releases/is', 'SELECT r.id FROM releases', $query), NN_MAX_PAGER_RESULTS ) ); @@ -1296,7 +1296,7 @@ class Releases } /** - * Creates part of a query for searches requiring the categoryID's. + * Creates part of a query for searches requiring the categoryid's. * * @param array $categories * @@ -1314,14 +1314,14 @@ class Releases $children = $Category->getChildren($category); $childList = '-99'; foreach ($children as $child) { - $childList .= ', ' . $child['ID']; + $childList .= ', ' . $child['id']; } if ($childList != '-99') { - $sql .= ' r.categoryID IN (' . $childList . ') OR '; + $sql .= ' r.categoryid IN (' . $childList . ') OR '; } } else { - $sql .= sprintf(' r.categoryID = %d OR ', $category); + $sql .= sprintf(' r.categoryid = %d OR ', $category); } } } @@ -1342,8 +1342,8 @@ class Releases sprintf( 'SELECT r.*, g.name AS group_name FROM releases r - INNER JOIN groups g ON g.ID = r.groupID - WHERE r.ID = %d', + INNER JOIN groups g ON g.id = r.groupid + WHERE r.id = %d', $id ) ); @@ -1394,7 +1394,7 @@ class Releases } else { $gsql = sprintf('guid = %s', $this->pdo->escapeString($guid)); } - $sql = sprintf("SELECT releases.*, musicinfo.cover AS mi_cover, musicinfo.review AS mi_review, musicinfo.tracks AS mi_tracks, musicinfo.publisher AS mi_publisher, musicinfo.title AS mi_title, musicinfo.artist AS mi_artist, music_genre.title AS music_genrename, bookinfo.cover AS bi_cover, bookinfo.review AS bi_review, bookinfo.publisher AS bi_publisher, bookinfo.publishdate AS bi_publishdate, bookinfo.title AS bi_title, bookinfo.author AS bi_author, bookinfo.pages AS bi_pages, bookinfo.isbn AS bi_isbn, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.ID, ',', c.ID) AS category_ids, groups.name AS group_name, movieinfo.title AS movietitle, movieinfo.year AS movieyear, (SELECT releasetitle FROM tvrage WHERE rageid = releases.rageid AND rageid > 0 LIMIT 1) AS tvreleasetitle FROM releases LEFT OUTER JOIN groups ON groups.ID = releases.groupID LEFT OUTER JOIN category c ON c.ID = releases.categoryID LEFT OUTER JOIN category cp ON cp.ID = c.parentID LEFT OUTER JOIN musicinfo ON musicinfo.ID = releases.musicinfoID LEFT OUTER JOIN bookinfo ON bookinfo.ID = releases.bookinfoID LEFT OUTER JOIN movieinfo ON movieinfo.imdbID = releases.imdbID LEFT JOIN genres music_genre ON music_genre.ID = musicinfo.genreID WHERE %s", $gsql); + $sql = sprintf("SELECT releases.*, musicinfo.cover AS mi_cover, musicinfo.review AS mi_review, musicinfo.tracks AS mi_tracks, musicinfo.publisher AS mi_publisher, musicinfo.title AS mi_title, musicinfo.artist AS mi_artist, music_genre.title AS music_genrename, bookinfo.cover AS bi_cover, bookinfo.review AS bi_review, bookinfo.publisher AS bi_publisher, bookinfo.publishdate AS bi_publishdate, bookinfo.title AS bi_title, bookinfo.author AS bi_author, bookinfo.pages AS bi_pages, bookinfo.isbn AS bi_isbn, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.id, ',', c.id) AS category_ids, groups.name AS group_name, movieinfo.title AS movietitle, movieinfo.year AS movieyear, (SELECT releasetitle FROM tvrage WHERE rageid = releases.rageid AND rageid > 0 LIMIT 1) AS tvreleasetitle FROM releases LEFT OUTER JOIN groups ON groups.id = releases.groupid LEFT OUTER JOIN category c ON c.id = releases.categoryid LEFT OUTER JOIN category cp ON cp.id = c.parentid LEFT OUTER JOIN musicinfo ON musicinfo.id = releases.musicinfoid LEFT OUTER JOIN bookinfo ON bookinfo.id = releases.bookinfoid LEFT OUTER JOIN movieinfo ON movieinfo.imdbid = releases.imdbid LEFT JOIN genres music_genre ON music_genre.id = musicinfo.genreID WHERE %s", $gsql); return (is_array($guid)) ? $this->pdo->query($sql) : $this->pdo->queryOneRow($sql); } @@ -1405,9 +1405,9 @@ class Releases public function removeRageIdFromReleases($rageid) { - $res = $this->pdo->queryOneRow(sprintf("SELECT count(ID) AS num FROM releases WHERE rageID = %d", $rageid)); + $res = $this->pdo->queryOneRow(sprintf("SELECT count(id) AS num FROM releases WHERE rageid = %d", $rageid)); $ret = $res["num"]; - $this->pdo->queryExec(sprintf("UPDATE releases SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL WHERE rageID = %d", $rageid)); + $this->pdo->queryExec(sprintf("UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL WHERE rageid = %d", $rageid)); return $ret; } @@ -1418,9 +1418,9 @@ class Releases public function removeThetvdbIdFromReleases($tvdbID) { - $res = $this->pdo->queryOneRow(sprintf("SELECT count(ID) AS num FROM releases WHERE tvdbID = %d", $tvdbID)); + $res = $this->pdo->queryOneRow(sprintf("SELECT count(id) AS num FROM releases WHERE tvdbid = %d", $tvdbID)); $ret = $res["num"]; - $res = $this->pdo->queryExec(sprintf("UPDATE releases SET tvdbID = -1 WHERE tvdbID = %d", $tvdbID)); + $res = $this->pdo->queryExec(sprintf("UPDATE releases SET tvdbid = -1 WHERE tvdbid = %d", $tvdbID)); return $ret; } @@ -1428,7 +1428,7 @@ class Releases public function removeAnidbIdFromReleases($anidbID) { - $res = $this->pdo->queryOneRow(sprintf("SELECT count(ID) AS num FROM releases WHERE anidbid = %d", $anidbID)); + $res = $this->pdo->queryOneRow(sprintf("SELECT count(id) AS num FROM releases WHERE anidbid = %d", $anidbID)); $ret = $res["num"]; $this->pdo->queryExec(sprintf("UPDATE releases SET anidbid = -1, episode = NULL, tvtitle = NULL, tvairdate = NULL WHERE anidbid = %d", $anidbID)); @@ -1440,7 +1440,7 @@ class Releases $selnfo = ($incnfo) ? ', uncompress(nfo) as nfo' : ''; - return $this->pdo->queryOneRow(sprintf("SELECT ID, releaseID" . $selnfo . " FROM releasenfo where releaseID = %d AND nfo IS NOT NULL", $id)); + return $this->pdo->queryOneRow(sprintf("SELECT id, releaseid" . $selnfo . " FROM releasenfo where releaseid = %d AND nfo IS NOT NULL", $id)); } public function updateGrab($guid) @@ -1469,7 +1469,7 @@ class Releases if (!empty($groupName)) { $groupInfo = $this->groups->getByName($groupName); - $groupID = $groupInfo['ID']; + $groupID = $groupInfo['id']; } $processReleases = microtime(true); @@ -1506,7 +1506,7 @@ class Releases } else if ($processRequestIDs === 2) { $requestIDTime = time(); if ($this->echoCLI) { - $this->pdo->log->doEcho($this->pdo->log->header("Process Releases -> Request ID Threaded lookup.")); + $this->pdo->log->doEcho($this->pdo->log->header("Process Releases -> Request id Threaded lookup.")); } passthru("$PYTHON ${DIR}update_scripts/nix_scripts/tmux/python/requestid_threaded.py"); if ($this->echoCLI) { @@ -1535,7 +1535,7 @@ class Releases //Print amount of added releases and time it took. if ($this->echoCLI && $this->tablePerGroup === false) { - $countID = $this->pdo->queryOneRow('SELECT COUNT(ID) AS count FROM binaries ' . (!empty($groupID) ? ' WHERE groupID = ' . $groupID : '')); + $countID = $this->pdo->queryOneRow('SELECT COUNT(id) AS count FROM binaries ' . (!empty($groupID) ? ' WHERE groupid = ' . $groupID : '')); $this->pdo->log->doEcho( $this->pdo->log->primary( 'Completed adding ' . @@ -1569,14 +1569,14 @@ class Releases // aggregate the releasefiles upto the releases. // $this->pdo->log->doEcho($this->pdo->log->primary('Aggregating Files')); - $this->pdo->queryExec("UPDATE releases INNER JOIN (SELECT releaseID, COUNT(ID) AS num FROM releasefiles GROUP BY releaseID) b ON b.releaseID = releases.ID AND releases.rarinnerfilecount = 0 SET rarinnerfilecount = b.num"); + $this->pdo->queryExec("UPDATE releases INNER JOIN (SELECT releaseid, COUNT(id) AS num FROM releasefiles GROUP BY releaseid) b ON b.releaseid = releases.id AND releases.rarinnerfilecount = 0 SET rarinnerfilecount = b.num"); // Remove the binaries and parts used to form releases, or that are duplicates. // if ($page->site->partsdeletechunks > 0) { $this->pdo->log->doEcho($this->pdo->log->primary('Chunk deleting unused binaries and parts')); - $query = sprintf("SELECT p.ID AS partsID,b.ID AS binariesID FROM %s p - LEFT JOIN %s b ON b.ID = p.binaryID + $query = sprintf("SELECT p.id AS partsID,b.id AS binariesID FROM %s p + LEFT JOIN %s b ON b.id = p.binaryID WHERE b.dateadded < %s - INTERVAL %d HOUR LIMIT 0,%d", $group['pname'], $group['bname'], @@ -1599,10 +1599,10 @@ class Releases } $pID = '(' . implode(',', $pID) . ')'; $bID = '(' . implode(',', $bID) . ')'; - $fr = $this->pdo->queryExec("DELETE FROM %s WHERE ID IN {$pID}", $group['pname']); + $fr = $this->pdo->queryExec("DELETE FROM %s WHERE id IN {$pID}", $group['pname']); if ($fr > 0) { $cc += $fr; - $cc += $this->pdo->queryExec("DELETE FROM %s WHERE ID IN {$bID}", $group['bname']); + $cc += $this->pdo->queryExec("DELETE FROM %s WHERE id IN {$bID}", $group['bname']); } unset($pID); unset($bID); @@ -1617,7 +1617,7 @@ class Releases $this->pdo->log->doEcho($this->pdo->log->primary('Complete - ' . $cc . ' rows affected')); } else { $this->pdo->log->doEcho($this->pdo->log->primary('Deleting unused binaries and parts')); - $this->pdo->queryExec(sprintf("DELETE %s, %s FROM %s JOIN %s ON %s.ID = %s.binaryID + $this->pdo->queryExec(sprintf("DELETE %s, %s FROM %s JOIN %s ON %s.id = %s.binaryID WHERE %s.dateadded < %s - INTERVAL %d HOUR", $group['pname'], $group['bname'], @@ -1648,7 +1648,7 @@ class Releases $page = new Page(); $group = $this->groups->getCBPTableNames($this->tablePerGroup, $groupID); $this->pdo->log->doEcho($this->pdo->log->primary('Marking binaries where all parts are available')); - $result = $this->pdo->queryDirect(sprintf("SELECT relname, date, SUM(reltotalpart) AS reltotalpart, groupID, reqID, fromname, SUM(num) AS num, coalesce(g.minfilestoformrelease, s.minfilestoformrelease) AS minfilestoformrelease FROM ( SELECT relname, reltotalpart, groupID, reqID, fromname, max(date) AS date, COUNT(ID) AS num FROM %s WHERE procstat = %s GROUP BY relname, reltotalpart, groupID, reqID, fromname ORDER BY NULL ) x LEFT OUTER JOIN groups g ON g.ID = x.groupID INNER JOIN ( SELECT value AS minfilestoformrelease FROM site WHERE setting = 'minfilestoformrelease' ) s GROUP BY relname, groupID, reqID, fromname, minfilestoformrelease ORDER BY NULL", $group['bname'], Releases::PROCSTAT_TITLEMATCHED)); + $result = $this->pdo->queryDirect(sprintf("SELECT relname, date, SUM(reltotalpart) AS reltotalpart, groupid, reqid, fromname, SUM(num) AS num, coalesce(g.minfilestoformrelease, s.minfilestoformrelease) AS minfilestoformrelease FROM ( SELECT relname, reltotalpart, groupid, reqid, fromname, max(date) AS date, COUNT(id) AS num FROM %s WHERE procstat = %s GROUP BY relname, reltotalpart, groupid, reqid, fromname ORDER BY NULL ) x LEFT OUTER JOIN groups g ON g.id = x.groupid INNER JOIN ( SELECT value AS minfilestoformrelease FROM site WHERE setting = 'minfilestoformrelease' ) s GROUP BY relname, groupid, reqid, fromname, minfilestoformrelease ORDER BY NULL", $group['bname'], Releases::PROCSTAT_TITLEMATCHED)); while ($row = $this->pdo->getAssocArray($result)) { $retcount++; @@ -1672,10 +1672,10 @@ class Releases $incomplete = true; } else { // Check that the binary is complete - $binlist = $this->pdo->query(sprintf('SELECT %s.ID, totalParts, date, COUNT(DISTINCT %s.messageID) AS num FROM %s, - %s WHERE %s.ID=%s.binaryID AND %s.relname = %s - AND %s.procstat = %d AND %s.groupID = %d AND %s.fromname = %s - GROUP BY %s.ID ORDER BY NULL', + $binlist = $this->pdo->query(sprintf('SELECT %s.id, totalParts, date, COUNT(DISTINCT %s.messageID) AS num FROM %s, + %s WHERE %s.id=%s.binaryID AND %s.relname = %s + AND %s.procstat = %d AND %s.groupid = %d AND %s.fromname = %s + GROUP BY %s.id ORDER BY NULL', $group['bname'], $group['pname'], $group['bname'], @@ -1687,7 +1687,7 @@ class Releases $group['bname'], Releases::PROCSTAT_TITLEMATCHED, $group['bname'], - $row['groupID'], + $row['groupid'], $group['bname'], $this->pdo->escapeString($row["fromname"]), $group['bname'] @@ -1709,12 +1709,12 @@ class Releases // // Right number of files, but see if the binary is a allfilled/reqid post, in which case it needs its name looked up // - if ($row['reqID'] != '' && $page->site->reqidurl != "") { + if ($row['reqid'] != '' && $page->site->reqidurl != "") { // // Try and get the name using the group // $binGroup = $this->groups->getByNameById($groupID); - $newtitle = $this->getReleaseNameForReqId($page->site->reqidurl, $page->site->newznabID, $binGroup, $row["reqID"]); + $newtitle = $this->getReleaseNameForReqId($page->site->reqidurl, $page->site->newznabID, $binGroup, $row["reqid"]); // // if the feed/group wasnt supported by the scraper, then just use the release name as the title. @@ -1728,14 +1728,14 @@ class Releases // if ($newtitle != "") { $this->pdo->queryExec(sprintf("UPDATE %s SET relname = %s, procstat = %d WHERE %s relname = %s AND procstat = %d AND fromname = %s", - $group['bname'], $this->pdo->escapeString($newtitle), Releases::PROCSTAT_READYTORELEASE, (!empty($groupID) ? ' groupID = ' . $groupID . ' AND ' : ' '), $this->pdo->escapeString($row["relname"]), Releases::PROCSTAT_TITLEMATCHED, $this->pdo->escapeString($row["fromname"]) + $group['bname'], $this->pdo->escapeString($newtitle), Releases::PROCSTAT_READYTORELEASE, (!empty($groupID) ? ' groupid = ' . $groupID . ' AND ' : ' '), $this->pdo->escapeString($row["relname"]), Releases::PROCSTAT_TITLEMATCHED, $this->pdo->escapeString($row["fromname"]) ) ); } else { // // Item not found, if the binary was added to the index yages ago, then give up. // - $maxaddeddate = $this->pdo->queryOneRow(sprintf("SELECT NOW() AS now, MAX(dateadded) AS dateadded FROM %s WHERE relname = %s AND procstat = %d AND groupID = %d AND fromname=%s", + $maxaddeddate = $this->pdo->queryOneRow(sprintf("SELECT NOW() AS now, MAX(dateadded) AS dateadded FROM %s WHERE relname = %s AND procstat = %d AND groupid = %d AND fromname=%s", $group['bname'], $this->pdo->escapeString($row["relname"]), Releases::PROCSTAT_TITLEMATCHED, $groupID, $this->pdo->escapeString($row["fromname"]) ) ); @@ -1744,7 +1744,7 @@ class Releases // If added to the index over 48 hours ago, give up trying to determine the title // if (strtotime($maxaddeddate['now']) - strtotime($maxaddeddate['dateadded']) > (60 * 60 * 48)) { - $this->pdo->queryExec(sprintf("UPDATE %s SET procstat=%d WHERE relname = %s AND procstat = %d AND groupID = %d AND fromname=%s", + $this->pdo->queryExec(sprintf("UPDATE %s SET procstat=%d WHERE relname = %s AND procstat = %d AND groupid = %d AND fromname=%s", $group['bname'], Releases::PROCSTAT_NOREQIDNAMELOOKUPFOUND, $this->pdo->escapeString($row["relname"]), Releases::PROCSTAT_TITLEMATCHED, $groupID, $this->pdo->escapeString($row["fromname"]) ) ); @@ -1752,7 +1752,7 @@ class Releases } } else { $this->pdo->queryExec(sprintf("UPDATE %s SET procstat = %d WHERE relname = %s AND procstat = %d AND %s fromname=%s", - $group['bname'], Releases::PROCSTAT_READYTORELEASE, $this->pdo->escapeString($row["relname"]), Releases::PROCSTAT_TITLEMATCHED,(!empty($groupID) ? ' groupID = ' . $groupID . ' AND ' : ' '), $this->pdo->escapeString($row["fromname"]) + $group['bname'], Releases::PROCSTAT_READYTORELEASE, $this->pdo->escapeString($row["relname"]), Releases::PROCSTAT_TITLEMATCHED,(!empty($groupID) ? ' groupid = ' . $groupID . ' AND ' : ' '), $this->pdo->escapeString($row["fromname"]) ) ); } @@ -1784,7 +1784,7 @@ class Releases // $categorize = new \Categorize(['Settings' => $this->pdo]); $returnCount = $duplicate = 0; - $result = $this->pdo->queryDirect(sprintf("SELECT %s.*, g.name AS group_name, count(%s.ID) AS parts FROM %s INNER JOIN groups g ON g.ID = %s.groupID WHERE %s procstat = %d AND relname IS NOT NULL GROUP BY relname, g.name, groupID, fromname ORDER BY COUNT(%s.ID) DESC LIMIT %d", $group['bname'], $group['bname'], $group['bname'], $group['bname'], (!empty($groupID) ? ' groupID = ' . $groupID . ' AND ' : ' '), Releases::PROCSTAT_READYTORELEASE, $group['bname'], $this->releaseCreationLimit)); + $result = $this->pdo->queryDirect(sprintf("SELECT %s.*, g.name AS group_name, count(%s.id) AS parts FROM %s INNER JOIN groups g ON g.id = %s.groupid WHERE %s procstat = %d AND relname IS NOT NULL GROUP BY relname, g.name, groupid, fromname ORDER BY COUNT(%s.id) DESC LIMIT %d", $group['bname'], $group['bname'], $group['bname'], $group['bname'], (!empty($groupID) ? ' groupid = ' . $groupID . ' AND ' : ' '), Releases::PROCSTAT_READYTORELEASE, $group['bname'], $this->releaseCreationLimit)); while ($row = $this->pdo->getAssocArray($result)) { $relguid = $this->createGUID(); // Clean release name @@ -1797,7 +1797,7 @@ class Releases if (is_array($cleanedName)) { $properName = $cleanedName['properlynamed']; $prehashID = (isset($cleanerName['predb']) ? $cleanerName['predb'] : false); - $isReqID = (isset($cleanerName['requestID']) ? $cleanerName['requestID'] : false); + $isReqID = (isset($cleanerName['requestid']) ? $cleanerName['requestid'] : false); $cleanedName = $cleanedName['cleansubject']; } else { $properName = true; @@ -1810,7 +1810,7 @@ class Releases $preMatch = $preHash->matchPre($cleanedName); if ($preMatch !== false) { $cleanedName = $preMatch['title']; - $prehashID = $preMatch['prehashID']; + $prehashID = $preMatch['prehashid']; $properName = true; } } @@ -1819,25 +1819,25 @@ class Releases 'name' => $this->pdo->escapeString($cleanRelName), 'searchname' => $this->pdo->escapeString(utf8_encode($cleanedName)), 'totalpart' => $row["parts"], - 'groupID' => $row["groupID"], + 'groupid' => $row["groupid"], 'guid' => $this->pdo->escapeString($relguid), - 'categoryID' => $categorize->determineCategory($groupID, $cleanedName), - 'regexID' => $row["regexID"], + 'categoryid' => $categorize->determineCategory($groupID, $cleanedName), + 'regexid' => $row["regexid"], 'postdate' => $this->pdo->escapeString($row['date']), 'fromname' => $this->pdo->escapeString($row['fromname']), - 'reqID' => $row["reqID"], + 'reqid' => $row["reqid"], 'passwordstatus' => ($page->site->checkpasswordedrar > 0 ? -1 : 0), 'nzbstatus' => \Enzebe::NZB_NONE, 'isrenamed' => ($properName === true ? 1 : 0), 'reqidstatus' => ($isReqID === true ? 1 : 0), - 'prehashID' => ($prehashID === false ? 0 : $prehashID) + 'prehashid' => ($prehashID === false ? 0 : $prehashID) ] ); // // Tag every binary for this release with its parent release id // - $this->pdo->queryExec(sprintf("UPDATE %s SET procstat = %d, releaseID = %d WHERE relname = %s AND procstat = %d AND %s fromname=%s", - $group['bname'], Releases::PROCSTAT_RELEASED, $relid, $this->pdo->escapeString($row["relname"]), Releases::PROCSTAT_READYTORELEASE, (!empty($groupID) ? ' groupID = ' . $groupID . ' AND ' : ' '), $this->pdo->escapeString($row["fromname"]) + $this->pdo->queryExec(sprintf("UPDATE %s SET procstat = %d, releaseid = %d WHERE relname = %s AND procstat = %d AND %s fromname=%s", + $group['bname'], Releases::PROCSTAT_RELEASED, $relid, $this->pdo->escapeString($row["relname"]), Releases::PROCSTAT_READYTORELEASE, (!empty($groupID) ? ' groupid = ' . $groupID . ' AND ' : ' '), $this->pdo->escapeString($row["fromname"]) ) ); $cat = new \Categorize(['Settings' => $this->pdo]); @@ -1852,7 +1852,7 @@ class Releases // // Remove used binaries // - $this->pdo->queryExec(sprintf("DELETE %s, %s FROM %s JOIN %s ON %s.ID = %s.binaryID WHERE releaseID = %d ", + $this->pdo->queryExec(sprintf("DELETE %s, %s FROM %s JOIN %s ON %s.id = %s.binaryID WHERE releaseid = %d ", $group['pname'], $group['bname'], $group['pname'], @@ -1878,7 +1878,7 @@ class Releases $this->delete($relid); $duplicate++; } else { - $this->pdo->queryExec(sprintf("UPDATE releases SET totalpart = %d, size = %s, COMPLETION = %d, GID=%s , nzb_guid = %s WHERE ID = %d", + $this->pdo->queryExec(sprintf("UPDATE releases SET totalpart = %d, size = %s, COMPLETION = %d, GID=%s , nzb_guid = %s WHERE id = %d", $nzbInfo->filecount, $nzbInfo->filesize, $nzbInfo->completion, @@ -2004,10 +2004,10 @@ class Releases // Get out all binaries of STAGE0 for current group $newUnmatchedBinaries = array(); - $ressql = sprintf('SELECT ID, name, date, totalParts, procstat, fromname FROM %s b - WHERE groupID = %d AND procstat IN (%d, %d) AND regexID IS NULL ORDER BY b.date ASC', + $ressql = sprintf('SELECT id, name, date, totalParts, procstat, fromname FROM %s b + WHERE groupid = %d AND procstat IN (%d, %d) AND regexid IS NULL ORDER BY b.date ASC', $group['bname'], - $groupArr['ID'], + $groupArr['id'], Releases::PROCSTAT_NEW, Releases::PROCSTAT_TITLENOTMATCHED ); @@ -2027,20 +2027,20 @@ class Releases if (!empty($regexMatches)) { $matchedbins++; $relparts = explode("/", $regexMatches['parts']); - $this->pdo->queryExec(sprintf("UPDATE %s SET relname = replace(%s, '_', ' '), relpart = %d, reltotalpart = %d, procstat=%d, categoryID=%s, regexID=%d, reqID=%s WHERE ID = %d", - $group['bname'], $this->pdo->escapeString($regexMatches['name']), $relparts[0], $relparts[1], Releases::PROCSTAT_TITLEMATCHED, $regexMatches['regcatid'], $regexMatches['regexID'], $this->pdo->escapeString($regexMatches['reqID']), $rowbin["ID"] + $this->pdo->queryExec(sprintf("UPDATE %s SET relname = replace(%s, '_', ' '), relpart = %d, reltotalpart = %d, procstat=%d, categoryid=%s, regexid=%d, reqid=%s WHERE id = %d", + $group['bname'], $this->pdo->escapeString($regexMatches['name']), $relparts[0], $relparts[1], Releases::PROCSTAT_TITLEMATCHED, $regexMatches['regcatid'], $regexMatches['regexid'], $this->pdo->escapeString($regexMatches['reqid']), $rowbin["id"] ) ); } else { if ($rowbin['procstat'] == Releases::PROCSTAT_NEW) - $newUnmatchedBinaries[] = $rowbin['ID']; + $newUnmatchedBinaries[] = $rowbin['id']; } } //mark as not matched if (!empty($newUnmatchedBinaries)) - $this->pdo->queryExec(sprintf("UPDATE %s SET procstat=%d WHERE ID IN (%s)", $group['bname'], Releases::PROCSTAT_TITLENOTMATCHED, implode(',', $newUnmatchedBinaries))); + $this->pdo->queryExec(sprintf("UPDATE %s SET procstat=%d WHERE id IN (%s)", $group['bname'], Releases::PROCSTAT_TITLENOTMATCHED, implode(',', $newUnmatchedBinaries))); } } @@ -2101,32 +2101,32 @@ class Releases public function insertRelease(array $parameters = []) { - if ($parameters['regexID'] == "") - $parameters['regexID'] = " null "; + if ($parameters['regexid'] == "") + $parameters['regexid'] = " null "; - if ($parameters['reqID'] != "") - $parameters['reqID'] = $this->pdo->escapeString($parameters['reqID']); + if ($parameters['reqid'] != "") + $parameters['reqid'] = $this->pdo->escapeString($parameters['reqid']); else - $parameters['reqID'] = " null "; + $parameters['reqid'] = " null "; - $parameters['id'] = $this->pdo->queryInsert(sprintf("INSERT INTO releases (name, searchname, totalpart, groupID, adddate, guid, categoryID, regexID, rageID, postdate, fromname, size, reqID, passwordstatus, completion, haspreview, nfostatus, nzbstatus, - isrenamed, iscategorized, reqidstatus, prehashID) + $parameters['id'] = $this->pdo->queryInsert(sprintf("INSERT INTO releases (name, searchname, totalpart, groupid, adddate, guid, categoryid, regexid, rageid, postdate, fromname, size, reqid, passwordstatus, completion, haspreview, nfostatus, nzbstatus, + isrenamed, iscategorized, reqidstatus, prehashid) VALUES (%s, %s, %d, %d, now(), %s, %d, %s, -1, %s, %s, 0, %s, %d, 100,-1, -1, %d, %d, 1, %d, %d)", $parameters['name'], $parameters['searchname'], $parameters['totalpart'], - $parameters['groupID'], + $parameters['groupid'], $parameters['guid'], - $parameters['categoryID'], - $parameters['regexID'], + $parameters['categoryid'], + $parameters['regexid'], $parameters['postdate'], $parameters['fromname'], - $parameters['reqID'], + $parameters['reqid'], $parameters['passwordstatus'], $parameters['nzbstatus'], $parameters['isrenamed'], $parameters['reqidstatus'], - $parameters['prehashID'] + $parameters['prehashid'] ) ); @@ -2180,15 +2180,15 @@ class Releases unlink($audiopreviewpath); if ($rel) { - $nfo->deleteReleaseNfo($rel['ID']); - $rc->deleteCommentsForRelease($rel['ID']); - $users->delCartForRelease($rel['ID']); - $users->delDownloadRequestsForRelease($rel['ID']); - $rf->delete($rel['ID']); - $re->delete($rel['ID']); - $re->deleteFull($rel['ID']); + $nfo->deleteReleaseNfo($rel['id']); + $rc->deleteCommentsForRelease($rel['id']); + $users->delCartForRelease($rel['id']); + $users->delDownloadRequestsForRelease($rel['id']); + $rf->delete($rel['id']); + $re->delete($rel['id']); + $re->deleteFull($rel['id']); $ri->delete($rel['guid']); - $this->pdo->queryExec(sprintf("DELETE FROM releases WHERE ID = %d", $rel['ID'])); + $this->pdo->queryExec(sprintf("DELETE FROM releases WHERE id = %d", $rel['id'])); } } } @@ -2220,14 +2220,14 @@ class Releases sprintf(' DELETE r, rn, rc, uc, rf, ra, rs, rv, re FROM releases r - LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID - LEFT OUTER JOIN releasecomment rc ON rc.releaseID = r.ID - LEFT OUTER JOIN usercart uc ON uc.releaseID = r.ID - LEFT OUTER JOIN releasefiles rf ON rf.releaseID = r.ID - LEFT OUTER JOIN releaseaudio ra ON ra.releaseID = r.ID - LEFT OUTER JOIN releasesubs rs ON rs.releaseID = r.ID - LEFT OUTER JOIN releasevideo rv ON rv.releaseID = r.ID - LEFT OUTER JOIN releaseextrafull re ON re.releaseID = r.ID + LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id + LEFT OUTER JOIN releasecomment rc ON rc.releaseid = r.id + LEFT OUTER JOIN usercart uc ON uc.releaseid = r.id + LEFT OUTER JOIN releasefiles rf ON rf.releaseid = r.id + LEFT OUTER JOIN releaseaudio ra ON ra.releaseid = r.id + LEFT OUTER JOIN releasesubs rs ON rs.releaseid = r.id + LEFT OUTER JOIN releasevideo rv ON rv.releaseid = r.id + LEFT OUTER JOIN releaseextrafull re ON re.releaseid = r.id WHERE r.guid = %s', $this->pdo->escapeString($identifiers['g']) ) @@ -2238,7 +2238,7 @@ class Releases { - return $this->pdo->query("SELECT ID, searchname, guid, adddate, grabs FROM releases + return $this->pdo->query("SELECT id, searchname, guid, adddate, grabs FROM releases WHERE grabs > 0 ORDER BY grabs DESC LIMIT 10" @@ -2249,7 +2249,7 @@ class Releases { - return $this->pdo->query("SELECT ID, guid, searchname, adddate, comments FROM releases + return $this->pdo->query("SELECT id, guid, searchname, adddate, comments FROM releases WHERE comments > 0 ORDER BY comments DESC LIMIT 10" @@ -2262,8 +2262,8 @@ class Releases return $this->pdo->query("SELECT concat(cp.title, ' > ', category.title) AS title, COUNT(*) AS count FROM category - LEFT OUTER JOIN category cp ON cp.ID = category.parentID - INNER JOIN releases ON releases.categoryID = category.ID + LEFT OUTER JOIN category cp ON cp.id = category.parentid + INNER JOIN releases ON releases.categoryid = category.id WHERE releases.adddate > NOW() - INTERVAL 1 WEEK GROUP BY concat(cp.title, ' > ', category.title) ORDER BY COUNT(*) DESC" @@ -2278,15 +2278,15 @@ class Releases public function getNewestMovies() { return $this->pdo->queryDirect( - "SELECT r.imdbID, r.guid, r.name, r.searchname, r.size, r.completion, - postdate, categoryID, comments, grabs, + "SELECT r.imdbid, r.guid, r.name, r.searchname, r.size, r.completion, + postdate, categoryid, comments, grabs, m.cover FROM releases r - INNER JOIN movieinfo m USING (imdbID) - WHERE r.categoryID BETWEEN 2000 AND 2999 - AND m.imdbID > 0 + INNER JOIN movieinfo m USING (imdbid) + WHERE r.categoryid BETWEEN 2000 AND 2999 + AND m.imdbid > 0 AND m.cover = 1 - AND r.ID in (select max(ID) from releases where imdbID > 0 group by imdbID) + AND r.id in (select max(id) from releases where imdbid > 0 group by imdbid) ORDER BY r.postdate DESC LIMIT 24" ); @@ -2300,15 +2300,15 @@ class Releases public function getNewestConsole() { return $this->pdo->queryDirect( - "SELECT r.consoleinfoID, r.guid, r.name, r.searchname, r.size, r.completion, - r.postdate, r.categoryID, r.comments, r.grabs, + "SELECT r.consoleinfoid, r.guid, r.name, r.searchname, r.size, r.completion, + r.postdate, r.categoryid, r.comments, r.grabs, con.cover FROM releases r - INNER JOIN consoleinfo con ON r.consoleinfoID = con.ID - WHERE r.categoryID BETWEEN 1000 AND 1999 - AND con.ID > 0 + INNER JOIN consoleinfo con ON r.consoleinfoid = con.id + WHERE r.categoryid BETWEEN 1000 AND 1999 + AND con.id > 0 AND con.cover > 0 - AND r.ID in (select max(ID) from releases where consoleinfoID > 0 group by consoleinfoID) + AND r.id in (select max(id) from releases where consoleinfoid > 0 group by consoleinfoid) ORDER BY r.postdate DESC LIMIT 35" ); @@ -2323,14 +2323,14 @@ class Releases { return $this->pdo->queryDirect( "SELECT r.gamesinfo_id, r.guid, r.name, r.searchname, r.size, r.completion, - r.postdate, r.categoryID, r.comments, r.grabs, + r.postdate, r.categoryid, r.comments, r.grabs, gi.cover FROM releases r INNER JOIN gamesinfo gi ON r.gamesinfo_id = gi.id - WHERE r.categoryID = 4050 + WHERE r.categoryid = 4050 AND gi.id > 0 AND gi.cover > 0 - AND r.ID in (select max(ID) from releases where gamesinfo_id > 0 group by gamesinfo_id) + AND r.id in (select max(id) from releases where gamesinfo_id > 0 group by gamesinfo_id) ORDER BY r.postdate DESC LIMIT 35" ); @@ -2344,16 +2344,16 @@ class Releases public function getNewestMP3s() { return $this->pdo->queryDirect( - "SELECT r.musicinfoID, r.guid, r.name, r.searchname, r.size, r.completion, - r.postdate, r.categoryID, r.comments, r.grabs, + "SELECT r.musicinfoid, r.guid, r.name, r.searchname, r.size, r.completion, + r.postdate, r.categoryid, r.comments, r.grabs, m.cover FROM releases r - INNER JOIN musicinfo m ON r.musicinfoID = m.ID - WHERE r.categoryID BETWEEN 3000 AND 3999 - AND r.categoryID != 3030 - AND m.ID > 0 + INNER JOIN musicinfo m ON r.musicinfoid = m.id + WHERE r.categoryid BETWEEN 3000 AND 3999 + AND r.categoryid != 3030 + AND m.id > 0 AND m.cover > 0 - AND r.ID in (select max(ID) from releases where musicinfoID > 0 group by musicinfoID) + AND r.id in (select max(id) from releases where musicinfoid > 0 group by musicinfoid) ORDER BY r.postdate DESC LIMIT 24" ); @@ -2367,16 +2367,16 @@ class Releases public function getNewestBooks() { return $this->pdo->queryDirect( - "SELECT r.bookinfoID, r.guid, r.name, r.searchname, r.size, r.completion, - r.postdate, r.categoryID, r.comments, r.grabs, + "SELECT r.bookinfoid, r.guid, r.name, r.searchname, r.size, r.completion, + r.postdate, r.categoryid, r.comments, r.grabs, b.url, b.cover, b.title as booktitle, b.author FROM releases r - INNER JOIN bookinfo b ON r.bookinfoID = b.ID - WHERE r.categoryID BETWEEN 7000 AND 7999 - OR r.categoryID = 3030 - AND b.ID > 0 + INNER JOIN bookinfo b ON r.bookinfoid = b.id + WHERE r.categoryid BETWEEN 7000 AND 7999 + OR r.categoryid = 3030 + AND b.id > 0 AND b.cover > 0 - AND r.ID in (select max(ID) from releases where bookinfoID > 0 group by bookinfoID) + AND r.id in (select max(id) from releases where bookinfoid > 0 group by bookinfoid) ORDER BY r.postdate DESC LIMIT 24" ); @@ -2391,14 +2391,14 @@ class Releases { return $this->pdo->queryDirect( "SELECT r.xxxinfo_id, r.guid, r.name, r.searchname, r.size, r.completion, - r.postdate, r.categoryID, r.comments, r.grabs, + r.postdate, r.categoryid, r.comments, r.grabs, xxx.cover, xxx.title FROM releases r - INNER JOIN xxxinfo xxx ON r.xxxinfo_id = xxx.ID - WHERE r.categoryID BETWEEN 6000 AND 6999 - AND xxx.ID > 0 + INNER JOIN xxxinfo xxx ON r.xxxinfo_id = xxx.id + WHERE r.categoryid BETWEEN 6000 AND 6999 + AND xxx.id > 0 AND xxx.cover = 1 - AND r.ID in (select max(ID) from releases where xxxinfo_id > 0 group by xxxinfo_id) + AND r.id in (select max(id) from releases where xxxinfo_id > 0 group by xxxinfo_id) ORDER BY r.postdate DESC LIMIT 24" ); @@ -2412,15 +2412,15 @@ class Releases public function getNewestTV() { return $this->pdo->queryDirect( - "SELECT r.rageID, r.guid, r.name, r.searchname, r.size, r.completion, - r.postdate, r.categoryID, r.comments, r.grabs, - tv.ID as tvid, tv.imgdata, tv.releasetitle as tvtitle + "SELECT r.rageid, r.guid, r.name, r.searchname, r.size, r.completion, + r.postdate, r.categoryid, r.comments, r.grabs, + tv.id as tvid, tv.imgdata, tv.releasetitle as tvtitle FROM releases r - INNER JOIN tvrage tv USING (rageID) - WHERE r.categoryID BETWEEN 5000 AND 5999 - AND tv.rageID > 0 + INNER JOIN tvrage tv USING (rageid) + WHERE r.categoryid BETWEEN 5000 AND 5999 + AND tv.rageid > 0 AND length(tv.imgdata) > 0 - GROUP BY tv.rageID + GROUP BY tv.rageid ORDER BY r.postdate DESC LIMIT 24" ); @@ -2453,7 +2453,7 @@ class Releases $this->pdo->log->doEcho( $this->pdo->log->header( sprintf( - "Process Releases -> Request ID %s lookup -- limit %s", + "Process Releases -> Request id %s lookup -- limit %s", ($local === true ? 'local' : 'web'), $limit ) @@ -2510,7 +2510,7 @@ class Releases if ($groupID == '') { $groupIDs = $this->groups->getActiveIDs(); } else { - $groupIDs = [['ID' => $groupID]]; + $groupIDs = [['id' => $groupID]]; } $maxSizeSetting = $this->site->maxsizetoformrelease; @@ -2520,20 +2520,20 @@ class Releases foreach ($groupIDs as $groupID) { $releases = $this->pdo->queryDirect( sprintf(" - SELECT r.guid, r.ID + SELECT r.guid, r.id FROM releases r - INNER JOIN groups g ON g.ID = r.groupID - WHERE r.groupID = %d + INNER JOIN groups g ON g.id = r.groupid + WHERE r.groupid = %d AND greatest(IFNULL(g.minsizetoformrelease, 0), %d) > 0 AND r.size < greatest(IFNULL(g.minsizetoformrelease, 0), %d)", - $groupID['ID'], + $groupID['id'], $minSizeSetting, $minSizeSetting ) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $minSizeDeleted++; } } @@ -2541,17 +2541,17 @@ class Releases if ($maxSizeSetting > 0) { $releases = $this->pdo->queryDirect( sprintf(' - SELECT ID, guid + SELECT id, guid FROM releases - WHERE groupID = %d + WHERE groupid = %d AND size > %d', - $groupID['ID'], + $groupID['id'], $maxSizeSetting ) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $maxSizeDeleted++; } } @@ -2559,20 +2559,20 @@ class Releases $releases = $this->pdo->queryDirect( sprintf(" - SELECT r.ID, r.guid + SELECT r.id, r.guid FROM releases r - INNER JOIN groups g ON g.ID = r.groupID - WHERE r.groupID = %d + INNER JOIN groups g ON g.id = r.groupid + WHERE r.groupid = %d AND greatest(IFNULL(g.minfilestoformrelease, 0), %d) > 0 AND r.totalpart < greatest(IFNULL(g.minfilestoformrelease, 0), %d)", - $groupID['ID'], + $groupID['id'], $minFilesSetting, $minFilesSetting ) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $minFilesDeleted++; } } @@ -2615,13 +2615,13 @@ class Releases if ($this->site->releaseretentiondays != 0) { $releases = $this->pdo->queryDirect( sprintf( - 'SELECT ID, guid FROM releases WHERE postdate < (NOW() - INTERVAL %d DAY)', + 'SELECT id, guid FROM releases WHERE postdate < (NOW() - INTERVAL %d DAY)', $this->site->releaseretentiondays ) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $retentionDeleted++; } } @@ -2631,13 +2631,13 @@ class Releases if ($this->site->deletepasswordedrelease == 1) { $releases = $this->pdo->queryDirect( sprintf( - 'SELECT ID, guid FROM releases WHERE passwordstatus = %d', + 'SELECT id, guid FROM releases WHERE passwordstatus = %d', \Releases::PASSWD_RAR ) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $passwordDeleted++; } } @@ -2647,13 +2647,13 @@ class Releases if ($this->site->deletepossiblerelease == 1) { $releases = $this->pdo->queryDirect( sprintf( - 'SELECT ID, guid FROM releases WHERE passwordstatus = %d', + 'SELECT id, guid FROM releases WHERE passwordstatus = %d', \Releases::PASSWD_POTENTIAL ) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $passwordDeleted++; } } @@ -2664,7 +2664,7 @@ class Releases do { $releases = $this->pdo->queryDirect( sprintf( - 'SELECT ID, guid FROM releases WHERE adddate > (NOW() - INTERVAL %d HOUR) GROUP BY name HAVING COUNT(name) > 1', + 'SELECT id, guid FROM releases WHERE adddate > (NOW() - INTERVAL %d HOUR) GROUP BY name HAVING COUNT(name) > 1', $this->crossPostTime ) ); @@ -2672,7 +2672,7 @@ class Releases if ($releases && $releases->rowCount()) { $total = $releases->rowCount(); foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $duplicateDeleted++; } } @@ -2681,11 +2681,11 @@ class Releases if ($this->completion > 0) { $releases = $this->pdo->queryDirect( - sprintf('SELECT ID, guid FROM releases WHERE completion < %d AND completion > 0', $this->completion) + sprintf('SELECT id, guid FROM releases WHERE completion < %d AND completion > 0', $this->completion) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $completionDeleted++; } } @@ -2696,12 +2696,12 @@ class Releases if (count($disabledCategories) > 0) { foreach ($disabledCategories as $disabledCategory) { $releases = $this->pdo->queryDirect( - sprintf('SELECT ID, guid FROM releases WHERE categoryID = %d', $disabledCategory['ID']) + sprintf('SELECT id, guid FROM releases WHERE categoryid = %d', $disabledCategory['id']) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { $disabledCategoryDeleted++; - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); } } } @@ -2709,11 +2709,11 @@ class Releases // Delete smaller than category minimum sizes. $categories = $this->pdo->queryDirect(' - SELECT c.ID AS id, + SELECT c.id AS id, CASE WHEN c.minsizetoformrelease = 0 THEN cp.minsizetoformrelease ELSE c.minsizetoformrelease END AS minsize FROM category c - INNER JOIN category cp ON cp.ID = c.parentID - WHERE c.parentID IS NOT NULL' + INNER JOIN category cp ON cp.id = c.parentid + WHERE c.parentid IS NOT NULL' ); if ($categories instanceof \Traversable) { @@ -2721,9 +2721,9 @@ class Releases if ($category['minsize'] > 0) { $releases = $this->pdo->queryDirect( sprintf(' - SELECT r.ID, r.guid + SELECT r.id, r.guid FROM releases r - WHERE r.categoryID = %d + WHERE r.categoryid = %d AND r.size < %d', $category['id'], $category['minsize'] @@ -2731,7 +2731,7 @@ class Releases ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $categoryMinSizeDeleted++; } } @@ -2745,17 +2745,17 @@ class Releases foreach ($genrelist as $genre) { $releases = $this->pdo->queryDirect( sprintf(' - SELECT ID, guid + SELECT id, guid FROM releases - INNER JOIN (SELECT ID AS mid FROM musicinfo WHERE musicinfo.genreID = %d) mi - ON musicinfoID = mid', - $genre['ID'] + INNER JOIN (SELECT id AS mid FROM musicinfo WHERE musicinfo.genreID = %d) mi + ON musicinfoid = mid', + $genre['id'] ) ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { $disabledGenreDeleted++; - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); } } } @@ -2765,9 +2765,9 @@ class Releases if ($this->site->miscotherretentionhours > 0) { $releases = $this->pdo->queryDirect( sprintf(' - SELECT ID, guid + SELECT id, guid FROM releases - WHERE categoryID = %d + WHERE categoryid = %d AND adddate <= NOW() - INTERVAL %d HOUR', \Category::CAT_MISC_OTHER, $this->site->miscotherretentionhours @@ -2775,7 +2775,7 @@ class Releases ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $miscRetentionDeleted++; } } @@ -2785,9 +2785,9 @@ class Releases if ($this->site->mischashedretentionhours > 0) { $releases = $this->pdo->queryDirect( sprintf(' - SELECT ID, guid + SELECT id, guid FROM releases - WHERE categoryID = %d + WHERE categoryid = %d AND adddate <= NOW() - INTERVAL %d HOUR', \Category::CAT_MISC_HASHED, $this->site->mischashedretentionhours @@ -2795,7 +2795,7 @@ class Releases ); if ($releases instanceof \Traversable) { foreach ($releases as $release) { - $this->deleteSingle(['g' => $release['guid'], 'i' => $release['ID']], $this->nzb, $this->releaseImage); + $this->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); $miscHashedDeleted++; } } @@ -2857,13 +2857,13 @@ class Releases { $cat = new \Categorize(['Settings' => $this->pdo]); $categorized = $total = 0; - $releases = $this->pdo->queryDirect(sprintf('SELECT ID, %s, groupID FROM releases %s', $type, $where)); + $releases = $this->pdo->queryDirect(sprintf('SELECT id, %s, groupid FROM releases %s', $type, $where)); if ($releases && $releases->rowCount()) { $total = $releases->rowCount(); foreach ($releases as $release) { - $catId = $cat->determineCategory($release['groupID'], $release[$type]); + $catId = $cat->determineCategory($release['groupid'], $release[$type]); $this->pdo->queryExec( - sprintf('UPDATE releases SET categoryID = %d, iscategorized = 1 WHERE ID = %d', $catId, $release['ID']) + sprintf('UPDATE releases SET categoryid = %d, iscategorized = 1 WHERE id = %d', $catId, $release['id']) ); $categorized++; if ($this->echoCLI) { @@ -2907,7 +2907,7 @@ class Releases } $this->categorizeRelease( $type, - (!empty($groupID) ? 'WHERE iscategorized = 0 AND groupID = ' . $groupID : 'WHERE iscategorized = 0') + (!empty($groupID) ? 'WHERE iscategorized = 0 AND groupid = ' . $groupID : 'WHERE iscategorized = 0') ); if ($this->echoCLI) { @@ -2926,7 +2926,7 @@ class Releases public function resetCategorize($where = '') { $this->pdo->queryExec( - sprintf('UPDATE releases SET categoryID = %d, iscategorized = 0 %s', \Category::CAT_MISC_OTHER, $where) + sprintf('UPDATE releases SET categoryid = %d, iscategorized = 0 %s', \Category::CAT_MISC_OTHER, $where) ); } diff --git a/lib/copy_this/www/lib/rottentomato.php b/lib/copy_this/www/lib/rottentomato.php index 0c18348c3..159f8a2e4 100644 --- a/lib/copy_this/www/lib/rottentomato.php +++ b/lib/copy_this/www/lib/rottentomato.php @@ -146,7 +146,7 @@ class RottenTomato * Detailed information on a specific movie specified by Id. * You can use the movies search endpoint or peruse the lists of movies/dvds to get the urls to movies. * - * @param int $ID The RT ID. + * @param int $ID The RT id. * * @return string */ @@ -159,7 +159,7 @@ class RottenTomato * Retrieves the reviews for a movie. * Results are paginated if they go past the specified page limit. * - * @param int $ID The RT ID. + * @param int $ID The RT id. * @param string $type Three different review types are possible: * "all", "top_critic" and "dvd". * "top_critic" shows all the Rotten Tomatoes designated top critics. @@ -188,7 +188,7 @@ class RottenTomato /** * Pulls the complete movie cast for a movie. * - * @param int $ID The RT ID. + * @param int $ID The RT id. * * @return string */ diff --git a/lib/copy_this/www/lib/sabnzbd.php b/lib/copy_this/www/lib/sabnzbd.php index 417fc075f..25e76c2d2 100644 --- a/lib/copy_this/www/lib/sabnzbd.php +++ b/lib/copy_this/www/lib/sabnzbd.php @@ -60,7 +60,7 @@ class SABnzbd public $integratedBool = false; /** - * ID of the current user, to send to SAB when downloading a NZB. + * id of the current user, to send to SAB when downloading a NZB. * * @var string */ @@ -85,7 +85,7 @@ class SABnzbd */ public function __construct(&$page) { - $this->uid = $page->userdata['ID']; + $this->uid = $page->userdata['id']; $this->rsstoken = $page->userdata['rsstoken']; $this->serverurl = $page->serverurl; diff --git a/lib/copy_this/www/lib/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php b/lib/copy_this/www/lib/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php index b2fd08c74..b0906c1ce 100644 --- a/lib/copy_this/www/lib/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php +++ b/lib/copy_this/www/lib/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -172,7 +172,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource } /** - * Get template's unique ID + * Get template's unique id * * @param Smarty $smarty Smarty object * @param string $resource_name template name diff --git a/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_configfileparser.php b/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_configfileparser.php index e480e500c..439c79879 100644 --- a/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_configfileparser.php +++ b/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_configfileparser.php @@ -374,7 +374,7 @@ class Smarty_Internal_Configfileparser #line 80 "smarty_internal_configfileparse public $yyTokenName = array( '$', 'OPENB', 'SECTION', 'CLOSEB', - 'DOT', 'ID', 'EQUAL', 'FLOAT', + 'DOT', 'id', 'EQUAL', 'FLOAT', 'INT', 'BOOL', 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING', 'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', 'TRIPPLE_QUOTES_END', 'NAKED_STRING', 'OTHER', 'NEWLINE', 'COMMENTSTART', 'error', @@ -402,7 +402,7 @@ class Smarty_Internal_Configfileparser #line 80 "smarty_internal_configfileparse /* 8 */ "var_list ::=", /* 9 */ - "var ::= ID EQUAL value", + "var ::= id EQUAL value", /* 10 */ "value ::= FLOAT", /* 11 */ diff --git a/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_template.php b/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_template.php index 996f1f79f..c2d18333e 100644 --- a/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_template.php +++ b/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_template.php @@ -678,7 +678,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase throw new SmartyException('Missing template name'); } $this->source = Smarty_Resource::source($this); - // cache template object under a unique ID + // cache template object under a unique id // do not cache eval resources if ($this->source->type != 'eval') { if ($this->smarty->allow_ambiguous_resources) { diff --git a/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_templatelexer.php b/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_templatelexer.php index bc10e0231..a6f5f2ae7 100644 --- a/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_templatelexer.php +++ b/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_templatelexer.php @@ -64,7 +64,7 @@ class Smarty_Internal_Templatelexer 'COMMA' => '","', 'ANDSYM' => '"&"', 'QMARK' => '"?"', - 'ID' => 'identifier', + 'id' => 'identifier', 'TEXT' => 'text', 'FAKEPHPSTARTTAG' => 'Fake PHP start tag', 'PHPSTARTTAG' => 'PHP start tag', diff --git a/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_templateparser.php b/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_templateparser.php index 5b330c285..ccf8ee63c 100644 --- a/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_templateparser.php +++ b/lib/copy_this/www/lib/smarty/sysplugins/smarty_internal_templateparser.php @@ -2144,7 +2144,7 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph 'ASPENDTAG', 'FAKEPHPSTARTTAG', 'XMLTAG', 'TEXT', 'STRIPON', 'STRIPOFF', 'BLOCKSOURCE', 'LITERALSTART', 'LITERALEND', 'LITERAL', 'LDEL', 'DOLLAR', - 'ID', 'EQUAL', 'PTR', 'LDELIF', + 'id', 'EQUAL', 'PTR', 'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC', 'TO', 'STEP', 'LDELFOREACH', 'SPACE', 'AS', 'APTR', 'LDELSETFILTER', 'SMARTYBLOCKCHILDPARENT', 'LDELSLASH', @@ -2240,23 +2240,23 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 32 */ "smartytag ::= LDEL expr attributes", /* 33 */ - "smartytag ::= LDEL DOLLAR ID EQUAL value", + "smartytag ::= LDEL DOLLAR id EQUAL value", /* 34 */ - "smartytag ::= LDEL DOLLAR ID EQUAL expr", + "smartytag ::= LDEL DOLLAR id EQUAL expr", /* 35 */ - "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes", + "smartytag ::= LDEL DOLLAR id EQUAL expr attributes", /* 36 */ "smartytag ::= LDEL varindexed EQUAL expr attributes", /* 37 */ - "smartytag ::= LDEL ID attributes", + "smartytag ::= LDEL id attributes", /* 38 */ - "smartytag ::= LDEL ID", + "smartytag ::= LDEL id", /* 39 */ - "smartytag ::= LDEL ID PTR ID attributes", + "smartytag ::= LDEL id PTR id attributes", /* 40 */ - "smartytag ::= LDEL ID modifierlist attributes", + "smartytag ::= LDEL id modifierlist attributes", /* 41 */ - "smartytag ::= LDEL ID PTR ID modifierlist attributes", + "smartytag ::= LDEL id PTR id modifierlist attributes", /* 42 */ "smartytag ::= LDELIF expr", /* 43 */ @@ -2286,19 +2286,19 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 55 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar APTR DOLLAR varvar attributes", /* 56 */ - "smartytag ::= LDELSETFILTER ID modparameters", + "smartytag ::= LDELSETFILTER id modparameters", /* 57 */ - "smartytag ::= LDELSETFILTER ID modparameters modifierlist", + "smartytag ::= LDELSETFILTER id modparameters modifierlist", /* 58 */ "smartytag ::= LDEL SMARTYBLOCKCHILDPARENT", /* 59 */ - "smartytag ::= LDELSLASH ID", + "smartytag ::= LDELSLASH id", /* 60 */ - "smartytag ::= LDELSLASH ID modifierlist", + "smartytag ::= LDELSLASH id modifierlist", /* 61 */ - "smartytag ::= LDELSLASH ID PTR ID", + "smartytag ::= LDELSLASH id PTR id", /* 62 */ - "smartytag ::= LDELSLASH ID PTR ID modifierlist", + "smartytag ::= LDELSLASH id PTR id modifierlist", /* 63 */ "attributes ::= attributes attribute", /* 64 */ @@ -2306,13 +2306,13 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 65 */ "attributes ::=", /* 66 */ - "attribute ::= SPACE ID EQUAL ID", + "attribute ::= SPACE id EQUAL id", /* 67 */ "attribute ::= ATTR expr", /* 68 */ "attribute ::= ATTR value", /* 69 */ - "attribute ::= SPACE ID", + "attribute ::= SPACE id", /* 70 */ "attribute ::= SPACE expr", /* 71 */ @@ -2334,7 +2334,7 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 79 */ "expr ::= ternary", /* 80 */ - "expr ::= DOLLAR ID COLON ID", + "expr ::= DOLLAR id COLON id", /* 81 */ "expr ::= expr MATH value", /* 82 */ @@ -2374,11 +2374,11 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 99 */ "expr ::= expr ISNOTODDBY expr", /* 100 */ - "expr ::= value INSTANCEOF ID", + "expr ::= value INSTANCEOF id", /* 101 */ "expr ::= value INSTANCEOF value", /* 102 */ - "ternary ::= OPENP expr CLOSEP QMARK DOLLAR ID COLON expr", + "ternary ::= OPENP expr CLOSEP QMARK DOLLAR id COLON expr", /* 103 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr", /* 104 */ @@ -2402,7 +2402,7 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 113 */ "value ::= DOT INTEGER", /* 114 */ - "value ::= ID", + "value ::= id", /* 115 */ "value ::= function", /* 116 */ @@ -2412,7 +2412,7 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 118 */ "value ::= doublequoted_with_quotes", /* 119 */ - "value ::= ID DOUBLECOLON static_class_access", + "value ::= id DOUBLECOLON static_class_access", /* 120 */ "value ::= varindexed DOUBLECOLON static_class_access", /* 121 */ @@ -2422,13 +2422,13 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 123 */ "variable ::= varindexed", /* 124 */ - "variable ::= DOLLAR varvar AT ID", + "variable ::= DOLLAR varvar AT id", /* 125 */ "variable ::= object", /* 126 */ - "variable ::= HATCH ID HATCH", + "variable ::= HATCH id HATCH", /* 127 */ - "variable ::= HATCH ID HATCH arrayindex", + "variable ::= HATCH id HATCH arrayindex", /* 128 */ "variable ::= HATCH variable HATCH", /* 129 */ @@ -2442,17 +2442,17 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 133 */ "indexdef ::= DOT DOLLAR varvar", /* 134 */ - "indexdef ::= DOT DOLLAR varvar AT ID", + "indexdef ::= DOT DOLLAR varvar AT id", /* 135 */ - "indexdef ::= DOT ID", + "indexdef ::= DOT id", /* 136 */ "indexdef ::= DOT INTEGER", /* 137 */ "indexdef ::= DOT LDEL expr RDEL", /* 138 */ - "indexdef ::= OPENB ID CLOSEB", + "indexdef ::= OPENB id CLOSEB", /* 139 */ - "indexdef ::= OPENB ID DOT ID CLOSEB", + "indexdef ::= OPENB id DOT id CLOSEB", /* 140 */ "indexdef ::= OPENB expr CLOSEB", /* 141 */ @@ -2462,7 +2462,7 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 143 */ "varvar ::= varvar varvarele", /* 144 */ - "varvarele ::= ID", + "varvarele ::= id", /* 145 */ "varvarele ::= LDEL expr RDEL", /* 146 */ @@ -2472,21 +2472,21 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 148 */ "objectchain ::= objectchain objectelement", /* 149 */ - "objectelement ::= PTR ID arrayindex", + "objectelement ::= PTR id arrayindex", /* 150 */ "objectelement ::= PTR DOLLAR varvar arrayindex", /* 151 */ "objectelement ::= PTR LDEL expr RDEL arrayindex", /* 152 */ - "objectelement ::= PTR ID LDEL expr RDEL arrayindex", + "objectelement ::= PTR id LDEL expr RDEL arrayindex", /* 153 */ "objectelement ::= PTR method", /* 154 */ - "function ::= ID OPENP params CLOSEP", + "function ::= id OPENP params CLOSEP", /* 155 */ - "method ::= ID OPENP params CLOSEP", + "method ::= id OPENP params CLOSEP", /* 156 */ - "method ::= DOLLAR ID OPENP params CLOSEP", + "method ::= DOLLAR id OPENP params CLOSEP", /* 157 */ "params ::= params COMMA expr", /* 158 */ @@ -2498,9 +2498,9 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 161 */ "modifierlist ::= modifier modparameters", /* 162 */ - "modifier ::= VERT AT ID", + "modifier ::= VERT AT id", /* 163 */ - "modifier ::= VERT ID", + "modifier ::= VERT id", /* 164 */ "modparameters ::= modparameters modparameter", /* 165 */ @@ -2514,11 +2514,11 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 169 */ "static_class_access ::= method objectchain", /* 170 */ - "static_class_access ::= ID", + "static_class_access ::= id", /* 171 */ - "static_class_access ::= DOLLAR ID arrayindex", + "static_class_access ::= DOLLAR id arrayindex", /* 172 */ - "static_class_access ::= DOLLAR ID arrayindex objectchain", + "static_class_access ::= DOLLAR id arrayindex objectchain", /* 173 */ "ifcond ::= EQUALS", /* 174 */ @@ -2554,7 +2554,7 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph /* 189 */ "arrayelement ::= value APTR expr", /* 190 */ - "arrayelement ::= ID APTR expr", + "arrayelement ::= id APTR expr", /* 191 */ "arrayelement ::= expr", /* 192 */ diff --git a/lib/copy_this/www/lib/smarty/sysplugins/smarty_resource.php b/lib/copy_this/www/lib/smarty/sysplugins/smarty_resource.php index 06b7aaa72..34af28dbe 100644 --- a/lib/copy_this/www/lib/smarty/sysplugins/smarty_resource.php +++ b/lib/copy_this/www/lib/smarty/sysplugins/smarty_resource.php @@ -653,7 +653,7 @@ class Smarty_Template_Source public $template_parser_class = null; /** - * Unique Template ID + * Unique Template id * * @var string */ diff --git a/lib/copy_this/www/lib/sphinx.php b/lib/copy_this/www/lib/sphinx.php index 44a5463f8..45a08fd25 100644 --- a/lib/copy_this/www/lib/sphinx.php +++ b/lib/copy_this/www/lib/sphinx.php @@ -512,14 +512,14 @@ class Sphinx * in real time. * * If ``$startingID`` is negative, then the last successfully indexed - * release will be identified and this will resume indexing from that ID - * onwards. If this is a positive value, then only releases with an ID + * release will be identified and this will resume indexing from that id + * onwards. If this is a positive value, then only releases with an id * larger than or equal to this will be indexed. In order to re-index * everything, pass 0. * * Returns the number of of NZBs that were successfully indexed. * - * @param int $startingID The ID of the first release to index. + * @param int $startingID The id of the first release to index. * @return int * */ @@ -560,15 +560,15 @@ class Sphinx } // Get the number of NZBs to do - $sql = "SELECT COUNT(ID) as num FROM releases WHERE ID >= %d"; + $sql = "SELECT COUNT(id) as num FROM releases WHERE id >= %d"; $row = $ndb->queryOneRow(sprintf($sql, $startingID)); $recordCount = (int)$row["num"]; // Start looping over the releases and build the NZB index - printf("starting from ID %d\n", $startingID); + printf("starting from id %d\n", $startingID); $numIndexed = 0; - $sql = "SELECT ID, guid FROM releases " - . "WHERE ID >= %d ORDER BY ID ASC"; + $sql = "SELECT id, guid FROM releases " + . "WHERE id >= %d ORDER BY id ASC"; $result = $ndb->queryDirect(sprintf($sql, $startingID)); $startTime = microtime(true); while ($row = $ndb->getAssocArray($result)) { @@ -586,7 +586,7 @@ class Sphinx } } $sql = sprintf("REPLACE INTO nzbs VALUES (%d, %s, %d)", - $row['ID'], $ndb->escapeString($fileNames), + $row['id'], $ndb->escapeString($fileNames), $fileCount); if (!mysqli_query($sdb, $sql)) { printf("error indexing NZB: %s\n", mysqli_error($sdb)); @@ -616,7 +616,7 @@ class Sphinx * be the data from the index--this is not guaranteed to be the most recent * data that is in the MySQL database. If you absolutely need the most * recent data from MySQL, then ``$lookupQuery`` should be a valid SQL - * query that has contains "releases.ID IN (%s)". + * query that has contains "releases.id IN (%s)". * * @param string $sphinxQuery The raw SphinxQL query. * @param string $lookupQuery The SQL to use to lookup the results. @@ -733,7 +733,7 @@ class Sphinx if ($lookup) { // Since we're going to look up the data from MySQL, we don't need // to get all the fields from Sphinx. - $select = "ID, name "; + $select = "id, name "; } else { $select = "* "; } @@ -824,8 +824,8 @@ class Sphinx // Inlcude all children $children = $categ->getChildren($category); foreach ($children as $child) { - if (!in_array($child["ID"], $categoryIDs)) { - $categoryIDs[] = $child["ID"]; + if (!in_array($child["id"], $categoryIDs)) { + $categoryIDs[] = $child["id"]; } } } @@ -835,7 +835,7 @@ class Sphinx // Only include the category filter if we created one. if ($categoryIDs) { - $where[] = sprintf("categoryID IN (%s)", implode(",", $categoryIDs)); + $where[] = sprintf("categoryid IN (%s)", implode(",", $categoryIDs)); } // Filter on postdate. @@ -846,7 +846,7 @@ class Sphinx // Categories to exclude. if (count($excludedcats) > 0) { - $where[] = sprintf("categoryID NOT IN (%s)", implode(",", + $where[] = sprintf("categoryid NOT IN (%s)", implode(",", $excludedcats)); } @@ -854,15 +854,15 @@ class Sphinx if ($grp) { foreach($grp as $i => $g) { if (strpos($g, "a.b.") !== false) { - $sql = sprintf("SELECT ID FROM groups " + $sql = sprintf("SELECT id FROM groups " ."WHERE name = %s", $ndb->escapeString(str_replace("a.b.", "alt.binaries.", $g))); $row = $ndb->queryOneRow($sql); - $grp[$i] = $row["ID"]; + $grp[$i] = $row["id"]; } } - $where[] = sprintf("groupID IN (%s)", implode(",", $grp)); + $where[] = sprintf("groupid IN (%s)", implode(",", $grp)); } // Order the results. @@ -927,29 +927,29 @@ class Sphinx if ($lookup) { $lookupQuery .= "SELECT releases.*, " . "CONCAT(cp.title, ' > ', c.title) AS category_name, " - . "CONCAT(cp.ID, ',', c.ID) AS category_ids, " - . "groups.name as group_name, rn.ID AS nfoID, " - . "re.releaseID as reID, cp.ID AS categoryParentID, " + . "CONCAT(cp.id, ',', c.id) AS category_ids, " + . "groups.name as group_name, rn.id AS nfoid, " + . "re.releaseid as reID, cp.id AS categoryParentID, " . "pre.ctime, pre.nuketype, " - . "COALESCE(movieinfo.ID, 0) AS movieinfoID " + . "COALESCE(movieinfo.id, 0) AS movieinfoID " . "FROM releases " . "LEFT OUTER JOIN movieinfo " - . "ON movieinfo.imdbID = releases.imdbID " + . "ON movieinfo.imdbid = releases.imdbid " . "LEFT OUTER JOIN releasevideo re " - . "ON re.releaseID = releases.ID " + . "ON re.releaseid = releases.id " . "LEFT OUTER JOIN releasenfo rn " - . "ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL " + . "ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL " . "LEFT OUTER JOIN groups " - . "ON groups.ID = releases.groupID " + . "ON groups.id = releases.groupid " . "LEFT OUTER JOIN category c " - . "ON c.ID = releases.categoryID " + . "ON c.id = releases.categoryid " . "LEFT OUTER JOIN category cp " - . "ON cp.ID = c.parentID " + . "ON cp.id = c.parentid " . "LEFT OUTER JOIN predb pre " - . "ON pre.ID = releases.preID " + . "ON pre.id = releases.preID " . "WHERE releases.passwordstatus <= (SELECT value " . "FROM site WHERE setting='showpasswordedrelease') " - . "AND releases.ID IN (%s)"; + . "AND releases.id IN (%s)"; } $where = array(); @@ -1008,23 +1008,23 @@ class Sphinx if ($lookup) { $lookupQuery .= "SELECT releases.*, " . "CONCAT(cp.title, ' > ', c.title) AS category_name, " - . "CONCAT(cp.ID, ',', c.ID) AS category_ids, " - . "groups.name AS group_name, rn.ID AS nfoID, " - . "re.releaseID AS reID " + . "CONCAT(cp.id, ',', c.id) AS category_ids, " + . "groups.name AS group_name, rn.id AS nfoid, " + . "re.releaseid AS reID " . "FROM releases " . "LEFT OUTER JOIN category c " - . "ON c.ID = releases.categoryID " + . "ON c.id = releases.categoryid " . "LEFT OUTER JOIN groups " - . "ON groups.ID = releases.groupID " + . "ON groups.id = releases.groupid " . "LEFT OUTER JOIN releasevideo re " - . "ON re.releaseID = releases.ID " + . "ON re.releaseid = releases.id " . "LEFT OUTER JOIN releasenfo rn " - . "ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL " + . "ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL " . "LEFT OUTER JOIN category cp " - . "ON cp.ID = c.parentID " + . "ON cp.id = c.parentid " . "WHERE releases.passwordstatus <= (SELECT value " . "FROM site WHERE setting='showpasswordedrelease') " - . "AND releases.ID IN (%s)"; + . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, $cat, $offset, $limit, $order, $maxage, array(), array(), $indexes, @@ -1045,7 +1045,7 @@ class Sphinx $order = array("postdate", "desc"); $where = array(); if ($imdbId != "-1" && is_numeric($imdbId)) { - // Pad ID with zeros just in case. + // Pad id with zeros just in case. $imdbId = str_pad($imdbId, 7, "0", STR_PAD_LEFT); $where[] = sprintf("imdbid = %d", $imdbId); } else { @@ -1075,22 +1075,22 @@ class Sphinx . "movieinfo.cover AS moi_cover, " . "movieinfo.backdrop AS moi_backdrop, " . "CONCAT(cp.title, ' > ', c.title) AS category_name, " - . "CONCAT(cp.ID, ',', c.ID) AS category_ids, " + . "CONCAT(cp.id, ',', c.id) AS category_ids, " . "groups.name AS group_name, " - . "rn.ID AS nfoID FROM releases " + . "rn.id AS nfoid FROM releases " . "LEFT OUTER JOIN groups " - . "ON groups.ID = releases.groupID " + . "ON groups.id = releases.groupid " . "LEFT OUTER JOIN category c " - . "ON c.ID = releases.categoryID " + . "ON c.id = releases.categoryid " . "LEFT OUTER JOIN releasenfo rn " - . "ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL " + . "ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL " . "LEFT OUTER JOIN category cp " - . "ON cp.ID = c.parentID " + . "ON cp.id = c.parentid " . "LEFT OUTER JOIN movieinfo " - . "ON releases.imdbID = movieinfo.imdbID " + . "ON releases.imdbid = movieinfo.imdbid " . "WHERE releases.passwordstatus <= (SELECT value " . "FROM site WHERE setting='showpasswordedrelease') " - . "AND releases.ID IN (%s)"; + . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, $cat, $offset, $limit, $order, $maxage, array(), array(), $indexes, @@ -1151,24 +1151,24 @@ class Sphinx . "musicinfo.artist AS mi_artist, " . "genres.title AS music_genrename, " . "CONCAT(cp.title, ' > ', c.title) AS category_name, " - . "CONCAT(cp.ID, ',', c.ID) AS category_ids, " + . "CONCAT(cp.id, ',', c.id) AS category_ids, " . "groups.name AS group_name, " - . "rn.ID AS nfoID FROM releases " + . "rn.id AS nfoid FROM releases " . "LEFT OUTER JOIN musicinfo " - . "ON musicinfo.ID = releases.musicinfoID " + . "ON musicinfo.id = releases.musicinfoid " . "LEFT JOIN genres " - . "ON genres.ID = musicinfo.genreID " + . "ON genres.id = musicinfo.genreID " . "LEFT OUTER JOIN groups " - . "ON groups.ID = releases.groupID " + . "ON groups.id = releases.groupid " . "LEFT OUTER JOIN category c " - . "ON c.ID = releases.categoryID " + . "ON c.id = releases.categoryid " . "LEFT OUTER JOIN releasenfo rn " - . "ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL " + . "ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL " . "LEFT OUTER JOIN category cp " - . "ON cp.ID = c.parentID " + . "ON cp.id = c.parentid " . "WHERE releases.passwordstatus <= (SELECT value " . "FROM site WHERE setting='showpasswordedrelease') " - . "AND releases.ID IN (%s)"; + . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, $cat, $offset, $limit, $order, $maxage, array(), array(), $indexes, @@ -1211,25 +1211,25 @@ class Sphinx . "bookinfo.author AS bi_author, " . "genres.title AS book_genrename, " . "concat(cp.title, ' > ', c.title) AS category_name, " - . "concat(cp.ID, ',', c.ID) AS category_ids, " + . "concat(cp.id, ',', c.id) AS category_ids, " . "groups.name AS group_name, " - . "rn.ID AS nfoID " + . "rn.id AS nfoid " . "FROM releases " . "LEFT OUTER JOIN bookinfo " - . "ON bookinfo.ID = releases.bookinfoID " + . "ON bookinfo.id = releases.bookinfoid " . "LEFT JOIN genres " - . "ON genres.ID = bookinfo.genreID " + . "ON genres.id = bookinfo.genreID " . "LEFT OUTER JOIN groups " - . "ON groups.ID = releases.groupID " + . "ON groups.id = releases.groupid " . "LEFT OUTER JOIN category c " - . "ON c.ID = releases.categoryID " + . "ON c.id = releases.categoryid " . "LEFT OUTER JOIN releasenfo rn " - . "ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL " + . "ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL " . "LEFT OUTER JOIN category cp " - . "ON cp.ID = c.parentID " + . "ON cp.id = c.parentid " . "WHERE releases.passwordstatus <= (SELECT value " . "FROM site WHERE setting='showpasswordedrelease')" - . "AND releases.ID IN (%s)"; + . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, array(-1), $offset, $limit, @@ -1267,21 +1267,21 @@ class Sphinx if ($lookup) { $lookupQuery .= "SELECT releases.*, " . "CONCAT(cp.title, ' > ', c.title) AS category_name, " - . "CONCAT(cp.ID, ',', c.ID) AS category_ids, " + . "CONCAT(cp.id, ',', c.id) AS category_ids, " . "groups.name AS group_name, " - . "rn.ID AS nfoID " + . "rn.id AS nfoid " . "FROM releases " . "LEFT OUTER JOIN category c " - . "ON c.ID = releases.categoryID " + . "ON c.id = releases.categoryid " . "LEFT OUTER JOIN groups " - . "ON groups.ID = releases.groupID " + . "ON groups.id = releases.groupid " . "LEFT OUTER JOIN releasenfo rn " - . "ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL " + . "ON rn.releaseid = releases.id AND rn.nfo IS NOT NULL " . "LEFT OUTER JOIN category cp " - . "ON cp.ID = c.parentID " + . "ON cp.id = c.parentid " . "WHERE releases.passwordstatus <= (SELECT value " . "FROM site WHERE setting='showpasswordedrelease')" - . "AND releases.ID IN (%s)"; + . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, array(-1), $offset, $limit, $order, $maxage, array(), array(), @@ -1307,8 +1307,8 @@ class Sphinx $lookupQuery = "SELECT predb.*, r.guid " . "FROM predb " . "LEFT OUTER JOIN releases r " - . "ON r.preID = predb.ID " - . "WHERE predb.ID IN (%s) " + . "ON r.preID = predb.id " + . "WHERE predb.id IN (%s) " . "ORDER BY predb.ctime DESC"; return $this->searchDirect($sphinxQuery, $lookupQuery, 120); } diff --git a/lib/copy_this/www/lib/spotnab.php b/lib/copy_this/www/lib/spotnab.php index 7ddf00120..04ab823ad 100644 --- a/lib/copy_this/www/lib/spotnab.php +++ b/lib/copy_this/www/lib/spotnab.php @@ -1331,14 +1331,14 @@ class SpotNab { // Comments $sql_new_cmt = "INSERT INTO releasecomment (". - "id, sourceID, username, userid, gid, cid, isvisible, ". + "id, sourceid, username, userid, gid, cid, isvisible, ". "releaseid, `text`, createddate, issynced, nzb_guid) VALUES (". "NULL, %d, %s, 0, %s, %s, %d, 0, %s, %s, 1, %s)"; $sql_upd_cmt = "UPDATE releasecomment SET ". "isvisible = %d, `text` = %s". - "WHERE sourceID = %d AND gid = %s AND cid = %s AND nzb_guid = %s"; + "WHERE sourceid = %d AND gid = %s AND cid = %s AND nzb_guid = %s"; $sql_fnd_cmt = "SELECT count(id) as cnt FROM releasecomment ". - "WHERE sourceID = %d AND gid = %s AND cid = %s"; + "WHERE sourceid = %d AND gid = %s AND cid = %s"; // Sync Times $sql_sync = "UPDATE spotnabsources SET lastupdate = %s ". @@ -2250,7 +2250,7 @@ class SpotNab { ."JOIN releases r ON r.id = rc.releaseid AND rc.releaseid != 0 " ."JOIN users u ON rc.userid = u.id AND rc.userid != 0 " ."WHERE r.gid IS NOT NULL " - ."AND sourceID = 0 AND issynced = 0 " + ."AND sourceid = 0 AND issynced = 0 " ."LIMIT %d", $limit); $res = $db->query($sql); diff --git a/lib/copy_this/www/lib/thetvdb.php b/lib/copy_this/www/lib/thetvdb.php index 201cf43cc..a16fab488 100644 --- a/lib/copy_this/www/lib/thetvdb.php +++ b/lib/copy_this/www/lib/thetvdb.php @@ -40,11 +40,11 @@ class TheTVDB $rating = "null"; $db->queryInsert(sprintf("INSERT INTO thetvdb - (tvdbID, actors, airsday, airstime, contentrating, firstaired, genre, imdbID, network, overview, rating, ratingcount, runtime, seriesname, status, createddate) + (tvdbid, actors, airsday, airstime, contentrating, firstaired, genre, imdbid, network, overview, rating, ratingcount, runtime, seriesname, status, createddate) VALUES (%d, %s, %s, %s, %s, %s, %s, %d, %s, %s, %F, %d, %d, %s, %s, now())", - $TheTVDBAPIArray['tvdbID'], $db->escapeString($TheTVDBAPIArray['actors']), $db->escapeString($TheTVDBAPIArray['airsday']), + $TheTVDBAPIArray['tvdbid'], $db->escapeString($TheTVDBAPIArray['actors']), $db->escapeString($TheTVDBAPIArray['airsday']), $airstime, $db->escapeString($TheTVDBAPIArray['contentrating']), $firstaired, - $db->escapeString($TheTVDBAPIArray['genre']), $TheTVDBAPIArray['imdbID'], $db->escapeString($TheTVDBAPIArray['network']), $db->escapeString($TheTVDBAPIArray['overview']), + $db->escapeString($TheTVDBAPIArray['genre']), $TheTVDBAPIArray['imdbid'], $db->escapeString($TheTVDBAPIArray['network']), $db->escapeString($TheTVDBAPIArray['overview']), $rating, $TheTVDBAPIArray['ratingcount'], $TheTVDBAPIArray['runtime'], $db->escapeString($TheTVDBAPIArray['seriesname']), $db->escapeString($TheTVDBAPIArray['status']))); } @@ -59,10 +59,10 @@ class TheTVDB continue; $db->queryInsert(sprintf('INSERT INTO episodeinfo - (rageID, tvdbID, imdbID, showtitle, airdate, fullep, eptitle, director, gueststars, overview, rating, writer, epabsolute) + (rageid, tvdbid, imdbid, showtitle, airdate, fullep, eptitle, director, gueststars, overview, rating, writer, epabsolute) VALUES (0, %d, %d, %s, %s, %s, %s, %s, %s, %s, %F, %s, %d) ON DUPLICATE KEY UPDATE - tvdbID=%1$d, imdbID=%2$d, showtitle=%3$s, airdate=%4$s, fullep=%5$s, eptitle=%6$s, director=%7$s, + tvdbid=%1$d, imdbid=%2$d, showtitle=%3$s, airdate=%4$s, fullep=%5$s, eptitle=%6$s, director=%7$s, gueststars=%8$s, overview=%9$s, rating=%10$F, writer=%11$s, epabsolute=%12$s', $TheTVDBAPIArray['episodetvdbID'][$i], $TheTVDBAPIArray['episodeimdbID'][$i], $db->escapeString($TheTVDBAPIArray['seriesname']), $db->escapeString($airdate), $db->escapeString(str_pad($TheTVDBAPIArray['episodeseason'][$i], 2, '0', STR_PAD_LEFT).'x'.str_pad($TheTVDBAPIArray['episodenumber'][$i], 2, '0', STR_PAD_LEFT)), @@ -91,9 +91,9 @@ class TheTVDB $rating = "null"; $sql = sprintf('UPDATE thetvdb - SET actors=%s, airsday=%s, airstime=%s, contentrating=%s, firstaired=%s, genre=%s, imdbID=%d, network=%s, + SET actors=%s, airsday=%s, airstime=%s, contentrating=%s, firstaired=%s, genre=%s, imdbid=%d, network=%s, overview=%s, rating=%s, ratingcount=%d, runtime=%d, seriesname=%s, status=%s, createddate=now() - WHERE tvdbID = %d', $db->escapeString($actors), $db->escapeString($airsday), $airstime, $db->escapeString($contentrating), + WHERE tvdbid = %d', $db->escapeString($actors), $db->escapeString($airsday), $airstime, $db->escapeString($contentrating), $firstaired, $db->escapeString($genre), $imdbID, $db->escapeString($network), $db->escapeString($overview), $rating, $ratingcount, $runtime, $db->escapeString($seriesname), $db->escapeString($status), $tvdbID); @@ -104,20 +104,20 @@ class TheTVDB { $db = new DB(); - $db->queryExec(sprintf("DELETE FROM thetvdb WHERE tvdbID = %d", $tvdbID)); + $db->queryExec(sprintf("DELETE FROM thetvdb WHERE tvdbid = %d", $tvdbID)); } public function addEmptySeries($seriesname) { $db = new DB(); - $db->queryInsert(sprintf("INSERT INTO thetvdb (tvdbID, seriesname, createddate) VALUES (0, %s, now())", $db->escapeString($seriesname))); + $db->queryInsert(sprintf("INSERT INTO thetvdb (tvdbid, seriesname, createddate) VALUES (0, %s, now())", $db->escapeString($seriesname))); } public function getSeriesInfoByID($tvdbID) { $db = new DB(); - return $db->queryOneRow(sprintf("SELECT * FROM thetvdb WHERE tvdbID = %d", $tvdbID)); + return $db->queryOneRow(sprintf("SELECT * FROM thetvdb WHERE tvdbid = %d", $tvdbID)); } public function getSeriesInfoByName($seriesname) @@ -136,7 +136,7 @@ class TheTVDB if ($seriesname != '') $rsql .= sprintf("AND thetvdb.seriesname LIKE %s ", $db->escapeString("%".$seriesname."%")); - return $db->query(sprintf(" SELECT ID, tvdbID, seriesname, overview FROM thetvdb WHERE 1=1 %s AND tvdbID > %d ORDER BY tvdbID ASC".$limit, $rsql, 0)); + return $db->query(sprintf(" SELECT id, tvdbid, seriesname, overview FROM thetvdb WHERE 1=1 %s AND tvdbid > %d ORDER BY tvdbid ASC".$limit, $rsql, 0)); } public function getSeriesCount($seriesname='') @@ -147,7 +147,7 @@ class TheTVDB if ($seriesname != '') $rsql .= sprintf("AND thetvdb.seriesname LIKE %s ", $db->escapeString("%".$seriesname."%")); - $res = $db->queryOneRow(sprintf("SELECT count(ID) AS num FROM thetvdb WHERE 1=1 %s ", $rsql)); + $res = $db->queryOneRow(sprintf("SELECT count(id) AS num FROM thetvdb WHERE 1=1 %s ", $rsql)); return $res["num"]; } @@ -180,14 +180,14 @@ class TheTVDB echo 'TheTVDB : '.$seriesName.' '.$fullep." Not found\n"; $db = new DB(); - $db->queryExec(sprintf('UPDATE releases SET episodeinfoID = -2 WHERE ID = %d', $releaseID)); + $db->queryExec(sprintf('UPDATE releases SET episodeinfoid = -2 WHERE id = %d', $releaseID)); } public function processReleases() { $db = new DB(); - $results = $db->queryDirect(sprintf("SELECT ID, searchname, rageID, anidbid, seriesfull, season, episode, tvtitle FROM releases WHERE episodeinfoID IS NULL AND categoryID IN ( SELECT ID FROM category WHERE parentID = %d ) LIMIT 150", Category::CAT_PARENT_TV)); + $results = $db->queryDirect(sprintf("SELECT id, searchname, rageid, anidbid, seriesfull, season, episode, tvtitle FROM releases WHERE episodeinfoid IS NULL AND categoryid IN ( SELECT id FROM category WHERE parentid = %d ) LIMIT 150", Category::CAT_PARENT_TV)); if ($db->getNumRows($results) > 0) { @@ -199,8 +199,8 @@ class TheTVDB unset($TheTVDBAPIArray, $episodeArray, $fullep, $epabsolute, $additionalSql); $seriesName = ''; - if($arr['rageID'] > 0) { - $seriesName = $db->queryOneRow(sprintf('SELECT releasetitle AS seriesName FROM tvrage WHERE rageID = %d', $arr['rageID'])); + if($arr['rageid'] > 0) { + $seriesName = $db->queryOneRow(sprintf('SELECT releasetitle AS seriesName FROM tvrage WHERE rageid = %d', $arr['rageid'])); } elseif($arr['anidbid'] > 0) { $seriesName = $db->queryOneRow(sprintf('SELECT title AS seriesName FROM anidb WHERE anidbid = %d', $arr['anidbid'])); @@ -208,7 +208,7 @@ class TheTVDB if(empty($seriesName) || !$seriesName) { - $this->notFound($seriesName, "", $arr['ID'], false); + $this->notFound($seriesName, "", $arr['id'], false); continue; } @@ -233,30 +233,30 @@ class TheTVDB else { $this->addEmptySeries($seriesName); - $this->notFound($seriesName, $fullep, $arr['ID']); + $this->notFound($seriesName, $fullep, $arr['id']); continue; } } else { $this->addEmptySeries($seriesName); - $this->notFound($seriesName, $fullep, $arr['ID']); + $this->notFound($seriesName, $fullep, $arr['id']); continue; } } - else if($TheTVDBAPIArray['tvdbID'] > 0 && ((time() - strtotime($TheTVDBAPIArray['createddate'])) > 604800)) + else if($TheTVDBAPIArray['tvdbid'] > 0 && ((time() - strtotime($TheTVDBAPIArray['createddate'])) > 604800)) { - $TheTVDBAPIArray = $this->TheTVDBAPI($TheTVDBAPIArray['tvdbID'], $seriesName); + $TheTVDBAPIArray = $this->TheTVDBAPI($TheTVDBAPIArray['tvdbid'], $seriesName); - $this->updateSeries($TheTVDBAPIArray['tvdbID'], $TheTVDBAPIArray['actors'], $TheTVDBAPIArray['airsday'], + $this->updateSeries($TheTVDBAPIArray['tvdbid'], $TheTVDBAPIArray['actors'], $TheTVDBAPIArray['airsday'], $TheTVDBAPIArray['airstime'], $TheTVDBAPIArray['contentrating'], $TheTVDBAPIArray['firstaired'], $TheTVDBAPIArray['genre'], - $TheTVDBAPIArray['imdbID'], $TheTVDBAPIArray['network'], $TheTVDBAPIArray['overview'], $TheTVDBAPIArray['rating'], + $TheTVDBAPIArray['imdbid'], $TheTVDBAPIArray['network'], $TheTVDBAPIArray['overview'], $TheTVDBAPIArray['rating'], $TheTVDBAPIArray['ratingcount'], $TheTVDBAPIArray['runtime'], $TheTVDBAPIArray['seriesname'], $TheTVDBAPIArray['status']); $this->addEpisodes($TheTVDBAPIArray); } - if($TheTVDBAPIArray['tvdbID'] > 0) + if($TheTVDBAPIArray['tvdbid'] > 0) { $epabsolute = '0'; if($arr['anidbid'] > 0) @@ -274,13 +274,13 @@ class TheTVDB $episodeArray = $Episode->getEpisodeInfoByName($seriesName, $fullep, (string) $epabsolute); if(!$episodeArray) { - $this->notFound($seriesName, $fullep, $arr['ID']); + $this->notFound($seriesName, $fullep, $arr['id']); continue; } } else { - $this->notFound($seriesName, $fullep, $arr['ID']); + $this->notFound($seriesName, $fullep, $arr['id']); continue; } @@ -293,12 +293,12 @@ class TheTVDB $db->escapeString($episodeArray['airdate'])); } - $db->queryExec(sprintf('UPDATE releases SET tvdbID = %d, episodeinfoID = %d %s WHERE ID = %d', - $TheTVDBAPIArray['tvdbID'], $episodeArray['ID'], $additionalSql, $arr['ID'])); + $db->queryExec(sprintf('UPDATE releases SET tvdbid = %d, episodeinfoid = %d %s WHERE id = %d', + $TheTVDBAPIArray['tvdbid'], $episodeArray['id'], $additionalSql, $arr['id'])); if($this->echooutput) { - echo 'TheTVDB : '.$seriesName.' '.$fullep." returned ".$episodeArray['tvdbID']."\n"; + echo 'TheTVDB : '.$seriesName.' '.$fullep." returned ".$episodeArray['tvdbid']."\n"; } } } @@ -331,14 +331,14 @@ class TheTVDB } $TheTVDBAPIArray = array( - 'tvdbID' => $seriesid, + 'tvdbid' => $seriesid, 'actors' => preg_replace('/^\||\|$/', '', (string) $TheTVDBAPIXML->Series->Actors), 'airsday' => preg_replace('/^\||\|$/', '', (string) $TheTVDBAPIXML->Series->Airs_DayOfWeek), 'airstime' => preg_replace('/^\||\|$/', '', (string) $TheTVDBAPIXML->Series->Airs_Time), 'contentrating' => (string) $TheTVDBAPIXML->Series->ContentRating, 'firstaired' => (string) $TheTVDBAPIXML->Series->FirstAired, 'genre' => preg_replace('/^\||\|$/', '', (string) $TheTVDBAPIXML->Series->Genre), - 'imdbID' => (int) preg_replace('/^[^\d]+/', '', (string) $TheTVDBAPIXML->Series->IMDB_ID), + 'imdbid' => (int) preg_replace('/^[^\d]+/', '', (string) $TheTVDBAPIXML->Series->IMDB_ID), 'network' => (string) $TheTVDBAPIXML->Series->Network, 'overview' => (string) $TheTVDBAPIXML->Series->Overview, 'rating' => (float) $TheTVDBAPIXML->Series->Rating, diff --git a/lib/copy_this/www/lib/tvrage.php b/lib/copy_this/www/lib/tvrage.php index df37547ac..7f9911ad2 100644 --- a/lib/copy_this/www/lib/tvrage.php +++ b/lib/copy_this/www/lib/tvrage.php @@ -36,23 +36,23 @@ class TvRage public function getByID($id) { $db = new DB(); - return $db->queryOneRow(sprintf("select * from tvrage where ID = %d", $id )); + return $db->queryOneRow(sprintf("select * from tvrage where id = %d", $id )); } public function getByRageID($id) { $db = new DB(); - return $db->query(sprintf("select * from tvrage where rageID = %d", $id )); + return $db->query(sprintf("select * from tvrage where rageid = %d", $id )); } public function getByTitle($title) { // check if we already have an entry for this show $db = new DB(); - $sql = sprintf("SELECT rageID from tvrage where (releasetitle = %s or releasetitle = %s)", $db->escapeString($title), $db->escapeString(str_replace(' and ', ' & ', $title))); + $sql = sprintf("SELECT rageid from tvrage where (releasetitle = %s or releasetitle = %s)", $db->escapeString($title), $db->escapeString(str_replace(' and ', ' & ', $title))); $res = $db->queryOneRow($sql); if ($res) - return $res["rageID"]; + return $res["rageid"]; return false; } @@ -62,7 +62,7 @@ class TvRage $releasename = str_replace(array('.','_'), array(' ',' '), $releasename); $db = new DB(); - return $db->queryInsert(sprintf("insert into tvrage (rageID, releasetitle, description, genre, country, createddate, imgdata) values (%d, %s, %s, %s, %s, now(), %s)", + return $db->queryInsert(sprintf("insert into tvrage (rageid, releasetitle, description, genre, country, createddate, imgdata) values (%d, %s, %s, %s, %s, now(), %s)", $rageid, $db->escapeString($releasename), $db->escapeString($desc), $db->escapeString($genre), $db->escapeString($country), $db->escapeString($imgbytes))); } @@ -73,14 +73,14 @@ class TvRage if ($imgbytes != "") $imgbytes = sprintf(", imgdata = %s", $db->escapeString($imgbytes)); - $db->queryExec(sprintf("update tvrage set rageID = %d, releasetitle = %s, description = %s, genre = %s, country = %s %s where ID = %d", + $db->queryExec(sprintf("update tvrage set rageid = %d, releasetitle = %s, description = %s, genre = %s, country = %s %s where id = %d", $rageid, $db->escapeString($releasename), $db->escapeString($desc), $db->escapeString($genre), $db->escapeString($country), $imgbytes, $id )); } public function delete($id) { $db = new DB(); - return $db->queryExec(sprintf("DELETE from tvrage where ID = %d",$id)); + return $db->queryExec(sprintf("DELETE from tvrage where id = %d",$id)); } public function getRange($start, $num, $ragename="") @@ -96,7 +96,7 @@ class TvRage if ($ragename != "") $rsql .= sprintf("and tvrage.releasetitle like %s ", $db->escapeString("%".$ragename."%")); - return $db->query(sprintf(" SELECT ID, rageID, releasetitle, description, createddate from tvrage where 1=1 %s order by rageID asc".$limit, $rsql)); + return $db->query(sprintf(" SELECT id, rageid, releasetitle, description, createddate from tvrage where 1=1 %s order by rageid asc".$limit, $rsql)); } public function getCount($ragename="") @@ -107,7 +107,7 @@ class TvRage if ($ragename != "") $rsql .= sprintf("and tvrage.releasetitle like %s ", $db->escapeString("%".$ragename."%")); - $res = $db->queryOneRow(sprintf("select count(ID) as num from tvrage where 1=1 %s ", $rsql)); + $res = $db->queryOneRow(sprintf("select count(id) as num from tvrage where 1=1 %s ", $rsql)); return $res["num"]; } @@ -116,7 +116,7 @@ class TvRage $db = new DB(); if(!preg_match('/\d{4}-\d{2}-\d{2}/',$date)) $date = date("Y-m-d"); - $sql = sprintf("SELECT * FROM episodeinfo WHERE rageID > %d AND DATE(airdate) = %s order by airdate asc ", 0, $db->escapeString($date)); + $sql = sprintf("SELECT * FROM episodeinfo WHERE rageid > %d AND DATE(airdate) = %s order by airdate asc ", 0, $db->escapeString($date)); return $db->query($sql); } @@ -138,7 +138,7 @@ class TvRage $tsql .= sprintf("and tvrage.releasetitle like %s", $db->escapeString("%".$ragename."%")); } - $sql = sprintf(" SELECT tvrage.ID, tvrage.rageID, tvrage.releasetitle, tvrage.genre, tvrage.country, tvrage.createddate, tvrage.prevdate, tvrage.nextdate, userseries.ID as userseriesID from tvrage left outer join userseries on userseries.userID = %d and userseries.rageID = tvrage.rageID where tvrage.rageID > 0 %s %s group by tvrage.rageID order by tvrage.releasetitle asc", $uid, $rsql, $tsql); + $sql = sprintf(" SELECT tvrage.id, tvrage.rageid, tvrage.releasetitle, tvrage.genre, tvrage.country, tvrage.createddate, tvrage.prevdate, tvrage.nextdate, userseries.id as userseriesID from tvrage left outer join userseries on userseries.userid = %d and userseries.rageid = tvrage.rageid where tvrage.rageid > 0 %s %s group by tvrage.rageid order by tvrage.releasetitle asc", $uid, $rsql, $tsql); return $db->query($sql); } @@ -216,8 +216,8 @@ class TvRage $fullep = $db->escapeString($sShow->ep); $link = $db->escapeString($sShow->link); $airdate = $db->escapeString(date("Y-m-d H:i:s", $day_time)); - $sql = sprintf('INSERT into episodeinfo (rageID,showtitle,fullep,airdate,link,eptitle) VALUES (%d,%s,%s,%s,%s,%s) - ON DUPLICATE KEY UPDATE rageID = %1$d, airdate = %4$s, link = %5$s, eptitle = %6$s, showtitle = %2$s', + $sql = sprintf('INSERT into episodeinfo (rageid,showtitle,fullep,airdate,link,eptitle) VALUES (%d,%s,%s,%s,%s,%s) + ON DUPLICATE KEY UPDATE rageid = %1$d, airdate = %4$s, link = %5$s, eptitle = %6$s, showtitle = %2$s', $sShow->sid,$showname,$fullep,$airdate,$link,$title); $db->queryInsert($sql); } @@ -227,7 +227,7 @@ class TvRage // update series info foreach ($xmlSchedule as $showId=>$epInfo) { - $res = $db->query(sprintf("select *, UNIX_TIMESTAMP(nextdate) as nextDateU, UNIX_TIMESTAMP(DATE(nextdate)) as nextDateDay from tvrage where rageID = %d", $showId)); + $res = $db->query(sprintf("select *, UNIX_TIMESTAMP(nextdate) as nextDateU, UNIX_TIMESTAMP(DATE(nextdate)) as nextDateDay from tvrage where rageid = %d", $showId)); if (sizeof($res) > 0) { foreach ($res as $arr) @@ -247,7 +247,7 @@ class TvRage { if ($prev_ep == "" && $arr['nextinfo'] != '' && $epInfo['next']['day_time'] > $arr['nextDateU'] && $arr['nextDateDay'] < $yesterday) { - $db->queryExec(sprintf("update tvrage set prevdate = nextdate, previnfo = nextinfo where ID = %d", $arr['ID'])); + $db->queryExec(sprintf("update tvrage set prevdate = nextdate, previnfo = nextinfo where id = %d", $arr['id'])); $prev_ep = "SWAPPED with: ".$arr['nextinfo']." - ".date("r", $arr['nextDateU']); } $next_ep = $epInfo['next']['episode'].', "'.$epInfo['next']['title'].'"'; @@ -272,7 +272,7 @@ class TvRage if (count($query) > 0) { $sql = str_ireplace("%", "%%", join(", ", $query)); - $sql = sprintf("update tvrage set {$sql} where ID = %d", $arr['ID']); + $sql = sprintf("update tvrage set {$sql} where id = %d", $arr['id']); $db->queryExec($sql); } } @@ -397,14 +397,14 @@ class TvRage } else { $tvairdate = $db->escapestring($show['airdate']); } - $db->queryExec(sprintf("update releases set seriesfull = %s, season = %s, episode = %s, tvairdate=%s where ID = %d", + $db->queryExec(sprintf("update releases set seriesfull = %s, season = %s, episode = %s, tvairdate=%s where id = %d", $db->escapeString($show['seriesfull']), $db->escapeString($show['season']), $db->escapeString($show['episode']), $tvairdate, $relid)); } public function refreshRageInfo($id) { $row = $this->getByID($id); - $rageid = $row["rageID"]; + $rageid = $row["rageid"]; $rInfo = $this->getRageInfoFromPage($rageid); $desc = ''; @@ -440,11 +440,11 @@ class TvRage //check local releases to see if we already have the data if ($idCheck && sizeof($idCheck) > 0) { - $epinfo = $db->queryOneRow(sprintf("select tvtitle as title, tvairdate as airdate from releases where tvairdate is not null and season = %s and episode = %s and rageID = %d", $db->escapeString($show['season']), $db->escapeString($show['episode']), $idCheck[0]['rageID'])); + $epinfo = $db->queryOneRow(sprintf("select tvtitle as title, tvairdate as airdate from releases where tvairdate is not null and season = %s and episode = %s and rageid = %d", $db->escapeString($show['season']), $db->escapeString($show['episode']), $idCheck[0]['rageid'])); //check tvdb episodeinfo data if ($epinfo == false) - $epinfo = $db->queryOneRow(sprintf("select eptitle as title, airdate as airdate from episodeinfo where airdate is not null and fullep = %s and rageID = %d", $db->escapeString(str_replace('S', '', $show['season']).'x'.str_replace('E', '', $show['episode'])), $idCheck[0]['rageID'])); + $epinfo = $db->queryOneRow(sprintf("select eptitle as title, airdate as airdate from episodeinfo where airdate is not null and fullep = %s and rageid = %d", $db->escapeString(str_replace('S', '', $show['season']).'x'.str_replace('E', '', $show['episode'])), $idCheck[0]['rageid'])); } // try and get the episode specific info from tvrage if its not available locally @@ -456,11 +456,11 @@ class TvRage $tvairdate = (!empty($epinfo['airdate'])) ? $db->escapeString($epinfo['airdate']) : "null"; $tvtitle = (!empty($epinfo['title'])) ? $db->escapeString($epinfo['title']) : "null"; - $db->queryExec(sprintf("update releases set tvtitle=trim(%s), tvairdate=%s, rageID = %d where ID = %d", $tvtitle, $tvairdate, $tvrShow['showid'], $relid)); + $db->queryExec(sprintf("update releases set tvtitle=trim(%s), tvairdate=%s, rageid = %d where id = %d", $tvtitle, $tvairdate, $tvrShow['showid'], $relid)); } else { - $db->queryExec(sprintf("update releases set rageID = %d where ID = %d", $tvrShow['showid'], $relid)); + $db->queryExec(sprintf("update releases set rageid = %d where id = %d", $tvrShow['showid'], $relid)); } $genre = ''; @@ -503,7 +503,7 @@ class TvRage $nfo = new Nfo(); // get all releases without a rageid which are in a tv category. - $result = $db->queryDirect(sprintf("SELECT searchname, ID from releases where rageID = -1 and categoryID in ( select ID from category where parentID = %d ) order by postdate desc limit %d ", Category::CAT_PARENT_TV, $numtoProcess)); + $result = $db->queryDirect(sprintf("SELECT searchname, id from releases where rageid = -1 and categoryid in ( select id from category where parentid = %d ) order by postdate desc limit %d ", Category::CAT_PARENT_TV, $numtoProcess)); if ($db->getNumRows($result) > 0) { @@ -513,17 +513,17 @@ class TvRage while ($arr = $db->getAssocArray($result)) { $rageID = false; - /* Preliminary Rage ID Detection from NFO file */ + /* Preliminary Rage id Detection from NFO file */ $rawnfo = ''; - if($nfo->getNfo($arr['ID'], $rawnfo)) + if($nfo->getNfo($arr['id'], $rawnfo)) $rageID = $this->parseRageIdFromNfo($rawnfo); if($rageID){ // Set RageID (if matched db) and move along - $res = $db->query(sprintf("SELECT count(ID) as cnt from tvrage where rageID = %d", $rageID)); + $res = $db->query(sprintf("SELECT count(id) as cnt from tvrage where rageid = %d", $rageID)); if(count($res) >= 1 && intval($res[0]['cnt']) > 1) { - $db->queryExec(sprintf("update releases set rageID = %d where ID = %d", $rageID, $arr["ID"])); + $db->queryExec(sprintf("update releases set rageid = %d where id = %d", $rageID, $arr["id"])); continue; } } @@ -532,9 +532,9 @@ class TvRage if (is_array($show) && $show['name'] != '') { // update release with season, ep, and airdate info (if available) from releasetitle - $this->updateEpInfo($show, $arr['ID']); + $this->updateEpInfo($show, $arr['id']); - // find the rageID + // find the rageid $id = $this->getByTitle($show['cleanname']); if ($id === false && $lookupTvRage) @@ -547,12 +547,12 @@ class TvRage if ($tvrShow !== false && is_array($tvrShow)) { // get all tv info and add show - $this->updateRageInfo($tvrShow['showid'], $show, $tvrShow, $arr['ID']); + $this->updateRageInfo($tvrShow['showid'], $show, $tvrShow, $arr['id']); } elseif ($tvrShow === false) { // no match - //add to tvrage with rageID = -2 and $show['cleanname'] title only + //add to tvrage with rageid = -2 and $show['cleanname'] title only $this->add(-2, $show['cleanname'], '', '', '', ''); } else @@ -574,12 +574,12 @@ class TvRage { //check local releases to see if we already have the data - $epinfo = $db->queryOneRow(sprintf("select tvtitle as title, tvairdate as airdate from releases where tvairdate is not null and season = %s and episode = %s and rageID = %d", $db->escapeString($show['season']), $db->escapeString($show['episode']), $id)); + $epinfo = $db->queryOneRow(sprintf("select tvtitle as title, tvairdate as airdate from releases where tvairdate is not null and season = %s and episode = %s and rageid = %d", $db->escapeString($show['season']), $db->escapeString($show['episode']), $id)); //check tvdb episodeinfo data if ($epinfo == false) { - $sql = sprintf("select eptitle as title, airdate as airdate from episodeinfo where airdate is not null and fullep = %s and rageID = %d", $db->escapeString(str_replace('S', '', $show['season']).'x'.str_replace('E', '', $show['episode'])), $id); + $sql = sprintf("select eptitle as title, airdate as airdate from episodeinfo where airdate is not null and fullep = %s and rageid = %d", $db->escapeString(str_replace('S', '', $show['season']).'x'.str_replace('E', '', $show['episode'])), $id); $epinfo = $db->queryOneRow($sql); } @@ -596,18 +596,18 @@ class TvRage } } } - $db->queryExec(sprintf("update releases set tvtitle=trim(%s), tvairdate=%s, rageID = %d where ID = %d", $tvtitle, $tvairdate, $id, $arr["ID"])); + $db->queryExec(sprintf("update releases set tvtitle=trim(%s), tvairdate=%s, rageid = %d where id = %d", $tvtitle, $tvairdate, $id, $arr["id"])); } else { // cant find rageid, so set rageid to n/a - $db->queryExec(sprintf("update releases set rageID = -2 where ID = %d", $arr["ID"])); + $db->queryExec(sprintf("update releases set rageid = -2 where id = %d", $arr["id"])); } } else { // not a tv episode, so set rageid to n/a - $db->queryExec(sprintf("update releases set rageID = -2 where ID = %d", $arr["ID"])); + $db->queryExec(sprintf("update releases set rageid = -2 where id = %d", $arr["id"])); } $ret++; } diff --git a/lib/copy_this/www/lib/usermovies.php b/lib/copy_this/www/lib/usermovies.php index a063d7ff7..d31c1aa1b 100644 --- a/lib/copy_this/www/lib/usermovies.php +++ b/lib/copy_this/www/lib/usermovies.php @@ -9,34 +9,34 @@ class UserMovies $catid = (!empty($catid)) ? $db->escapeString(implode('|', $catid)) : "null"; - $sql = sprintf("insert into usermovies (userID, imdbID, categoryID, createddate) values (%d, %d, %s, now())", $uid, $imdbid, $catid); + $sql = sprintf("insert into usermovies (userid, imdbid, categoryid, createddate) values (%d, %d, %s, now())", $uid, $imdbid, $catid); return $db->queryInsert($sql); } public function getMovies($uid) { $db = new DB(); - $sql = sprintf("select usermovies.*, movieinfo.year, movieinfo.plot, movieinfo.cover, movieinfo.title from usermovies left outer join movieinfo on movieinfo.imdbID = usermovies.imdbID where userID = %d order by movieinfo.title asc", $uid); + $sql = sprintf("select usermovies.*, movieinfo.year, movieinfo.plot, movieinfo.cover, movieinfo.title from usermovies left outer join movieinfo on movieinfo.imdbid = usermovies.imdbid where userid = %d order by movieinfo.title asc", $uid); return $db->query($sql); } public function delMovie($uid, $imdbid) { $db = new DB(); - $db->queryExec(sprintf("DELETE from usermovies where userID = %d and imdbID = %d ", $uid, $imdbid)); + $db->queryExec(sprintf("DELETE from usermovies where userid = %d and imdbid = %d ", $uid, $imdbid)); } public function getMovie($uid, $imdbid) { $db = new DB(); - $sql = sprintf("select usermovies.*, movieinfo.title from usermovies left outer join movieinfo on movieinfo.imdbID = usermovies.imdbID where usermovies.userID = %d and usermovies.imdbID = %d ", $uid, $imdbid); + $sql = sprintf("select usermovies.*, movieinfo.title from usermovies left outer join movieinfo on movieinfo.imdbid = usermovies.imdbid where usermovies.userid = %d and usermovies.imdbid = %d ", $uid, $imdbid); return $db->queryOneRow($sql); } public function delMovieForUser($uid) { $db = new DB(); - $db->queryExec(sprintf("DELETE from usermovies where userID = %d", $uid)); + $db->queryExec(sprintf("DELETE from usermovies where userid = %d", $uid)); } public function updateMovie($uid, $imdbid, $catid=array()) @@ -45,7 +45,7 @@ class UserMovies $catid = (!empty($catid)) ? $db->escapeString(implode('|', $catid)) : "null"; - $sql = sprintf("update usermovies set categoryID = %s where userID = %d and imdbID = %d", $catid, $uid, $imdbid); + $sql = sprintf("update usermovies set categoryid = %s where userid = %d and imdbid = %d", $catid, $uid, $imdbid); $db->queryExec($sql); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/users.php b/lib/copy_this/www/lib/users.php index a050e5196..c18fcf7b2 100644 --- a/lib/copy_this/www/lib/users.php +++ b/lib/copy_this/www/lib/users.php @@ -193,12 +193,12 @@ class Users $res = $this->getByUsername($uname); if ($res) - if ($res["ID"] != $id) + if ($res["id"] != $id) return Users::ERR_SIGNUP_UNAMEINUSE; $res = $this->getByEmail($email); if ($res) - if ($res["ID"] != $id) + if ($res["id"] != $id) return Users::ERR_SIGNUP_EMAILINUSE; $sql = array(); @@ -688,7 +688,7 @@ class Users $this->delUserCategoryExclusions($uid); if (count($catids) > 0) { foreach ($catids as $catid) { - $db->queryInsert(sprintf("insert into userexcat (userid, categoryID, createddate) values (%d, %d, now())", $uid, $catid)); + $db->queryInsert(sprintf("insert into userexcat (userid, categoryid, createddate) values (%d, %d, now())", $uid, $catid)); } } } @@ -697,9 +697,9 @@ class Users { $db = new DB(); $ret = array(); - $data = $db->query(sprintf("select categoryID from roleexcat where role = %d", $role)); + $data = $db->query(sprintf("select categoryid from roleexcat where role = %d", $role)); foreach ($data as $d) - $ret[] = $d["categoryID"]; + $ret[] = $d["categoryid"]; return $ret; } @@ -710,7 +710,7 @@ class Users $this->delRoleCategoryExclusions($role); if (count($catids) > 0) { foreach ($catids as $catid) { - $db->queryInsert(sprintf("insert into roleexcat (role, categoryID, createddate) values (%d, %d, now())", $role, $catid)); + $db->queryInsert(sprintf("insert into roleexcat (role, categoryid, createddate) values (%d, %d, now())", $role, $catid)); } } } @@ -741,9 +741,9 @@ class Users { $db = new DB(); $ret = array(); - $data = $db->query(sprintf("select categoryID from userexcat where userid = %d union distinct select categoryID from roleexcat inner join users on users.role = roleexcat.role where users.id = %d", $uid, $uid)); + $data = $db->query(sprintf("select categoryid from userexcat where userid = %d union distinct select categoryid from roleexcat inner join users on users.role = roleexcat.role where users.id = %d", $uid, $uid)); foreach ($data as $d) - $ret[] = $d["categoryID"]; + $ret[] = $d["categoryid"]; return $ret; } @@ -751,7 +751,7 @@ class Users public function delCategoryExclusion($uid, $catid) { $db = new DB(); - $db->exec(sprintf("DELETE from userexcat where userid = %d and categoryID = %d", $uid, $catid)); + $db->exec(sprintf("DELETE from userexcat where userid = %d and categoryid = %d", $uid, $catid)); } public function sendInvite($sitetitle, $siteemail, $serverurl, $uid, $emailto) diff --git a/lib/copy_this/www/lib/userseries.php b/lib/copy_this/www/lib/userseries.php index 40065513d..16ef8bbf5 100644 --- a/lib/copy_this/www/lib/userseries.php +++ b/lib/copy_this/www/lib/userseries.php @@ -9,40 +9,40 @@ class UserSeries $catid = (!empty($catid)) ? $db->escapeString(implode('|', $catid)) : "null"; - $sql = sprintf("insert into userseries (userID, rageID, categoryID, createddate) values (%d, %d, %s, now())", $uid, $rageid, $catid); + $sql = sprintf("insert into userseries (userid, rageid, categoryid, createddate) values (%d, %d, %s, now())", $uid, $rageid, $catid); return $db->queryInsert($sql); } public function getShows($uid) { $db = new DB(); - $sql = sprintf("select userseries.*, tvrage.releasetitle from userseries inner join (SELECT ID, releasetitle, rageid FROM tvrage GROUP BY rageid) tvrage on tvrage.rageID = userseries.rageID where userID = %d order by tvrage.releasetitle asc", $uid); + $sql = sprintf("select userseries.*, tvrage.releasetitle from userseries inner join (SELECT id, releasetitle, rageid FROM tvrage GROUP BY rageid) tvrage on tvrage.rageid = userseries.rageid where userid = %d order by tvrage.releasetitle asc", $uid); return $db->query($sql); } public function delShow($uid, $rageid) { $db = new DB(); - $db->queryExec(sprintf("DELETE from userseries where userID = %d and rageID = %d ", $uid, $rageid)); + $db->queryExec(sprintf("DELETE from userseries where userid = %d and rageid = %d ", $uid, $rageid)); } public function getShow($uid, $rageid) { $db = new DB(); - $sql = sprintf("select userseries.*, tvrage.releasetitle from userseries left outer join (SELECT ID, releasetitle, rageid FROM tvrage GROUP BY rageid) tvrage on tvrage.rageID = userseries.rageID where userseries.userID = %d and userseries.rageID = %d ", $uid, $rageid); + $sql = sprintf("select userseries.*, tvrage.releasetitle from userseries left outer join (SELECT id, releasetitle, rageid FROM tvrage GROUP BY rageid) tvrage on tvrage.rageid = userseries.rageid where userseries.userid = %d and userseries.rageid = %d ", $uid, $rageid); return $db->queryOneRow($sql); } public function delShowForUser($uid) { $db = new DB(); - $db->queryExec(sprintf("DELETE from userseries where userID = %d", $uid)); + $db->queryExec(sprintf("DELETE from userseries where userid = %d", $uid)); } public function delShowForSeries($sid) { $db = new DB(); - $db->queryExec(sprintf("DELETE from userseries where rageID = %d", $sid)); + $db->queryExec(sprintf("DELETE from userseries where rageid = %d", $sid)); } public function updateShow($uid, $rageid, $catid=array()) @@ -51,7 +51,7 @@ class UserSeries $catid = (!empty($catid)) ? $db->escapeString(implode('|', $catid)) : "null"; - $sql = sprintf("update userseries set categoryID = %s where userID = %d and rageID = %d", $catid, $uid, $rageid); + $sql = sprintf("update userseries set categoryid = %s where userid = %d and rageid = %d", $catid, $uid, $rageid); $db->queryExec($sql); } } \ No newline at end of file diff --git a/lib/copy_this/www/lib/util.php b/lib/copy_this/www/lib/util.php index 197b6b776..03e4c717c 100644 --- a/lib/copy_this/www/lib/util.php +++ b/lib/copy_this/www/lib/util.php @@ -428,7 +428,7 @@ class Utility public static function getCoverURL(array $options = []) { $defaults = [ - 'ID' => null, + 'id' => null, 'suffix' => '-cover.jpg', 'type' => '', ]; @@ -436,9 +436,9 @@ class Utility $fileSpecTemplate = '%s/%s%s'; $fileSpec = ''; - if (!empty($options['ID']) && in_array($options['type'], + if (!empty($options['id']) && in_array($options['type'], ['anime', 'audio', 'audiosample', 'book', 'console', 'games', 'movies', 'music', 'preview', 'sample', 'tvrage', 'video', 'xxx'])) { - $fileSpec = sprintf($fileSpecTemplate, $options['type'], $options['ID'], $options['suffix']); + $fileSpec = sprintf($fileSpecTemplate, $options['type'], $options['id'], $options['suffix']); $fileSpec = file_exists(NN_COVERS . $fileSpec) ? $fileSpec : sprintf($fileSpecTemplate, $options['type'], 'no', $options['suffix']); } diff --git a/lib/copy_this/www/pages/api.php b/lib/copy_this/www/pages/api.php index 265e1e6e6..12d07ffdd 100644 --- a/lib/copy_this/www/pages/api.php +++ b/lib/copy_this/www/pages/api.php @@ -76,7 +76,7 @@ $catExclusions = []; $maxRequests = 0; // Page is accessible only by the apikey, or logged in users. if ($users->isLoggedIn()) { - $uid = $page->userdata['ID']; + $uid = $page->userdata['id']; $apiKey = $page->userdata['rsstoken']; $catExclusions = $page->userdata['categoryexclusions']; $maxRequests = $page->userdata['apirequests']; @@ -92,7 +92,7 @@ if ($users->isLoggedIn()) { showApiError(100, 'Incorrect user credentials (wrong API key)'); } - $uid = $res['ID']; + $uid = $res['id']; $catExclusions = $users->getCategoryExclusion($uid); // // A hash of the users ip to record against the api hit @@ -138,7 +138,7 @@ switch ($function) { verifyEmptyParameter('q'); $maxAge = maxAge(); $users->addApiRequest($uid, $_SERVER['REQUEST_URI'], $hosthash); - $categoryID = categoryID(); + $categoryID = categoryid(); $limit = limit(); $offset = offset(); @@ -174,7 +174,7 @@ switch ($function) { $offset, limit(), (isset($_GET['q']) ? $_GET['q'] : ''), - categoryID(), + categoryid(), $maxAge ); @@ -195,7 +195,7 @@ switch ($function) { if (!$reldata) showApiError(300); - $nfo = $releases->getReleaseNfo($reldata["ID"], true); + $nfo = $releases->getReleaseNfo($reldata["id"], true); if (!$nfo) showApiError(300); @@ -262,7 +262,7 @@ switch ($function) { $reldata = $releases->getByGuid($_GET["id"]); if ($reldata) { - $ret = $rc->addComment($reldata["ID"], $reldata["gid"], $_GET["text"], $uid, $_SERVER['REMOTE_ADDR']); + $ret = $rc->addComment($reldata["id"], $reldata["gid"], $_GET["text"], $uid, $_SERVER['REMOTE_ADDR']); $content = "\n"; $content.= "\n"; @@ -376,13 +376,13 @@ switch ($function) { $offset, limit(), (isset($_GET['q']) ? $_GET['q'] : ''), - categoryID(), + categoryid(), $maxAge ); addCoverURL($relData, function ($release) { - return Utility::getCoverURL(['type' => 'movies', 'ID' => $release['imdbID']]); + return Utility::getCoverURL(['type' => 'movies', 'id' => $release['imdbid']]); } ); @@ -454,7 +454,7 @@ switch ($function) { // Check email isn't taken. $ret = $users->getByEmail($_GET['email']); - if (isset($ret['ID'])) { + if (isset($ret['id'])) { showApiError(105); } @@ -465,7 +465,7 @@ switch ($function) { // Register. $userDefault = $users->getDefaultRole(); $uid = $users->signup( - $username, $password, $_GET['email'], $_SERVER['REMOTE_ADDR'], $userDefault['ID'], "", $userDefault['defaultinvites'], "", false, false, false, true + $username, $password, $_GET['email'], $_SERVER['REMOTE_ADDR'], $userDefault['id'], "", $userDefault['defaultinvites'], "", false, false, false, true ); // Check if it succeeded. @@ -572,12 +572,12 @@ function maxAge() * Verify cat parameter. * @return array */ -function categoryID() +function categoryid() { $categoryID[] = -1; if (isset($_GET['cat'])) { $categoryIDs = $_GET['cat']; - // Append Web-DL category ID if HD present for SickBeard / NZBDrone compatibility. + // Append Web-DL category id if HD present for SickBeard / NZBDrone compatibility. if (strpos($_GET['cat'], (string)Category::CAT_TV_HD) !== false && strpos($_GET['cat'], (string)Category::CAT_TV_WEBDL) === false) { $categoryIDs .= (',' . Category::CAT_TV_WEBDL); @@ -665,8 +665,8 @@ function addLanguage(&$releases, DB $settings) { if ($releases && count($releases)) { foreach ($releases as $key => $release) { - if (isset($release['ID'])) { - $language = $settings->queryOneRow(sprintf('SELECT audiolanguage FROM releaseaudio WHERE releaseID = %d', $release['ID'])); + if (isset($release['id'])) { + $language = $settings->queryOneRow(sprintf('SELECT audiolanguage FROM releaseaudio WHERE releaseid = %d', $release['id'])); if ($language !== false) { $releases[$key]['searchname'] = $releases[$key]['searchname'] . ' ' . $language['audiolanguage']; } diff --git a/lib/copy_this/www/pages/browse.php b/lib/copy_this/www/pages/browse.php index e5876310f..9b711e8a8 100644 --- a/lib/copy_this/www/pages/browse.php +++ b/lib/copy_this/www/pages/browse.php @@ -46,17 +46,17 @@ if ($category == -1 && $grp == "") { $cdata = $cat->getById($category); if ($cdata) { $page->smarty->assign('catname', $cdata["title"]); - if ($cdata['parentID'] == Category::CAT_PARENT_GAME || $cdata['ID'] == Category::CAT_PARENT_GAME) { + if ($cdata['parentid'] == Category::CAT_PARENT_GAME || $cdata['id'] == Category::CAT_PARENT_GAME) { $covgroup = 'console'; - } elseif ($cdata['parentID'] == Category::CAT_PARENT_MOVIE || $cdata['ID'] == Category::CAT_PARENT_MOVIE) { + } elseif ($cdata['parentid'] == Category::CAT_PARENT_MOVIE || $cdata['id'] == Category::CAT_PARENT_MOVIE) { $covgroup = 'movies'; - } elseif ($cdata['parentID'] == Category::CAT_PARENT_XXX || $cdata['ID'] == Category::CAT_PARENT_XXX) { + } elseif ($cdata['parentid'] == Category::CAT_PARENT_XXX || $cdata['id'] == Category::CAT_PARENT_XXX) { $covgroup = 'xxx'; - } elseif ($cdata['parentID'] == Category::CAT_PARENT_PC || $cdata['ID'] == Category::CAT_PC_GAMES) { + } elseif ($cdata['parentid'] == Category::CAT_PARENT_PC || $cdata['id'] == Category::CAT_PC_GAMES) { $covgroup = 'games'; - } elseif ($cdata['parentID'] == Category::CAT_PARENT_MUSIC || $cdata['ID'] == Category::CAT_PARENT_MUSIC) { + } elseif ($cdata['parentid'] == Category::CAT_PARENT_MUSIC || $cdata['id'] == Category::CAT_PARENT_MUSIC) { $covgroup = 'music'; - } elseif ($cdata['parentID'] == Category::CAT_PARENT_BOOK || $cdata['ID'] == Category::CAT_PARENT_BOOK) { + } elseif ($cdata['parentid'] == Category::CAT_PARENT_BOOK || $cdata['id'] == Category::CAT_PARENT_BOOK) { $covgroup = 'books'; } } else { diff --git a/lib/copy_this/www/pages/console.php b/lib/copy_this/www/pages/console.php index 810f9de07..743e43293 100644 --- a/lib/copy_this/www/pages/console.php +++ b/lib/copy_this/www/pages/console.php @@ -14,7 +14,7 @@ if (!$users->isLoggedIn()) $concats = $cat->getChildren(Category::CAT_PARENT_GAME); $ctmp = array(); foreach($concats as $ccat) { - $ctmp[$ccat['ID']] = $ccat; + $ctmp[$ccat['id']] = $ccat; } $category = Category::CAT_PARENT_GAME; if (isset($_REQUEST["t"]) && array_key_exists($_REQUEST['t'], $ctmp)) @@ -56,7 +56,7 @@ $page->smarty->assign('title', $title); $genres = $gen->getGenres(Genres::CONSOLE_TYPE, true, true); $tmpgnr = array(); foreach($genres as $gn) { - $tmpgnr[$gn['ID']] = $gn['title']; + $tmpgnr[$gn['id']] = $gn['title']; } $genre = (isset($_REQUEST['genre']) && array_key_exists($_REQUEST['genre'], $tmpgnr)) ? $_REQUEST['genre'] : ''; $page->smarty->assign('genres', $genres); diff --git a/lib/copy_this/www/pages/details.php b/lib/copy_this/www/pages/details.php index 04fe40ee5..82d8e6927 100644 --- a/lib/copy_this/www/pages/details.php +++ b/lib/copy_this/www/pages/details.php @@ -30,20 +30,20 @@ if (isset($_GET["id"])) $page->show404(); if ($page->isPostBack()) - $rc->addComment($data["ID"], $data["gid"], $_POST["txtAddComment"], $users->currentUserId(), $_SERVER['REMOTE_ADDR']); + $rc->addComment($data["id"], $data["gid"], $_POST["txtAddComment"], $users->currentUserId(), $_SERVER['REMOTE_ADDR']); - $nfo = $releases->getReleaseNfo($data["ID"], false); - $reVideo = $re->getVideo($data["ID"]); - $reAudio = $re->getAudio($data["ID"]); - $reSubs = $re->getSubs($data["ID"]); + $nfo = $releases->getReleaseNfo($data["id"], false); + $reVideo = $re->getVideo($data["id"]); + $reAudio = $re->getAudio($data["id"]); + $reSubs = $re->getSubs($data["id"]); $comments = $rc->getCommentsByGid($data["gid"]); $rage = ''; - if ($data["rageID"] != '') + if ($data["rageid"] != '') { $tvrage = new TvAnger(); - $rageinfo = $tvrage->getByRageID($data["rageID"]); + $rageinfo = $tvrage->getByRageID($data["rageid"]); if (count($rageinfo) > 0) { $seriesnames = $seriesdescription = $seriescountry = $seriesgenre = $seriesimg = $seriesid = array(); @@ -61,7 +61,7 @@ if (isset($_GET["id"])) if (!empty($r['imgdata'])) { $seriesimg[] = $r['imgdata']; - $seriesid[] = $r['ID']; + $seriesid[] = $r['id']; } } $rage = array( @@ -70,25 +70,25 @@ if (isset($_GET["id"])) 'country' => array_shift($seriescountry), 'genre' => array_shift($seriesgenre), 'imgdata' => array_shift($seriesimg), - 'ID'=>array_shift($seriesid) + 'id'=>array_shift($seriesid) ); } } $episodeArray = ''; - if ($data['episodeinfoID'] > 0) + if ($data['episodeinfoid'] > 0) { $episode = new Episode(); - $episodeArray = $episode->getEpisodeInfoByID($data['episodeinfoID']); + $episodeArray = $episode->getEpisodeInfoByID($data['episodeinfoid']); } $mov = ''; - if ($data['imdbID'] != '' && $data['imdbID'] != 0000000) { + if ($data['imdbid'] != '' && $data['imdbid'] != 0000000) { $movie = new Film(); - $mov = $movie->getMovieInfo($data['imdbID']); + $mov = $movie->getMovieInfo($data['imdbid']); $trakt = new TraktTv(); - $traktSummary = $trakt->traktMoviesummary('tt' . $data['imdbID'], true); + $traktSummary = $trakt->traktMoviesummary('tt' . $data['imdbid'], true); if ($traktSummary !== false && isset($traktSummary['trailer']) && $traktSummary['trailer'] !== '' && @@ -99,7 +99,7 @@ if (isset($_GET["id"])) 'https://www.youtube.com/v/' . $youtubeM[1] . '" type="application/x-shockwave-flash">'; } else { - $mov['trailer'] = imdb_trailers($data['imdbID']); + $mov['trailer'] = imdb_trailers($data['imdbid']); } if ($mov && isset($mov['title'])) { @@ -140,31 +140,31 @@ if (isset($_GET["id"])) } $mus = ''; - if ($data['musicinfoID'] != '') { + if ($data['musicinfoid'] != '') { require_once(WWW_DIR."/lib/music.php"); $music = new Musik(['Settings' => $page->settings]); - $mus = $music->getMusicInfo($data['musicinfoID']); + $mus = $music->getMusicInfo($data['musicinfoid']); } $book = ''; - if ($data['bookinfoID'] != '') { + if ($data['bookinfoid'] != '') { require_once(WWW_DIR."/lib/book.php"); $b = new Book(); - $book = $b->getBookInfo($data['bookinfoID']); + $book = $b->getBookInfo($data['bookinfoid']); } $con = ''; - if ($data['consoleinfoID'] != '') { + if ($data['consoleinfoid'] != '') { require_once(WWW_DIR."/lib/console.php"); $c = new Console(); - $con = $c->getConsoleInfo($data['consoleinfoID']); + $con = $c->getConsoleInfo($data['consoleinfoid']); } $AniDBAPIArray = ''; - if ($data["anidbID"] > 0) + if ($data["anidbid"] > 0) { $AniDB = new AniDB(['Settings' => $releases->pdo]); - $AniDBAPIArray = $AniDB->getAnimeInfo($data["anidbID"]); + $AniDBAPIArray = $AniDB->getAnimeInfo($data["anidbid"]); } $predbQuery = ''; @@ -175,10 +175,10 @@ if (isset($_GET["id"])) } $prehash = new PreHash(); - $pre = $prehash->getForRelease($data["prehashID"]); + $pre = $prehash->getForRelease($data["prehashid"]); $rf = new ReleaseFiles; - $releasefiles = $rf->get($data["ID"]); + $releasefiles = $rf->get($data["id"]); $page->smarty->assign('releasefiles',$releasefiles); $page->smarty->assign('release',$data); diff --git a/lib/copy_this/www/pages/forgottenpassword.php b/lib/copy_this/www/pages/forgottenpassword.php index 1601a6bdd..0df73a111 100644 --- a/lib/copy_this/www/pages/forgottenpassword.php +++ b/lib/copy_this/www/pages/forgottenpassword.php @@ -26,9 +26,9 @@ switch($action) // // reset the password, inform the user, send out the email // - $users->updatePassResetGuid($ret["ID"], ""); + $users->updatePassResetGuid($ret["id"], ""); $newpass = $users->generatePassword(); - $users->updatePassword($ret["ID"], $newpass); + $users->updatePassword($ret["id"], $newpass); $to = $ret["email"]; $subject = $page->site->title." Password Reset"; @@ -66,7 +66,7 @@ switch($action) // Generate a forgottenpassword guid, store it in the user table // $guid = md5(uniqid()); - $users->updatePassResetGuid($ret["ID"], $guid); + $users->updatePassResetGuid($ret["id"], $guid); // // Send the email diff --git a/lib/copy_this/www/pages/games.php b/lib/copy_this/www/pages/games.php index 83b5e4aaa..8a416ade2 100644 --- a/lib/copy_this/www/pages/games.php +++ b/lib/copy_this/www/pages/games.php @@ -13,7 +13,7 @@ $gen = new Genres(); $concats = $cat->getChildren(Category::CAT_PARENT_PC); $ctmp = array(); foreach ($concats as $ccat) { - $ctmp[$ccat['ID']] = $ccat; + $ctmp[$ccat['id']] = $ccat; } $category = Category::CAT_PC_GAMES; if (isset($_REQUEST["t"]) && array_key_exists($_REQUEST['t'], $ctmp)) { @@ -55,7 +55,7 @@ $page->smarty->assign('title', $title); $genres = $gen->getGenres(Genres::GAME_TYPE, true); $tmpgnr = array(); foreach ($genres as $gn) { - $tmpgnr[$gn['ID']] = $gn['title']; + $tmpgnr[$gn['id']] = $gn['title']; } $genre = (isset($_REQUEST['genre']) && array_key_exists($_REQUEST['genre'], $tmpgnr)) ? $_REQUEST['genre'] : ''; $page->smarty->assign('genres', $genres); diff --git a/lib/copy_this/www/pages/getnzb.php b/lib/copy_this/www/pages/getnzb.php index 493513853..33c297d48 100644 --- a/lib/copy_this/www/pages/getnzb.php +++ b/lib/copy_this/www/pages/getnzb.php @@ -23,11 +23,11 @@ if ($users->isLoggedIn()) { $res = $users->getByIdAndRssToken($_GET["i"], $_GET["r"]); if (!$res) { header("X-DNZB-RCode: 401"); - header("X-DNZB-RText: Unauthorised, wrong user ID or rss key!"); + header("X-DNZB-RText: Unauthorised, wrong user id or rss key!"); $page->show403(); } } - $uid = $res["ID"]; + $uid = $res["id"]; $maxdls = $res["downloadrequests"]; } diff --git a/lib/copy_this/www/pages/login.php b/lib/copy_this/www/pages/login.php index 9a2c02902..b8bd69547 100644 --- a/lib/copy_this/www/pages/login.php +++ b/lib/copy_this/www/pages/login.php @@ -24,7 +24,7 @@ if ($page->isPostBack()) else if ($users->checkPassword($_POST["password"], $res["password"])) { $rememberMe = (isset($_POST['rememberme']) && $_POST['rememberme'] == 'on') ? 1 : 0; - $users->login($res["ID"], $_SERVER['REMOTE_ADDR'], $rememberMe); + $users->login($res["id"], $_SERVER['REMOTE_ADDR'], $rememberMe); if (isset($_POST["redirect"]) && $_POST["redirect"] != "") header("Location: ".$_POST["redirect"]); diff --git a/lib/copy_this/www/pages/movies.php b/lib/copy_this/www/pages/movies.php index 9e82214f1..7cf9f510a 100644 --- a/lib/copy_this/www/pages/movies.php +++ b/lib/copy_this/www/pages/movies.php @@ -12,7 +12,7 @@ if (!$users->isLoggedIn()) $moviecats = $cat->getChildren(Category::CAT_PARENT_MOVIE); $mtmp = array(); foreach($moviecats as $mcat) { - $mtmp[$mcat['ID']] = $mcat; + $mtmp[$mcat['id']] = $mcat; } $category = (isset($_GET["imdb"]) ? -1 : Category::CAT_PARENT_MOVIE); diff --git a/lib/copy_this/www/pages/music.php b/lib/copy_this/www/pages/music.php index e26f19ae6..6b18f5a24 100644 --- a/lib/copy_this/www/pages/music.php +++ b/lib/copy_this/www/pages/music.php @@ -14,7 +14,7 @@ $gen = new Genres(['Settings' => $page->settings]); $musiccats = $cat->getChildren(Category::CAT_PARENT_MUSIC); $mtmp = array(); foreach ($musiccats as $mcat) { - $mtmp[$mcat['ID']] = $mcat; + $mtmp[$mcat['id']] = $mcat; } $category = Category::CAT_PARENT_MUSIC; if (isset($_REQUEST['t']) && array_key_exists($_REQUEST['t'], $mtmp)) { diff --git a/lib/copy_this/www/pages/nfo.php b/lib/copy_this/www/pages/nfo.php index c236d8106..9c72b1eab 100644 --- a/lib/copy_this/www/pages/nfo.php +++ b/lib/copy_this/www/pages/nfo.php @@ -13,7 +13,7 @@ if (isset($_GET["id"])) { if (!$rel) $page->show404(); - $nfo = $releases->getReleaseNfo($rel['ID']); + $nfo = $releases->getReleaseNfo($rel['id']); $nfo['nfoUTF'] = cp437toUTF($nfo['nfo']); $page->smarty->assign('rel', $rel); diff --git a/lib/copy_this/www/pages/prehashinfo.php b/lib/copy_this/www/pages/prehashinfo.php index 9e6ec8a36..13522262b 100644 --- a/lib/copy_this/www/pages/prehashinfo.php +++ b/lib/copy_this/www/pages/prehashinfo.php @@ -20,7 +20,7 @@ require_once(WWW_DIR . '/../misc/update_scripts/nix_scripts/tmux/lib/functions.p * * Parameters: * ---------- - * reqid : The request ID + * reqid : The request id * group : The group name. * * Example URL: @@ -150,15 +150,15 @@ if (isset($_GET['type'])) { switch ($_GET['type']) { case 'r': - case 'requestID': + case 'requestid': if (isset($_GET['reqid']) && is_numeric($_GET['reqid']) && isset($_GET['group']) && is_string($_GET['group'])) { $db = new DB(); $preData = $db->query( sprintf(' SELECT p.* FROM prehash p - INNER JOIN groups g ON g.ID = p.groupID - WHERE requestID = %d + INNER JOIN groups g ON g.id = p.groupid + WHERE requestid = %d AND g.name = %s %s %s %s LIMIT %d @@ -198,7 +198,7 @@ if (isset($_GET['type'])) { if (isset($_GET['md5']) && strlen($_GET['title']) === 32) { $db = new DB(); $preData = $db->query( - sprintf('SELECT * FROM prehash p INNER JOIN predbhash ph ON ph.pre_id = p.ID WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', + sprintf('SELECT * FROM prehash p INNER JOIN predbhash ph ON ph.pre_id = p.id WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', $db->escapeString($_GET['md5']), $newer, $older, @@ -215,7 +215,7 @@ if (isset($_GET['type'])) { if (isset($_GET['sha1']) && strlen($_GET['sha1']) === 40) { $db = new DB(); $preData = $db->query( - sprintf('SELECT * FROM prehash p INNER JOIN predbhash ph ON ph.pre_id = p.ID WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', + sprintf('SELECT * FROM prehash p INNER JOIN predbhash ph ON ph.pre_id = p.id WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', $db->escapeString($_GET['sha1']), $newer, $older, @@ -253,7 +253,7 @@ if ($json === false) { foreach ($preData as $data) { echo 'getByEmail($_POST['email']); - if ($res && $res["ID"] != $userid) { + if ($res && $res["id"] != $userid) { $errorStr = "Sorry, the email is already in use."; } elseif ((empty($_POST['saburl']) && !empty($_POST['sabapikey'])) || (!empty($_POST['saburl']) && empty($_POST['sabapikey']))) { $errorStr = "Insert a SABnzdb URL and API key."; diff --git a/lib/copy_this/www/pages/register.php b/lib/copy_this/www/pages/register.php index f712eb7f6..be1b696ec 100644 --- a/lib/copy_this/www/pages/register.php +++ b/lib/copy_this/www/pages/register.php @@ -57,7 +57,7 @@ else { //get the default user role $userdefault = $users->getDefaultRole(); - $ret = $users->signup($username, $password, $email, $_SERVER['REMOTE_ADDR'], $userdefault['ID'], "", $userdefault['defaultinvites'], $invitecode, false, isset($_POST['recaptcha_challenge_field']) ? $_POST['recaptcha_challenge_field'] : null, isset($_POST['recaptcha_response_field']) ? $_POST['recaptcha_response_field'] : null); + $ret = $users->signup($username, $password, $email, $_SERVER['REMOTE_ADDR'], $userdefault['id'], "", $userdefault['defaultinvites'], $invitecode, false, isset($_POST['recaptcha_challenge_field']) ? $_POST['recaptcha_challenge_field'] : null, isset($_POST['recaptcha_response_field']) ? $_POST['recaptcha_response_field'] : null); if ($ret > 0) { $users->login($ret, $_SERVER['REMOTE_ADDR']); header("Location: " . WWW_TOP . "/"); diff --git a/lib/copy_this/www/pages/series.php b/lib/copy_this/www/pages/series.php index 500c68a83..34bd8603b 100644 --- a/lib/copy_this/www/pages/series.php +++ b/lib/copy_this/www/pages/series.php @@ -30,7 +30,7 @@ if (isset($_GET["id"]) && ctype_digit($_GET['id'])) { } elseif (!$rel) { $page->smarty->assign("nodata", "No releases for this series."); } else { - $myshows = $us->getShow($users->currentUserId(), $rage[0]['rageID']); + $myshows = $us->getShow($users->currentUserId(), $rage[0]['rageid']); // Sort releases by season, episode, date posted. $season = $episode = $posted = array(); diff --git a/lib/copy_this/www/pages/xxx.php b/lib/copy_this/www/pages/xxx.php index 9d7b5cd37..65cf90fe3 100644 --- a/lib/copy_this/www/pages/xxx.php +++ b/lib/copy_this/www/pages/xxx.php @@ -12,7 +12,7 @@ $cat = new Category(); $moviecats = $cat->getChildren(Category::CAT_PARENT_XXX); $mtmp = array(); foreach ($moviecats as $mcat) { - $mtmp[$mcat['ID']] = $mcat; + $mtmp[$mcat['id']] = $mcat; } $category = Category::CAT_PARENT_XXX; if (isset($_REQUEST['t']) && array_key_exists($_REQUEST['t'], $mtmp)) { diff --git a/lib/copy_this/www/populate/AniDB.php b/lib/copy_this/www/populate/AniDB.php index 66f0177ca..d41671e14 100644 --- a/lib/copy_this/www/populate/AniDB.php +++ b/lib/copy_this/www/populate/AniDB.php @@ -26,7 +26,7 @@ class PopulateAniDB public $pdo; /** - * The AniDB ID we are looking up + * The AniDB id we are looking up * @var bool */ private $anidbId; @@ -104,7 +104,7 @@ class PopulateAniDB /** * Checks for an existing anime title in anidb table * - * @param int $id The AniDB ID to be inserted + * @param int $id The AniDB id to be inserted * @param string $type The title type * @param string $lang The title language * @param string $title The title of the Anime @@ -132,7 +132,7 @@ class PopulateAniDB /** * Retrieves supplemental anime info from the AniDB API * - * @param int $id The AniDB ID to be inserted + * @param int $id The AniDB id to be inserted * @param string $type The title type * @param string $lang The title language * @param string $title The title of the Anime @@ -273,7 +273,7 @@ class PopulateAniDB /** * Inserts new anime info from AniDB to anidb table * - * @param int $id The AniDB ID to be inserted + * @param int $id The AniDB id to be inserted * @param string $type The title type * @param string $lang The title language * @param string $title The title of the Anime @@ -431,12 +431,12 @@ class PopulateAniDB true); exit; } elseif ($AniDBAPIArray === false && $this->echooutput) { - $this->pdo->log->doEcho($this->pdo->log->info("Anime ID: {$this->anidbId} not available for update yet."), + $this->pdo->log->doEcho($this->pdo->log->info("Anime id: {$this->anidbId} not available for update yet."), true); } else { $this->updateAniChildTables($AniDBAPIArray); if (NN_DEBUG) { - $this->pdo->log->doEcho($this->pdo->log->headerOver("Added/Updated AniDB ID: {$this->anidbId}"), + $this->pdo->log->doEcho($this->pdo->log->headerOver("Added/Updated AniDB id: {$this->anidbId}"), true); } } diff --git a/lib/copy_this/www/post/AniDB.php b/lib/copy_this/www/post/AniDB.php index 058b25eb9..249c9eac8 100644 --- a/lib/copy_this/www/post/AniDB.php +++ b/lib/copy_this/www/post/AniDB.php @@ -10,7 +10,7 @@ require_once(NN_TMUX . 'lib' . DS . 'Enzebe.php'); class PostAniDB { const PROC_EXTFAIL = -1; // Release Anime title/episode # could not be extracted from searchname - const PROC_NOMATCH = -2; // AniDB ID was not found in anidb table using extracted title/episode # + const PROC_NOMATCH = -2; // AniDB id was not found in anidb table using extracted title/episode # const REGEX_NOFORN = 'English|Japanese|German|Danish|Flemish|Dutch|French|Swe(dish|sub)|Deutsch|Norwegian'; @@ -68,11 +68,11 @@ class PostAniDB { $results = $this->pdo->queryDirect( sprintf(' - SELECT searchname, ID + SELECT searchname, id FROM releases WHERE nzbstatus = %d AND anidbid IS NULL - AND categoryID = %d + AND categoryid = %d ORDER BY postdate DESC LIMIT %d', \Enzebe::NZB_ADDED, @@ -97,9 +97,9 @@ class PostAniDB sprintf(' UPDATE releases SET anidbid = %d - WHERE ID = %d', + WHERE id = %d', $this->status, - $release['ID'] + $release['id'] ) ); } @@ -237,7 +237,7 @@ class PostAniDB $type = 'Remote'; } else { echo PHP_EOL . - $this->pdo->log->info("This AniDB ID was not found to be accurate locally, but has been updated too recently to check AniDB.") . + $this->pdo->log->info("This AniDB id was not found to be accurate locally, but has been updated too recently to check AniDB.") . PHP_EOL; } } @@ -246,10 +246,10 @@ class PostAniDB $cleanArr['epno'], $updatedAni['episode_title'], $updatedAni['airdate'], - $release['ID']); + $release['id']); $this->pdo->log->doEcho( - $this->pdo->log->headerOver("Matched {$type} AniDB ID: ") . + $this->pdo->log->headerOver("Matched {$type} AniDB id: ") . $this->pdo->log->primary($anidbId['anidbid']) . $this->pdo->log->alternateOver(" Title: ") . $this->pdo->log->primary($anidbId['title']) . @@ -293,7 +293,7 @@ class PostAniDB UPDATE releases SET anidbid = %d, seriesfull = %s, season = 'S01', episode = %s, tvtitle = %s, tvairdate = %s - WHERE ID = %d", + WHERE id = %d", $anidbId, $this->pdo->escapeString('S01' . $epno), $this->pdo->escapeString($epno), diff --git a/lib/copy_this/www/templates/nntmux/scripts/jquery-1.9.1.js b/lib/copy_this/www/templates/nntmux/scripts/jquery-1.9.1.js index e2c203fe9..e0375b304 100644 --- a/lib/copy_this/www/templates/nntmux/scripts/jquery-1.9.1.js +++ b/lib/copy_this/www/templates/nntmux/scripts/jquery-1.9.1.js @@ -176,7 +176,7 @@ jQuery.fn = jQuery.prototype = { // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items - // by name instead of ID + // by name instead of id if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } @@ -1565,7 +1565,7 @@ function internalData( elem, name, data, pvt /* Internal Use Only */ ){ // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, - // Only defining an ID for JS objects if its cache already exists allows + // Only defining an id for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; @@ -1576,7 +1576,7 @@ function internalData( elem, name, data, pvt /* Internal Use Only */ ){ } if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data + // Only DOM nodes need a new unique id for each element since their data // ends up in the global cache if ( isNode ) { elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; @@ -2733,7 +2733,7 @@ jQuery.event = { selector = handleObjIn.selector; } - // Make sure that the handler has a unique ID, used to find/remove it later + // Make sure that the handler has a unique id, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } @@ -3778,7 +3778,7 @@ var i, ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "id": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), @@ -3797,7 +3797,7 @@ var i, rnative = /^[^{]+\{\s*\[native code/, - // Easily-parseable/retrievable ID or TAG or CLASS selectors + // Easily-parseable/retrievable id or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, @@ -3912,7 +3912,7 @@ function Sizzle( selector, context, results, seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") + // Speed-up: Sizzle("#id") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); @@ -3920,7 +3920,7 @@ function Sizzle( selector, context, results, seed ) { // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID + // by name instead of id if ( elem.id === m ) { results.push( elem ); return results; @@ -3957,7 +3957,7 @@ function Sizzle( selector, context, results, seed ) { newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root + // We can work around this by specifying an extra id on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { @@ -4057,7 +4057,7 @@ setDocument = Sizzle.setDocument = function( node ) { }); // Check if getElementById returns elements by name - // Check if getElementsByName privileges form controls or returns elements by ID + // Check if getElementsByName privileges form controls or returns elements by id support.getByName = assert(function( div ) { // Inject content div.id = expando + 0; @@ -4094,9 +4094,9 @@ setDocument = Sizzle.setDocument = function( node ) { } }; - // ID find and filter + // id find and filter if ( support.getIdNotName ) { - Expr.find["ID"] = function( id, context ) { + Expr.find["id"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns @@ -4104,14 +4104,14 @@ setDocument = Sizzle.setDocument = function( node ) { return m && m.parentNode ? [m] : []; } }; - Expr.filter["ID"] = function( id ) { + Expr.filter["id"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { - Expr.find["ID"] = function( id, context ) { + Expr.find["id"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); @@ -4122,7 +4122,7 @@ setDocument = Sizzle.setDocument = function( node ) { []; } }; - Expr.filter["ID"] = function( id ) { + Expr.filter["id"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); @@ -5463,13 +5463,13 @@ function select( selector, context, results, seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { - // Take a shortcut and set the context if the root selector is an ID + // Take a shortcut and set the context if the root selector is an id tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + if ( tokens.length > 2 && (token = tokens[0]).type === "id" && context.nodeType === 9 && !documentIsXML && Expr.relative[ tokens[1].type ] ) { - context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; + context = Expr.find["id"]( token.matches[0].replace( runescape, funescape ), context )[0]; if ( !context ) { return results; } diff --git a/lib/copy_this/www/templates/nntmux/views/admin/ajax_release-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/ajax_release-edit.tpl index 828ed72b5..8711069a6 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/ajax_release-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/ajax_release-edit.tpl @@ -37,7 +37,7 @@ Category: - {html_options id="category" name=category options=$catlist selected=$release.categoryID} + {html_options id="category" name=category options=$catlist selected=$release.categoryid} @@ -49,16 +49,16 @@ - Tv Rage Id: + Tv Rage Id: - + - TheTVDB ID: + TheTVDB id: - + @@ -86,7 +86,7 @@ IMDB Id: - + diff --git a/lib/copy_this/www/templates/nntmux/views/admin/binaryblacklist-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/binaryblacklist-edit.tpl index c2e195530..2407eeaab 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/binaryblacklist-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/binaryblacklist-edit.tpl @@ -13,9 +13,9 @@ Group: - + - The full name of a valid newsgroup. (Wildcard in the format 'alt.binaries.*') + The full name of a valid newsgroup. (Wildcard in the format 'alt.binaries.*') @@ -23,7 +23,7 @@ Regex: {$regex.regex|escape:html} - The regex to be applied. (Note: Beginning and Ending / are already included) + The regex to be applied. (Note: Beginning and Ending / are already included) @@ -31,7 +31,7 @@ Description: {$regex.description|escape:html} - A description for this regex + A description for this regex @@ -39,7 +39,7 @@ Message Field: {html_radios id="msgcol" name='msgcol' values=$msgcol_ids output=$msgcol_names selected=$regex.msgcol separator=''} - Which field in the message to apply the black/white list to. + Which field in the message to apply the black/white list to. @@ -47,7 +47,7 @@ Active: {html_radios id="status" name='status' values=$status_ids output=$status_names selected=$regex.status separator=''} - Only active regexes are applied during the release process. + Only active regexes are applied during the release process. @@ -55,7 +55,7 @@ Type: {html_radios id="optype" name='optype' values=$optype_ids output=$optype_names selected=$regex.optype separator=''} - Black will exclude all messages for a group which match this regex. White will include only those which match. + Black will exclude all messages for a group which match this regex. White will include only those which match. diff --git a/lib/copy_this/www/templates/nntmux/views/admin/binaryblacklist-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/binaryblacklist-list.tpl index dafe79a01..93a408784 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/binaryblacklist-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/binaryblacklist-list.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -18,10 +18,10 @@ status Options - + {foreach from=$binlist item=bin} - - {$bin.ID} + + {$bin.id} {$bin.groupname|replace:"alt.binaries":"a.b"} {$bin.regex|escape:html} @@ -30,7 +30,7 @@ {if $bin.optype==1}black{else}white{/if} {if $bin.msgcol==1}subject{elseif $bin.msgcol==2}poster{else}messageid{/if} {if $bin.status==1}active{else}disabled{/if} - edit | delete + edit | delete {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/book-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/book-edit.tpl index e019ee145..417958379 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/book-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/book-edit.tpl @@ -1,9 +1,9 @@ - + {$page->title} - + @@ -54,7 +54,7 @@ {if $book.cover == 1} - + {/if} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/book-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/book-list.tpl index b40c454da..a83c0d369 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/book-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/book-list.tpl @@ -1,4 +1,4 @@ -{$page->title} +{$page->title} {if $booklist} {$pager} @@ -6,16 +6,16 @@ - ID + id Title Author Created - + {foreach from=$booklist item=book} - {$book.ID} - {$book.title} + {$book.id} + {$book.title} {$book.author} {$book.createddate|date_format} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/category-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/category-edit.tpl index 370ba6301..34dc4407d 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/category-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/category-edit.tpl @@ -1,4 +1,4 @@ - + {$page->title} {if $error != ''} @@ -12,7 +12,7 @@ Title: - + {$category.title} @@ -20,7 +20,7 @@ Parent: - {$category.parentID} + {$category.parentid} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/category-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/category-list.tpl index 2c9eee7e3..613e3debf 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/category-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/category-list.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -16,13 +16,13 @@ active disable preview - + {foreach from=$categorylist item=category} - {$category.ID} - {$category.title} + {$category.id} + {$category.title} - {if $category.parentID != null} + {if $category.parentid != null} {$category.parentName} {else} n/a diff --git a/lib/copy_this/www/templates/nntmux/views/admin/comments-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/comments-list.tpl index 47af5e655..dd11d9f1d 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/comments-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/comments-list.tpl @@ -17,7 +17,7 @@ {foreach from=$commentslist item=comment} - {if $comment.sourceid == 0}{$comment.username}{else}{$comment.username}(syndicated){/if} + {if $comment.sourceid == 0}{$comment.username}{else}{$comment.username}(syndicated){/if} {$comment.createddate|date_format} ({$comment.createddate|timeago} ago) @@ -26,7 +26,7 @@ {$comment.host} {if $comment.guid != ""}view | {/if} - delete + delete {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/console-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/console-edit.tpl index 5ae2c63bb..ba6827608 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/console-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/console-edit.tpl @@ -1,9 +1,9 @@ - + {$page->title} - + @@ -68,7 +68,7 @@ {foreach from=$genres item=gen} - {$gen.title|escape:'htmlall'} + {$gen.title|escape:'htmlall'} {/foreach} @@ -79,7 +79,7 @@ {if $console.cover == 1} - + {/if} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/console-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/console-list.tpl index 6853c7b40..255f79139 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/console-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/console-list.tpl @@ -1,4 +1,4 @@ -{$page->title} +{$page->title} {if $consolelist} {$pager} @@ -6,16 +6,16 @@ - ID + id Title Platform Created - + {foreach from=$consolelist item=console} - {$console.ID} - {$console.title} + {$console.id} + {$console.title} {$console.platform} {$console.createddate|date_format} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/group-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/group-edit.tpl index 5658d6353..6bee68efa 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/group-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/group-edit.tpl @@ -4,7 +4,7 @@ Name: - + Changing the name to an invalid group will break things. @@ -44,14 +44,14 @@ - First Record ID: + First Record id: The oldest record number for the group. - Last Record ID: + Last Record id: The newest record number for the group. diff --git a/lib/copy_this/www/templates/nntmux/views/admin/group-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/group-list.tpl index 256c0d2ce..741885e15 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/group-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/group-list.tpl @@ -39,25 +39,25 @@ options {foreach from=$grouplist item=group} - + - {$group.name|replace:"alt.binaries":"a.b"} + {$group.name|replace:"alt.binaries":"a.b"} {$group.description} {$group.first_record_postdate}{$group.first_record_postdate|timeago} {$group.last_record_postdate}{$group.last_record_postdate|timeago} {$group.last_updated|timeago} ago - {if $group.active=="1"}Deactivate{else}Activate{/if} + {if $group.active=="1"}Deactivate{else}Activate{/if} {if $group.regexmatchonly == "1"}Yes{else}No{/if} - {if $group.backfill=="1"}Deactivate{else}Activate{/if} + {if $group.backfill=="1"}Deactivate{else}Activate{/if} {$group.num_releases} {if $group.minfilestoformrelease==""}n/a{else}{$group.minfilestoformrelease}{/if} {if $group.minsizetoformrelease==""}n/a{else}{$group.minsizetoformrelease|fsize_format:"MB"}{/if} {$group.backfill_target} - - Reset | - Delete | - Purge + + Reset | + Delete | + Purge {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/menu-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/menu-edit.tpl index 77fc59033..8c1a4faa4 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/menu-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/menu-edit.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -8,7 +8,7 @@ Title: - + diff --git a/lib/copy_this/www/templates/nntmux/views/admin/menu-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/menu-list.tpl index 03f52cded..004bfc932 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/menu-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/menu-list.tpl @@ -1,4 +1,4 @@ -{$page->title} +{$page->title} {if $menulist} @@ -13,16 +13,16 @@ new window options - + {foreach from=$menulist item=menu} - {$menu.title|escape:"htmlall"} + {$menu.title|escape:"htmlall"} {$menu.href} {$menu.tooltip} {if $menu.role == 0}Guests{elseif $menu.role == 1}Users{elseif $menu.role == 2}Admin{else}Other{/if} {$menu.ordinal} {if $menu.newwindow == 1}Yes{else}No{/if} - delete + delete {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/movie-add.tpl b/lib/copy_this/www/templates/nntmux/views/admin/movie-add.tpl index a2d8683c9..f7e0b9537 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/movie-add.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/movie-add.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -12,7 +12,7 @@ - IMDB ID: + IMDB id: diff --git a/lib/copy_this/www/templates/nntmux/views/admin/movie-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/movie-edit.tpl index 390752360..526f9b5a5 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/movie-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/movie-edit.tpl @@ -3,17 +3,17 @@ - + - IMDB ID: - {$movie.imdbID} + IMDB id: + {$movie.imdbid} - TMDb ID: + TMDb id: {$movie.tmdbID} @@ -85,7 +85,7 @@ {if $movie.cover == 1} - + {/if} @@ -95,7 +95,7 @@ {if $movie.backdrop == 1} - + {/if} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/movie-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/movie-list.tpl index d39eaa36c..dd02a1528 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/movie-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/movie-list.tpl @@ -1,4 +1,4 @@ -{$page->title} +{$page->title} {if $movielist} @@ -19,26 +19,26 @@ - IMDB ID - TMDb ID + IMDB id + TMDb id Title Cover Backdrop Created options - + {foreach from=$movielist item=movie} - {$movie.imdbID} + {$movie.imdbid} {$movie.tmdbID} - {$movie.title} ({$movie.year}) + {$movie.title} ({$movie.year}) {if $movie.cover == "1"}Yes{else}No{/if} {if $movie.backdrop == "1"}Yes{else}No{/if} {$movie.createddate|date_format} - update | - delete + update | + delete {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/music-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/music-edit.tpl index b3d72b0d1..985c0fc8b 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/music-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/music-edit.tpl @@ -1,9 +1,9 @@ - + {$page->title} - + @@ -68,7 +68,7 @@ {foreach from=$genres item=gen} - {$gen.title|escape:'htmlall'} + {$gen.title|escape:'htmlall'} {/foreach} @@ -87,7 +87,7 @@ {if $music.cover == 1} - + {/if} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/music-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/music-list.tpl index d674d9bca..1d80c484a 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/music-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/music-list.tpl @@ -1,4 +1,4 @@ -{$page->title} +{$page->title} {if $musiclist} {$pager} @@ -6,16 +6,16 @@ - ID + id Title Artist Created - + {foreach from=$musiclist item=music} - {$music.ID} - {$music.title} ({$music.year}) + {$music.id} + {$music.title} ({$music.year}) {$music.artist} {$music.createddate|date_format} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/nzb-export.tpl b/lib/copy_this/www/templates/nntmux/views/admin/nzb-export.tpl index ef359caa7..97e2a90aa 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/nzb-export.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/nzb-export.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -43,9 +43,9 @@ If you are exporting a large number of nzb files, run this script from the comma - Category: + Category: - {html_options id="categoryID" name='categoryID' options=$catlist selected=$cat} + {html_options id="categoryid" name='categoryid' options=$catlist selected=$cat} Posted to this category diff --git a/lib/copy_this/www/templates/nntmux/views/admin/preview-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/preview-list.tpl index 7bff6329c..bf1233800 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/preview-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/preview-list.tpl @@ -4,9 +4,9 @@ All {foreach from=$catlist item=parentcat} - {$parentcat.title} + {$parentcat.title} {foreach from=$parentcat.subcatlist item=subcat} - {$subcat.title} + {$subcat.title} {/foreach} {/foreach} @@ -23,15 +23,15 @@ preview options - + {foreach from=$releaselist item=release} - {$release.searchname|escape:"htmlall"|wordwrap:75:"\n":true} + {$release.searchname|escape:"htmlall"|wordwrap:75:"\n":true} - + {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/rage-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/rage-edit.tpl index 271c3da53..bfc1a009e 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/rage-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/rage-edit.tpl @@ -1,7 +1,7 @@ - + {$page->title} -Update from TV Rage +Update from TV Rage @@ -12,10 +12,10 @@ - Rage Id: + Rage Id: - - + + The numeric TVRage Id. @@ -55,7 +55,7 @@ Series Image: {if $rage.imgdata != ""} - + {/if} Shown in the TV series view page. @@ -81,7 +81,7 @@ function doDelete() { if (confirm('Are you sure?')) { - window.location = "rage-delete.php?id={$rage.ID}&from={$smarty.get.from}"; + window.location = "rage-delete.php?id={$rage.id}&from={$smarty.get.from}"; } } \ No newline at end of file diff --git a/lib/copy_this/www/templates/nntmux/views/admin/rage-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/rage-list.tpl index 12948341e..1fd3031bc 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/rage-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/rage-list.tpl @@ -1,4 +1,4 @@ -{$page->title} +{$page->title} {if $tvragelist} @@ -24,13 +24,13 @@ date options - + {foreach from=$tvragelist item=tvrage} - {$tvrage.rageID} - {$tvrage.releasetitle|escape:"htmlall"} + {$tvrage.rageid} + {$tvrage.releasetitle|escape:"htmlall"} {$tvrage.createddate|date_format} - delete | remove + delete | remove {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/regex-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/regex-edit.tpl index f62f450d0..b7f16e775 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/regex-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/regex-edit.tpl @@ -1,7 +1,7 @@ - + {$page->title} -{if $regex.ID > 0 && $regex.ID < 100000 && $site->reqidurl != ""} +{if $regex.id > 0 && $regex.id < 100000 && $site->reqidurl != ""} Warning: Editing system regex, these changes will be overwritten next update releases. {/if} @@ -17,7 +17,7 @@ Group: - + The full name of a valid newsgroup. This value can be a regular expression. Use .* to apply regex to all newsgroups. @@ -30,7 +30,7 @@ The regex to be applied. Regex requires at least 1 named capturing group in the form of (?P<name>) to work. If the subjects contains the number of parts (ie [1/10]) then it is wise to also use (?P<parts>) to match the parts. - + @@ -38,15 +38,15 @@ Description: {$regex.description|escape:html} - A description for this regex + A description for this regex Category: - {html_options id="category" name=category options=$catlist selected=$regex.categoryID} - If this regex indicates the release category then supply it here. If left blank the standard method of determining the category will apply. + {html_options id="category" name=category options=$catlist selected=$regex.categoryid} + If this regex indicates the release category then supply it here. If left blank the standard method of determining the category will apply. @@ -54,7 +54,7 @@ Ordinal: - The zero-based order in which the regex should be applied. + The zero-based order in which the regex should be applied. @@ -62,7 +62,7 @@ Active: {html_radios id="status" name='status' values=$status_ids output=$status_names selected=$regex.status separator=''} - Only active regexes are applied during the release process. + Only active regexes are applied during the release process. diff --git a/lib/copy_this/www/templates/nntmux/views/admin/regex-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/regex-list.tpl index 4d651cdc8..63a2f3e6c 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/regex-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/regex-list.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -29,21 +29,21 @@ Order Options - + {foreach from=$regexlist item=regex} - - {$regex.ID} + + {$regex.id} {if $regex.groupname==""}all{else}{$regex.groupname|replace:"alt.binaries":"a.b"}{/if} - {$regex.regex|escape:html} + {$regex.regex|escape:html} {$regex.description} {$regex.poster} - {if $regex.categoryID!=""}{$regex.categoryTitle}{/if} + {if $regex.categoryid!=""}{$regex.categoryTitle}{/if} {if $regex.status==1}active{else}disabled{/if} {$regex.num_releases} {$regex.max_releasedate} {$regex.ordinal} up | down - delete{if $regex.groupname != ""} | test{/if} + delete{if $regex.groupname != ""} | test{/if} {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/regex-submit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/regex-submit.tpl index 83a793d85..76e6b8c53 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/regex-submit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/regex-submit.tpl @@ -1,7 +1,7 @@ - + {$page->title} -Use this feature to submit any regex you have added locally to newznab. We'll have a look at integrating them into the master list. No data other than regex's with an ID greater than 10000 will be sent. +Use this feature to submit any regex you have added locally to newznab. We'll have a look at integrating them into the master list. No data other than regex's with an id greater than 10000 will be sent. {if $upload_status eq 'OK'} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/regex-test.tpl b/lib/copy_this/www/templates/nntmux/views/admin/regex-test.tpl index e955b6e28..63e58ac77 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/regex-test.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/regex-test.tpl @@ -1,4 +1,4 @@ - + {$page->title} {if $error != ''} @@ -14,7 +14,7 @@ or - + {html_options values=$gid output=$gnames selected=$groupID} @@ -69,14 +69,14 @@ poster Bin Count Bin Size - Regex ID - Req ID + Regex id + Req id Group Age {/if} - + @@ -87,8 +87,8 @@ {$match.bininfo[0].fromname|escape:"htmlall"} {$match.bincount}{if $match.reltotalparts != ''}/{$match.reltotalparts}{/if} {$match.totalsize|fsize_format:"MB"} - {$match.bininfo[0].regexID} - {$match.reqID} + {$match.bininfo[0].regexid} + {$match.reqid} {$match.bininfo[0].groupname|replace:"alt.binaries":"a.b"} {$match.bininfo[0].date|timeago} @@ -114,7 +114,7 @@ or - + {html_options values=$gid output=$gnames selected=$groupID} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/release-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/release-edit.tpl index 053bacdf9..6f4f32260 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/release-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/release-edit.tpl @@ -10,7 +10,7 @@ Original Name: - + @@ -41,7 +41,7 @@ Category: - {html_options id="category" name=category options=$catlist selected=$release.categoryID} + {html_options id="category" name=category options=$catlist selected=$release.categoryid} @@ -60,16 +60,16 @@ - Tv Rage Id: + Tv Rage Id: - + - TheTVDB Id: + TheTVDB Id: - + @@ -102,16 +102,16 @@ - IMDB Id: + IMDB Id: - + - Console Id: + Console Id: - + @@ -123,9 +123,9 @@ - Regex ID: + Regex id: - {$release.regexID} + {$release.regexid} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/release-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/release-list.tpl index 96b81d78e..326cf67c5 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/release-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/release-list.tpl @@ -1,4 +1,4 @@ -{$page->title} +{$page->title} {if $releaselist} {$pager} @@ -15,17 +15,17 @@ grabs options - + {foreach from=$releaselist item=release} - {$release.searchname|escape:"htmlall"|wordwrap:75:"\n":true} + {$release.searchname|escape:"htmlall"|wordwrap:75:"\n":true} {$release.category_name} {$release.size|fsize_format:"MB"} {$release.totalpart} {$release.postdate|date_format} {$release.adddate|date_format} {$release.grabs} - delete + delete {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/role-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/role-edit.tpl index 537d773d9..c0ed1e6cb 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/role-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/role-edit.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -8,8 +8,8 @@ Name: - - {if $role.ID != '' && $role.ID < 4}{$role.name}{else}The name of the role{/if} + + {if $role.id != '' && $role.id < 4}{$role.name}{else}The name of the role{/if} @@ -61,7 +61,7 @@ -{if $role.ID != ''} +{if $role.id != ''} Is Default Role: diff --git a/lib/copy_this/www/templates/nntmux/views/admin/role-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/role-list.tpl index ded17b254..bff3a392d 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/role-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/role-list.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -15,10 +15,10 @@ options - + {foreach from=$userroles item=role} - {$role.name} + {$role.name} {$role.apirequests} {$role.downloadrequests} {$role.defaultinvites} @@ -26,7 +26,7 @@ {if $role.canpre == 1}Yes{else}No{/if} {if $role.hideads == 1}Yes{else}No{/if} {if $role.isdefault=="1"}Yes{else}No{/if} - edit {if $role.ID>"3"}delete{/if} + edit {if $role.id>"3"}delete{/if} {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/sharing.tpl b/lib/copy_this/www/templates/nntmux/views/admin/sharing.tpl index a4a98ee94..20b30931d 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/sharing.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/sharing.tpl @@ -162,7 +162,7 @@ - ID + id Name First seen Last seen @@ -171,21 +171,21 @@ {foreach from=$sites item=site} - - {$site.ID} + + {$site.id} {$site.site_name} {$site.first_time|timeago} {$site.last_time|timeago} - + {if $site.enabled=="1"} - Disable + Disable {else} - Enable + Enable {/if} {$site.comments} - Purge + Purge {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/site-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/site-edit.tpl index 8233d79a4..389debf9a 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/site-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/site-edit.tpl @@ -1168,14 +1168,14 @@ Lookup Request IDs: {html_options style="width:180px;" id="lookup_reqids" name='lookup_reqids' values=$lookup_reqids_ids output=$lookup_reqids_names selected=$fsite->lookup_reqids} - Whether to attempt to lookup Request IDs using the Request ID link below. This will rename your releases to proper PreDB names. + Whether to attempt to lookup Request IDs using the Request id link below. This will rename your releases to proper PreDB names. - Request ID Link: + Request id Link: - Optional URL to lookup Request IDs. [REQUEST_ID] gets replaced with the request ID from the + Optional URL to lookup Request IDs. [REQUEST_ID] gets replaced with the request id from the post. [GROUP_NM] Gets replaced with the group name. @@ -1184,7 +1184,7 @@ Max hours to recheck Request IDs: - The maximum hours after a release is added to recheck for a Request ID match. + The maximum hours after a release is added to recheck for a Request id match. @@ -1459,10 +1459,10 @@ - Request ID Threads: + Request id Threads: - The number of threads for local Request ID processing. + The number of threads for local Request id processing. diff --git a/lib/copy_this/www/templates/nntmux/views/admin/site-stats.tpl b/lib/copy_this/www/templates/nntmux/views/admin/site-stats.tpl index 630b33577..a66ea97df 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/site-stats.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/site-stats.tpl @@ -1,4 +1,4 @@ - + {$page->title} {if $topgrabs|count > 0} @@ -12,11 +12,11 @@ {foreach from=$topgrabs item=result} - {$result.username} + {$result.username} {$result.grabs} {/foreach} - + @@ -73,19 +73,19 @@ {foreach from=$usersbyhosthash item=result} - + {$result.hosthash} {assign var="usersplits" value=","|explode:$result.user_string} {foreach from=$usersplits item=usersplit} {$usersplit} - {/foreach} + {/foreach} {assign var="usernsplits" value=","|explode:$result.user_names} {foreach from=$usernsplits item=usernsplit} {$usernsplit} - {/foreach} + {/foreach} {/foreach} @@ -134,12 +134,12 @@ {foreach from=$topdownloads item=result} {$result.searchname|escape:"htmlall"|replace:".":" "} - {if $isadmin}[Edit]{/if} + {if $isadmin}[Edit]{/if} {$result.grabs} {$result.adddate|timeago} {/foreach} - + @@ -159,7 +159,7 @@ {$result.count} {/foreach} - + @@ -181,6 +181,6 @@ {$result.adddate|timeago} {/foreach} - + {/if} \ No newline at end of file diff --git a/lib/copy_this/www/templates/nntmux/views/admin/spotnab-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/spotnab-edit.tpl index 00a6221e9..7d74aa219 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/spotnab-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/spotnab-edit.tpl @@ -1,4 +1,4 @@ - + {$page->title} @@ -8,9 +8,9 @@ Name: - + - A name or description for the source. + A name or description for the source. @@ -18,28 +18,28 @@ Poster Username: - The username part of the poster. eg nntp + The username part of the poster. eg nntp Poster E-mail: - The email part of the poster. eg spot@nntp.com + The email part of the poster. eg spot@nntp.com Usenet Group: - Group to search when looking up posts for this source. + Group to search when looking up posts for this source. Public Key: {$source.publickey|escape:html} - Public Key needed to decode the posts specific for this source. + Public Key needed to decode the posts specific for this source. diff --git a/lib/copy_this/www/templates/nntmux/views/admin/spotnab-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/spotnab-list.tpl index 009ba4fc6..0bfd8824d 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/spotnab-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/spotnab-list.tpl @@ -1,4 +1,4 @@ - + {$page->title} {if $spotnab|@count == 0} @@ -15,11 +15,11 @@ No available sources. Add one? last update options - + {foreach from=$spotnab item=source} - {$source.description} - {if $source.active=="1"}active{else}inactive{/if} + {$source.description} + {if $source.active=="1"}active{else}inactive{/if} {$source.comments} {if $source.lastbroadcast != null} @@ -35,7 +35,7 @@ No available sources. Add one? n/a {/if} - edit delete + edit delete {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-edit.tpl index 4c9b07870..c1b55a8a0 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-edit.tpl @@ -8,9 +8,9 @@ - tvdbID: + tvdbid: - + @@ -57,9 +57,9 @@ - imdbID: + imdbid: - + diff --git a/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-list.tpl b/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-list.tpl index 373cd50aa..b457497b5 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-list.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-list.tpl @@ -19,16 +19,16 @@ - TheTVDB ID + TheTVDB id Title Options {foreach from=$serieslist item=thetvdb} - {$thetvdb.tvdbID} - {$thetvdb.seriesname|escape:"htmlall"} - delete | remove + {$thetvdb.tvdbid} + {$thetvdb.seriesname|escape:"htmlall"} + delete | remove {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-remove.tpl b/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-remove.tpl index bbf12af25..1c245f125 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-remove.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/thetvdb-remove.tpl @@ -1,4 +1,4 @@ {$page->title} -Removed tvdbID from {$numtv} releases. \ No newline at end of file +Removed tvdbid from {$numtv} releases. \ No newline at end of file diff --git a/lib/copy_this/www/templates/nntmux/views/admin/tmux-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/tmux-edit.tpl index dc33ad177..280282ac3 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/tmux-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/tmux-edit.tpl @@ -121,10 +121,10 @@ release. The 'In Process' NZBs are total nzbs, inside the parenthesis is distinct nzbs and 'In Database' are nzbs that have all parts available and will be processed on next run. - The 'In Process' requestID is the number waiting to be processed and inside the parenthesis is the + The 'In Process' requestid is the number waiting to be processed and inside the parenthesis is the number changed since the script started. The 'In Database' is the total matches of releases to requestIDs and inside the parenthesis is percentage of total releases that you have matched to a - requestID. + requestid. The 'In Process' rows PC and Pron are simply subsets of the 'In Process' row Misc. There is no postprocessing specifically for these categories. The 'In Database' is the actual count for the category. diff --git a/lib/copy_this/www/templates/nntmux/views/admin/user-edit.tpl b/lib/copy_this/www/templates/nntmux/views/admin/user-edit.tpl index fbde31cb4..5abbaf6bc 100644 --- a/lib/copy_this/www/templates/nntmux/views/admin/user-edit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/admin/user-edit.tpl @@ -11,7 +11,7 @@ Name: - + @@ -27,12 +27,12 @@ Password: - {if $user.ID} + {if $user.id} Only enter a password if you want to change it. {/if} - {if $user.ID} + {if $user.id} Grabs: @@ -107,12 +107,12 @@ - {if $user.ID != ""} + {if $user.id != ""} @@ -181,7 +181,7 @@ {/if} {if $loggedin=="true"} - + {/if} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/books.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/books.tpl index dbe27a5ee..47c0c77eb 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/books.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/books.tpl @@ -76,7 +76,7 @@ @@ -84,7 +84,7 @@ {if $result.url != ""} + name="amazon{$result.bookinfoid}" title="View amazon page"> Amazon{/if} Grp diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/browse.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/browse.tpl index cb21ba447..1842a49b4 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/browse.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/browse.tpl @@ -7,7 +7,7 @@ Series List | Manage My Shows | - Rss + Rss @@ -110,19 +110,19 @@ {release_flag($result.searchname, browse)} - {if $result.nfoID > 0} 0} Nfo{/if} - {if $result.imdbID > 0} - Cover + {if $result.imdbid > 0} + Cover {/if} {if $result.preID > 0 && $userdata.canpre == 1} PreDB{/if} - {if $result.prehashID > 0}Prehash{/if} + {if $result.prehashid > 0}Prehash{/if} {if $result.movieinfoID > 0}Movie{/if} {if $result.haspreview == 1 && $userdata.canpreview == 1} {/if} - {if $result.musicinfoID > 0} 0}Cover{/if} - {if $result.consoleinfoID > 0} 0} Cover{/if} - {if $result.bookinfoID > 0} 0}Cover{/if} - {if $result.rageID > 0} 0}View Series{/if} {if $result.anidbid > 0} {$result.category_name} + href="{$smarty.const.WWW_TOP}/browse?t={$result.categoryid}">{$result.category_name} {$result.postdate|timeago} {$result.size|fsize_format:"MB"}{if $result.completion > 0} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/cart.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/cart.tpl index 0d65d27b8..2fbad4153 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/cart.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/cart.tpl @@ -2,7 +2,7 @@ My Cart -Your cart can be downloaded as an Rss Feed. +Your cart can be downloaded as an Rss Feed. {if $results|@count > 0} @@ -36,7 +36,7 @@ Your cart can be downloaded as an delete {/foreach} - + diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/console.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/console.tpl index 202fd1a2b..6d87f0775 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/console.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/console.tpl @@ -16,7 +16,7 @@ {foreach from=$genres item=gen} - {$gen.title} + {$gen.title} {/foreach} @@ -24,7 +24,7 @@ {foreach from=$catlist item=ct} - {$ct.title} + {$ct.title} {/foreach} @@ -120,17 +120,17 @@ - {if $result.nfoID > 0} 0} Nfo{/if} {if $result.url != ""} + name="amazon{$result.consoleinfoid}" title="View amazon page"> Amazon{/if} Grp @@ -154,10 +154,10 @@ title="View similar nzbs">Similar {if $isadmin} Edit Del {/if} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/dlbrowse.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/dlbrowse.tpl index a92b886cc..35e9c6504 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/dlbrowse.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/dlbrowse.tpl @@ -4,7 +4,7 @@ /{$subpath|escape:"htmlall"} -View: +View: {if $lm}Covers | List {else}Covers | List{/if} @@ -24,19 +24,19 @@ View: .. {/if} - + {foreach from=$results item=result} - - {assign var="icon" value='templates/nntmux/images/fileicons/'|cat:$result.pathinfo.extension|cat:".png"} + + {assign var="icon" value='templates/nntmux/images/fileicons/'|cat:$result.pathinfo.extension|cat:".png"} {if $result.isdir == "1"} {assign var="icon" value='folder'} {elseif $result.pathinfo.extension == "" || !is_file("$icon")} {assign var="icon" value='file'} {else} {assign var="icon" value=$result.pathinfo.extension} - {/if} - + {/if} + {if $result.isdir == 1} @@ -62,7 +62,7 @@ View: {if $result.release.ep_airdate != ''}Aired: {$result.release.ep_airdate|date_format}{/if} {if $result.release.ep_fullep != ''}Episode: {$result.release.ep_fullep}{/if} - {/if} + {/if} {if $result.release.music_id != ""} @@ -70,12 +70,12 @@ View: {if $result.release.mu_artist != ''}{$result.release.mu_artist}{/if} {if $result.release.mu_year != ''}Year: {$result.release.mu_year}{/if} - {/if} - + {/if} + {if $result.release.music_id == "" && $result.release.ep_id == "" && $result.release.movie_id == ""} {/if} - {if $result.release.ID != ""} + {if $result.release.id != ""} More Info {/if} @@ -85,25 +85,25 @@ View: {/if} - {if $result.release.categoryID != ""} - {$result.release.category_name} + {if $result.release.categoryid != ""} + {$result.release.category_name} {/if} {if $result.release.movie_id != ""} - + {/if} {if $result.release.rage_imgdata != ""} - {/if} + {/if} {if $result.release.mu_cover == "1"} - {/if} + {/if} {$result.mtime|timeago} {/foreach} - + diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/forum.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/forum.tpl index 0bdcb41b4..57fbad568 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/forum.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/forum.tpl @@ -1,6 +1,6 @@ Forum - + {if $results|@count > 0} {$pager} @@ -18,9 +18,9 @@ {foreach from=$results item=result} - - - {$result.subject|escape:"htmlall"|truncate:100:'...':true:true} + + + {$result.subject|escape:"htmlall"|truncate:100:'...':true:true} {$result.message|escape:"htmlall"|truncate:200:'...':false:false} @@ -31,12 +31,12 @@ on {$result.createddate|date_format} ({$result.createddate|timeago}) - {$result.updateddate|date_format} ({$result.updateddate|timeago}) + {$result.updateddate|date_format} ({$result.updateddate|timeago}) {$result.replies} {/foreach} - + Top diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/forumpost.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/forumpost.tpl index 1c10888c3..97012692c 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/forumpost.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/forumpost.tpl @@ -24,15 +24,15 @@ on {$result.createddate|date_format} ({$result.createddate|timeago}) {if $userdata.role==2} - Delete + Delete {/if} - + {$result.message|escape:"htmlall"|nl2br|magicurl} {/foreach} - + Top diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/games.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/games.tpl index 63353b1f8..409757c80 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/games.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/games.tpl @@ -17,7 +17,7 @@ {foreach from=$genres item=gen} - {$gen.title} + {$gen.title} {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/headermenu.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/headermenu.tpl index 2f81b41cf..48b5ccbf8 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/headermenu.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/headermenu.tpl @@ -2,55 +2,55 @@ {foreach from=$parentcatlist item=parentcat} - {if $parentcat.ID == 1000 && $userdata.consoleview=="1"} + {if $parentcat.id == 1000 && $userdata.consoleview=="1"} {$parentcat.title} {foreach from=$parentcat.subcatlist item=subcat} {$subcat.title} + href="{$smarty.const.WWW_TOP}/console?t={$subcat.id}">{$subcat.title} {/foreach} - {elseif $parentcat.ID == 2000 && $userdata.movieview=="1"} + {elseif $parentcat.id == 2000 && $userdata.movieview=="1"} {$parentcat.title} {foreach from=$parentcat.subcatlist item=subcat} {$subcat.title} + href="{$smarty.const.WWW_TOP}/movies?t={$subcat.id}">{$subcat.title} {/foreach} - {elseif ($parentcat.ID == 3000 && $userdata.musicview=="1")} + {elseif ($parentcat.id == 3000 && $userdata.musicview=="1")} {$parentcat.title} {foreach from=$parentcat.subcatlist item=subcat} - {if $subcat.ID == 3030} + {if $subcat.id == 3030} {$subcat.title} + href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title} {else} {$subcat.title} + href="{$smarty.const.WWW_TOP}/music?t={$subcat.id}">{$subcat.title} {/if} {/foreach} - {elseif ($parentcat.ID == 4000 && $userdata.gameview=="1")} + {elseif ($parentcat.id == 4000 && $userdata.gameview=="1")} {$parentcat.title} {foreach from=$parentcat.subcatlist item=subcat} - {if $subcat.ID == 4050} + {if $subcat.id == 4050} {$subcat.title} {else} {$subcat.title} + href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title} {/if} {/foreach} - {elseif ($parentcat.ID == 6000 && $userdata.xxxview=="1" && $site->lookupxxx=="1")} + {elseif ($parentcat.id == 6000 && $userdata.xxxview=="1" && $site->lookupxxx=="1")} {$subcat.title} + href="{$smarty.const.WWW_TOP}/xxx?t={$subcat.id}">{$subcat.title} {else} {$subcat.title} + href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title} {/if} {/foreach} @@ -86,11 +86,11 @@ {foreach from=$parentcat.subcatlist item=subcat} {if $subcat.id == 6010 OR 6020 OR 6030 OR 6040} {$subcat.title} + href="{$smarty.const.WWW_TOP}/xxx?t={$subcat.id}">{$subcat.title} {else} {$subcat.title} + href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title} {/if} {/foreach} @@ -98,15 +98,15 @@ {else} {$parentcat.title} + href="{$smarty.const.WWW_TOP}/browse?t={$parentcat.id}">{$parentcat.title} {foreach from=$parentcat.subcatlist item=subcat} - {if ($subcat.ID == 7020 && $userdata.bookview=="1")} + {if ($subcat.id == 7020 && $userdata.bookview=="1")} {$subcat.title} {else} {$subcat.title} + href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title} {/if} {/foreach} @@ -124,15 +124,15 @@ - + Search Category All {foreach from=$parentcatlist item=parentcat} - {$parentcat.title} + {$parentcat.title} {foreach from=$parentcat.subcatlist item=subcat} - {$subcat.title} + {$subcat.title} {/foreach} {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/movies.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/movies.tpl index bbb0370d5..3dde6d9ae 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/movies.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/movies.tpl @@ -44,7 +44,7 @@ {foreach from=$catlist item=ct} - {$ct.title} + {$ct.title} {/foreach} @@ -109,21 +109,21 @@ - {if $result.trailer != ""}Trailer{/if} + {if $result.trailer != ""}Trailer{/if} @@ -132,15 +132,15 @@ class="sendtocouch" target="blackhole" href="javascript:;" - rel="{$cpurl}/api/{$cpapi}/movie.add/?identifier=tt{$result.imdbID}&title={$result.title}" - name="CP{$result.imdbID}" + rel="{$cpurl}/api/{$cpapi}/movie.add/?identifier=tt{$result.imdbid}&title={$result.title}" + name="CP{$result.imdbid}" title="Add to CouchPotato" > {/if} {$result.title|stripslashes|escape:"htmlall"} + href="{$smarty.const.WWW_TOP}/movies/?imdb={$result.imdbid}">{$result.title|stripslashes|escape:"htmlall"} ({$result.year}) {if $result.rating != ''}{$result.rating}/10{/if} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/music.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/music.tpl index a39625297..737e4654d 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/music.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/music.tpl @@ -20,8 +20,8 @@ {foreach from=$genres item=gen} - {$gen.title|escape:"htmlall"} + {$gen.title|escape:"htmlall"} {/foreach} @@ -37,7 +37,7 @@ {foreach from=$catlist item=ct} - {$ct.title} + {$ct.title} {/foreach} @@ -126,7 +126,7 @@ @@ -136,7 +136,7 @@ title="View Nfo" class="btn btn-mini modal_nfo" rel="nfo"> Nfo{/if} Amazon + name="amazon{$result.musicinfoid}" title="View amazon page">Amazon Grp diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/mymovies.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/mymovies.tpl index 785ad903a..8b6a06d98 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/mymovies.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/mymovies.tpl @@ -1,7 +1,7 @@ {$page->title} -Using 'My Movies' you can search for movies, and add them to a wishlist. If the movie becomes available it will be added to an Rss Feed you can use to automatically download. You can Manage Your Movie List to remove old items. +Using 'My Movies' you can search for movies, and add them to a wishlist. If the movie becomes available it will be added to an Rss Feed you can use to automatically download. You can Manage Your Movie List to remove old items. diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/mymoviesedit.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/mymoviesedit.tpl index d5f181c7b..b4b67697e 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/mymoviesedit.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/mymoviesedit.tpl @@ -1,7 +1,7 @@ {$page->title} -Use this page to manage movies added to your personal list. If the movie becomes available it will be added to an Rss Feed you can use to automatically download. To add more movies use the My Movies search feature. +Use this page to manage movies added to your personal list. If the movie becomes available it will be added to an Rss Feed you can use to automatically download. To add more movies use the My Movies search feature. {if $movies|@count > 0} @@ -20,11 +20,11 @@ Use this page to manage movies added to your personal list. If the movie becomes - + - + - Imdb + Imdb @@ -40,10 +40,10 @@ Use this page to manage movies added to your personal list. If the movie becomes {if $movie.categoryNames != ''}{$movie.categoryNames|escape:"htmlall"}{else}All{/if} {$movie.createddate|date_format} - Remove + Remove {/foreach} - + {else} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/myshows.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/myshows.tpl index 2207174c8..806a34d5c 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/myshows.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/myshows.tpl @@ -2,9 +2,9 @@ {$page->title} -Series List | -Browse My Shows | -Rss Feed +Series List | +Browse My Shows | +Rss Feed {if $shows|@count > 0} @@ -20,14 +20,14 @@ {foreach from=$shows item=show} - {$show.releasetitle|escape:"htmlall"|wordwrap:75:"\n":true} + {$show.releasetitle|escape:"htmlall"|wordwrap:75:"\n":true} {if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if} {$show.createddate|date_format} - Edit Remove + Edit Remove {/foreach} - + {else} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/newposterwall.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/newposterwall.tpl index a1567fb5e..2dc7e0eee 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/newposterwall.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/newposterwall.tpl @@ -43,19 +43,19 @@ href="{$smarty.const.WWW_TOP}/details/{$result.guid}"> {if $type == 'Console'} + src="{$smarty.const.WWW_TOP}/covers/console/{$result.consoleinfoid}.jpg"/> {elseif $type == 'Movies'} + src="{$smarty.const.WWW_TOP}/covers/movies/{$result.imdbid}-cover.jpg"/> {elseif $type == 'XXX'} {elseif $type == 'Audio'} + src="{$smarty.const.WWW_TOP}/covers/music/{$result.musicinfoid}.jpg"/> {elseif $type == 'Books'} + src="{$smarty.const.WWW_TOP}/covers/book/{$result.bookinfoid}.jpg"/> {elseif $type == 'PC'} @@ -97,17 +97,17 @@ {elseif $type == 'Movies'} + href="{$site->dereferrer_link}http://www.imdb.com/title/tt{$result.imdbid}/"> + href="{$site->dereferrer_link}http://trakt.tv/search/imdb/tt{$result.imdbid}/"> {if $cpapi != '' && $cpurl != ''} + rel="{$cpurl}/api/{$cpapi}/movie.add/?identifier=tt{$result.imdbid}&title={$result.searchname|escape:"url"}"> {/if} {elseif $type == 'XXX'} @@ -176,7 +176,7 @@ {elseif $type == 'TV'} {/if} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/prehash.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/prehash.tpl index b1b4eef8e..187087e04 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/prehash.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/prehash.tpl @@ -216,15 +216,15 @@ {/if} - {if is_numeric({$result.requestID}) && {$result.requestID} != 0} + {if is_numeric({$result.requestid}) && {$result.requestid} != 0} - {$result.requestID} + {$result.requestid} {else} N/A diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/profile.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/profile.tpl index 49b333138..29c614dab 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/profile.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/profile.tpl @@ -3,19 +3,19 @@ Username:{$user.username|escape:"htmlall"} - {if $user.ID==$userdata.ID || $userdata.role==2}Email:{$user.email}{/if} + {if $user.id==$userdata.id || $userdata.role==2}Email:{$user.email}{/if} Registered:{$user.createddate|date_format} ({$user.createddate|timeago} ago) Last Login:{$user.lastlogin|date_format} ({$user.lastlogin|timeago} ago) Role:{$user.rolename} - {if $userdata.role==2}Notes:{$user.notes|escape:htmlall}{if $user.notes|count_characters > 0}{/if}Add/Edit{/if} - {if $user.ID==$userdata.ID || $userdata.role==2}Site Api/Rss Key:{$user.rsstoken}{/if} - {if $user.ID==$userdata.ID || $userdata.role==2} - API Hits Today:{$apihits.num} {if $userdata.role==2 && $apihits.num > 0}Reset{/if} - Grabs Today:{$grabstoday.num} {if $grabstoday.num >= $user.downloadrequests} (Next DL in {($grabstoday.nextdl/3600)|intval}h {($grabstoday.nextdl/60) % 60}m){/if}{if $userdata.role==2 && $grabstoday.num > 0}Reset{/if} + {if $userdata.role==2}Notes:{$user.notes|escape:htmlall}{if $user.notes|count_characters > 0}{/if}Add/Edit{/if} + {if $user.id==$userdata.id || $userdata.role==2}Site Api/Rss Key:{$user.rsstoken}{/if} + {if $user.id==$userdata.id || $userdata.role==2} + API Hits Today:{$apihits.num} {if $userdata.role==2 && $apihits.num > 0}Reset{/if} + Grabs Today:{$grabstoday.num} {if $grabstoday.num >= $user.downloadrequests} (Next DL in {($grabstoday.nextdl/3600)|intval}h {($grabstoday.nextdl/60) % 60}m){/if}{if $userdata.role==2 && $grabstoday.num > 0}Reset{/if} {/if} Grabs Total:{$user.grabs} - {if ($user.ID==$userdata.ID || $userdata.role==2) && $site->registerstatus==1} + {if ($user.id==$userdata.id || $userdata.role==2) && $site->registerstatus==1} Invites: {$user.invites} @@ -49,8 +49,8 @@ {if $user.bookview == "1"}View book covers{else}View standard book category{/if} - {if $user.ID==$userdata.ID || $userdata.role==2}Excluded Categories:{$exccats|replace:",":""}{/if} - {if $page->site->sabintegrationtype == 2 && $user.ID==$userdata.ID} + {if $user.id==$userdata.id || $userdata.role==2}Excluded Categories:{$exccats|replace:",":""}{/if} + {if $page->site->sabintegrationtype == 2 && $user.id==$userdata.id} SABnzbd Integration: Url: {if $saburl == ''}N/A{else}{$saburl}{/if} @@ -67,7 +67,7 @@ Key: {if $user.cp_api == ''}N/A{else}{$user.cp_api}{/if} - {if ($user.ID==$userdata.ID)} + {if ($user.id==$userdata.id)} NZBVortex @@ -78,13 +78,13 @@ {/if} - {if $user.ID==$userdata.ID} + {if $user.id==$userdata.id} My TV Shows:Manage my shows My Movies:Manage my movies {/if} - {if $user.ID==$userdata.ID}Edit{/if} + {if $user.id==$userdata.id}Edit{/if} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/recentforumposts.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/recentforumposts.tpl index 184100189..0d6f5b3d8 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/recentforumposts.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/recentforumposts.tpl @@ -1,10 +1,10 @@ {if $recentforumpostslist|@count > 0} - - Recent Posts + + Recent Posts {foreach from=$recentforumpostslist item=content} - {$content.subject|escape:htmlall} + {$content.subject|escape:htmlall} {/foreach} @@ -12,4 +12,4 @@ {/if} - + diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/rss.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/rss.tpl index 0258895cc..7109bf893 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/rss.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/rss.tpl @@ -5,43 +5,43 @@ {$release.searchname|escape:html} {$serverroot}details/{$release.guid} {$serverroot}{if $dl=="1"}getnzb{else}details{/if}/{$release.guid}{if $dl=="1"}.nzb&i={$uid}&r={$rsstoken}{/if}{if $del=="1"}&del=1{/if} - {$serverroot}details/{$release.guid}#comments - {$release.adddate|phpdate_format:"DATE_RSS"} - {$release.category_name|escape:html} + {$serverroot}details/{$release.guid}#comments + {$release.adddate|phpdate_format:"DATE_RSS"} + {$release.category_name|escape:html} {if $api=="1"}{$release.searchname}{else} {if $release.cover == 1} - + {/if} {if $release.mu_cover == 1} - - {/if} + + {/if} {if $release.co_cover == 1} - - {/if} + + {/if} {if $release.bo_cover == 1} - - {/if} + + {/if} - ID: {$release.guid} + id: {$release.guid} Name: {$release.searchname} Size: {$release.size|fsize_format:"MB"} - Attributes: Category - {$release.category_name} + Attributes: Category - {$release.category_name} Groups: {$release.group_name} Poster: {$release.fromname|escape:"htmlall"} PostDate: {$release.postdate|phpdate_format:"DATE_RSS"} Password: {if $release.passwordstatus == 0}None{elseif $release.passwordstatus == 2}Passworded Rar Archive{elseif $release.passwordstatus == 1}Contains Cab/Ace/RAR Archive{else}Unknown{/if} - - {if $release.nfoID != ""} + + {if $release.nfoid != ""} Nfo: {$release.searchname}.nfo {/if} - + {if $release.parentCategoryID == 2000} - {if $release.imdbID != ""} - Imdb Info: + {if $release.imdbid != ""} + Imdb Info: - IMDB Link: {$release.imdbtitle|escape:"htmlall"} + IMDB Link: {$release.imdbtitle|escape:"htmlall"} {if $release.rating != ""}Rating: {$release.rating|escape:"htmlall"}{/if} {if $release.plot != ""}Plot: {$release.plot|escape:"htmlall"}{/if} {if $release.year != ""}Year: {$release.year|escape:"htmlall"}{/if} @@ -52,10 +52,10 @@ {/if} {/if} - + {if $release.parentCategoryID == 3000} - {if $release.musicinfoID > 0} - Music Info: + {if $release.musicinfoid > 0} + Music Info: {if $release.mu_url != ""}Amazon: {$release.mu_title|escape:"htmlall"}{/if} {if $release.mu_artist != ""}Artist: {$release.mu_artist|escape:"htmlall"}{/if} @@ -69,18 +69,18 @@ {assign var="tracksplits" value="|"|explode:$release.mu_tracks} {foreach from=$tracksplits item=tracksplit} {$tracksplit|trim|escape:"htmlall"} - {/foreach} + {/foreach} - + {/if} {/if} - {/if} + {/if} {if $release.parentCategoryID == 1000} - {if $release.consoleinfoID > 0} - Console Info: + {if $release.consoleinfoid > 0} + Console Info: {if $release.co_url != ""}Amazon: {$release.co_title|escape:"htmlall"}{/if} {if $release.co_genre != ""}Genre: {$release.co_genre|escape:"htmlall"}{/if} @@ -90,11 +90,11 @@ {/if} - {/if} + {/if} - {if $release.categoryID == 7020} - {if $release.bookinfoID > 0} - Console Info: + {if $release.categoryid == 7020} + {if $release.bookinfoid > 0} + Console Info: {if $release.bo_author != ""}Author: {$release.bo_author|escape:"htmlall"}{/if} {if $release.bo_url != ""}Amazon: {$release.bo_title|escape:"htmlall"}{/if} @@ -104,10 +104,10 @@ {/if} - {/if} - + {/if} + - + {/strip}]]> @@ -129,15 +129,15 @@ {/if} {if $release.showtitle != ""} {$release.showtitle|escape:html} {/if} -{if $release.rageID != "-1" && $release.rageID != "-2"} +{if $release.rageid != "-1" && $release.rageid != "-2"} {/if} {if $release.tvtitle != ""} {/if} {if $release.tvairdate != ""} {/if} -{if $release.imdbID != ""} +{if $release.imdbid != ""} {/if} -{if $release.tvdbID != ""} +{if $release.tvdbid != ""} {/if} {if $release.ep_tvdbID != ""} {/if} @@ -163,9 +163,9 @@ - + - + {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/rssdesc.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/rssdesc.tpl index 9510e8cbf..91913e941 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/rssdesc.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/rssdesc.tpl @@ -1,55 +1,55 @@ - + {$page->title} - Here you can choose rss feeds from site categories. The feeds will present either decriptions or + Here you can choose rss feeds from site categories. The feeds will present either decriptions or downloads of Nzb files. - + - Add this string to your feed URL to allow NZB downloads without logging in: &i={$userdata.ID}&r={$userdata.rsstoken} + Add this string to your feed URL to allow NZB downloads without logging in: &i={$userdata.id}&r={$userdata.rsstoken} - To remove the nzb from your cart after download add this string to your feed URL: &del=1 + To remove the nzb from your cart after download add this string to your feed URL: &del=1 To change the default link to download an nzb: &dl=1 - To change the number of results (default is 25, max is 100) returned: &num=50 + To change the number of results (default is 25, max is 100) returned: &num=50 - To return TV shows only aired in the last x days (default is all): &airdate=20 + To return TV shows only aired in the last x days (default is all): &airdate=20 - + Most Nzb clients which support Nzb rss feeds will appreciate the full URL, with download link and your user token. - + The feeds include additional attributes to help provide better filtering in your Nzb client, such as size, group and categorisation. If you want to chain multiple categories together or do more advanced searching, use the api, which returns its data in an rss compatible format. - + Available Feeds General Full site feed - {$smarty.const.WWW_TOP}/rss?t=0&dl=1&i={$userdata.ID}&r={$userdata.rsstoken} + {$smarty.const.WWW_TOP}/rss?t=0&dl=1&i={$userdata.id}&r={$userdata.rsstoken} My cart feed - {$smarty.const.WWW_TOP}/rss?t=-2&dl=1&i={$userdata.ID}&r={$userdata.rsstoken}&del=1 + {$smarty.const.WWW_TOP}/rss?t=-2&dl=1&i={$userdata.id}&r={$userdata.rsstoken}&del=1 My shows feed - {$smarty.const.WWW_TOP}/rss?t=-3&dl=1&i={$userdata.ID}&r={$userdata.rsstoken}&del=1 + {$smarty.const.WWW_TOP}/rss?t=-3&dl=1&i={$userdata.id}&r={$userdata.rsstoken}&del=1 My movies feed - {$smarty.const.WWW_TOP}/rss?t=-4&dl=1&i={$userdata.ID}&r={$userdata.rsstoken}&del=1 + {$smarty.const.WWW_TOP}/rss?t=-4&dl=1&i={$userdata.id}&r={$userdata.rsstoken}&del=1 @@ -57,8 +57,8 @@ {foreach from=$parentcategorylist item=category} - {$category.title} feed - {$smarty.const.WWW_TOP}/rss?t={$category.ID}&dl=1&i={$userdata.ID}&r={$userdata.rsstoken} + {$category.title} feed + {$smarty.const.WWW_TOP}/rss?t={$category.id}&dl=1&i={$userdata.id}&r={$userdata.rsstoken} {/foreach} @@ -69,32 +69,32 @@ {foreach from=$categorylist item=category} - {$category.title} feed - {$smarty.const.WWW_TOP}/rss?t={$category.ID}&dl=1&i={$userdata.ID}&r={$userdata.rsstoken} + {$category.title} feed + {$smarty.const.WWW_TOP}/rss?t={$category.id}&dl=1&i={$userdata.id}&r={$userdata.rsstoken} {/foreach} - + Multi Category Multiple categories separated by comma. - {$smarty.const.WWW_TOP}/rss?t=1000,2000,3010&dl=1&i={$userdata.ID}&r={$userdata.rsstoken} + {$smarty.const.WWW_TOP}/rss?t=1000,2000,3010&dl=1&i={$userdata.id}&r={$userdata.rsstoken} Additional Feeds - Tv Series (Use the TVRage ID) - {$smarty.const.WWW_TOP}/rss/?rage=1234&dl=1&i={$userdata.ID}&r={$userdata.rsstoken} + Tv Series (Use the TVRage id) + {$smarty.const.WWW_TOP}/rss/?rage=1234&dl=1&i={$userdata.id}&r={$userdata.rsstoken} - Tv Series aired in last seven days (Using the TVRage ID and airdate) - {$smarty.const.WWW_TOP}/rss/?rage=1234&airdate=7&dl=1&i={$userdata.ID}&r={$userdata.rsstoken} + Tv Series aired in last seven days (Using the TVRage id and airdate) + {$smarty.const.WWW_TOP}/rss/?rage=1234&airdate=7&dl=1&i={$userdata.id}&r={$userdata.rsstoken} - Anime Feed (Use the AniDB ID) - {$smarty.const.WWW_TOP}/rss/?anidb=1234&dl=1&i={$userdata.ID}&r={$userdata.rsstoken} + Anime Feed (Use the AniDB id) + {$smarty.const.WWW_TOP}/rss/?anidb=1234&dl=1&i={$userdata.id}&r={$userdata.rsstoken} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/search.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/search.tpl index ddf0a001e..9f98d1f1e 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/search.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/search.tpl @@ -234,23 +234,23 @@ Nfo {/if} {if $result.imdbid > 0} - Cover + Cover {/if} {if $result.haspreview == 1 && $userdata.canpreview == 1} Preview{/if} {if $result.jpgstatus == 1 && $userdata.canpreview == 1} Sample{/if} {if $result.musicinfoid > 0} - Cover + Cover {/if} {if $result.consoleinfoid > 0} - Cover + Cover {/if} {if $result.rageid > 0} - View Series + View Series {/if} {if $result.anidbid > 0} - View Anime + View Anime {/if} {if $result.tvairdate != ""} Aired {if $result.tvairdate|strtotime > $smarty.now}in future{else}{$result.tvairdate|daysago}{/if} @@ -262,7 +262,7 @@ PreDB {/if} {if $result.prehashid > 0} - PreHash + PreHash {/if} {if $result.group_name != ""} {$result.group_name|escape:"htmlall"|replace:"alt.binaries.":"a.b."} @@ -271,7 +271,7 @@ - {$result.category_name} + {$result.category_name} {$result.postdate|timeago} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/searchraw.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/searchraw.tpl index a3e071d69..5af123822 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/searchraw.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/searchraw.tpl @@ -43,15 +43,15 @@ {foreach from=$results item=result} - + {$result.name|escape:"htmlall"} {$result.group_name|replace:"alt.binaries":"a.b"} {$result.date|date_format} {if $isadmin} - {$result.procstat}/{$result.totalParts}/{if $result.regexID==""}_{else}{$result.regexID}{/if}/{$result.relpart}/{$result.reltotalpart} + {$result.procstat}/{$result.totalParts}/{if $result.regexid==""}_{else}{$result.regexid}{/if}/{$result.relpart}/{$result.reltotalpart} {if $result.binnum < $result.totalParts}{$result.binnum}/{$result.totalParts}{else}100%{/if} {/if} - {if $result.releaseID > 0}Yes{/if} + {if $result.releaseid > 0}Yes{/if} {/foreach} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/viewanime.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/viewanime.tpl index a4173c7b7..22a6f8ecb 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/viewanime.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/viewanime.tpl @@ -37,7 +37,7 @@ {if $animeImdbID > 0}View IMDb | {/if} - RSS + RSS feed for this Anime @@ -77,7 +77,7 @@ - {if $result.nfoID > 0} 0} Nfo{/if} {if $result.haspreview == 1 && $userdata.canpreview == 1} Edit Del {/if} @@ -105,7 +105,7 @@ {$result.category_name} + href="{$smarty.const.WWW_TOP}/anime/{$result.anidbid}?t={$result.categoryid}">{$result.category_name} {$result.postdate|timeago} {$result.size|fsize_format:"MB"}{if $result.completion > 0} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/viewbook.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/viewbook.tpl index e6ea4db2d..1b2739406 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/viewbook.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/viewbook.tpl @@ -1,6 +1,6 @@ - + {$book.author} - {$book.title} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/viewcalendar.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/viewcalendar.tpl index ef2c45062..4e6fa5722 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/viewcalendar.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/viewcalendar.tpl @@ -13,7 +13,7 @@ {foreach $predata as $s} - {$s.showtitle}{$s.fullep} - {$s.eptitle} + {$s.showtitle}{$s.fullep} - {$s.eptitle} {/foreach} {else} @@ -28,7 +28,7 @@ {foreach $daydata as $s} - {$s.showtitle}{$s.fullep} - {$s.eptitle} + {$s.showtitle}{$s.fullep} - {$s.eptitle} {/foreach} {else} @@ -43,7 +43,7 @@ {foreach $nxtdata as $s} - {$s.showtitle}{$s.fullep} - {$s.eptitle} + {$s.showtitle}{$s.fullep} - {$s.eptitle} {/foreach} {else} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/viewconsole.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/viewconsole.tpl index 440f7fe74..51905463a 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/viewconsole.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/viewconsole.tpl @@ -1,6 +1,6 @@ - + {$console.title} {if $console.year != ""}({$console.year}){/if} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/viewmovie.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/viewmovie.tpl index d0d4c87ed..eaec9c3d1 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/viewmovie.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/viewmovie.tpl @@ -3,12 +3,12 @@ For {$rel.searchname|escape:'htmlall'} {/if} -{if $movie.backdrop == 1}{/if} +{if $movie.backdrop == 1}{/if} {$movie.title|ss} {if $movie.year != ''}({$movie.year}){/if} -{if $movie.cover == 1}{/if} +{if $movie.cover == 1}{/if} {if $movie.tagline != ''}{$movie.tagline|ss}{/if} {if $movie.plot != ''} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/viewmoviefull.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/viewmoviefull.tpl index eb6015e1c..d18508119 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/viewmoviefull.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/viewmoviefull.tpl @@ -3,7 +3,7 @@ {foreach from=$results item=result} {if $result.cover == 1}{/if} + src="{$smarty.const.WWW_TOP}/covers/movies/{$result.imdbid}-cover.jpg" />{/if} {$result.title|escape:"htmlall"} ({$result.year}) {if $result.genre != ''}{$result.genre|replace:"|":" / "}{/if} @@ -27,7 +27,7 @@ {if $result.trailer != ''} Trailer: - Show trailer{/if} + Show trailer{/if} {if in_array("1", ","|explode:$result.grp_haspreview) && $userdata.canpreview == 1} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/viewmusic.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/viewmusic.tpl index db7d812aa..5f6a69702 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/viewmusic.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/viewmusic.tpl @@ -1,6 +1,6 @@ - + {$music.title} {if $music.year != ""}({$music.year}){/if} @@ -18,7 +18,7 @@ {assign var="tracksplits" value="|"|explode:$music.tracks} {foreach from=$tracksplits item=tracksplit} {$tracksplit|trim} - {/foreach} + {/foreach} {/if} diff --git a/lib/copy_this/www/templates/nntmux/views/frontend/viewnzb.tpl b/lib/copy_this/www/templates/nntmux/views/frontend/viewnzb.tpl index cacccbeec..f4d0fea7e 100644 --- a/lib/copy_this/www/templates/nntmux/views/frontend/viewnzb.tpl +++ b/lib/copy_this/www/templates/nntmux/views/frontend/viewnzb.tpl @@ -8,7 +8,7 @@ - {$release.category_name} + {$release.category_name} {$release.group_name|replace:"alt.binaries":"a.b"} @@ -39,26 +39,26 @@ -{if $rage && $release.rageID > 0 && $rage.imgdata != ""}{/if} -{if $movie && $release.rageID < 0 && $movie.cover == 1}{/if} +{if $rage && $release.rageid > 0 && $rage.imgdata != ""}{/if} +{if $movie && $release.rageid < 0 && $movie.cover == 1}{/if} {if $game && $game.cover == 1}{/if} {if $xxx && $xxx.cover == 1}{/if} -{if $anidb && $release.anidbID > 0 && $anidb.picture != ""}{/if} -{if $con && $con.cover == 1}{/if} -{if $music && $music.cover == 1}{/if} -{if $book && $book.cover == 1}{/if} +{if $anidb && $release.anidbid > 0 && $anidb.picture != ""}{/if} +{if $con && $con.cover == 1}{/if} +{if $music && $music.cover == 1}{/if} +{if $book && $book.cover == 1}{/if} -{if $rage && $release.rageID > 0} +{if $rage && $release.rageid > 0} {if $release.tvtitle != ""}{$release.tvtitle|escape:"htmlall"} - {/if}{$release.seriesfull|replace:"S":"Season "|replace:"E":" Episode "} {if $rage.description != ""}{$rage.description|escape:"htmlall"|nl2br|magicurl|truncate:"350":"more..."}{if $rage.description|strlen > 350}{$rage.description|escape:"htmlall"|nl2br|magicurl}{else}{/if}{/if} {if $rage.genre != ""}Genre: {$rage.genre|escape:"htmlall"|replace:"|":", "}{/if} {if $release.tvairdate != ""}Aired: {$release.tvairdate|date_format}{/if} {if $rage.country != ""}Country: {$rage.country}{/if} -{if $episode && $release.episodeinfoID > 0} +{if $episode && $release.episodeinfoid > 0} {if $episode.overview != ""}Overview: {$episode.overview|escape:"htmlall"|nl2br|magicurl|truncate:"350":"more..."}{if $episode.overview|strlen > 350}{$episode.overview|escape:"htmlall"|nl2br|magicurl}{else}{/if}{/if} {if $episode.rating > 0}Rating: {$episode.rating}/10 @@ -67,12 +67,12 @@ {if $episode.writer != ""}Writer: {$episode.writer|escape:"htmlall"|replace:"|":", "}{/if} {if $episode.gueststars != ""}Guest Stars: {$episode.gueststars|escape:"htmlall"|replace:"|":", "}{/if} {/if} - All Episodes - TV Rage - {if $release.tvdbID > 0}TheTVDB{/if} - Series Rss Feed + All Episodes + TV Rage + {if $release.tvdbid > 0}TheTVDB{/if} + Series Rss Feed {/if} -{if $movie && $release.rageID < 0} +{if $movie && $release.rageid < 0} {$movie.title|escape:"htmlall"} ({$movie.year}) {if $movie.tagline != ''}{$movie.tagline|escape:"htmlall"}{/if} @@ -91,14 +91,14 @@ {/if} - IMDB + IMDB {if $movie.tmdbID != ''}TMDb{/if} - Movie View + Movie View + rel="{$site->dereferrer_link}{$cpurl}/api/{$cpapi}/movie.add/?identifier=tt{$release.imdbid}&title={$movie.title}" + name="CP{$release.imdbid}" title="Add to CouchPotato"> CouchPotato OpenSubtitles @@ -106,13 +106,13 @@ {/if} -{if $anidb && $release.anidbID > 0} +{if $anidb && $release.anidbid > 0} {if $release.tvtitle != ""}{$release.tvtitle|escape:"htmlall"}{/if} {if $anidb.description != ""}{$anidb.description|escape:"htmlall"|nl2br|magicurl|truncate:"350":"more..."}{if $anidb.description|strlen > 350}{$anidb.description|escape:"htmlall"|nl2br|magicurl}{else}{/if}{/if} {if $anidb.categories != ""}Categories: {$anidb.categories|escape:"htmlall"|replace:"|":", "}{/if} {if $release.tvairdate != "0000-00-00 00:00:00"}Aired: {$release.tvairdate|date_format}{/if} -{if $episode && $release.episodeinfoID > 0} +{if $episode && $release.episodeinfoid > 0} {if $episode.overview != ""}Overview: {$episode.overview}{/if} {if $episode.rating > 0}Rating: {$episode.rating}{/if} {if $episode.director != ""}Director: {$episode.director|escape:"htmlall"|replace:"|":", "}{/if} @@ -120,10 +120,10 @@ {if $episode.writer != ""}Writer: {$episode.writer|escape:"htmlall"|replace:"|":", "}{/if} {/if} - All Episodes - AniDB - {if $release.tvdbID > 0}TheTVDB{/if} - Anime RSS Feed + All Episodes + AniDB + {if $release.tvdbid > 0}TheTVDB{/if} + Anime RSS Feed {/if} {if $con} @@ -235,10 +235,10 @@ Details - {if $reVideo.releaseID|@count > 0 || $reAudio|@count > 0} + {if $reVideo.releaseid|@count > 0 || $reAudio|@count > 0} Media Info {/if} - {if $nfo.ID|@count > 0} + {if $nfo.id|@count > 0} View NFO {/if} File Info @@ -266,7 +266,7 @@ Group:{$release.group_name|replace:"alt.binaries":"a.b"} - Category:{$release.category_name} + Category:{$release.category_name} Size:{$release.size|fsize_format:"MB"}{if $release.completion > 0} ({if $release.completion < 100}{$release.completion}%{else}{$release.completion}%{/if}){/if} Grabs:{$release.grabs} time{if $release.grabs==1}{else}s{/if} {if $release.name != $release.searchname} @@ -325,7 +325,7 @@ -{if $reVideo.releaseID|@count > 0 || $reAudio|@count > 0} +{if $reVideo.releaseid|@count > 0 || $reAudio|@count > 0} @@ -470,7 +470,7 @@ {/if} -{if $nfo.ID|@count > 0} +{if $nfo.id|@count > 0} {/if} @@ -546,15 +546,15 @@ Actions: - Edit - Delete + Edit + Delete Release Info: - Regex Id ({$release.regexID}) - {if $release.reqID != ""} - Request Id ({$release.reqID}) + Regex Id ({$release.regexid}) + {if $release.reqid != ""} + Request Id ({$release.reqid}) {/if} @@ -616,7 +616,7 @@ }); -{if $nfo.ID|@count > 0} +{if $nfo.id|@count > 0}
@@ -18,10 +18,10 @@
@@ -16,13 +16,13 @@
@@ -43,9 +43,9 @@ If you are exporting a large number of nzb files, run this script from the comma
@@ -29,21 +29,21 @@
Use this feature to submit any regex you have added locally to newznab. We'll have a look at integrating them into the master list. No data other than regex's with an ID greater than 10000 will be sent.
Use this feature to submit any regex you have added locally to newznab. We'll have a look at integrating them into the master list. No data other than regex's with an id greater than 10000 will be sent.
-Your cart can be downloaded as an Rss Feed. +Your cart can be downloaded as an Rss Feed.
-Using 'My Movies' you can search for movies, and add them to a wishlist. If the movie becomes available it will be added to an Rss Feed you can use to automatically download. You can Manage Your Movie List to remove old items. +Using 'My Movies' you can search for movies, and add them to a wishlist. If the movie becomes available it will be added to an Rss Feed you can use to automatically download. You can Manage Your Movie List to remove old items.
-Use this page to manage movies added to your personal list. If the movie becomes available it will be added to an Rss Feed you can use to automatically download. To add more movies use the My Movies search feature. +Use this page to manage movies added to your personal list. If the movie becomes available it will be added to an Rss Feed you can use to automatically download. To add more movies use the My Movies search feature.
-Series List | -Browse My Shows | -Rss Feed +Series List | +Browse My Shows | +Rss Feed
- Here you can choose rss feeds from site categories. The feeds will present either decriptions or + Here you can choose rss feeds from site categories. The feeds will present either decriptions or downloads of Nzb files.
Most Nzb clients which support Nzb rss feeds will appreciate the full URL, with download link and your user token.
The feeds include additional attributes to help provide better filtering in your Nzb client, such as size, group and categorisation. If you want to chain multiple categories together or do more advanced searching, use the api, which returns its data in an rss compatible format.