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.

Welcome code problem

View previous topic View next topic Go down

Solved Welcome code problem

Post by APE on January 10th 2016, 8:21 am

Hello all.

I have been making a widget on my forum and wanted the Username in this Code to change when the member logs in
I have got it to work but the color of the text don't match there username to the groups there in it just comes out Black

 

Code:
<div id="LGstatus1">
                                                           
    <div align="center">
                            <span style="color: rgb(102, 102, 255);"><span style="font-family: FontAwesome;"><span style="font-size: 18px; line-height: normal"> </span></span></span><strong><span style="color: #000000;"><span style="font-size: 13px;">Welcome To your Control Panel <span style="color: #ff0000;">        {USERNAME}</span></span></span> </strong>                   
    </div>

What I want is when Say Gizmo logs in the username will be red like he is in the Admin Group and say Fish Crazy logs in it will show he;s name in the Green Mods color Group

can some one tell me how to make this work so when anyone logs in there name will change to the group color's

Much thanks to anyone that can help Wink

APE





APE
Manager
Manager

Male Posts : 8636
Reputation : 756
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Welcome code problem

Post by 10spetter10 on January 10th 2016, 10:33 am

Try adding this script. It should search for the username in the 'Registered Users' list at the bottom of the index, and take the color of it to the element with id 'usernameIndexMessage'.

Code:
$(function() {
  var usernameColor = $('#fa_online_users span:contains('+_userdata.username+')').css('color');
  $('#usernameIndexMessage').css('color',usernameColor);
});

So then you need to make sure there is an element with id 'usernameIndexMessage' in here, I added the id to the span around the username:

Code:
<div id="LGstatus1">
                                                         
    <div align="center">
                            <span style="color: rgb(102, 102, 255);"><span style="font-family: FontAwesome;"><span style="font-size: 18px; line-height: normal"> </span></span></span><strong><span style="color: #000000;"><span style="font-size: 13px;">Welcome To your Control Panel <span id="usernameIndexMessage" style="color: #ff0000;">        {USERNAME}</span></span></span> </strong>                 
    </div>

10spetter10
Forumember

Posts : 195
Reputation : 81
Language : Dutch

Back to top Go down

Solved Re: Welcome code problem

Post by APE on January 10th 2016, 10:46 am

That worked like a charm thank you @10spetter10 +1 Wink





APE
Manager
Manager

Male Posts : 8636
Reputation : 756
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Welcome code problem

Post by APE on January 10th 2016, 11:27 am

Topic solved and archived





APE
Manager
Manager

Male Posts : 8636
Reputation : 756
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

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