Dominic Deegan Fansite
HomeFAQSearchRegisterLog in
Post new topic   Reply to topic
 

Random Forum Header

View previous topic View next topic Go down 
Goto page : 1, 2, 3, 4  Next
AuthorMessage
Maulkin
Shivering Isles Resident
Shivering Isles Resident



Joined : 26 Mar 2007
Posts : 9475

PostSubject: Random Forum Header   Fri Apr 25, 2008 9:54 am

Link sent me the following:


Quote:
This is somewhat difficult to explain, but let me try. Forgive me if I sound patronizing at any particular point, I just don't want to say anything you don't understand and lead to this becoming really confusing for you.

PHP is what we call a "server-side language," as opposed to HTML which is "Browser Side"

When code is run, first it is processed by the server, then downloaded to the computer, then processed by the browser, then displayed.

HTML doesn't get turned from code into the product of that code until the browser processes it. PHP turns from code into the product of code before the browser gets to it. What this means is that if we code some PHP to bring up an image, then we can trick the browser into thinking the PHP *IS* an image, because the code will have turned into the image before it ever reaches the browser.

THis also means that the server you are using must support PHP. It will probably tell you whether it does or not somewhere. Most servers do these days, but I don't know whether photobucket (which you're using to host the topbanner) does or not.

So what we do is put the location of the PHP file inside of an image bracket.

<*img src="http"//www.YOURSERVER.com/CODE/RANDOM.PHP">

And you'll get the random image.


Creating that PHP file is REALLY simple. All you have to do is copy and paste the code that I give you, and put it in a notepad file. Then, change the file extension to .php instead of .txt and presto chango, you have a random banner PHP file. However, there is a windows option that is enabled by default on most machines, which can fuck you over at this stage: it's called "Hide Known Filetypes."

If you don't know if this is enabled, right click on your desktop, and create a new notepad file. If the filename ends in .txt you're good, if it doesn't end in anything you *must* go to your folder options and DISABLE "hide known file types." Otherwise, adding .php to the end will do nothing, because the hidden filename will be "Whatever.php.txt"

Windows makes things so much more difficult to learn =/

So at this point, you're going to want the code to paste into the TXT file. Here it is:

Quote:

<?
$banners= scandir(banners);
$banners= array_slice($banners, 2);
shuffle($banners);
$ban= fopen("banners/$banners[0]", "r");
header("content-type: image/jpeg");
fpassthru($ban);
?>



Now, put this SOMEWHERE on your photobucket. It doesn't matter where.

Now here's the final big step, and I must remind you that filenames are important unless you want me to try and explain to you how to edit the PHP code itself.

create a folder in the same subfolder as the code. Name this folder "banners" The only thing you should put in this folder are jpg or jpeg images that you want to be displayed as topbanners.

Then, go to the place in the admin control panel where you link to the URL of the topbanner, and link to the PHP file instead. It will display a random topbanner.

Hopefully that should be sufficient. Good luck



Does anyone understand this? I'm hung up on a few parts, particularly how to upload a text document to my photobucket @_@
_________________
Spoiler:
 
Back to top Go down
r1nn
Geeky Scarf-Loving Girls On The Internet
Geeky Scarf-Loving Girls On The Internet



Age : 20
Joined : 07 Apr 2007
Posts : 3343
Location : United States

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 11:08 am

I looked over on the photobucket website, and it doesn't look like it supports PHP or text documents...
_________________
check out my art blog and devART.

Click here to feed me a Rare Candy!
Back to top Go down
Drache
Assassin Droid
Assassin Droid



Age : 24
Joined : 04 Jun 2007
Posts : 1722
Location : Aroundish...

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 11:16 am

Maul, I've been wanting to give this a try for a while. Could you direct me to all the image banners?
_________________

Spoiler:
 
Back to top Go down
Maulkin
Shivering Isles Resident
Shivering Isles Resident



Joined : 26 Mar 2007
Posts : 9475

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 11:36 am

Do you want it in URL form or picture form?
_________________
Spoiler:
 
Back to top Go down
Marsco
I Saw The Sign
I Saw The Sign



