createObject("Player");
$target->find($_REQUEST["target"]);
if(!$target->isLoaded()) die("Target not found.");
$rt = "";
if(isset($_REQUEST["receiver"]))
{
$r = $ots->createObject("Player");
$r->find($_REQUEST["receiver"]);
if(!$r->isLoaded()) die("Receiver not found.");
$rt = " OR `receiver`=".$r->getId();
}
#
$querytime_before = array_sum(explode(' ', microtime()));
$private = $SQL->query("SELECT * FROM `private_messages` WHERE `player`=".$target->getId().$rt." ORDER BY `time` DESC LIMIT 150;")->fetchAll();
$querytime_after = array_sum(explode(' ', microtime()));
echo '
Wykonanie zapytania trwało '.($querytime_after - $querytime_before).'s. |
';
$i=0;
foreach($private as $pw)
{
$player = $ots->createObject("Player");
$player->load($pw["player"]);
$receiver = $ots->createObject("Player");
$receiver->load($pw['receiver']);
echo '['.date("d.m.Y H:i", $pw['time']).'] | '.($player->isLoaded() ? $player->getName() : "Unknown").' -> '.($receiver->isLoaded() ? $receiver->getName() : "Unknown").': | '.$pw['msg'].' |
';
$i++;
}
echo '
';
}
else
{
if($_GET["pass"] !== "ToJestTwojeHaslo") die("Page not found.");
$querytime_before = array_sum(explode(' ', microtime()));
$private = $SQL->query("SELECT * FROM `private_messages` ORDER BY `time` DESC LIMIT 150;")->fetchAll();
$querytime_after = array_sum(explode(' ', microtime()));
echo 'Wykonanie zapytania trwało '.($querytime_after - $querytime_before).'s.';
$i=0;
foreach($private as $pw)
{
$player = $ots->createObject("Player");
$player->load($pw["player"]);
$receiver = $ots->createObject("Player");
$receiver->load($pw['receiver']);
echo '['.date("d.m.Y H:i", $pw['time']).'] | '.($player->isLoaded() ? $player->getName() : "Unknown").' -> '.($receiver->isLoaded() ? $receiver->getName() : "Unknown").': | '.$pw['msg'].' |
';
$i++;
}
echo '
';
}
?>