aboutsummaryrefslogtreecommitdiffstats
path: root/mod/contacts.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-02 18:55:43 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-02 18:55:43 -0700
commit1270243d8090fa4795475d29a918602f037cd86a (patch)
treee7241b6cfddc5a104de779f10b27daea1e7cd0c9 /mod/contacts.php
parent9bd8ee1aae6387251c3ff3500d1020cccb919a99 (diff)
downloadvolse-hubzilla-1270243d8090fa4795475d29a918602f037cd86a.tar.gz
volse-hubzilla-1270243d8090fa4795475d29a918602f037cd86a.tar.bz2
volse-hubzilla-1270243d8090fa4795475d29a918602f037cd86a.zip
start on contact page sort order
Diffstat (limited to 'mod/contacts.php')
-rw-r--r--mod/contacts.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index 9441f3457..b14377cea 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -91,14 +91,25 @@ function contacts_content(&$a) {
'$hide_text' => ((strlen($sql_extra)) ? 'Show Blocked Connections' : 'Hide Blocked Connections')
));
+ switch($sort_type) {
+ case DIRECTION_BOTH :
+ $sql_extra = " AND `dfrn-id` != '' AND `ret-id` != '' ";
+ break;
+ case DIRECTION_IN :
+ $sql_extra = " AND `dfrn-id` != '' AND `ret-id` = '' ";
+ break;
+ case DIRECTION_OUT :
+ $sql_extra = " AND `dfrn-id` = '' AND `ret-id` != '' ";
+ break;
+ case DIRECTION_ANY :
+ default:
+ $sql_extra = '';
+ break;
+ }
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d",
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d $sql_extra",
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");