Thread: [PHP] Creating forum signatures

Results 1 to 7 of 7
  1. #1 [PHP] Creating forum signatures 
    Registered Member Text's Avatar
    Join Date
    Nov 2012
    Posts
    300
    Thanks given
    55
    Thanks received
    26
    Rep Power
    21
    I wrote a very short script to use imagettftext() to create forum signatures on the fly

    Here is the end result


    The code:

    Code:
    <?php
    
    $rImg = ImageCreateFromJPEG("img.jpg");
     
    $cor = imagecolorallocate($rImg, 230, 190, 120);
    $black = imagecolorallocate($rImg, 0, 0, 0);
    
    $font = './font.ttf';
    imagettftext($rImg, 11, 0, 242 - (strlen($_GET['name']) * 2), 24, $cor, $font, $_GET['name']);
    imagettftext($rImg, 10, 0, 242 - (strlen($_GET['text']) * 2), 85, $black, $font, $_GET['text']);
    
    
    header('Content-type: image/jpeg');
    imagejpeg($rImg,NULL,100);
     
    ?>
    Blank image:



    The font I used:
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    domino's manager & developer
    Peerr's Avatar
    Join Date
    Aug 2014
    Posts
    228
    Thanks given
    110
    Thanks received
    59
    Rep Power
    53
    Can't you just use Photoshop to add text to a picture? Not trying to be rude, I just don't get the idea
    Reply With Quote  
     

  3. #3  
    ???

    funkE's Avatar
    Join Date
    Feb 2008
    Posts
    2,606
    Thanks given
    242
    Thanks received
    977
    Discord
    View profile
    Rep Power
    1281
    Quote Originally Posted by Peurr View Post
    Can't you just use Photoshop to add text to a picture? Not trying to be rude, I just don't get the idea
    It's the same as stat signatures.
    .
    Reply With Quote  
     

  4. #4  
    aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa
    Planets's Avatar
    Join Date
    Aug 2014
    Age
    26
    Posts
    2,161
    Thanks given
    675
    Thanks received
    1,958
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Peurr View Post
    Can't you just use Photoshop to add text to a picture? Not trying to be rude, I just don't get the idea
    You can use it to generate things like this

    [Only registered and activated users can see links. ]

    Reply With Quote  
     

  5. #5  
    Registered Member Text's Avatar
    Join Date
    Nov 2012
    Posts
    300
    Thanks given
    55
    Thanks received
    26
    Rep Power
    21
    Quote Originally Posted by Izzz View Post
    You can use it to generate things like this

    [Only registered and activated users can see links. ]
    Exactly, it's all about creativity.
    Reply With Quote  
     

  6. #6  
    domino's manager & developer
    Peerr's Avatar
    Join Date
    Aug 2014
    Posts
    228
    Thanks given
    110
    Thanks received
    59
    Rep Power
    53
    I see, I see, my bad.
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Dec 2011
    Posts
    1,622
    Thanks given
    1,984
    Thanks received
    830
    Rep Power
    1049
    Quote Originally Posted by Peurr View Post
    Can't you just use Photoshop to add text to a picture? Not trying to be rude, I just don't get the idea
    Dynamically generated image like the one in my signature that says developer.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. allPHP - PHP Development Forums
    By booher in forum Website Development
    Replies: 8
    Last Post: 02-08-2012, 02:18 AM
  2. Forum signature
    By Traydon in forum Requests
    Replies: 5
    Last Post: 12-31-2011, 10:11 PM
  3. [PHP] BAsic PHP GD example/Signature
    By Z in forum Website Development
    Replies: 3
    Last Post: 02-05-2011, 11:46 AM
  4. [PHP] Server Status Signature [PHP]
    By Naab in forum Website Development
    Replies: 21
    Last Post: 10-22-2009, 06:54 PM
  5. [PHP] Runescape Stat Signatures
    By booher in forum Website Development
    Replies: 2
    Last Post: 08-22-2009, 06:58 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •