• 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 API

Your thread tag sounds very cool... j0j "mangoapi"...

And, excellent work. :)
 
Nice code, but I thinking about it:
PHP:
global $GDPreviousPositions;
Why are you using globals? I think better way is to use $GDPreviousPositions as a public variable of MadGD because if you create two signatures in one code you'll access that same global $GDPreviousPositions; for both.

Try to hand over MadGB pointer to childrens( MadGDIcon/MadGDText ) instead $object. Then set $object and $GDPreviousPositions as public property in MadGD.

ex. use:
PHP:
//MadGBText
public function __construct($parent, $text, $color, $font, $shadow)
{
$this->parent = $parent;
instead of:
PHP:
public function __construct($object, $text, $color, $font, $shadow)
{
$this->object = $object;

And access for $object property:
PHP:
$this->parent->object;
or $GDPreviousPositions:
PHP:
$this->parent->GDPreviousPositions;

I think you know what about I'm talking. Sorry for my bad english ;)
 
Your thread tag sounds very cool... j0j "mangoapi"...

And, excellent work. :)
Thank you. The reason I used mangoapi was to be able to track all my released API in one simple search (without having to bump into others).
OtLand - Threads Tagged with mangoapi

Great work. It would be so useful:thumbup:
++rep
Thank you.

Nice code, but I thinking about it:
PHP:
global $GDPreviousPositions;
Why are you using globals? I think better way is to use $GDPreviousPositions as a public variable of MadGD because if you create two signatures in one code you'll access that same global $GDPreviousPositions; for both.

Try to hand over MadGB pointer to childrens( MadGDIcon/MadGDText ) instead $object. Then set $object and $GDPreviousPositions as public property in MadGD.

ex. use:
PHP:
//MadGBText
public function __construct($parent, $text, $color, $font, $shadow)
{
$this->parent = $parent;
instead of:
PHP:
public function __construct($object, $text, $color, $font, $shadow)
{
$this->object = $object;
And access for $object property:
PHP:
$this->parent->object;
or $GDPreviousPositions:
PHP:
$this->parent->GDPreviousPositions;
I think you know what about I'm talking. Sorry for my bad english ;)
Yeah, I completely understand your points, the thing is that the script wasn't this advanced at first. I made a few adjustments whilst working on it and the previous positions was one of them. Being made quickly to enhance the experience. But yeah, I totally get your points and I will fix them as soon as I get the time for it.

Thank you for pointing them out!
 
can you talk my about how i can lunch this script for MySql whether i must white for end this script when by get parameters from mysql
 
Last edited:
Whats up, why does not work I defined styled?
And the second question is how to set the size of the image?
Because I want to do something with the signature of my php code:

Code:
 <div id="gracz_pasek_zycia"> <img src="images/pasek_zielony.png" border="0" height="10" width="'.$pasek_hp.'" /> <img src = "images / empty.png "border =" 0 "height =" 10 "width ="'.$ pasek_hp1. '" /> </ div>

Please help fast. Sorry that maim English: P
 
Oh, sorry about that. When I rewrote the entire class, I also removed the string keys of the style.
PHP:
$styled = array(
    'font' => 'arial.ttf',
    'size' => 8,
    'color' => '#AAFFFF',
    'shadow' => false
);
Should actually be
PHP:
$styled = array(
    'arial.ttf',
    8,
    'AAFFFF',
    false
);
At least for now, I might re-add the string keys to make it easier for you guys.

To set the size of your image, is simply to increase/decrease it in Adobe Photoshop (or any other photo editing tools). The class will automatically read the size of the image.
 
Good work, but needs to define it:
src="images/pasek_zielony.png" <img border="0" height="10" width="'.$pasek_hp.'" />
Because he wants to put there hp bar, etc..
 
I felt that your request was necessary if we were ever to reach total perfection, therefore I decided to add it.

PHP:
$MadGD = new MadGD;
$MadGD->setBackground( 'myBackground.png' );
$MadGD->addIcon( 'healthbar.png', 10, 10 )->setPosition( 10, 10 );
$MadGD->display( );
The first parameter is of course the name of the image, second one is the desired width, and third is the desired height.

To create a working health bar you would have to fetch the current health of the user from the database.
PHP:
$MadGD = new MadGD;
$MadGD->setBackground( 'myBackground.png' );
$MadGD->addIcon( 'healthbar.png', ( $row['health'] / $row['maxhealth'] ) * 100 )->setPosition( 10, 10 );
$MadGD->display( );
NOTICE! You must download the latest version of the class from my website and override your current one.

EDIT:
What is also worth mentioning is that I re-added the string keys for the styled text fonts. Please excuse me for making you change them earlier, but you would have to change them back for them to work properly.
 
Last edited:
I am thrilled it worked out for you :- )
 
Sorry for the additional post, but I had to fix a few minor things, please update once again!

EDIT: Quality issue solved.
 
Last edited:
The new Signature API code for Gesior will be released by me or AbsMango as soon as we finish the tests
 
Back
Top