|
Post by Wormopolis on Dec 19, 2008 16:48:06 GMT -8
Browsers Tested: IE and FF Placement: Global Footer
Allows you to specify certain boards to be Male or Female only.
<script type="text/javascript"> <!--
/*ORIGINAL CODE: Board Age Restrictions, By Zando*/ // Modifications by Wormo to make Gender Restricted boards
var allowedToChangeGender=/(admin|beavis)/; var accessAnyBoard=/^(admin|admin2|wormo)$/;
// No need to edit below except for support
function wFunc(wBoardid,wReqgender){ var tdz=document.getElementsByTagName("td") var tbl=document.getElementsByTagName("table") if (location.href.match(/action=modifyprofile/i) && !pb_username.match(allowedToChangeGender)) { sel=document.getElementsByName("gender"); sel[0].disabled=true; selTd=sel[0].parentNode.parentNode; selTdNext=selTd.nextSibling; selTdNext.firstChild.innerHTML="Gender can only be changed by admin"; function revertLockout() {document.modifyForm.gender.disabled=false;} if (document.addEventListener) { document.modifyForm.addEventListener("submit",revertLockout,false); } else { document.modifyForm.attachEvent("onsubmit",revertLockout); } }
if(location.href.match('((action=viewprofile&user='+pb_username+'$)|(action=viewprofile$))')){ for(z=0;z<tdz.length;z++){ if(tdz[z].width=="25%" && tdz[z].innerHTML.match(/Gender:/) ){ var zGender=tdz[z+1].getElementsByTagName("font")[0].innerHTML document.cookie ='genez='+zGender+';expires=Sat, 20 Jan 3000 12:12:12 UTC; path=/;'; } } } if(!document.cookie.match(/genez/)){ document.cookie ='genez="none";expires=Sat, 20 Jan 3000 12:12:12 UTC; path=/;'; } if(location.href.match('board='+wBoardid) && document.cookie.match(/genez=/) && !pb_username.match(accessAnyBoard)){ placer=document.cookie.indexOf('genez=')+6; placerend=document.cookie.indexOf(";",placer); var wGenCheck=document.cookie.substring(placer,placerend); if(wGenCheck!=wReqgender){ document.title="Error"; for(z=0;z<tbl.length;z++){ if(tbl[z].width=="92%" && tbl[z].align=="center" && tbl[z].getElementsByTagName('tr')[0].getElementsByTagName('td')[0].vAlign=="top"){ nwRw=document.createElement('tr'); nwCl=document.createElement('td'); nwCl.innerHTML='<table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td class="titlebg" bgcolor="4080B0" height="18"><font size="2" class="titletext" color="F1F1F1"><b>Error</b></font></td></tr><tr><td class="windowbg"><font size="2">Unfortunately you do not meet the required gender to enter this board. You must be a '+wReqgender+' to enter this board. <b'+'r/><b'+'r/>Please click <a href="/index.cgi?"><b>here</b></a> to return to the forum main page.<b'+'r/><b'+'r/>If you beleive that you are a '+wReqgender+', then please visit your profile page by clicking <a href="/index.cgi?action=viewprofile"><b>here</b></a> and try entering the board again.</font></td></tr></table>'; nwRw.appendChild(nwCl); if (tbl[z].firstChild.nodeName=="TBODY") { tbl[z].firstChild.appendChild(nwRw); tbl[z].firstChild.firstChild.style.display="none"; } else { tbl[z].appendChild(nwRw); tbl[z].firstChild.nextSibling.style.display="none"; }
} } } } }
wFunc("womenstuff", "Female"); wFunc("menstuff", "Male"); wFunc("happy", "Female");
//--> </script>
Preview: Coming Soon
|
|