Need help to limit the view (times) number of visitors
5 posters
Page 1 of 1
Need help to limit the view (times) number of visitors
As per the topic title, I want to limit view number of guest. Once the view number out of limit, visitor have to register account. However, after visiters register and login completed, they can be continue to read the topic that they are reading before.
Please help me these.
My forum is phpBB3 and link to on my profile.
Thank you!
Alex.
Please help me these.
My forum is phpBB3 and link to on my profile.
Thank you!
Alex.
Last edited by AlexisMcDevin on December 30th 2014, 1:57 pm; edited 2 times in total
Re: Need help to limit the view (times) number of visitors
Do you mean that you want guests to not see the posts?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Need help to limit the view (times) number of visitors
SLGray wrote:Do you mean that you want guests to not see the posts?
I mean that Guest only can view and read info. in my forum a few times (may be ten times). After that, they must be register and login to read more information in my forum.
Is it clear my request?
Re: Need help to limit the view (times) number of visitors
I do not know if there is a way to achieve this.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Need help to limit the view (times) number of visitors
you could count the post they have navigated to but if they refresh the page it would still count as another view
Re: Need help to limit the view (times) number of visitors
Hi all,
I need someone really well to corect below code. I think that my requests will be solved.
- This code will be the viewing quantity limitation of visitor (guest) in our forum. I mean that how many times we will allow the visitor read topic (please noted that at the moment visitor is guest (have not yet a member of forum)? Time will be count down.
- This code may be used for: After visitor already completed regiter and then login to forum, they can be continue read the last topic that they were reading before.
I do not know how to make these codes work. So, I hope you can do that.
I need someone really well to corect below code. I think that my requests will be solved.
- This code will be the viewing quantity limitation of visitor (guest) in our forum. I mean that how many times we will allow the visitor read topic (please noted that at the moment visitor is guest (have not yet a member of forum)? Time will be count down.
- Code:
$(function(){
if($("#logout").length<1) {
count = parseInt(my_getcookie("count")) || 0;
count < 0?my_setcookie("count",++count):location.href='URL login page';
}
});
- This code may be used for: After visitor already completed regiter and then login to forum, they can be continue read the last topic that they were reading before.
- Code:
function getParameter(name) { // function use parameters
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
getParameter('url') // return www.google.com
I do not know how to make these codes work. So, I hope you can do that.
Re: Need help to limit the view (times) number of visitors
- Code:
$(function(){
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);
}else{
var hhh = location.href;
my_setcookie("mylasturl",hhh);
location.href='/login';
};
}else{
lastur = my_getcookie("mylasturl");
if (lastur == ""){}else{
location.href=lastur;
my_setcookie("mylasturl","");
};
};
});
change the 10 in
- Code:
if(count < 10){
to set the view count
Re: Need help to limit the view (times) number of visitors
Haha, you are my guy!!! Your code worked very well!
After I applied this code, at the login time, the address bar of browser inform: "http://ccxiqi.forumvi.com/null" in a few seconds, and then link to my forum.
Can I request one more thing?
I really need to get a small board (pop-up) to notice (inform) to visitor (guest) that they are over the viewing quantity limitation on our forum, please login or register to use all the funtions of our forum. Something like my description. I will change text in our language.
If we do not have this notice, they will not know why they have been kicked out.
I am looking forward to receiving your response soon.
Thank you!
Alex.
After I applied this code, at the login time, the address bar of browser inform: "http://ccxiqi.forumvi.com/null" in a few seconds, and then link to my forum.
Can I request one more thing?
I really need to get a small board (pop-up) to notice (inform) to visitor (guest) that they are over the viewing quantity limitation on our forum, please login or register to use all the funtions of our forum. Something like my description. I will change text in our language.
If we do not have this notice, they will not know why they have been kicked out.
I am looking forward to receiving your response soon.
Thank you!
Alex.
Re: Need help to limit the view (times) number of visitors
- 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);
}else{
alert(themsg);
var hhh = location.href;
my_setcookie("mylasturl",hhh);
location.href='/login';
};
}else{
lastur = my_getcookie("mylasturl");
if (lastur == ""){}else{
location.href=lastur;
my_setcookie("mylasturl","");
};
};
});
Re: Need help to limit the view (times) number of visitors
This code also working really good! You are the best!
I just find out one more thing that we have to improve. Once the visitor gone out of the viewing quantity limitation, the notice board turn on however, if the visitor turn off their browser and then turn on it, they will have 10 times to review our forum again.
In this case, I think that we should control IP address from visitor to get the best way.
Please let me know your thoughts. Can you find other ways to get this thing done.
Thank you!
Alex.
I just find out one more thing that we have to improve. Once the visitor gone out of the viewing quantity limitation, the notice board turn on however, if the visitor turn off their browser and then turn on it, they will have 10 times to review our forum again.
In this case, I think that we should control IP address from visitor to get the best way.
Please let me know your thoughts. Can you find other ways to get this thing done.
Thank you!
Alex.
Re: Need help to limit the view (times) number of visitors
try this idk if it will work i didnt test it
- 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';
};
}else{
lastur = my_getcookie("mylasturl");
if (lastur == ""){}else{
location.href=lastur;
my_setcookie("mylasturl","", 10000);
};
};
});
Re: Need help to limit the view (times) number of visitors
I do not know if you can control guests you erase their histories and caches with a code.
Also guests can turn off JavaScript in their browsers.
Also guests can turn off JavaScript in their browsers.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Need help to limit the view (times) number of visitors
only way to by pass it would be to delete cookies.. because you can still setup a noscript to redirect to login page if their javascript is off
Re: Need help to limit the view (times) number of visitors
It may not good with you all, however it is good enough with me. If visitors have to delete cookie all time to view my forum, it will take long time more than they registor an account in my forum.
So, if you have any better ideas, I am really happy on this. If not, this topic should be closed. Solved!
Thank you very much!
Alex.
So, if you have any better ideas, I am really happy on this. If not, this topic should be closed. Solved!
Thank you very much!
Alex.
Re: Need help to limit the view (times) number of visitors
Is this problem now solved as it marked as solved on the icon ?
Similar topics
» how to put the limit of the number of posts to view threads?
» IP-number on old visitors?
» Limit Number of Dice Rolls
» Limit on the number of groups
» Limit number of letters-charachters in post
» IP-number on old visitors?
» Limit Number of Dice Rolls
» Limit on the number of groups
» Limit number of letters-charachters in post
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum