mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
Fix headling.php cannot find font
This commit is contained in:
parent
71f7bb2e75
commit
3d73de13d8
@ -1,21 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
//require '../../common.php';
|
$text = $_GET['t'];
|
||||||
|
if(strlen($text) > 100) // max limit
|
||||||
//$text = $_GET['text'];
|
$text = '';
|
||||||
/*
|
|
||||||
$page_file = BASE . 'pages/' . PAGE . '.php';
|
|
||||||
if(!@file_exists($page_file))
|
|
||||||
{
|
|
||||||
$page_file = BASE . 'pages/custom/' . PAGE . '.php';
|
|
||||||
if(!@file_exists($page_file))
|
|
||||||
die('Page does not exists.');
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//$file = 'images/header/headline-' . PAGE . '.gif';
|
|
||||||
//if(!file_exists($file))
|
|
||||||
//{
|
|
||||||
if(strlen($_GET['t']) > 100) // max limit
|
|
||||||
$_GET['t'] = '';
|
|
||||||
|
|
||||||
// set font path
|
// set font path
|
||||||
putenv('GDFONTPATH=' . __DIR__);
|
putenv('GDFONTPATH=' . __DIR__);
|
||||||
@ -27,16 +13,11 @@ if(!@file_exists($page_file))
|
|||||||
imagecolortransparent($image, imagecolorallocate($image, 0, 0, 0));
|
imagecolortransparent($image, imagecolorallocate($image, 0, 0, 0));
|
||||||
|
|
||||||
// set text
|
// set text
|
||||||
imagettftext($image, 18, 0, 4, 20, imagecolorallocate($image, 240, 209, 164), 'martel.ttf', utf8_decode($_GET['t']));
|
$font = getenv('GDFONTPATH') . DIRECTORY_SEPARATOR . 'martel.ttf';
|
||||||
|
imagettftext($image, 18, 0, 4, 20, imagecolorallocate($image, 240, 209, 164), $font, utf8_decode($text));
|
||||||
|
|
||||||
// header mime type
|
// header mime type
|
||||||
header('Content-type: image/gif');
|
header('Content-type: image/gif');
|
||||||
|
|
||||||
// save image
|
// output image to browser
|
||||||
imagegif($image/*, $file*/);
|
imagegif($image);
|
||||||
//}
|
|
||||||
|
|
||||||
// output image
|
|
||||||
//header('Content-type: image/gif');
|
|
||||||
//readfile($file);
|
|
||||||
?>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user