get rid of duplicate function
This commit is contained in:
parent
5ad9b48f1d
commit
d19dfc87a6
@ -1705,7 +1705,7 @@ function recursive_activity_recipients($arr_allow_cid, $arr_allow_gid, $arr_deny
|
|||||||
|
|
||||||
//turn allow_gid into allow_cid's
|
//turn allow_gid into allow_cid's
|
||||||
foreach($arr_allow_gid as $gid) {
|
foreach($arr_allow_gid as $gid) {
|
||||||
$in_group = in_group($gid);
|
$in_group = group_get_members($gid);
|
||||||
$arr_allow_cid = array_unique(array_merge($arr_allow_cid, $in_group));
|
$arr_allow_cid = array_unique(array_merge($arr_allow_cid, $in_group));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1727,7 +1727,7 @@ function recursive_activity_recipients($arr_allow_cid, $arr_allow_gid, $arr_deny
|
|||||||
* */
|
* */
|
||||||
if($parent_arr['allow_gid']) {
|
if($parent_arr['allow_gid']) {
|
||||||
foreach($parent_arr['allow_gid'][$count] as $gid) {
|
foreach($parent_arr['allow_gid'][$count] as $gid) {
|
||||||
$in_group = in_group($gid);
|
$in_group = group_get_members($gid);
|
||||||
$parent_arr['allow_cid'][$count] = array_unique(array_merge($parent_arr['allow_cid'][$count], $in_group));
|
$parent_arr['allow_cid'][$count] = array_unique(array_merge($parent_arr['allow_cid'][$count], $in_group));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1808,31 +1808,6 @@ function recursive_activity_recipients($arr_allow_cid, $arr_allow_gid, $arr_deny
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Returns members of a group.
|
|
||||||
*
|
|
||||||
* @param int $group_id id of the group to look up
|
|
||||||
*/
|
|
||||||
function in_group($group_id) {
|
|
||||||
$group_members = array();
|
|
||||||
|
|
||||||
/** @TODO make these two queries one with a join. */
|
|
||||||
$x = q("SELECT id FROM groups WHERE hash = '%s'",
|
|
||||||
dbesc($group_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
$r = q("SELECT xchan FROM group_member WHERE gid = %d",
|
|
||||||
intval($x[0]['id'])
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach($r as $ig) {
|
|
||||||
$group_members[] = $ig['xchan'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group_members;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function filepath_macro($s) {
|
function filepath_macro($s) {
|
||||||
|
|
||||||
return str_replace(
|
return str_replace(
|
||||||
|
Reference in New Issue
Block a user