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:
Locked Topic
[ C ] Separate Forum Background Images for Site Request
Topic Started: Apr 18 2013, 04:45 PM (931 Views)
Offensive Bias
Member
[ * ]
I'd like to add some forum background image to my site but do not know the javascript to do that for me. If someone were to help, it'd be great if they could post the javascript here in this thread, and tell me where to put the background image url in the script. Here's the link to my board: http://w11.zetaboards.com/Halo_Archive/index/

Thanks in advance.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
What I did was add a class to a specific page and use CSS to change the background image:
Code:
 
<script type="text/javascript">
//<![CDATA[
if (location.href.indexOf('/index') !== -1) {
$('body').addClass('index');
}
//]]>
</script>
Code:
 
body.index #inner-war {
background: url(http://z2.ifrm.com/10717/129/0/p1026532/IndexBkgd.png) fixed center 40px no-repeat;
}
Offline Profile Goto Top
 
Offensive Bias
Member
[ * ]
Now... where do I put this and how do I get an image to only show up in one Forum Section? Do I keep copying the CLASS part and add the forum section in there, along with the image?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Themes Posted Image Edit Theme Layout: Very Bottom
Code:
 
<script type="text/javascript">
//<![CDATA[
function addFID(id) {
if (location.href.indexOf('/forum/' + id) !== -1) {
$('body').addClass('f' + id);
}
}

addFID('FORUM_ID');
//]]>
</script>
Try that, change FORUM_ID. You can repeat the addFID('FORUM_ID'); line as many times as you like. Here's an example:

Forum: http://if.invisionfree.com/forum/1000326/

CSS:
Code:
 
body.f1000326 {
display: none;
}
The CSS goes in Edit Theme Appearance.
Offline Profile Goto Top
 
Offensive Bias
Member
[ * ]
Where would I put the image URL that would be displayed on the Forum Section's background?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Use the CSS in my first post, ensuring you change the class name (after the period) and the image URL.
Offline Profile Goto Top
 
Offensive Bias
Member
[ * ]
So...

This:
Quote:
 
<script type="text/javascript">
//<![CDATA[
if (location.href.indexOf('/index') !== -1) {
$('body').addClass('index');
}
//]]>
</script>
goes in Javascripts under Edit Board Template?

This:
Quote:
 
Code:

body.index #inner-war {
background: url(http://z2.ifrm.com/10717/129/0/p1026532/IndexBkgd.png) fixed center 40px no-repeat;
}


goes with this:
Quote:
 

Code:

body.f1000326 {
display: none;
}
, yes?

While This:
Quote:
 
<script type="text/javascript">
//<![CDATA[
function addFID(id) {
if (location.href.indexOf('/forum/' + id) !== -1) {
$('body').addClass('f' + id);
}
}

addFID('FORUM_ID');
//]]>
</script>

goes all the way at the bottom of Theme Layout?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code #1 and #3 was an example, they're not needed.

You are correct on Code #4.

Code #2 goes in the Edit Theme Appearance.
Offline Profile Goto Top
 
Offensive Bias
Member
[ * ]
Code #2: How do I specify which Forum Section I want to have the Background image? Would I go:

body.f318853 {
background: url(http://i791.photobucket.com/albums/yy199/DevaPath/Archive/Builder/forerunner_2__zpsdd59a253.jpg) fixed center 40px no-repeat;

}

And this would go in the CSS code in Edit Appearence?

Code #4: What do I need to do here? Change FORUM_ID to
Forum: http://w11.zetaboards.com/Halo_Archive/forum/3188533/

Yes or No?
Edited by Offensive Bias, Apr 18 2013, 10:27 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
f318853 should be f3188533.

Use this URL instead: http://i791.photobucket.com/albums/yy199/DevaPath/Archive/Builder/forerunner_2__zpsdd59a253.jpg

Change FORUM_ID to 3188533.
Offline Profile Goto Top
 
Helena
Member Avatar
M is for Mod

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic