]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/vier/theme.php
This merge brings back dbm::is_result() where I could find it.
[friendica.git] / view / theme / vier / theme.php
index cd2c31f1880f9007539e62b2de49c75ed35df46b..9cdd396fd1b69f6f80f773dd54360309754f08d8 100644 (file)
@@ -19,10 +19,6 @@ function vier_init(&$a) {
 
        set_template_engine($a, 'smarty3');
 
-       $baseurl = $a->get_baseurl();
-
-       $a->theme_info = array();
-
        if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()) {
                vier_community_info();
 
@@ -151,7 +147,7 @@ function vier_community_info() {
                $r = suggestion_query(local_user(), 0, 9);
 
                $tpl = get_markup_template('ch_directory_item.tpl');
-               if(count($r)) {
+               if(dbm::is_result($r)) {
 
                        $aside['$comunity_profiles_title'] = t('Community Profiles');
                        $aside['$comunity_profiles_items'] = array();
@@ -160,7 +156,7 @@ function vier_community_info() {
                                $entry = replace_macros($tpl,array(
                                        '$id' => $rr['id'],
                                        //'$profile_link' => zrl($rr['url']),
-                                       '$profile_link' => $a->get_baseurl().'/follow/?url='.urlencode($rr['url']),
+                                       '$profile_link' => 'follow/?url='.urlencode($rr['url']),
                                        '$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
                                        '$alt_text' => $rr['name'],
                                ));
@@ -174,23 +170,24 @@ function vier_community_info() {
                $publish = (get_config('system','publish_all') ? '' : " AND `publish` = 1 ");
                $order = " ORDER BY `register_date` DESC ";
 
+               $tpl = get_markup_template('ch_directory_item.tpl');
+
                $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`
                                FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
                                WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $order LIMIT %d , %d ",
                                0, 9);
 
-               $tpl = get_markup_template('ch_directory_item.tpl');
-               if(count($r)) {
+               if(dbm::is_result($r)) {
 
                        $aside['$lastusers_title'] = t('Last users');
                        $aside['$lastusers_items'] = array();
 
                        foreach($r as $rr) {
-                               $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
+                               $profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
                                $entry = replace_macros($tpl,array(
                                        '$id' => $rr['id'],
                                        '$profile_link' => $profile_link,
-                                       '$photo' => $a->get_cached_avatar_image($rr['thumb']),
+                                       '$photo' => $a->remove_baseurl($rr['thumb']),
                                        '$alt_text' => $rr['name']));
                                $aside['$lastusers_items'][] = $entry;
                        }
@@ -207,7 +204,7 @@ function vier_community_info() {
                $nv['suggest'] = Array('suggest', t('Friend Suggestions'), "", "");
                $nv['invite'] = Array('invite', t('Invite Friends'), "", "");
 
-               $nv['search'] = '<form name="simple_bar" method="get" action="'.$a->get_baseurl().'/dirfind">
+               $nv['search'] = '<form name="simple_bar" method="get" action="dirfind">
                                                <span class="sbox_l"></span>
                                                <span class="sbox">
                                                <input type="text" name="search" size="13" maxlength="50">
@@ -220,7 +217,7 @@ function vier_community_info() {
        //Community_Pages at right_aside
        if($show_pages AND local_user()) {
 
-               require_once('include/Forum.php');
+               require_once('include/ForumManager.php');
 
                if(x($_GET['cid']) && intval($_GET['cid']) != 0)
                        $cid = $_GET['cid'];
@@ -228,7 +225,7 @@ function vier_community_info() {
                //sort by last updated item
                $lastitem = true;
 
-               $contacts = Forum::get_list($a->user['uid'],true,$lastitem, true);
+               $contacts = ForumManager::get_list($a->user['uid'],true,$lastitem, true);
                $total = count($contacts);
                $visible_forums = 10;
 
@@ -241,12 +238,12 @@ function vier_community_info() {
                                $selected = (($cid == $contact['id']) ? ' forum-selected' : '');
 
                                $entry = array(
-                                       'url' => z_root() . '/network?f=&cid=' . $contact['id'],
-                                       'external_url' => z_root() . '/redir/' . $contact['id'],
+                                       'url' => 'network?f=&cid=' . $contact['id'],
+                                       'external_url' => 'redir/' . $contact['id'],
                                        'name' => $contact['name'],
                                        'cid' => $contact['id'],
                                        'selected'      => $selected,
-                                       'micro' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO),
+                                       'micro' => App::remove_baseurl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
                                        'id' => ++$id,
                                );
                                $entries[] = $entry;
@@ -371,7 +368,7 @@ function vier_community_info() {
 
                $tpl = get_markup_template('ch_connectors.tpl');
 
-               if(count($r)) {
+               if(dbm::is_result($r)) {
 
                        $con_services = array();
                        $con_services['title'] = Array("", t('Connect Services'), "", "");