Post by Ћ€ Dog Monst€Я on Jul 20, 2006 9:18:51 GMT -8
Preview A - Buttons Are Gone 1, 2
Preview B - Error Message 1, 2
EDITING: Replace orange parts according to red instructions.
Board Header
<script type="text/javascript">
/*
Allow Posting On Board For Certain Members Only
Coded by The Dog Monster
Please Do Not Edit Or Redistribute Without Permission
Board Header Portion
*/
var allowed=/X/i //Users allowed to post. For multiple users, enclose the X with brackets and add users within them, seperated by a "|".
if(this.location.href.match(/&action=(post|createpoll)/i) && !pb_username.match(allowed)){
document.write('<div style="display:none">')
}
</script>
Board Footer
<script type="text/javascript">
<!--
/*
Allow Posting On Board For Certain Members Only
Coded by The Dog Monster
Please Do Not Edit Or Redistribute Without Permission
Board Footer Portion
*/
if(!pb_username.match(allowed)){
var aPost=document.getElementsByTagName('a')
var aTab = document.getElementsByTagName('table')
for(i=0;i<aTab.length;i++){
if(aTab[i].innerHTML.match(/Quick Reply/i) && aTab[i].width.match(/100%/)){
aTab[i].style.display="none";
}
}
for(n=0;n<aPost.length;n++){
if(aPost[n].innerHTML.match(/img/i) && aPost[n].href.match(/action=(post|createpoll)/i)){
aPost[n].style.display="none"
}
}
function error(nmess){
var forumname=document.title.split(' -')
document.write('</div><center><div id="navinner" width="92%" style="display:none"><a href="/index.cgi?" class="nav">'+forumname[0]+'</a> :: An Error Has Occured</div><table width="92%"><div id="nav" width="92%"></div></td></tr></table><table border="0" width="92%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td width="100%" class="titlebg"><font size="2"><b>An Error Has Occurred</b></font></td></tr><tr><td width="100%" class="windowbg"><font size="2">You are not authorized to '+nmess+' on this board.</font></td></tr></table></td></tr></table><table width="92%"><div id="nav2" width="92%"></div></table></center>')
document.getElementById('nav2').innerHTML=document.getElementById('navinner').innerHTML
document.getElementById('nav').innerHTML=document.getElementById('navinner').innerHTML
document.title=forumname[0]+" - An Error Has Occured"
}
if(this.location.href.match(/&action=post/i) && !this.location.href.match(/&thread=/i)){
error('post')
}
if(this.location.href.match(/&action=createpoll/i)){
error('create a poll')
}
if(this.location.href.match(/&action=post/i) && this.location.href.match(/&thread=/i)){
error('reply')
}
}
//-->
</script>
I want to "Disallow Posting On Board For Certain Members Only". How do I do that with this code?
Find this row in the Board Header portion:
if(this.location.href.match(/&action=(post|createpoll)/i) && !pb_username.match(allowed)){
And replace it with this:
if(this.location.href.match(/&action=(post|createpoll)/i) && pb_username.match(allowed)){
Find this row in the Board Footer portion:
if(!pb_username.match(allowed)){
And replace it with this:
if(pb_username.match(allowed)){
Instead of replacing the orange X with allowed users, you now need to replace it with disallowed users.
EDIT: Made to remove the need to add the name of the forum to a variable.
Preview B - Error Message 1, 2
EDITING: Replace orange parts according to red instructions.
Board Header
<script type="text/javascript">
/*
Allow Posting On Board For Certain Members Only
Coded by The Dog Monster
Please Do Not Edit Or Redistribute Without Permission
Board Header Portion
*/
var allowed=/X/i //Users allowed to post. For multiple users, enclose the X with brackets and add users within them, seperated by a "|".
if(this.location.href.match(/&action=(post|createpoll)/i) && !pb_username.match(allowed)){
document.write('<div style="display:none">')
}
</script>
Board Footer
<script type="text/javascript">
<!--
/*
Allow Posting On Board For Certain Members Only
Coded by The Dog Monster
Please Do Not Edit Or Redistribute Without Permission
Board Footer Portion
*/
if(!pb_username.match(allowed)){
var aPost=document.getElementsByTagName('a')
var aTab = document.getElementsByTagName('table')
for(i=0;i<aTab.length;i++){
if(aTab[i].innerHTML.match(/Quick Reply/i) && aTab[i].width.match(/100%/)){
aTab[i].style.display="none";
}
}
for(n=0;n<aPost.length;n++){
if(aPost[n].innerHTML.match(/img/i) && aPost[n].href.match(/action=(post|createpoll)/i)){
aPost[n].style.display="none"
}
}
function error(nmess){
var forumname=document.title.split(' -')
document.write('</div><center><div id="navinner" width="92%" style="display:none"><a href="/index.cgi?" class="nav">'+forumname[0]+'</a> :: An Error Has Occured</div><table width="92%"><div id="nav" width="92%"></div></td></tr></table><table border="0" width="92%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td width="100%" class="titlebg"><font size="2"><b>An Error Has Occurred</b></font></td></tr><tr><td width="100%" class="windowbg"><font size="2">You are not authorized to '+nmess+' on this board.</font></td></tr></table></td></tr></table><table width="92%"><div id="nav2" width="92%"></div></table></center>')
document.getElementById('nav2').innerHTML=document.getElementById('navinner').innerHTML
document.getElementById('nav').innerHTML=document.getElementById('navinner').innerHTML
document.title=forumname[0]+" - An Error Has Occured"
}
if(this.location.href.match(/&action=post/i) && !this.location.href.match(/&thread=/i)){
error('post')
}
if(this.location.href.match(/&action=createpoll/i)){
error('create a poll')
}
if(this.location.href.match(/&action=post/i) && this.location.href.match(/&thread=/i)){
error('reply')
}
}
//-->
</script>
I want to "Disallow Posting On Board For Certain Members Only". How do I do that with this code?
Find this row in the Board Header portion:
if(this.location.href.match(/&action=(post|createpoll)/i) && !pb_username.match(allowed)){
And replace it with this:
if(this.location.href.match(/&action=(post|createpoll)/i) && pb_username.match(allowed)){
Find this row in the Board Footer portion:
if(!pb_username.match(allowed)){
And replace it with this:
if(pb_username.match(allowed)){
Instead of replacing the orange X with allowed users, you now need to replace it with disallowed users.
EDIT: Made to remove the need to add the name of the forum to a variable.