예제 #1
0
/**
* 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 = "******".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='******'">' . $aUserNickName . '</a>';
            $award_string .= ' ' . $award;
            $award_string .= ' ' . EB_MATCH_L12 . ' <img ' . getActivityGameIconResize($aEventgameicon) . ' title="' . $aEventgame . '"/>&nbsp;<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) . '&nbsp;' . EB_MATCH_L8;
                } else {
                    $award_string .= $date;
                }
            }
            $award_string .= '</div></td></tr>';
            $events[$nbr_events][0] = $aTime;
            $events[$nbr_events][1] = $award_string;
            $nbr_events++;
        }
    }
    $q = "SELECT " . TBL_AWARDS . ".*, " . TBL_TEAMS . ".*, " . TBL_EVENTS . ".*, " . TBL_GAMES . ".*" . " FROM " . TBL_AWARDS . ", " . TBL_TEAMS . ", " . TBL_EVENTS . ", " . TBL_GAMES . " WHERE (" . TBL_AWARDS . ".Team = " . TBL_TEAMS . ".TeamID)" . " AND (" . TBL_TEAMS . ".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");
            $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");
            $aClanTeam = mysql_result($result, $i, TBL_TEAMS . ".TeamID");
            list($tclan, $tclantag, $tclanid) = getClanInfo($aClanTeam);
            switch ($aType) {
                case 'TeamTookFirstPlace':
                    $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 'TeamInTopTen':
                    $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 'TeamStreak5':
                    $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 'TeamStreak10':
                    $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 'TeamStreak25':
                    $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 'TeamWonTournament':
                    $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 'TeamRankFirst':
                    $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 'TeamRankSecond':
                    $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 'TeamRankThird':
                    $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/claninfo.php?clanid=' . $tclanid . '">' . $tclan . '</a>';
            $award_string .= ' ' . $award;
            $award_string .= ' ' . EB_MATCH_L12 . ' <img ' . getActivityGameIconResize($aEventgameicon) . ' title="' . $aEventgame . '"/>&nbsp;<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) . '&nbsp;' . EB_MATCH_L8;
                } else {
                    $award_string .= $date;
                }
            }
            $award_string .= '</div></td></tr>';
            $events[$nbr_events][0] = $aTime;
            $events[$nbr_events][1] = $award_string;
            $nbr_events++;
        }
    }
    $text .= '<table style="margin-left: 0px; margin-right: auto;">';
    multi2dSortAsc($events, 0, SORT_DESC);
    for ($index = 0; $index < min($nbr_events, $rowsPerPage); $index++) {
        $text .= $events[$index][1];
    }
    if ($index == 0) {
        $text .= '<tr><td>' . EB_ACTIVITY_L1 . '</td></tr>';
    }
    $text .= '</table>';
    return $text;
}
예제 #2
0
            }
            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 . '&nbsp;' . ($match + 1) . '&nbsp;');
                        }
                    }
                    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
0
$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 .= '&nbsp;&nbsp;&nbsp;';
// 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
0
/* 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 = '******')" . " 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>&nbsp;' . 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>&nbsp;' . EB_EVENT_L66;
    $text .= '</b></p>';
    $text .= '<br />';
    /* Display table contents */
    $text .= '<table class="table_left">';