aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/directory.php26
-rw-r--r--mod/dirsearch.php2
2 files changed, 24 insertions, 4 deletions
diff --git a/mod/directory.php b/mod/directory.php
index 1e5d64a0f..1b7bc3e4f 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -53,6 +53,20 @@ function directory_content(&$a) {
}
logger('mod_directory: URL = ' . $url, LOGGER_DEBUG);
+ $contacts = array();
+
+ if(local_user()) {
+ $x = q("select abook_xchan from abook where abook_channel = %d",
+ intval(local_user())
+ );
+ if($x) {
+ foreach($x as $xx)
+ $contacts[] = $xx['abook_xchan'];
+ }
+ }
+
+
+
if($url) {
$query = $url . '?f=' ;
if($search)
@@ -88,7 +102,11 @@ function directory_content(&$a) {
$profile_link = chanlink_url($rr['url']);
$pdesc = (($rr['description']) ? $rr['description'] . '<br />' : '');
-
+ $connect_link = ((local_user()) ? z_root() . '/follow?f=&url=' . urlencode($rr['address']) : '');
+
+ if(in_array($rr['hash'],$contacts))
+ $connect_link = '';
+
$details = '';
if(strlen($rr['locale']))
$details .= $rr['locale'];
@@ -142,7 +160,8 @@ function directory_content(&$a) {
'marital' => $marital,
'homepage' => $homepage,
'about' => $about,
-
+ 'conn_label' => t('Connect'),
+ 'connect' => $connect_link,
);
$arr = array('contact' => $rr, 'entry' => $entry);
@@ -150,14 +169,13 @@ function directory_content(&$a) {
call_hooks('directory_item', $arr);
$entries[] = $entry;
-
unset($profile);
unset($location);
}
- logger('mod_directory: entries: ' . print_r($entries,true), LOGGER_DATA);
+// logger('mod_directory: entries: ' . print_r($entries,true), LOGGER_DATA);
$o .= replace_macros($tpl, array(
'$search' => $search,
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 993522549..6d6ef7434 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -134,6 +134,8 @@ function dirsearch_content(&$a) {
$entry = array();
$entry['name'] = $rr['xchan_name'];
+ $entry['hash'] = $rr['xchan_hash'];
+
$entry['updated'] = (($rr['ud_date']) ? $rr['ud_date'] : '0000-00-00 00:00:00');
$entry['url'] = $rr['xchan_url'];
$entry['photo'] = $rr['xchan_photo_m'];