diff --git a/library/mysql.php b/library/mysql.php index d9bebf2..6c7d28a 100644 --- a/library/mysql.php +++ b/library/mysql.php @@ -163,6 +163,7 @@ class MySQL { return $query->fetch()->total; } + /* not in use public function getTotalPagesByHttpCode(mixed $httpCode) { if (is_null($httpCode)) { @@ -179,6 +180,7 @@ class MySQL { return $query->fetch()->total; } + */ public function getHostPage(int $hostId, int $crc32uri) { @@ -662,6 +664,21 @@ class MySQL { return $query->fetchAll(); } + public function getHostPageCrawlQueueTotal(int $timeFrom) { + + $query = $this->_db->prepare('SELECT COUNT(*) AS `total` + + FROM `hostPage` + JOIN `host` ON (`host`.`hostId` = `hostPage`.`hostId`) + + WHERE (`hostPage`.`timeUpdated` IS NULL OR `hostPage`.`timeUpdated` < ? ) AND `host`.`status` <> ? + AND `hostPage`.`timeBanned` IS NULL'); + + $query->execute([$timeFrom, 0]); + + return $query->fetch()->total; + } + public function updateHostPageCrawlQueue(int $hostPageId, int $timeUpdated, int $httpCode, int $size) { $query = $this->_db->prepare('UPDATE `hostPage` SET `timeUpdated` = ?, `httpCode` = ?, `size` = ? WHERE `hostPageId` = ? LIMIT 1'); diff --git a/public/explore.php b/public/explore.php index 4cb3a12..a959c70 100644 --- a/public/explore.php +++ b/public/explore.php @@ -274,7 +274,7 @@ $placeholder = Filter::plural($totalPages, [sprintf(_('Over %s page or enter the