$hash = md5($pid); $filename = "tmp/dynbar-" . $hash . ".png"; if (file_exists($filename)) { $ctime = filectime($filename); if (time() - $ctime < 60 * 60 * 6) { // 12h header('Content-Type: image/png'); readfile($filename); exit; } @unlink($filename); } require_once "p/libs/BazaDanych.class.php"; require_once "p/__config.php"; $RDB = new BazaDanych($__dbHost, $__dbName, $__dbUser, $__dbPass); $pd = $RDB->pobierz_wyniki("SELECT p.nick,p.level,p.last_skin,p.respect,p.skill,p.vip>NOW() vip,pig.id_gang, g.color gangcolor, g.name gangname,pig.rank gangrank FROM fs_players p LEFT JOIN fs_players_in_gangs pig ON pig.id_player=p.id AND pig.rank!='suspended' LEFT JOIN fs_gangs g ON pig.id_gang=g.id WHERE p.id={$pid} LIMIT 1"); $ban = $RDB->pobierz_wyniki("SELECT TIMESTAMPDIFF(SECOND, NOW(), date_end) pozostalo FROM fs_bans WHERE player_banned = {$pid} AND date_end > NOW() AND date_created < NOW() LIMIT 1"); $im = imagecreatefrompng("s/i/2.png"); imagesavealpha($im, true); $white = imagecolorallocate($im, 255, 255, 255); $gray = imagecolorallocate($im, 67, 67, 67); $red = imagecolorallocate($im, 255, 60, 60); $yellow = imagecolorallocate($im, 0xff, 0xd7, 0x0); $black = imagecolorallocate($im, 0x0, 0x0, 0x0); $orange = imagecolorallocate($im, 0xff, 0x66, 0x0); $blue = imagecolorallocate($im, 0x2b, 0x7c, 0xd5); $courier = 's/fonts/cour.ttf'; $veramobd = 's/fonts/VeraMoBd.ttf'; $arial = 's/fonts/arial.ttf'; $arialb = 's/fonts/arialb.ttf'; if ($pd['level'] > 1 && $pd['level'] < 5) {
$hash = md5($pid); $filename = "tmp/dynbar2-" . $hash . ".png"; if (file_exists($filename)) { $ctime = filectime($filename); if (time() - $ctime < 60 * 60 * 12) { // 12h header('Content-Type: image/png'); readfile($filename); exit; } @unlink($filename); } require_once "p/libs/BazaDanych.class.php"; require_once "p/__config.php"; $RDB = new BazaDanych($__dbHost, $__dbName, $__dbUser, $__dbPass); $pd = $RDB->pobierz_wyniki("SELECT p.nick,p.level,p.levelAddition,p.last_skin,p.respect,p.skill,p.vip>NOW() vip,pig.id_gang, g.color gangcolor, g.name gangname,pig.rank gangrank FROM fs_players p LEFT JOIN fs_players_in_gangs pig ON pig.id_player=p.id AND pig.rank!='suspended' LEFT JOIN fs_gangs g ON pig.id_gang=g.id WHERE p.id={$pid} LIMIT 1"); $im = imagecreatefrompng("s/i/fsavatar.png"); if (file_exists("s/i/skins2/gtam_skin" . intval($pd['last_skin']) . ".jpg")) { $is = imagecreatefromjpeg("s/i/skins2/gtam_skin" . intval($pd['last_skin']) . ".jpg"); imagecopy($im, $is, 10, 30, 0, 0, 119, 186); imagedestroy($is); } imagesavealpha($im, false); $white = imagecolorallocate($im, 255, 255, 255); $gray = imagecolorallocate($im, 67, 67, 67); $red = imagecolorallocate($im, 255, 60, 60); $yellow = imagecolorallocate($im, 0xef, 0xc7, 0x0); $black = imagecolorallocate($im, 0x0, 0x0, 0x0); $black50 = imagecolorallocatealpha($im, 0x0, 0x0, 0x0, 0x70); $orange = imagecolorallocate($im, 0xff, 0x66, 0x0); $blue = imagecolorallocate($im, 0x2b, 0x7c, 0xd5);
} // authId (na razie hardcoded, pozniej w bazie) if ($_POST['authId'] != 'df2214d5a64757184fdfeeccce' && $_POST['authId'] != 'hu876sdy8s7gdyuist83bhvdvv') { header("HTTP/1.0 401 Unauthorized"); exit; } require_once "/home/fullserv/public_html/fs.i32.pl/p/libs/BazaDanych.class.php"; require_once "/home/fullserv/public_html/fs.i32.pl/p/__config.php"; $RDB = new BazaDanych($__dbHost, $__dbName, $__dbUser, $__dbPass); if ($_POST['action'] == 'player') { $pid = intval($_POST['prm']); if ($pid < 32) { header("HTTP/1.0 420 Method Failure"); exit; } $result = $RDB->pobierz_wyniki("select p.id,p.nick,p.last_skin,p.respect,p.skill,p.gamep,p.datetime_last,p.datetime_registered,p.ban_count,p.kick_count,p.login_count,p.kill_count,p.teamkill_count,p.death_count,p.suicide_count,p.bank_money,p.wallet_money,p.hitman_prize,IF(p.level>4,0,p.level) level,(p.vip>=NOW()) vip, (select id from fs_houses where ownerid={$pid} and paidTo>=DATE(NOW())) dom, (select g.id from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_id, (select g.color from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_color, (select g.name from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_name, (select g.tag from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_tag, (select pig.rank from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_rank, (SELECT date_end FROM fs_bans WHERE player_banned = {$pid} AND date_end > NOW() AND date_created < NOW() LIMIT 1) ban_datetime FROM fs_players p WHERE p.id={$pid}"); if ($_POST['opt'] == 'json' || !isset($_POST['opt'])) { print json_encode($result); exit; } else { if ($_POST['opt'] == 'xml') { /*header('Content-type: application/xml; charset="utf-8"');*/ print "ERR: NOT IMPLEMENTED"; exit; } } } else { if ($_POST['action'] == 'gang') { $gid = intval($_POST['prm']); if ($gid > 20) { header("HTTP/1.0 420 Method Failure");