Go Back   FSC Forum > Image Gallery > Digital Dreams... > Digital Dreams Tech
User Name
Password
Register FAQ Members List Calendar Mark Forums Read

Supporting Members Don't see these ads...learn more.

Reply
 
Thread Tools Display Modes
Old 09-25-2005, 05:41 PM   #1
mcfly
teh ownji

mcfly's Avatar

Status: Offline
Join Date: Sep 2004
Member ID: 18305
Location: Germany
Age: 24
Posts: 1,102
Dynamic Image Tutorial - no gif crap
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.
click here and press F5 a couple of times



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 mcfly : 09-25-2005 at 05:41 PM.
  Reply With Quote
Old 09-25-2005, 05:48 PM   #2
AntiBling
Premium Member #55
Kenny Howard hates you

AntiBling's Avatar

Status: Offline
Join Date: Sep 2002
Member ID: 2731
Location: Fargo, ND
Age: 25
Posts: 7,107
Re: Dynamic Image Tutorial - no gif crap
Cool write up, I would say sticky material.
  Reply With Quote
Old 02-21-2007, 03:12 AM   #3
gmccsierra
Sierra Crew

gmccsierra's Avatar

Status: Offline
Join Date: Sep 2005
Member ID: 34436
Location: Lafayette, LA
Age: 19
Posts: 279
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.
  Reply With Quote
Old 02-27-2007, 12:25 AM   #4
mcfly
teh ownji

mcfly's Avatar

Status: Offline
Join Date: Sep 2004
Member ID: 18305
Location: Germany
Age: 24
Posts: 1,102
Re: Dynamic Image Tutorial - no gif crap
Quote:
Originally Posted by gmccsierra
edit: nevermind i figured it out

sigs are looking nice
  Reply With Quote
Old 02-27-2007, 03:16 PM   #5
gmccsierra
Sierra Crew

gmccsierra's Avatar

Status: Offline
Join Date: Sep 2005
Member ID: 34436
Location: Lafayette, LA
Age: 19
Posts: 279
Re: Dynamic Image Tutorial - no gif crap
thanks
  Reply With Quote
Old 02-27-2007, 09:21 PM   #6
Chuggernaut
FSC Spam Sniper

Chuggernaut's Avatar


Status: Offline
Join Date: Nov 2001
Member ID: 447
Location: Williamsport, PA
Age: 32
Posts: 8,194
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.
Now accepting pics for the 2009 FSC Calendar! Click for here for guidelines.
Click here to check on the status of your submitted pics.

  Reply With Quote
Advertisements
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 12:59 PM.


Powered by vBulletin Version 3.5.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0