From d6c6a2b144ad1c619cef70310bad7e0cdc920e77 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 13 Aug 2013 02:29:10 -0700 Subject: debugging issue #58 - seems to work but needs (more) theming --- include/Contact.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/Contact.php') diff --git a/include/Contact.php b/include/Contact.php index 6b0ffe4f7..992ed27e2 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -3,20 +3,27 @@ function rconnect_url($channel_id,$xchan) { + if(! $xchan) return ''; - $r = q("select abook_id from abook where abook_channel_id = %d and abook_xchan = '%s' limit 1", + + $r = q("select abook_id from abook where abook_channel = %d and abook_xchan = '%s' limit 1", intval($channel_id), dbesc($xchan) ); + if($r) return ''; - $r = q("select hubloc_url from hubloc where hubloc_hash = '%s' and (hubloc_flags & HUBLOC_FLAGS_PRIMARY) limit 1", - dbesc($xchan) + + $r = q("select hubloc_url from hubloc where hubloc_hash = '%s' and ( hubloc_flags & %d ) limit 1", + dbesc($xchan), + intval(HUBLOC_FLAGS_PRIMARY) ); + if($r) return $r[0]['hubloc_url']; return ''; + } function abook_connections($channel_id, $sql_conditions = '') { -- cgit v1.2.3