<script>
var n = 0;
var NeedPosts = new Array();
NeedPosts[n++] = ["BOARD","POSTS"];
var span = document.getElementsByTagName("span");
for(r=0;r<span.length;r++){
if(span[r].innerHTML.match(/Hello <b>(.*)<\/b>/i)){
var username = RegExp.$1;
};};
if(username && document.getElementById("upshrinkHeaderIC")){
var find = document.getElementById("upshrinkHeaderIC").getElementsByTagName("a");
for(x=0;x<find.length;x++){
if(find[x].innerHTML.match(username) && find[x].href.match(/action=profile;u=(\d+)/i)){
var usernumber = RegExp.$1;
};};};
if(username && document.getElementById("upshrinkHeaderIC")){
function Request(){
if (window.XMLHttpRequest ) { return new XMLHttpRequest(); }
else if (window.ActiveXObject) {
try {
return new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
return false;
}}}
};/*End Request();*/
var req = Request();
var main = document.location.href.split("/index.php")[0];
req.open("GET",main + "/index.php?action=profile;u=" + usernumber + ";sa=statPanel");
req.onreadystatechange = function(){
if(req.readyState == 4){
var text = document.createElement("div");
text.innerHTML = req.responseText;
var txtTD = text.getElementsByTagName("td");
for(s=0;s<txtTD.length;s++){
if(txtTD[s].align == "right" && txtTD[s].innerHTML.match(/(\d+) posts/i)){
var Posts = RegExp.$1;
for(x=0;x<NeedPosts.length;x++){
if(Posts < NeedPosts[x][1]){
var a = document.getElementsByTagName("a");
for(i=0;i<a.length;i++){
if(a[i].name == "b" + NeedPosts[x][0]){
a[i].parentNode.innerHTML = a[i].innerHTML;
};};};};};};};};
req.send(null);
};
</script>
This is a long code, but I didn't want to use Jquery AJAX, so it is all javascript.
With this code, if a user doesn't have a certain ammount of posts, they cannot click the link to get into a certain board.
There is an error with this though, if you know how, they still can get to the board. Im not telling how cause then what fun would taht be?
BOARD = The Board ID (if you look up at the address bar, you will see something like this: board,1. The 1 would be the ID)
POSTS = How much posts they need to get into that board.
To add more boards taht they have to access with a certain ammount of posts, add more of these lines:
NeedPosts[n++] = ["BOARD","POSTS"];
Enjoy
