GFXVoid Graphic Design Forum

Remove Text Formatting
Loading...

» Online Users: 1,322

0 members and 1,322 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

Thread: Randomizing Tag

  1. #1
    Join Date
    Aug 2007
    Posts
    1,259

    Default Randomizing Tag

    I have been asked a lot how I get my tag to change all the time, so I will just post how to do it.

    First, you need to have access to a host that you can put all the tags you want within 1 folder, and it has to be able to handle PHP files.


    Create a folder that will contain all your images, and the PHP file, which you can name anything that you want. Upload all the tags you want to be randomized within it, and create a PHP file named tag.php.

    Within the PHP file, you will have to put the following code:
    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() % 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);
        }
    }

    ?>

    Now, when adding this into your signature, just use the image tags like normal, but instead of linking it to a picture, link to the php file, and add /image.jpg to the end of it to disguise it as an image file. So it will look something like:

    http://www.website.com/images/tag.php/image.jpg.


    That is all there is too it.

    Commissions and stickers available via linktree here.

  2. #2
    Join Date
    Dec 2010
    Posts
    1,145

    Default

    oh
    i thought you just had a new one like everyday LOL









  3. #3
    Join Date
    Nov 2009
    Location
    Belgium
    Posts
    358

    Default

    Lol, even though I noticed, because I always take the time to look at your work , I hadn't really thought about it.
    Just me being brainless; ooh, it changed, but I never really got to; huh, what changed?
    Thanks for sharing!



  4. #4
    Join Date
    Aug 2007
    Posts
    1,259

    Default

    I get a lot of questions about my tag, asking how it does it, if it is just me constantly putting a different one, or what, so I just thought I would be nice and post how I did it.

    Commissions and stickers available via linktree here.

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