- $r = DBA::p("SELECT `uri` FROM `thread`
- INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
- INNER JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id`
- WHERE `thread`.`uid` = 0 AND NOT `author`.`hidden` AND NOT `author`.`blocked`
- ORDER BY `thread`.`commented` DESC LIMIT ?, ?", $start, $itemspage);
+ if (!is_null($accounttype)) {
+ $condition = ["`uid` = ? AND `owner`.`contact-type` = ?", 0, $accounttype];
+ } else {
+ $condition = ['uid' => 0];
+ }
+
+ $r = Item::selectThreadForUser(0, ['uri'], $condition, ['order' => ['commented' => true], 'limit' => [$start, $itemspage]]);