mirror of
https://github.com/friendica/friendica
synced 2025-04-26 16:30:12 +00:00
Issue 9165: Make pager work for search
This commit is contained in:
parent
d0caf93a0a
commit
03157cc2f2
2 changed files with 19 additions and 2 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue