示例#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>";
    }
}
示例#2
0
 /**
 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']);
     }
 }