* enabled cache http headers for signatures

* disabled fullpage plugin in tinymce
This commit is contained in:
slawkens1 2017-10-11 21:25:41 +02:00
parent 42ef8487c8
commit 92028a2492
6 changed files with 152 additions and 153 deletions

View File

@ -158,7 +158,8 @@ $config = array(
'signature_enabled' => true,
'signature_type' => 'tibian', // signature engine to use: tibian, mango, gesior
'signature_cache_time' => 5, // how long to store cached file (in minutes)
'signature_cache_time' => 5, // how long to store cached file (in minutes), default 5 minutes
'signature_browser_cache' => 60, // how long to cache by browser (in minutes), default 1 hour
// online page
'online_record' => true, // display players record?

View File

@ -3,7 +3,7 @@
tinymce.init({
selector : "textarea",
theme : "modern",
plugins: 'print preview fullpage searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help',
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat',
image_advtab: true
});

View File

@ -26,7 +26,4 @@
imagettftext($image , $fontsize, 0, 100, 95, $color, $font, (($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');
?>

View File

@ -51,4 +51,11 @@
}
require($file);
header('Content-type: image/png');
$seconds_to_cache = $config['signature_browser_cache'] * 60;
$ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
header('Expires: ' . $ts);
header('Pragma: cache');
header('Cache-Control: max-age=' . $seconds_to_cache);
readfile(SIGNATURES_CACHE . $player->getId() . '.png');
?>

View File

@ -21,8 +21,13 @@
$otb_path = SIGNATURES_DATA.'items.otb';
$background = 'default.png';
if ( file_exists( SIGNATURES_BACKGROUNDS.$background ) )
if ( !file_exists( SIGNATURES_BACKGROUNDS.$background ) )
{
header( 'Content-type: image/png' );
readfile( SIGNATURES_IMAGES . 'nobackground.png' );
exit;
}
$MadGD = new MadGD( SIGNATURES_BACKGROUNDS.$background );
$MadGD->testMode = false;
@ -161,12 +166,4 @@
}
$MadGD->save($player->getID());
header( 'Content-type: image/png' );
readfile( SIGNATURES_CACHE . $player->getId().'.png' );
}
else
{
header( 'Content-type: image/png' );
readfile( SIGNATURES_IMAGES . 'nobackground.png' );
}
?>

View File

@ -127,7 +127,4 @@
imagepng($img, SIGNATURES_CACHE . $player->getID() . '.png');
imagedestroy($img);
header('Content-type: image/png');
readfile(SIGNATURES_CACHE.$player->getId() . '.png' );
?>