Post by Tylr on May 19, 2006 20:52:03 GMT -8
Note: This code is obsolete as it is now possible to limit access to categories based on post rank. To limit access to a specific board rather than category, use this: [CB] Member group restriction for boards.
This code works by getting the number of posts you have from your miniprofile and storing them in a cookie, therefore it will not be completely accurate. For instance, if you switch computers, restart, clear your cache or anything else that could tamper with the cookies you may need to view your mini profile again. This is as simple as viewing any post made by you, or your profile. Also, the cookie is not deleted after simply logging out. It is cleared if you login and view a post made by that login, but otherwise remains the same.
Global Footer
<script language="JavaScript">
<!--
// Only viewy boardity with certain number of postitys By T.J.
// Original: support.proboards.com
var boardid="boardID" // ID of the board only accesible with an amount of posts
var numposts="#posts" // Number of posts required to see board
if(!location.href.match('action=') && !location.href.match('board=')){
var ah=document.getElementsByTagName('a')
for(a=0;a<ah.length;a++){
if(ah.href.match('board='+boardid) && !ah.href.match('thread=') && !document.cookie.match('posts=')){
ah.parentNode.parentNode.parentNode.style.display='none'
}
if(document.cookie.match('posts=')){
if(ah.href.match('board='+boardid) && !ah.href.match('thread=') && document.cookie.split('posts=')[1].split(';')[0]<numposts) {
ah.parentNode.parentNode.parentNode.style.display='none'
}
}
}
}
if(location.href.match('board='+boardid) && document.cookie.split('posts=')[1].split(';')[0]<numposts){
var td=document.getElementsByTagName('td')
for(i=0;i<td.length;i++){
td.style.display='none';
}
document.write('<center><h2>You do not have enough posts to access this board.</h2><a href="'+location.href.split('?')[0]+'">Go to the home page</a><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>')
}
if(location.href.match('action=viewprofile') || location.href.match('thread=')){
var ahh=document.getElementsByTagName('a')
for(q=0;q<ahh.length;q++){
if(ahh[q].href.match('viewprofile&user='+pb_username)){
document.cookie='posts='+ahh[q].parentNode.parentNode.innerHTML.split('Posts: ')[1].split(/</)[0]
break;
}
}
}
// -->
</script>
(Repost if header stays in tact.)
Global Footer
<script language="JavaScript">
<!--
// Only viewy boardity with certain number of postitys By T.J.
// Original: support.proboards.com
var boardid="boardID" // ID of the board only accesible with an amount of posts
var numposts="#posts" // Number of posts required to see board
if(!location.href.match('action=') && !location.href.match('board=')){
var ah=document.getElementsByTagName('a')
for(a=0;a<ah.length;a++){
if(ah.href.match('board='+boardid) && !ah.href.match('thread=') && !document.cookie.match('posts=')){
ah.parentNode.parentNode.parentNode.style.display='none'
}
if(document.cookie.match('posts=')){
if(ah.href.match('board='+boardid) && !ah.href.match('thread=') && document.cookie.split('posts=')[1].split(';')[0]<numposts) {
ah.parentNode.parentNode.parentNode.style.display='none'
}
}
}
}
if(location.href.match('board='+boardid) && document.cookie.split('posts=')[1].split(';')[0]<numposts){
var td=document.getElementsByTagName('td')
for(i=0;i<td.length;i++){
td.style.display='none';
}
document.write('<center><h2>You do not have enough posts to access this board.</h2><a href="'+location.href.split('?')[0]+'">Go to the home page</a><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>')
}
if(location.href.match('action=viewprofile') || location.href.match('thread=')){
var ahh=document.getElementsByTagName('a')
for(q=0;q<ahh.length;q++){
if(ahh[q].href.match('viewprofile&user='+pb_username)){
document.cookie='posts='+ahh[q].parentNode.parentNode.innerHTML.split('Posts: ')[1].split(/</)[0]
break;
}
}
}
// -->
</script>
(Repost if header stays in tact.)