Code: Select all
<?php
$db = mysql_connect($dbhost, $dbuname, $dbpass);
mysql_select_db($dbname, $db);
mysql_select_db("extreme_statsig",$db);
$result = mysql_query("SELECT * FROM bhdsigs WHERE pid = '33680801261'", $db);
while ($row = mysql_fetch_assoc($result))
{
extract($row);
// Set the content-type
header('Content-type: image/png');
// Create the image
$im = imagecreatefrompng ("background1.png");
// Create some colors
$red = imagecolorallocate($im, 255, 0, 0);
$black = imagecolorallocate($im, 0, 0, 0);
// The text to draw
$text[0] = "$player_name";
$text[1] = "EXP POINTS: $team_experience_points";
$text[2] = "KILLS: $total_kills";
$text[3] = "HS RATIO: $head_shot_ratio";
$text[4] = "FB LEVELS: $flag_levels";
$text[5] = "MINS PLAYED: $minutes_played";
$text[6] = "DEATHS: $deaths";
$text[7] = "BW LEVELS: 19";
$text[8] = "HEAD SHOTS: $total_head_shots";
$text[9] = "$player_rank";
$text[10] = "YELLOWS: $killed_2_for_1";
$text[11] = "RATIO: $kill_death_ratio";
$text[12] = "DM LEVELS: $dm_levels";
$text[13] = "KOTH LEVELS: $koth_levels";
// Font to use
$font = '04B_09__.TTF';
// The text size
$size[0] = 13;
$size[1] = 6;
// Add the text
imagettftext($im, $size[1], 0, 5, 27, $red, $font, $text[0]);
imagettftext($im, $size[1], 0, 5, 50, $red, $font, $text[1]);
imagettftext($im, $size[1], 0, 5, 68, $red, $font, $text[2]);
imagettftext($im, $size[1], 0, 5, 85, $red, $font, $text[3]);
imagettftext($im, $size[1], 0, 5, 103, $red, $font, $text[4]);
imagettftext($im, $size[1], 0, 122, 50, $red, $font, $text[5]);
imagettftext($im, $size[1], 0, 122, 68, $red, $font, $text[6]);
imagettftext($im, $size[1], 0, 122, 103, $red, $font, $text[7]);
imagettftext($im, $size[1], 0, 122, 85, $red, $font, $text[8]);
imagettftext($im, $size[1], 0, 237, 27, $red, $font, $text[9]);
imagettftext($im, $size[1], 0, 237, 50, $red, $font, $text[10]);
imagettftext($im, $size[1], 0, 237, 68, $red, $font, $text[11]);
imagettftext($im, $size[1], 0, 237, 85, $red, $font, $text[12]);
imagettftext($im, $size[1], 0, 237, 103, $red, $font, $text[13]);
imagepng($im, 'ozymandias.png');
imagedestroy($im);
}
?>