Issue 9165: Make pager work for search
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user