myaac/tools/signature/gesior.php
slawkens1 a177c93e97 Some big update
* added option to change character name in accountmanagement
* added automatic database updater (data migrations)
* renamed events to hooks
* moved hooks to database
* now you can use hooks in plugins
* set account.type field to 5, if TFS 1.0+
* added example plugin
* new, latest google analytics code
* fixed bug with loading account.name that has numbers in it
* fixed many bugs in player editor in admin panel
* added error handling to plugin manager and some more verification in
file has been correctly unpacked/uploaded
* fixed Statistics page in admin panel when using account.number
* fixed bug when creating/recovering account on servers with
account.salt field (TFS 0.3 for example)
* fixed forum showing thread with html tags (added from news manager)
* new, actual code for youtube videos in movies
* fixed showing vocation images when using
$config['online_vocations_images']
* many fixes in polls (also importing proper schema)
* fixed hovering on buttons in kathrine template (on accountmanagement
page)
* many fixes in signatures
* added missing gesior signature system
2017-05-11 04:13:16 +02:00

52 lines
2.0 KiB
PHP

<?php
defined('MYAAC') or die('Direct access not allowed!');
$player = $ots->createObject( 'Player' );
$player->find($_GET['name']);
if(function_exists('imagecreatefrompng'))
{
if($player->isLoaded())
{
$file = SIGNATURES_CACHE.$player->getId().'.png';
if ( file_exists( $file ) and ( time( ) < ( filemtime($file) + ( 60 * $config['signature_cache_time'] ) ) ) )
{
header( 'Content-type: image/png' );
readfile( SIGNATURES_CACHE.$player->getId().'.png' );
}
else
{
$image = imagecreatefrompng(SIGNATURES_BACKGROUNDS . 'signature.png');
$color= imagecolorallocate($image , 255, 255, 255);
imagettftext($image , 12, 0, 20, 32, $color, SIGNATURES_FONTS . 'font.ttf' , 'Name:');
imagettftext($image , 12, 0, 70, 32, $color, SIGNATURES_FONTS . 'font.ttf' , $player->getName());
imagettftext($image , 12, 0, 20, 52, $color, SIGNATURES_FONTS . 'font.ttf' , 'Level:');
imagettftext($image , 12, 0, 70, 52, $color, SIGNATURES_FONTS . 'font.ttf' , $player->getLevel() . ' ' . $config['vocations'][$player->getVocation()]);
$rank = $player->getRank();
if($rank->isLoaded())
{
imagettftext($image , 12, 0, 20, 75, $color, SIGNATURES_FONTS . 'font.ttf' , 'Guild:');
imagettftext($image , 12, 0, 70, 75, $color, SIGNATURES_FONTS . 'font.ttf' , $player->getRank()->getName() . ' of the ' . $$rank->getGuild()->getName());
}
imagettftext($image , 12, 0, 20, 95, $color, SIGNATURES_FONTS . 'font.ttf' , 'Last Login:');
imagettftext($image , 12, 0, 100, 95, $color, SIGNATURES_FONTS . 'font.ttf' , (($player->getLastLogin() > 0) ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.'));
imagepng($image, SIGNATURES_CACHE . $player->getID() . '.png');
imagedestroy($image);
header('Content-type: image/png');
readfile(SIGNATURES_CACHE . $player->getId().'.png');
}
}
else
{
header('Content-type: image/png');
readfile(SIGNATURES_IMAGES . 'nocharacter.png');
}
}
else
{
header('Content-type: image/png');
readfile(SIGNATURES_IMAGES . 'nogd.png');
}
?>