aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-04-12 23:06:41 -0700
committerfriendica <info@friendica.com>2012-04-12 23:06:41 -0700
commit3c4e6d34610ae4913d1d9ea090499c5d328a62e8 (patch)
treeffba2ebe12a5e47c96e9a3a4b2c73bd50c43cd55 /include
parentaf68d033e330e33571f95763b58833273d22d3a7 (diff)
downloadvolse-hubzilla-3c4e6d34610ae4913d1d9ea090499c5d328a62e8.tar.gz
volse-hubzilla-3c4e6d34610ae4913d1d9ea090499c5d328a62e8.tar.bz2
volse-hubzilla-3c4e6d34610ae4913d1d9ea090499c5d328a62e8.zip
bug #369 - show contacts who are not in any groups
Diffstat (limited to 'include')
-rw-r--r--include/Contact.php22
-rw-r--r--include/group.php1
2 files changed, 19 insertions, 4 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 8d893cf70..657977801 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -176,12 +176,26 @@ function random_profile() {
}
-function contacts_not_grouped($uid) {
- $r = q("select * from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) ",
+function contacts_not_grouped($uid,$start = 0,$count = 0) {
+dbg(1);
+ if(! $count) {
+ $r = q("select count(*) as total from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) ",
+ intval($uid),
+ intval($uid)
+ );
+dbg(0);
+ return $r;
+
+
+ }
+dbg(1);
+ $r = q("select * from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) limit %d, %d",
+ intval($uid),
intval($uid),
- intval($uid)
+ intval($start),
+ intval($count)
);
-
+dbg(0);
return $r;
}
diff --git a/include/group.php b/include/group.php
index 4a35912e5..edb547de6 100644
--- a/include/group.php
+++ b/include/group.php
@@ -212,6 +212,7 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0
'$title' => t('Groups'),
'$edittext' => t('Edit group'),
'$createtext' => t('Create a new group'),
+ '$ungrouped' => (($every === 'contacts') ? t('Contacts not in any group') : ''),
'$groups' => $groups,
'$add' => t('add'),
));