aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/group.php10
-rw-r--r--include/text.php4
2 files changed, 8 insertions, 6 deletions
diff --git a/include/group.php b/include/group.php
index c91365896..dda432266 100644
--- a/include/group.php
+++ b/include/group.php
@@ -146,7 +146,7 @@ function group_add_member($uid,$name,$member,$gid = 0) {
// -- It was just created at another time
if(! count($r))
$r = q("INSERT INTO `group_member` (`uid`, `gid`, `xchan`)
- VALUES( %d, %d, %d ) ",
+ VALUES( %d, %d, '%s' ) ",
intval($uid),
intval($gid),
dbesc($member)
@@ -157,11 +157,13 @@ function group_add_member($uid,$name,$member,$gid = 0) {
function group_get_members($gid) {
$ret = array();
if(intval($gid)) {
- $r = q("SELECT abook.*,xchan.* FROM `group_member`
+ $r = q("SELECT abook.*,xchan.*,group_member.* FROM `group_member`
LEFT JOIN abook ON abook_xchan = `group_member`.`xchan` left join xchan on xchan_hash = abook_xchan
- WHERE `gid` = %d AND `group_member`.`uid` = %d ORDER BY xchan_name ASC ",
+ WHERE `gid` = %d AND `group_member`.`uid` = %d and not ( abook_flags & %d) and not (abook_flags & %d) ORDER BY xchan_name ASC ",
intval($gid),
- intval(local_user())
+ intval(local_user()),
+ intval(ABOOK_FLAG_SELF),
+ intval(ABOOK_FLAG_BLOCKED)
);
if(count($r))
$ret = $r;
diff --git a/include/text.php b/include/text.php
index 56f41d797..63bb320ff 100644
--- a/include/text.php
+++ b/include/text.php
@@ -549,12 +549,12 @@ function contact_block() {
$micropro = Null;
} else {
-dbg(1);
+
$r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash WHERE abook_channel = %d AND abook_flags = 0 ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),
intval($shown)
);
-dbg(0);
+
if(count($r)) {
$contacts = sprintf( tt('%d Contact','%d Contacts', $total),$total);
$micropro = Array();