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 ] Diff banners for diff forums - enhancement
Topic Started: Jul 25 2012, 11:59 AM (844 Views)
tobeme
Member Avatar
Member
[ *  * ]
Following the codes posted by Reid on "Individual Banners for each forum; By .Scott http://resources.zetaboards.com/topic/5079003/1/#new , my understanding is that I have to set up the banner for the forum index page in "Edit Themes Setting". The codes provided by Scott only work for banners for different forums.

The issue (or it is just my site) with the above setup is that the banner for the index page will always load first, follow by the banner for the specific forum. In other words, two banners will load when a forum page is open. This slows down the loading significantly and it is also strange to see the index banner appears and replaced by the forum banner.

Is it possible to include the index page directly in the codes (which doesn't have the forum number) rather than having it set up in the "Edit Themes Setting"? Also, I hope my banner appears in the center of the page.

Thanks
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
function addLogo(forumID, imageURL) {
var indexImageURL = 'IMAGE_URL';

if (!$('#nav a[href*="/forum/' + forumID + '"]').length || location.href.indexOf('/forum/' + forumID + '') !== 1) $('#logo a').html('<img src="' + indexImageURL + '" alt="Logo" />');

if ($('#nav a[href*="/forum/' + forumID + '"]').length || location.href.indexOf('/forum/' + forumID + '') !== -1) $('#logo a').html('<img src="' + imageURL + '" alt="Logo" />');
}

addLogo('FORUM_ID', 'IMAGE_URL');
</script>
Try that, edit FORUM_ID and IMAGE_URL (the first one near the top of the script is the global logo) as necessary and you may repeat the addLogo line to add more forum-specific logos.
Offline Profile Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
Hi Cory

I'm a bit confused. Do you mean I should first remove the codes in "Edit Themes Setting" entirely and put my global banner in the following code:

function addLogo(forumID, imageURL) {
var indexImageURL = 'IMAGE_URL';

Where can I find the forum ID for the index page? There is no forum number there.

After the above, I should enter the respective forum ID and URL in the following for the forums.

addLogo('FORUM_ID', 'IMAGE_URL');
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
var indexImageURL = 'IMAGE_URL';
Code:
 
addLogo('FORUM_ID', 'IMAGE_URL');
The capitalized text selections is what can be replaced. The whole addLogo line found above can be repeated to add more forum-specific logos. The IMAGE_URL for the indexImageURL line is the image URL that the logo will be everywhere else across the board, it doesn't need an ID.
Offline Profile Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
Thanks Cory. Your help is highly appreciated!
The codes don't work. I just want to double confirm that I don't need to put any codes in "Edit Theme Setting", right?

These are my codes based on the above:

<script type="text/javascript">
function addLogo(forumID, imageURL) {
var indexImageURL = ‘http://www.wallacehuo.info/photos/i-4NhHDxR/0/X3/i-4NhHDxR-X3.png’;

if (!$('#nav a[href*="/forum/' + forumID + '"]').length || location.href.indexOf('/forum/' + forumID + '') !== 1) $('#logo a').html('<img src="' + indexImageURL + '" alt="Logo" />');

if ($('#nav a[href*="/forum/' + forumID + '"]').length || location.href.indexOf('/forum/' + forumID + '') !== -1) $('#logo a').html('<img src="' + imageURL + '" alt="Logo" />');
}

addLogo (‘3371638’, ’http://www.wallacehuo.info/photos/i-vMMgDhq/0/X3/i-vMMgDhq-X3.png’);
addLogo (‘3385556’,’http://www.wallacehuo.info/photos/i-vMMgDhq/0/X3/i-vMMgDhq-X3.png’);
addLogo (‘3371642’,’http://www.wallacehuo.info/photos/i-vMMgDhq/0/X3/i-vMMgDhq-X3.png’);
addLogo (‘3371641’,’http://www.wallacehuo.info/photos/i-vMMgDhq/0/X3/i-vMMgDhq-X3.png’);

</script>

PS: I'm temporary using the "ban" codes at the moment.
Edited by tobeme, Jul 27 2012, 03:53 AM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Yes, that's right, nothing should be in the Edit Theme Settings Logo box. Sorry for not answering that before.

Try this instead:
Code:
 
<script type="text/javascript">
function addLogo(forumID, imageURL) {
var indexImageURL = 'http://www.wallacehuo.info/photos/i-4NhHDxR/0/X3/i-4NhHDxR-X3.png';

if (!$('#nav a[href*="/forum/' + forumID + '"]').length || location.href.indexOf('/forum/' + forumID + '') !== 1) $('#logo a').html('<img src="' + indexImageURL + '" alt="Logo" />');

if ($('#nav a[href*="/forum/' + forumID + '"]').length || location.href.indexOf('/forum/' + forumID + '') !== -1) $('#logo a').html('<img src="' + imageURL + '" alt="Logo" />');
}

addLogo('3371638', 'http://www.wallacehuo.info/photos/i-vMMgDhq/0/X3/i-vMMgDhq-X3.png');
addLogo('3385556', 'http://www.wallacehuo.info/photos/i-vMMgDhq/0/X3/i-vMMgDhq-X3.png');
addLogo('3371642', 'http://www.wallacehuo.info/photos/i-vMMgDhq/0/X3/i-vMMgDhq-X3.png');
addLogo('3371641', 'http://www.wallacehuo.info/photos/i-vMMgDhq/0/X3/i-vMMgDhq-X3.png');
</script>
You were using Microsoft Word-styled apostrophe's, or something.
Offline Profile Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
I replaced with your codes above, however, the global banner takes over the forums as well (in other words all the forums show the same global banner instead of their respective banners).

Thanks
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I don't see the code on your board.
Offline Profile Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
Sorry Cory. Since it didn't work I started using the old codes on a temporary basis.

Also, my site requires the banner appearing in the center. Right now I'm using this <center>xxx</center> in the "theme setting" to force the banners to the center. If I remove the banner from the theme setting, what codes do I need to change so that all banners will appear in the center?

Thanks for your help.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Center the logo for all themes:

Admin CP Posted Image Themes Posted Image Board Template Posted Image Javascripts
Code:
 
<style type="text/css">
#logo {
text-align: center;
}
</style>
Center the logo for one theme:

Admin CP Posted Image Themes Posted Image Themes Posted Image Edit Theme Appearance
Code:
 
#logo {
text-align: center;
}
Offline Profile Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
Hi Cory, I have put the new banner codes onto my site (www.wallacehou.info). For some reasons only the index banner is shown. The rest of the banners (for the forums) are not showing.

BTW - thank you for the "banners moved to the center" codes!
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
$('#logo a').html('<img src="http://www.wallacehuo.info/photos/i-9B4xb7b/0/X3/i-9B4xb7b-X3.png" alt="Logo" />');

function addLogo(forumID, imageURL) {
if ($('#nav a[href*="/forum/' + forumID + '"]').length || location.href.indexOf('/forum/' + forumID + '') !== -1) $('#logo a').html('<img src="' + imageURL + '" alt="Logo" />');
}

addLogo('3371638', 'http://www.wallacehuo.info/photos/i-bDLZWNs/0/X3/i-bDLZWNs-X3.png');
addLogo('3385556', 'http://www.wallacehuo.info/photos/i-bDLZWNs/0/X3/i-bDLZWNs-X3.png');
addLogo('3371642', 'http://www.wallacehuo.info/photos/i-bDLZWNs/0/X3/i-bDLZWNs-X3.png');
addLogo('3371641', 'http://www.wallacehuo.info/photos/i-bDLZWNs/0/X3/i-bDLZWNs-X3.png');

addLogo('3370599', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3370606', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3370610', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3375674', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3370619', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3371320', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3371324', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3371325', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3371326', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3371328', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3371332', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378317', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378319', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378321', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378322', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378323', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378324', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378325', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378327', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378329', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378331', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378333', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378334', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3378337', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');
addLogo('3371641', 'http://www.wallacehuo.info/photos/i-wtCGc4H/0/X3/i-wtCGc4H-X3.png');

addLogo('3370294', 'http://www.wallacehuo.info/photos/i-Xh9QLWb/0/X3/i-Xh9QLWb-X3.png');
addLogo('3375550', 'http://www.wallacehuo.info/photos/i-Xh9QLWb/0/X3/i-Xh9QLWb-X3.png');
addLogo('3375635', 'http://www.wallacehuo.info/photos/i-Xh9QLWb/0/X3/i-Xh9QLWb-X3.png');
addLogo('3370588', 'http://www.wallacehuo.info/photos/i-Xh9QLWb/0/X3/i-Xh9QLWb-X3.png');
addLogo('3371317', 'http://www.wallacehuo.info/photos/i-Xh9QLWb/0/X3/i-Xh9QLWb-X3.png');
addLogo('3375558', 'http://www.wallacehuo.info/photos/i-Xh9QLWb/0/X3/i-Xh9QLWb-X3.png');
addLogo('3371318', 'http://www.wallacehuo.info/photos/i-Xh9QLWb/0/X3/i-Xh9QLWb-X3.png');

addLogo('3376830', 'http://www.wallacehuo.info/photos/i-8vS4mwt/0/X3/i-8vS4mwt-X3.png');
addLogo('3376883', 'http://www.wallacehuo.info/photos/i-8vS4mwt/0/X3/i-8vS4mwt-X3.png');
addLogo('3385071', 'http://www.wallacehuo.info/photos/i-8vS4mwt/0/X3/i-8vS4mwt-X3.png');

addLogo('3385495', 'http://www.wallacehuo.info/photos/i-8bGMmBT/0/X3/i-8bGMmBT-X3.png');
addLogo('3375576', 'http://www.wallacehuo.info/photos/i-8bGMmBT/0/X3/i-8bGMmBT-X3.png');
</script>
Try that instead.
Offline Profile Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
Marvelous! Worked like a charm. Thank you very much Cory!
Offline Profile Goto Top
 
Steve
Member Avatar
patriot
[ *  *  *  *  *  *  *  *  *  * ]
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