GFXVoid Graphic Design Forum

Remove Text Formatting
Loading...

» Online Users: 4,198

0 members and 4,198 guests
No Members online

» Site Navigation

 > FAQ

» Stats

Members: 35,443
Threads: 103,072
Posts: 826,684
Top Poster: cc.RadillacVIII (7,429)
Welcome to our newest member, Lekelindids
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Posts
    1,259

    Default How to get your signature to randomize.

    I do not know where to put this, so I will stash it here for now. I have been asked a lot on how I get my signature to randomize like it does, so I will tell you.

    First - You need access to a web server with PHP support. This is where you will put all the signatures, and the PHP file to have it all randomize. Upload your images into a folder that will be your randomizing set. [Example - website.com/signature]

    Second - Create a PHP file with any name you want, I just went with a simple "image.php" And uploaded it to the folder than images images are in. [Only have images you want randomized in this folder.]

    Third - The following code is what should be in the PHP file.
    PHP Code:
    <?php

        $folder 
    '.';
        
    $extList = array();
        
    $extList['gif'] = 'image/gif';
        
    $extList['jpg'] = 'image/jpeg';
        
    $extList['jpeg'] = 'image/jpeg';
        
    $extList['png'] = 'image/png';

    $img null;

    if (
    substr($folder,-1) != '/') {
        
    $folder $folder.'/';
    }

    if (isset(
    $_GET['img'])) {
        
    $imageInfo pathinfo($_GET['img']);
        if (
            isset( 
    $extListstrtolower$imageInfo['extension'] ) ] ) &&
            
    file_exists$folder.$imageInfo['basename'] )
        ) {
            
    $img $folder.$imageInfo['basename'];
        }
    } else {
        
    $fileList = array();
        
    $handle opendir($folder);
        while ( 
    false !== ( $file readdir($handle) ) ) {
            
    $file_info pathinfo($file);
            if (
                isset( 
    $extListstrtolower$file_info['extension'] ) ] )
            ) {
                
    $fileList[] = $file;
            }
        }
        
    closedir($handle);

        if (
    count($fileList) > 0) {
            
    $imageNumber time() &#37; count($fileList);
            
    $img $folder.$fileList[$imageNumber];
        }
    }

    if (
    $img!=null) {
        
    $imageInfo pathinfo($img);
        
    $contentType 'Content-type: '.$extList$imageInfo['extension'] ];
        
    header ($contentType);
        
    readfile($img);
    } else {
        if ( 
    function_exists('imagecreate') ) {
            
    header ("Content-type: image/png");
            
    $im = @imagecreate (100100)
                or die (
    "Cannot initialize new GD image stream");
            
    $background_color imagecolorallocate ($im255255255);
            
    $text_color imagecolorallocate ($im0,0,0);
            
    imagestring ($im255,  "IMAGE ERROR"$text_color);
            
    imagepng ($im);
            
    imagedestroy($im);
        }
    }

    ?>
    Forth - Now that the PHP file is done, and all the images are uploaded, how to put this in your signature. Under Signature, put the image tags, and inside of that put the link to the PHP file, as if it was an image.

    example -
    HTML Code:
    [IMG]http://www.website.com/signature/image.php[/IMG]
    And you are done. If this is on a website that doesn't allow PHP in a signature like this, just add "/image.jpg" to the end to disguise it as a normal JPEG picture.

    example -
    HTML Code:
    [IMG]http://www.website.com/signature/image.php/image.jpg[/IMG]

    Commissions and stickers available via linktree here.

  2. #2
    Join Date
    Jul 2008
    Location
    Vancity, Canada
    Posts
    2,985

    Default

    YES!! OMG thank you so much, I have been wondering how to do this ever since I saw yours. I'll give this a shot, although I'm not great at coding/webserver stuff.
    Quote Originally Posted by MarkPancake View Post
    MarkPancake banned.
    Success.

  3. #3
    Join Date
    Sep 2008
    Location
    Australia
    Posts
    2,310

    Default

    Awesome! That is So Cool. Do you have any suggestions for websites or servers that may allow you to do this?

    If I give is a shot, I may be coming back for help every now and then. Been years since I did some of the advanced coding.

  4. #4
    Join Date
    Feb 2008
    Location
    Toronto, Canada
    Posts
    4,831

    Default

    thnx alot pet






Similar Threads

  1. New Signature
    By Apathy in forum Sigs & Manips
    Replies: 1
    Last Post: 02-02-2007, 05:46 AM
  2. New Signature
    By Freak in forum Sigs & Manips
    Replies: 8
    Last Post: 09-05-2005, 05:18 PM
  3. Signature?
    By Nightfire in forum Sigs & Manips
    Replies: 9
    Last Post: 09-03-2005, 03:21 PM
  4. ==.Cat Signature.==
    By Lokiwho in forum Sigs & Manips
    Replies: 2
    Last Post: 09-02-2005, 12:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1