Post by BrotherHolmes on Jan 4, 2006 10:56:13 GMT -8
This code will hide boards for PBv4 so that only special members will see them. This code (like any code) will not work if the person has javascript disabled.
Currently Version 5.4:
Few bug fixes.
v5.0: This version also hides user recent info.
New features:
v4.0: Support for Sub-boards has been added.
v3.1 - v3.4: Fixed a few bugs.
v3.0: This version also removes the jump link.
v2.0: This will also hide the board even if they have a direct link.
You must add this to the board's HnFs:
This MUST be the last thing in the board header:
<div id="hiddenboard" style="display:none;">
This MUST be the first thing in the board footer:
</div>
Add this to Global Footer:
Read the comments for instructions and...
Add a "|" (line) between each user's name.
I'd like to thank Ross for helping me study Javascripting.
Currently Version 5.4:
Few bug fixes.
v5.0: This version also hides user recent info.
New features:
v4.0: Support for Sub-boards has been added.
v3.1 - v3.4: Fixed a few bugs.
v3.0: This version also removes the jump link.
v2.0: This will also hide the board even if they have a direct link.
You must add this to the board's HnFs:
This MUST be the last thing in the board header:
<div id="hiddenboard" style="display:none;">
This MUST be the first thing in the board footer:
</div>
Add this to Global Footer:
Read the comments for instructions and...
Add a "|" (line) between each user's name.
<script>
<!--
/*Board hide except for special members v5.4
made by DJAikou from djaikou.com/forums
Do NOT repost with permission from DJAikou*/
//Anyone you want to veiw all boards.
var allboards='(admin|other|etc)';
//List of boards and who can view them.
var unames=[];
unames[0]=['board1','(user1|user2|user3|user4)'];
unames[1]=['board2','(user1|user2|user3|user4)'];
unames[2]=['board3','(user1|user2|user3|user4)'];
//Width of the second TD in each row.
//If you don't know what it is, don't change it.
//default is 66%
var tdw='66%';
var td=document.getElementsByTagName('td');
var boardn=document.getElementsByTagName('a');
for(un=0;un<unames.length;un++){
if(location.href.match(/com\/?((index\.cgi)?\??(action=(logout|home))?(#.+)?)?$/) || this.location.href.match(/board=\w+(&\w+=\d)?$/) ){
for(an=0;an<boardn.length;an++){
for(t=0;t<td.length;t++){
if(td[t].width==tdw && boardn[an].href.match(new RegExp('board='+unames[un][0]+'$','gi'))){
if(!pb_username.match(new RegExp('^'+ allboards +'$','gi')) && !pb_username.match(new RegExp('^'+ unames[un][1] +'$','gi'))){
boardn[an].parentNode.parentNode.parentNode.style.display='none';
}
}
}}}
for(an=0;an<boardn.length;an++){
if(location.href.match('user=') && !location.href.match('action=(user)?recent') && boardn[an].href.match('board='+unames[un][0]) && (!pb_username.match(new RegExp('^'+ allboards +'$','gi')) && !pb_username.match(new RegExp('^'+ unames[un][1] +'$','gi'))) ){
boardn[an].parentNode.parentNode.style.display='none';
}
if(document.title.match(/- Search Results/) && boardn[an].href.match('board='+unames[un][0]) && !boardn[an].innerHTML.match(/(&\#187\;|&\#171\;)/) && (!pb_username.match(new RegExp('^'+ allboards +'$','gi')) && !pb_username.match(new RegExp('^'+ unames[un][1] +'$','gi'))) ){
boardn[an].parentNode.parentNode.parentNode.parentNode.parentNode.style.display='none';
}
}
var hDiv=document.getElementById('hiddenboard')
if(location.href.match('board='+unames[un][0]) || location.href.match('action=advancedmoderation') || document.title.match(/- Preview( Personal)? Message/)){
if(pb_username.match(new RegExp('^'+ allboards +'$','gi')) || pb_username.match(new RegExp('^'+ unames[un][1] +'$','gi'))){
hDiv.style.display='block';
}
}
var lJump=document.getElementsByTagName('option');
for(jl=0;jl<lJump.length;jl++){
if(lJump[jl].value.match(new RegExp('board='+unames[un][0]+'$','gi'))){
if(!pb_username.match(new RegExp('^'+ allboards +'$','gi')) && !pb_username.match(new RegExp('^'+ unames[un][1] +'$','gi'))){
lJump[jl].style.display='none';
}
}
}}
//-->
</script>
I'd like to thank Ross for helping me study Javascripting.