- Joined
- Aug 11, 2008
- Messages
- 2,628
- Solutions
- 2
- Reaction score
- 240
Hey guys.
I'm certain that some of you are using my old signature script, and some of you may also be aware of the fact that I improved the API a lot and released it in the Web development Resources department. What I did not do, however, is a finished product for Gesiors AAC. Hence, this topic.
Why should we use the improved signatures over the previous ones?
For several reasons, to be honest. In this new version, you will be able to disable the signature for every single character. If you wish to use the signature however, you may still disable certain parts of it (showing health/mana/experience bars and showing equipments are not required). You may also change the background. All of this can be accessed and altered through the account management page.
If, lets say, a character posses a helmet which you have no image of - the script will automatically attempt to create it and store it within the images folder. This may cause a bit of extra time for the signature to be loaded, but not to fear! This would only happen the first time the item was created, and eventually all (most, at least) of the lag would disappear.
Okay, sounds valid. Now how do I install it?
Well.. first of all I would like to add that you should always keep the data files (located within the data/ folder) up to date. Which are the Tibia.spr, Tibia.dat and items.otb files. Those files are required to make the image creation script properly function.
That being said, you may carry on by following these steps.
Step 1:
Download and extract the .RAR package within your htdocs/www folder (it is strongly advisable to remove the old signature system before installing the new one).
Step 2:
Go to your phpMyAdmin (or any other tool that you may be using) and access your main database. Run this piece of code:
Step 3:
Open up your accountmanagement.php file and locate this line:
Below it, paste this:
Now, locate this line a few lines further down.
Below it, paste this:
Yet again, a few more lines further down you will find these lines:
Replace them with:
Step 4:
Open up your characters.php file, and find this line:
Below it, paste this:
That should be it, if I managed to miss anything or you just can't get it to work - please let me know!
If you're wondering why there's a picture of a bag inside the items folder, that is due to the simple fact that the item creator did not succeed in creating a bag for some odd reason I have yet to discover. If, you would encounter the same issue with another sprite, just download the sprite from tibia wikia and override the existing black image in your items folder.
DOWNLOAD: Signature.rar
PREVIEW:
PS. I did not create the sprite creation script, NMagus did. What is worth mentioning though, is that I rewrote the entire script to clean it up a bit, and also added some slight modifications to it, to support the usage of it within my GD API etc.
I'm certain that some of you are using my old signature script, and some of you may also be aware of the fact that I improved the API a lot and released it in the Web development Resources department. What I did not do, however, is a finished product for Gesiors AAC. Hence, this topic.
Why should we use the improved signatures over the previous ones?
For several reasons, to be honest. In this new version, you will be able to disable the signature for every single character. If you wish to use the signature however, you may still disable certain parts of it (showing health/mana/experience bars and showing equipments are not required). You may also change the background. All of this can be accessed and altered through the account management page.
If, lets say, a character posses a helmet which you have no image of - the script will automatically attempt to create it and store it within the images folder. This may cause a bit of extra time for the signature to be loaded, but not to fear! This would only happen the first time the item was created, and eventually all (most, at least) of the lag would disappear.
Okay, sounds valid. Now how do I install it?
Well.. first of all I would like to add that you should always keep the data files (located within the data/ folder) up to date. Which are the Tibia.spr, Tibia.dat and items.otb files. Those files are required to make the image creation script properly function.
That being said, you may carry on by following these steps.
Step 1:
Download and extract the .RAR package within your htdocs/www folder (it is strongly advisable to remove the old signature system before installing the new one).
Step 2:
Go to your phpMyAdmin (or any other tool that you may be using) and access your main database. Run this piece of code:
Code:
ALTER TABLE `players` ADD `madphp_signature` TINYINT( 4 ) NOT NULL DEFAULT '1' COMMENT 'Absolute Mango © MadPHP.org', ADD `madphp_signature_bg` VARCHAR( 50 ) NOT NULL COMMENT 'Absolute Mango © MadPHP.org' AFTER `madphp_signature`, ADD `madphp_signature_eqs` TINYINT( 4 ) NOT NULL DEFAULT '0' COMMENT 'Absolute Mango © MadPHP.org' AFTER `madphp_signature_bg`, ADD `madphp_signature_bars` TINYINT( 4 ) NOT NULL DEFAULT '1' COMMENT 'Absolute Mango © MadPHP.org' AFTER `madphp_signature_eqs`, ADD `madphp_signature_cache` INT( 11 ) NOT NULL COMMENT 'Absolute Mango © MadPHP.org' AFTER `madphp_signature_bars`;
Open up your accountmanagement.php file and locate this line:
PHP:
$new_hideacc = (int) $_POST['accountvisible'];
PHP:
// MadPHP.org Signature
$madphp_signature = (int) $_POST['madphp_signature'];
$madphp_signature_bg = htmlspecialchars(stripslashes(trim( $_POST['madphp_signature_bg'] )));
$madphp_signature_bars = (int) $_POST['madphp_signature_bars'];
$madphp_signature_eqs = (int) $_POST['madphp_signature_eqs'];
// MadPHP.org Signature
PHP:
$player->setCustomField("comment", $new_comment);
PHP:
// MadPHP.org Signature
$player->setCustomField( 'madphp_signature', $madphp_signature );
if ( $madphp_signature == 1 ) {
$player->setCustomField( 'madphp_signature_bg', $madphp_signature_bg );
$player->setCustomField( 'madphp_signature_bars', $madphp_signature_bars );
$player->setCustomField( 'madphp_signature_eqs', $madphp_signature_eqs );
}
// MadPHP.org Signature
PHP:
$main_content .= 'Here you can see and edit the information about your character.<br/>If you do not want to specify a certain field, just leave it blank.<br/><br/><form action="?subtopic=accountmanagement&action=changecomment" method="post" ><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Edit Character Information</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td class="LabelV" >Name:</td><td style="width:80%;" >'.$player_name.'</td></tr><tr><td class="LabelV" >Hide Account:</td><td>';
if($player->getCustomField("hide_char") == 1) {
$main_content .= '<input type="checkbox" name="accountvisible" value="1" checked="checked">';
}
else
{
$main_content .= '<input type="checkbox" name="accountvisible" value="1" >';
}
$main_content .= ' check to hide your account information</td></tr> </table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td class="LabelV" ><span >Comment:</span></td><td style="width:80%;" ><textarea name="comment" rows="10" cols="50" wrap="virtual" >'.$player->getCustomField("comment").'</textarea><br>[max. length: 2000 chars, 50 lines (ENTERs)]</td></tr> </table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div></div></div></td></tr></td></tr> </table> </div> </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="name" value="'.$player->getName().'"><input type="hidden" name="changecommentsave" value="1"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
PHP:
$main_content .= 'Here you can see and edit the information about your character.<br/>If you do not want to specify a certain field, just leave it blank.<br/><br/><form action="?subtopic=accountmanagement&action=changecomment" method="post" ><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Edit Character Information</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td class="LabelV" >Name:</td><td style="width:80%;" >'.$player_name.'</td></tr><tr><td class="LabelV" >Hide Account:</td><td>';
if($player->getCustomField("hide_char") == 1) {
$main_content .= '<input type="checkbox" name="accountvisible" value="1" checked="checked">';
}
else
{
$main_content .= '<input type="checkbox" name="accountvisible" value="1" >';
}
$main_content .= ' check to hide your account information</td></tr>';
$main_content .= '</table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div>';
// MadPHP.org Signature
$main_content .= '<div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" >';
$main_content .= '<tr><td class="LabelV">Enable Signature</td><td style="width:80%;">';
$main_content .= '<input type="checkbox" id="madphp_signature" name="madphp_signature" value="1"'.( $player->getCustomField( 'madphp_signature' ) == 1 ? ' checked="checked"' : null ).' /> untick to disable the signature of this character</td></tr>';
$main_content .= '<tr><td class="LabelV">Background</td><td style="width:80%;">';
$main_content .= '<select name="madphp_signature_bg">';
foreach( scandir( 'signatures/backgrounds/' ) as $background )
{
if ( !in_array( $background, array( '.', '..' ) ) )
{
$extension = end( explode( '.', $background ) );
if ( in_array( strtolower( $extension ), array ( 'png', 'jpeg', 'jpg', 'gif' ) ) )
{
$main_content .= '<option value="'.strtolower( $background ).'"'.( $player->getCustomField( 'madphp_signature_bg' ) == strtolower( $background ) ? ' selected="selected"' : null ).'>'.ucwords( $background ).'</option>';
}
}
}
$main_content .= '</select> pick the background you prefer the most</td></tr>';
$main_content .= '<tr><td class="LabelV">Hide Bars</td><td style="width:80%;">';
$main_content .= '<input type="checkbox" id="madphp_signature_bars" name="madphp_signature_bars" value="1"'.( $player->getCustomField( 'madphp_signature_bars' ) == 1 ? ' checked="checked"' : null ).' /> tick to hide the information bars</td></tr>';
$main_content .= '<tr><td class="LabelV">Hide Equipments</td><td style="width:80%;">';
$main_content .= '<input type="checkbox" id="madphp_signature_eqs" name="madphp_signature_eqs" value="1"'.( $player->getCustomField( 'madphp_signature_eqs' ) == 1 ? ' checked="checked"' : null ).' /> tick to hide the equipments</td></tr>';
// MadPHP.org Signature
$main_content .= '</table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div>';
$main_content .= '<div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td class="LabelV" ><span >Comment:</span></td><td style="width:80%;" ><textarea name="comment" rows="10" cols="50" wrap="virtual" >'.$player->getCustomField("comment").'</textarea><br>[max. length: 2000 chars, 50 lines (ENTERs)]</td></tr> </table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div></div></div></td></tr></td></tr> </table> </div> </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="name" value="'.$player->getName().'"><input type="hidden" name="changecommentsave" value="1"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
Open up your characters.php file, and find this line:
PHP:
if(!empty($comment))
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>';
}
}
PHP:
// MadPHP.org Signature
if ( $player->getCustomField( 'madphp_signature' ) == 1 )
{
$main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Signature</B></TD></TR>';
$main_content .= "<TR BGCOLOR=".$config['site']['darkborder']."><TD WIDTH=20%>Forum Link:</TD><TD><input type='text' size='75' onclick='this.select();' value='[url=\"http://" . $_SERVER['HTTP_HOST'] . "\"][IMG]http://" . $_SERVER['HTTP_HOST'] . "/signature.php?character=" .$player->getName(). "[/IMG][/url]' /></TD></TR>";
$main_content .= "<TR BGCOLOR=".$config['site']['lightborder']."><TD WIDTH=20%>Direct Link:</TD><TD><input type='text' size='75' onclick='this.select();' value='http://" . $_SERVER['HTTP_HOST'] . "/signature.php?character=" .$player->getName(). "' /></TD></TR>";
$main_content .= "<TR BGCOLOR=".$config['site']['darkborder']."><TD COLSPAN='2' style='text-align: center;'><img src='signature.php?character=" .$player->getName(). "' alt='' /></TD></TR>";
$main_content .= '</TD></TR></TABLE>';
}
// MadPHP.org Signature
If you're wondering why there's a picture of a bag inside the items folder, that is due to the simple fact that the item creator did not succeed in creating a bag for some odd reason I have yet to discover. If, you would encounter the same issue with another sprite, just download the sprite from tibia wikia and override the existing black image in your items folder.
DOWNLOAD: Signature.rar
PREVIEW:
PS. I did not create the sprite creation script, NMagus did. What is worth mentioning though, is that I rewrote the entire script to clean it up a bit, and also added some slight modifications to it, to support the usage of it within my GD API etc.
Last edited: