Text rotation in forum signatures

Discussion in 'PHP' started by stupify, Feb 25, 2008.

  1. #1
    stupify, Feb 25, 2008 IP
  2. 00johnny

    00johnny Peon

    Messages:
    149
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    do you want to do that in your own forums? or other forums like this one?
     
    00johnny, Feb 25, 2008 IP
  3. stupify

    stupify Peon

    Messages:
    215
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    forums like this one
     
    stupify, Feb 25, 2008 IP
  4. imvain2

    imvain2 Peon

    Messages:
    218
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This actually isn't that difficult. You will need gd library for my example

    First: .htaccess
    
    RewriteRule ^showfooter.jpg showfooter.php [nc]
    
    Code (markup):
    showfooter.php (that will work for random text)
    
    	$image = imagecreatefrompng("barbg.png");
    	$black = imagecolorallocate($image, 255, 255, 255);
    	srand(time());
    	$random = (rand()%9);
    	$str = "Random Number: " . $random;
    	imagestring($image,2, 5, 2, $str, $black);
    	Header('Content-type: image/png');
    	imagepng($image);
    	imagedestroy($image);
    
    Code (markup):
    this example, just takes an image and sets it as the "background" (barbg.png), and adds some random number text.

    This is a basic example, you will need to make the random function for the text part.
     
    imvain2, Feb 25, 2008 IP
  5. stupify

    stupify Peon

    Messages:
    215
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thank you very much
     
    stupify, Feb 26, 2008 IP