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


PHP Event::getField方法代码示例

本文整理汇总了PHP中Event::getField方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::getField方法的具体用法?PHP Event::getField怎么用?PHP Event::getField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Event的用法示例。


在下文中一共展示了Event::getField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayPastEvents


//.........这里部分代码省略.........
            $text .= '<span class="paginate" style="float:left;">' . $pages->display_pages() . '</span>';
            $text .= '<span style="float:right">';
            // Sort By
            $text .= EB_PGN_L6;
            $text .= '<select class="tbox" name="orderby" onchange="this.form.submit()">';
            $text .= $items;
            $text .= '</select>';
            // Up/Down arrow
            $text .= '<input type="hidden" id="sort" name="sort" value=""/>';
            if ($sort == "ASC") {
                $text .= '<a href="javascript:buttonval(\'ASC\');" title="Ascending"><img src="' . e_PLUGIN . 'ebattles/images/sort_asc.gif" alt="Asc" style="vertical-align:middle; border:0"/></a>';
            } else {
                $text .= '<a href="javascript:buttonval(\'DESC\');" title="Descending"><img src="' . e_PLUGIN . 'ebattles/images/sort_desc.gif" alt="Desc" style="vertical-align:middle; border:0"/></a>';
            }
            $text .= '&nbsp;&nbsp;&nbsp;';
            // Go To Page
            $text .= $pages->display_jump_menu();
            $text .= '&nbsp;&nbsp;&nbsp;';
            // Items per page
            $text .= $pages->display_items_per_page();
            $text .= '</span>';
            $text .= '</div>';
            $text .= '</form><br/><br/>';
            /* Display table contents */
            $text .= '<table class="eb_table" style="width:95%"><tbody>';
            $text .= '<tr>
		<th class="eb_th2">' . EB_EVENTS_L13 . '</th>
		<th colspan="2" class="eb_th2">' . EB_EVENTS_L14 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L15 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L16 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L17 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L18 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L19 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L34 . '</th>
		</tr>';
            for ($i = 0; $i < $numEvents; $i++) {
                $gName = mysql_result($result, $i, TBL_GAMES . ".Name");
                $gIcon = mysql_result($result, $i, TBL_GAMES . ".Icon");
                $event_id = mysql_result($result, $i, TBL_EVENTS . ".EventID");
                $event = new Event($event_id);
                if ($event->getField('StartDateTime') != 0) {
                    $startdatetime_local = $event->getField('StartDateTime') + TIMEOFFSET;
                    $date_start = date("d M Y", $startdatetime_local);
                } else {
                    $date_start = "-";
                }
                if ($event->getField('EndDateTime') != 0) {
                    $enddatetime_local = $event->getField('EndDateTime') + TIMEOFFSET;
                    $date_end = date("d M Y", $enddatetime_local);
                } else {
                    $date_end = "-";
                }
                /* Nbr players */
                $q_2 = "SELECT COUNT(*) as NbrPlayers" . " FROM " . TBL_PLAYERS . " WHERE (Event = '{$event_id}')";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrplayers = $row['NbrPlayers'];
                /* Nbr Teams */
                $q_2 = "SELECT COUNT(*) as NbrTeams" . " FROM " . TBL_TEAMS . " WHERE (" . TBL_TEAMS . ".Event = '{$event_id}')";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrTeams = $row['NbrTeams'];
                /* Nbr matches */
                $q_2 = "SELECT COUNT(DISTINCT " . TBL_MATCHS . ".MatchID) as NbrMatches" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . " WHERE (Event = '{$event_id}')" . " AND (" . TBL_MATCHS . ".Status = 'active')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrmatches = $row['NbrMatches'];
                switch ($event->getField('Type')) {
                    case "One Player Ladder":
                    case "One Player Tournament":
                        $nbrTeamPlayers = $nbrplayers;
                        break;
                    case "Team Ladder":
                        $nbrTeamPlayers = $nbrTeams . '/' . $nbrplayers;
                        break;
                    case "Clan Ladder":
                    case "Clan Tournament":
                        $nbrTeamPlayers = $nbrTeams;
                        break;
                    default:
                }
                $text .= '<tr>
			<td class="eb_td"><a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event_id . '">' . $event->getField('Name') . '</a></td>
			<td class="eb_td"><img ' . getGameIconResize($gIcon) . '/></td>
			<td class="eb_td">' . $gName . '</td>
			<td class="eb_td">' . ($event->getField('MatchType') != '' ? $event->getField('MatchType') . ' - ' : '') . $event->eventTypeToString() . '</td>
			<td class="eb_td">' . $date_start . '</td>
			<td class="eb_td">' . $date_end . '</td>
			<td class="eb_td">' . $nbrTeamPlayers . '</td>
			<td class="eb_td">' . $nbrmatches . '</td>
			<td class="eb_td">' . $event->eventStatusToString() . '</td>
			</tr>';
            }
            $text .= '</tbody></table><br />';
            $text .= '<div>';
            $text .= ebImageLink('back_to_events', '', e_PLUGIN . 'ebattles/events.php', '', 'action_back.gif', EB_EVENTP_L3 . ' ' . EB_EVENTP_L4, 'jq-button');
            $text .= '</div>';
        }
    }
}
开发者ID:testt98,项目名称:ebattles,代码行数:101,代码来源:eventspast.php

