Location: PHPKode > projects > World of Warcraft Signature Script > includes/pic.php
<?php
if(!defined("INZWOWSIG")) die("blubb");

if(mysql_result(mysql_query("SELECT count(name) FROM wowsig_players WHERE id='$id'"),0)==0||$id=="217") die("wat willste?");
$query="INSERT INTO wowsig_trackback(ip, useragent, referrer, timestamp, extended, playerid) VALUES('".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."', '".mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])."', '".mysql_real_escape_string($_SERVER['HTTP_REFERER'])."','".time()."', '".mysql_real_escape_string($_GET['extended'])."', '".mysql_real_escape_string($id)."')";

if ($dotracback)
{
	mysql_query($query);
}

include("includes/varconfig.php");

$player['name'] = mysql_result(mysql_query("SELECT name FROM wowsig_players WHERE id='$id'"),0);
$class = mysql_result(mysql_query("SELECT class FROM wowsig_players WHERE id='$id'"),0);
$player['classname'] = mysql_result(mysql_query("SELECT class_name FROM wowsig_classes WHERE class_id='$class'"),0);
//$player['classpic'] = mysql_result(mysql_query("SELECT pic FROM wowsig_classes WHERE class_id='$class'"),0);
$race = mysql_result(mysql_query("SELECT race FROM wowsig_players WHERE id='$id'"),0);
$player['racename'] = mysql_result(mysql_query("SELECT race_name FROM wowsig_races WHERE race_id='$race'"),0);
$player['timestamp'] = mysql_result(mysql_query("SELECT timestamp FROM wowsig_players WHERE id='$id'"),0);
$map = mysql_result(mysql_query("SELECT map FROM wowsig_players WHERE id='$id'"),0);
$player['mapname'] = mysql_result(mysql_query("SELECT map_name FROM wowsig_maps WHERE map_id='$map'"),0);
$zone = mysql_result(mysql_query("SELECT zone FROM wowsig_players WHERE id='$id'"),0);

if (!($player['zonename']=@mysql_result(mysql_query("SELECT zone_name FROM wowsig_zones WHERE zone_id='$zone'"),0)))
$player['zonename']="Instanz";

$player['level'] = mysql_result(mysql_query("SELECT level FROM wowsig_players WHERE id='$id'"),0);
$player['bgpic'] = mysql_result(mysql_query("SELECT pic FROM wowsig_races WHERE race_id='$race'"),0);

$bgpicres=imagecreatefrompng("pics/race/".$player['bgpic']);

imageAlphaBlending($bgpicres, true);
imageSaveAlpha($bgpicres, true);

$borderres=imagecreatefrompng("pics/misc/border.png");
$border_h=imagesy($borderres);
$border_w=imagesx($borderres);
imagecopy($bgpicres,$borderres,0,0,0,0,$border_w,$border_h);

//Rahmen
$hintergrundcolor=imagecolorallocatealpha($bgpicres, 255, 255, 255, $bgvisible); 

imagefilledrectangle($bgpicres, 0, 0, 380-1, 120-1, $hintergrundcolor);

$rahmencolor = imagecolorallocate($bgpicres, $rahmencolor_r, $rahmencolor_g, $rahmencolor_b);
imagerectangle($bgpicres, 0, 0, 380-1, 120-1, $rahmencolor);  //schwarzer rahmen

//text
$font['1']="includes/fonts/schrift.ttf";
$font['2']="includes/fonts/Accidental_Presidency.ttf";
$font['3']="includes/fonts/Adventure_Normal.ttf";
$font['4']="includes/fonts/African.ttf";
$font['5']="includes/fonts/Agent_Orange.ttf";
$font['6']="includes/fonts/AirCut_Light.ttf";
$font['7']="includes/fonts/Akbar__Plain.ttf";
$font['8']="includes/fonts/arial.ttf";

$labelcolor = imagecolorallocate($bgpicres, $labelcolor_r, $labelcolor_g, $labelcolor_b);

$contcolor = imagecolorallocate($bgpicres, $contcolor_r, $contcolor_g, $contcolor_b);

$headcolor = imagecolorallocate($bgpicres, $headcolor_r, $headcolor_g, $headcolor_b);

$serverheadcolor = imagecolorallocate($bgpicres, $serverheadcolor_r, $serverheadcolor_g, $serverheadcolor_b);

$servercontcolor = imagecolorallocate($bgpicres, $servercontcolor_r, $servercontcolor_g, $servercontcolor_b);
$beschirftungen=
   "Char:\n".
   "Level:\n".
   "Rasse:\n".
   "Klasse:\n".
   "Status:\n".
   "Ort:\n";
if(time()-$player['timestamp']>$refreshrate)
{
$offlinetime=formattime($player['timestamp']);
$on="offline(".$offlinetime.")";
}
else
{
$on="Online";
}

if ($player['zonename']=="Instanz")
{
$ort=$player['zonename']."/".$player['mapname'];
}
elseif($player['mapname']!="Azeroth" && $player['mapname']!="Kalimdor")
{
$ort=$player['zonename']."/".$player['mapname'];
}
else
{
$ort=$player['mapname']."/".$player['zonename'];
}
$text=$player['name']."\n".
$player['level']."\n".
$player['racename']."\n".
$player['classname']."\n".
$on."\n".
$ort."\n";
//head
imagettftext($bgpicres, $headsize, 0, 20, 18, $headcolor, $font[$headfont], $headline);
//klasse level usw.
imagettftext($bgpicres, $labelsize, 0, 10, 32, $labelcolor, $font[$labelfont], $beschirftungen);
//$klasse usw.
imagettftext($bgpicres, $contsize, 0, 70, 32, $contcolor, $font[$contfont], $text);

//serverinfo
$uptime = mysql_result(mysql_query("SELECT `value`
FROM `wowsig_config`
WHERE `key` LIKE 'uptime'"),0);
$uptime=str_replace(" weeks","w",$uptime);
$uptime=str_replace(" days","d",$uptime);
$uptime=str_replace(" mins","m",$uptime);
$uptime=str_replace(" hours","h",$uptime);

$playerstotal=mysql_result(mysql_query("SELECT count(name)
FROM `wowsig_players`"),0);

$playersonline = mysql_result(mysql_query("SELECT `value`
FROM `wowsig_config`
WHERE `key` LIKE 'playersonline'"),0);

$playersonline="Players online: ".$playersonline." von ca.".$playerstotal."\nuptime: $uptime";
$serverlastupdate=mysql_result(mysql_query("SELECT `value`
FROM `wowsig_config`
WHERE `key` LIKE 'lastupdate'"),0);

if (time()-$serverlastupdate>$refreshrate)
{ $playersonline="Serverstatus: Offline(".formattime($serverlastupdate).")";}

imagettftext($bgpicres, $serverheadsize, 0, 170, 40, $serverheadcolor, $font[$serverheadfont], "Server Informationen:");
imagettftext($bgpicres, $servercontsize, 0, 180, 55, $servercontcolor, $font[$servercontfont], "$playersonline\n");



header('Content-type: image/png');
imagepng($bgpicres);
?>
Return current item: World of Warcraft Signature Script