Here's a simple snippet that allows you to force a guest to the registration page after so many page views on your site. Copy this into a phpblock (left/right/center). You should make the block have no title or frame so it is basically invisible.
It will redirect the "Guest" to the registration page after they have exceeded the number of page views you set with the $gpvl_MaxPages variable in the code. To see it in action, you can go to my TP Blocks site (http://tpblocks.ccs-net.com) as a guest, view 3 pages and you will be redirected to the SMF Registration page.
Here's the code:
//////////////////////////////////////////////
// Guest Page View Limit 1.2
//////////////////////////////////////////////
// Developed by TPH Thurnok
// TinyPortal Hosting - Your premier TP/SMF host
// http://www.tinyportalhosting.com
// November 16, 2006
//
// Last update: March 10, 2007
// added &gpvl=exceeded to redirect so scripting can be done in registration
// to allow detecting user got there by exceeding the page view limit
//
// This is designed for a phpblock.
// This allows you to limit the number of pages a guest can view on your site
// before being redirected to the registration page.
//
// Requirements:
// In order for this to work, you must place this in a phpblock that is displayed
// on all pages. For any pages where this block is not displayed, that page will
// not be counted against the guest. It is recommended you do not display a title
// or frame for the block so that it is basically invisible to the user.
//
// This script will create a table for the storage of IPs and the count of pages.
// It is a very simple IP based count. No session info or other info is used.
// Therefore, if you set this to a very high value, and a user has a dynamic IP, you
// may be ineffective as the user may simply get a new IP the next time they visit your site.
//
//////////////////////////////////////////////
/*
****************************************
****************************************
*** !! User Configuration Section !! ***
****************************************
****************************************
*/
// Set the maximum number of pages you want to limit a normal guest to view
$gpvl_MaxPages = 3;
// Set the maximum number of pages to limit "special" guests to (usually for high limit guests)
$gpvl_MaxPagesSpecial = 1000;
// Set the IPs for "special" guests in an array - Example: array('12.1.4.70', '3.88.129.211', '42.150.220.200');
$gpvl_SpecialIPs = array();
// Set the IPs you want excluded from the limit - like google/spiders etc. in an array - same format as "special" guest array
$gpvl_ExcludeIPs = array('127.0.0.1');
// set the table name you want to use (without a prefix - prefix will be auto added)
$gpvl_table = 'guest_page_limit';
/*
****************************************
****************************************
*/
//////////////////////////////////////////////
//
// The rest of this you should leave as is
// unless you are overly industrious :)
//
//////////////////////////////////////////////
// globals for database vars
global $db_prefix, $tp_prefix;
// globals for user information
global $context, $scripturl;
// fix for TP 0.8.6 and lower
if (empty($tp_prefix)){
$tp_prefix = $settings['tp_prefix'];
}
$gpvl_table = $tp_prefix . $gpvl_table;
$myself = $_SERVER['REQUEST_URL'];
// first seperate the parameters from the URL, to avoid possible search string in the URL itself
$parms = str_replace($scripturl, "", $myself);
// then see if we are actually at the registration page (action=register)
$gpvl_at_register = stristr($parms, "action=register") ? true : false;
// or if we are at the login page (action=login)
$gpvl_at_login = stristr($parms, "action=login") ? true : false;
// or if we are at the password reminder page (action=reminder)
$gpvl_at_reminder = stristr($parms, "action=reminder") ? true : false;
// only for limiting guests, so if not a guest - get out (unless at registration/login/reminder page)
if ($context['user']['is_guest'] && !$gpvl_at_register && !$gpvl_at_login && !$gpvl_at_reminder){
// preset to max pages in case we fall thru
$gpvl_NumPages = $gpvl_MaxPages;
// what is our IP?
$gpvl_ip = empty($_SERVER['REMOTE_ADDR']) ? getenv('REMOTE_ADDR') : $_SERVER['REMOTE_ADDR'];
// if we got an IP (and it is not an excluded IP), do the work, otherwise, send them to registration
if ($gpvl_ip && strtoupper($gpvl_ip) != "NULL"){
if (in_array($gpvl_ip, $gpvl_ExcludeIPs)){
$gpvl_NumPages = 0;
} else {
// if they are a "special" guest, set their max pages to the "special" max pages setting
if (in_array($gpvl_ip, $gpvl_SpecialIPs)){
$gpvl_MaxPages = $gpvl_MaxPagesSpecial;
}
// test for table existance
$gpvl_result = @mysql_query('SELECT pageviews FROM '.$gpvl_table.' WHERE ip = "'.$gpvl_ip.'" LIMIT 1');
if (!$gpvl_result){
if (mysql_errno() == 1146){
// table doesn't exist, create it!
@mysql_query('CREATE table '.$gpvl_table.'(ip TEXT, pageviews INT UNSIGNED NOT NULL)');
$gpvl_NumPages = 1;
@mysql_query('INSERT INTO '.$gpvl_table.' VALUES ("'.$gpvl_ip.'", 1)');
} else {
die("Guest Page View Limit - Unexpected error: " . mysql_error());
}
} else {
if (mysql_num_rows($gpvl_result)){
// found this IP already in table
$row = mysql_fetch_assoc($gpvl_result);
$gpvl_NumPages = $row['pageviews'] + 1;
@mysql_query('UPDATE '.$gpvl_table.' SET pageviews = '.$gpvl_NumPages.' WHERE ip = "'.$gpvl_ip.'"');
} else {
// not in table yet, insert it
$gpvl_NumPages = 1;
@mysql_query('INSERT INTO '.$gpvl_table.' VALUES ("'.$gpvl_ip.'", 1)');
}
mysql_free_result($gpvl_result);
}
}
}
// Send to registration if they are at or above max pages
if ($gpvl_NumPages > 0 && $gpvl_NumPages >= $gpvl_MaxPages){
header("Location: ".$scripturl."?action=register&gpvl=exceeded");
}
}
ROFL
As many guests as I get all of the time I may start using this block!
Thanks alot - i needed this ;)
Edit: Argghh ! :P something is wrong with the script.. when i test it its working fine, but it takes ages for it to send the guest to the registration page... it just sit there loading for a very very long time.. what can be the cause of this ? if i disable the script while the other computer is loading it loads instantly the second i disable the script.. :o
That should upset habitual lurkers :up:
Quote from: knat on November 17, 2006, 07:10:00 AM
Thanks alot - i needed this ;)
Edit: Argghh ! :P something is wrong with the script.. when i test it its working fine, but it takes ages for it to send the guest to the registration page... it just sit there loading for a very very long time.. what can be the cause of this ? if i disable the script while the other computer is loading it loads instantly the second i disable the script.. :o
Ok i found a workaround for this.. i only make the script work inside forum.. this way the script dont run on the registration page and now it works fine ... but i guess the page view only counts for the boardindex now :-s
You need to make sure the block doesn't show up on the registration page, because you would go into an endless loop if it did, since the block does a redirect.
In otherwords, your registration page must not show the block area that you've placed the Guest Page View Limit code. Try putting it in a centerblock and make sure centerblocks are turned off for your forum page. Or, if you normally turn off right blocks when in your forum, use a right block. The registration page is part of the forum, so simply put the code into whatever block you "do not" have showing up when in your forum pages.
I use all blocktypes in my forum so this is not an option for me... but i got it working to a level that i am happy with :) i made it show on boardindex and in my most popular board.. and guests are bound to go to the boardindex to get to the categories.. so its all good ;) Thanks for the code :)
wow another great script by thurnok!
Thanks so much for this :D
I do have one question though - what happens to bots if using this?
Like yahoo msn google etc....wouldnt they get redirected as well and as a result end their indexing journey?
Most likely.
Perhaps a list of IPs or domains to exclude from the logic...
Nice code - I will certainly see how this one develops!
Ok, you can put in any block, regardless if that block shows on the same page as registration page or not now without issue. New code in first post.
Greetings!
This is not a question, a request or something like this. I only like the Idea in general, but see some problems and maybe an improvement.
IÃ,´m running a board, to provide Informationââ,¬â,,¢s about games and know, that a lot of people come to read my stuff. Also I invited even Guest to post, at some boards, but nearly nobody use the chance to get (easily) involved.
Thatââ,¬â,,¢s why I like your Idea, but I donÃ,´t want to force my guests hand.
So, point one is, that I would prefer, if not the registration site is shown up, but a general (handmade) site with a short hint like ââ,¬Å"You have now seen x sites of my contend. I like to invite you to register (link). Please klick here to continue without registering.ââ,¬Â
(Only as an example).
This extra site, even without the possibility to continue, seems to be more polite, because it allow to explain, why somebody is forced to register. Without, I only get a register page and donÃ,´t know what happens.
Second thing, the duration.
I like it, if guests come back to my side, looking for new contend.
If the have a static IP, they canÃ,´t do this, without being forced to register immediately.
If they have an dynamic IP, it could happen, that this IP is noticed in the database already.
To make a long story short, I would prefer a kind of circle.
Count page views of an IP. Show a short hint every x page view. Count next x page views, show a hint, etc.
Accent: This is not a question, a request or something like this. I donÃ,´t ask your to modify your code. I only like your (basic) idea and canÃ,´t keep my mouth shut.
Have al lot of fun and successes with everything you do.
ianus
I think the solution to your first idea is easy to do
Create an article to say the things you want to say to your guests.. plus a link to register
Then change this code to direct the guest to your new article instead of the registration page..
From this:
// Send to registration if they are at or above max pages
if ($gpvl_NumPages >= $gpvl_MaxPages){
header("Location: ".$scripturl."?action=register");
}
}
To This
// Send to registration if they are at or above max pages
if ($gpvl_NumPages >= $gpvl_MaxPages){
header("Location: ".$scripturl."?page=17");
}
}
Tested, and fixed to work... just change the page number to your page ;)
Yep.. Knat nailed it.
Follow his changes and suggestion and you are there on your first request.
Your second request is a bit more tricky (not impossible, nor difficult for some situations) but it really depends on how you want to track time, and what constitutes your clearing of the count so they aren't redirected and the count starts over. It would involve adding another field to the table for a date/time stamp, then a determination made as to the logic for saying "It's been long enough to reset this IP".
I'll consider updating it with this in the future as soon as I have some free time again. Knat might beat me to it however.. hehe
Greetings!
IÃ,´m not skilled enough in using the English language to express the way your support astonished me. ItÃ,´s absolute excellent!
Quote from: Thurnok on December 06, 2006, 02:35:23 AM
Yep.. Knat nailed it.
Follow his changes and suggestion and you are there on your first request.
As I mentioned, this isnÃ,´t a request. IÃ,´m only trying to mention my idea of a (possible) improvement.
So, the solution, Knat mentioned, is working (of course). Well, I can imagine, that a backlink to the last viewed page, would be nice, if the custom page is shown up. This would make it perfect.
No need to write code for it!
The second part.
/ Send to registration if they are at or above max pages
if ($gpvl_NumPages >= $gpvl_MaxPages){
header("Location: ".$scripturl."?action=register");
}
In my oppinon, a simple
ââ,¬Å"if ($gpvl_NumPages >= $gpvl_MaxPages)ââ,¬Å"
First action : header("Location: ".$scripturl."?action=register");
Second action: delete $gpvl_ip of user
should be enough.
But, for this point, itÃ,´s also not necessary to write code for it!
If you want to alter your snippet, feel free, but I donÃ,´t want to waste your time.
Have al lot of fun and successes with everything you do.
ianus
hi, can i request.. im like planing to do the page view limit on all membergroups and i want them to be redirected on an html page.. do you think thats possible?
thanks for the code!
Yes, but I'm not sure why you would want to limit all membergroups to viewing your site. Viewing a specific article might be more appropriate - say if you only wanted them to be able to view the article a number of times before redirecting them somewhere. If you want to do it for your entire site however, you probably would want the count to be reset right afterwards for them as well.
What specifically were you planning to do with it? That info would probably help understand what you really need anyway.
ohh sorry, i mean limit the page views per day..for all membergroups.. is that possible?
Quote from: metal13 on December 21, 2006, 04:29:41 PM
ohh sorry, i mean limit the page views per day..for all membergroups.. is that possible?
That sounds unhealthy to any forum :D
hmm why is that? my server is overloaded and my smf cant connect to the data base everytime i get around 100+ users online... so i think i need that..
any ideas on how to solve this? i dont want to stop using tp, hmm.. is there any way to minimize the queries of my smf and tp? i onl have 5 important mods installed on forum and still overloaded...
That sounds more like an issue with your server. There are numerous sites running TP/SMF that have more than 100 simultaneous users online throughout the day without issue.
Either way, this block really isn't for that, though it would be possible to make one that does that. I'm already behind on other things however, so someone else probably would be able to get to it faster than I would at the moment.
Thurnok, just I would like to thank you for this code... it is very useful. :)
np... pleasure is all mine. :)
Mr. T..he's a code monkey..lol.. :)
hmm ok, thnks for the replies..
Great snippet Thurnok ;) i've put this in a block an then why i log out it directly showed me the registration page, i changed the numbers in the code to 10
****************************************
*** !! User Configuration Section !! ***
****************************************
****************************************
*/
// Set the maximum number of pages you want to limit a guest to view
$gpvl_MaxPages = 10;
// set the table name you want to use (without a prefix - prefix will be auto added)
$gpvl_table = 'guest_page_limit';
/*
****************************************
****************************************
*/
Anyone? :)
Sorry, didn't realize it was a question. Are you saying that you set the code for 10 pages, but it sent you to registration page at the first page view?
- Did you put into a phpblock?
- What block location: left/right/center/frontpage/article?
- Does this block show on all pages of your site?
- Do you have something that refreshes your page automatically - like in another block somewhere (example the Teamspeak block has this)?
- Did it create the database table to hold the IP list?
- What does it say for the number of views for your IP in the table?
Quote from: Thurnok on December 28, 2006, 11:52:08 PM
Sorry, didn't realize it was a question. Are you saying that you set the code for 10 pages, but it sent you to registration page at the first page view?
No problem and yes it did take me directly to the registration page.
- YES
- LEFT
- YES
- NO
- YES, see attachment
- 16
hrm.. well, somehow it counted 16 page views for you, which is why it sent you to the registration page. I haven't seen that happen at all, so not sure why it would do that.
Try resetting the pageviews value to 1 and then visit as a guest again. If it sends you direct to the registration page again, recheck the pageviews value to see what it is at. If it is at above 10 again just from a single page view, there must be something causing it to count multiple times for a single view - but only for you I'd say, since in your screenshot I see another IP in the table that listed a single count.
Solved this issue Thurnok, seems i had a space to much between the = and number
$gpvl_MaxPages = 10;
$gpvl_MaxPages =10;
Thanks for the help
hehe.. not sure what you mean, white space is ignored by the php processor unless it is part of a string value. Hence:
$gpvl_MaxPages=10;
and
$gpvl_MaxPages = 10;
mean exactly the same thing as far as the php processor is concerned. But glad it is working correctly for you now. :)
I don't know if this has been noted already, but I realised a major problem with this snipplet.
I switched from the default theme to another, one which does not have the login box but only has the login lick on the main index. When I logged out to check something, I kept going back to the registration page and had no way to log back in. I had to use a proxy to log back.
Another problem is this: If someone has browsed enough as a guest but then made an account, and later on forgot their password, they cannot go to the password retrieval page, as they are led back to the registration page no matter what link they click. The same goes for account activation requests.
A smarter thing would be to lead them to a custom page which has both the login and the registration boxes.
Alright I am confused on this one...
This code will do a redirect after x amount of page views. <--- Got that part
So if a user is browsing away and gets x amount of views they get sent to the registration page. Now this is where I get lost... Maybe I am just tired...
But... If the only section of TP I use is the center section and I place the block in the center section when they go to register it will loop endlessly correct ?? But if I put it in a right block it won't work unless the right block is activated correct ?? So then the code doesn't do anything.
Am I right on this or did I miss something ??
Thanks!!
You're right. If its not in a block that is activated it won't work.
@Gargoyle - correct, if you do not have that block (or block section in the case you mention) activated, then it does not have an effect. This allows you to prevent redirection in circumstances you wish. For example, not to redirect when going to the password retrieval screen.
@haktanir - see note above. What you need to do, is disable this block for those pages. Read about TP dynamic blocks for more info. Also note, that as an Administrator, you can go directly to your SMF ACP (which typically you would normally have TP Blocks disabled for) and can disable the block if you run into an issue such as you did, rather than having to go to the page using a proxy. example: http://www.yoursite.com/index.php?action=admin
You can also simply remove your IP from the table via your phpMyAdmin.
In the future, I'll add exclusion IPs, and maybe a direct control panel to the table. However, it was a quick block based on a user request, so it was not made with a slew of options originally.
Thanks Thurnok and IchBin for your replies.. This helps... ;D
Very very nice. This allows me to open up all of my boards to Guests. I was restricting some of them previously.
KIND REQUEST I know the IPs of the Google and Yahoo spiders (Who is Online Mod). Can you please write a small routine that excludes certain IPs from this page view limit? There would only have to be a few excluded IPs, so we could put them in a string. Another idea would be to have one limit parameter for everyone of say 10, and then a limitless parameter (or some crazy large number) for defined IPs.
Thankyou.
Update 1.1:
- disabled at Registration/Login/Password reminder pages regardless if you set the block to be enabled on those pages
- you can set "special" guests (IPs) to have a higher limit than regular guests using $gpvl_SpecialIPs variable
- you can set excluded IPs (to exclude bots/spiders for example, so they can scan all your pages)
$gpvl_MaxPagesSpecial = number of pages that special guests can view before being directed to register
$gpvl_SpecialIPs = an array of IPs that are considered special guests
$gpvl_ExcludeIPs = an array of IPs that are excluded from page view limits
See new code in first post.
Greetings!
I see, you are working at this, so I like to give my hint again.
For example. I try the link in the first post
To see it in action, you can go to my [url=http://tpblocks.ccs-net.com/]TP Blocks site[/url] as a guest, view 3 pages and you will be redirected to the SMF Registration page.
Now I canÃ,´t go to your page anymore, I canââ,¬â,,¢t see what you offer there and Iââ,¬â,,¢m constrained to register.
Well, I know where I am, what you offer and so. But imagine, that I have found your page via google. Klick at Forum, Then Public, than About this area and ... nothing more to see.
Itââ,¬â,,¢s usefull to allow google & co. to search. But itââ,¬â,,¢ also usefull to have guest who bookmark and return and register because of the contend.
Because of that and in my humble opinion, it would be better to show the register page after x klicks but after that, the counter should restart. This way it will not cause extra work for an admin to care for a SpecialIPs list.
Btw. I donÃ,´t know how it should be possible to figure out who is a special guest. I know, Iââ,¬â,,¢m not special ;-) And I have a dynamic IP.
I have written down my qualms before
Re: [Block] Guest Page View Limit (http://www.tinyportal.net/index.php?topic=10625.msg91335#msg91335)
Re: [Block] Guest Page View Limit (http://www.tinyportal.net/index.php?topic=10625.msg91557#msg91557)
@ianus:
The example you state, going to 3 pages on my site, then having to register is because I have it set to 3 page views as a guest so that existing members can test it without having to view hundreds of pages as a guest before seeing the results. This was intentional. In practical use for most sites that number would probably be much higher, though can be whatever the Admin of the site wants it to be. Again, this is intentional. As far as my own site, one must register to view my various blocks, and test/use them at my site, and that of course is also intentional.
Your ideas are good, however, there is already a registration reminder mod at SMF, so doing something that is simply a reminder is somewhat a duplication of effort. This block was produced as a request to prevent someone from viewing the site as a guest more than x number of times. What you are looking for changes the entire basis for this block. The basis for this block is to prevent guests from viewing your site, more than x times, forcing them to register if they wish to continue viewing content on your site. If you simply want to display a registration reminder, allowing a guest to continue viewing the site, my suggestion would be to get the SMF mod that already performs this function.
Additionally, the "special" IPs and "excluded" IPs enhancement was based on a request to enhance this block, but still keep its basic intent. In otherwords, still prevent "real user" guests from infinately viewing the site, but allow various bots and spiders (for which there are known staic IPs) to not be blocked after x number of views so that they can infinately scan your site to update search engine pages.
Yea, this is nice coding. I implemented it at www.ps3hax.com
Then I linked the code to an article that has a nice message and a href to the registration as well as one to the login for existing users (left & right blocks are removed for article).
Check it out as a guest, it will take you 10 clicks to get to the article to test it.
Yep... I just checked it out Haxen. Nice implementation. :)
Greetings!
Sorry for the delay. Overlook the sent notification.
Thanks for your polite answer which makes things clear, even to me.
I choose your side only as an example, to make my arguments more understandable.
I understand your intention and Iââ,¬â,,¢m sure, you will get me as an member, as soon as I can set up my SMF1.1.x & TP. Your offerings are worth enough to spend the time and register, for sure.
I know the ââ,¬Å¾Reminder ââ,¬â€œ mod ââ,¬Å" (http://custom.simplemachines.org/mods/index.php?mod=363) and also, I see the duplication of effort. Personally, I would name it increase in capacity. Nevertheless, your position is clear and this mod is a great feature with or without this snippet.
So there arenÃ,´t ââ,¬Å"more special guestââ,¬Â, mmh.
Antecedes and face your destiny ââ,¬â€œ your will see, we are all the same ââ,¬â€œ but google is different.
Why? Because, If Mr. (or Mrs.) Death have the suspicion to leave out a soul, he (she) perform a quick search. >:D
I bow my head.
Have a lot of fun and success with everything you do.
Thurnok, I have found that Google spiders could possibly range their IPs from 66.249.64.0 - 66.249.95.255
How would we describe this entire range as being exempt from the Guest Page View Limit, this would surely give access to Googlebot no matter what IP they come from. I am sure others will benefit from your solution.
thanks, :up:
@haxen
Yes, I can see that might be a problem. Alot of other spiders only have 1 or 2 IPs, but since Google is so large these days... Hrm... I will add an IP mask to the "excluded" and "special" IP arrays for the next update. I'll probably keep it relatively simple, and not support all the possible ways for displaying an IP mask (in other words, I'll probably use 4 dot notation masks, but not CIDR notation). Also, I probably will not include IPv6.
So probably something like array('113.27.61.*', '66.249.64.0-66.249.95.255');
@ianus
Ah.. does the Regbar warning mod have the features you need? I haven't used it myself, only saw it in the list of mods and its purpose. I think there was one other mod that mentions something about registration notifications as well. If not, you can probably get something similar to the way haxen has implemented this block on your site with some similar features. Take a look at haxen's site mentioned in his post above and see if that is more of what you are looking to do.
I have this block on my site and have not seen a slow down in spiders at all. Very nice little feature Thurnok :up:
Thurok, can I simply replace your existing code with the
array('113.27.61.*', '66.249.64.0-66.249.95.255'); (for example) or do you need to provide code more to understand the * and the range above?
thanks.
Greetings!
ââ,¬Å¾Ah.. does the Regbar warning mod have the features you need?ââ,¬Å"
Maybe. I think, I try a ââ,¬Å"show only to Guestââ,¬Â block instead.
I insert some advertising or a picture of my face and the option to remove this ugly box after a registration.
In any case, thanks for your kind support and great care.
@ianus
Yes, TP will allow you to show a block only to guests. It is a nice feature built right in. You can basically make that block look any way you please, including HTML code, Javascript code, and php code as necessary.
@haxen
No, unfortunately it will take more code than simply sticking in an IP mask within the array. Right now a simple in_array() function is used and that simply compares a string to each string in the array. So it will not match a full IP to an IP with asterisks or dashes and such in it.
Great block-snippet Thur..
been looking for something like this..I like. :)
I'm just about to try out this script.
Is there a way I can show a center block on the registration page once the page view limit hase been reached, and not before.
I'd like to give an explanation of why a guest has suddenly been redirected to a registration page.
Ok... here's the solution.
- Use the new code in the first post of this thread to replace your existing block code.
- Create an additional Center phpblock (name it something like Registration Welcome)
- Set it to only display for Guests
- Set the "Show for this action (custom action name)" to Register in the pull down menu
- Put the following code into the Registration Welcome phpblock and modify the message info to your liking (note: BBC supported!):
// a regular "Welcome to registration" message for those electing to register on their own
$gpvl_regular_msg = parse_bbc("[b]Welcome to the Registration Page.[/b]\nPlease read the Registration Agreement carefully before signing!");
// the "You have exceeded" registration message for those viewing more pages than allowed as a guest
$gpvl_exceeded_msg = parse_bbc("[b]Welcome to the Registration Page[/b]\nYou have reached this page because you have viewed more pages on this site than is allowed as a guest. Please register on the site to continue your viewing pleasure. Make sure you read the Registration Agreement below carefully before signing!");
// did they get here normally (selecting to register) or where they directed by GPVL?
$gpvl_exceed = empty($_GET['gpvl']) ? '' : $_GET['gpvl'];
if (empty($gpvl_exceed)){
echo $gpvl_regular_msg;
} else {
echo $gpvl_exceeded_msg;
}
Thanks Thurnok, do you know of a way to edit the Registration Agreement?
I get this message displayed when I view the agreement:
Warning - agreement.txt is not writable, any changes you make will NOT be saved.
Either that, or I'm missing a simple way to edit it, I guess it can be edited from the file on the server.
[Edit]... okay, I didn't realise you were making an edit. Apologies.
Very cool, thanks for this! Hopefully we'll have more members than lurkers ::)
Quote from: Zetan on March 11, 2007, 12:06:53 AM
Thanks Thurnok, do you know of a way to edit the Registration Agreement?
I get this message displayed when I view the agreement:
Warning - agreement.txt is not writable, any changes you make will NOT be saved.
Either that, or I'm missing a simple way to edit it, I guess it can be edited from the file on the server.
[Edit]... okay, I didn't realise you were making an edit. Apologies.
You have to chom'd that file to 777. Just right click that file via FTP at the root of your forum, right click and set the permissions to 777.
Quote from: RoarinRow on March 11, 2007, 05:12:58 AM
You have to chom'd that file to 777. Just right click that file via FTP at the root of your forum, right click and set the permissions to 777.
I thought so...
Thank you Thurnok. This is a great snippit.
Either more people will register.. or won't return :P
Not sure which yet. Has anybody found more people register on their site using Thurnocks snippit?
Thurnok, can I take the excluded IPs further for Yahoo, Google, and MSNbots a step further if I had something like this in the excludeIPs section -
// Set the IPs you want excluded from the limit - like google/spiders etc. in an array - same format as "special" guest array
$gpvl_ExcludeIPs = array('127.0.0.1', '74.*.*.*', '72.*.*.*', '65.*.*.*', '66.*.*.*');
Quote from: Zetan on March 11, 2007, 10:52:15 AM
Either more people will register.. or won't return :P
Not sure which yet. Has anybody found more people register on their site using Thurnocks snippit?
Actually, not to bring affense to Thurnok for making this or any people using this but... as a guest browsing some websites. it gets so annoying I just never return. :P
Brianjw
Quote from: Brianjw on March 12, 2007, 02:35:54 AM
Quote from: Zetan on March 11, 2007, 10:52:15 AM
Either more people will register.. or won't return :P
Not sure which yet. Has anybody found more people register on their site using Thurnocks snippit?
Actually, not to bring affense to Thurnok for making this or any people using this but... as a guest browsing some websites. it gets so annoying I just never return. :P
Brianjw
I have to agree with you there Brian.
However, I've set it so the Home Page is still available to guests.
It's set at 20 forum views, which is reasonable.. I may raise it to 30.
People find the information to a subject through a google search.
I've seen many guests viewing a thread on my site that is about a new forthcoming music release. They can still view threads by going through links and through the Recent Posts on the Home Page.
I'm keeping an eye on it... It's mainly an attempt to persuade habitual lurkers to register. If I find it is counter productive, then I will consider removing it.
ZTN
@Roarin
Sorry, it won't work that way currently. It's a string search compare so asterisks don't work as wildcards there. I'll have to make a specific function to do it. I'll look into that in the near future since it would seem a logical thing to have.
@Brian
Do you visit the same site a hundred times as a guest? It would seem that if a site was worth visiting more than 20 or 30 times, you would register on it anyway. Which is the main purpose of the snippet. ;)
@Zetan
Yes, you have discovered the ultimate use of the snippet. Since it only works where you allow the block to be "enabled" (technically "viewed", but the intent of course is for the block to be hidden from view, so "enabled"), it allows you to do exactly what you are doing with it.
So the best and obviously suggested method of use is to allow guests to always hit your homepage, but force them to register if they are interested enough in viewing your forums 20 or 30 times (or of course whatever the admin's desired number is).
In any case, it is definately usefull for weeding out the lurkers if your board has that particular problem.
Cool, looking forward to the update. I don't want to restrict the Googlebots and Spiders :up:
Quote from: RoarinRow on March 12, 2007, 07:09:42 PM
Cool, looking forward to the update. I don't want to restrict the Googlebots and Spiders :up:
Have noticed any increase in your rankings?
I like this mod... very handy. Now there's no more lurker in my site heehe.. thanks!
thanks nice one
good script, very good :up:
Question,
If Guest exceeds the max. page count, they must register, but the next day, the guests can view another 10 pages?
Is it possible to select more then 1 board were the block is enabled?
because on the frontpage I have forum posts, and now I only selected one board..
The limit doesn't refresh. In otherwords, once they reach the limit and have to register, they cannot view the pages as guest anymore. At least from that IP address, which is what it is based on.
The block can be enabled wherever you wish, limited only by TinyPortal's ability to display (or maybe a better word is enable) a block. So it basically means with a little planning, and adjusting where your blocks can be displayed or not, allows you to make some pages accessable to a guest and others not (once they have reached their limit).
Quote from: Tank on November 17, 2006, 07:10:00 AM
Thanks alot - i needed this ;)
Edit: Argghh ! :P something is wrong with the script.. when i test it its working fine, but it takes ages for it to send the guest to the registration page... it just sit there loading for a very very long time.. what can be the cause of this ? if i disable the script while the other computer is loading it loads instantly the second i disable the script.. :o
I really needed this as well.
Perfect work and you made my day ... thanks,
Wim
Cool script, and works great, but is there a possibility to "warn" the user? Like "okay you viewed xx times to board, go on and register"?
As far as i know the script allready does this. when they reach the limit, a box with the registration page will show up asking them to register
Quote from: haxen on January 11, 2007, 08:29:49 PM
Thurnok, I have found that Google spiders could possibly range their IPs from 66.249.64.0 - 66.249.95.255
How would we describe this entire range as being exempt from the Guest Page View Limit, this would surely give access to Googlebot no matter what IP they come from. I am sure others will benefit from your solution.
thanks, :up:
The correct list of IP's of Robots you can find here:
http://www.iplists.com/
Here is the google ip list if you want to let google into the site and restrict guests. PS - thanks for the great script. $gpvl_ExcludeIPs = array('209.185.108', '209.185.253', '209.85.238.11', '216.239.33.96', '216.239.33.97', '216.239.33.98', '216.239.33.99', '216.239.37.98', '216.239.37.99', '216.239.39.98', '216.239.39.99', '216.239.41.96', '216.239.41.97', '216.239.41.98', '216.239.41.99', '216.239.45.4', '216.239.46', '216.239.51.96', '216.239.51.97', '216.239.51.98', '216.239.51.99', '216.239.53.98', '216.239.53.99', '216.239.57.96', '216.239.57.97', '216.239.57.98', '216.239.57.99', '216.239.59.98', '216.239.59.99', '216.33.229.163', '64.233.173.193', '64.233.173.194', '64.233.173.195', '64.233.173.196', '64.233.173.197', '64.233.173.198', '64.233.173.199', '64.233.173.200', '64.233.173.201', '64.233.173.202', '64.233.173.203', '64.233.173.204', '64.233.173.205', '64.233.173.206', '64.233.173.207', '64.233.173.208', '64.233.173.209', '64.233.173.210', '64.233.173.211', '64.233.173.212', '64.233.173.213', '64.233.173.214', '64.233.173.215', '64.233.173.216', '64.233.173.217', '64.233.173.218', '64.233.173.219', '64.233.173.220', '64.233.173.221', '64.233.173.222', '64.233.173.223', '64.233.173.224', '64.233.173.225', '64.233.173.226', '64.233.173.227', '64.233.173.228', '64.233.173.229', '64.233.173.230', '64.233.173.231', '64.233.173.232', '64.233.173.233', '64.233.173.234', '64.233.173.235', '64.233.173.236', '64.233.173.237', '64.233.173.238', '64.233.173.239', '64.233.173.240', '64.233.173.241', '64.233.173.242', '64.233.173.243', '64.233.173.244', '64.233.173.245', '64.233.173.246', '64.233.173.247', '64.233.173.248', '64.233.173.249', '64.233.173.250', '64.233.173.251', '64.233.173.252', '64.233.173.253', '64.233.173.254', '64.233.173.255', '64.68.80', '64.68.81', '64.68.82', '64.68.83', '64.68.84', '64.68.85', '64.68.90.178', '64.68.90.179', '64.68.90.18', '64.68.90.180', '64.68.90.181', '64.68.90.182', '64.68.90.183', '64.68.90.184', '64.68.90.185', '64.68.90.186', '64.68.90.187', '64.68.90.188', '64.68.90.189', '64.68.90.19', '64.68.90.190', '64.68.90.191', '64.68.90.192', '64.68.90.193', '64.68.90.194', '64.68.90.195', '64.68.90.196', '64.68.90.197', '64.68.90.198', '64.68.90.199', '64.68.86', '64.68.90.156', '64.68.90.157', '64.68.90.158', '64.68.90.159', '64.68.90.16', '64.68.90.160', '64.68.90.161', '64.68.90.162', '64.68.90.163', '64.68.90.164', '64.68.90.165', '64.68.90.166', '64.68.90.145', '64.68.90.146', '64.68.90.147', '64.68.90.148', '64.68.90.149', '64.68.90.15', '64.68.90.150', '64.68.90.151', '64.68.90.152', '64.68.90.153', '64.68.90.154', '64.68.90.155', '64.68.87', '64.68.88', '64.68.89', '64.68.90.1', '64.68.90.10', '64.68.90.11', '64.68.90.12', '64.68.90.129', '64.68.90.13', '64.68.90.130', '64.68.90.131', '64.68.90.132', '64.68.90.133', '64.68.90.167', '64.68.90.168', '64.68.90.169', '64.68.90.17', '64.68.90.170', '64.68.90.171', '64.68.90.172', '64.68.90.173', '64.68.90.174', '64.68.90.175', '64.68.90.176', '64.68.90.177', '64.68.90.2', '64.68.90.20', '64.68.90.200', '64.68.90.201', '64.68.90.202', '64.68.90.203', '64.68.90.204', '64.68.90.205', '64.68.90.206', '64.68.90.207', '64.68.90.208', '64.68.90.21', '64.68.90.22', '64.68.90.23', '64.68.90.24', '64.68.90.25', '64.68.90.26', '64.68.90.27', '64.68.90.28', '64.68.90.29', '64.68.90.3', '64.68.90.30', '64.68.90.31', '64.68.90.32', '64.68.90.33', '64.68.90.34', '64.68.90.35', '64.68.90.36', '64.68.90.37', '64.68.90.38', '64.68.90.39', '64.68.90.4', '64.68.90.40', '64.68.90.41', '64.68.90.42', '64.68.90.43', '64.68.90.44', '64.68.90.45', '64.68.90.46', '64.68.90.47', '64.68.90.48', '64.68.90.49', '64.68.90.5', '64.68.90.50', '64.68.90.51', '64.68.90.52', '64.68.90.53', '64.68.90.54', '64.68.90.55', '64.68.90.56', '64.68.90.57', '64.68.90.58', '64.68.90.59', '64.68.90.6', '64.68.90.60', '64.68.90.61', '64.68.90.62', '64.68.90.63', '64.68.90.64', '64.68.90.65', '64.68.90.66', '64.68.90.67', '64.68.90.68', '64.68.90.69', '64.68.90.7', '64.68.90.70', '64.68.90.71', '64.68.90.72', '64.68.90.73', '64.68.90.74', '64.68.90.75', '64.68.90.76', '64.68.90.77', '64.68.90.78', '64.68.90.79', '64.68.90.8', '64.68.90.80', '64.68.90.9', '64.68.91', '64.68.92', '66.249.64', '66.249.65', '66.249.66', '66.249.67', '66.249.68', '66.249.69', '66.249.70', '66.249.71', '66.249.72', '66.249.73', '66.249.78', '66.249.79', '72.14.199');
cheers Ferd