]> git.mxchange.org Git - friendica.git/blobdiff - mod/hovercard.php
Merge pull request #4243 from MrPetovan/task/switch-to-array-new-style
[friendica.git] / mod / hovercard.php
index 29dfd268913eded5834f89877b0c3d3dd4906f3c..334bf228abe74ddb253c79ccb5d1b253ef69f593 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
+use Friendica\Model\Profile;
 
 function hovercard_init(App $a)
 {
@@ -44,8 +45,8 @@ function hovercard_content()
        $cid = 0;
        if (local_user() && strpos($profileurl, 'redir/') === 0) {
                $cid = intval(substr($profileurl, 6));
-               $r = dba::select('contact', array('nurl'), array('id' => $cid), array('limit' => 1));
-               $profileurl = defaults($r, 'nurl', '');
+               $remote_contact = dba::selectFirst('contact', ['nurl'], ['id' => $cid]);
+               $profileurl = defaults($remote_contact, 'nurl', '');
        }
 
        $contact = [];
@@ -65,12 +66,12 @@ function hovercard_content()
        }
 
        // Move the contact data to the profile array so we can deliver it to
-       $profile = array(
+       $profile = [
                'name'     => $contact['name'],
                'nick'     => $contact['nick'],
                'addr'     => defaults($contact, 'addr', $contact['url']),
                'thumb'    => proxy_url($contact['thumb'], false, PROXY_SIZE_THUMB),
-               'url'      => $cid ? ('redir/' . $cid) : zrl($contact['url']),
+               'url'      => $cid ? ('redir/' . $cid) : Profile::zrl($contact['url']),
                'nurl'     => $contact['nurl'], // We additionally store the nurl as identifier
                'location' => $contact['location'],
                'gender'   => $contact['gender'],
@@ -80,12 +81,12 @@ function hovercard_content()
                'bd'       => $contact['birthday'] <= '0001-01-01' ? '' : $contact['birthday'],
                'account_type' => Contact::getAccountType($contact),
                'actions'  => $actions,
-       );
+       ];
        if ($datatype == 'html') {
                $tpl = get_markup_template('hovercard.tpl');
-               $o = replace_macros($tpl, array(
+               $o = replace_macros($tpl, [
                        '$profile' => $profile,
-               ));
+               ]);
 
                return $o;
        } else {