mirror of
https://github.com/friendica/friendica
synced 2024-11-18 07:43:51 +00:00
Fix paging on media pages
This commit is contained in:
parent
e9421d7eb6
commit
47ab246441
3 changed files with 12 additions and 11 deletions
|
@ -1548,23 +1548,24 @@ class Contact
|
||||||
* Returns posts from a given contact url
|
* Returns posts from a given contact url
|
||||||
*
|
*
|
||||||
* @param string $contact_url Contact URL
|
* @param string $contact_url Contact URL
|
||||||
* @param bool $thread_mode
|
* @param int $uid User ID
|
||||||
* @param int $update Update mode
|
|
||||||
* @param int $parent Item parent ID for the update mode
|
|
||||||
* @param bool $only_media Only display media content
|
* @param bool $only_media Only display media content
|
||||||
|
* @param string $last_created Newest creation date, used for paging
|
||||||
* @return string posts in HTML
|
* @return string posts in HTML
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function getPostsFromUrl(string $contact_url, int $uid, bool $only_media = false): string
|
public static function getPostsFromUrl(string $contact_url, int $uid, bool $only_media = false, string $last_created = null): string
|
||||||
{
|
{
|
||||||
return self::getPostsFromId(self::getIdForURL($contact_url), $uid, $only_media);
|
return self::getPostsFromId(self::getIdForURL($contact_url), $uid, $only_media, $last_created);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns posts from a given contact id
|
* Returns posts from a given contact id
|
||||||
*
|
*
|
||||||
* @param int $cid Contact ID
|
* @param int $cid Contact ID
|
||||||
|
* @param int $uid User ID
|
||||||
* @param bool $only_media Only display media content
|
* @param bool $only_media Only display media content
|
||||||
|
* @param string $last_created Newest creation date, used for paging
|
||||||
* @return string posts in HTML
|
* @return string posts in HTML
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Media extends BaseModule
|
||||||
|
|
||||||
$o = Contact::getTabsHTML($contact, Contact::TAB_MEDIA);
|
$o = Contact::getTabsHTML($contact, Contact::TAB_MEDIA);
|
||||||
|
|
||||||
$o .= ModelContact::getPostsFromUrl($contact['url'], $this->userSession->getLocalUserId(), true);
|
$o .= ModelContact::getPostsFromUrl($contact['url'], $this->userSession->getLocalUserId(), true, $request['last_created'] ?? '');
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ class Media extends BaseProfile
|
||||||
|
|
||||||
$o = self::getTabsHTML('media', $is_owner, $profile['nickname'], $profile['hide-friends']);
|
$o = self::getTabsHTML('media', $is_owner, $profile['nickname'], $profile['hide-friends']);
|
||||||
|
|
||||||
$o .= Contact::getPostsFromUrl($profile['url'], $this->userSession->getLocalUserId(), true);
|
$o .= Contact::getPostsFromUrl($profile['url'], $this->userSession->getLocalUserId(), true, $request['last_created'] ?? '');
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue