X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcommon.php;h=62a5185fed84c4a00256bab9447fc56c64b530b2;hb=9285ba81786a715d4eebed7508e7dfcf96db475a;hp=08609222972e68dfcd832647f2709d2fbe619967;hpb=721e7e410c85bd646bd9ff804c3a78aca0e9e4db;p=friendica.git diff --git a/mod/common.php b/mod/common.php index 0860922297..62a5185fed 100644 --- a/mod/common.php +++ b/mod/common.php @@ -3,6 +3,7 @@ require_once('include/socgraph.php'); require_once('include/Contact.php'); require_once('include/contact_selectors.php'); +require_once('mod/contacts.php'); function common_content(&$a) { @@ -29,22 +30,23 @@ function common_content(&$a) { intval($cid), intval($uid) ); - } - else { + $a->page['aside'] = ""; + profile_load($a, "", 0, get_contact_details_by_url($c[0]["url"])); + } else { $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1", intval($uid) ); - } - $vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array( - '$name' => htmlentities($c[0]['name']), - '$photo' => $c[0]['photo'], - 'url' => z_root() . '/contacts/' . $cid - )); + $vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array( + '$name' => htmlentities($c[0]['name']), + '$photo' => $c[0]['photo'], + 'url' => 'contacts/' . $cid + )); - if(! x($a->page,'aside')) - $a->page['aside'] = ''; - $a->page['aside'] .= $vcard_widget; + if(! x($a->page,'aside')) + $a->page['aside'] = ''; + $a->page['aside'] .= $vcard_widget; + } if(! count($c)) return; @@ -74,23 +76,22 @@ function common_content(&$a) { if($cid) - $t = count_common_friends($uid,$cid); + $t = count_common_friends($uid, $cid); else - $t = count_common_friends_zcid($uid,$zcid); + $t = count_common_friends_zcid($uid, $zcid); - - $a->set_pager_total($t); - - if(! $t) { + if(count($t)) + $a->set_pager_total($t); + else { notice( t('No contacts in common.') . EOL); return $o; } if($cid) - $r = common_friends($uid,$cid); + $r = common_friends($uid, $cid, $a->pager['start'], $a->pager['itemspage']); else - $r = common_friends_zcid($uid,$zcid); + $r = common_friends_zcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']); if(! count($r)) { @@ -127,13 +128,19 @@ function common_content(&$a) { $entries[] = $entry; } + if($cmd === 'loc' && $cid && $uid == local_user()) { + $tab_str = contacts_tab($a, $cid, 4); + } else + $title = t('Common Friends'); + $tpl = get_markup_template('viewcontact_template.tpl'); $o .= replace_macros($tpl,array( - '$title' => t('Common Friends'), + '$title' => $title, + '$tab_str' => $tab_str, '$contacts' => $entries, + '$paginate' => paginate($a), )); -// $o .= paginate($a); return $o; }