• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[PHP] Character Signature - v4

NOTICE!!!
A second version is now available at the first post. It includes new features such as bold titles and hex colors instead of rgb formatting (#000000 for black, #ffffff for white, do not use 3 digits).
 
2 Things left:)

Adding something like when you generate it, it gives you a link to put it on forum, or another link to the image only :)

and the second is, making it works with Gesiors acc.
 
Why oO?? xd

signatures.php
Code:
<?PHP
//Made by Master-m

$main_content .= '<h2><center>To get a Character Signature simply write your name here and then copy the link.<p></p>
<form method="get" action="signature/signature.php">

		Name: <input name="name" type="text" value="" SIZE="20" maxlength="25" />  
	        <input type="submit" value="Create Signature" title="Create Signature" />
			</form>';
?>

signature.php(in signature folder)

Code:
<?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 );
	
?>
 
You cant change the color of the text... if you type #ffffff its still black and not white... and if you type any number or sth like #35484 its still black...
 
Sorry my bad, I rewrote a lot of the code when updating to version 2, try downloading version 2 again (updated it).
 
Nice Finaly works...

But when you edit this:
Code:
            'color'       => "#ffccff"

if does nothing... tryed alot of different colors... is there some write or wrong code to put there.....

Tryed Hexdecimal..

mabye the old color sceme thing was better?
 
Nah it should work, perhaps I just managed to mess the links up or something, hold on. Reuploading.

EDIT: Try again.
 
Ok now it works :)
And could you add now a small box after creation of the signature where the link for forums is written?? because i tried it with echo... and it simply doesnt show it :/
 
I will, not now though. ; ) For now simply wrap your link with
 
PHP:
[url="http://www.yoursite.com"][img]http://www.yoursite.com/signature.php?character=XXX&image=1[/img][/url]
 
i was wondering how you could get the script to read the players_skills and record each skill and ect..

And also.. is there a way to make the text print differently on each picture??


And i cannot see your above code
 
Back
Top Bottom