Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 9 of 9

Thread: PHP Help

  1. #1

    Default PHP Help

    Hello, i'm having a problem with a PHP code. I cba to post here it's pretty complicated!! If anyone could add my skype and try to help I would be very greatful. PM me please. It has to do with a PHP fetch image script.

  2. #2
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by IcePhreak View Post
    I cba to post here it's pretty complicated!!
    Wait, so you can't be bothered spending the little bit of time it would take to post the code, but you want someone else to spend their time helping you out?
    You couldn't even be bothered to explain the problem, or post an error message or anything?

  3. #3

    Default

    Quote Originally Posted by Trinity View Post
    Wait, so you can't be bothered spending the little bit of time it would take to post the code, but you want someone else to spend their time helping you out?
    You couldn't even be bothered to explain the problem, or post an error message or anything?
    See the thing is there is no error codes as its a fetch image script. I'll give the low down... Sorry about that.

    So I got this layout from here http://habboemotion.com/resources/fansitelayout/17/ I went and installed on my website here http://boomradio.site11.com/17/

    As you can see the Navigation, News, and Stats bars don't appear on the left. I've double checked that the image and php script are correct. This layout apparently uses a header.php to fetch the top.png

  4. #4
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by IcePhreak View Post
    See the thing is there is no error codes as its a fetch image script. I'll give the low down... Sorry about that.

    So I got this layout from here http://habboemotion.com/resources/fansitelayout/17/ I went and installed on my website here http://boomradio.site11.com/17/

    As you can see the Navigation, News, and Stats bars don't appear on the left. I've double checked that the image and php script are correct. This layout apparently uses a header.php to fetch the top.png
    It looks like you don't have the right font installed on the server. Header.php shows this error if you look at the source:
    HTML Code:
    <b>Warning</b>:  imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in <b>/home/a6506051/public_html/17/header.php</b> on line <b>7</b>

  5. #5

    Default

    Quote Originally Posted by Trinity View Post
    It looks like you don't have the right font installed on the server. Header.php shows this error if you look at the source:
    HTML Code:
    <b>Warning</b>:  imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in <b>/home/a6506051/public_html/17/header.php</b> on line <b>7</b>
    How can I fix this i have the volterb.tff in my folder...

  6. #6
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by IcePhreak View Post
    How can I fix this i have the volterb.tff in my folder...
    .tff? Shouldn't it be .ttf? Check you've not made a typo in the code or the filename, and then post header.php here.
    You could also try specifying the full path to the font file, if it's not done already.

  7. #7

    Default

    Quote Originally Posted by Trinity View Post
    .tff? Shouldn't it be .ttf? Check you've not made a typo in the code or the filename, and then post header.php here.
    You could also try specifying the full path to the font file, if it's not done already.
    Sorry, yes I did mean ttf.. lol. Here is the header code.

    PHP Code:
    <?php
    header
    ("Content-type: image/png");
    $text $_GET['t'];
    $im imagecreatefrompng("images/top.png");
    $font "volterb.ttf";
    $white imagecolorallocate($im255255255);
    imagettftext($im70914$white$font$text);
    imagepng($im);
    imagedestroy($im);
    ?>

  8. #8
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by IcePhreak View Post
    Sorry, yes I did mean ttf.. lol. Here is the header code.

    PHP Code:
    <?php
    header
    ("Content-type: image/png");
    $text $_GET['t'];
    $im imagecreatefrompng("images/top.png");
    $font "volterb.ttf";
    $white imagecolorallocate($im255255255);
    imagettftext($im70914$white$font$text);
    imagepng($im);
    imagedestroy($im);
    ?>
    Read through this: http://www.php.net/imagettftext
    Specifically this part:
    Depending on which version of the GD library PHP is using, when fontfile does not begin with a leading / then .ttf will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.
    So giving it an absolute path to the font (like $font = 'http://blablabla.com/bla/volterb.ttf') should work, if that's what's causing the problem.
    Or something like this: http://board.phpbuilder.com/showthre...1#post10332311

  9. #9

    Default

    Quote Originally Posted by Trinity View Post
    Read through this: http://www.php.net/imagettftext
    Specifically this part:


    So giving it an absolute path to the font (like $font = 'http://blablabla.com/bla/volterb.ttf') should work, if that's what's causing the problem.
    Or something like this: http://board.phpbuilder.com/showthre...1#post10332311
    I tried specifying to that and it still didn't work :/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •