Random logo in header.

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Random logo in header.
Donovan
CZ Active Member
 Codezwiz Site Donator
Donovan has been a member for over 20 year's 20 Year Member
usa.gif ohio.gif
Occupation: Web Developer
Gender: Male
Fav. Sports Team: St Louis Cardinals
Status: Offline
Joined: Dec 03, 2003
0.02 posts per day
Posts: 160
Points: 9,216
   
I am looking for a random logo javascript I can use to select a different logo when the page is refreshed.

I have probably 4-5 logos now and want to use them on my site.



Back to top Reply with quote
#2   re: Random logo in header.
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
[ Register or login to view links on this board. ]




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Random logo in header.
Donovan
CZ Active Member
 Codezwiz Site Donator
Donovan has been a member for over 20 year's 20 Year Member
usa.gif ohio.gif
Occupation: Web Developer
Gender: Male
Fav. Sports Team: St Louis Cardinals
Status: Offline
Joined: Dec 03, 2003
0.02 posts per day
Posts: 160
Points: 9,216
   
How do I reference the js in the header?

Is it best to save the code as a javascript file and reference it externaly?

Or paste the code into the header.

I would show an example but this site wont let me. It keeps telling me
The html tags you attempted to use are not allowed.



Back to top Reply with quote
#4   re: Random logo in header.
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.48 posts per day
Posts: 3765
Points: 351,412
   
If the code, you're trying to display has the script tag in it, you won't be able post it here. It's a security thing. UNLESS you get creative. icon_wink.gif

Try typing the script tag like this: < s c r i p t >. It will work for display purposes.

Anyway, to call a .js file into your page use this code:

< s c r i p t type='text/javascript' src='FILENAME_HERE.js'></s c r i p t>


Paste it into the header or wherever you need it to pull the contents of the .js file into your page. Don't forget to take out the spaces in the word script (both tags) and make sure you change the name of the .js file.

Kelly


Back to top Reply with quote
#5   re: Random logo in header.
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.48 posts per day
Posts: 3765
Points: 351,412
   
I have a PHP Random Image script if you're interested. I've used it on several commercial sites I've done. Works great!!

If you want it, let me know and I'll post it here.

Kelly



Back to top Reply with quote
#6   Re: re: Random logo in header.
Donovan
CZ Active Member
 Codezwiz Site Donator
Donovan has been a member for over 20 year's 20 Year Member
usa.gif ohio.gif
Occupation: Web Developer
Gender: Male
Fav. Sports Team: St Louis Cardinals
Status: Offline
Joined: Dec 03, 2003
0.02 posts per day
Posts: 160
Points: 9,216
   


Originally posted by Kelly_Hero:

I have a PHP Random Image script if you're interested. I've used it on several commercial sites I've done. Works great!!

If you want it, let me know and I'll post it here.

Kelly


Please do. That way I can try both and at least get one of them to work. icon_smile.gif



Back to top Reply with quote
#7   re: Random logo in header.
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.48 posts per day
Posts: 3765
Points: 351,412
   
Here it is:

To use, just upload your images to a directory on your server and then edit image.php to call the images from that directory and upload it to the server as well. You'll be changing the $dir variable. Then, in the header, or wherever you're wanting to display the images, use a include to call image.php. Like this:

<?php include "image.php"; ?>


Let me know if you have any problems getting it installed.

Kelly


Attached Files
randimage.zip (984 Bytes, Downloaded: 5238 Time(s))


Back to top Reply with quote
#8   re: Random logo in header.
Donovan
CZ Active Member
 Codezwiz Site Donator
Donovan has been a member for over 20 year's 20 Year Member
usa.gif ohio.gif
Occupation: Web Developer
Gender: Male
Fav. Sports Team: St Louis Cardinals
Status: Offline
Joined: Dec 03, 2003
0.02 posts per day
Posts: 160
Points: 9,216
   
I don't think I am calling the image.php correctly. Here is the original lines from the header. How do I insert <?php include "image.php"; ?>

[code]<tr>
<td width="100%"><a href="index.php"><center><img src="themes/3rdID_Chronicles/images/logo1.gif" border="0" alt="Welcome to $sitename"></center></a></td>
</tr>
[\code]



Back to top Reply with quote
#9   re: Random logo in header.
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.48 posts per day
Posts: 3765
Points: 351,412
   
Try this:

<tr>
<td width="100%" align="center"><a href="index.php"><?php include "image.php"; ?></a></td>
</tr>


I'm not sure if the link will work or not, but you can try. The link may have to be written into the image.php file.

Kelly


Back to top Reply with quote
#10   re: Random logo in header.
GoddsEgo
PayPal Donation
CZ Moderator
Status: Offline
Joined: Jun 26, 2003
0.15 posts per day
Posts: 1211
Points: 69,166
 Yahoo Messenger  
Hi Don


Kewl site don wish i knew php am trying to start learning but it all looks greek so far lol



i do know of a simple script for randomly displaying graphic images if you can't get the php thingy to work


whats great about this script is that u can use it as many times on u'r page as u want and add as many pics as u want to it by just adding or subtracting line 6

you can also add demention tags (width='192' height='100') to line if need be

you can take link ref out to it just displays pic without link


you just paste scriipt in body where you want pic (or banner as in case)



heres a league page that i have been adding more and more pics to so that each time page is loaded the pic changes

[ Register or login to view links on this board. ]


Rob



Attached Files
randombanner.txt (601 Bytes, Downloaded: 5240 Time(s))


Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum