• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Maximum Guest Views by Waindigo [Deleted]

Jon W

Well-known member
#1
Waindigo submitted a new resource:

Maximum Guest Views by Waindigo - Limit the number of posts that guests and/or unconfirmed users can view before register/confirming.

Description:

This add-on adds an option to limit the number of posts that guests and/or unconfirmed users can view before they have to register or complete their registration.

You can also exclude certain forums from being affected by this restriction.

Installation:
  • Upload contents of upload folder to root directory, overwriting any existing files.
  • Install addon-Waindigo_MaxGuestViews.xml file.
Licence and support:...
Read more about this resource...
 

Moshe1010

Well-known member
#4
Is it possible to make a custom message for users with two levels? Level one message only to register at the top and level 2 complete block with a message?( Like vB?)
 

Jon W

Well-known member
#5
Is it possible to make a custom message for users with two levels? Level one message only to register at the top and level 2 complete block with a message?( Like vB?)
Not sure I understand -- although it has been a long night, so it is probably just me. Can you please explain with pictures? ;)
 
#8
Good Work @Waindigo

How does this plugin detects the number of pages views? With cookies or database?

I dont know why, but it's not working with invalid users. I have marked both boxes.
 

Jon W

Well-known member
#9
Good Work @Waindigo

How does this plugin detects the number of pages views? With cookies or database?

I dont know why, but it's not working with invalid users. I have marked both boxes.
Thanks. It uses cookies.

Try replacing this code in library/Waindigo/MaxGuestViews/Extend/XenForo/Model/Thread.php:
Code:
        //Set the cookies for users who haven't validated their accounts yet
        if (!isset($_COOKIE['invalid_views'])) {
            if (!self::$cookieSet) {
                setcookie("invalid_views", "1");
                self::$cookieSet = true;
            }
        } else {
            $invalid_views = $_COOKIE['invalid_views'] + 1;
            if (!self::$cookieSet) {
                setcookie("invalid_views", $invalid_views);
                self::$cookieSet = true;
            }
        }
with:
Code:
        //Set the cookies for users who haven't validated their accounts yet
        if (!isset($_COOKIE['invalid_views'])) {
            if (!self::$cookieSet) {
                setcookie("invalid_views", "1", time() + 3600, "/");
                self::$cookieSet = true;
            }
        } else {
            $invalid_views = $_COOKIE['invalid_views'] + 1;
            if (!self::$cookieSet) {
                setcookie("invalid_views", $invalid_views, time() + 3600, "/");
                self::$cookieSet = true;
            }
        }
 

Moshe1010

Well-known member
#13
Not sure I understand -- although it has been a long night, so it is probably just me. Can you please explain with pictures? ;)
It works like this:
1. Let's say you set view of 5 threads for level1. After a vistor enters 5 threads, it shows a message at the top of the board; custom message that you can edit through ACP. At level1, users don't get a complete block, they can still visit threads until level 2
2. Then, you can set that after 10 threads level2 is activated and users are shown a message (again, custom through ACP) that they need to register. At this level, they are complete blocked, and they can also view the list of nodes/threads, but cannot enter a thread (it shows them the message again).

You can set a timer for how long you want to block users (through ACP), and you can choose if you want to activate level 1, 2 or both. You can test here:
http://www.theadminzone.com/forums/

Try to visit about 5 threads, you will get to level 1. Then keep entering different threads, and you will get to level 2.

How does this affect bots such as Google, considering they're a guest pretty much.
Bots don't have cookies, so it doesn't affect them. However, a whitelist and bot detection as a backup would be appreciated.
 
#18
@Waindigo on ACP -> Admin Log

A lot of errors like this one below, when used with another plugin Login As User.

ErrorException: Undefined index: is_robot - library/Waindigo/MaxGuestViews/Extend/XenForo/Model/Thread.php:22