Adding post to any group

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

  • can plz anyone let me know hw to write a plugin for the above...
  • You should be able to find some help here: http://status.net/wiki/HOWTO_Make_a_Plugin
  • @habi I already made a plugin which forcefully lets the user join a group and then leave the particular group when saving a post. I am writing the code below plz let me know if there should be any changes:




    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
  • I am just a user of StatusNet, and have really no idea of the codebase, so I cannot help you with this request.
    And generally, I don't think that your idea is very good (e.g. forcefully joining a group…), but that's my opinion.
  • @habi thnx for the help. but i needed that every user should be able to post in any group they want which is not possible until they join the particular group.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID