Exemple #1
0
function threadlog_bit($uid)
{
    global $db, $mybb, $cache;
    $member = new GroupMember($mybb, $db, $cache);
    if ($member->initialize($uid)) {
        $user = $member->get_info();
        return "Viewing <a href='misc.php?action=threadlog&uid=" . $uid . "'>" . $user['username'] . "'s Threadlog</a>";
    } else {
        return "Viewing <a href='misc.php?action=threadlog'>Threadlog</a>";
    }
}
/**
 * Sets the user options values in ACP on submit
 */
function admin_user_commit()
{
    global $mybb, $user, $db, $cache;
    // Save new group rank
    if ($mybb->settings['rpgsuite_groupranks']) {
        $rankid = (int) $mybb->input['rank_uid' . $user['uid']];
        $groupuser = new GroupMember($mybb, $db, $cache);
        $groupuser->initialize($user['uid']);
        $groupuser->update_rank($rankid);
    }
}
 /**
 Add a new member to the group
 */
 public function add_member($uid)
 {
     // Set display group
     $member = new GroupMember($this->mybb, $this->db, $this->cache);
     if ($member->initialize($uid)) {
         $user = $member->get_info();
         // If they are a pm of their old group, they won't be now!
         $this->demote_member($uid);
         // If they are in a group currently, remove it from additional
         leave_usergroup($user['uid'], $user['displaygroup']);
         // add new to additional groups
         join_usergroup($user['uid'], $this->info['gid']);
         $updatearray = array('displaygroup' => $this->info['gid'], 'group_dateline' => time());
         $member->update_member($updatearray);
         $member->update_rank($this->info['defaultrank']);
     }
 }