From 593d361d2e9dd177d4125a8751540f0afa4b2323 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 9 Nov 2012 00:02:46 -0800 Subject: profile/channel page view contacts --- include/text.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index dcd3ad07f..6c1a102c0 100644 --- a/include/text.php +++ b/include/text.php @@ -522,6 +522,7 @@ function contact_block() { $o = ''; $a = get_app(); +logger('contact block'); $shown = get_pconfig($a->profile['uid'],'system','display_friend_count'); if($shown === false) $shown = 24; @@ -530,7 +531,7 @@ function contact_block() { if((! is_array($a->profile)) || ($a->profile['hide_friends'])) return $o; - $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0", + $r = q("SELECT COUNT(*) AS total FROM abook WHERE abook_channel = %d and abook_flags = 0", intval($a->profile['uid']) ); if(count($r)) { @@ -541,10 +542,12 @@ function contact_block() { $micropro = Null; } else { - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0 ORDER BY RAND() LIMIT %d", +dbg(1); + $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash WHERE abook_channel = %d AND abook_flags = 0 ORDER BY RAND() LIMIT %d", intval($a->profile['uid']), intval($shown) ); +dbg(0); if(count($r)) { $contacts = sprintf( tt('%d Contact','%d Contacts', $total),$total); $micropro = Array(); @@ -575,14 +578,14 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { if($class) $class = ' ' . $class; - $url = $contact['url']; + $url = $contact['xchan_url']; $sparkle = ''; $redir = false; if($redirect) { $a = get_app(); - $redirect_url = $a->get_baseurl() . '/redir/' . $contact['id']; - if(local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === 'dfrn')) { + $redirect_url = $a->get_baseurl() . '/magic/' . $contact['abook_id']; + if(local_user() && ($contact['abook_channel'] == local_user()) && ($contact['xchan_network'] === NETWORK_ZOT)) { $redir = true; $url = $redirect_url; $sparkle = ' sparkle'; @@ -598,15 +601,15 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { . (($click) ? ' fakelink' : '') . '" ' . (($redir) ? ' ' : '') . (($url) ? ' href="' . $url . '"' : '') . $click - . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name'] - . '" >'. $contact['name'] . '' . "\r\n"; + . '" title="' . $contact['xchan_name'] . ' [' . $contact['xchan_url'] . ']" alt="' . $contact['xchan_name'] + . '" >'. $contact['xchan_name'] . '' . "\r\n"; } else { return '
' . $contact['name'] 
+			. $contact['xchan_photo_s'] . '
' . "\r\n"; } }} -- cgit v1.2.3