]> git.mxchange.org Git - friendica.git/blobdiff - mod/allfriends.php
Merge pull request #6414 from MrPetovan/bug/4609-add-support-hubzilla-forum-link
[friendica.git] / mod / allfriends.php
index cee067e97acf1ab9791a667a89f4bea89c175209..ceb32e6c1898dcefe2b2cc768c15ff609f5a9ef4 100644 (file)
@@ -5,7 +5,9 @@
 
 use Friendica\App;
 use Friendica\Content\ContactSelector;
+use Friendica\Content\Pager;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model;
@@ -13,8 +15,6 @@ use Friendica\Module;
 use Friendica\Util\Proxy as ProxyUtils;
 
 
-require_once 'include/dba.php';
-
 function allfriends_content(App $a)
 {
        $o = '';
@@ -45,9 +45,9 @@ function allfriends_content(App $a)
 
        $total = Model\GContact::countAllFriends(local_user(), $cid);
 
-       $a->setPagerTotal($total);
+       $pager = new Pager($a->query_string);
 
-       $r = Model\GContact::allFriends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
+       $r = Model\GContact::allFriends(local_user(), $cid, $pager->getStart(), $pager->getItemsPerPage());
        if (!DBA::isResult($r)) {
                $o .= L10n::t('No friends to display.');
                return $o;
@@ -79,9 +79,9 @@ function allfriends_content(App $a)
                $entry = [
                        'url'          => $rr['url'],
                        'itemurl'      => defaults($contact_details, 'addr', $rr['url']),
-                       'name'         => htmlentities($contact_details['name']),
+                       'name'         => $contact_details['name'],
                        'thumb'        => ProxyUtils::proxifyUrl($contact_details['thumb'], false, ProxyUtils::SIZE_THUMB),
-                       'img_hover'    => htmlentities($contact_details['name']),
+                       'img_hover'    => $contact_details['name'],
                        'details'      => $contact_details['location'],
                        'tags'         => $contact_details['keywords'],
                        'about'        => $contact_details['about'],
@@ -97,13 +97,11 @@ function allfriends_content(App $a)
 
        $tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
 
-       $tpl = get_markup_template('viewcontact_template.tpl');
-
-       $o .= replace_macros($tpl, [
-               //'$title' => L10n::t('Friends of %s', htmlentities($c[0]['name'])),
+       $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
+       $o .= Renderer::replaceMacros($tpl, [
                '$tab_str' => $tab_str,
                '$contacts' => $entries,
-               '$paginate' => paginate($a),
+               '$paginate' => $pager->renderFull($total),
        ]);
 
        return $o;