$ttt2 = timpexec(); $difff = number_format(substr($ttt2, 0, 9) + substr($ttt2, -10) - substr($ttt1, 0, 9) - substr($ttt1, -10), 4); if ($downloadfacut == false) { $difff = "error"; } $updatelog_text = $updatelog_text . "\nShares : " . $difff . " ms"; } } if ($downloadfacut == true) { CopyUpdate($caminfo_update, $caminfo_file); CopyUpdate($servers_update, $servers_file); CopyUpdate($shares_update, $shares_file); CopyUpdate($clients_update, $clients_file); CopyUpdate($activeclients_update, $activeclients_file); CopyUpdate($entitlements_update, $entitlements_file); UpdateClientsCountryIP(); UpdateServersCountryIP(); UpdateServersECM(); $timp2 = timpexec(); $diferentaTIMP1 = number_format(substr($timp2, 0, 9) + substr($timp2, -10) - substr($timp1, 0, 9) - substr($timp1, -10), 4); $TIMP_Update = "Update time: " . $diferentaTIMP1 . "s"; $updatelog_text = $updatelog_text . "\nTOTAL : " . $diferentaTIMP1 . " ms"; $fp = @fopen($update_log, "w"); fwrite($fp, $updatelog_text); fclose($fp); } } if ($TIMP_Update == "" && $timp_lastupdate != "") { $TIMP_Update = " Updated " . get_formatted_timediff($timp_lastupdate) . " ago"; } $skipUpdate = true;
/** * 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 . '"/> <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; } } $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 . '"/> <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; } } $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; }
echo "<td class=\"tabel_hop_total\"></td>"; } } } } else { if ($client_host != "") { if ($maxhop > 1) { echo "<td class=\"tabel_hop_total\" COLSPAN=\"" . ($maxhop + 2) . "\"></td>"; } else { echo "<td class=\"tabel_hop_total\" COLSPAN=\"" . ($maxhop + 1) . "\"></td>"; } } else { $text_offline = "-- OFFLINE --"; if (isset($OnlineServers[$sh_host]) && $OnlineServers[$sh_host]["time"] != "") { $last_online = $OnlineServers[$sh_host]["time"]; $text_offline = get_formatted_timediff($last_online); } if ($maxhop > 1) { echo "<td class=\"tabel_hop_total\" COLSPAN=\"" . ($maxhop + 2) . "\"><FONT COLOR=red>" . $text_offline . "</FONT></td>"; } else { echo "<td class=\"tabel_hop_total\" COLSPAN=\"" . ($maxhop + 1) . "\"><FONT COLOR=red>" . $text_offline . "</FONT></td>"; } } } //------------- ECM $totalECMNow = ""; if (isset($nodes["Info"]["ECM_NOW"]["ECM"])) { $totalECMNow = $nodes["Info"]["ECM_NOW"]["ECM"]; } $totalECMSaved = ""; if (isset($nodes["Info"]["ECM_SAVED"]["ECM"])) {
$share_client = explode("|", $currentline); $share_Username = trim($share_client[1]); $share_Idents = trim($share_client[2]); if ($share_Username != "") { $lastUsername = $share_Username; } $clientConectat[$lastUsername]["Info"]["Idents"][] = $share_Idents; //echo "<BR>".$lastUsername."-".$share_Idents; } } } if (!isset($clientConectat[$username])) { if (isset($UsageUsers[$username])) { $lastSeenOnline = $UsageUsers[$username]["time"]; $ac_IP = $UsageUsers[$username]["ip"]; $text_offline = get_formatted_timediff($lastSeenOnline) . " ago"; $ac_Connected = "<FONT COLOR=red>" . $text_offline . "</FONT>"; $ac_Idle = "-"; $acEcm = ""; $acEcmOk = ""; $acEmm = ""; $acEmmOk = ""; $ac_Version = "-"; $ac_LastShare = ""; $ac_EcmTime = ""; $acEmmOk = ""; $clientConectat[$username]["Info"] = array($ac_IP, $ac_Connected, $ac_Idle, $acEcm, $acEcmOk, $acEmm, $acEmmOk, $ac_Version, $ac_LastShare, $ac_EcmTime, $lastSeenOnline); } } //___________________________________________________________________________________________________ if (!isset($clientConectat[$username])) {
if (isset($total_host_shares[$sh_host][$k])) { if ($k == 1) { echo "<td class=\"tabel_hop_total\">" . $total_host_shares[$sh_host][$k] . "</td>"; } else { echo "<td class=\"tabel_hop_total1\">" . $total_host_shares[$sh_host][$k] . "</td>"; } } else { echo "<td class=\"tabel_hop_total\"></td>"; } } } } else { $text_offline = "-- OFFLINE --"; if (isset($OnlineServers[$sh_host]) && $OnlineServers[$sh_host]["time"] != "") { $last_online = $OnlineServers[$sh_host]["time"]; $text_offline = "Last seen online : " . get_formatted_timediff($last_online) . " ago"; } if ($maxhop > 1) { echo "<td class=\"tabel_hop_total\" COLSPAN=\"" . ($maxhop + 5) . "\"><FONT COLOR=red>" . $text_offline . "</FONT></td>"; } else { echo "<td class=\"tabel_hop_total\" COLSPAN=\"" . ($maxhop + 4) . "\"><FONT COLOR=red>" . $text_offline . "</FONT></td>"; } } //------------- ECM $procentEcmAfisat = procentColor($procentEcm); if ($totalECMOK == 0 && $totalECM == 0) { $totalECMOK = "<FONT COLOR=red>-</FONT>"; $procentEcmAfisat = "-"; } else { if ($totalECMOK == 0 && $totalECM > 0) { $totalECMOK = "<FONT COLOR=red>" . $totalECM . "</FONT>";
function displayMatchInfo($type = 0, $header = '') { global $time; global $sql; global $pref; $match_id = $this->fields['MatchID']; $string = ''; // Get info about the match $q = "SELECT DISTINCT " . TBL_MATCHS . ".*, " . TBL_USERS . ".*, " . TBL_EVENTS . ".*, " . TBL_GAMES . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_USERS . ", " . TBL_EVENTS . ", " . TBL_GAMES . " WHERE (" . TBL_MATCHS . ".MatchID = '" . $match_id . "')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND (" . TBL_USERS . ".user_id = " . TBL_MATCHS . ".ReportedBy)" . " AND (" . TBL_MATCHS . ".Event = " . TBL_EVENTS . ".EventID)" . " AND (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)"; $result = $sql->db_Query($q); $numMatchs = mysql_numrows($result); if ($numMatchs > 0) { $mReportedBy = mysql_result($result, 0, TBL_USERS . ".user_id"); $mReportedByNickName = mysql_result($result, 0, TBL_USERS . ".user_name"); $mEventgame = mysql_result($result, 0, TBL_GAMES . ".Name"); $mEventgameicon = mysql_result($result, 0, TBL_GAMES . ".Icon"); $mStatus = mysql_result($result, 0, TBL_MATCHS . ".Status"); $mTime = mysql_result($result, 0, TBL_MATCHS . ".TimeReported"); $mTime_local = $mTime + TIMEOFFSET; $date = date("d M Y, h:i A", $mTime_local); $mTimeScheduled = mysql_result($result, 0, TBL_MATCHS . ".TimeScheduled"); $mTimeScheduled_local = $mTimeScheduled + TIMEOFFSET; $dateScheduled = date("d M Y, h:i A", $mTimeScheduled_local); $mComments = mysql_result($result, 0, TBL_MATCHS . ".Comments"); $event_id = mysql_result($result, 0, TBL_EVENTS . ".EventID"); $event = new Event($event_id); // Calculate number of players and teams for the match $q = "SELECT DISTINCT " . TBL_SCORES . ".Player_MatchTeam" . " FROM " . TBL_SCORES . " WHERE (" . TBL_SCORES . ".MatchID = '" . $match_id . "')"; $result = $sql->db_Query($q); $nbr_teams = mysql_numrows($result); // Check if the match has several ranks $q = "SELECT DISTINCT " . TBL_MATCHS . ".*, " . TBL_SCORES . ".Player_Rank" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . " WHERE (" . TBL_MATCHS . ".MatchID = '" . $match_id . "')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)"; $result = $sql->db_Query($q); $numRanks = mysql_numrows($result); if ($numRanks > 0) { //------------ permissions -------------- $permissions = $this->get_permissions(USERID); $userclass = $permissions['userclass']; $can_approve = $permissions['can_approve']; $can_report = $permissions['can_report']; $can_schedule = $permissions['can_schedule']; $can_delete = $permissions['can_delete']; $can_edit = $permissions['can_edit']; $orderby_str = " ORDER BY " . TBL_SCORES . ".Player_Rank, " . TBL_SCORES . ".Player_MatchTeam"; if ($nbr_teams == 2) { $orderby_str = " ORDER BY " . TBL_SCORES . ".Player_MatchTeam"; } switch ($event->getMatchPlayersType()) { case 'Players': $q = "SELECT " . TBL_MATCHS . ".*, " . TBL_SCORES . ".*, " . TBL_PLAYERS . ".*, " . TBL_USERS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . ", " . TBL_USERS . " WHERE (" . TBL_MATCHS . ".MatchID = '" . $match_id . "')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND (" . TBL_PLAYERS . ".PlayerID = " . TBL_SCORES . ".Player)" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_USERS . ".user_id = " . TBL_GAMERS . ".User)" . $orderby_str; break; case 'Teams': $q = "SELECT " . TBL_MATCHS . ".*, " . TBL_SCORES . ".*, " . TBL_CLANS . ".*, " . TBL_TEAMS . ".*, " . TBL_DIVISIONS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_CLANS . ", " . TBL_TEAMS . ", " . TBL_DIVISIONS . " WHERE (" . TBL_MATCHS . ".MatchID = '" . $match_id . "')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND (" . TBL_TEAMS . ".TeamID = " . TBL_SCORES . ".Team)" . " AND (" . TBL_CLANS . ".ClanID = " . TBL_DIVISIONS . ".Clan)" . " AND (" . TBL_TEAMS . ".Division = " . TBL_DIVISIONS . ".DivisionID)" . $orderby_str; break; default: } $result = $sql->db_Query($q); $numPlayers = mysql_numrows($result); $pname = ''; $string .= '<tr>'; if ($header) { $string .= '<td>' . $header . '</td>'; } $scores = ''; if (($type & eb_MATCH_NOEVENTINFO) == 0) { $string .= '<td style="vertical-align:top">'; $string .= '<img ' . getActivityGameIconResize($mEventgameicon) . ' title="' . $mEventgame . '"/>'; $string .= '</td>'; } $string .= '<td>'; $matchteam = 0; for ($index = 0; $index < $numPlayers; $index++) { switch ($event->getMatchPlayersType()) { case 'Players': $puid = mysql_result($result, $index, TBL_USERS . ".user_id"); $gamer_id = mysql_result($result, $index, TBL_PLAYERS . ".Gamer"); $gamer = new Gamer($gamer_id); $pname = $gamer->getField('Name'); $pavatar = mysql_result($result, $index, TBL_USERS . ".user_image"); $pteam = mysql_result($result, $index, TBL_PLAYERS . ".Team"); break; case 'Teams': $pname = mysql_result($result, $index, TBL_CLANS . ".Name"); $pavatar = mysql_result($result, $index, TBL_CLANS . ".Image"); $pteam = mysql_result($result, $index, TBL_TEAMS . ".TeamID"); break; default: } list($pclan, $pclantag, $pclanid) = getClanInfo($pteam); $prank = mysql_result($result, $index, TBL_SCORES . ".Player_Rank"); $pmatchteam = mysql_result($result, $index, TBL_SCORES . ".Player_MatchTeam"); $pscore = mysql_result($result, $index, TBL_SCORES . ".Player_Score"); $pfaction = mysql_result($result, $index, TBL_SCORES . ".Faction"); $pfactionIcon = ""; //if (($pfaction!=0)&&($type!=0)) if ($pfaction != 0) { $q_Factions = "SELECT " . TBL_FACTIONS . ".*" . " FROM " . TBL_FACTIONS . " WHERE (" . TBL_FACTIONS . ".FactionID = '{$pfaction}')"; $result_Factions = $sql->db_Query($q_Factions); $numFactions = mysql_numrows($result_Factions); if ($numFactions > 0) { $fIcon = mysql_result($result_Factions, 0, TBL_FACTIONS . ".Icon"); $fName = mysql_result($result_Factions, 0, TBL_FACTIONS . ".Name"); $pfactionIcon = ' <img ' . getFactionIconResize($fIcon) . ' title="' . $fName . '"/>'; } } /* takes too long $image = ''; if ($pref['eb_avatar_enable_playersstandings'] == 1) { switch($event->getMatchPlayersType()) { case 'Players': if($pavatar) { $image = '<img '.getAvatarResize(avatar($pavatar)).'/>'; } else if ($pref['eb_avatar_default_image'] != ''){ $image = '<img '.getAvatarResize(getImagePath($pref['eb_avatar_default_image'], 'avatars')).'/>'; } break; case 'Teams': if($pavatar) { $image = '<img '.getAvatarResize(getImagePath($pavatar, 'team_avatars')).'/>'; } else if ($pref['eb_avatar_default_image'] != ''){ $image = '<img '.getAvatarResize(getImagePath($pref['eb_avatar_default_team_image'], 'team_avatars')).'/>'; } break; default: } } */ if ($index > 0) { $scores .= "-" . $pscore; if ($pmatchteam == $matchteam) { $string .= ' & '; } else { if (($type & eb_MATCH_SCHEDULED) != 0) { $str = ' vs. '; } else { if ($prank == $rank) { $str = ' ' . EB_MATCH_L2 . ' '; } else { if ($prank > $rank) { $str = ' ' . EB_MATCH_L3 . ' '; } else { $str = ' ' . EB_MATCH_L14 . ' '; } } } $string .= $str; $matchteam = $pmatchteam; $rank = $prank; } } else { $rank = $prank; $matchteam = $pmatchteam; $scores .= $pscore; } /* echo "rank: $rank, prank: $prank<br>"; echo "mt: $matchteam, pmt $pmatchteam<br>"; */ $string .= $pfactionIcon . ' '; switch ($event->getMatchPlayersType()) { case 'Players': $string .= '<a href="' . e_PLUGIN . 'ebattles/userinfo.php?user='******'">' . $pclantag . $pname . '</a>'; break; case 'Teams': $string .= '<a href="' . e_PLUGIN . 'ebattles/claninfo.php?clanid=' . $pclanid . '">' . $pclan . '</a>'; break; default: } } //score here if ($event->getField('AllowScore') == TRUE && ($type & eb_MATCH_SCHEDULED) == 0) { $string .= ' (' . $scores . ') '; } if (($type & eb_MATCH_NOEVENTINFO) == 0) { $string .= ' ' . EB_MATCH_L12 . ' <a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event_id . '">' . $event->getField('Name') . '</a>'; } if ($can_approve == 1) { $string .= ' <a href="' . e_PLUGIN . 'ebattles/matchinfo.php?matchid=' . $match_id . '"><img class="eb_image" src="' . e_PLUGIN . 'ebattles/images/exclamation.png" alt="' . EB_MATCH_L13 . '" title="' . EB_MATCH_L13 . '"/></a>'; } else { if (($type & eb_MATCH_SCHEDULED) == 0 || $can_schedule == 1) { $string .= ' <a href="' . e_PLUGIN . 'ebattles/matchinfo.php?matchid=' . $match_id . '"><img class="eb_image" src="' . e_PLUGIN . 'ebattles/images/magnify.png" alt="' . EB_MATCH_L5 . '" title="' . EB_MATCH_L5 . '"/></a>'; } } if (($type & eb_MATCH_SCHEDULED) == 0) { $string .= ' <div class="smalltext">'; $string .= EB_MATCH_L6 . ' <a href="' . e_PLUGIN . 'ebattles/userinfo.php?user='******'">' . $mReportedByNickName . '</a> '; if ($time - $mTime < INT_MINUTE) { $string .= EB_MATCH_L7; } else { if ($time - $mTime < INT_DAY) { $string .= get_formatted_timediff($mTime, $time) . ' ' . EB_MATCH_L8; } else { $string .= EB_MATCH_L9 . ' ' . $date . '.'; } } $nbr_comments = ebGetCommentTotal("ebmatches", $match_id); $nbr_comments += $mComments == '' ? 0 : 1; $string .= ' <a href="' . e_PLUGIN . 'ebattles/matchinfo.php?matchid=' . $match_id . '" title="' . EB_MATCH_L4 . ' ' . $match_id . '">' . $nbr_comments . ' '; $string .= $nbr_comments > 1 ? EB_MATCH_L10 : EB_MATCH_L11; $string .= '</a>'; $string .= '</div></td>'; } else { $string .= ' <div class="smalltext">'; $string .= EB_MATCH_L16 . ' '; $string .= EB_MATCH_L17 . ' ' . $dateScheduled . '.'; $string .= '</div></td>'; } if (($type & eb_MATCH_NO_EDIT_ICONS) == 0) { if ($can_delete == 1) { $delete_text = $competition_type == 'Tournament' ? EB_MATCHD_L29 : EB_MATCHD_L5; $string .= '<td>'; $string .= '<form action="' . e_PLUGIN . 'ebattles/matchdelete.php?eventid=' . $event_id . '" method="post">'; $string .= '<div>'; $string .= '<input type="hidden" name="eventid" value="' . $event_id . '"/>'; $string .= '<input type="hidden" name="matchid" value="' . $match_id . '"/>'; $string .= '</div>'; $string .= ebImageTextButton('deletematch', 'cross.png', '', 'simple', $delete_text, EB_MATCHD_L4); $string .= '</form>'; $string .= '</td>'; } if ($can_approve == 1) { $string .= '<td>'; $string .= '<form id="approvematch_form" action="' . e_PLUGIN . 'ebattles/matchprocess.php" method="post">'; $string .= '<div>'; $string .= '<input type="hidden" name="eventid" value="' . $event_id . '"/>'; $string .= '<input type="hidden" name="matchid" value="' . $match_id . '"/>'; $string .= '</div>'; $string .= ebImageTextButton('approvematch', 'accept.png', '', 'simple', '', EB_MATCHD_L17); $string .= '</form>'; $string .= '</td>'; } if ($can_edit == 1) { if ($this->getField('Status') == 'scheduled') { $string .= '<td>'; $string .= ebImageLink('matchschedulededit', EB_MATCHR_L46, '', e_PLUGIN . 'ebattles/matchreport.php?eventid=' . $event_id . '&matchid=' . $match_id . '&actionid=matchschedulededit&userclass=' . $userclass, 'page_white_edit.png', '', 'matchreport_link', '', EB_MATCHD_L27); $string .= '</td>'; } else { $string .= '<td>'; $string .= ebImageLink('matchedit', EB_MATCHR_L46, '', e_PLUGIN . 'ebattles/matchreport.php?eventid=' . $event_id . '&matchid=' . $match_id . '&actionid=matchedit&userclass=' . $userclass, 'page_white_edit.png', '', 'matchreport_link', '', EB_MATCHD_L27); $string .= '</td>'; } } if ($can_report == 1) { $string .= '<td>'; $string .= '<div>'; $string .= ebImageLink('matchscheduledreport', EB_MATCHR_L32, '', e_PLUGIN . 'ebattles/matchreport.php?eventid=' . $event_id . '&matchid=' . $match_id . '&actionid=matchscheduledreport&userclass=' . $userclass, 'report.png', '', 'matchreport_link', '', EB_MATCHD_L30); $string .= '</div>'; $string .= '</td>'; } } $string .= '</tr>'; } } return $string; }
function eventStatusToTimeComment() { global $time; $time_comment = ''; switch ($this->getField('Status')) { case 'draft': break; case 'signup': if ($this->getField('CheckinDuration') == 0) { $time_comment = EB_EVENT_L2 . ' ' . get_formatted_timediff($time, $this->getField('StartDateTime')); } else { $time_comment = EB_EVENT_L87 . ' ' . get_formatted_timediff($time, $this->getField('StartDateTime') - INT_MINUTE * $this->getField('CheckinDuration')); } break; case 'checkin': $time_comment = EB_EVENT_L2 . ' ' . get_formatted_timediff($time, $this->getField('StartDateTime')); break; case 'active': if ($this->getField('EndDateTime') != 0) { $time_comment = EB_EVENT_L3 . ' ' . get_formatted_timediff($time, $this->getField('EndDateTime')); } break; case 'finished': $time_comment = EB_EVENT_L4; break; } return $time_comment; }
function displayChallengeInfo($type = 0) { global $time; global $sql; global $pref; $string = ''; // 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"); $cEventgame = mysql_result($result, 0, TBL_GAMES . ".Name"); $cEventgameicon = mysql_result($result, 0, TBL_GAMES . ".Icon"); $cStatus = mysql_result($result, 0, TBL_CHALLENGES . ".Status"); $cTime = mysql_result($result, 0, TBL_CHALLENGES . ".TimeReported"); $cTime_local = $cTime + TIMEOFFSET; $date = date("d M Y, h:i A", $cTime_local); $event_id = mysql_result($result, 0, TBL_EVENTS . ".EventID"); $event = new Event($event_id); $cChallengerpID = mysql_result($result, 0, TBL_CHALLENGES . ".ChallengerPlayer"); $cChallengedpID = mysql_result($result, 0, TBL_CHALLENGES . ".ChallengedPlayer"); $cChallengertID = mysql_result($result, 0, TBL_CHALLENGES . ".ChallengerTeam"); $cChallengedtID = mysql_result($result, 0, TBL_CHALLENGES . ".ChallengedTeam"); $string .= '<tr>'; // Game icon if (($type & eb_MATCH_NOEVENTINFO) == 0) { $string .= '<td style="vertical-align:top"><a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event->getField('EventID') . '" title="' . $cEventgame . '">'; $string .= '<img ' . getActivityGameIconResize($cEventgameicon) . '/>'; $string .= '</a></td>'; } $string .= '<td>'; // User info $q = "SELECT " . TBL_PLAYERS . ".*, " . TBL_USERS . ".*, " . TBL_TEAMS . ".*" . " FROM " . TBL_PLAYERS . ", " . TBL_GAMERS . ", " . TBL_USERS . ", " . TBL_TEAMS . " WHERE (" . TBL_PLAYERS . ".Event = '{$event_id}')" . " AND (" . TBL_TEAMS . ".TeamID = " . TBL_PLAYERS . ".Team)" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_GAMERS . ".User = '******')"; $result = $sql->db_Query($q); $uteam = mysql_result($result, 0, TBL_PLAYERS . ".Team"); switch ($event->getMatchPlayersType()) { case 'Players': // Challenger Info $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_PLAYERS . ".PlayerID = '{$cChallengerpID}')"; $result = $sql->db_Query($q); $challengerpid = mysql_result($result, 0, TBL_PLAYERS . ".PlayerID"); $challengerpuid = mysql_result($result, 0, TBL_USERS . ".user_id"); $challengerpname = mysql_result($result, 0, TBL_USERS . ".user_name"); $challengerpavatar = mysql_result($result, $index, TBL_USERS . ".user_image"); $challengerpteam = mysql_result($result, $index, TBL_PLAYERS . ".Team"); list($challengerpclan, $challengerpclantag, $challengerpclanid) = getClanInfo($challengerpteam); $isUserChallenger = USERID == $challengerpuid ? TRUE : FALSE; $string .= '<a href="' . e_PLUGIN . 'ebattles/userinfo.php?user='******'">' . $challengerpclantag . $challengerpname . '</a>'; $string .= ' vs. '; // Challenged Info $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_PLAYERS . ".PlayerID = '{$cChallengedpID}')"; $result = $sql->db_Query($q); $challengedpid = mysql_result($result, 0, TBL_PLAYERS . ".PlayerID"); $challengedpuid = mysql_result($result, 0, TBL_USERS . ".user_id"); $challengedpname = mysql_result($result, 0, TBL_USERS . ".user_name"); $challengedpavatar = mysql_result($result, $index, TBL_USERS . ".user_image"); $challengedpteam = mysql_result($result, $index, TBL_PLAYERS . ".Team"); list($challengedpclan, $challengedpclantag, $challengedpclanid) = getClanInfo($challengedpteam); $isUserChallenged = USERID == $challengedpuid ? TRUE : FALSE; $string .= '<a href="' . e_PLUGIN . 'ebattles/userinfo.php?user='******'">' . $challengedpclantag . $challengedpname . '</a>'; break; case 'Teams': // Challenger Info $q = "SELECT " . TBL_TEAMS . ".*" . " AND (" . TBL_TEAMS . ".TeamID = '{$cChallengertID}')"; $result = $sql->db_Query($q); $challengertrank = mysql_result($result, 0, TBL_TEAMS . ".Rank"); list($challengertclan, $challengertclantag, $challengertclanid) = getClanInfo($cChallengertID); $isUserChallenger = $uteam == $cChallengertID ? TRUE : FALSE; $string .= '<a href="' . e_PLUGIN . 'ebattles/claninfo.php?clanid=' . $challengertclanid . '">' . $challengertclan . '</a>'; $string .= ' vs. '; // Challenged Info $q = "SELECT " . TBL_TEAMS . ".*" . " AND (" . TBL_TEAMS . ".TeamID = '{$cChallengedtID}')"; $result = $sql->db_Query($q); $challengedtrank = mysql_result($result, 0, TBL_TEAMS . ".Rank"); list($challengedtclan, $challengedtclantag, $challengedtclanid) = getClanInfo($cChallengedtID); $isUserChallenged = $uteam == $cChallengedtID ? TRUE : FALSE; $string .= '<a href="' . e_PLUGIN . 'ebattles/claninfo.php?clanid=' . $challengedtclanid . '">' . $challengedtclan . '</a>'; break; default: } // Event if (($type & eb_MATCH_NOEVENTINFO) == 0) { $string .= ' ' . EB_MATCH_L12 . ' <a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event_id . '">' . $event->getField('Name') . '</a>'; } // Submitted by $string .= ' <div class="smalltext">'; $string .= EB_MATCH_L15 . ' <a href="' . e_PLUGIN . 'ebattles/userinfo.php?user='******'">' . $cReportedByNickName . '</a> '; if ($time - $cTime < INT_MINUTE) { $string .= EB_MATCH_L7; } else { if ($time - $cTime < INT_DAY) { $string .= get_formatted_timediff($cTime, $time) . ' ' . EB_MATCH_L8; } else { $string .= EB_MATCH_L9 . ' ' . $date . '.'; } } $string .= '</div></td>'; // Action form // Is the user a moderator? $can_delete = 0; $q_Mods = "SELECT " . TBL_EVENTMODS . ".*" . " FROM " . TBL_EVENTMODS . " WHERE (" . TBL_EVENTMODS . ".Event = '{$event_id}')" . " AND (" . TBL_EVENTMODS . ".User = "******")"; $result_Mods = $sql->db_Query($q_Mods); $numMods = mysql_numrows($result_Mods); if (check_class($pref['eb_mod_class'])) { $can_delete = 1; } if (USERID == $eowner) { $userclass |= eb_UC_EVENT_OWNER; $can_delete = 1; } if ($numMods > 0) { $userclass |= eb_UC_EB_MODERATOR; $can_delete = 1; } // If the user is challenger, show the "Withdraw" button /* if ($isUserChallenger == TRUE) { $can_delete = 1; } */ if ($can_delete == 1) { $string .= '<td>'; $string .= '<form action="' . e_PLUGIN . 'ebattles/challengeconfirm.php?eventid=' . $event_id . '&challengeid=' . $this->fields['ChallengeID'] . '" method="post">'; $string .= '<div>'; $string .= ebImageTextButton('challenge_withdraw', 'delete.png', '', 'simple', EB_CHALLENGE_L16, EB_CHALLENGE_L15); $string .= '</div>'; $string .= '</form>'; $string .= '</td>'; } // If the user is challenged, show the "Confirm" button if ($isUserChallenged == TRUE) { $string .= '<td>'; $string .= '<form action="' . e_PLUGIN . 'ebattles/challengeconfirm.php?eventid=' . $event_id . '&challengeid=' . $this->fields['ChallengeID'] . '" method="post">'; $string .= '<div>'; $string .= ebImageTextButton('challenge_confirm', 'page_white_edit.png', '', 'simple', '', EB_CHALLENGE_L17); $string .= '</div>'; $string .= '</form>'; $string .= '</td>'; } // If the user is admin/moderator, show the "Edit" button // fm: TBD ??? $string .= '</tr>'; } return $string; }
include "getconfigserver.php"; exit; } echo "<table id=\"" . $idtable . "\" style='display:none;' border=0 cellpadding=0 cellspacing=0>"; echo "<tr><td>Select active profile or click <input type='button' name='NewProfile' value='New' style='width:40px;height:18px;font-family: Tahoma;font-size : 9px' onclick=\"NewProfile()\"</A> to define new server:</td></tr>"; echo "<tr>"; echo "<td>"; foreach ($CCCamWebInfo as $cccam_host_profil => $cccam_profil_hostname) { $ccamhost_path = $work_path . $cccam_profil_hostname[0] . "/"; $ccamhost_update_log = $ccamhost_path . "update.log"; $ccamhost_TIMP_Update = ""; if (file_exists($ccamhost_update_log)) { $ccamhost_update_log_data = file($ccamhost_update_log); $ccamhost_timp_lastupdate = $ccamhost_update_log_data[0]; $diff = time() - $ccamhost_timp_lastupdate; $ccamhost_TIMP_Update = "Last update : " . get_formatted_timediff($ccamhost_timp_lastupdate) . " ago"; if ($diff > 3 * INT_DAY) { $ccamhost_TIMP_Update = "<FONT color=red>" . $ccamhost_TIMP_Update . "</FONT>"; } if ($diff < 12 * INT_HOUR) { $ccamhost_TIMP_Update = "<FONT color=green>" . $ccamhost_TIMP_Update . "</FONT>"; } } $server = $cccam_profil_hostname[0]; $port = $cccam_profil_hostname[1]; $user = $cccam_profil_hostname[2]; $pass = $cccam_profil_hostname[3]; if ($cccam_host == $cccam_profil_hostname[0]) { $linkprofil = "<A class=\"tabel_param\" HREF=" . $pagina . "?setProfil=" . $cccam_host_profil . ">"; $linkprofil = $linkprofil . "Current " . "<FONT color=red>(" . $cccam_host_profil . ") " . $cccam_profil_hostname[0] . "</FONT></A>"; } else {
$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; } $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 .= ' <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; } } $award_string .= '</div></td></tr>'; $awards[$nbr_awards][0] = $aTime; $awards[$nbr_awards][1] = $award_string; $nbr_awards++; } } if ($nbr_awards > 0) { $text .= '<table class="table_left">'; multi2dSortAsc($awards, 0, SORT_DESC); for ($index = 0; $index < min($nbr_awards, $rowsPerPage); $index++) { $text .= $awards[$index][1];
/** * displayTeamAwards - Displays ... */ function displayTeamAwards($clan_id) { global $sql; global $text; global $time; /* Stats/Results */ $q = "SELECT " . TBL_AWARDS . ".*, " . TBL_EVENTS . ".*, " . TBL_CLANS . ".*, " . TBL_TEAMS . ".*, " . TBL_DIVISIONS . ".*, " . TBL_GAMES . ".*" . " FROM " . TBL_AWARDS . ", " . TBL_EVENTS . ", " . TBL_CLANS . ", " . TBL_TEAMS . ", " . TBL_DIVISIONS . ", " . TBL_GAMES . " WHERE (" . TBL_CLANS . ".ClanID = '{$clan_id}')" . " AND (" . TBL_CLANS . ".ClanID = " . TBL_DIVISIONS . ".Clan)" . " AND (" . TBL_TEAMS . ".Division = " . TBL_DIVISIONS . ".DivisionID)" . " AND (" . TBL_AWARDS . ".Team = " . TBL_TEAMS . ".TeamID)" . " AND (" . TBL_TEAMS . ".Event = " . TBL_EVENTS . ".EventID)" . " AND (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)" . " ORDER BY " . TBL_AWARDS . ".timestamp DESC"; $result = $sql->db_Query($q); $num_rows = mysql_numrows($result); if ($num_rows > 0) { $text .= '<table class="eb_table table_left">'; /* Display table contents */ for ($i = 0; $i < $num_rows; $i++) { $aID = mysql_result($result, $i, TBL_AWARDS . ".AwardID"); $aEventID = mysql_result($result, $i, TBL_EVENTS . ".EventID"); $aEventName = mysql_result($result, $i, TBL_EVENTS . ".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); $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 . ' <a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $aEventID . '">' . $aEventName . '</a> (' . $aEventgame . ')'; $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; } } $award_string .= '</div></td></tr>'; $text .= $award_string; } $text .= '</table><br />'; } }
require_once "includes/comment_functions.php"; require_once 'includes/user.php'; define("MAX_TITLE_LENGTH", 70); if ($bookmarks != null) { foreach ($bookmarks as $row) { if (!$anyBooks) { $anyBooks = true; require_once 'includes/convert_date.php'; if ($displayDivs) { echo "<div class=\"tags_content\">\n"; echo "<div class=\"inner\">\n"; include 'includes/searchform.php'; } } $rec_date = "{$row["formatted_time"]}"; $time_between = get_formatted_timediff($rec_date); $date_added = convert_date_tags($rec_date); $rec_id = "{$row["id"]}"; $rec_title = "{$row["title"]}"; $rec_url = "{$row["url"]}"; $rec_desc = "{$row["description"]}"; // Strip title if too long! if (strlen($rec_title) > MAX_TITLE_LENGTH) { $rec_title = substr($rec_title, 0, MAX_TITLE_LENGTH) . ".."; } if ($current_page != "") { $allTagsLinks = returnAllTagsLinks($rec_id, $current_page); } else { $allTagsLinks = returnAllTagsLinks($rec_id); } //no follow so that search engines don't increment the count