Post by SubDevo on Jul 20, 2010 1:28:11 GMT -8
Hide Post Count from Non-Staff by SubDevo
Tested in IE, FF, Opera, Safari and Chrome.
This was done as a request. Maybe you will find a use for it! ;D
This code hides the text "Posts:" and the post count in the mini-profile, profile page and the Member List page.
Optionally remove the "Top Posters" link on the Member List page.
Any user names listed in the code will be able to see the post count.
Enjoy!!!
SubDevo
Variables: Edit the Maroon portions.
var fStaff=/^(admin|staff1)$/i // Usernames allowed to see post count.
Just add the user names (NOT display names) that are allowed to see the post count.
Separate each name with a "|". Do NOT put a "|" after the last name!
var remTop=1; // Remove Top Posters Link? 1=Yes, 0=No
1= Remove the "Top Posters" link on the Member List page.
0= Leave it alone!
If set to 1, the link will not be removed for the users listed in fStaff above.
Location: Global Footer
BELOW any RPG/Money codes etc... These codes looks for the word "Posts:"
ABOVE your mini-profile mod code (if using one).
<script type="text/javascript">
/* Hide Post Count from Non-Staff by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var fStaff=/^(admin|staff1)$/i; // users allowed to see post count.
var remTop=1; // Remove Top Posters Link? 1=Yes, 0=No
if(!fStaff.test(pb_username)){
var tr=document.getElementsByTagName("tr"),a,n,i,x=-1,b="Posts:";
if(/(calendar|pm|pre)view|viewprofile|search2|display/i.test(pb_action)){
while(tr[++x]){ n=tr[x].firstChild;
if(n&&n.width=="20%"&&n.innerHTML.indexOf(b)!=-1){
n.innerHTML=n.innerHTML.replace(/posts:(.+)<br\s?\/?>/i,"");
if(pb_action=="viewprofile"){n=n.nextSibling.getElementsByTagName("tr");i=-1;
while(n[++i]){if(n.innerHTML.indexOf(b)!=-1){ n.style.display="none"; break;}}
}}}}
if(pb_action=="members"){ n=document.getElementsByTagName("table"); i=x=-1;
while(n[++x]){a=n[x];
if(a.border==0&&a.cellPadding==4&&a.innerHTML.indexOf("action=members")!=-1){
a=a.rows; b=n[x].getElementsByTagName("a");
if(remTop){ while(b[++i]){ if(/view=top$/i.test(b.href)){
b.style.display="none"; b.parentNode.removeChild(b.nextSibling); break;
}}} i=-1; while(a[++i]){b=a.cells; if(b.length==6){b[4].style.display="none";}} break;
}}}}
</script>
Tested in IE, FF, Opera, Safari and Chrome.
This was done as a request. Maybe you will find a use for it! ;D
This code hides the text "Posts:" and the post count in the mini-profile, profile page and the Member List page.
Optionally remove the "Top Posters" link on the Member List page.
Any user names listed in the code will be able to see the post count.
Enjoy!!!
SubDevo
Variables: Edit the Maroon portions.
var fStaff=/^(admin|staff1)$/i // Usernames allowed to see post count.
Just add the user names (NOT display names) that are allowed to see the post count.
Separate each name with a "|". Do NOT put a "|" after the last name!
var remTop=1; // Remove Top Posters Link? 1=Yes, 0=No
1= Remove the "Top Posters" link on the Member List page.
0= Leave it alone!
If set to 1, the link will not be removed for the users listed in fStaff above.
Location: Global Footer
BELOW any RPG/Money codes etc... These codes looks for the word "Posts:"
ABOVE your mini-profile mod code (if using one).
<script type="text/javascript">
/* Hide Post Count from Non-Staff by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var fStaff=/^(admin|staff1)$/i; // users allowed to see post count.
var remTop=1; // Remove Top Posters Link? 1=Yes, 0=No
if(!fStaff.test(pb_username)){
var tr=document.getElementsByTagName("tr"),a,n,i,x=-1,b="Posts:";
if(/(calendar|pm|pre)view|viewprofile|search2|display/i.test(pb_action)){
while(tr[++x]){ n=tr[x].firstChild;
if(n&&n.width=="20%"&&n.innerHTML.indexOf(b)!=-1){
n.innerHTML=n.innerHTML.replace(/posts:(.+)<br\s?\/?>/i,"");
if(pb_action=="viewprofile"){n=n.nextSibling.getElementsByTagName("tr");i=-1;
while(n[++i]){if(n.innerHTML.indexOf(b)!=-1){ n.style.display="none"; break;}}
}}}}
if(pb_action=="members"){ n=document.getElementsByTagName("table"); i=x=-1;
while(n[++x]){a=n[x];
if(a.border==0&&a.cellPadding==4&&a.innerHTML.indexOf("action=members")!=-1){
a=a.rows; b=n[x].getElementsByTagName("a");
if(remTop){ while(b[++i]){ if(/view=top$/i.test(b.href)){
b.style.display="none"; b.parentNode.removeChild(b.nextSibling); break;
}}} i=-1; while(a[++i]){b=a.cells; if(b.length==6){b[4].style.display="none";}} break;
}}}}
</script>