Results 1 to 6 of 6

Dynamic Image Tutorial - no gif crap

This is a discussion on Dynamic Image Tutorial - no gif crap within the Digital Dreams Tech forums, part of the Digital Dreams... category; so i had some people asking me how my sig works and i thought i should write a little tutorial. ...

  1. #1
    teh ownji mcfly's Avatar
    Join Date
    Sep 2004
    Location
    Germany
    Age
    29
    Posts
    1,076

    Dynamic Image Tutorial - no gif crap


    Support FSC and see no ads! - Click Here
    so i had some people asking me how my sig works and i thought i should write a little tutorial.

    a single signature was a little plain for me and *.gif was not an option because it sucks (go browse gmfs and you'll notice)

    my version will bring up a different picture with every load. press f5 several times and watch the changes to my sig:




    first you need some webspace that can handle php and altering of the .htaccess file.
    then create some pics (or choose some you already have)

    as a bonus (and because i just cant do anything in a "normal" way) i split my signature in 3 pieces. that way i can have 3 seperate hyperlinks plus there are more overall sig combinations.
    i created a template (the yellow frame) and can just put whatever picture i like in there


    now comes the tricky part.
    first create a file called ".htaccess" and paste the following into it
    [code]<Files signature.jpg>
    ForceType application/x-httpd-php
    </Files>[/code]
    this makes sure, that the file "signature.jpg" is handled as if it were a simple *.php file

    now create a file called "signature.jpg" (or whatever else you like, but alter the .htaccess file accordingly) and paste:
    [code]<?php

    $images = array(
    "./image1.jpg",
    "./image2.gif",
    "./image3.png",
    );


    //leave everything below this alone
    $images_total = count($images);
    $mictime = microtime();
    $mictime = explode(' ', $mictime);
    $mictime = $mictime[1] + $mictime[0];
    srand($mictime);

    $random = rand(0, ($images_total - 1));

    $content_type = "";

    if (strtolower(substr($images[$random], -3)) == "gif")
    {
    $content_type = "image/gif";
    } elseif (strtolower(substr($images[$random], -3)) == "png") {
    $content_type = "image/png";
    } elseif (strtolower(substr($images[$random], -3)) == "jpg" || strtolower(substr($images[$random], -4)) == "jpeg") {
    $content_type = "image/jpeg";
    } else {
    // Error...
    exit();
    }

    @header("Expires: Mon, 12 Feb 1992 12:00:00 GMT");
    @header("Cache-Control: no-cache, must-revalidate");
    @header("Pragma: no-cache");
    @header("Content-Type: ".$content_type);
    @readfile($images[$random]);
    ?>[/code]
    Insert the names of your images for "image1.jpg" and so on. You can add as many as you want (i have a lot :>).

    After that just upload in the desired online-webspace and link to the "signature.jpg" file
    img]http://your.webspace.provider/blabla/signature.jpg[/img]
    Last edited by Chuggs; 12-29-2010 at 07:58 AM. Reason: Original reference link no longer valid

  2. #2
    Negative value imo AntiBling's Avatar
    Join Date
    Sep 2002
    Location
    Fargo, ND
    Age
    30
    Posts
    7,374

    Re: Dynamic Image Tutorial - no gif crap

    Cool write up, I would say sticky material.


    ****Sig removed by staff****

  3. #3
    Sierra Crew gmccsierra's Avatar
    Join Date
    Sep 2005
    Location
    Lafayette, LA
    Age
    24
    Posts
    284

    Re: Dynamic Image Tutorial - no gif crap

    is there any place i can get free webspace that will actually work with this FTP? im too cheap to buy a domain, because all i would be using it for is a sig.

    edit: nevermind i figured it out
    Last edited by gmccsierra; 02-22-2007 at 07:34 PM.

  4. #4
    teh ownji mcfly's Avatar
    Join Date
    Sep 2004
    Location
    Germany
    Age
    29
    Posts
    1,076

    Re: Dynamic Image Tutorial - no gif crap

    Quote Originally Posted by gmccsierra
    edit: nevermind i figured it out
    sigs are looking nice

  5. #5
    Sierra Crew gmccsierra's Avatar
    Join Date
    Sep 2005
    Location
    Lafayette, LA
    Age
    24
    Posts
    284

    Re: Dynamic Image Tutorial - no gif crap

    thanks

  6. #6
    FSC Spam Sniper Chuggs's Avatar
    Join Date
    Nov 2001
    Location
    Southern Virginia
    Posts
    10,296

    Re: Dynamic Image Tutorial - no gif crap

    I thought I had responded to this thread earlier, but I guess not. Thanks for the write up, mcfly.
    If I create a signature for you, please copy it to your own photo account before applying it in your User CP. Thank you.


    Bob
    XBL: ShortBusAzClown

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
     BMW - Cadillac - Camaro - Corvette - Mercedes - Mustang - F150 - Ferrari - Lamborghini - Porsche - Ranger