Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
[CODE] Change banner for specific forums
Topic Started: Jul 22 2005, 06:30 AM (15,259 Views)
Stefan
Member Avatar
Mew?
 *   *   *   *   *   *   *  
This code changes your banner when you're browsing a specific forum, also for the topics in that forum.

Quote:
 
<script type='text/javascript'>
// Banners for specific forums
// by Stefan
forumBanners = []

// add banners for forums here
// use this format
// forumBanners['forum<forum#>'] = 'banner URL'
forumBanners['forum#1'] = 'URL of banner 1'
forumBanners['forum#2'] = 'URL of banner 2'


// don't edit after this line
e = document.getElementById('navstrip')
bnr = null
if (e) {
l = e.getElementsByTagName('A')
bnr = null
for (n = 0; n < l.length; n++) {
if (l[n].href.match(/[&?]showforum=(\d+)/) || l[n].href.match(/[&?]f=(\d+)/)) {
bnr = forumBanners['forum'+RegExp.$1]
}}
if (bnr) {
e = document.getElementById('logostrip')
im = e.getElementsByTagName('img')
if (im && im.length) {
im[0].src = bnr
} else {
im = new Image()
im.src = bnr
e.insertBefore(im, e.firstChild)
}}}
</script>

Put it in Admin CP->Board Wrappers->Header & Body, after <% NAVIGATION %>

Banners for forums are added ad the bold part, using this format:

forumBanners['forum##'] = 'URL of banner'

where ## is the forum number, the number after showforum= in the address bar when you view the topic list.
And replace the green with your banner URL.
You can add more than one banner, simply place another line like the one above at the bold part.

Preview
Offline Profile Quote Post Goto Top
 
Das
Member Avatar
Smells of rich mahogany
 *   *   *   *   *   *   *  
Very nice. Couldn't you aslo replace all 'forum's with 'topic's, and have a different banner per topic?
Offline Profile Quote Post Goto Top
 
Vaux
Member Avatar
^^^^^^^^^^
 *   *   *  
Very Cool. Im definitly going to use this code.
Offline Profile Quote Post Goto Top
 
DJ Aragorn
Member
 *  
could you change this for categories? so it applies to catgories and all forums and topics?
Offline Profile Quote Post Goto Top
 
Lil_Santito
Member Avatar
Owner of Pokémon Fantasy and a Webmaster!
 *   *  
It ain't workin' on mine...

Edit : I guess you have to wait for tha image to load... Nice code!
Offline Profile Quote Post Goto Top
 
carlofan
Member
 *   *  
I try this code for my site but it is not working :(
Offline Profile Quote Post Goto Top
 
copycat136
Member Avatar
Copy Copy Copy
 *   *  
very very very very nice code!
Offline Profile Quote Post Goto Top
 
carlofan
Member
 *   *  
copycat136
July 28, 2005 10:28 AM
very very very very nice code!

how do you do it? i've been trying for days now and i got nada :(
Offline Profile Quote Post Goto Top
 
HighFrequency
Member
 *  
I need this code so bad!! I put it in place, did everything right, but no banners, it isn't working for me. plz help.
Offline Profile Quote Post Goto Top
 
Massacre
Member Avatar
Member
 *   *   *   *  
Same here:(
Offline Profile Quote Post Goto Top
 
Stefan
Member Avatar
Mew?
 *   *   *   *   *   *   *  
If you ever experience problems with a code, a link to your board would help a lot.
Offline Profile Quote Post Goto Top
 
_Cree_
T-minus 5.4.3.2.1.0.-1.-2 *boom* ok i was near enough!
 *   *  
Could it be used for topics, Ryan fans code never worked for me, perhaps yours will?
Offline Profile Quote Post Goto Top
 
floppylover
Member
 *  
Does this work for skins as well?
Offline Profile Quote Post Goto Top
 
Ravmaster100
Unregistered

DJ Aragorn
July 22, 2005 05:59 PM
could you change this for categories? so it applies to catgories and all forums and topics?

exactly wht i wnt
Quote Post Goto Top
 
themikado
Member
 *   *  
Hi guys, done all of the above and double checked for any mistakes, but can't get any change. Any tips?
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Code Snippets · Next Topic »
Add Reply