mirror of
https://github.com/friendica/friendica
synced 2025-05-03 23:44:10 +02:00
Merge pull request #10034 from annando/better-tag-sorting
Trending tags are now sort by different users
This commit is contained in:
commit
60a74fd5dc
4 changed files with 8 additions and 6 deletions
|
@ -547,10 +547,10 @@ class Tag
|
|||
{
|
||||
$block_sql = self::getBlockedSQL();
|
||||
|
||||
$tagsStmt = DBA::p("SELECT `name` AS `term`, COUNT(*) AS `score`
|
||||
$tagsStmt = DBA::p("SELECT `name` AS `term`, COUNT(*) AS `score`, COUNT(DISTINCT(`author-id`)) as `authors`
|
||||
FROM `tag-search-view`
|
||||
WHERE `private` = ? AND `uid` = ? AND `received` > DATE_SUB(NOW(), INTERVAL ? HOUR) $block_sql
|
||||
GROUP BY `term` ORDER BY `score` DESC LIMIT ?",
|
||||
GROUP BY `term` ORDER BY `authors` DESC, `score` DESC LIMIT ?",
|
||||
Item::PUBLIC, 0, $period, $limit);
|
||||
|
||||
if (DBA::isResult($tagsStmt)) {
|
||||
|
@ -592,10 +592,10 @@ class Tag
|
|||
{
|
||||
$block_sql = self::getBlockedSQL();
|
||||
|
||||
$tagsStmt = DBA::p("SELECT `name` AS `term`, COUNT(*) AS `score`
|
||||
$tagsStmt = DBA::p("SELECT `name` AS `term`, COUNT(*) AS `score`, COUNT(DISTINCT(`author-id`)) as `authors`
|
||||
FROM `tag-search-view`
|
||||
WHERE `private` = ? AND `wall` AND `origin` AND `received` > DATE_SUB(NOW(), INTERVAL ? HOUR) $block_sql
|
||||
GROUP BY `term` ORDER BY `score` DESC LIMIT ?",
|
||||
GROUP BY `term` ORDER BY `authors` DESC, `score` DESC LIMIT ?",
|
||||
Item::PUBLIC, $period, $limit);
|
||||
|
||||
if (DBA::isResult($tagsStmt)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue