本文整理汇总了PHP中Division::addMember方法的典型用法代码示例。如果您正苦于以下问题:PHP Division::addMember方法的具体用法?PHP Division::addMember怎么用?PHP Division::addMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Division
的用法示例。
在下文中一共展示了Division::addMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Division
* ClanInfo_process.php
*
*/
require_once e_PLUGIN . 'ebattles/include/clan.php';
require_once e_PLUGIN . 'ebattles/include/event.php';
if (isset($_POST['joindivision'])) {
$div_id = $_POST['division'];
$division = new Division($div_id);
$q = "SELECT " . TBL_CLANS . ".*, " . TBL_DIVISIONS . ".*" . " FROM " . TBL_CLANS . ", " . TBL_DIVISIONS . " WHERE (" . TBL_DIVISIONS . ".DivisionID = '{$div_id}')" . " AND (" . TBL_DIVISIONS . ".Clan = " . TBL_CLANS . ".ClanID)";
$result = $sql->db_Query($q);
$clan_password = mysql_result($result, 0, TBL_CLANS . ".password");
$gid = mysql_result($result, 0, TBL_DIVISIONS . ".Game");
if ($clan_password == "" || $_POST['joindivisionPassword'] == $clan_password) {
$Name = $_POST["gamername"];
$UniqueGameID = $_POST["gameruniquegameid"];
$gamerID = updateGamer(USERID, $gid, $Name, $UniqueGameID);
$division->addMember(USERID, FALSE);
}
}
if (isset($_POST['quitdivision'])) {
$div_id = $_POST['division'];
$division = new Division($div_id);
// Check that the member has made no games with this division
$q_MemberScores = "SELECT " . TBL_MEMBERS . ".*, " . TBL_TEAMS . ".*, " . TBL_PLAYERS . ".*, " . TBL_SCORES . ".*" . " FROM " . TBL_MEMBERS . ", " . TBL_TEAMS . ", " . TBL_PLAYERS . ", " . TBL_SCORES . " WHERE (" . TBL_MEMBERS . ".User = " . USERID . ")" . " AND (" . TBL_MEMBERS . ".Division = '{$div_id}')" . " AND (" . TBL_TEAMS . ".Division = '{$div_id}')" . " AND (" . TBL_PLAYERS . ".Team = " . TBL_TEAMS . ".TeamID)" . " AND (" . TBL_SCORES . ".Player = " . TBL_PLAYERS . ".PlayerID)";
$result_MemberScores = $sql->db_Query($q_MemberScores);
$numMemberScores = mysql_numrows($result_MemberScores);
if ($numMemberScores == 0) {
$division->deleteMemberPlayers();
$division->deleteMember();
}
}
示例2: Division
if (isset($_POST['kick'])) {
//fm: Not good
// We can not delete members w/o deleting the corresponding players.
// And we can delete players only if they have not scored yet.
// Therefore, we can only delete members if they have not played in a match yet.
$clan_div = $_POST['clandiv'];
$division = new Division($clan_div);
$game_id = $division->getField('Game');
if (count($_POST['del']) > 0) {
$del_ids = $_POST['del'];
for ($i = 0; $i < count($del_ids); $i++) {
$q2 = "DELETE FROM " . TBL_MEMBERS . " WHERE (" . TBL_MEMBERS . ".MemberID = '{$del_ids[$i]}')";
$result2 = $sql->db_Query($q2);
}
}
//echo "-- kick --<br />";
header("Location: clanmanage.php?clanid={$clan_id}&gameid={$game_id}");
exit;
}
if (isset($_POST['claninviteuser'])) {
$user = $_POST['user'];
$clan_div = $_POST['clandiv'];
$division = new Division($clan_div);
$game_id = $division->getField('Game');
$division->addMember($user, TRUE);
//echo "-- claninviteuser --<br />";
header("Location: clanmanage.php?clanid={$clan_id}&gameid={$game_id}");
exit;
}
header("Location: clanmanage.php?clanid={$clan_id}");
exit;