diff --git a/config/sphinx.conf.txt b/config/sphinx.conf.txt index f30e56c..226b936 100644 --- a/config/sphinx.conf.txt +++ b/config/sphinx.conf.txt @@ -16,7 +16,7 @@ source hostPage : common `hostPage`.`uri`, \ `host`.`name`, \ REGEXP_REPLACE(`hostPage`.`mime`, '^([A-z-]+)/[A-z-]+.*', '$1') AS `mime`, \ - (SELECT SUM(`quantity`) FROM `hostPageToHostPage` \ + (SELECT COUNT(*) FROM `hostPageToHostPage` \ WHERE `hostPageToHostPage`.`hostPageIdTarget` = `hostPage`.`hostPageId` \ AND (SELECT `hostPageSource`.`hostId` FROM `hostPage` AS `hostPageSource` \ WHERE `hostPageSource`.`hostPageId` = `hostPageToHostPage`.`hostPageIdSource`) <> `hostPage`.`hostId`) AS `rank`, \ diff --git a/database/yggo.mwb b/database/yggo.mwb index da1d4f6..e6c58ae 100644 Binary files a/database/yggo.mwb and b/database/yggo.mwb differ diff --git a/library/mysql.php b/library/mysql.php index 2eb000f..6cd213c 100644 --- a/library/mysql.php +++ b/library/mysql.php @@ -327,9 +327,7 @@ class MySQL { public function addHostPageToHostPage(int $hostPageIdSource, int $hostPageIdTarget) { - $query = $this->_db->prepare('INSERT INTO `hostPageToHostPage` (`hostPageIdSource`, `hostPageIdTarget`, `quantity`) VALUES (?, ?, 1) - - ON DUPLICATE KEY UPDATE `quantity` = `quantity` + 1'); + $query = $this->_db->prepare('INSERT IGNORE `hostPageToHostPage` (`hostPageIdSource`, `hostPageIdTarget`) VALUES (?, ?)'); $query->execute([$hostPageIdSource, $hostPageIdTarget]); @@ -355,7 +353,7 @@ class MySQL { public function getHostPageIdSourcesByHostPageIdTarget(int $hostPageIdTarget, int $limit = 1000) { - $query = $this->_db->prepare('SELECT * FROM `hostPageToHostPage` WHERE `hostPageIdTarget` = ? ORDER BY `quantity` DESC LIMIT ' . (int) $limit); + $query = $this->_db->prepare('SELECT * FROM `hostPageToHostPage` WHERE `hostPageIdTarget` = ? LIMIT ' . (int) $limit); $query->execute([$hostPageIdTarget]); diff --git a/public/explore.php b/public/explore.php index b38dd6c..de1b471 100644 --- a/public/explore.php +++ b/public/explore.php @@ -244,10 +244,6 @@ $placeholder = Filter::plural($totalPages, [sprintf(_('Over %s page or enter the getHostPageIdSourcesByHostPageIdTarget($hp) as $hostPageIdSource) { ?> getFoundHostPage($hostPageIdSource->hostPageIdSource)) { ?>
- quantity, [sprintf(_('%s ref'), $hostPageIdSource->quantity),
- sprintf(_('%s refs'), $hostPageIdSource->quantity),
- sprintf(_('%s refs'), $hostPageIdSource->quantity),
- ]) ?>
scheme . '://' . $hostPage->name . ($hostPage->port ? ':' . $hostPage->port : false)) . (mb_strlen(urldecode($hostPage->uri)) > 48 ? '...' . mb_substr(urldecode($hostPage->uri), -48) : urldecode($hostPage->uri))) ?>
diff --git a/public/search.php b/public/search.php
index a07730e..89ab51c 100644
--- a/public/search.php
+++ b/public/search.php
@@ -354,10 +354,6 @@ if (filter_var($q, FILTER_VALIDATE_URL) && preg_match(CRAWL_URL_REGEXP, $q)) {
getFoundHostPage($hostPageIdSource->hostPageIdSource)) { ?>
- quantity, [sprintf(_('%s ref'), $hostPageIdSource->quantity),
- sprintf(_('%s refs'), $hostPageIdSource->quantity),
- sprintf(_('%s refs'), $hostPageIdSource->quantity),
- ]) ?>
scheme . '://' . $hostPage->name . ($hostPage->port ? ':' . $hostPage->port : false)) . (mb_strlen(urldecode($hostPage->uri)) > 36 ? '...' . mb_substr(urldecode($hostPage->uri), -36) : urldecode($hostPage->uri))) ?>