SMF For Free Support Forum
SMF For Free Support => SMF For Free Codes and Support => Topic started by: Agent Moose on August 14, 2007, 10:23:28 pm
-
<script>
var randbanner = []
//Created by Agent Moose (smcodes.smfforfree3.com)
randbanner[0]=["URL"]
rawr = Math.floor(Math.random()*randbanner.length)
document.write("<center><img src='" + randbanner[rawr][0] + "' /></center>")
</script>
Place it where ever you want your banners to show.
URL = the URL of the image
To add more, just add more of these lines:
randbanner[0]=["URL"]
Change the 0 to a 1, if you add another line after that, you would change the 1 to a 2.
-
Thanks, Moose, sounds cool. As soon as I can figure out what I want will give it a try.
-
can i do a directory of images instead of a specific image
-
No. You have to use the URL of the whole image.
-
k k
-
where i put this code?
-
where i put this code?
Admin > Manage Styles > Edit Header/Footer
Put it in your Header if you want it above the forum, footer if you want it below the forum.
-
do u want to put a preview plzzz.
Thanks.
-
http://randombanner.smfforfree3.com/index.php
Keep refreshing the page to see em.
The banners i just found....
-
Is there a way to make the banners clickable with this code?
-
[quote ]
Is there a way to make the banners clickable with this code?
[/quote]
Use this for each banner
randbanner[0]=["URL OF IMAGE' onclick=location.href='URL OF SITE' style='cursor: pointer"]
-
Thanks , That works.
-
thats cool
-
Forum Url: http://gemstone.smfforfree4.com/.smfforfree4.com
I looked through the list of codes, but can't figure out which one I might use to be able and place this code so that it shows in between a couple of the forums boards on the forum.
Can someone point me to how I might be able to do this... ?
-
hi tao - some scripts can be put in a Boards Description area just fine.. Ild always try it on a test forum first though and not your real forum. Mentioning that as Im not sure what you mean by "between a couple of the forums boards" If you meant in the space between Categorys I know of no way to do that.
-
If you meant in the space between Categorys I know of no way to do that.
Yes..... Categories is what I should have said.
Ok and thank you..
-
Thanks and it's center. thank you!
-
Not sure what I am missing..
Here is an example of what I am placing within my Header and nothing shows up..
<script>
var randbanner = []
//Created by Agent Moose (smcodes.smfforfree3.com)
randbanner[0]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg' onclick=location.href='http://taogem.com/taogemst_myzencart/" ' style='cursor: pointer"]
randbanner[1]=["http://farm2.static.flickr.com/1254/906421054_78113b1c8f_o.jpg' onclick=location.href='http://griffincustomopal.com/store/' style='cursor: pointer"]
randbanner[0]=["http://i517.photobucket.com/albums/u340/taogemstones/Bobs_premium_cabs-1.jpg' onclick=location.href='http://bobspremiumcabochons.com/"><' style='cursor: pointer"]
rawr = Math.floor(Math.random()*randbanner.length)
document.write("<center><img src='" + randbanner[rawr][0] + "' /></center>")
</script><p>
-
Forum Url: http://gemstone.smfforfree4.com/
I made a couple of changes after looking at the page source for the example link showing what this looks like (http://randombanner.smfforfree3.com/index.php). Added some quotation marks and also numbered the images starting with 1 instead of zero..
Still not showing up for me when I try to add it to either the header or footer.
Help ? :)
<script>
var randbanner = []
//Created by Agent Moose (smcodes.smfforfree3.com)
randbanner[1]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg" onclick=location.href="http://taogem.com/taogemst_myzencart/" ' style='cursor: pointer"]
randbanner[2]=["http://farm2.static.flickr.com/1254/906421054_78113b1c8f_o.jpg" onclick=location.href="http://griffincustomopal.com/store/' style='cursor: pointer"]
randbanner[3]=["http://i517.photobucket.com/albums/u340/taogemstones/Bobs_premium_cabs-1.jpg" onclick=location.href="http://bobspremiumcabochons.com/"><' style='cursor: pointer"]
rawr = Math.floor(Math.random()*randbanner.length)
document.write("<center><img src='" + randbanner[rawr][0] + "' /></center>")
</script><p>
-
taogem - you have it correct except you replaced some single quotes with double quotes and visa versa.
Ive corrected the code for you - this one works
<script>
var randbanner = []
//Created by Agent Moose (smcodes.smfforfree3.com)
randbanner[0]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg' onclick=location.href='http://taogem.com/taogemst_myzencart/' style='cursor: pointer"]
randbanner[1]=["http://farm2.static.flickr.com/1254/906421054_78113b1c8f_o.jpg' onclick=location.href='http://griffincustomopal.com/store/' style='cursor: pointer"]
randbanner[2]=["http://i517.photobucket.com/albums/u340/taogemstones/Bobs_premium_cabs-1.jpg' onclick=location.href='http://bobspremiumcabochons.com/' style='cursor: pointer"]
rawr = Math.floor(Math.random()*randbanner.length)
document.write("<center><img src='" + randbanner[rawr][0] + "' /></center>")
</script>
-
That did the trick !!
Thanks a bunch ! :)
-
Just one more question...
Is there a way to be able and right click on the banners so that they can be opened in a new page ?
-
Forum Url: http://gemstone.smfforfree4.com/
Another question members are asking..
Is there a way to have multiple banners show up at the same time during each page refresh ? I am hoping from within the same script rather than multiple scripts ?
Also, would still like to know if there is something that can be done about being able to right click on the banners for opening in new page.
-
hi tao ;) Unless someone else can figure out a way to tweak that code to do both things for you will have to wait on Moose to see this. Now that he is off to college we don't see him as often Im afraid.
-
Okedokey..... !
I found another script online that is letting us right click on the random banners so as to open in a new page.. :)
-
Forum Url: http://gemstone.smfforfree4.com/
I would like to know if someone can make this code so that when someone clicks on the clickable banners, a new browser will open for that banners website so that they do not leave/loose the forum page..
Even if the banner could be "right clicked" to open in new window. Even that could help..
-
Forum Url: http://gemstone.smfforfree4.com/
I would like to know if someone can make this code so that when someone clicks on the clickable banners, a new browser will open for that banners website so that they do not leave/loose the forum page..
Even if the banner could be "right clicked" to open in new window. Even that could help..
Anyone ?
Or am I posting this request in the wrong board ?
-
Instead of using this, for example:
randbanner[0]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg' onclick=location.href='http://taogem.com/taogemst_myzencart/' style='cursor: pointer"]
Try this:
randbanner[0]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg' onclick='window.open(\"http://taogem.com/taogemst_myzencart/\")' style='cursor: pointer"]
-
Thank you !