(.+)
/s', $buffer, $match)) { if (preg_match_all('/
.+?<\/div>/s', $match["1"], $matches)) { foreach ($matches as $m1) { foreach ($m1 as $m) { if (preg_match('/timestamp">(?P.+?)<\/span>.+?section">.+?">(?P.+?)<\/a>.+?release">(?P.+?)<\/span>(.+info">(?P<size>.+?) )?/s', $m, $matches2)) { $oldname = $db->queryOneRow(sprintf("SELECT title FROM prehash WHERE title = %s", $db->escapeString($matches2["title"]))); if ($oldname["title"] == $matches2["title"]) continue; else { if (!isset($matches2["size"]) && empty($matches2["size"])) $size = "NULL"; else $size = $db->escapeString($matches2["size"]); $db->query(sprintf("INSERT IGNORE INTO prehash (title, size, category, predate, adddate, source, hash) VALUES (%s, %s, %s, FROM_UNIXTIME(".strtotime($matches2["date"])."), now(), %s, %s)", $db->escapeString($matches2["title"]), $size, $db->escapeString($matches2["category"]), $db->escapeString("orlydb"), $db->escapeString(md5($matches2["title"])))); $newnames++; } } } } } } } return $newnames; ?>