本文整理汇总了PHP中GroupManager::addBLIDToGroupID方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupManager::addBLIDToGroupID方法的具体用法?PHP GroupManager::addBLIDToGroupID怎么用?PHP GroupManager::addBLIDToGroupID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupManager
的用法示例。
在下文中一共展示了GroupManager::addBLIDToGroupID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
require_once dirname(__DIR__) . '/private/class/GroupManager.php';
$group = GroupManager::getFromName("Beta");
if ($group === false) {
GroupManager::createGroupWithLeaderBLID("Beta", "Closed beta", "ff0000", "gear", 9789);
$group = GroupManager::getFromName("Beta");
}
if (isset($_POST['action'])) {
if ($_POST['action'] == "add") {
$res = GroupManager::addBLIDToGroupID($_POST['blid'], $group->getId());
if ($res) {
echo "Added " . $_POST['blid'] . "<hr />";
} else {
echo "Failed to add " . $_POST['blid'] . "<hr />";
}
}
}
$members = GroupManager::getMembersByID($group->getId());
foreach ($members as $mem) {
echo $mem . "<br />";
}
?>
<hr />
<form action="" method="post">
<input type="hidden" name="action" value="add" />
<input type="text" name="blid" />
<input type="submit" value="Add" />
</form>
示例2:
}
} else {
if ($user->inGroup("Reviewer") || $user->inGroup("Moderator") || $user->inGroup("Administrator")) {
$message = "Welcome back, reviewer, moderator, and/or administrator! You can find the latest download <a href=\"/api/beta/System_BlocklandGlass.zip\">here</a>!";
} else {
if ($user->inGroup("Beta")) {
$message = "Welcome back, tester! You can find the latest download <a href=\"/api/beta/System_BlocklandGlass.zip\">here</a>!";
} else {
if ($closed === true) {
$message = "We are not currently looking for testers.";
} else {
if ($group->getMemberCount() >= $cap) {
$message = "The private testing is currently full. Try again later.";
} else {
if (isset($_POST['submit']) && $_POST['submit'] == "Join") {
$res = GroupManager::addBLIDToGroupID($user->getBlid(), $group->getId());
if ($res) {
$message = "Welcome to Glass Live private testing! You can download the latest version <a href=\"/api/beta/System_BlocklandGlass.zip\">here</a>";
} else {
$message = "Error joining";
}
} else {
$message = "There's currently <b>" . ($cap - $group->getMemberCount()) . '</b> spots left!<br />' . '<form action="" method="post" /><input type="submit" value="Join" name="submit"/></form>';
}
}
}
}
}
}
?>
<style>