Hello, I found this code to limit the views on the forum for guests but on some reloads i get a null page then is automatically redirects to the index, does this while logged in. Can this be fixed?
Code:
punbb
Forum Link: http://www.team-psn.net/
Thank you in advance!
Regards
FrOsTyXi
Code:
- Code:
$(function(){
themsg = "You Have Reached The View Limit You Must Signup To Continue Viewing";
var x = "/login /register";
var y = x.split(" ");
for (var i = 0; i < y.length; i++) {
if (window.location.pathname == y[i]) return;
};
if(_userdata.session_logged_in <= 0) {
count = parseInt(my_getcookie("count")) || 0;
if(count < 10){
my_setcookie("count",++count, 10000);
}else{
alert(themsg);
var hhh = location.href;
my_setcookie("mylasturl",hhh, 10000);
location.href='/login?theme_id=185730';
};
}else{
lastur = my_getcookie("mylasturl");
if (lastur == ""){}else{
location.href=lastur;
my_setcookie("mylasturl","", 10000);
};
};
});
punbb
Forum Link: http://www.team-psn.net/
Thank you in advance!
Regards
FrOsTyXi