Post by Tylr on Apr 3, 2012 10:25:12 GMT -8
This code allows you to restrict board access instead of category access by member group. It works by moving a board from your restricted category into a different category, then hiding the category it came from. Why would you want to do this? Because member group restrictions are possible with categories, but not boards. Just create a category with the appropriate restrictions and place a board in that category. Then use this:
Top of your Main Footer (specifically before any other board listing hacks):
<script type="text/javascript">
<!--
//Member group restriction for boards by Tylr
//Repost with header | original: support.proboards.com
function moveBoard(boardID,toCatID){
var td=document.getElementsByTagName('td');
for(i=0;i<td.length;i++){
if(td.className=='windowbg2' && td.width=='66%' && td.innerHTML.match('board='+boardID)){
var movingBoard=td.parentNode.cloneNode(true);
td.parentNode.style.display='none';
td.parentNode.previousSibling.style.display='none';
}
}
var tr=document.getElementsByTagName('tr');
for(i=0;i<tr.length;i++){
if(tr.firstChild.className=='catbg' && tr.firstChild.colSpan=='5' && tr.firstChild.firstChild.name==toCatID){
if(movingBoard) tr.parentNode.insertBefore(movingBoard,tr.nextSibling);
}
}
}
moveBoard('boardID','toCategoryID');
moveBoard('boardID2','toCategoryID2');
-->
</script>
moveBoard('boardID','toCategoryID');Where boardID is the ID of the board you placed in the restricted access category and toCategoryID is the ID of the category you want it displayed in. It will automatically hide the category containing the board you reference. Repeat for as many as boards as you want.
Top of your Main Footer (specifically before any other board listing hacks):
<script type="text/javascript">
<!--
//Member group restriction for boards by Tylr
//Repost with header | original: support.proboards.com
function moveBoard(boardID,toCatID){
var td=document.getElementsByTagName('td');
for(i=0;i<td.length;i++){
if(td.className=='windowbg2' && td.width=='66%' && td.innerHTML.match('board='+boardID)){
var movingBoard=td.parentNode.cloneNode(true);
td.parentNode.style.display='none';
td.parentNode.previousSibling.style.display='none';
}
}
var tr=document.getElementsByTagName('tr');
for(i=0;i<tr.length;i++){
if(tr.firstChild.className=='catbg' && tr.firstChild.colSpan=='5' && tr.firstChild.firstChild.name==toCatID){
if(movingBoard) tr.parentNode.insertBefore(movingBoard,tr.nextSibling);
}
}
}
moveBoard('boardID','toCategoryID');
moveBoard('boardID2','toCategoryID2');
-->
</script>