Issue 9165: Make pager work for search

This commit is contained in:
Michael 2020-09-17 21:10:59 +00:00
parent d0caf93a0a
commit 03157cc2f2
2 changed files with 19 additions and 2 deletions

View file

@ -440,6 +440,21 @@ class Tag
return $return;
}
/**
* Counts posts for given tag
*
* @param string $search
* @param integer $uid
* @return integer number of posts
*/
public static function countByTag(string $search, int $uid = 0)
{
$condition = ["`name` = ? AND (NOT `private` OR (`private` AND `uid` = ?))", $search, $uid];
$params = ['group_by' => ['uri-id']];
return DBA::count('tag-search-view', $condition, $params);
}
/**
* Search posts for given tag
*