diff --git a/bin/monitor.php b/bin/monitor.php index abda36b04..b251a6e84 100644 --- a/bin/monitor.php +++ b/bin/monitor.php @@ -4,7 +4,7 @@ require(dirname(__FILE__)."/config.php"); require(WWW_DIR.'/lib/postprocess.php'); require_once (WWW_DIR.'/lib/site.php'); -$version="0.3r302"; +$version="0.3r305"; $db = new DB(); $s = new Sites(); diff --git a/test/jb_fix_names.php b/test/jb_fix_names.php index bc97587d2..91161d345 100644 --- a/test/jb_fix_names.php +++ b/test/jb_fix_names.php @@ -32,10 +32,12 @@ function preName($argv) echo $tot." Releases had no searchname\n"; echo "Getting work\n"; if (isset($argv[1]) && $argv[1]=="full") - $res = $db->query("SELECT ID, name, searchname, groupID, categoryID FROM releases WHERE ( relnamestatus in (1, 20, 21, 22) AND categoryID BETWEEN 8000 AND 8999)"); - elseif (isset($argv[1]) && is_numeric($argv[1])) - $res = $db->query("SELECT ID, name, searchname, groupID, categoryID FROM releases WHERE ( relnamestatus in (1, 20, 21, 22) AND categoryID BETWEEN 8000 AND 8999) AND adddate > NOW() - INTERVAL %d HOUR",$argv[1]); - $total = $res->rowCount(); + $res = $db->prepare("SELECT ID, name, searchname, groupID, categoryID FROM releases WHERE ( relnamestatus in (1, 20, 21, 22) AND categoryID BETWEEN 8000 AND 8999)"); + $res->execute(); + elseif (isset($argv[1]) && is_numeric($argv[1])) + $res = $db->prepare("SELECT ID, name, searchname, groupID, categoryID FROM releases WHERE ( relnamestatus in (1, 20, 21, 22) AND categoryID BETWEEN 8000 AND 8999) AND adddate > NOW() - INTERVAL %d HOUR",$argv[1]); + $res->execute(); + $total = $res->rowCount(); if ($total > 0) { $consoletools = new ConsoleTools(); @@ -92,7 +94,8 @@ function resetSearchnames() { $db = new DB(); echo "\nResetting blank searchnames\n"; - $bad = $db->query("UPDATE releases SET searchname = name WHERE searchname = ''"); + $bad = $db->prepare("UPDATE releases SET searchname = name WHERE searchname = ''"); + $bad->execute(); $tot = count($bad); if ($tot > 0) echo $tot." Releases had no searchname\n"; diff --git a/test/namefixer.php b/test/namefixer.php index 9c1603c61..43487f409 100644 --- a/test/namefixer.php +++ b/test/namefixer.php @@ -77,7 +77,7 @@ class Namefixer if ($time == 2 && $cats == 2) $relres = $db->queryDirect($query.$this->fullall); - $rowcount = $db->getAffectedRows(); + $rowcount = $relres->rowCount(); if ($rowcount > 0) { while ($relrow = $functions->fetchArray($relres)) @@ -126,7 +126,7 @@ class Namefixer if ($time == 2 && $cats == 2) $relres = $db->queryDirect($query.$this->fullall); - $rowcount = $db->getAffectedRows(); + $rowcount = $relres->rowCount(); if ($rowcount > 0) { while ($relrow = $functions->fetchArray($relres)) @@ -173,7 +173,7 @@ class Namefixer if ($time == 2 && $cats == 2) $relres = $db->queryDirect($query.$this->fullother); - $rowcount = $db->getAffectedRows(); + $rowcount = $relres->rowCount(); if ($rowcount > 0) { diff --git a/test/prehash.php b/test/prehash.php index bfc219faf..a767cc14f 100755 --- a/test/prehash.php +++ b/test/prehash.php @@ -118,7 +118,8 @@ Class Predb else $nfo = $db->escapeString("http://nzb.isasecret.com/".$matches2["nfo"]); - $db->query(sprintf("INSERT INTO prehash (title, nfo, size, category, predate, adddate, source, hash) VALUES (%s, %s, %s, %s, FROM_UNIXTIME(".strtotime($matches2["date"])."), now(), %s, %s)", $db->escapeString($matches2["title"]), $nfo, $size, $db->escapeString($matches2["category"]), $db->escapeString("womble"), $db->escapeString(md5($matches2["title"])))); + $qry = $db->prepare(sprintf("INSERT INTO prehash (title, nfo, size, category, predate, adddate, source, hash) VALUES (%s, %s, %s, %s, FROM_UNIXTIME(".strtotime($matches2["date"])."), now(), %s, %s)", $db->escapeString($matches2["title"]), $nfo, $size, $db->escapeString($matches2["category"]), $db->escapeString("womble"), $db->escapeString(md5($matches2["title"])))); + $qry->execute(); $newnames++; } }