<?php

require "globals.php";
$auth = $_GET['auth'];
if ($auth != 'supertajne') {
    exit("invalid auth");
}
$from = $_GET['from'];
$to = $_GET['to'];
$fi = getPlayerId($from);
if ($fi <= 0) {
    exit("invalid from");
}
$ti = getPlayerId($to);
if ($ti <= 0) {
    exit("invalid to");
}
mysql_query("UPDATE Games2players SET playerId = {$fi} WHERE playerId = {$ti}");
mysql_query("DELETE FROM Players2ip WHERE playerId = {$ti}");
mysql_query("DELETE FROM Players WHERE id = {$ti}");
mysql_query("UPDATE Players SET name='{$to}' WHERE id = {$fi}");
<body>

<div class="container">
    <div class="header clearfix">
        <nav>
            <ul class="nav nav-pills pull-right">
                <li role="presentation" class="active"><a href="#">Hlavní stránka</a></li>
                <li role="presentation"><a href="#">Vývojáři</a></li>
                <li role="presentation"><a href="#">Kontakt</a></li>
            </ul>
        </nav>
        <h3 class="text-muted">Minecore Times</h3>
    </div>
    <?php 
$uId = getPlayerId($_COOKIE["MTU"], $mysqli);
?>
    <div class="jumbotron">
        <h1>Vyber si dobu</h1>
        <p class="lead">Vyber si herní dobu, kterou chceš hrát. Měj však na paměti, že se ti zpřístupní pouze ta, na kterou máš potřebný level.</p>
        <?php 
$list = listAges($mysqli);
foreach ($list as $single) {
    if (checkAgeLevel(playerDataSingle($uId, "playerLevel", $mysqli), $single['id'], $mysqli) == 1) {
        print "<p><a class='btn btn-lg btn-success' href='quest-list.php?ageName=" . $single['ageName'] . "' role='button'><span class='glyphicon glyphicon-play' aria-hidden='true'></span> " . $single['ageName'] . "</a></p>";
    } else {
        print "<p><a class='btn btn-lg btn-warning' href='#' role='button'> <span class='glyphicon glyphicon-lock' aria-hidden='true'></span> " . $single['ageName'] . "</a></p>";
    }
}
?>
        <p><a class="btn btn-lg btn-success" href="#" role="button">---</a></p>
