• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

AAC Please Help Myaac headline.php

dervin13

Active Member
Joined
Apr 26, 2008
Messages
459
Solutions
1
Reaction score
28
I changed my xampp version to new one and the headline isnt work anymore, the img dont show... I already tried everything

Anyone know what could be? If it need any extension?

If I try to open it in chrome it shows The image cannot be displayed because it contains errors.

Code:
<?php
//require '../../common.php';

//$text = $_GET['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
    putenv('GDFONTPATH=' . __DIR__);

    // create image
    $image = imagecreatetruecolor(250, 28);

    // make the background transparent
    imagecolortransparent($image, imagecolorallocate($image, 0, 0, 0));

    // set text
    imagettftext($image, 18, 0, 4, 20, imagecolorallocate($image, 240, 209, 164), 'martel.ttf', utf8_decode($_GET['t']));

    // header mime type
    header('Content-type: image/gif');

    // save image
    imagegif($image/*, $file*/);
//}

// output image
//header('Content-type: image/gif');
//readfile($file);
?>

thanks
 
After hours of trying I discovery this simple error, I dont know why in php 5.5 this work and in php 7 doesnt work... but who want to fix need to make just a change in this line

DIR . '/martel.ttf'
Code:
    imagettftext($image, 18, 0, 4, 20, ImageColorAllocate($image, 240, 209, 164), __DIR__ . '/martel.ttf', utf8_decode($_GET['t']));
 
Back
Top