Age : 19
Joined : 07 Dec 2007
Posts : 2486
Location : 19 miles outside the windy city

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 12:57 pm

i can do this >.>
_________________
Spoiler:
 


Spoiler:
 

Spoiler:
 
Back to top Go down
Marsco
I Saw The Sign
I Saw The Sign



Age : 19
Joined : 07 Dec 2007
Posts : 2486
Location : 19 miles outside the windy city

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 1:12 pm

In fact i have it set up, i just need the imgs and i can send you the link to use in the img code.
_________________
Spoiler:
 


Spoiler:
 

Spoiler:
 
Back to top Go down
Maulkin
Shivering Isles Resident
Shivering Isles Resident



Joined : 26 Mar 2007
Posts : 9475

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 1:19 pm























































Edit: And, of course, this:



(I honestly don't know how I forgot that one >.> )
_________________
Spoiler:
 


Last edited by Maulkin on Fri Apr 25, 2008 1:28 pm; edited 1 time in total
Back to top Go down
linkskywalker
Lurker
Lurker



Age : 21
Joined : 27 Mar 2007
Posts : 2855
Location : I'm a citizen of the world

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 1:23 pm

Maulkin, you fucking son of a bitch, you forgot the most important one.




This one was 400% more likely to come up than any other banner.
_________________
"Bears have penises. They can stick it in butts."
~LS
Back to top Go down
2.72




Joined : 06 Nov 2007
Posts : 753

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 1:35 pm

*Looks at the URL of the image link just posted*

So you have your own server, and used to run the script off of it? It all makes sense now. For the record, most image-based hosting services do not allow PHP scripts.

Thanks for the help.
Back to top Go down
r1nn
Geeky Scarf-Loving Girls On The Internet
Geeky Scarf-Loving Girls On The Internet



Age : 20
Joined : 07 Apr 2007
Posts : 3343
Location : United States

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 2:15 pm

Links, you are supreme. Thank you. :D
_________________
check out my art blog and devART.

Click here to feed me a Rare Candy!
Back to top Go down
Marsco
I Saw The Sign
I Saw The Sign



Age : 19
Joined : 07 Dec 2007
Posts : 2486
Location : 19 miles outside the windy city

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 3:16 pm

ok got it working.

http://neomarsco.bravehost.com/RANDOM.php

there ya go..
_________________
Spoiler:
 


Spoiler:
 

Spoiler:
 
Back to top Go down
BladedFalcon
Professional Blade-For-Hire
Professional Blade-For-Hire



Age : 20
Joined : 27 Feb 2008
Posts : 6747
Location : Mexico

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 3:16 pm

Ooooh, Awesome work marsco, that is great!
_________________
Magello wrote:
Bladed Falcon is the black hole of grammar.


Spoiler:
 
Back to top Go down
Marsco
I Saw The Sign
I Saw The Sign



Age : 19
Joined : 07 Dec 2007
Posts : 2486
Location : 19 miles outside the windy city

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 3:24 pm

http://neomarsco.bravehost.com/RandomBanner.php

that one does the trick too...
_________________
Spoiler:
 


Spoiler:
 

Spoiler:
 
Back to top Go down
r1nn
Geeky Scarf-Loving Girls On The Internet
Geeky Scarf-Loving Girls On The Internet



Age : 20
Joined : 07 Apr 2007
Posts : 3343
Location : United States

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 4:21 pm

I demand that Marsco gets a honorable member award.
_________________
check out my art blog and devART.

Click here to feed me a Rare Candy!
Back to top Go down
Marsco
I Saw The Sign
I Saw The Sign



Age : 19
Joined : 07 Dec 2007
Posts : 2486
Location : 19 miles outside the windy city

PostSubject: Re: Random Forum Header   Fri Apr 25, 2008 4:22 pm

o_O; you're crazy. I did nothing special.
_________________
Spoiler:
 


Spoiler:
 

Spoiler:
 
Back to top Go down

Random Forum Header

View previous topic View next topic Back to top 
Page 1 of 4Goto page : 1, 2, 3, 4  Next

Permissions of this forum:You cannot reply to topics in this forum
Dominic Deegan Fansite :: Forum Upkeep :: Announcements-
Post new topic   Reply to topic