diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-09-21 20:52:13 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-09-21 20:52:13 -0700 |
commit | 124129e2a06a6ae82c283c8c10b7c3c7d0a0fdae (patch) | |
tree | 5040d8f857b8737a5e10b36326bcc38fa534cc93 /mod | |
parent | 188dc1fcf8be7476ca912e3e0cd7aa6cef0c9e8c (diff) | |
download | volse-hubzilla-124129e2a06a6ae82c283c8c10b7c3c7d0a0fdae.tar.gz volse-hubzilla-124129e2a06a6ae82c283c8c10b7c3c7d0a0fdae.tar.bz2 volse-hubzilla-124129e2a06a6ae82c283c8c10b7c3c7d0a0fdae.zip |
greatly simplify sorting by relation type, though it still isn't fully implemented.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/contacts.php | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/mod/contacts.php b/mod/contacts.php index d20d734d6..fa3739922 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -218,23 +218,9 @@ function contacts_content(&$a) { $search = dbesc($search.'*'); $sql_extra .= ((strlen($search)) ? " AND MATCH `name` AGAINST ('$search' IN BOOLEAN MODE) " : ""); + $sql_extra2 = ((($sort_type > 0) && ($sort_type <= REL_BUD)) ? sprintf(" AND `rel` = %d ",intval($sort_type)) : ''); - switch($sort_type) { - case REL_BUD : - $sql_extra2 = " AND `dfrn-id` != '' AND `issued-id` != '' "; - break; - case REL_VIP : - $sql_extra2 = " AND `dfrn-id` = '' AND `issued-id` != '' "; - break; - case REL_FAN : - $sql_extra2 = " AND `dfrn-id` != '' AND `issued-id` = '' "; - break; - case 0 : - default: - $sql_extra2 = ''; - break; - } - + $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `pending` = 0 $sql_extra $sql_extra2 ", intval($_SESSION['uid'])); |