当前位置: 首页>>代码示例>>PHP>>正文


PHP GroupManager::addBLIDToGroupID方法代码示例

本文整理汇总了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>
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:29,代码来源:users.php

示例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>
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:31,代码来源:index.php


注:本文中的GroupManager::addBLIDToGroupID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。