本文整理匯總了PHP中UserGroup::add_member方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserGroup::add_member方法的具體用法?PHP UserGroup::add_member怎麽用?PHP UserGroup::add_member使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserGroup
的用法示例。
在下文中一共展示了UserGroup::add_member方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update_display_group
function update_display_group($uid, $gid)
{
global $mybb, $db, $cache;
$usergroup = new UserGroup($mybb, $db, $cache);
if ($usergroup->initialize($gid)) {
$usergroup->add_member($uid);
}
}
示例2: deny
function deny($userid, $username)
{
global $mybb, $db, $cache;
$group = new UserGroup($mybb, $db, $cache);
$group->initialize(Groups::MEMBER);
$group->add_member($userid);
if (!empty($mybb->settings['rpgsuite_approval_denypm'])) {
$pm_handler = new PMDataHandler();
$pm_handler->admin_override = true;
$pm = array("subject" => $mybb->settings['rpgsuite_approval_denypm_subj'], "message" => $mybb->settings['rpgsuite_approval_denypm'], "fromid" => Accounts::ADMIN, "options" => array("savecopy" => "0"));
$pm['to'] = array($username);
$pm_handler->set_data($pm);
if (!$pm_handler->validate_pm()) {
//bad pm. oops. lol
} else {
$pm_handler->insert_pm();
}
}
}
示例3: hard_remove_member
/**
Remove a member in an ooc capacity (move to default OOC group)
*/
public function hard_remove_member($uid)
{
$this->demote_member($uid);
$defaultgroup = new UserGroup($this->mybb, $this->db, $this->cache);
if ($defaultgroup->initialize(Groups::MEMBER)) {
$defaultgroup->add_member($uid);
}
}