Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 18 users online :: 0 Registered, 0 Hidden and 18 Guests :: 2 Bots
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
[SOLVED] Different Logo For Specific sub-forums
Page 1 of 1 • Share
I know it's possible and involves JavaScript, I was wondering if I could please have some help?
Ange's old post for portal: http://help.forumotion.com/t134043-different-logo-for-the-portal
So rather than portal, I'd like to choose a specific forum/sub-forum for the different logo. I have a couple sub-forums/forums that I'd like to change the logo for.
Ange's old post for portal: http://help.forumotion.com/t134043-different-logo-for-the-portal
So rather than portal, I'd like to choose a specific forum/sub-forum for the different logo. I have a couple sub-forums/forums that I'd like to change the logo for.
Hey,
Install the script below in the following places :
1. sub-forums
2. topics ( optional )
After this, just edit the object at the top named "image."
To the left you should see a number, that is the forum id.
To the right you should see "new_logo" that's where you'll place the logo for that forum.
So it's easier to remember :
If any problems let me know.
Install the script below in the following places :
1. sub-forums
2. topics ( optional )
- Code:
$(function() {
var image = {
1 : 'new_logo',
2 : 'new_logo',
3 : 'new_logo',
4 : 'new_logo'
},
forum = $('.pathname-box:first a:last')[0],
logo = document.getElementById('logo').firstChild,
i;
if (forum) {
forum = +forum.href.replace(/.*?f(\d+).*/, '$1');
for (i in image) {
if (i == forum) {
logo.src = image[i]
}
}
}
'par ange tuteur';
});
After this, just edit the object at the top named "image."
To the left you should see a number, that is the forum id.
To the right you should see "new_logo" that's where you'll place the logo for that forum.
So it's easier to remember :
- Code:
var image = {
forum_id : 'new_logo',
forum_id : 'new_logo',
forum_id : 'new_logo',
forum_id : 'new_logo'
},
If any problems let me know.
Thanks!
It's not working for me, here is what I added:
It's not working for me, here is what I added:
- Code:
$(function() {
var image = {
16 : 'http://i1320.photobucket.com/albums/u537/MayaGrayx3/Apparel%20designs/g11621-2-3-4.png',
34 : 'http://i1320.photobucket.com/albums/u537/MayaGrayx3/Apparel%20designs/g11621-2-3-4.png'
},
forum = $('.pathname-box:first a:last')[0],
logo = document.getElementById('logo').firstChild,
i;
if (forum) {
forum = +forum.href.replace(/.*?f(\d+).*/, '$1');
for (i in image) {
if (i == forum) {
logo.src = image[i]
}
}
}
'par ange tuteur';
});
- GuestGuest
Forumedic wrote:Thanks!
It's not working for me, here is what I added:
- Code:
$(function() {
var image = {
16 : 'http://i1320.photobucket.com/albums/u537/MayaGrayx3/Apparel%20designs/g11621-2-3-4.png',
34 : 'http://i1320.photobucket.com/albums/u537/MayaGrayx3/Apparel%20designs/g11621-2-3-4.png'
},
forum = $('.pathname-box:first a:last')[0],
logo = document.getElementById('logo').firstChild,
i;
if (forum) {
forum = +forum.href.replace(/.*?f(\d+).*/, '$1');
for (i in image) {
if (i == forum) {
logo.src = image[i]
}
}
}
'par ange tuteur';
});
LOL! Like @Ange Tuteur said, you still gotta learn a great deal,,,,,
@ the 'par ange tuteur' @Ange Tuteur!
Looks like a mistake on my part, I didn't notice that the class of the breadcrumbs changed in subforums. Try replace your script with this and see if it works for you now :
@Samantha no one can truly learn without first making mistakes..
PS
I mark certain snippets of code in case someone decides to take it and make a tutorial about it without my permission. I've seen it happen in the past with codes I posted on the help forum.
- Code:
$(function() {
var image = {
16 : 'http://i1320.photobucket.com/albums/u537/MayaGrayx3/Apparel%20designs/g11621-2-3-4.png',
34 : 'http://i1320.photobucket.com/albums/u537/MayaGrayx3/Apparel%20designs/g11621-2-3-4.png'
},
forum = $('.pathname-box:first a:last, .path:first a:last')[0],
logo = document.getElementById('logo').firstChild;
if (forum) {
forum = +forum.href.replace(/.*?f(\d+).*/, '$1');
if (image[forum]) {
logo.src = image[forum];
}
}
'par ange tuteur';
});
@Samantha no one can truly learn without first making mistakes..
PS
I mark certain snippets of code in case someone decides to take it and make a tutorial about it without my permission. I've seen it happen in the past with codes I posted on the help forum.
- GuestGuest
Ange Tuteur wrote:Looks like a mistake on my part, I didn't notice that the class of the breadcrumbs changed in subforums. Try replace your script with this and see if it works for you now :
- Code:
$(function() {
var image = {
16 : 'http://i1320.photobucket.com/albums/u537/MayaGrayx3/Apparel%20designs/g11621-2-3-4.png',
34 : 'http://i1320.photobucket.com/albums/u537/MayaGrayx3/Apparel%20designs/g11621-2-3-4.png'
},
forum = $('.pathname-box:first a:last, .path:first a:last')[0],
logo = document.getElementById('logo').firstChild;
if (forum) {
forum = +forum.href.replace(/.*?f(\d+).*/, '$1');
if (image[forum]) {
logo.src = image[forum];
}
}
'par ange tuteur';
});
@Samantha no one can truly learn without first making mistakes..
PS
I mark certain snippets of code in case someone decides to take it and make a tutorial about it without my permission. I've seen it happen in the past with codes I posted on the help forum.
About the PS part. Are you accusing me? Because if I ever did, you know how I feel about my codes getting stolen. I had a huge fight over my codes, a 'certain dude' on here and my profile pic last year and that's why I'm reluctant to show any no more yk. I feel I did nothing wrong here, but if I did just don't hold back telling me. I know the feel. Regarding your code here right now, I'm sorry, but it feels like it's all too easy to ask you for codes and do nothing in return yk. It all ends with me copycatting, grabbing, taking. yk me.
No, "someone" is denoting any random lurker on the internet who is viewing my posts. I wont name names, but I wasn't talking about you, however I'm sure the people who repost my content know I'm talking about them.
- GuestGuest
Ange Tuteur wrote:No, "someone" is denoting any random lurker on the internet who is viewing my posts. I wont name names, but I wasn't talking about you, however I'm sure the people who repost my content know I'm talking about them.
:/ Hmm.. I hate lurkers. Hence the security on my site. you! (blocking 'm in fact if it was on here ). You should protect your codes, tbh, @Ange Tuteur. They're precious!
So SHHHH silly lurkers GO AWAY!
Solved, thanks Ange.
I have one quick question, is it possible to make it faster? It could be that I have bad WiFi and I'm using iPad but when I go on the page (sub-forum or topic) I can see the original banner for a few seconds.
I have one quick question, is it possible to make it faster? It could be that I have bad WiFi and I'm using iPad but when I go on the page (sub-forum or topic) I can see the original banner for a few seconds.
No, not really. The script must wait for the document ( or target element ) to be ready before it knows which forum you're in. So there's always going to be a small delay for the banner to change since the target element comes after the banner.
If you're only targeting the sub-forums and not topics in the sub-forums you could use the window location which would be a wee bit faster. Are you applying this to the topics as well, or only the sub-forums ? If it's only the sub-forums I could speed up the execution of the script.
If you're only targeting the sub-forums and not topics in the sub-forums you could use the window location which would be a wee bit faster. Are you applying this to the topics as well, or only the sub-forums ? If it's only the sub-forums I could speed up the execution of the script.
In that case you might want to stick with the last code. However, if you do want it a little faster I can use another method. Just let me know.
Anyway, you're welcome.
Anyway, you're welcome.
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum