本文整理汇总了PHP中Match::displayMatchInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Match::displayMatchInfo方法的具体用法?PHP Match::displayMatchInfo怎么用?PHP Match::displayMatchInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Match
的用法示例。
在下文中一共展示了Match::displayMatchInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayRecentActivity
/**
* displayRecentActivity - Displays Recent Activity
*/
function displayRecentActivity($event_id)
{
global $sql;
global $time;
global $pref;
$events = array();
$nbr_events = 0;
if ($event_id != '') {
$eventid_match = " AND (" . TBL_MATCHS . ".Event = '{$event_id}')";
$eventid_award = " AND (" . TBL_EVENTS . ".EventID = '{$event_id}')";
}
// Add recent games
$rowsPerPage = $pref['eb_activity_number_of_items'];
/* Stats/Results */
$q = "SELECT DISTINCT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . " WHERE (" . TBL_MATCHS . ".Status = 'active')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . $eventid_match . " ORDER BY " . TBL_MATCHS . ".TimeReported DESC" . " LIMIT 0, {$rowsPerPage}";
$result = $sql->db_Query($q);
$num_rows = mysql_numrows($result);
if ($num_rows > 0) {
/* Display table contents */
for ($i = 0; $i < $num_rows; $i++) {
$match_id = mysql_result($result, $i, TBL_MATCHS . ".MatchID");
$match = new Match($match_id);
$events[$nbr_events][0] = $match->getField('TimeReported');
$events[$nbr_events][1] = $match->displayMatchInfo(eb_MATCH_NO_EDIT_ICONS);
$nbr_events++;
}
}
// Add Awards events
$q = "SELECT " . TBL_AWARDS . ".*, " . TBL_PLAYERS . ".*, " . TBL_USERS . ".*, " . TBL_EVENTS . ".*, " . TBL_GAMES . ".*" . " FROM " . TBL_AWARDS . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . ", " . TBL_USERS . ", " . TBL_EVENTS . ", " . TBL_GAMES . " WHERE (" . TBL_AWARDS . ".Player = " . TBL_PLAYERS . ".PlayerID)" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_GAMERS . ".User = " . TBL_USERS . ".user_id)" . " AND (" . TBL_PLAYERS . ".Event = " . TBL_EVENTS . ".EventID)" . " AND (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)" . $eventid_award . " ORDER BY " . TBL_AWARDS . ".timestamp DESC" . " LIMIT 0, {$rowsPerPage}";
$result = $sql->db_Query($q);
$numAwards = mysql_numrows($result);
if ($numAwards > 0) {
/* Display table contents */
for ($i = 0; $i < $numAwards; $i++) {
$aID = mysql_result($result, $i, TBL_AWARDS . ".AwardID");
$aUser = mysql_result($result, $i, TBL_USERS . ".user_id");
$gamer_id = mysql_result($result, $i, TBL_PLAYERS . ".Gamer");
$gamer = new Gamer($gamer_id);
$aUserNickName = $gamer->getField('Name');
$aEventgame = mysql_result($result, $i, TBL_GAMES . ".Name");
$aEventgameicon = mysql_result($result, $i, TBL_GAMES . ".Icon");
$aType = mysql_result($result, $i, TBL_AWARDS . ".Type");
$aTime = mysql_result($result, $i, TBL_AWARDS . ".timestamp");
$aTime_local = $aTime + TIMEOFFSET;
$date = date("d M Y, h:i A", $aTime_local);
$aEventID = mysql_result($result, $i, TBL_EVENTS . ".EventID");
$aEventName = mysql_result($result, $i, TBL_EVENTS . ".Name");
switch ($aType) {
case 'PlayerTookFirstPlace':
$award = EB_AWARD_L2;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/award_star_gold_3.png") . ' alt="' . EB_AWARD_L3 . '" title="' . EB_AWARD_L3 . '"/> ';
break;
case 'PlayerInTopTen':
$award = EB_AWARD_L4;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/award_star_bronze_3.png") . ' alt="' . EB_AWARD_L5 . '" title="' . EB_AWARD_L5 . '"/> ';
break;
case 'PlayerStreak5':
$award = EB_AWARD_L6;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/medal_bronze_3.png") . ' alt="' . EB_AWARD_L7 . '" title="' . EB_AWARD_L7 . '"/> ';
break;
case 'PlayerStreak10':
$award = EB_AWARD_L8;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/medal_silver_3.png") . ' alt="' . EB_AWARD_L9 . '" title="' . EB_AWARD_L9 . '"/> ';
break;
case 'PlayerStreak25':
$award = EB_AWARD_L10;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/medal_gold_3.png") . ' alt="' . EB_AWARD_L11 . '" title="' . EB_AWARD_L11 . '"/> ';
break;
case 'PlayerWonTournament':
$award = EB_AWARD_L12;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/trophy_gold.png") . ' alt="' . EB_AWARD_L13 . '" title="' . EB_AWARD_L13 . '"/> ';
break;
case 'PlayerRankFirst':
$award = EB_AWARD_L14;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/medal_gold_1.png") . ' alt="' . EB_AWARD_L15 . '" title="' . EB_AWARD_L15 . '"/> ';
break;
case 'PlayerRankSecond':
$award = EB_AWARD_L16;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/medal_silver_1.png") . ' alt="' . EB_AWARD_L17 . '" title="' . EB_AWARD_L17 . '"/> ';
break;
case 'PlayerRankThird':
$award = EB_AWARD_L18;
$icon = '<img ' . getActivityIconResize(e_PLUGIN . "ebattles/images/awards/medal_bronze_1.png") . ' alt="' . EB_AWARD_L19 . '" title="' . EB_AWARD_L19 . '"/> ';
break;
}
$award_string = '<tr><td style="vertical-align:top">' . $icon . '</td>';
$award_string .= '<td><a href="' . e_PLUGIN . 'ebattles/userinfo.php?user=' . $aUser . '">' . $aUserNickName . '</a>';
$award_string .= ' ' . $award;
$award_string .= ' ' . EB_MATCH_L12 . ' <img ' . getActivityGameIconResize($aEventgameicon) . ' title="' . $aEventgame . '"/> <a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $aEventID . '">' . $aEventName . '</a>';
$award_string .= ' <div class="smalltext">';
if ($time - $aTime < INT_MINUTE) {
$award_string .= EB_MATCH_L7;
} else {
if ($time - $aTime < INT_DAY) {
$award_string .= get_formatted_timediff($aTime, $time) . ' ' . EB_MATCH_L8;
} else {
$award_string .= $date;
//.........这里部分代码省略.........
示例2: count
}
if ($found_match == 1) {
$text .= '<b>' . $rounds[$round]['Title'] . '</b>';
$text .= ' (' . EB_EVENTM_L146 . ' ' . $rounds[$round]['BestOf'] . ')';
$text .= '<table class="table_left">';
for ($matchup = 1; $matchup <= $nbrMatchups; $matchup++) {
$nbrMatchs = count($results[$round][$matchup]['matchs']);
$text_add = '';
$nbrMatchsScheduled = 0;
for ($match = 0; $match < $nbrMatchs; $match++) {
$current_match = $results[$round][$matchup]['matchs'][$match];
$match_id = $current_match['match_id'];
$matchObj = new Match($match_id);
if ($matchObj->getField('Status') == 'scheduled') {
$nbrMatchsScheduled++;
$text_add .= $matchObj->displayMatchInfo(eb_MATCH_NOEVENTINFO | eb_MATCH_SCHEDULED, EB_MATCH_L1 . ' ' . ($match + 1) . ' ');
}
}
if ($nbrMatchsScheduled > 0) {
$text .= '<tr><td><b>' . EB_EVENT_L102 . ' ' . $matchup . '</b></td></tr>';
}
$text .= $text_add;
}
$text .= '</table>';
}
}
}
}
$text .= '</div>';
// tabs-4 "Matches"
$text .= '<div id="tabs-5">';
示例3: WHERE
$text .= '<span class="paginate" style="float:left;">' . $pages->display_pages() . '</span>';
$text .= '<span style="float:right">';
// Go To Page
$text .= $pages->display_jump_menu();
$text .= ' ';
// Items per page
$text .= $pages->display_items_per_page();
$text .= '</span><br /><br />';
/* Stats/Results */
$q = "SELECT DISTINCT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . " WHERE (" . TBL_MATCHS . ".Event = '{$event_id}')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND (" . TBL_MATCHS . ".Status = 'active')" . " ORDER BY " . TBL_MATCHS . ".TimeReported DESC" . " {$pages->limit}";
$result = $sql->db_Query($q);
$num_rows = mysql_numrows($result);
if ($num_rows > 0) {
/* Display table contents */
$text .= '<table class="table_left">';
for ($i = 0; $i < $num_rows; $i++) {
$match_id = mysql_result($result, $i, TBL_MATCHS . ".MatchID");
$match = new Match($match_id);
$text .= $match->displayMatchInfo(eb_MATCH_NOEVENTINFO);
}
$text .= '</table>';
}
$text .= '<br />';
$text .= '<div>';
$text .= ebImageLink('back_to_event', '', e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event_id, '', 'action_back.gif', EB_MATCHS_L3 . ' ' . EB_MATCHS_L4, 'jq-button');
$text .= '</div>';
$text .= '</div>';
$text .= '</div>';
$ns->tablerender("{$event->getField}('Name') ({$gName} - " . $event->eventTypeToString() . ")", $text);
require_once FOOTERF;
exit;
示例4: WHERE
/* Display Scheduled Matches */
$text .= '<br />';
$q = "SELECT DISTINCT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . " WHERE (" . TBL_MATCHS . ".Status = 'scheduled')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND ((" . TBL_PLAYERS . ".PlayerID = " . TBL_SCORES . ".Player)" . " OR ((" . TBL_PLAYERS . ".Team = " . TBL_SCORES . ".Team)" . " AND (" . TBL_PLAYERS . ".Team != 0)))" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_GAMERS . ".User = '{$req_user}')" . " AND (" . TBL_GAMERS . ".Game = '{$game_id}')" . " ORDER BY " . TBL_MATCHS . ".TimeReported DESC";
$result = $sql->db_Query($q);
$numMatches = mysql_numrows($result);
if ($numMatches > 0) {
$text .= '<p><b>';
$text .= '<span class="badge">' . $numMatches . '</span> ' . EB_EVENT_L70;
$text .= '</b></p>';
$text .= '<br />';
/* Display table contents */
$text .= '<table class="table_left">';
for ($i = 0; $i < $numMatches; $i++) {
$match_id = mysql_result($result, $i, TBL_MATCHS . ".MatchID");
$match = new Match($match_id);
$text .= $match->displayMatchInfo(eb_MATCH_SCHEDULED);
}
$text .= '</table>';
}
/* Display Requested Challenges */
$text .= '<br />';
$q = "SELECT DISTINCT " . TBL_CHALLENGES . ".*" . " FROM " . TBL_CHALLENGES . " WHERE (" . TBL_CHALLENGES . ".Status = 'requested')" . " AND (" . TBL_CHALLENGES . ".ReportedBy = '{$req_user}')" . " ORDER BY " . TBL_CHALLENGES . ".TimeReported DESC";
$result = $sql->db_Query($q);
$numChallenges = mysql_numrows($result);
if ($numChallenges > 0) {
$text .= '<p><b>';
$text .= '<span class="badge">' . $numChallenges . '</span> ' . EB_EVENT_L66;
$text .= '</b></p>';
$text .= '<br />';
/* Display table contents */
$text .= '<table class="table_left">';