aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-11 21:39:51 -0800
committerfriendica <info@friendica.com>2012-02-11 21:39:51 -0800
commitd856ae1fa527772ebc9194f25a1e55df614b8f3e (patch)
tree890b18548f8c0ca22c9be1d4c9959c7650303e93 /mod
parent0c4606682ff0463c7d07e5215bb3d0881f94701c (diff)
downloadvolse-hubzilla-d856ae1fa527772ebc9194f25a1e55df614b8f3e.tar.gz
volse-hubzilla-d856ae1fa527772ebc9194f25a1e55df614b8f3e.tar.bz2
volse-hubzilla-d856ae1fa527772ebc9194f25a1e55df614b8f3e.zip
bug #279, add network selector widget to contacts page
Diffstat (limited to 'mod')
-rwxr-xr-xmod/contacts.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index aaa2ff961..32af29c15 100755
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -42,6 +42,7 @@ function contacts_init(&$a) {
$a->page['aside'] .= findpeople_widget();
+ $a->page['aside'] .= networks_widget('contacts',$_GET['nets']);
}
function contacts_post(&$a) {
@@ -371,10 +372,11 @@ function contacts_content(&$a) {
$sql_extra = " AND `blocked` = 0 ";
}
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
+ $nets = ((x($_GET,'nets')) ? notags(trim($_GET['nets'])) : '');
$tpl = get_markup_template("contacts-top.tpl");
$o .= replace_macros($tpl,array(
- '$header' => t('Contacts'),
+ '$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''),
'$hide_url' => (($blocked) ? 'contacts' : 'contacts/blocked'),
'$hide_text' => (($blocked) ? t('Show Unblocked Contacts') : t('Show Blocked Contacts')),
'$all_url' => 'contacts/all',
@@ -392,6 +394,9 @@ function contacts_content(&$a) {
$search = dbesc($search.'*');
$sql_extra .= ((strlen($search)) ? " AND MATCH `name` AGAINST ('$search' IN BOOLEAN MODE) " : "");
+ if($nets)
+ $sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets));
+
$sql_extra2 = ((($sort_type > 0) && ($sort_type <= CONTACT_IS_FRIEND)) ? sprintf(" AND `rel` = %d ",intval($sort_type)) : '');