<?PHP
// --Script made by MrSheen. Please keep credits. -- //
//------------------------------------------------------------------------------------------------------------------- //
//--Defing the script information
$Mysql_Host = 'localhost'; //The location of your MYSQL Server
$Mysql_User = 'root'; //The Username for your MYSQL Server
$Mysql_Password = 'password'; //The Password for your MYSQL Server
$Mysql_Database = 'theforgottenserver'; //The Database name for your TFS Server
$Server_Name = 'SERVERNAME'; //The name of your server
$Server_Address = 'www.SERVERNAME.net'; //the web address or slogan for your server
$Font_File = 'arial.ttf'; //The font file for your server!
$Background_Picture = 'banner.png'; //The location of the background picture for the signature (322 x 122)
//------------------------------------------------------------------------------------------------------------------- //
//--Connecting the script to your database--
mysql_connect ( $Mysql_Host, $Mysql_User, $Mysql_Password ) or die ( 'Error connecting to the MYSQL Server.' );
mysql_select_db ( $Mysql_Database ) or die ( 'Error selecting the database.' );
//--Creating the background for the signature:
$final_image = imageCreateFromPng ( $Background_Picture );
//--Checking that you have entered a player:
if ( isset( $_GET['name'] ) ) {
//See if the player name entered is found in the datbase:
$Player_Query = mysql_query ( "SELECT * FROM `players` WHERE `name`='".$_GET['name']."'" );
if ( mysql_num_rows ( $Player_Query ) > 0 ) {
$Player_Info = mysql_fetch_array ( $Player_Query, MYSQL_ASSOC );
imagettftext($final_image, 10, 0, 10, 55, imagecolorallocate($final_image, 0, 0, 0), $Font_File, "Name: ".$Player_Info['name'] );
imagettftext($final_image, 10, 0, 11, 56, imagecolorallocate($final_image, 255, 255, 255), $Font_File, "Name: ".$Player_Info['name'] );
imagettftext($final_image, 10, 0, 10, 70, imagecolorallocate($final_image, 0, 0, 0), $Font_File, "Level: ".$Player_Info['level'] );
imagettftext($final_image, 10, 0, 11, 71, imagecolorallocate($final_image, 255, 255, 255), $Font_File, "Level: ".$Player_Info['level'] );
imagettftext($final_image, 10, 0, 10, 85, imagecolorallocate($final_image, 0, 0, 0), $Font_File, "Magic Level: ".$Player_Info['maglevel'] );
imagettftext($final_image, 10, 0, 11, 86, imagecolorallocate($final_image, 255, 255, 255), $Font_File, "Magic Level: ".$Player_Info['maglevel'] );
if ( $Player_Info['vocation'] > 0 ) {
switch ( $Player_Info['vocation'] ) {
case 1:
$Vocation = 'Sorcerer';
break;
case 2:
$Vocation = 'Druid';
break;
case 3:
$Vocation = 'Paladin';
break;
case 4:
$Vocation = 'Knight';
break;
}
imagettftext($final_image, 10, 0, 10, 100, imagecolorallocate($final_image, 0, 0, 0), $Font_File, "Vocation: " .$Vocation );
imagettftext($final_image, 10, 0, 11, 101, imagecolorallocate($final_image, 255, 255, 255), $Font_File, "Vocation: ".$Vocation );
}
} else {
imagettftext($final_image, 12, 0, 90, 90, imagecolorallocate($final_image, 0, 0, 0), $Font_File, "Character Not Found!" );
imagettftext($final_image, 12, 0, 91, 91, imagecolorallocate($final_image, 255, 255, 255), $Font_File, "Character Not Found!" );
}
} else {
imagettftext($final_image, 12, 0, 90, 90, imagecolorallocate($final_image, 0, 0, 0), $Font_File, "Character Not Found!" );
imagettftext($final_image, 12, 0, 91, 91, imagecolorallocate($final_image, 255, 255, 255), $Font_File, "Character Not Found!" );
}
imagettftext($final_image, 11, 0, 10, 20, imagecolorallocate($final_image, 0, 0, 0), $Font_File, $Server_Name );
imagettftext($final_image, 11, 0, 11, 21, imagecolorallocate($final_image, 255, 255, 255), $Font_File, $Server_Name );
imagettftext($final_image, 9, 0, 10, 32, imagecolorallocate($final_image, 0, 0, 0), $Font_File, $Server_Address );
imagettftext($final_image, 9, 0, 11, 33, imagecolorallocate($final_image, 255, 255, 255), $Font_File, $Server_Address );
//--Displaying the output of the image!
header ( "Content-type: image/png" );
imagePng ( $final_image );
?>