X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItemContent.php;h=5268c49e953a6fa7b52bc4f7218bc2ddf27aea79;hb=8c328a3c60d3bcbc8b091158383bf829064d2c9c;hp=daa2766e2f16a594c85b0878604f1f0a170f0d47;hpb=cc5e5be931bc21e44d0cb26778e8cc15be924e41;p=friendica.git diff --git a/src/Model/ItemContent.php b/src/Model/ItemContent.php index daa2766e2f..5268c49e95 100644 --- a/src/Model/ItemContent.php +++ b/src/Model/ItemContent.php @@ -29,10 +29,25 @@ use Friendica\DI; class ItemContent { - public static function getURIIdListBySearch(string $search, int $uid = 0, int $start = 0, int $limit = 100) + /** + * Search posts for given content + * + * @param string $search + * @param integer $uid + * @param integer $start + * @param integer $limit + * @param integer $last_uriid + * @return array + */ + public static function getURIIdListBySearch(string $search, int $uid = 0, int $start = 0, int $limit = 100, int $last_uriid = 0) { $condition = ["`uri-id` IN (SELECT `uri-id` FROM `item-content` WHERE MATCH (`title`, `content-warning`, `body`) AGAINST (? IN BOOLEAN MODE)) AND (NOT `private` OR (`private` AND `uid` = ?))", $search, $uid]; + + if (!empty($last_uriid)) { + $condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $last_uriid]); + } + $params = [ 'order' => ['uri-id' => true], 'group_by' => ['uri-id'],