Post by zando on Nov 8, 2006 22:30:13 GMT -8
Will restrict certain boards from people who do not meet the required age.
Global Footers
Cross Browser: IE & FF
Proboards
<script type="text/javascript">
<!--
/*Board Age Restrictions, By Zando*/
function zFunc(zBoardid,zReqage){
var tdz=document.getElementsByTagName("td")
var tbl=document.getElementsByTagName("table")
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(/Age:/) && tdz[z+1].innerHTML.match(/(\d+)/)){
var zAge=tdz[z+1].getElementsByTagName("font")[0].innerHTML
document.cookie ='Agez='+zAge+';expires=Sat, 20 Jan 3000 12:12:12 UTC; path=/;';
}
}
}
if(!document.cookie.match(/Agez/)){
document.cookie ='Agez=0;expires=Sat, 20 Jan 3000 12:12:12 UTC; path=/;';
}
if(location.href.match('board='+zBoardid) && document.cookie.match(/Agez=(\d+)/)){
var zAgeCheck=RegExp.$1
if(zAgeCheck<zReqage){
document.title="Error";
for(z=0;z<tbl.length;z++){
if(tbl[z].width=="92%" && tbl[z].align=="center" && tbl[z].rows[0].cells[0].vAlign=="top"){
tbl[z].style.display="none";
}
}
document.write('<table border="0" width="92%" cellspacing="0" cellpadding="0" bgcolor="000000" class="bordercolor" align="center"><tr><td><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 age limit to enter this board. You must be at least '+zReqage+' years of age to enter this board. <b'+'r/><b'+'r/>Please click <a href="/index.cgi?">here</a> to return to the forum main page.<b'+'r/><b'+'r/>If you beleive that you are of the required age, then please visit your profile page by clicking <a href="/index.cgi?action=viewprofile">here</a> and try entering the board again.</font></td></tr></table></td></tr></table>');
}
}
}
zFunc("Board ID", "Required Age");
zFunc("Board ID", "Required Age");
//-->
</script>
All you need to do is edit this part:
zFunc("Board ID", "Required Age");
zFunc("Board ID", "Required Age");
If you wish to have more boards have an age restriction, then just add more of this line:
zFunc("Board ID", "Required Age");
Global Footers
Cross Browser: IE & FF
Proboards
<script type="text/javascript">
<!--
/*Board Age Restrictions, By Zando*/
function zFunc(zBoardid,zReqage){
var tdz=document.getElementsByTagName("td")
var tbl=document.getElementsByTagName("table")
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(/Age:/) && tdz[z+1].innerHTML.match(/(\d+)/)){
var zAge=tdz[z+1].getElementsByTagName("font")[0].innerHTML
document.cookie ='Agez='+zAge+';expires=Sat, 20 Jan 3000 12:12:12 UTC; path=/;';
}
}
}
if(!document.cookie.match(/Agez/)){
document.cookie ='Agez=0;expires=Sat, 20 Jan 3000 12:12:12 UTC; path=/;';
}
if(location.href.match('board='+zBoardid) && document.cookie.match(/Agez=(\d+)/)){
var zAgeCheck=RegExp.$1
if(zAgeCheck<zReqage){
document.title="Error";
for(z=0;z<tbl.length;z++){
if(tbl[z].width=="92%" && tbl[z].align=="center" && tbl[z].rows[0].cells[0].vAlign=="top"){
tbl[z].style.display="none";
}
}
document.write('<table border="0" width="92%" cellspacing="0" cellpadding="0" bgcolor="000000" class="bordercolor" align="center"><tr><td><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 age limit to enter this board. You must be at least '+zReqage+' years of age to enter this board. <b'+'r/><b'+'r/>Please click <a href="/index.cgi?">here</a> to return to the forum main page.<b'+'r/><b'+'r/>If you beleive that you are of the required age, then please visit your profile page by clicking <a href="/index.cgi?action=viewprofile">here</a> and try entering the board again.</font></td></tr></table></td></tr></table>');
}
}
}
zFunc("Board ID", "Required Age");
zFunc("Board ID", "Required Age");
//-->
</script>
All you need to do is edit this part:
zFunc("Board ID", "Required Age");
zFunc("Board ID", "Required Age");
If you wish to have more boards have an age restriction, then just add more of this line:
zFunc("Board ID", "Required Age");