TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 411
  • Total: 411

[Block] Guest Page View Limit

Started by Thurnok, November 17, 2006, 04:51:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JDMhustle

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

Thurnok

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.  :)

haktanir

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.

Gargoyle

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!!

IchBin

You're right. If its not in a block that is activated it won't work.

Thurnok

@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.

Gargoyle

Thanks Thurnok and IchBin for your replies.. This helps... ;D

haxen

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.

Thurnok

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.

ianus

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
Re: [Block] Guest Page View Limit

This website is proudly hosted on Crocweb Cloud Website Hosting.