]> git.mxchange.org Git - friendica.git/commitdiff
more work on contact page and added new site directory
authorMike Macgirvin <mike@macgirvin.com>
Sat, 3 Jul 2010 01:37:43 +0000 (18:37 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Sat, 3 Jul 2010 01:37:43 +0000 (18:37 -0700)
mod/contacts.php
mod/directory.php [new file with mode: 0644]
view/contact_template.tpl

index e6c2005e06c7279e6950fd977eeaeebd1be78ddb..9441f3457a44195924ba14317dae27a9cdb3452c 100644 (file)
@@ -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'] )
                        ));
                }
        }
diff --git a/mod/directory.php b/mod/directory.php
new file mode 100644 (file)
index 0000000..94a826e
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+
+function directory_content(&$a) {
+
+
+       $tpl .= file_get_contents('view/directory_header');
+
+       $o .= replace_macros($tpl);
+
+       $r = q("SELECT * FORM `profile` WHERE `default` = 1 AND `publish` = 1");
+       if(count($r)) {
+
+               $tpl = file_get_contents('view/directory_item);
+
+               foreach($r as $rr) {
+
+                       $o .= directory_block($a,$rr,$tpl);
+
+               }
+       }
+       else
+               notice("No entries (some entries may be hidden).");
+}
\ No newline at end of file
index c590ba3d141ba38b717a524c1c6daabc5f5efb81..bfa901734b085570a7c4c90f59100ef457a198b6 100644 (file)
@@ -1,5 +1,6 @@
 
 <div class="contact-entry-wrapper" id="contact-entry-wrapper-$id" >
+<img class="contact-entry-direction-icon" src="$dir_icon" alt="$alt_text" title="$alt_text" />
 <div class="contact-entry-photo" id="contact-entry-photo-$id" >
        <a href="$url" title="Visit $name's profile" /><img src="$thumb" alt="$name" ></a>
 </div>