示例2: intval

<?php

/**
* embedded brackets
*
*/
require_once "../../class2.php";
require_once e_PLUGIN . "ebattles/include/main.php";
require_once e_PLUGIN . "ebattles/include/event.php";
/*******************************************************************
********************************************************************/
$text = '';
$text .= '<html>';
$text .= '<head>';
$text .= '<link rel="stylesheet" type="text/css" href="./css/brackets.css" />';
$text .= '</head>';
$text .= '<body>';
$event_id = intval($_GET['eventid']);
if (!$event_id) {
    header("Location: ./events.php");
    exit;
}
$event = new Event($event_id);
list($bracket_html) = $event->brackets(false, 0, 'elimination');
$text .= $bracket_html;
$ns->tablerender($event->getField('Name') . " ({$egame} - " . $event->eventTypeToString() . ")", $text);
?>

开发者ID:testt98,项目名称:ebattles,代码行数:27,代码来源:embed_bracket.php

示例3: user_form

function user_form($action, $players_id, $players_name, $event_id, $match_id, $allowDraw, $allowForfeit, $allowScore, $userclass, $date_scheduled, $user_player)
{
    global $sql;
    global $text;
    global $tp;
    global $time;
    /* Event Info */
    $event = new Event($event_id);
    if (e_WYSIWYG) {
        $insertjs = "rows='5'";
    } else {
        require_once e_HANDLER . "ren_help.php";
        $insertjs = "rows='5' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'";
    }
    /*
    //dbg form
    echo "<br>_POST: ";
    var_dump($_POST);
    echo "<br>_GET: ";
    var_dump($_GET);
    */
    $match_str = '';
    $matchreport_str = EB_MATCHR_L31;
    if ($action == 'matchedit') {
        $matchreport_str = EB_MATCHR_L46;
        $text .= '<div>';
        $text .= EB_MATCHR_L45 . " {$match_id}<br />";
        $text .= '<img src="' . e_PLUGIN . 'ebattles/images/exclamation.png"/>';
        $text .= EB_MATCHR_L47;
        $text .= '</div><br />';
    }
    if ($action == 'matchschedulededit') {
        $matchreport_str = EB_MATCHR_L46;
        $text .= '<div>';
        $text .= EB_MATCHR_L45 . " {$match_id}<br />";
        $text .= '</div><br />';
    }
    if ($action == 'matchschedule') {
        $matchreport_str = EB_MATCHR_L48;
    }
    if ($match_id) {
        $match_str = '&amp;matchid=' . $match_id;
    }
    if ($action) {
        $action_str = '&amp;actionid=' . $action;
    }
    // Assign values to POST if not set
    // fm: check might not be correct here
    // should check if $action=='matchedit') only?
    if (!isset($_POST['time_reported']) || $action == 'matchscheduledreport') {
        $_POST['time_reported'] = $time;
    }
    $time_reported = $_POST['time_reported'];
    if (!isset($_POST['reported_by'])) {
        $_POST['reported_by'] = USERID;
    }
    $reported_by = $_POST['reported_by'];
    if (isset($_POST['match_comment'])) {
        $comment = $tp->toDB($_POST['match_comment']);
    } else {
        $comment = '';
    }
    for ($matchMap = 0; $matchMap < min($numMaps, $event->getField('MaxMapsPerMatch')); $matchMap++) {
        if (!isset($_POST['map' . $matchMap])) {
            $_POST['map' . $matchMap] = 0;
        }
    }
    // if vars are not set, set them as empty.
    if (!isset($_POST['nbr_players'])) {
        $_POST['nbr_players'] = 2;
    }
    if (!isset($_POST['nbr_teams'])) {
        $_POST['nbr_teams'] = 2;
    }
    // This form should only be used for 2 teams matches (1v1, 2v2, ...)
    // now to output the form HTML.
    $max_nbr_players = count($players_id) - 1;
    $nbr_players = $_POST['nbr_players'];
    $nbr_teams = $_POST['nbr_teams'];
    $nbr_players_per_team = $_POST['nbr_players'] / $_POST['nbr_teams'];
    $i = 1;
    // player index
    for ($t = 1; $t <= $nbr_teams; $t++) {
        if (!isset($_POST['rank' . $t])) {
            $_POST['rank' . $t] = 'Team #' . $t;
        }
        for ($p = 1; $p <= $nbr_players_per_team; $p++) {
            if (!isset($_POST['team' . $i])) {
                $_POST['team' . $i] = 'Team #' . $t;
            }
            if (!isset($_POST['score' . $i])) {
                $_POST['score' . $i] = 0;
            }
            if (!isset($_POST['faction' . $i])) {
                $_POST['faction' . $i] = 0;
            }
            $i++;
        }
    }
    $result = 1;
//.........这里部分代码省略.........
开发者ID:testt98,项目名称:ebattles,代码行数:101,代码来源:matchreport_versus_form.php

示例4: displayRecentEvents


//.........这里部分代码省略.........
    $text .= '</table>';
    $game_string = $gameid == "All" ? "" : "   AND (" . TBL_EVENTS . ".Game = '{$gameid}')";
    $matchtype_string = $matchtype == "All" ? "" : "   AND (" . TBL_EVENTS . ".MatchType = '{$matchtype}')";
    $q = "SELECT " . TBL_EVENTS . ".*, " . TBL_GAMES . ".*" . " FROM " . TBL_EVENTS . ", " . TBL_GAMES . " WHERE (" . TBL_EVENTS . ".Status = 'finished')" . "   AND (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)" . $game_string . $matchtype_string . " LIMIT 0, {$rowsPerPage}";
    $result = $sql->db_Query($q);
    $numEvents = mysql_numrows($result);
    if (!$result || $numEvents < 0) {
        /* Error occurred, return given name by default */
        $text .= EB_EVENTS_L11 . '</div>';
        $text .= '</form><br/>';
    } else {
        if ($numEvents == 0) {
            $text .= EB_EVENTS_L12 . '</div>';
            $text .= '</form><br/>';
        } else {
            $text .= '</div>';
            $text .= '</form><br/><br/>';
            /* Display table contents */
            $text .= '<table class="eb_table" style="width:95%"><tbody>';
            $text .= '<tr>
		<th class="eb_th2">' . EB_EVENTS_L13 . '</th>';
            if ($gameid == "All") {
                $text .= '<th colspan="2" class="eb_th2">' . EB_EVENTS_L14 . '</th>';
            }
            $text .= '
		<th class="eb_th2">' . EB_EVENTS_L15 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L16 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L17 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L18 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L19 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L34 . '</th>
		</tr>';
            for ($i = 0; $i < $numEvents; $i++) {
                $gName = mysql_result($result, $i, TBL_GAMES . ".Name");
                $gIcon = mysql_result($result, $i, TBL_GAMES . ".Icon");
                $event_id = mysql_result($result, $i, TBL_EVENTS . ".EventID");
                $event = new Event($event_id);
                if ($event->getField('StartDateTime') != 0) {
                    $startdatetime_local = $event->getField('StartDateTime') + TIMEOFFSET;
                    $date_start = date("d M Y", $startdatetime_local);
                } else {
                    $date_start = "-";
                }
                if ($event->getField('EndDateTime') != 0) {
                    $enddatetime_local = $event->getField('EndDateTime') + TIMEOFFSET;
                    $date_end = date("d M Y", $enddatetime_local);
                } else {
                    $date_end = "-";
                }
                /* Nbr players */
                $q_2 = "SELECT COUNT(*) as NbrPlayers" . " FROM " . TBL_PLAYERS . " WHERE (Event = '{$event_id}')";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrplayers = $row['NbrPlayers'];
                /* Nbr Teams */
                $q_2 = "SELECT COUNT(*) as NbrTeams" . " FROM " . TBL_TEAMS . " WHERE (" . TBL_TEAMS . ".Event = '{$event_id}')";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrTeams = $row['NbrTeams'];
                /* Nbr matches */
                $q_2 = "SELECT COUNT(DISTINCT " . TBL_MATCHS . ".MatchID) as NbrMatches" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . " WHERE (Event = '{$event_id}')" . " AND (" . TBL_MATCHS . ".Status = 'active')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrmatches = $row['NbrMatches'];
                switch ($event->getField('Type')) {
                    case "One Player Ladder":
                    case "One Player Tournament":
                        $nbrTeamPlayers = $nbrplayers;
                        break;
                    case "Team Ladder":
                        $nbrTeamPlayers = $nbrTeams . '/' . $nbrplayers;
                        break;
                    case "Clan Ladder":
                    case "Clan Tournament":
                        $nbrTeamPlayers = $nbrTeams;
                        break;
                    default:
                }
                $text .= '<tr>
			<td class="eb_td"><a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event_id . '">' . $event->getField('Name') . '</a></td>';
                if ($gameid == "All") {
                    $text .= '<td class="eb_td"><img ' . getGameIconResize($gIcon) . '/></td>
				<td class="eb_td">' . $gName . '</td>';
                }
                $text .= '
			<td class="eb_td">' . ($event->getField('MatchType') != '' ? $event->getField('MatchType') . ' - ' : '') . $event->eventTypeToString() . '</td>
			<td class="eb_td">' . $date_start . '</td>
			<td class="eb_td">' . $date_end . '</td>
			<td class="eb_td">' . $nbrTeamPlayers . '</td>
			<td class="eb_td">' . $nbrmatches . '</td>
			<td class="eb_td">' . $event->eventStatusToString() . '</td>
			</tr>';
            }
            $text .= '</tbody></table><br />';
            $text .= '<div>';
            $text .= ebImageLink('link_to_eventspast', '', e_PLUGIN . 'ebattles/eventspast.php', '', 'action_back.gif', EB_EVENTS_L21, 'jq-button');
            $text .= '</div>';
        }
    }
}
开发者ID:testt98,项目名称:ebattles,代码行数:101,代码来源:events.php

