aboutsummaryrefslogtreecommitdiffstats
path: root/mod/contacts.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-02 18:37:43 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-02 18:37:43 -0700
commit9bd8ee1aae6387251c3ff3500d1020cccb919a99 (patch)
tree3125efa3e9467666e413e00585e2e17ae652d857 /mod/contacts.php
parent0ecfe292b0a50a23420e31e7a00ab28bbc4958d9 (diff)
downloadvolse-hubzilla-9bd8ee1aae6387251c3ff3500d1020cccb919a99.tar.gz
volse-hubzilla-9bd8ee1aae6387251c3ff3500d1020cccb919a99.tar.bz2
volse-hubzilla-9bd8ee1aae6387251c3ff3500d1020cccb919a99.zip
more work on contact page and added new site directory
Diffstat (limited to 'mod/contacts.php')
-rw-r--r--mod/contacts.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index e6c2005e0..9441f3457 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -95,6 +95,10 @@ function contacts_content(&$a) {
$r = q("SELECT * FROM `contact` WHERE `uid` = %d",
intval($_SESSION['uid']));
+define ( 'DIRECTION_IN', 0);
+define ( 'DIRECTION_OUT', 1);
+define ( 'DIRECTION_BOTH', 2);
+
if(count($r)) {
$tpl = file_get_contents("view/contact_template.tpl");
@@ -102,11 +106,32 @@ function contacts_content(&$a) {
foreach($r as $rr) {
if($rr['self'])
continue;
+ $direction = '';
+ if(strlen($rr['dfrn-id'])) {
+ if(strlen($rr['ret-id'])) {
+ $direction = DIRECTION_BOTH;
+ $dir_icon = 'images/lrarrow.gif';
+ $alt_text = 'Mutual Friendship';
+ }
+ else {
+ $direction = DIRECTION_OUT;
+ $dir_icon = 'images/rarrow.gif';
+ $alt_text = 'You are a fan of';
+ }
+ }
+ else {
+ $direction = DIRECTION_IN;
+ $dir_icon = 'images/larrow.gif';
+ $alt_text = 'is a fan of yours';
+ }
+
$o .= replace_macros($tpl, array(
'$id' => $rr['id'],
+ '$alt_text' => $alt_text,
+ '$dir_icon' => $dir_icon,
'$thumb' => $rr['thumb'],
'$name' => $rr['name'],
- '$url' => $rr['url']
+ '$url' => (($direction != DIRECTION_IN) ? "redir/{$rr['id']}" : $rr['url'] )
));
}
}