undefined fn: init_groups_visitor in mod_profile, rev update

This commit is contained in:
friendica 2012-10-21 14:41:10 -07:00
commit 02251f23df
5 changed files with 55 additions and 53 deletions

View file

@ -168,23 +168,4 @@ else {
}
}
// Returns an array of group id's this contact is a member of.
// This array will only contain group id's related to the uid of this
// DFRN contact. They are *not* neccessarily unique across the entire site.
if(! function_exists('init_groups_visitor')) {
function init_groups_visitor($contact_id) {
$groups = array();
$r = q("SELECT `gid` FROM `group_member`
WHERE `contact-id` = %d ",
intval($contact_id)
);
if(count($r)) {
foreach($r as $rr)
$groups[] = $rr['gid'];
}
return $groups;
}}

View file

@ -76,6 +76,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
killme();
$contact = $r[0];
require_once('include/security.php');
$groups = init_groups_visitor($contact['id']);
if(count($groups)) {

View file

@ -371,3 +371,23 @@ function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'f
killme();
}
}
// Returns an array of group id's this contact is a member of.
// This array will only contain group id's related to the uid of this
// DFRN contact. They are *not* neccessarily unique across the entire site.
if(! function_exists('init_groups_visitor')) {
function init_groups_visitor($contact_id) {
$groups = array();
$r = q("SELECT `gid` FROM `group_member`
WHERE `contact-id` = %d ",
intval($contact_id)
);
if(count($r)) {
foreach($r as $rr)
$groups[] = $rr['gid'];
}
return $groups;
}}