hello! I am new to statusnet and have configured it to make a new blogging site wid sum new features. I want to let any registered user to add a post to any group whether or not he/she joined the group. If its possible plz let me know as soon as possible
Comments
function onMySave($user, $notice)
{
//$user = common_current_user();
//$profile = $user->getProfile();
//$group = array();
$group = User_group::getUri();
//$group = User_group::getNickName();
foreach ($group->uri as $uri) {
$nickname = User_group::getUrlId($uri);
//$grp = User_group::getForNickname($nickname);
if (!$user->isMember($nickname)) {
try {
if (Event::handle('StartJoinGroup', array($nickname, $user))) {
Group_member::join($nickname->id, $user->id);
Event::handle('EndJoinGroup', array($nickname, $user));
}
} catch (Exception $e) {
// TRANS: Server exception.
// TRANS: %1$s is a user nickname, %2$s is a group nickname.
throw new ServerException(sprintf(_m('Could not join user %1$s to group %2$s.'),
$user->nickname, $group->nickname));
}
}
}
return true;
}
this is the event i called in my plugin file and in the file newnotice.php in the savenewnotice function I added the following line:
Event::handle('MySave', array($user, &$content));
can u plz help me out with this one. me really very confused
And generally, I don't think that your idea is very good (e.g. forcefully joining a group…), but that's my opinion.