]> git.mxchange.org Git - friendica.git/commitdiff
Fix paging on media pages
authorMichael <heluecht@pirati.ca>
Sat, 15 Jun 2024 09:04:36 +0000 (09:04 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 15 Jun 2024 09:04:36 +0000 (09:04 +0000)
src/Model/Contact.php
src/Module/Contact/Media.php
src/Module/Profile/Media.php

index 490c61cf57074de239a312641c9cde51c940248f..43d60257b5164a0c12440cdbafffb7fe41fca2ec 100644 (file)
@@ -1547,24 +1547,25 @@ class Contact
        /**
         * Returns posts from a given contact url
         *
-        * @param string $contact_url Contact URL
-        * @param bool   $thread_mode
-        * @param int    $update      Update mode
-        * @param int    $parent      Item parent ID for the update mode
-        * @param bool   $only_media  Only display media content
+        * @param string $contact_url  Contact URL
+        * @param int    $uid          User ID
+        * @param bool   $only_media   Only display media content
+        * @param string $last_created Newest creation date, used for paging
         * @return string posts in HTML
         * @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
         *
-        * @param int  $cid         Contact ID
-        * @param bool $only_media  Only display media content
+        * @param int    $cid          Contact ID
+        * @param int    $uid          User ID
+        * @param bool   $only_media   Only display media content
+        * @param string $last_created Newest creation date, used for paging
         * @return string posts in HTML
         * @throws \Exception
         */
index b8a8afa8e787cb1942c2824b7eb321432adac310..bb60887055e56b9b0b8c0e9f9f8afbbbb5fb8132 100644 (file)
@@ -65,7 +65,7 @@ class Media extends BaseModule
 
                $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;
        }
index efb610caa34a9cb9e9fb44a2bfad281b211cf5f3..64bb103322f4245140a8268c3ca82a6fa9aedba7 100644 (file)
@@ -64,7 +64,7 @@ class Media extends BaseProfile
 
                $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;
        }