- Code: Select all
buildNickItem_modify_nick_style: function(nickid, span)
{
// this method can be overloaded to change the nick style (color, font ...)
// example: span.style.color = 'red';
var isadmin = this.getUserMeta(nickid, 'isadmin');
if (isadmin == '') isadmin = false;
if (isadmin == true) span.style.color = "#CC0000";
else span.style.color = "#888888";
}
I could easily call this same function for the pfc_nick and/or the pfc_nickmarker spans, but when those elements are created, I do not have a nickid to pass to them, allowing me to check if the user isadmin or not. I currently have this working, but I had to hardcode in the admin names.
- Code: Select all
colorizeNicks: function(root)
{
if (this.nickmarker)
{
var nicklist = this.getElementsByClassName(root, 'pfc_nickmarker', '');
for(var i = 0; i < nicklist.length; i++)
{
var cur_nick = nicklist[i].innerHTML;
if(cur_nick == "admin1" || cur_nick == "admin2") {
var cur_color = "#CC0000";
} else {
var cur_color = "#888888";
}
//var cur_color = this.getAndAssignNickColor(cur_nick);
nicklist[i].style.color = cur_color;
}
}
}
I would like to use isadmin to determine if the user is an admin or not. Are there any easy methods to accomplish this? If I could figure out how to transports nickid to colorNicks() I could easily make the change. I have scoured the FAQ and forums looking for some leads, but nothing yet.