The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Username in color problem

View previous topic View next topic Go down

Solved Username in color problem

Post by BlackScorpion on August 23rd 2014, 4:00 am

This was working fine until i touched something in the group management panel, went back and redid it over and it still does not work.

http://help.forumotion.com/t129844-username-in-multiple-colors

Now it doesn't work, were their any changes made to the Javascript or the editor that could have changed something and make it stop working?

this is the script i'm using:

$(function(){
$('a[href="/uXXX]').not(function(){return $("img",this)[0]}).html('<strong><font color="#000000">Go</font><font color="#ff9600">Power</font><font color="#0000">Sports</font></strong>');
});

http://gokartbazaar.com

Thanks


Last edited by BlackScorpion on August 24th 2014, 3:32 am; edited 1 time in total

BlackScorpion
Graphic Designer
Graphic Designer

Male Posts : 4451
Reputation : 651
Language : English
Location : USA

http://help.forumotion.com

Back to top Go down

Solved Re: Username in color problem

Post by Ange Tuteur on August 23rd 2014, 5:43 am

Hi BlackScorpion,

From the code it looks like you're missing a double quote in a[href=""]. I made it more simple to edit though. Smile

Write : multiColor(id, html);

id : The user id of the member you wish to modify
html : The replacement HTML

Here is the code with one setup :
Code:
$(function(){
 multiColor(733, '<strong><font color="#000000">Go</font><font color="#ff9600">Power</font><font color="#0000">Sports</font></strong>'); // member username
 
 function multiColor(id, html){$('a[href="/u'+id+'"]').not(function(){return $("img",this)[0]}).html(html)}
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Username in color problem

Post by BlackScorpion on August 24th 2014, 2:58 am

this would replace the current javascript, correct? I would enter the members id here[href="/u'+id+'"] such as[href="/u'+u1+'"]

S can you provide me an example say for me "BlackScorpion ID u1"
thanks for the help Ange

BlackScorpion
Graphic Designer
Graphic Designer

Male Posts : 4451
Reputation : 651
Language : English
Location : USA

http://help.forumotion.com

Back to top Go down

Solved Re: Username in color problem

Post by Ange Tuteur on August 24th 2014, 3:13 am

Yep, it'll replace your current script. +id+is data passed through the multiColor() function.

So it's more simple and takes less space up, you can just copy and paste :
Code:
multiColor(733, '<strong><font color="#000000">Go</font><font color="#ff9600">Power</font><font color="#0000">Sports</font></strong>');

After the first multicolored username, to color another user. Just fill out the fields :

733 => new user id
old html => new html

Here, I added you as the first color :
Code:
$(function(){
multiColor(1, '<strong><font color="#000000">Black</font><font color="#ff9600">Scorpion</font></strong>'); // BlackScorpion
multiColor(733, '<strong><font color="#000000">Go</font><font color="#ff9600">Power</font><font color="#0000">Sports</font></strong>'); // GoPowerSports

function multiColor(id, html){$('a[href="/u'+id+'"]').not(function(){return $("img",this)[0]}).html(html)}
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Username in color problem

Post by BlackScorpion on August 24th 2014, 3:31 am

Got it now much easier.. Thanks Your the best. Now maybe you can update the tutorialWink. Just kidding!

BlackScorpion
Graphic Designer
Graphic Designer

Male Posts : 4451
Reputation : 651
Language : English
Location : USA

http://help.forumotion.com

Back to top Go down

Solved Re: Username in color problem

Post by Ange Tuteur on August 24th 2014, 3:37 am

You're welcome BlackScorpion. Smile

Topic archived

You are right, I'll most likely update the tuto with this code since it is easier. Wink

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum