]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
Merge pull request #2151 from annando/1512-misconfigured-friendica
[friendica.git] / mod / network.php
index 5e9be8d80deacf45b73472dcd73cc982c23dd9eb..8e7a2b8e1ea1174b9bd0069924d5fcd1881be0e8 100644 (file)
@@ -6,6 +6,8 @@ function network_init(&$a) {
        }
 
        $is_a_date_query = false;
+       if(x($_GET['cid']) && intval($_GET['cid']) != 0)
+               $cid = $_GET['cid'];
 
        if($a->argc > 1) {
                for($x = 1; $x < $a->argc; $x ++) {
@@ -112,6 +114,7 @@ function network_init(&$a) {
        require_once('include/group.php');
        require_once('include/contact_widgets.php');
        require_once('include/items.php');
+       require_once('include/forums.php');
 
        if(! x($a->page,'aside'))
                $a->page['aside'] = '';
@@ -144,20 +147,13 @@ function network_init(&$a) {
                ));
        }
 
-       $a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network',true,$group_id) : '');
+       $a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network','standard',$group_id) : '');
+       $a->page['aside'] .= (feature_enabled(local_user(),'forumlist_widget') ? widget_forumlist(local_user(),$cid) : '');
        $a->page['aside'] .= posted_date_widget($a->get_baseurl() . '/network',local_user(),false);
        $a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
        $a->page['aside'] .= saved_searches($search);
        $a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
 
-       if(x($_GET['cid']) && intval($_GET['cid']) != 0) {
-               $r = q("SELECT * FROM `contact` WHERE `id` = %d",
-                       intval($_GET['cid']));
-               if ($r) {
-                       $a->page['aside'] = "";
-                       profile_load($a, "", 0, $r[0]);
-               }
-       }
 }
 
 function saved_searches($search) {
@@ -581,7 +577,7 @@ function network_content(&$a, $update = 0) {
        }
        elseif($cid) {
 
-               $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d
+               $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl`, `forum`, `prv`, `addr`, `thumb`, `location` FROM `contact` WHERE `id` = %d
                                AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
                        intval($cid)
                );
@@ -592,8 +588,18 @@ function network_content(&$a, $update = 0) {
                                            ON $sql_table.$sql_parent = `temp1`.`parent` ";
                        $sql_extra = "";
 
-                       $o = replace_macros(get_markup_template("section_title.tpl"),array(
-                               '$title' => sprintf( t('Contact: %s'), htmlentities($r[0]['name']))
+                       $entries[0] = array(
+                               'id' => 'network',
+                               'name' => htmlentities($r[0]['name']),
+                               'itemurl' => (($r[0]['addr']) ? ($r[0]['addr']) : ($r[0]['nurl'])),
+                               'thumb' => proxy_url($r[0]['thumb'], false, PROXY_SIZE_THUMB),
+                               'account_type' => (($r[0]['forum']) || ($r[0]['prv']) ? t('Forum') : ''),
+                               'details' => $r[0]['location'],
+                       );
+
+                       $o = replace_macros(get_markup_template("viewcontact_template.tpl"),array(
+                               'contacts' => $entries,
+                               'id' => 'network',
                        )) . $o;
 
                        if($r[0]['network'] === NETWORK_OSTATUS && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {