Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

you.php

Options
  • 03-10-2008 10:02pm
    #1
    Subscribers Posts: 9,716 ✭✭✭


    Here's the (somewhat remedial) code for you.php if anyone wants to muck around with it on their own forums, or play with the concept, whateva.

    I just cobbled it together from various tutorials anyway :)
    So a few lines of it may not even be necessary.

    [php]
    <?php
    require("./global.php");
    require("./init.php");
    global $db;

    $username = $vbulletin->userinfo;
    if ($username == "") $username = "Stranger";

    // Set the content-type
    header("Content-type: image/png");

    // Create the image, make wide enough to render most usernames accurately
    $im = imagecreatetruecolor(150, 10);
    imageSaveAlpha($im, true);

    $transparentColor = imagecolorallocatealpha($im, 200, 200, 200, 127);
    imagefill($im, 0, 0, $transparentColor);

    // Create some colors
    $black = imagecolorallocate($im, 0, 0, 0);


    // The text to draw, put to uppercase because lowercase loses the bottom of p, q, y, etc.
    $text = strtoupper($username) . "!";
    // Replace path by your own font path
    $font = './verdana.ttf';

    // Add the text
    imagettftext($im, 10, 0, 0, 10, $black, $font, $text);

    // Using imagepng() results in clearer text compared with imagejpeg()
    imagepng($im);
    imagedestroy($im);
    ?>
    [/php]


Comments

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.

Advertisement