本文整理汇总了PHP中Member::postNotification方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::postNotification方法的具体用法?PHP Member::postNotification怎么用?PHP Member::postNotification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::postNotification方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Member
$memberInfo = $member->get_info();
$consoleObj->select($cID);
$eventObj->select($eID);
if (!$member->hasAccess($consoleObj) || !$eventObj->memberHasAccess($memberInfo['member_id'], "invitemembers") && $memberInfo['rank_id'] != 1) {
exit;
}
}
echo "\n\n<script type='text/javascript'>\n\$(document).ready(function() {\n\$('#breadCrumbTitle').html(\"Invite Members\");\n\$('#breadCrumb').html(\"<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&select=" . $eventInfo['event_id'] . "'>" . $consoleTitle . "</a> > <b>" . $eventInfo['title'] . ":</b> Invite Members\");\n});\n</script>\n";
$dispError = "";
$countErrors = 0;
$objInviteMember = new Member($mysqli);
if ($_POST['submit']) {
foreach ($_SESSION['btInviteList'] as $value) {
$checkInvite = $eventObj->inviteMember($value, $memberInfo['member_id']);
if ($objInviteMember->select($value) && $checkInvite === true) {
$objInviteMember->postNotification("You have been invited to the event, <b>" . $eventInfo['title'] . "</b>!. Go to the <a href='" . $MAIN_ROOT . "events/info.php?eID=" . $eventInfo['event_id'] . "'>event</a> page to view more info.", "general");
} elseif ($objInviteMember->select($value) && $checkInvite === false) {
$dispInviteErrorName = $objInviteMember->get_info_filtered("username");
$countErrors++;
$dispError .= " <b>·</b> Unable to invite " . $dispInviteErrorName . ".<br>";
} elseif (!$objInviteMember->select($value)) {
$countErrors++;
$dispError .= " <b>·</b> You selected an invalid member.<br>";
} elseif ($checkInvite == "dup") {
$dispInviteErrorName = $objInviteMember->get_info_filtered("username");
$countErrors++;
$dispError .= " <b>·</b> Unable to invite " . $dispInviteErrorName . ". (already invited)<br>";
}
}
if ($countErrors == 0) {
echo "\n\t\t\t\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\tSuccessfully sent event invitations!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Invite Members', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&select=" . $eventInfo['event_id'] . "', 'successBox');\n\t\t\t</script>\n\t\t\n\t\t";
示例2: count
$memberInfo = $member->get_info_filtered();
if ($squadObj->select($_POST['sID']) && $squadObj->memberHasAccess($memberInfo['member_id'], "acceptapps") && $squadAppObj->select($_POST['saID'])) {
$squadInfo = $squadObj->get_info_filtered();
$squadAppInfo = $squadAppObj->get_info();
$squadRankList = $squadObj->getRankList();
if ($squadAppInfo['squad_id'] == $_POST['sID'] && $squadAppInfo['status'] == 0 && count($squadRankList) > 1) {
if ($_POST['action'] == "accept") {
$squadRankKey = count($squadRankList) - 1;
$newMemberSquadRank = $squadRankList[$squadRankKey];
$squadAppObj->update(array("dateaction", "status", "squadmember_id"), array(time(), "1", $memberInfo['member_id']));
$arrColumns = array("squad_id", "member_id", "squadrank_id", "datejoined");
$arrValues = array($squadAppInfo['squad_id'], $squadAppInfo['member_id'], $newMemberSquadRank, time());
$squadObj->objSquadMember->addNew($arrColumns, $arrValues);
$intViewSquadsCID = $consoleObj->findConsoleIDByName("View Your Squads");
$member->select($squadAppInfo['member_id']);
$member->postNotification("Congratulations! Your application for the squad <b>" . $squadInfo['name'] . "</b> has been approved. View the Squads section of <a href='" . $MAIN_ROOT . "members'>My Account</a> to <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intViewSquadsCID . "'>View Your Squads</a>.");
$mysqli->query("DELETE FROM " . $dbprefix . "squadinvites WHERE receiver_id = '" . $squadAppInfo['member_id'] . "'");
echo "\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\$('#actionMessage').html(\"<p class='main' align='center' style='font-weight: bold'><span class='successFont'>Squad Application Approved!</span></p>\");\n\t\t\t\t\t\t});\n\t\t\t\t\t</script>\n\t\t\t\t";
} else {
$squadAppObj->update(array("dateaction", "status", "squadmember_id"), array(time(), "2", $memberInfo['member_id']));
$member->select($squadAppInfo['member_id']);
$member->postNotification("Your application to join <b><a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $squadInfo['squad_id'] . "'>" . $squadInfo['name'] . "</a></b> has been declined. You may now re-apply if you want to.");
echo "\n\t\t\t\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\$('#actionMessage').html(\"<p class='main' align='center' style='font-weight: bold'><span class='failedFont'>Squad Applicaion Declined!</span></p>\");\n\t\t\t\t\t\t});\n\t\t\t\t\t</script>\n\t\t\t\n\t\t\t\t";
}
} elseif (count($squadRankList) <= 1 && $_POST['action'] == "accept") {
echo "\n\t\t\t\t<div style='display: none' id='errorMessage'>\n\t\t\t\t\t<p align='center' class='main'>You must have at least one rank besides the founder's rank to add a new member!</p>\n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$('#errorMessage').dialog({\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle: 'Manage Squads - Accept Application',\n\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'Ok': function() {\n\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t";
}
include "applist.php";
} else {
echo "\n\t\t\t<script type='text/javascript'>\n\t\t\t\twindow.location = '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'\n\t\t\t</script>\n\t\t";
}
示例3: array
}
// Check Recruiter
if (!$memberObj->select($_POST['newrecruiter'])) {
$countErrors++;
$dispError = " <b>·</b> You selected an invalid Recruiter.<br>";
} else {
$newRecruiterInfo = $memberObj->get_info_filtered();
}
if ($countErrors == 0) {
$arrColumns = array("recruiter");
$arrValues = array($_POST['newrecruiter']);
$memberObj->select($_POST['member']);
if ($memberObj->update($arrColumns, $arrValues)) {
$logMessage = $member->getMemberLink() . " changed " . $newMemberInfo['username'] . "'s recruiter from " . $oldRecruiterInfo['username'] . " to " . $newRecruiterInfo['username'] . ".<br><br><b>Reason:</b><br>" . filterText($_POST['reason']);
echo "\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\tSuccessfully set " . $memberObj->getMemberLink() . "'s recruiter to <b>" . $newRecruiterInfo['username'] . "</b>!\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tpopupDialog('Set Member\\'s Recruiter', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t</script>\n\t\t\t\n\t\t\t";
$memberObj->postNotification("Your recruiter has been set to " . $newMemberInfo['username'] . "!");
$member->select($memberInfo['member_id']);
$member->logAction($logMessage);
} else {
$countErrors++;
$dispError .= " <b>·</b> Unable to save information to the database. Please contact the website administrator.<br>";
}
}
if ($countErrors > 0) {
$_POST = filterArray($_POST);
$_POST['submit'] = false;
}
}
if (!$_POST['submit']) {
$result = $mysqli->query("SELECT " . $dbprefix . "members.* FROM " . $dbprefix . "members, " . $dbprefix . "ranks WHERE " . $dbprefix . "ranks.rank_id = " . $dbprefix . "members.rank_id AND " . $dbprefix . "members.disabled = '0' AND " . $dbprefix . "members.rank_id != '1' ORDER BY " . $dbprefix . "ranks.ordernum DESC, " . $dbprefix . "members.username");
while ($row = $result->fetch_assoc()) {
示例4: notifyManagers
public function notifyManagers()
{
$webInfoObj = new WebsiteInfo($this->MySQL);
$memberObj = new Member($this->MySQL);
$consoleObj = new ConsoleOption($this->MySQL);
$webInfoObj->select(1);
$webInfo = $webInfoObj->get_info_filtered();
$viewMemberAppCID = $consoleObj->findConsoleIDByName("View Member Applications");
$consoleObj->select($viewMemberAppCID);
$arrBCC = array();
$result = $this->MySQL->query("SELECT member_id FROM " . $this->MySQL->get_tablePrefix() . "members WHERE disabled = '0'");
while ($row = $result->fetch_assoc()) {
$memberObj->select($row['member_id']);
if ($memberObj->hasAccess($consoleObj)) {
if ($memberObj->get_info("email") != "") {
$arrBCC[] = array("email" => $memberObj->get_info("email"), "name" => $memberObj->get_info("username"));
}
$memberObj->postNotification("A new member has signed up! Go to the <a href='" . MAIN_ROOT . "members/console.php?cID=" . $viewMemberAppCID . "'>View Member Applications</a> page to review the application.");
}
}
$subject = $webInfo['clanname'] . ": New Member Application";
$message = "A new member, " . $this->arrObjInfo['username'] . ", has signed up at your website: <a href='" . FULL_SITE_URL . "'>" . $webInfo['clanname'] . "</a>!";
$webInfoObj->objBTMail->sendMail("", $subject, $message, array("bcc" => $arrBCC));
}
示例5: Basic
$consoleObj->select($cID);
if (!$member->authorizeLogin($_SESSION['btPassword']) || !$member->hasAccess($consoleObj)) {
exit;
}
$memberInfo = $member->get_info_filtered();
$iaRequestObj = new Basic($mysqli, "iarequest", "iarequest_id");
$checkRequestID = $iaRequestObj->select($_POST['iaRequestID']);
if ($_POST['action'] == "postmessage" && trim($_POST['message']) != "" && $checkRequestID) {
$iaRequestMessageObj = new Basic($mysqli, "iarequest_messages", "iamessage_id");
$arrColumns = array("iarequest_id", "member_id", "messagedate", "message");
$arrValues = array($iaRequestObj->get_info("iarequest_id"), $memberInfo['member_id'], time(), $_POST['message']);
$iaRequestMessageObj->addNew($arrColumns, $arrValues);
echo dispIAMessages($iaRequestObj->get_info("iarequest_id"));
$requestIACID = $consoleObj->findConsoleIDByName("Inactive Request");
$member->select($iaRequestObj->get_info("member_id"));
$member->postNotification("A new message was posted on your inactive request!<br><br><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $requestIACID . "'>View Messages</a>");
exit;
} elseif (($_POST['action'] == "approve" || $_POST['action'] == "deny") && $checkRequestID) {
$requestStatus = $_POST['action'] == "approve" ? 1 : 2;
$iaRequestObj->update(array("reviewer_id", "reviewdate", "requeststatus"), array($memberInfo['member_id'], time(), $requestStatus));
if ($requestStatus == 1) {
$member->select($iaRequestObj->get_info("member_id"));
$member->update(array("onia", "inactivedate"), array(1, time()));
$member->postNotification("Your inactive request was approved!");
} else {
$member->select($iaRequestObj->get_info("member_id"));
$member->update(array("onia", "inactivedate"), array(0, 0));
$member->postNotification("Your inactive request was denied!");
}
$member->select($memberInfo['member_id']);
} elseif ($_POST['action'] == "delete" && $checkRequestID) {
示例6: notifyEventInvites
public function notifyEventInvites($strMessage)
{
if ($this->intTableKeyValue != "") {
$objMember = new Member($this->MySQL);
$arrInvitedMembers = $this->getInvitedMembers(true);
foreach ($arrInvitedMembers as $value) {
if ($objMember->select($value)) {
$objMember->postNotification($strMessage);
}
}
}
return true;
}
示例7: foreach
}
if ($customPageInfo['specialform'] == "") {
echo "\n\t\t\t\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t" . $customPageInfo['submitmessage'] . "\n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tpopupDialog('" . $customPageInfo['name'] . "', '" . $customPageInfo['submitlink'] . "', 'successBox');\n\t\t\t\t</script>\n\t\t\t";
} else {
echo "\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t" . $customPageInfo['submitmessage'] . "\n\t\t\t\t\n\t\t\t\t\t<form action='" . $customPageInfo['submitlink'] . "' method='post'>\n\t\t\t\t\t\t";
foreach ($arrComponents as $value) {
$tempName = "customform_" . $value;
echo "\t\n\t\t\t\t\t\t\t<input type='hidden' name='" . $tempName . "' value='" . $_POST[$tempName] . "'>\n\t\t\t\t\t\t";
}
echo "\n\t\t\t\t\t\t<input type='submit' name='submit' id='btnSubmitCustomForm' style='display: none'>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\$(document).ready(function() {\n\t\t\n\t\t\t\t\t\$('#successBox').dialog({\n\t\t\t\t\t\ttitle: '" . $customPageInfo['name'] . "',\n\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t'Ok': function() {\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t//\$('#btnSubmitCustomForm').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbeforeClose: function() {\n\t\t\t\t\t\t\t\$('#btnSubmitCustomForm').click();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\$('.ui-dialog :button').blur();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t\n\t\t\t";
}
$member = new Member($mysqli);
$member->selectAdmin();
$consoleObj = new ConsoleOption($mysqli);
$viewSubmissionsCID = $consoleObj->findConsoleIDByName("View Custom Form Submissions");
$member->postNotification("There is a new submission for custom form: <b>" . $customPageInfo['name'] . "</b><br><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $viewSubmissionsCID . "'>View Form Submissions</a>");
}
if ($countErrors > 0) {
$_POST = filterArray($_POST);
$_POST['submit'] = false;
}
}
if (!$_POST['submit']) {
echo "<div class='formDiv'>";
if ($dispError != "") {
echo "\n\t\t<div class='errorDiv'>\n\t\t<strong>Unable to submit form because the following errors occurred:</strong><br><br>\n\t\t{$dispError}\n\t\t</div>\n\t\t";
}
echo $customPageInfo['pageinfo'];
echo "\n\t\n\t\t<form action='" . $MAIN_ROOT . "customform.php?pID=" . $_GET['pID'] . "' method='post'>\n\t\t\t<table class='formTable'>\n\t\t\t";
foreach ($arrComponents as $componentID) {
$customFormObj->objComponent->select($componentID);
示例8: Member
include_once "../../../classes/event.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$eventObj = new Event($mysqli);
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage My Events");
$consoleObj->select($cID);
if ($member->authorizeLogin($_SESSION['btPassword']) && $eventObj->objEventMember->select($_POST['eMemID'])) {
$eventID = $eventObj->objEventMember->get_info("event_id");
$memberInfo = $member->get_info_filtered();
if ($eventObj->select($eventID) && $member->hasAccess($consoleObj) && ($eventObj->memberHasAccess($memberInfo['member_id'], "manageinvites") || $memberInfo['rank_id'] == 1)) {
$eventInfo = $eventObj->get_info_filtered();
$eventMemberInfo = $eventObj->objEventMember->get_info_filtered();
$objInviteMember = new Member($mysqli);
$objInviteMember->select($eventMemberInfo['member_id']);
$objInviteMember->postNotification("You were uninvited from the event <b>" . $eventInfo['title'] . "</b>!");
$eventObj->objEventMember->delete();
$arrInvitedMembers = $eventObj->getInvitedMembers(true);
$sqlInvitedMembers = "('" . implode("','", $arrInvitedMembers) . "')";
$memberoptions = "<option value=''>Select</option>";
$result = $mysqli->query("SELECT m.member_id, m.username, r.ordernum, r.name FROM " . $dbprefix . "members m, " . $dbprefix . "ranks r WHERE m.rank_id = r.rank_id AND m.member_id IN " . $sqlInvitedMembers . " AND m.disabled = '0' AND m.rank_id != '1' ORDER BY r.ordernum DESC");
while ($row = $result->fetch_assoc()) {
$row = filterArray($row);
$eventMemberID = $eventObj->getEventMemberID($row['member_id']);
if ($eventMemberID !== false) {
$memberoptions .= "<option value='" . $eventMemberID . "'>" . $row['name'] . " " . $row['username'] . "</option>";
}
}
echo $memberoptions;
}
}
示例9: count
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj) && $squadInviteObj->select($_POST['siID'])) {
$memberInfo = $member->get_info();
$memberLink = $member->getMemberLink();
$squadInviteInfo = $squadInviteObj->get_info();
$squadObj->select($squadInviteInfo['squad_id']);
$squadInfo = $squadObj->get_info_filtered();
$squadMemberList = $squadObj->getMemberList();
if ($squadInviteInfo['receiver_id'] == $memberInfo['member_id'] && $squadInviteInfo['status'] == 0 && !in_array($memberInfo['member_id'], $squadMemberList)) {
if ($_POST['action'] == "accept") {
$arrRankList = $squadObj->getRankList();
if (!$squadObj->objSquadRank->select($squadInviteInfo['startingrank_id']) && count($arrRankList) > 1) {
$rankKey = count($arrRankList) - 1;
$squadInviteInfo['startingrank_id'] = $arrRankList[$rankKey];
} elseif (!$squadObj->objSquadRank->select($squadInviteInfo['startingrank_id']) && count($arrRankList) <= 1) {
$member->select($squadInfo['member_id']);
$member->postNotification("There are currently members in your squad, <b><a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $squadInfo['squad_id'] . "'>" . $squadInfo['name'] . "</a></b> without ranks!");
$member->select($memberInfo['member_id']);
}
$squadInviteObj->update(array("dateaction", "status"), array(time(), "1"));
$arrColumns = array("squad_id", "member_id", "squadrank_id", "datejoined");
$arrValues = array($squadInviteInfo['squad_id'], $memberInfo['member_id'], $squadInviteInfo['startingrank_id'], time());
$squadObj->objSquadMember->addNew($arrColumns, $arrValues);
$intViewSquadsCID = $consoleObj->findConsoleIDByName("View Your Squads");
$member->postNotification("Congratulations! You just joined the squad <b>" . $squadInfo['name'] . "</b>. View the Squads section of <a href='" . $MAIN_ROOT . "members'>My Account</a> to <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intViewSquadsCID . "'>View Your Squads</a>.");
$member->select($squadInviteInfo['sender_id']);
$member->postNotification("<b>" . $memberLink . "</b> has accepted the invitation to join <b><a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $squadInfo['squad_id'] . "'>" . $squadInfo['name'] . "</a></b>");
$mysqli->query("DELETE FROM " . $dbprefix . "squadapps WHERE member_id = '" . $memberInfo['member_id'] . "'");
echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$('#actionMessage').html(\"<p class='main' align='center' style='font-weight: bold'><span class='successFont'>Squad Invitation Accepted!</span></p>\");\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t";
} else {
$squadInviteObj->update(array("dateaction", "status"), array(time(), "2"));
$member->select($squadInviteInfo['sender_id']);
示例10: array
$dispAction = "";
if ($_SESSION['btCountMindChanges'][$_POST['emID']] == "") {
$_SESSION['btCountMindChanges'][$_POST['emID']] == 1;
} else {
$_SESSION['btCountMindChanges'][$_POST['emID']]++;
}
if ($_POST['rsvpNum'] == 1 && time() < $eventInfo['startdate']) {
$arrColumns = array("status");
$arrValues = array("1");
$dispAction = "going";
} elseif ($_POST['rsvpNum'] == 2 && time() < $eventInfo['startdate']) {
$arrColumns = array("status");
$arrValues = array("2");
$dispAction = "not going";
}
if (count($arrColumns) > 0) {
if ($eventObj->objEventMember->update($arrColumns, $arrValues)) {
$dispEventMemberLink = $member->getMemberLink();
if ($_SESSION['btCountMindChanges'][$_POST['emID']] < 5) {
if ($member->select($eventMemberInfo['invitedbymember_id'])) {
$member->postNotification($dispEventMemberLink . " is " . $dispAction . " to your <a href='" . $MAIN_ROOT . "events/info.php?eID=" . $eventInfo['event_id'] . "'>event</a>.");
}
if ($eventInfo['member_id'] != $eventMemberInfo['invitedbymember_id'] && $member->select($eventInfo['member_id'])) {
$member->postNotification($dispEventMemberLink . " is " . $dispAction . " to your <a href='" . $MAIN_ROOT . "events/info.php?eID=" . $eventInfo['event_id'] . "'>event</a>.");
}
}
$member->select($eventMemberID['member_id']);
}
}
include "invitelist.php";
}
示例11: array
$countErrors++;
$dispError .= " <b>·</b> You are already in this tournament.<br>";
}
}
if ($countErrors == 0) {
if ($tournamentObj->objPlayer->addNew(array("member_id", "tournament_id"), array($memberInfo['member_id'], $tournamentInfo['tournament_id']))) {
if ($tournamentInfo['playersperteam'] == 1) {
$arrUnfilledTeams = $tournamentObj->getUnfilledTeams();
if (count($arrUnfilledTeams) > 0) {
$newTeam = $arrUnfilledTeams[0];
$tournamentObj->objPlayer->update(array("team_id"), array($newTeam));
}
}
echo "\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\tSuccessfully Joined the Tournament!\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Join a Tournament', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t</script>\n\t\t\t\n\t\t\t";
$tMemberObj->select($tournamentInfo['member_id']);
$tMemberObj->postNotification($member->getMemberLink() . " has joined your tournament: <a href='" . $MAIN_ROOT . "tournaments/view.php?tID=" . $tournamentInfo['tournament_id'] . "'>" . $tournamentInfo['name'] . "</a>");
} else {
$countErrors++;
$dispError .= " <b>·</b> Unable to save information to the database. Please contact the website administrator.<br>";
}
}
if ($countErrors > 0) {
$_POST['submit'] = false;
}
}
if (!$_POST['submit']) {
$tournamentSQL = "('" . implode("','", $arrTournaments) . "')";
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "tournaments WHERE tournament_id NOT IN " . $tournamentSQL . " ORDER BY name");
while ($row = $result->fetch_assoc()) {
$dispSelected = "";
if (isset($_GET['tID']) && $row['tournament_id'] == $_GET['tID']) {