{
$request = $this->getRequest([
'limit' => 10, // Maximum number of results to return. Defaults to 10.
- 'offset' => 0, // Offset page, Defaults to 0.
+ 'offset' => 0, // Offset in set, Defaults to 0.
], $request);
$condition = ["EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread-view`.`uri-id` AND `type` = ? AND NOT `name` IS NULL AND NOT `description` IS NULL) AND NOT `private` AND `commented` > ? AND `created` > ?",
}
DBA::close($statuses);
+ if (!empty($trending)) {
+ self::setLinkHeaderByOffsetLimit($request['offset'], $request['limit']);
+ }
+
System::jsonExit($trending);
}
}
$request = $this->getRequest([
'limit' => 10, // Maximum number of results to return. Defaults to 10.
- 'offset' => 0, // Offset page, Defaults to 0.
+ 'offset' => 0, // Offset in set, Defaults to 0.
], $request);
$condition = ["NOT `private` AND `commented` > ? AND `created` > ?", DateTimeFormat::utc('now -1 day'), DateTimeFormat::utc('now -1 week')];
}
DBA::close($statuses);
+ if (!empty($trending)) {
+ self::setLinkHeaderByOffsetLimit($request['offset'], $request['limit']);
+ }
+
System::jsonExit($trending);
}
}
{
$request = $this->getRequest([
'limit' => 20, // Maximum number of results to return. Defaults to 20.
- 'offset' => 0, // Offset page. Defaults to 0.
+ 'offset' => 0, // Offset in set. Defaults to 0.
'friendica_local' => false, // Whether to return local tag trends instead of global, defaults to false
], $request);
$trending[] = $hashtag->toArray();
}
- System::jsonExit(array_slice($trending, 0, $request['limit']));
+ if (!empty($trending)) {
+ self::setLinkHeaderByOffsetLimit($request['offset'], $request['limit']);
+ }
+
+ System::jsonExit($trending);
}
}