Post by ialex on May 24, 2008 23:46:57 GMT -8
This code will change the colour of posts by staff members. Edit the red text at the top of the code with the colour that you want staff member's posts to be.
Global Footer.
Cross Browser.
<script type="text/javascript">
<!--
/*Highlight Posts by Staff - By iAlex - Open Source*/
var iHigh_Staff={
iHighlight_Colour: "00FF00", //Background Colour of staff posts
iMeans_That: /^group(1|2|3)$/,
iThey_Do_Not: function(){
if(window.location.href.match(/action=(display|(user)?recent|calendarview|pmview)/) || window.location.href.match(/index.cgi$/) && (document.postForm||document.title.match(/\s-\sSearch/))){
this.iSpend_Much();
}
},
iSpend_Much: function(){
var iTime_Online=document.getElementsByTagName('td');
var iBecause=iTime_Online.length-1;
do{
if(iTime_Online.item(iBecause).width=="20%" && iTime_Online.item(iBecause).vAlign=="top" && iTime_Online.item(iBecause).align=="left" && iTime_Online.item(iBecause).className.match(/windowbg(2)?/) && iTime_Online.item(iBecause).getElementsByTagName('b').item(0) && iTime_Online.item(iBecause).getElementsByTagName('b').item(0).firstChild.className.match(this.iMeans_That)){
var iThey_Are=iTime_Online.item(iBecause).parentNode.getElementsByTagName('td');
var iEating=iThey_Are.length-1;
do{
iThey_Are.item(iEating).style.backgroundColor=this.iHighlight_Colour;
iEating--;
}
while(iEating>=0);
}
iBecause--;
}
while(iBecause>6);
}
};
iHigh_Staff.iThey_Do_Not();
//-->
</script>
Global Footer.
Cross Browser.
<script type="text/javascript">
<!--
/*Highlight Posts by Staff - By iAlex - Open Source*/
var iHigh_Staff={
iHighlight_Colour: "00FF00", //Background Colour of staff posts
iMeans_That: /^group(1|2|3)$/,
iThey_Do_Not: function(){
if(window.location.href.match(/action=(display|(user)?recent|calendarview|pmview)/) || window.location.href.match(/index.cgi$/) && (document.postForm||document.title.match(/\s-\sSearch/))){
this.iSpend_Much();
}
},
iSpend_Much: function(){
var iTime_Online=document.getElementsByTagName('td');
var iBecause=iTime_Online.length-1;
do{
if(iTime_Online.item(iBecause).width=="20%" && iTime_Online.item(iBecause).vAlign=="top" && iTime_Online.item(iBecause).align=="left" && iTime_Online.item(iBecause).className.match(/windowbg(2)?/) && iTime_Online.item(iBecause).getElementsByTagName('b').item(0) && iTime_Online.item(iBecause).getElementsByTagName('b').item(0).firstChild.className.match(this.iMeans_That)){
var iThey_Are=iTime_Online.item(iBecause).parentNode.getElementsByTagName('td');
var iEating=iThey_Are.length-1;
do{
iThey_Are.item(iEating).style.backgroundColor=this.iHighlight_Colour;
iEating--;
}
while(iEating>=0);
}
iBecause--;
}
while(iBecause>6);
}
};
iHigh_Staff.iThey_Do_Not();
//-->
</script>