示例5: MPQFile

 $a = new MPQFile($tmpname, true, $debug);
 $init = $a->getState();
 if ($init == false) {
     $text .= "Error parsing uploaded file, make sure it is a valid MPQ archive!<br />\n";
 } else {
     if ($a->getFileType() == "SC2replay") {
         $b = $a->parseReplay();
         $parseDurationString .= sprintf("Parsed replay in %d ms.<br />\n", (microtime_float() - $start) * 1000);
         $players = $b->getPlayers();
         $recorder = $b->getRecorder();
         $error_str = '';
         if ($event_id) {
             $event = new Event($event_id);
             $match = new Match();
             // Check if replay->TeamSize == event->MatchType
             if ($b->getTeamSize() != $event->getField('MatchType')) {
                 $error_str .= '<li>' . EB_SUBMITREPLAY_L3 . '</li>';
             }
             // Check if winner is known
             if (!$b->isWinnerKnown()) {
                 $error_str .= '<li>' . EB_SUBMITREPLAY_L4 . '</li>';
             }
             // Check if the replay has already been submitted.
             $q2 = "SELECT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . " WHERE (" . TBL_MATCHS . ".TimePlayed = '" . $b->getCtime() . "')";
             $result2 = $sql->db_Query($q2);
             $num_rows = mysql_numrows($result2);
             if ($num_rows != 0) {
                 $error_str .= '<li>' . EB_SUBMITREPLAY_L7 . '</li>';
             }
             $match->setField('Event', $event_id);
             $match->setField('ReportedBy', USERID);
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:submitreplay.php

示例6: WHERE

    $pid = $_POST['player'];
    // Player can quit an event if he has not played yet
    // TODO - can quit if event not started.
    $q = "SELECT DISTINCT " . TBL_PLAYERS . ".*" . " FROM " . TBL_PLAYERS . ", " . TBL_SCORES . " WHERE (" . TBL_PLAYERS . ".PlayerID = '{$pid}')" . " AND (" . TBL_SCORES . ".Player = " . TBL_PLAYERS . ".PlayerID)";
    $result = $sql->db_Query($q);
    $nbrscores = mysql_numrows($result);
    if ($nbrscores == 0) {
        deletePlayer($pid);
        $event->setFieldDB('IsChanged', 1);
    }
    header("Location: eventinfo.php?eventid={$event_id}");
}
if (isset($_POST['checkinevent'])) {
    $pid = $_POST['player'];
    checkinPlayer($pid);
    if ($event->getField('FixturesEnable') == TRUE && $event->getField('Status') == 'active') {
        $event->brackets(true);
    }
    $event->setFieldDB('IsChanged', 1);
    header("Location: eventinfo.php?eventid={$event_id}");
}
if (isset($_POST['teamcheckinevent'])) {
    $team_id = $_POST['team'];
    checkinTeam($team_id);
    if ($event->getField('FixturesEnable') == TRUE && $event->getField('Status') == 'active') {
        $event->brackets(true);
    }
    $event->setFieldDB('IsChanged', 1);
    header("Location: eventinfo.php?eventid={$event_id}");
}
if (isset($_POST['joinevent'])) {
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:eventinfo_process.php

示例7: challengeDecline

 function challengeDecline()
 {
     global $sql;
     global $tp;
     global $time;
     global $pref;
     // Get info about the challenge
     $q = "SELECT DISTINCT " . TBL_CHALLENGES . ".*, " . TBL_USERS . ".*, " . TBL_EVENTS . ".*, " . TBL_GAMES . ".*" . " FROM " . TBL_CHALLENGES . ", " . TBL_USERS . ", " . TBL_EVENTS . ", " . TBL_GAMES . " WHERE (" . TBL_CHALLENGES . ".ChallengeID = '" . $this->fields['ChallengeID'] . "')" . " AND (" . TBL_USERS . ".user_id = " . TBL_CHALLENGES . ".ReportedBy)" . " AND (" . TBL_CHALLENGES . ".Event = " . TBL_EVENTS . ".EventID)" . " AND (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)";
     $result = $sql->db_Query($q);
     $numChallenges = mysql_numrows($result);
     if ($numChallenges > 0) {
         $cReportedBy = mysql_result($result, 0, TBL_USERS . ".user_id");
         $cReportedByNickName = mysql_result($result, 0, TBL_USERS . ".user_name");
         $cReportedByEmail = mysql_result($result, 0, TBL_USERS . ".user_email");
         $event_id = mysql_result($result, 0, TBL_EVENTS . ".EventID");
         $event = new Event($event_id);
         $subject = SITENAME . " " . EB_CHALLENGE_L29;
         $message = EB_CHALLENGE_L30 . $cReportedByNickName . EB_CHALLENGE_L31 . USERNAME . EB_CHALLENGE_L32 . $event->getField('Name') . EB_CHALLENGE_L33;
         $fromid = 0;
         $sendto = $cReportedBy;
         $sendtoemail = $cReportedByEmail;
         if (check_class($pref['eb_pm_notifications_class'])) {
             // Send PM
             sendNotification($sendto, $subject, $message, $fromid);
         }
         if (check_class($pref['eb_email_notifications_class'])) {
             // Send email
             require_once e_HANDLER . "mail.php";
             sendemail($sendtoemail, $subject, $message);
         }
     }
     $this->deleteChallenge();
 }
开发者ID:testt98,项目名称:ebattles,代码行数:33,代码来源:challenge.php

示例8: intval

<script type="text/javascript" src="' . e_PLUGIN . 'ebattles/js/slider.js"></script>
';
$event_id = intval($_GET['eventid']);
if (!$event_id) {
    header("Location: ./events.php");
    exit;
}
$q = "SELECT " . TBL_EVENTS . ".*, " . TBL_GAMES . ".*, " . TBL_USERS . ".*" . " FROM " . TBL_EVENTS . ", " . TBL_GAMES . ", " . TBL_USERS . " WHERE (" . TBL_EVENTS . ".EventID = '{$event_id}')" . "   AND (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)" . "   AND (" . TBL_USERS . ".user_id = " . TBL_EVENTS . ".Owner)";
$result = $sql->db_Query($q);
$event = new Event($event_id);
$egame = mysql_result($result, 0, TBL_GAMES . ".Name");
$egameid = mysql_result($result, 0, TBL_GAMES . ".GameID");
$egameicon = mysql_result($result, 0, TBL_GAMES . ".Icon");
$eowner = mysql_result($result, 0, TBL_USERS . ".user_id");
$eownername = mysql_result($result, 0, TBL_USERS . ".user_name");
$eventIsChanged = $event->getField('IsChanged');
$eventStatus = $event->getField('Status');
$rounds = unserialize($event->getFieldHTML('Rounds'));
$eMaxNumberPlayers = $event->getField('MaxNumberPlayers');
$type = $event->getField('Type');
$competition_type = $event->getCompetitionType();
/* Nbr players */
$q = "SELECT COUNT(*) as NbrPlayers" . " FROM " . TBL_PLAYERS . " WHERE (" . TBL_PLAYERS . ".Event = '{$event_id}')";
$result = $sql->db_Query($q);
$row = mysql_fetch_array($result);
$nbr_players = $row['NbrPlayers'];
$q = "SELECT " . TBL_PLAYERS . ".*" . " FROM " . TBL_PLAYERS . " WHERE (" . TBL_PLAYERS . ".Event = '{$event_id}')" . " AND (" . TBL_PLAYERS . ".CheckedIn = '1')" . " AND (" . TBL_PLAYERS . ".Seed <= '{$eMaxNumberPlayers}')";
$result = $sql->db_Query($q);
$nbr_players_checked_in = mysql_numrows($result);
/* Nbr Teams */
$q = "SELECT COUNT(*) as NbrTeams" . " FROM " . TBL_TEAMS . " WHERE (Event = '{$event_id}')";
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:eventmanage.php

示例9: addMember

 function addMember($user, $notify)
 {
     global $sql;
     global $time;
     $div_id = $this->fields['DivisionID'];
     $game_id = $this->fields['Game'];
     $q = "SELECT " . TBL_USERS . ".*" . " FROM " . TBL_USERS . " WHERE (" . TBL_USERS . ".user_id = '{$user}')";
     $result = $sql->db_Query($q);
     $Name = mysql_result($result, 0, TBL_USERS . ".user_name");
     $UniqueGameID = "";
     $gamerID = updateGamer($user, $game_id, $Name, $UniqueGameID);
     $q = " INSERT INTO " . TBL_MEMBERS . "(Division,User,timestamp)\r\n\t\tVALUES ({$div_id},{$user},{$time})";
     $sql->db_Query($q);
     // User will automatically be signed up to all current events this division participates in
     $q_2 = "SELECT " . TBL_TEAMS . ".*, " . TBL_EVENTS . ".*" . " FROM " . TBL_TEAMS . ", " . TBL_EVENTS . " WHERE (" . TBL_TEAMS . ".Division = '{$div_id}')" . " AND (" . TBL_TEAMS . ".Event = " . TBL_EVENTS . ".EventID)" . " AND (" . TBL_EVENTS . ".Status != 'finished')";
     $result_2 = $sql->db_Query($q_2);
     $num_rows_2 = mysql_numrows($result_2);
     if ($num_rows_2 > 0) {
         for ($j = 0; $j < $num_rows_2; $j++) {
             $event_id = mysql_result($result_2, $j, TBL_EVENTS . ".EventID");
             $event = new Event($event_id);
             $team_id = mysql_result($result_2, $j, TBL_TEAMS . ".TeamID");
             $team_banned = mysql_result($result_2, $j, TBL_TEAMS . ".Banned");
             // Verify there is no other player for that user/event/team
             $q = "SELECT COUNT(*) as NbrPlayers" . " FROM " . TBL_PLAYERS . " WHERE (Event = '{$event_id}')" . " AND (Team = '{$team_id}')" . " AND (User = " . USERID . ")";
             $result = $sql->db_Query($q);
             $row = mysql_fetch_array($result);
             $nbrplayers = $row['NbrPlayers'];
             if ($nbrplayers == 0) {
                 $q = " INSERT INTO " . TBL_PLAYERS . "(Event,Gamer,Team,ELORanking,TS_mu,TS_sigma,G2_r,G2_RD,G2_sigma,Joined,Banned)\r\n\t\t\t\t\tVALUES ({$event_id}, {$gamerID}, {$team_id}, " . $event->getField('ELO_default') . ", " . $event->getField('TS_default_mu') . ", " . $event->getField('TS_default_sigma') . "," . $event->fields['G2_default_r'] . "," . $event->fields['G2_default_RD'] . "," . $event->fields['G2_default_sigma'] . ",{$time}, {$team_banned})";
                 $sql->db_Query($q);
                 $event->setFieldDB('IsChanged', 1);
             }
         }
     }
     if ($notify) {
         list($cname, $ctag, $cid) = $this->getClanInfo();
         $sendto = $user;
         $subject = SITENAME . " " . $cname;
         $message = EB_CLANM_L39 . $username . EB_CLANM_L40 . $cname . EB_CLANM_L41 . EB_CLANM_L43;
         sendNotification($sendto, $subject, $message, $fromid = 0);
         // Send email
         $message = EB_CLANM_L39 . $username . EB_CLANM_L39 . $cname . EB_CLANM_L42 . SITEURLBASE . e_PLUGIN_ABS . "ebattles/claninfo.php?clanid=" . $cid . EB_CLANM_L43;
         require_once e_HANDLER . "mail.php";
         sendemail($useremail, $subject, $message);
     }
 }
开发者ID:testt98,项目名称:ebattles,代码行数:47,代码来源:clan.php

示例10: ebImageTextButton

                $prank_txt = EB_EVENT_L54;
            } else {
                $prank_txt = "#{$prank}";
            }
            $text .= '<option value="' . $pid . '">' . $pclantag . $pname . ' (' . $prank_txt . ')</option>';
        }
    }
    $text .= '
	</select>
	</td>
	</tr>
	<tr>
	<td>
	';
    $reported_by = USERID;
    $text .= '<div>';
    $text .= '<input type="hidden" name="EventID" value="' . $event_id . '"/>';
    $text .= '<input type="hidden" name="reported_by" value="' . $reported_by . '"/>';
    $text .= '
	</div>
	' . ebImageTextButton('qrsubmitloss', 'flag_red.png', EB_MATCHQL_L6) . '
	</td>
	</tr>
	</table>
	</form>
	</div>
	';
}
$ns->tablerender($event->getField('Name') . " ({$egame} - " . $event->eventTypeToString() . ") - " . EB_MATCHQL_L1, $text);
require_once FOOTERF;
exit;
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:quickreport.php

