aboutsummaryrefslogtreecommitdiffstats
path: root/mod/contacts.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-11 03:07:15 -0800
committerfriendica <info@friendica.com>2012-02-11 03:07:15 -0800
commitda946bb9b0905a2126e7234c6c85157bd7978102 (patch)
tree34e31cb598739060d3ccbe8f0cfe6e93ebaaa0be /mod/contacts.php
parent1d5f1723e0a9100783f3999c49c1d60c4ad69541 (diff)
downloadvolse-hubzilla-da946bb9b0905a2126e7234c6c85157bd7978102.tar.gz
volse-hubzilla-da946bb9b0905a2126e7234c6c85157bd7978102.tar.bz2
volse-hubzilla-da946bb9b0905a2126e7234c6c85157bd7978102.zip
bug #278 show only blocked contacts
Diffstat (limited to 'mod/contacts.php')
-rwxr-xr-xmod/contacts.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index 206128f9d..aaa2ff961 100755
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -356,20 +356,29 @@ function contacts_content(&$a) {
}
+ $blocked = false;
+
$_SESSION['return_url'] = $a->query_string;
if(($a->argc == 2) && ($a->argv[1] === 'all'))
$sql_extra = '';
- else
- $sql_extra = " AND `blocked` = 0 ";
-
+ else {
+ if(($a->argc == 2) && ($a->argv[1] === 'blocked')) {
+ $sql_extra = " AND `blocked` = 1 ";
+ $blocked = true;
+ }
+ else
+ $sql_extra = " AND `blocked` = 0 ";
+ }
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
$tpl = get_markup_template("contacts-top.tpl");
$o .= replace_macros($tpl,array(
'$header' => t('Contacts'),
- '$hide_url' => ((strlen($sql_extra)) ? 'contacts/all' : 'contacts' ),
- '$hide_text' => ((strlen($sql_extra)) ? t('Show Blocked Connections') : t('Hide Blocked Connections')),
+ '$hide_url' => (($blocked) ? 'contacts' : 'contacts/blocked'),
+ '$hide_text' => (($blocked) ? t('Show Unblocked Contacts') : t('Show Blocked Contacts')),
+ '$all_url' => 'contacts/all',
+ '$all_text' => t('Show All Contacts'),
'$search' => $search,
'$desc' => t('Search your contacts'),
'$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""),