]> git.mxchange.org Git - friendica.git/blobdiff - mod/videos.php
Merge pull request #5862 from nupplaphil/rename_App_Methods
[friendica.git] / mod / videos.php
index 505c3c2a8fdfc5bdbcd1cb84dad3c2871ed8c6a7..e52c78cab11f794a0b5f2e4fdd7ab30dfd35c2a0 100644 (file)
@@ -105,12 +105,6 @@ function videos_init(App $a)
                $a->page['htmlhead'] .= replace_macros($tpl,[
                        '$baseurl' => System::baseUrl(),
                ]);
-
-               $tpl = get_markup_template("videos_end.tpl");
-               $a->page['end'] .= replace_macros($tpl,[
-                       '$baseurl' => System::baseUrl(),
-               ]);
-
        }
 
        return;
@@ -274,6 +268,7 @@ function videos_content(App $a)
        // perhaps they're visiting - but not a community page, so they wouldn't have write access
        if (remote_user() && (!$visitor)) {
                $contact_id = 0;
+
                if (!empty($_SESSION['remote'])) {
                        foreach($_SESSION['remote'] as $v) {
                                if($v['uid'] == $owner_uid) {
@@ -346,8 +341,8 @@ function videos_content(App $a)
        );
 
        if (DBA::isResult($r)) {
-               $a->set_pager_total(count($r));
-               $a->set_pager_itemspage(20);
+               $a->setPagerTotal(count($r));
+               $a->setPagerItemsPage(20);
        }
 
        $r = q("SELECT hash, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`created`) AS `created`,
@@ -365,11 +360,13 @@ function videos_content(App $a)
        if (DBA::isResult($r)) {
                foreach ($r as $rr) {
                        $alt_e = $rr['filename'];
+                       /// @todo The album isn't part of the above query. This seems to be some unfinished code that needs to be reworked completely.
+                       $rr['album'] = '';
                        $name_e = $rr['album'];
 
                        $videos[] = [
                                'id'       => $rr['id'],
-                               'link'     => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['resource-id'],
+                               'link'     => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['hash'],
                                'title'    => L10n::t('View Video'),
                                'src'      => System::baseUrl() . '/attach/' . $rr['id'] . '?attachment=0',
                                'alt'      => $alt_e,