示例11: intval

require_once e_PLUGIN . "ebattles/include/clan.php";
/*******************************************************************
********************************************************************/
// Specify if we use WYSIWYG for text areas
global $e_wysiwyg;
$e_wysiwyg = "match_comment";
// set $e_wysiwyg before including HEADERF
$event_id = intval($_GET['eventid']);
$match_id = intval($_GET['matchid']);
$action = eb_sanitize($_GET['actionid']);
if (!$event_id) {
    header("Location: ./events.php");
    exit;
}
$event = new Event($event_id);
$type = $event->getField('Type');
$competition_type = $event->getCompetitionType();
$matchtype = $event->getField('MatchType');
//------------ event permissions --------------
$event_permissions = $event->get_permissions(USERID);
$userclass = $event_permissions['userclass'];
$can_report = $event_permissions['can_report'];
$can_schedule = $event_permissions['can_schedule'];
switch ($event->getMatchPlayersType()) {
    case 'Players':
        $q = "SELECT " . TBL_PLAYERS . ".*, " . TBL_USERS . ".*, " . TBL_GAMERS . ".*" . " FROM " . TBL_PLAYERS . ", " . TBL_GAMERS . ", " . TBL_USERS . " WHERE (" . TBL_PLAYERS . ".Event = '{$event_id}')" . " AND (" . TBL_PLAYERS . ".Banned != 1)" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_USERS . ".user_id = " . TBL_GAMERS . ".User)" . " ORDER BY " . TBL_GAMERS . ".UniqueGameID";
        $result = $sql->db_Query($q);
        $num_rows = mysql_numrows($result);
        if (!$result) {
            die('Invalid query: ' . mysql_error());
        }
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:matchreport.php

示例12: SubmitTeamChallenge

function SubmitTeamChallenge($event_id, $challengerpuid, $challengedtid)
{
    global $sql;
    global $text;
    global $tp;
    global $time;
    global $pref;
    $event = new Event($event_id);
    // Challenger Info
    // Attention here, we use user_id, so there has to be 1 user for 1 player
    $q = "SELECT " . TBL_PLAYERS . ".*, " . TBL_USERS . ".*" . " FROM " . TBL_PLAYERS . ", " . TBL_GAMERS . ", " . TBL_USERS . " WHERE (" . TBL_PLAYERS . ".Event = '{$event_id}')" . "   AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . "   AND (" . TBL_USERS . ".user_id = " . TBL_GAMERS . ".User)" . "   AND (" . TBL_USERS . ".user_id = '{$challengerpuid}')";
    $result = $sql->db_Query($q);
    $challengerpid = mysql_result($result, 0, TBL_PLAYERS . ".PlayerID");
    $challengertid = mysql_result($result, 0, TBL_PLAYERS . ".Team");
    list($challengertclan, $challengertclantag, $challengertclanid) = getClanInfo($challengertid);
    // Challenged Info
    // Nothing needed here
    // ...
    $challenge_times = '';
    for ($date = 1; $date <= $event->getField('MaxDatesPerChallenge'); $date++) {
        $challenge_date = $_POST['date' . $date];
        $challenge_time_local = strtotime($challenge_date);
        $challenge_time_local = $challenge_time_local - TIMEOFFSET;
        // Convert to GMT time
        if ($date > 1) {
            $challenge_times .= ',';
        }
        $challenge_times .= $challenge_time_local;
    }
    // comments
    //----------------------------------
    $comments = $tp->toDB($_POST['challenge_comments']);
    $time_reported = $time;
    // Create Challenge ------------------------------------------
    $q = "INSERT INTO " . TBL_CHALLENGES . "(Event,ChallengerTeam,ChallengedTeam,ReportedBy,TimeReported,Comments,Status,MatchDates)\r\n\tVALUES (\r\n\t'{$event_id}',\r\n\t'{$challengertid}',\r\n\t'{$challengedtid}',\r\n\t'{$challengerpuid}',\r\n\t'{$time_reported}',\r\n\t'{$comments}',\r\n\t'requested',\r\n\t'{$challenge_times}'\r\n\t)";
    $result = $sql->db_Query($q);
    // Send PM
    $fromid = 0;
    $subject = SITENAME . " " . EB_CHALLENGE_L23;
    // All members of the challenged division will receive the PM
    $q = "SELECT " . TBL_TEAMS . ".*, " . TBL_MEMBERS . ".*, " . TBL_USERS . ".*" . " FROM " . TBL_TEAMS . ", " . TBL_USERS . ", " . TBL_MEMBERS . " WHERE (" . TBL_TEAMS . ".TeamID = '{$challengedtid}')" . " AND (" . TBL_MEMBERS . ".Division = " . TBL_TEAMS . ".Division)" . " AND (" . TBL_USERS . ".user_id = " . TBL_MEMBERS . ".User)";
    $result = $sql->db_Query($q);
    $num_rows = mysql_numrows($result);
    if ($num_rows > 0) {
        for ($j = 0; $j < $num_rows; $j++) {
            $challengedpname = mysql_result($result, $j, TBL_USERS . ".user_name");
            $challengedpemail = mysql_result($result, $j, TBL_USERS . ".user_email");
            $message = EB_CHALLENGE_L24 . $challengedpname . EB_CHALLENGE_L25 . $challengertclan . EB_CHALLENGE_L26 . $event->getField('Name') . EB_CHALLENGE_L27;
            if (check_class($pref['eb_pm_notifications_class'])) {
                $sendto = mysql_result($result, $j, TBL_USERS . ".user_id");
                sendNotification($sendto, $subject, $message, $fromid);
            }
            if (check_class($pref['eb_email_notifications_class'])) {
                // Send email
                require_once e_HANDLER . "mail.php";
                sendemail($challengedpemail, $subject, $message);
            }
        }
    }
}
开发者ID:testt98,项目名称:ebattles,代码行数:60,代码来源:challengerequest.php

示例13: displayRating

 $prating = 0;
 $prating_votes = 0;
 for ($scoreIndex = 0; $scoreIndex < $numScores; $scoreIndex++) {
     $sid = mysql_result($result_Scores, $scoreIndex, TBL_SCORES . ".ScoreID");
     // Get user rating.
     $rate = $rater->GetRating("ebscores", $sid);
     $prating += $rate[0] * ($rate[1] + $rate[2] / 10);
     $prating_votes += $rate[0];
 }
 if ($prating_votes != 0) {
     $prating /= $prating_votes;
 }
 $rating = displayRating($prating, $prating_votes);
 $text .= '<tr>';
 $text .= '<td class="eb_td">';
 $text .= '<a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event_id . '">' . $event->getField('Name') . '</a>';
 $text .= '</td>';
 //$text .= '<td class="eb_td">';
 //$text .= '<img '.getGameIconResize($gIcon).'/> '.$gName;
 //$text .= '</td>';
 $text .= '<td class="eb_td">';
 $text .= $pRank;
 $text .= '</td>';
 $text .= '<td class="eb_td">';
 $text .= $pWinLoss;
 $text .= '</td>';
 $text .= '<td class="eb_td">';
 $text .= $rating;
 $text .= '</td>';
 $text .= '<td class="eb_td">';
 $text .= $event->eventStatusToString();
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:userinfo.php

示例14: COUNT

/* Nbr players */
$q = "SELECT COUNT(*) as NbrPlayers" . " FROM " . TBL_PLAYERS . " WHERE (" . TBL_PLAYERS . ".Event = '" . $event_id . "')";
$result = $sql->db_Query($q);
$row = mysql_fetch_array($result);
$nbrplayers = $row['NbrPlayers'];
/* Nbr Teams */
$q = "SELECT COUNT(*) as NbrTeams" . " FROM " . TBL_TEAMS . " WHERE (Event = '" . $event_id . "')";
$result = $sql->db_Query($q);
$row = mysql_fetch_array($result);
$nbrteams = $row['NbrTeams'];
$update_matchupsfile = 0;
$can_manage = 0;
if (check_class($pref['eb_mod_class'])) {
    $can_manage = 1;
}
if (USERID == $event->getField('Owner')) {
    $can_manage = 1;
}
if ($action == 'create' && check_class($pref['eb_events_create_class'])) {
    $can_manage = 1;
}
if ($can_manage == 0) {
    header("Location: ./eventinfo.php?eventid={$event_id}");
    exit;
}
$event->setFieldDB('IsChanged', 1);
if (isset($_POST['eventpublish'])) {
    /* Event Status */
    $event->setFieldDB('Status', 'signup');
    //echo "-- eventpublish --<br />";
    header("Location: eventmanage.php?eventid={$event_id}");
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:eventprocess.php

示例15: Event

$event = new Event($event_id);
//------------ permissions --------------
$permissions = $event->get_permissions(USERID);
$userclass = $permissions['userclass'];
$can_approve = $permissions['can_approve'];
$can_report = $permissions['can_report'];
$can_schedule = $permissions['can_schedule'];
$can_report_quickloss = $permissions['can_report_quickloss'];
$can_submit_replay = $permissions['can_submit_replay'];
$can_challenge = $permissions['can_challenge'];
$egame = mysql_result($result, 0, TBL_GAMES . ".Name");
$egameid = mysql_result($result, 0, TBL_GAMES . ".GameID");
$egameicon = mysql_result($result, 0, TBL_GAMES . ".Icon");
$eowner = mysql_result($result, 0, TBL_USERS . ".user_id");
$eownername = mysql_result($result, 0, TBL_USERS . ".user_name");
$eventIsChanged = $event->getField('IsChanged');
$eventStatus = $event->getField('Status');
$rounds = unserialize($event->getFieldHTML('Rounds'));
$eMaxNumberPlayers = $event->getField('MaxNumberPlayers');
$type = $event->getField('Type');
$competition_type = $event->getCompetitionType();
/* Nbr players */
$q = "SELECT COUNT(*) as NbrPlayers" . " FROM " . TBL_PLAYERS . " WHERE (" . TBL_PLAYERS . ".Event = '{$event_id}')";
$result = $sql->db_Query($q);
$row = mysql_fetch_array($result);
$nbr_players = $row['NbrPlayers'];
$q = "SELECT " . TBL_PLAYERS . ".*" . " FROM " . TBL_PLAYERS . " WHERE (" . TBL_PLAYERS . ".Event = '{$event_id}')" . " AND (" . TBL_PLAYERS . ".CheckedIn = '1')" . " AND (" . TBL_PLAYERS . ".Seed <= '{$eMaxNumberPlayers}')";
$result = $sql->db_Query($q);
$nbr_players_checked_in = mysql_numrows($result);
/* Nbr Teams */
$q = "SELECT COUNT(*) as NbrTeams" . " FROM " . TBL_TEAMS . " WHERE (Event = '{$event_id}')";
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:eventinfo.php


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