aboutsummaryrefslogtreecommitdiffstats
path: root/include/Contact.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-13 02:06:05 -0700
committerfriendica <info@friendica.com>2013-08-13 02:06:05 -0700
commitb9a8b73392afc6e460073ac6305da24623de5b49 (patch)
tree425cd32b3b604c9a641030c205244bdacddf2731 /include/Contact.php
parent55cb32248953c6e63a2da478f0eb3895875f93d8 (diff)
downloadvolse-hubzilla-b9a8b73392afc6e460073ac6305da24623de5b49.tar.gz
volse-hubzilla-b9a8b73392afc6e460073ac6305da24623de5b49.tar.bz2
volse-hubzilla-b9a8b73392afc6e460073ac6305da24623de5b49.zip
untested patch for issue #58 - will require theming if it works
Diffstat (limited to 'include/Contact.php')
-rw-r--r--include/Contact.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/Contact.php b/include/Contact.php
index b9ad1e4cb..6b0ffe4f7 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -1,6 +1,24 @@
<?php /** @file */
+
+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",
+ 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)
+ );
+ if($r)
+ return $r[0]['hubloc_url'];
+ return '';
+}
+
function abook_connections($channel_id, $sql_conditions = '') {
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d
and not ( abook_flags & %d ) $sql_conditions",