function topplayersblock($sortby = "skill", $direction = "DESC", $offset = 0) { global $coddb; global $minkills; global $minrounds; global $toplist_block; global $user_length; global $t; global $maxdays; global $currentconfignumber; $current_time = time(); $sortfields = array("skill", "kills", "ratio"); $sortby = strtolower($sortby); if (!in_array($sortby, $sortfields)) { $sortby = $sortfields[0]; } if ($direction != "ASC") { $direction = "DESC"; } echo "\n <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"outertable\"><tr><td align=\"center\">Top {$toplist_block} - {$sortby}</span></td></tr><tr><td>\n <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\" class=\"innertable\">\n <tr class=\"outertable\">\n <td>Rank</td>\n <td>Name</td>\n </tr>\n "; $rank = $offset + 1; $rank_step = $direction == "ASC" ? -1 : 1; $query = "SELECT {$t['b3_clients']}.name, {$t['b3_clients']}.time_edit, {$t['players']}.id, kills, deaths, ratio, skill, winstreak, losestreak, rounds, fixed_name\n FROM {$t['b3_clients']}, {$t['players']}\n WHERE ({$t['b3_clients']}.id = {$t['players']}.client_id)\n AND (({$t['players']}.kills > {$minkills})\n OR ({$t['players']}.rounds > {$minrounds}))\n AND ({$t['players']}.hide = 0)\n AND ({$current_time} - {$t['b3_clients']}.time_edit < {$maxdays}*60*60*24)\n ORDER BY {$sortby} {$direction}"; if ($toplist_block > 0) { $query .= " LIMIT {$offset}, {$toplist_block}"; } $result = $coddb->sql_query($query); while ($row = $coddb->sql_fetchrow($result)) { echo "<tr>"; echo "<td>{$rank}</td>"; $name = $row['fixed_name'] ? $row['fixed_name'] : $row['name']; if (strlen($name) > $user_length) { $name = substr($name, 0, $user_length) . '...'; } if ($sortby == "skill") { echo "<td><a href=\"" . httplink() . "index.php?func=player&playerid={$row['id']}&config={$currentconfignumber}\" target=\"_blank\" title=\"{$sortby} - {$row['skill']}\">", $name, "</a></td>"; } elseif ($sortby == "kills") { echo "<td><a href=\"" . httplink() . "index.php?func=player&playerid={$row['id']}&config={$currentconfignumber}\" target=\"_blank\" title=\"{$sortby} - {$row['kills']}\">", $name, "</a></td>"; } elseif ($sortby == "ratio") { echo "<td><a href=\"" . httplink() . "index.php?func=player&playerid={$row['id']}&config={$currentconfignumber}\" target=\"_blank\" title=\"{$sortby} - {$row['ratio']}\">", $name, "</a></td>"; } echo "</tr>"; $rank += $rank_step; } echo "</table>"; echo "</td></tr></table>"; // Closing extra border-table }
function gamelauncher($type) { global $currentconfig; global $text; include $currentconfig; $link = ""; $img_xfire = httplink() . 'images/ico/icon_xfire.jpg'; $img_qtracker = httplink() . 'images/ico/icon_qtracker.jpg'; $img_hlsw = httplink() . 'images/ico/icon_hlsw.jpg'; $img_gsc = httplink() . 'images/ico/icon_gsc.jpg'; if ($type == 'xfire') { $tgame = False; if ($game == 'cod1') { $tgame = 'codmp'; } if ($game == 'coduo') { $tgame = 'coduomp'; } if ($game == 'cod2') { $tgame = 'cod2mp'; } if ($game == 'cod4') { $tgame = 'cod4mp'; } if ($game == 'codwaw') { $tgame = 'codwawmp'; } if ($game == 'urt') { $tgame = 'utq3'; } if ($game == 'q3a') { $tgame = 'q3'; } if ($game == 'smg') { $tgame = 'smokin'; } if ($game == 'wop') { $tgame = 'wopad'; } if ($tgame) { $link = ' <a href="xfire:join?game=' . $tgame . '&server=' . $public_ip . '"><img src="' . $img_xfire . '" title="' . $text["conwxfire"] . '" alt="xfire" width="16" height="16" border="0" align="absmiddle" id="xfire" /></a>'; } } elseif ($type == 'qtracker') { $tgame = False; if ($game == 'cod1') { $tgame = 'CallOfDuty'; } if ($game == 'coduo') { $tgame = 'CallOfDutyUnitedOffensive'; } if ($game == 'cod2') { $tgame = 'CallOfDuty2'; } if ($game == 'cod4') { $tgame = 'CallOfDuty4'; } if ($game == 'codwaw') { $tgame = 'CallOfDutyWorldAtWar'; } if ($game == 'urt') { $tgame = 'UrbanTerror'; } if ($game == 'q3a') { $tgame = 'Quake3'; } if ($game == 'smg') { $tgame = 'Quake3'; } if ($game == 'wop') { $tgame = 'WorldOfPadman'; } if ($tgame) { $link = ' <a href="qtracker://' . $public_ip . '/?game=' . $tgame . '&action=join"><img src="' . $img_qtracker . '" title="' . $text["conwqtracker"] . '" alt="qtracker" width="16" height="16" border="0" align="absmiddle" id="qtracker" /></a>'; } } elseif ($type == 'hlsw') { $link = ' <a href="hlsw://' . $public_ip . '"><img src="' . $img_hlsw . '" title="' . $text["conwhlsw"] . '" alt="hlsw" width="16" height="16" border="0" align="absmiddle" id="hlsw" /></a>'; } elseif ($type == 'gsc') { $tgame = False; if ($game == 'cod1') { $tgame = 'cod'; } if ($game == 'coduo') { $tgame = 'uo'; } if ($game == 'cod2') { $tgame = 'cod2'; } if ($game == 'cod4') { $tgame = 'cod4'; } if ($game == 'codwaw') { $tgame = 'codww'; } if ($game == 'urt') { $tgame = 'urbanterror'; } if ($game == 'q3a') { $tgame = 'q3'; } if ($game == 'smg') { $tgame = 'q3'; } if ($game == 'wop') { $tgame = 'wop'; } $temp = explode(":", $public_ip); if ($tgame) { $link = ' <a href="gsc://joinGame:game=' . $tgame . '&ip=' . $temp[0] . '&port=' . $temp[1] . '"><img src="' . $img_gsc . '" title="' . $text["conwgsc"] . '" alt="gsc" width="16" height="16" border="0" align="absmiddle" id="gsc" /></a>'; } } return $link; }
} $query .= " ORDER BY {$sortby} {$direction} \n LIMIT 0, {$limit}"; $result = $coddb->sql_query($query); $timestamp = time(); $count = 1; while ($row = $coddb->sql_fetchrow($result)) { //Create an empty FeedItem $newItem = $XLRfeed->createNewItem(); if ($use_localtime == 1) { $time_edit = date("j F Y, G:i T", $row['time_edit'] + date("Z")); } else { $time_edit = date("j F Y, G:i", $row['time_edit']) . " GMT"; } $tname = $row['fixed_name'] ? $row['fixed_name'] : $row['name']; $name = "#" . $count . ": " . $tname; $link = httplink() . "?config=" . $currentconfignumber . "&func=player&playerid=" . $row['id']; //$time_edit = $row['time_edit']; if ($sortby == "kills") { $description = "<strong>[Kills: " . $row['kills'] . "]</strong> [Skill: " . $row['skill'] . "] [Ratio: " . $row['ratio'] . "] [Deaths: " . $row['deaths'] . "] [Last seen: " . $time_edit . " ]"; } elseif ($sortby == "ratio") { $description = "<strong>[Ratio: " . $row['ratio'] . "]</strong> [Skill: " . $row['skill'] . "] [Kills: " . $row['kills'] . "] [Deaths: " . $row['deaths'] . "] [Last seen: " . $time_edit . " ]"; } else { $description = "<strong>[Skill: " . $row['skill'] . "]</strong> [Ratio: " . $row['ratio'] . "] [Kills: " . $row['kills'] . "] [Deaths: " . $row['deaths'] . "] [Last seen: " . $time_edit . " ]"; } //Add elements to the feed item $newItem->setTitle($name); $newItem->setLink($link); $newItem->setDate($timestamp); $newItem->setDescription($description); //Now add the feed item $XLRfeed->addItem($newItem);
***************************************************************************/ // Set flag that this is a parent file define('_XLREXEC', 1); $main_width = "100%"; // Enter a value (i.e. $main_width="400px";) if you need to set a fixed width. $onlineplayers_bgcolor = ""; //Background color for online players. (you can leave blank) include "inc_mysql.php"; include "func-globallogic.php"; include "func-block.php"; include "func-clan.php"; require_once "config/inc_constants.php"; //Add below, if you are running other game types, don't forget to use commas after each input EXCEPT for the last one $gametypes = array("tdm" => "Team Death Match", "ffa" => "Free For All", "dm" => "Death Match", "war" => "War", "sd" => "Search & Destroy", "htf" => "Hold the Flag", "re" => "Retreival", "ctf" => "Capture the Flag", "hq" => "Head Quarters", "ts" => "Team Survivor", "lms" => "Last Man Standing", "koth" => "King of the Hill"); $ffa_modes = array('dm', 'ffa', 'syc-ffa'); $images_folder = httplink() . 'images'; session_start(); cleanglobals(); // If statsconfig.php exists, we won't enable multiconfig functionality if (file_exists("config/statsconfig.php")) { $currentconfig = "config/statsconfig.php"; $currentconfignumber = 0; } elseif (file_exists("config/statsconfig1.php")) { $currentconfig = "config/statsconfig1.php"; $currentconfignumber = 1; // Was a config set in the url? if (isset($_GET['config'])) { $currentconfignumber = escape_string($_GET['config']); $currentconfig = "config/statsconfig" . $currentconfignumber . ".php"; $_SESSION['currentconfignumber'] = $currentconfignumber; }
function checkinstalldir() { $configfiles = scandir('config'); // Check the [array] config dir for a filename containing 'statsconfig' $statsconfig_exists = array_find('statsconfig', $configfiles); if (is_dir('install') && $statsconfig_exists) { echo '<html> <head> <title>XLRstats B3 - ERROR</title> <style type="text/css"> body{text-align: center; font-family:Arial, Helvetica, sans-serif; font-weight: bold} </style> </head> <body> <p>We found a valid configfile for XLRstats, seems you have finished installation.</p> <p>However, your installation directory is still at the default location!<br /> Before you can continue, you need to</p> <p style="font-size:1.5em; color: red"><i>Remove</i> or <i>Rename</i> your installation directory.</p> </body> </html>'; exit; } elseif (is_dir('install')) { // Not installed yet, forward to the install folder $install_loc = httplink() . 'install/'; header("Location: {$install_loc}"); } }