function do_search($name, $search_aliases = false)
{
    global $currentconfig;
    global $currentconfignumber;
    global $coddb;
    global $t;
    global $text;
    $count = 0;
    $link = baselink();
    $query = "SELECT {$t['b3_clients']}.name, {$t['players']}.id, {$t['players']}.fixed_name,\n              {$t['players']}.hide \n              FROM {$t['b3_clients']}, {$t['players']}\n              WHERE ({$t['b3_clients']}.id = {$t['players']}.client_id)\n              AND ( \n                      ({$t['b3_clients']}.name LIKE \"%{$name}%\")\n                  OR\n                      ({$t['players']}.fixed_name LIKE \"%{$name}%\")\n                  )\n              AND {$t['players']}.hide = 0";
    $result = $coddb->sql_query($query);
    opentablerow('100');
    echo "<td>" . $text["currentplnames"] . "<td></tr><tr>";
    while ($row = $coddb->sql_fetchrow($result)) {
        opentablecell('100');
        if ($row['fixed_name'] == "") {
            echo "<a href=\"{$link}?func=player&playerid={$row['id']}&config={$currentconfignumber}\">" . htmlspecialchars(utf2iso($row['name'])) . "</a><br/>";
            $count++;
        } else {
            if (stristr($row['fixed_name'], $name)) {
                echo "<a href=\"{$link}?func=player&playerid={$row['id']}&config={$currentconfignumber}\">" . htmlspecialchars(utf2iso($row['fixed_name'])) . "</a><br/>";
                $count++;
            }
        }
        closetablecell();
        echo "</tr><tr>";
    }
    closetablerow();
    if ($search_aliases == "true") {
        $query = "SELECT {$t['b3_aliases']}.alias, {$t['b3_clients']}.name, {$t['players']}.id\n        FROM {$t['b3_aliases']}, {$t['b3_clients']}, {$t['players']}\n        WHERE ({$t['b3_aliases']}.alias LIKE \"%{$name}%\")\n        AND {$t['b3_aliases']}.client_id = {$t['b3_clients']}.id\n        AND {$t['b3_clients']}.id = {$t['players']}.client_id\n        AND {$t['players']}.hide = 0\n        AND {$t['players']}.fixed_name = '' ";
        $result = $coddb->sql_query($query);
        if ($coddb->sql_numrows($result) > 0) {
            echo "Alias results:<br/>";
        }
        opentablerow('100');
        echo "<td>Search results (aliase -> current playername)<td></tr><tr>";
        while ($row = $coddb->sql_fetchrow($result)) {
            opentablecell('100');
            echo "{$row['alias']} -> <a href=\"{$link}?func=player&playerid={$row['id']}&config={$currentconfignumber}\">{$row['name']}</a><br/>";
            $count++;
            closetablecell();
            echo "</tr><tr>";
        }
        closetablerow();
    }
    return $count;
}
예제 #2
0
function player_compare($myplayerid, $playerid)
{
    global $ccounter1;
    global $ccounter2;
    $ccounter1 = 0;
    $ccounter2 = 0;
    // load the two players in arrays
    $player1 = player_short_comparison($myplayerid);
    $player2 = player_short_comparison($playerid);
    opentablerow(100);
    echo "<td align=\"center\">Player Comparison Chart. Comparing " . htmlspecialchars(utf2iso($player1['name'])) . " to " . htmlspecialchars(utf2iso($player2['name'])) . "</td></tr><tr>";
    closetablecell();
    closetablerow();
    echo "<br>";
    echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"0\"><tr>";
    echo "<td width=\"25%\">";
    player_compare_item($player1, $player2, $citem = "playerrank", $cbar = false, $switchwinner = true, $columns = 4);
    echo "</td><td width=\"25%\">";
    player_compare_item($player1, $player2, $citem = "country", $cbar = false, $switchwinner = true, $columns = 4);
    echo "</td><td width=\"25%\">";
    player_compare_item($player1, $player2, $citem = "connections", $cbar = false, $switchwinner = false, $columns = 4);
    echo "</td><td width=\"25%\">";
    player_compare_item($player1, $player2, $citem = "rounds", $cbar = false, $switchwinner = false, $columns = 4);
    echo "</td></tr></table>";
    echo "<br>";
    echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"0\"><tr>";
    echo "<td width=\"50%\">";
    player_compare_item($player1, $player2, $citem = "skill", $cbar = true, $switchwinner = false, $columns = 2);
    echo "<br>";
    echo "</td><td width=\"50%\">";
    player_compare_item($player1, $player2, $citem = "ratio", $cbar = true, $switchwinner = false, $columns = 2);
    echo "<br>";
    echo "</td></tr><tr><td width=\"50%\">";
    player_compare_item($player1, $player2, $citem = "kills", $cbar = true, $switchwinner = false, $columns = 2);
    echo "<br>";
    echo "</td><td width=\"50%\">";
    player_compare_item($player1, $player2, $citem = "deaths", $cbar = true, $switchwinner = true, $columns = 2);
    echo "<br>";
    echo "</td></tr><tr><td width=\"50%\">";
    player_compare_item($player1, $player2, $citem = "winstreak", $cbar = true, $switchwinner = false, $columns = 2);
    echo "<br>";
    echo "</td><td width=\"50%\">";
    player_compare_item($player1, $player2, $citem = "losestreak", $cbar = true, $switchwinner = true, $columns = 2);
    echo "<br>";
    echo "</td></tr><tr><td width=\"50%\">";
    player_compare_item($player1, $player2, $citem = "teamkills", $cbar = true, $switchwinner = true, $columns = 2);
    echo "<br>";
    echo "</td><td width=\"50%\">";
    player_compare_item($player1, $player2, $citem = "teamdeaths", $cbar = true, $switchwinner = true, $columns = 2);
    echo "<br>";
    echo "</td></tr></table>";
    opentablerow(100);
    echo "<td align=\"center\">Comparison Count and Conclusion</td></tr><tr>";
    opentablecell(100);
    $ctotal = $ccounter1 + $ccounter2;
    if ($ccounter2 > $ccounter1) {
        echo "We can conclude that " . htmlspecialchars(utf2iso($player1['name'])) . " ownes " . htmlspecialchars(utf2iso($player2['name'])) . " in " . $ccounter2 . " of " . $ctotal . " total comparison sections!";
    }
    if ($ccounter1 > $ccounter2) {
        echo "We can conclude that " . htmlspecialchars(utf2iso($player2['name'])) . " ownes " . htmlspecialchars(utf2iso($player1['name'])) . " in " . $ccounter1 . " of " . $ctotal . " total comparison sections!";
    }
    closetablecell();
    closetablerow();
}
예제 #3
0
        $currentconfignumber = $_SESSION['currentconfignumber'];
        $currentconfig = "../config/statsconfig" . $currentconfignumber . ".php";
    }
    // double check config number found point to an existing config file or fallback to config 1
    if (!file_exists($currentconfig)) {
        $currentconfig = "config/statsconfig1.php";
        $currentconfignumber = 1;
    }
}
require_once $currentconfig;
// pop should hold the subdir depth of this file in relation to the xlrstats root.
$pop = 1;
include "../languages/languages.php";
displaysimpleheader(1);
opentablerow('100');
opentablecell('100');
echo "<h1 align=\"center\">XLRstats - Signature Builder </h1>";
if (isset($_POST['submit'])) {
    if (strlen($_POST['id']) == 0) {
        die("Please enter a player ID");
    }
    $ptemp = explode("/", GetFileDir($_SERVER['PHP_SELF']));
    array_pop($ptemp);
    array_pop($ptemp);
    $link = "http://" . $_SERVER['HTTP_HOST'] . implode("/", $ptemp);
    extract($_POST, EXTR_PREFIX_ALL, "in");
    $in_id = stripslashes($in_id);
    $player_id = $in_id;
    if ($currentconfignumber != 0) {
        $url = $link . "/sig/?config=" . $currentconfignumber . "&id=" . urlencode($player_id);
        $stats_url = $link . "/index.php?func=player&config=" . $currentconfignumber . "&playerid=" . urlencode($player_id);