(former) (new problem) Avatar missing in member list (code issue)
3 posters
Page 1 of 1
(former) (new problem) Avatar missing in member list (code issue)
[Former issue: Individual Username Colors: Status: solved]
[New Issue: code issue removing avatar from memberlist due to username color code]
[defunct: I was wondering if it was possible to edit individual usernames by coloring them without adding them to a group.
If there's some sort of code or something, please let me know. ]
[edit] With the help of some friendly people, I have figured out how to change individual user-name colors but, in applying the respected code to the forum, it has removed the avatar from my memberlist.
This is not particularly urgent as I could easily remove the code but I choose not to as I'm using a test forum.
If any of you know a "fix" for this it would be greatly appreciated.
[New Issue: code issue removing avatar from memberlist due to username color code]
[defunct: I was wondering if it was possible to edit individual usernames by coloring them without adding them to a group.
If there's some sort of code or something, please let me know. ]
[edit] With the help of some friendly people, I have figured out how to change individual user-name colors but, in applying the respected code to the forum, it has removed the avatar from my memberlist.
This is not particularly urgent as I could easily remove the code but I choose not to as I'm using a test forum.
If any of you know a "fix" for this it would be greatly appreciated.
Last edited by Global Federation on July 23rd 2015, 7:55 am; edited 1 time in total
Re: (former) (new problem) Avatar missing in member list (code issue)
Anyone going to deal with the ad-bot?
Re: (former) (new problem) Avatar missing in member list (code issue)
Hi @Global Federation,
You can find an answer in this topic, or this one.
If none of those match what you're looking for, just let me know.
You can find an answer in this topic, or this one.
If none of those match what you're looking for, just let me know.
When ever a staff member is online they will ban the bots. However, only certain members can moderate a section, so sometimes they need to wait until a member gets on who can move the spam elsewhere. If you feel the need, you can report the post to staff.Global Federation wrote:Anyone going to deal with the ad-bot?
Re: (former) (new problem) Avatar missing in member list (code issue)
Alright, will do!
I'm wondering however if this could be used to color just one username and if this will affect group coloring in anyway or vice versa.
- Code:
$(function() {
var users = {
'u1' : '<span style="color:red">MY</span> <span style="color:blue">NAME</span>',
'u2' : '<span style="color:purple">ANOTHER</span> <span style="color:pink">NAME</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k;
for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});
I'm wondering however if this could be used to color just one username and if this will affect group coloring in anyway or vice versa.
Re: (former) (new problem) Avatar missing in member list (code issue)
Yes, it can be used for one name as long as you only include one property in the object. ( e.g. keep u1's line and remove u2's line. )
It will affect group coloring as once the script finds an element that matches the conditions it will overwrite that element's HTML with the HTML you specified. The element in question is a link which matches your user id.
- Code:
$(function() {
var users = {
'u1' : '<span style="color:red">MY</span> <span style="color:blue">NAME</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k;
for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});
It will affect group coloring as once the script finds an element that matches the conditions it will overwrite that element's HTML with the HTML you specified. The element in question is a link which matches your user id.
Re: (former) (new problem) Avatar missing in member list (code issue)
Where would I place it?
And would I have to update this every-time someone changes their username?
And would I have to update this every-time someone changes their username?
Re: (former) (new problem) Avatar missing in member list (code issue)
Hi
You would have to place them in Javascript Management < In all pages.
And yes, unfortunately you have to change, else the name appearing won't appear the same to the one they changed it.
Regards,
Pizza Boi
You would have to place them in Javascript Management < In all pages.
And yes, unfortunately you have to change, else the name appearing won't appear the same to the one they changed it.
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: (former) (new problem) Avatar missing in member list (code issue)
Thank you guys for all your help, however, I'm having trouble setting it up, could you show me how the fields have to be filled?
[edit] I'm sorry I couldn't thank two people. I was seeing if I could.
[edit] I'm sorry I couldn't thank two people. I was seeing if I could.
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: (former) (new problem) Avatar missing in member list (code issue)
Thank you, but I meant the fields within the script. I'm not one for knowledge based on code. xD
Re: (former) (new problem) Avatar missing in member list (code issue)
Hi
I marked them in red boxes http://prntscr.com/7v4dmx
You can change the u1 to any username value and the other box with style. See how My has a </span> after? It means that you can start changing the 2nd name when the second <span> starts. As for <span style="color: red;">, you can change red to any hexadecimal value for the colors (You can google the values).
Regards,
Pizza Boi
I marked them in red boxes http://prntscr.com/7v4dmx
You can change the u1 to any username value and the other box with style. See how My has a </span> after? It means that you can start changing the 2nd name when the second <span> starts. As for <span style="color: red;">, you can change red to any hexadecimal value for the colors (You can google the values).
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: (former) (new problem) Avatar missing in member list (code issue)
- Code:
$(function() {
var users = {
'Saleena' : '<span style="color:red">Saleena</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k;
for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});
Am I doing this right or do I have to have the second span bracket for it to work. I'm trying to influence one username.
Re: (former) (new problem) Avatar missing in member list (code issue)
Hi
You have to re-write it as this:
As for the one <span> tag, that's okay. Also, see this: /u# of Saleena. You have to change that to Saleena's user #. You can find out by clicking the user's profile and check your address bar for this: http://prntscr.com/7v4k9p
Regards,
Pizza Boi
You have to re-write it as this:
- Code:
$(function() {
var users = {
'/u# of Saleena' : '<span style="color:red">Saleena</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k;
for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});
As for the one <span> tag, that's okay. Also, see this: /u# of Saleena. You have to change that to Saleena's user #. You can find out by clicking the user's profile and check your address bar for this: http://prntscr.com/7v4k9p
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: (former) (new problem) Avatar missing in member list (code issue)
- Code:
$(function() {
var users = {
'/u6' : '<span style="color:red">Saleena</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k;
for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});
Okay, do i have to have "u6" like it is? I've tried multiple variations and nothing so far has worked.
Re: (former) (new problem) Avatar missing in member list (code issue)
Hi
Oh sorry, remove / from it. My apologies; however it should work now.
Regards,
Pizza Boi
Oh sorry, remove / from it. My apologies; however it should work now.
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: (former) (new problem) Avatar missing in member list (code issue)
Thank you so much, it worked, however it removed the avatar from my memberlist.
Re: (former) (new problem) Avatar missing in member list (code issue)
Hi
o.O" oh wow... I apologize but I know nothing of that now.
Regards,
Pizza Boi
o.O" oh wow... I apologize but I know nothing of that now.
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: (former) (new problem) Avatar missing in member list (code issue)
Hmm, alright, thanks much!
Hopefully someone will come around who does.
Hopefully someone will come around who does.
Re: (former) (new problem) Avatar missing in member list (code issue)
My first post now explains my problem if anyone of you is able to help.
Re: (former) (new problem) Avatar missing in member list (code issue)
Hi @Global Federation,
I apologize for the late reply, but see if this works for you :
Just replace your currently existing script.
I apologize for the late reply, but see if this works for you :
- Code:
$(function() {
var users = {
'u6' : '<span style="color:red">Saleena</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k, img;
for (; i<j; i++) {
for (k in users) {
if ($(a[i]).attr('href') == ('/' + k).toLowerCase()) {
img = null;
if (a[i].getElementsByTagName('IMG')[0]) {
img = document.createElement('IMG');
img.src = a[i].getElementsByTagName('IMG')[0].src;
}
a[i].innerHTML = users[k];
img && a[i].insertBefore(img, a[i].firstChild);
}
}
}
});
Just replace your currently existing script.
Similar topics
» Problem with member of the month javascript code
» problem with code Remove messages of a member
» Help with member list.
» help in member list
» Member's list glitch?
» problem with code Remove messages of a member
» Help with member list.
» help in member list
» Member's list glitch?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum