mirror of
https://github.com/friendica/friendica
synced 2025-04-25 09:50:11 +00:00
Display featured posts for contacts
This commit is contained in:
parent
8669f12176
commit
75bc4eccb7
21 changed files with 172 additions and 118 deletions
|
@ -48,7 +48,7 @@ class Pin extends BaseModule
|
|||
|
||||
$itemId = intval($this->parameters['id']);
|
||||
|
||||
$item = Post::selectFirst(['uri-id', 'uid'], ['id' => $itemId]);
|
||||
$item = Post::selectFirst(['uri-id', 'uid', 'featured'], ['id' => $itemId]);
|
||||
if (!DBA::isResult($item)) {
|
||||
throw new HTTPException\NotFoundException();
|
||||
}
|
||||
|
@ -57,9 +57,13 @@ class Pin extends BaseModule
|
|||
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
|
||||
}
|
||||
|
||||
$pinned = !Post\ThreadUser::getPinned($item['uri-id'], local_user());
|
||||
$pinned = !$item['featured'];
|
||||
|
||||
Post\ThreadUser::setPinned($item['uri-id'], local_user(), $pinned);
|
||||
if ($pinned) {
|
||||
Post\Collection::add($item['uri-id'], Post\Collection::FEATURED);
|
||||
} else {
|
||||
Post\Collection::remove($item['uri-id'], Post\Collection::FEATURED);
|
||||
}
|
||||
|
||||
// See if we've been passed a return path to redirect to
|
||||
$return_path = $_REQUEST['return'] ?? '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue