]> git.mxchange.org Git - friendica.git/blobdiff - mod/videos.php
forgotten templates
[friendica.git] / mod / videos.php
index 662da4ca4beca3b23ed9584242faa7a48425a3b5..c4e5d0aaa410882caf4eb97430cf310c3fe60948 100644 (file)
@@ -5,13 +5,13 @@ use Friendica\Core\Config;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
-use Friendica\Object\Contact;
+use Friendica\Model\Contact;
 
-require_once('include/items.php');
-require_once('include/acl_selectors.php');
-require_once('include/bbcode.php');
-require_once('include/security.php');
-require_once('include/redir.php');
+require_once 'include/items.php';
+require_once 'include/acl_selectors.php';
+require_once 'include/bbcode.php';
+require_once 'include/security.php';
+require_once 'include/redir.php';
 
 function videos_init(App $a) {
 
@@ -40,16 +40,16 @@ function videos_init(App $a) {
 
                $profile = get_profiledata_by_nick($nick, $a->profile_uid);
 
-               $account_type = account_type($profile);
+               $account_type = Contact::getAccountType($profile);
 
                $tpl = get_markup_template("vcard-widget.tpl");
 
-               $vcard_widget .= replace_macros($tpl, array(
+               $vcard_widget = replace_macros($tpl, array(
                        '$name' => $profile['name'],
                        '$photo' => $profile['photo'],
-                       '$addr' => (($profile['addr'] != "") ? $profile['addr'] : ""),
+                       '$addr' => defaults($profile, 'addr', ''),
                        '$account_type' => $account_type,
-                       '$pdesc' => (($profile['pdesc'] != "") ? $profile['pdesc'] : ""),
+                       '$pdesc' => defaults($profile, 'pdesc', ''),
                ));
 
 
@@ -280,8 +280,9 @@ function videos_content(App $a) {
                }
        }
 
-       // perhaps they're visiting - but not a community page, so they wouldn't have write access
+       $groups = [];
 
+       // perhaps they're visiting - but not a community page, so they wouldn't have write access
        if(remote_user() && (! $visitor)) {
                $contact_id = 0;
                if(is_array($_SESSION['remote'])) {
@@ -317,7 +318,7 @@ function videos_content(App $a) {
                return;
        }
 
-       $sql_extra = permissions_sql($owner_uid,$remote_contact,$groups);
+       $sql_extra = permissions_sql($owner_uid, $remote_contact, $groups);
 
        $o = "";
 
@@ -378,14 +379,8 @@ function videos_content(App $a) {
        $videos = array();
        if (DBM::is_result($r)) {
                foreach ($r as $rr) {
-                       if ($a->theme['template_engine'] === 'internal') {
-                               $alt_e = template_escape($rr['filename']);
-                               $name_e = template_escape($rr['album']);
-                       }
-                       else {
-                               $alt_e = $rr['filename'];
-                               $name_e = $rr['album'];
-                       }
+                       $alt_e = $rr['filename'];
+                       $name_e = $rr['album'];
 
                        $videos[] = array(
                                'id'       => $rr['id'],