![]() |
|
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read | ||||||||||
|
Supporting Members Don't see these ads...learn more. |
||||||||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
teh ownji
Status: Offline
Join Date: Sep 2004
Member ID: 18305
Pics: My Gallery
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. |
|
|
|
#2 |
|
Premium Member #55
Kenny Howard hates you
Status:
Online
Join Date: Sep 2002
Member ID: 2731
Pics: My Gallery
Location: Fargo, ND
Age: 25
Posts: 7,106
|
Re: Dynamic Image Tutorial - no gif crap
Cool write up, I would say sticky material.
|
|
|
|
#3 |
|
Sierra Crew
Status: Offline
Join Date: Sep 2005
Member ID: 34436
Pics: My Gallery
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. |
|
|
|
#4 | |
|
teh ownji
Status: Offline
Join Date: Sep 2004
Member ID: 18305
Pics: My Gallery
Location: Germany
Age: 24
Posts: 1,102
|
Re: Dynamic Image Tutorial - no gif crap
Quote:
sigs are looking nice ![]() |
|
|
|
|
#5 |
|
Sierra Crew
Status: Offline
Join Date: Sep 2005
Member ID: 34436
Pics: My Gallery
Location: Lafayette, LA
Age: 19
Posts: 279
|
Re: Dynamic Image Tutorial - no gif crap
thanks
|
|
|
|
#6 |
|
FSC Spam Sniper
Status: Offline
Join Date: Nov 2001
Member ID: 447
Pics: My Gallery
Location: Williamsport, PA
Age: 32
Posts: 8,180
|
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.
![]()
|
|
| Advertisements |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|