diff --git a/lib/copy_this/misc/reqscraper/query.php b/lib/copy_this/misc/reqscraper/query.php index de5b39f93..1c19e2a6d 100644 --- a/lib/copy_this/misc/reqscraper/query.php +++ b/lib/copy_this/misc/reqscraper/query.php @@ -18,7 +18,7 @@ if ($type != "g") $result = mysql_query("select ID from feed where '".mysql_real_escape_string($type)."' REGEXP code and status = 1"); $feedid = -1; while ($row = mysql_fetch_assoc($result)) - $feedid = $row["ID"]; + $feedid = $row["id"]; $result = mysql_query("select * from item inner join feed on feed.ID = item.feedID inner join access on access.guid = '".mysql_real_escape_string($uid)."' where ".$reqstr." and item.feedid = '".mysql_real_escape_string($feedid)."'"); } @@ -30,7 +30,7 @@ else // build metadata about the item(s) // $ret = ""; -while ($row = mysql_fetch_assoc($result)) +while ($row = mysql_fetch_assoc($result)) $ret.="\n"; $ret.=""; @@ -43,21 +43,21 @@ echo $ret; die(); -function cleanXML($strin) +function cleanXML($strin) { $strout = null; - for ($i = 0; $i < strlen($strin); $i++) + for ($i = 0; $i < strlen($strin); $i++) { $ord = ord($strin[$i]); - if (($ord > 0 && $ord < 32) || ($ord >= 127)) + if (($ord > 0 && $ord < 32) || ($ord >= 127)) { $strout .= "&#{$ord};"; } - else + else { - switch ($strin[$i]) + switch ($strin[$i]) { case '<': $strout .= '<'; diff --git a/lib/copy_this/misc/reqscraper/rss.php b/lib/copy_this/misc/reqscraper/rss.php index ee79f83ce..64d1a0d23 100644 --- a/lib/copy_this/misc/reqscraper/rss.php +++ b/lib/copy_this/misc/reqscraper/rss.php @@ -19,7 +19,7 @@ if ($type != "g") $result = mysql_query("select ID from feed where '".mysql_real_escape_string($type)."' REGEXP code"); $feedid = -1; while ($row = mysql_fetch_assoc($result)) - $feedid = $row["ID"]; + $feedid = $row["id"]; $result = mysql_query("select item.*, feed.* from item join ( select ID from item where feedID = '".mysql_real_escape_string($feedid)."' order by adddateunique desc limit ".$limit." ) x on x.ID = item.ID inner join feed on feed.ID = item.feedID inner join access on access.guid = '".mysql_real_escape_string($uid)."' order by item.id desc"); } diff --git a/lib/copy_this/misc/reqscraper/scrape.php b/lib/copy_this/misc/reqscraper/scrape.php index cb600f457..1720705fc 100644 --- a/lib/copy_this/misc/reqscraper/scrape.php +++ b/lib/copy_this/misc/reqscraper/scrape.php @@ -6,54 +6,54 @@ require_once('config.php'); // // retrieve a list of feeds to be scraped // -$result = mysql_query("SELECT *, NOW() as now FROM feed WHERE status=1"); -while ($row = mysql_fetch_assoc($result)) +$result = mysql_query("SELECT *, NOW() as now FROM feed WHERE status=1"); +while ($row = mysql_fetch_assoc($result)) { - + if (strtotime($row['now']) - strtotime($row['lastupdate']) < $row['updatemins']*60) { continue; } - + echo "checking ".$row["code"]."\n"; $rss = fetch_rss($row["url"]); - + $upd = mysql_query("UPDATE feed SET lastupdate = NOW() WHERE ID = ".$row['ID']); - + // // scrape every item into a database table // - foreach ($rss->items as $item) + foreach ($rss->items as $item) { $link = ""; if (isset($item['link'])) $link = mysql_real_escape_string($item['link']); - + if (isset($item['description'])) - $description = mysql_real_escape_string($item['description']); + $description = mysql_real_escape_string($item['description']); elseif (isset($item['summary'])) - $description = mysql_real_escape_string($item['description']); + $description = mysql_real_escape_string($item['description']); else $description = ""; - - $feedID = $row["ID"]; - + + $feedID = $row["id"]; + if (isset($item['pubdate'])) $pubdate = date("Y-m-d H:i:s", strtotime($item['pubdate'])); elseif (isset($item["dc"]) && isset($item["dc"]["date"])) $pubdate = date("Y-m-d H:i:s", strtotime($item["dc"]["date"])); else $pubdate = date("Y-m-d H:i:s"); - + // // store 'specific stuff' like parsed reqids by regexing // $reqid = 0; $matches = ""; - + $title = ""; if (preg_match($row["titleregex"], $item[$row["titlecol"]], $matches)) - $title = mysql_real_escape_string($matches["title"]); - + $title = mysql_real_escape_string($matches["title"]); + //straight md5 if ($row["reqidregex"] == "-1" && $title != "") { @@ -80,13 +80,13 @@ while ($row = mysql_fetch_assoc($result)) } if (isset($item['guid'])) - $guid = mysql_real_escape_string($item['guid']); + $guid = mysql_real_escape_string($item['guid']); else { if ($title != "" && $reqid != 0) $guid = md5($reqid.$title); else - $guid = md5(uniqid()); + $guid = md5(uniqid()); } $addateunique = round(microtime(true) * 1000); diff --git a/lib/copy_this/misc/testing/fixreleasename.php b/lib/copy_this/misc/testing/fixreleasename.php index ac9edcbf6..5253c6f5e 100644 --- a/lib/copy_this/misc/testing/fixreleasename.php +++ b/lib/copy_this/misc/testing/fixreleasename.php @@ -14,7 +14,7 @@ foreach ($rows as $row) preg_match($reg, $row["searchname"], $matches); if (isset($matches["name"])) { $db->exec(sprintf("update releases set searchname = %s, name = %s where ID = %d", - $db->escapeString($matches["name"]), $db->escapeString($matches["name"]), $row["ID"])); + $db->escapeString($matches["name"]), $db->escapeString($matches["name"]), $row["id"])); echo $matches["name"]."\n"; } } diff --git a/lib/copy_this/misc/testing/parsebooknames.php b/lib/copy_this/misc/testing/parsebooknames.php index 69d2dad47..c1b469da5 100644 --- a/lib/copy_this/misc/testing/parsebooknames.php +++ b/lib/copy_this/misc/testing/parsebooknames.php @@ -1 +1 @@ -parseAuthor($t); if ($book !== false) { echo 'Looking up: '.$book["author"].' - '.$book["title"].' ['.$t.']'."\n"; //check for existing book entry $bookCheck = $b->getBookInfoByName($book["author"], $book["title"]); if ($bookCheck === false) { // // get from amazon // $ret = $b->updateBookInfo($book["author"], $book["title"]); if ($ret !== false) { $bookId = $ret; } } else { $bookId = $bookCheck["ID"]; } } echo $bookId; } \ No newline at end of file +parseAuthor($t); if ($book !== false) { echo 'Looking up: '.$book["author"].' - '.$book["title"].' ['.$t.']'."\n"; //check for existing book entry $bookCheck = $b->getBookInfoByName($book["author"], $book["title"]); if ($bookCheck === false) { // // get from amazon // $ret = $b->updateBookInfo($book["author"], $book["title"]); if ($ret !== false) { $bookId = $ret; } } else { $bookId = $bookCheck["id"]; } } echo $bookId; } \ No newline at end of file diff --git a/lib/copy_this/misc/testing/regexverify.php b/lib/copy_this/misc/testing/regexverify.php index 67ff76939..6e30555bf 100644 --- a/lib/copy_this/misc/testing/regexverify.php +++ b/lib/copy_this/misc/testing/regexverify.php @@ -42,7 +42,7 @@ foreach ($res as $regexrow) }catch(Exception $e){ $errcnt++; $strerr=str_pad((int) $errcnt,2," ",STR_PAD_LEFT); - echo "$strerr. id=".$regexrow["ID"]. + echo "$strerr. id=".$regexrow["id"]. ", group=".$regexrow["groupname"]."\n"; echo " regex='".$regexrow["regex"]."'\n"; echo " error=".$e->getMessage()."\n\n"; diff --git a/lib/copy_this/misc/testing/test_blacklist.php b/lib/copy_this/misc/testing/test_blacklist.php index 801c5f36c..b318d5b54 100644 --- a/lib/copy_this/misc/testing/test_blacklist.php +++ b/lib/copy_this/misc/testing/test_blacklist.php @@ -298,7 +298,7 @@ while($res=get_block($offset, $batch)){ # Support letting the user know when there is a bad # regular expression entry abort futher checks $strerr=str_pad((int) $errcnt,2," ",STR_PAD_LEFT); - echo "$strerr. id=".$bl["ID"]. + echo "$strerr. id=".$bl["id"]. ", group=".$header["groupname"]."\n"; echo " regex='".$bl["groupname"]."'\n"; echo " error=".$e->getMessage()."\n\n"; @@ -324,8 +324,8 @@ while($res=get_block($offset, $batch)){ # Support letting the user know when there is a bad # regular expression entry abort futher checks $strerr=str_pad((int) $errcnt,2," ",STR_PAD_LEFT); - if(isset($bl["ID"])) - echo "$strerr. id=".$bl["ID"].", "; + if(isset($bl["id"])) + echo "$strerr. id=".$bl["id"].", "; echo " name=".$header["name"]."\n"; echo " regex=$regex\n"; echo " error=".$e->getMessage()."\n\n"; diff --git a/lib/copy_this/misc/testing/test_regex.php b/lib/copy_this/misc/testing/test_regex.php index ca6358af0..bf7f482e9 100644 --- a/lib/copy_this/misc/testing/test_regex.php +++ b/lib/copy_this/misc/testing/test_regex.php @@ -42,7 +42,7 @@ foreach ($res as $regexrow) }catch(Exception $e){ $errcnt++; $strerr=str_pad((int) $errcnt,2," ",STR_PAD_LEFT); - echo "$strerr. id=".$regexrow["ID"]. + echo "$strerr. id=".$regexrow["id"]. ", group=".$regexrow["groupname"]."\n"; echo " regex='".$regexrow["regex"]."'\n"; echo " error=".$e->getMessage()."\n\n"; diff --git a/lib/copy_this/misc/testing/updateTVRage.php b/lib/copy_this/misc/testing/updateTVRage.php index 58febae44..d97d2a5c8 100644 --- a/lib/copy_this/misc/testing/updateTVRage.php +++ b/lib/copy_this/misc/testing/updateTVRage.php @@ -16,6 +16,6 @@ $rows = $db->query("select ID, releasetitle from tvrage echo "Updating ".count($rows)." entries \n"; foreach ($rows as $row) { - $t->refreshRageInfo($row["ID"]); + $t->refreshRageInfo($row["id"]); echo "Refreshing ".$row["releasetitle"]."\n"; } \ No newline at end of file diff --git a/lib/copy_this/www/admin/regex-test.php b/lib/copy_this/www/admin/regex-test.php index 88bf66a79..03266dd23 100644 --- a/lib/copy_this/www/admin/regex-test.php +++ b/lib/copy_this/www/admin/regex-test.php @@ -27,8 +27,8 @@ $numarticles = (isset($_REQUEST['numarticles']) && !empty($_REQUEST['numarticles $clearexistingbins = isset($_REQUEST['clearexistingbins']) ? true : false; foreach($groupList as $grp) { - $gid[$grp["ID"]] = $grp["ID"]; - $gnames[$grp["ID"]] = $grp["name"]; + $gid[$grp["id"]] = $grp["id"]; + $gnames[$grp["id"]] = $grp["name"]; } $group = $groupname; diff --git a/lib/copy_this/www/pages/cart.php b/lib/copy_this/www/pages/cart.php index 3bc7d9ed2..09e09d678 100644 --- a/lib/copy_this/www/pages/cart.php +++ b/lib/copy_this/www/pages/cart.php @@ -17,7 +17,7 @@ if (isset($_REQUEST["add"])) $page->show404(); foreach($data as $d) - $users->addCart($users->currentUserId(), $d["ID"]); + $users->addCart($users->currentUserId(), $d["id"]); } elseif (isset($_REQUEST["delete"])) { diff --git a/lib/copy_this/www/pages/profile.php b/lib/copy_this/www/pages/profile.php index c6eb7f49a..3f1cb512a 100644 --- a/lib/copy_this/www/pages/profile.php +++ b/lib/copy_this/www/pages/profile.php @@ -14,7 +14,7 @@ elseif (isset($_GET["name"])) { $res = $users->getByUsername($_GET["name"]); if ($res) - $userid = $res["ID"]; + $userid = $res["id"]; } else $userid = $users->currentUserId(); diff --git a/lib/copy_this/www/pages/rss.php b/lib/copy_this/www/pages/rss.php index c8eb309c0..f1cd1fe35 100644 --- a/lib/copy_this/www/pages/rss.php +++ b/lib/copy_this/www/pages/rss.php @@ -55,7 +55,7 @@ else } else { - $uid = $page->userdata["ID"]; + $uid = $page->userdata["id"]; $rsstoken = $page->userdata["rsstoken"]; $maxrequests = $page->userdata['apirequests']; }