Welcome code problem
2 posters
Page 1 of 1
Welcome code problem
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
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
APE
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
APE
Re: Welcome code problem
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'.
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:
$(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 : 82
Language : Dutch
Similar topics
» CSS code problem
» Problem in this code
» what is the problem in this JS code
» I have a problem in this code ..
» Problem with JS code
» Problem in this code
» what is the problem in this JS code
» I have a problem in this code ..
» Problem with JS code
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum