Post by Ross on Sept 16, 2006 13:20:40 GMT -8
Global Footer
Simply put, this will restrict access to certain boards based on a users gender. Users without a gender set won't be able to see any of the boards listed. Just edit the red bits with the board IDs for each gender. However, members will need to modify their profile in order for them to see the restricted boards.
<table width="92%" class="bordercolor" cellspacing="1" cellpadding="4" align="center" id="error_message" style="display: none;">
<tr>
<td class="titlebg"><b>An Error Has Occured</b></td></tr>
<tr><td class="windowbg">Sorry, this is a restricted area.</td></tr>
</table>
<script type="text/javascript">
<!--
/* gender restricted boards - ross
101support.proboards43.com - do not redistribute */
var maleBoards = ["boardID1", "boardID2"];
var femaleBoards = ["general", "boardID2"];
var accessAllUsers = /^(admin|username2|username3)$/i
var board_array = (document.cookie.match(/gender=male/))? femaleBoards : ((document.cookie.match(/gender=female/))? maleBoards : maleBoards.concat(femaleBoards));
if(location.href.match(/(ion=(search2|(user)?recent)|\.com\/?(index.cgi)?\??(&?action=home)?(#.+?)?$)/) && !pb_username.match(accessAllUsers)) {
var a = document.getElementsByTagName('a');
for(i=0; i<a.length; i++) {
for(b=0; b<board_array.length; b++) {
if(a.item(i).href.match(board_array)) {
a.item(i).style.display = 'none';
}
}
}
var td = document.getElementsByTagName('td');
for(v=0; v<td.length; v++) {
if(td.item(v).width == '66%' && td.item(v).className == 'windowbg2') {
for(b=0; b<board_array.length; b++) {
if(td.item(v).getElementsByTagName('a').item(0).href.match(board_array)) {
td.item(v).parentNode.style.display = 'none';
break;
}
}
}
}
} else if(location.href.match(/board=(.+?)(&|#|$)/)) {
for(b=0; b<board_array.length; b++) {
if(RegExp.$1 == board_array) {
var table = document.getElementsByTagName('table');
for(t=4; t<table.length; t++) {
table.item(t).style.display = 'none';
document.getElementById('error_message').style.display = 'block';
}
break;
}
}
} else if(document.modifyForm && document.modifyForm.user.value == pb_username) {
document.modifyForm.onsubmit = function() {
var d = new Date();
d.setYear('2025');
var gender = (document.modifyForm.sex.value == 1)? 'male' : ((document.modifyForm.sex.value == 2)? 'female' : 'none');
document.cookie = 'gender='+gender+';Expires='+d;
}
}
//-->
</script>
Simply put, this will restrict access to certain boards based on a users gender. Users without a gender set won't be able to see any of the boards listed. Just edit the red bits with the board IDs for each gender. However, members will need to modify their profile in order for them to see the restricted boards.
<table width="92%" class="bordercolor" cellspacing="1" cellpadding="4" align="center" id="error_message" style="display: none;">
<tr>
<td class="titlebg"><b>An Error Has Occured</b></td></tr>
<tr><td class="windowbg">Sorry, this is a restricted area.</td></tr>
</table>
<script type="text/javascript">
<!--
/* gender restricted boards - ross
101support.proboards43.com - do not redistribute */
var maleBoards = ["boardID1", "boardID2"];
var femaleBoards = ["general", "boardID2"];
var accessAllUsers = /^(admin|username2|username3)$/i
var board_array = (document.cookie.match(/gender=male/))? femaleBoards : ((document.cookie.match(/gender=female/))? maleBoards : maleBoards.concat(femaleBoards));
if(location.href.match(/(ion=(search2|(user)?recent)|\.com\/?(index.cgi)?\??(&?action=home)?(#.+?)?$)/) && !pb_username.match(accessAllUsers)) {
var a = document.getElementsByTagName('a');
for(i=0; i<a.length; i++) {
for(b=0; b<board_array.length; b++) {
if(a.item(i).href.match(board_array)) {
a.item(i).style.display = 'none';
}
}
}
var td = document.getElementsByTagName('td');
for(v=0; v<td.length; v++) {
if(td.item(v).width == '66%' && td.item(v).className == 'windowbg2') {
for(b=0; b<board_array.length; b++) {
if(td.item(v).getElementsByTagName('a').item(0).href.match(board_array)) {
td.item(v).parentNode.style.display = 'none';
break;
}
}
}
}
} else if(location.href.match(/board=(.+?)(&|#|$)/)) {
for(b=0; b<board_array.length; b++) {
if(RegExp.$1 == board_array) {
var table = document.getElementsByTagName('table');
for(t=4; t<table.length; t++) {
table.item(t).style.display = 'none';
document.getElementById('error_message').style.display = 'block';
}
break;
}
}
} else if(document.modifyForm && document.modifyForm.user.value == pb_username) {
document.modifyForm.onsubmit = function() {
var d = new Date();
d.setYear('2025');
var gender = (document.modifyForm.sex.value == 1)? 'male' : ((document.modifyForm.sex.value == 2)? 'female' : 'none');
document.cookie = 'gender='+gender+';Expires='+d;
}
}
//-->
</script>