Exemple #3
0
        array_push($filter, "session");
    }
}
//Signs
if (isset($_POST["signs"])) {
    if ($_POST["signs"] == "on") {
        array_push($filter, "sign");
    }
}
if (isset($_POST["date"]) && $_POST["date"] != "") {
    $date = strtotime($_POST["date"]);
} else {
    $date = strtotime("-1 hour");
}
if (isset($_GET["user"])) {
    $id = getPlayerId($con, $tablepre, $_GET["user"]);
    $where = "user='******' AND time>'{$date}'";
} else {
    $where = "time>'{$date}'";
}
if (isset($_POST["search"]) && (isset($_POST["chat"]) || isset($_POST["command"]))) {
    $search = mysqli_real_escape_string($con, $_POST["search"]);
    $where .= "AND message LIKE '%{$search}%'";
}
//Add everything too one array for easy sorting
foreach ($filter as $value) {
    $result = mysqli_query($con, "SELECT * FROM " . $tablepre . $value . " WHERE ( " . $where . " ) ORDER BY rowid DESC");
    while ($row = mysqli_fetch_array($result)) {
        array_push($row, $value);
        array_push($logs, $row);
    }
$p = $_GET[p];
if (!validate()) {
    exit("FAILED 2 auth failed - delete do_not_delete_me.xml in springie folder and restart!");
}
echo "RESPOND\n";
if ($p == "" || $p == "HELP") {
    echo "* !smurfs <playername> *\n";
}
if ($p == "") {
    if (count($_GET[users]) == 0) {
        $p = $_GET[user];
    } else {
        echo "--- Smurfs of current game ---\n";
        for ($i = 0; $i < count($_GET[users]); $i++) {
            $spl = explode("|", $_GET[users][$i]);
            echo $spl[0] . " --> " . displaySmurf(getPlayerId($spl[0])) . "\n";
        }
        //echo "\nIf you like !smurfs please support it by voting here http://taspring.clan-sy.com/phpbb/viewtopic.php?t=8662\n";
        exit;
    }
}
function displaySmurf($id)
{
    $ret = "";
    $res = mysql_query("SELECT name, lastSeen, rank FROM Players AS p JOIN Players2ip AS i ON p.id = i.playerId WHERE ip IN (SELECT ip FROM Players2ip WHERE playerId={$id}) GROUP BY playerId ORDER BY name");
    $cnt = 0;
    while ($row = mysql_fetch_array($res)) {
        if ($row[rank] == 0) {
            $row[rank] = "?";
        }
        if ($cnt > 0) {
	$y = secureData($_POST['y']);
	$z = secureData($_POST['z']);
	$target_id = getPlayerId($x, $y, $z);
	if ($target_id <= 0) { $error = 103; }
	if ($playerdata['res_crystal'] < 2700) { $error = 104; }
	if (!checkItem($playerdata['id'], $ADVANCED_INTELLIGENCE)) { $error = 105; }
	if ($error < 100) {
		$playerdata['res_crystal'] -= 2700;
		updatePlayerData($playerdata['id'], $playerdata);
	}
}
if ($do == 'newsscan') {
	$x = secureData($_POST['x']);
	$y = secureData($_POST['y']);
	$z = secureData($_POST['z']);
	$target_id = getPlayerId($x, $y, $z);
	if ($target_id <= 0) { $error = 103; }
	if ($playerdata['res_crystal'] < 5000) { $error = 104; }
	if (!checkItem($playerdata['id'], $NG_INTELLIGENCE)) { $error = 106; }
	if ($error < 100) {
		$playerdata['res_crystal'] -= 5000;
		updatePlayerData($playerdata['id'], $playerdata);
	}
}
if ($do == 'uniscan') {
	$findcluster = secureData($_POST['findcluster']);
	$order = secureData($_POST['order']);
	$excl_galmem = secureData($_POST['excl_galmem']);
	$excl_allmem = secureData($_POST['excl_allmem']);
	$minscore = secureData($_POST['minscore']);
	$maxscore = secureData($_POST['maxscore']);
	if ($_POST['resubject']) {
		$resub = secureData($_POST['resubject']);
		if (substr($resub, 0, 4) == 'Re: ') { $subject = $resub; }
		else{ $subject = 'Re: '.$resub; }
	}
}
if ($do == 'send') {
	$x = secureData($_POST['x']);
	$y = secureData($_POST['y']);
	$z = secureData($_POST['z']);

	$subject = secureData($_POST['subject']);
	$text = secureData($_POST['text']);
	$error = 0;

	$player_to_id = getPlayerId($x, $y, $z);
	if ($player_to_id < 1) { $error = 1; }
	if ($subject == '') { $error = 2; }
	if ($error == 0) {
		$sql_newmail = "INSERT INTO $table[mail] (`id`, `from_player`, `to_player`, `subject`, `text`, `date`)
						VALUES ('', '$playerdata[id]', '$player_to_id', '$subject', '$text', UNIX_TIMESTAMP())";
		mysql_query($sql_newmail);
		unset($x, $y, $z, $subject, $text);
	}
	switch($error) {
		case 0:
		$msg = "The mail was succesfully sent.";
		break;
		case 1:
		$msg = "That player does not exist!";
		break;
        }
        $res = mysql_query("SELECT name, sum(duration) AS sum FROM Games JOIN Mods ON modId = Mods.id AND Games.id IN (SELECT distinct gameId AS cnt FROM Games2players WHERE playerId={$pid}) GROUP BY modId ORDER BY sum DESC LIMIT 0,5 ");
        echo "most played MODS are:\n";
        $i = 1;
        while ($row = mysql_fetch_array($res)) {
            echo $i . ". {$row['name']} - " . timeDiff($row[sum]) . "\n";
            $i++;
        }
        $res = mysql_query("SELECT count(*) AS cnt, side FROM Games2players WHERE playerId = {$pid} AND spectator = 0 GROUP BY side ORDER BY cnt DESC LIMIT 0,5");
        echo "most played SIDES are:\n";
        $i = 1;
        while ($row = mysql_fetch_array($res)) {
            echo $i . ". {$row['side']} - {$row['cnt']} times \n";
            $i++;
        }
        break;
    case "":
        echo "--- Stats for current game ---\n";
        $res = mysql_query("SELECT sum(duration) AS totalTime, avg(duration) AS avgTime, count(*) AS cnt,avg(players) AS avgPlayers FROM Games WHERE modId = " . getModId($_GET[mod]) . " AND mapId = " . getMapId($_GET[map]));
        @($row = mysql_fetch_array($res));
        echo "Game on this map and mod usually lasts " . timeDiff($row[avgTime]) . " and is played by " . round($row[avgPlayers]) . " players \n";
        for ($i = 0; $i < count($_GET[users]); $i++) {
            $spl = explode("|", $_GET[users][$i]);
            echo $spl[0] . " --> " . displayStats(getPlayerId($spl[0])) . "\n";
        }
        exit;
        break;
    default:
        echo "RESPOND\nuse !stats games, !stats maps, !stats player <name>";
        break;
}