Limited Guest Viewing

Limited Guest Viewing [Paid] 1.7.3

No permission to buy ($20.00)
Thanks. I tried that and it still came out red :( Edit. I had missed the first line off. That works :) There is still a red cross though and a red line round the border of it.
This is what I get with the default style using the code below:

1689555336349.webp

Code:
.blockMessage.blockMessage--error
{
    background: white;
    color: black;
    border-left: 0px solid white;
}
.blockMessage.blockMessage--error.blockMessage--iconic:before
{
    color: green;
}
I don't see any red remaining in this example.
 
Thank you! This is much better. However I still have a thin red line round three sides. Maybe because I'm not using the default style? I'm using a pixel exit style.

Warning edited.webp
 
However I changed border-left :0px to
border: 0px

And that did the trick :) (so I just took "left" out). I know nothing about coding btw, just took a guess!

Is there any way of changing the icon? Or just removing it? Your help has been greatly appreciated!
 
I just changed the colour to white for the icon so it doesn't show. Although replacing the icon with something different to a cross might be nice :-)

There is another warning still comes up in red if someone tries to then register, and enters a username that isn't available.

Warning edited 2.webp
 
There is another warning still comes up in red if someone tries to then register, and enters a username that isn't available.
That's a Xenforo default alert; I think you can possibly modify that one through CSS with the .inputValidationError location. You'd have to play with the color, background and border attributes just as you did in the previous example.
Is there any way of changing the icon? Or just removing it? Your help has been greatly appreciated!
I assume there is a way, but haven't tried doing it myself. Will take a look next time I swing around to the test site.
 
Thanks - really appreciate your help so far. The username not available alert isn't a big issue really. The registration warning looks better on my site now with the colours adjusted. It would be great if there is an option to change the symbol but meanwhile I've left it very pale and less obtrusive.
 
hiya @Wutime

am i correct in assuming, whilst i can exclude certain forum sections from the count towards the guest limit

after the guest limit has been reached, then this will also limit viewing on excluded forum sections

the exclusion feature for specific forum section is just for 'count' and does not exclude specific forum section from the guest view limit, after the user limit has been reached ?
 
the exclusion feature for specific forum section is just for 'count' and does not exclude specific forum section from the guest view limit, after the user limit has been reached ?
Yes, you're right.

Would you like to allow "excluded" forums from both the count, and from forcing registration?

If so, an update is in order, which I'm willing to do.

The only issue being, it might work a bit wonky for anyone that's "counting" on "Homepages" and "Forum Thread List" pages because the user may not be able to browse to the "post pages" once the forced redirection starts occurring.

Though, with that said, there are instructions under the "Page types for view tracking" that says:

We recommend ignoring most types of pages except the actual content pages (posts/threads)
  • [Thread post pages ] should always be enabled - these are your content pages
  • You can add other page types here if you want to be more aggressive
  • Example: you could add [Search pages]; but given all searches lead to views on [Thread post pages] we don't recommend it
 
hiya @Wutime

am i correct in assuming, whilst i can exclude certain forum sections from the count towards the guest limit

after the guest limit has been reached, then this will also limit viewing on excluded forum sections

the exclusion feature for specific forum section is just for 'count' and does not exclude specific forum section from the guest view limit, after the user limit has been reached ?
Yes, you're right.

Would you like to allow "excluded" forums from both the count, and from forcing registration?

If so, an update is in order, which I'm willing to do.

The only issue being, it might work a bit wonky for anyone that's "counting" on "Homepages" and "Forum Thread List" pages because the user may not be able to browse to the "post pages" once the forced redirection starts occurring.

Though, with that said, there are instructions under the "Page types for view tracking" that says:

hiya @Wutime thanks for the response

I would like to have the option of having specific forum sections excluded from the forced registration (y)
 
Last edited:
Wutime updated Limited Guest Viewing with a new update entry:

New option + exclusion fix for excluded pages from view tracking (quality of life update)

  • New option added (on by default) (shown below)
    • "Allow viewing of excluded forums after guest view count reached"
  • Limited Guest Viewing will allow continued viewing of "excluded" forums even when the maximum number of views has been triggered
    • Note, if enabled, you must not "view track" for page types such as: Homepage and Thread List Pages, otherwise the visitor will be pigeon holed to the registration page when trying to navigate to...

Read the rest of this update entry...
 
Wutime updated Limited Guest Viewing with a new update entry:

v1.7.3 - New option + exclusion fix for excluded pages from view tracking (quality of life update)

  • New option added (on by default) (shown below)
    • "Allow viewing of excluded forums after guest view count reached"
  • Limited Guest Viewing will allow continued viewing of "excluded" forums even when the maximum number of views has been triggered
    • Note, if enabled, you must not "view track" for page types such as: Homepage and Thread List Pages, otherwise the visitor will be pigeon holed to the registration page when trying to navigate to...

Read the rest of this update entry...
 

Hi,
thanks for the update, but since I installed it yesterday, it keeps giving errors similar to this:

PHP version 8.0.30

Code:
ErrorException: [E_WARNING] Undefined array key "thread_id" src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php:37
Generado por: Cuenta desconocida 20 Ene 2024 a las 13:50

Code:
#0 src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php(37): XF::handlePhpError(2, '[E_WARNING] Und...', '/home/******/...', 37)
#1 src/XF/App.php(908): Wutime\LimitedGuestViewing\XF\Session\Session->start(Object(XF\Http\Request))
#2 src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/Pub/App.php(48): XF\Container->offsetGet('session.public')
#4 src/XF/Container.php(31): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#5 src/XF/App.php(2833): XF\Container->offsetGet('session')
#6 src/XF/Pub/App.php(153): XF\App->session()
#7 src/XF/App.php(2483): XF\Pub\App->start(true)
#8 src/XF.php(524): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

Code:
array(4) {
  ["url"] => string(8) "/threads"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}


Code:
ErrorException: [E_WARNING] Attempt to read property "node_id" on null src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php:39
Generado por: Cuenta desconocida 20 Ene 2024 a las 01:08

Code:
#0 src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php(39): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/****/...', 39)
#1 src/XF/App.php(908): Wutime\LimitedGuestViewing\XF\Session\Session->start(Object(XF\Http\Request))
#2 src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/Pub/App.php(48): XF\Container->offsetGet('session.public')
#4 src/XF/Container.php(31): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#5 src/XF/App.php(2833): XF\Container->offsetGet('session')
#6 src/XF/Pub/App.php(153): XF\App->session()
#7 src/XF/App.php(2483): XF\Pub\App->start(true)
#8 src/XF.php(524): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

Code:
array(4) {
  ["url"] => string(38) "/threads/phone-number-en-multics.73414"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Hi,
thanks for the update, but since I installed it yesterday, it keeps giving errors similar to this:

PHP version 8.0.30

Code:
ErrorException: [E_WARNING] Undefined array key "thread_id" src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php:37
Generado por: Cuenta desconocida 20 Ene 2024 a las 13:50

Code:
#0 src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php(37): XF::handlePhpError(2, '[E_WARNING] Und...', '/home/******/...', 37)
#1 src/XF/App.php(908): Wutime\LimitedGuestViewing\XF\Session\Session->start(Object(XF\Http\Request))
#2 src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/Pub/App.php(48): XF\Container->offsetGet('session.public')
#4 src/XF/Container.php(31): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#5 src/XF/App.php(2833): XF\Container->offsetGet('session')
#6 src/XF/Pub/App.php(153): XF\App->session()
#7 src/XF/App.php(2483): XF\Pub\App->start(true)
#8 src/XF.php(524): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

Code:
array(4) {
  ["url"] => string(8) "/threads"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}


Code:
ErrorException: [E_WARNING] Attempt to read property "node_id" on null src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php:39
Generado por: Cuenta desconocida 20 Ene 2024 a las 01:08

Code:
#0 src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php(39): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/****/...', 39)
#1 src/XF/App.php(908): Wutime\LimitedGuestViewing\XF\Session\Session->start(Object(XF\Http\Request))
#2 src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/Pub/App.php(48): XF\Container->offsetGet('session.public')
#4 src/XF/Container.php(31): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#5 src/XF/App.php(2833): XF\Container->offsetGet('session')
#6 src/XF/Pub/App.php(153): XF\App->session()
#7 src/XF/App.php(2483): XF\Pub\App->start(true)
#8 src/XF.php(524): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

Code:
array(4) {
  ["url"] => string(38) "/threads/phone-number-en-multics.73414"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
I fixed it by making this change to the Session.php to make sure the keys are set before trying to access them:

Replace:
PHP:
        // get forum_id using thread_id
        if ($controller == 'XF:Thread') {
            // get the thread_id
            $thread_id = \XF::app()->router()->routeToController(\XF::app()->request()->getRoutePath())->getParams()['thread_id'];
            // Use the finder to get the thread
            $forum_id = \XF::app()->finder('XF:Thread')->where('thread_id', $thread_id)->fetchOne()->node_id;
        }

With this:
PHP:
        // get forum_id using thread_id
        if ($controller == 'XF:Thread') {
            // get the thread_id
            $params = \XF::app()->router()->routeToController(\XF::app()->request()->getRoutePath())->getParams();

            // Verificar si 'thread_id' está definido en $params antes de intentar acceder a él
            $thread_id = isset($params['thread_id']) ? $params['thread_id'] : null;

            // Utilizar el finder solo si $thread_id está definido
            if ($thread_id !== null) {
                $thread = \XF::app()->finder('XF:Thread')->where('thread_id', $thread_id)->fetchOne();

                // Verificar si se encontró un hilo antes de intentar acceder a 'node_id'
                if ($thread && $thread->node_id !== null) {
                    $forum_id = $thread->node_id;
                } else {
                    // Manejar la situación en la que no se encuentra el hilo o 'node_id' es null
                    $forum_id = null; // o proporciona un valor predeterminado por defecto en vez de null
                }
            } else {
                // Manejar la situación en la que 'thread_id' no está definido
                $forum_id = null; // o proporciona un valor predeterminado por defecto en vez de null
            }

        }

There are no more errors and the plugin continues to work without any problem ;)
 
Hi,
thanks for the update, but since I installed it yesterday, it keeps giving errors similar to this:

PHP version 8.0.30

Code:
ErrorException: [E_WARNING] Undefined array key "thread_id" src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php:37
Generado por: Cuenta desconocida 20 Ene 2024 a las 13:50

Code:
#0 src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php(37): XF::handlePhpError(2, '[E_WARNING] Und...', '/home/******/...', 37)
#1 src/XF/App.php(908): Wutime\LimitedGuestViewing\XF\Session\Session->start(Object(XF\Http\Request))
#2 src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/Pub/App.php(48): XF\Container->offsetGet('session.public')
#4 src/XF/Container.php(31): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#5 src/XF/App.php(2833): XF\Container->offsetGet('session')
#6 src/XF/Pub/App.php(153): XF\App->session()
#7 src/XF/App.php(2483): XF\Pub\App->start(true)
#8 src/XF.php(524): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

Code:
array(4) {
  ["url"] => string(8) "/threads"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}


Code:
ErrorException: [E_WARNING] Attempt to read property "node_id" on null src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php:39
Generado por: Cuenta desconocida 20 Ene 2024 a las 01:08

Code:
#0 src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php(39): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/****/...', 39)
#1 src/XF/App.php(908): Wutime\LimitedGuestViewing\XF\Session\Session->start(Object(XF\Http\Request))
#2 src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/Pub/App.php(48): XF\Container->offsetGet('session.public')
#4 src/XF/Container.php(31): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#5 src/XF/App.php(2833): XF\Container->offsetGet('session')
#6 src/XF/Pub/App.php(153): XF\App->session()
#7 src/XF/App.php(2483): XF\Pub\App->start(true)
#8 src/XF.php(524): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

Code:
array(4) {
  ["url"] => string(38) "/threads/phone-number-en-multics.73414"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
I also have these errors. Any official update on this @Wutime?

Thanks
 
same error

  • ErrorException: [E_WARNING] Attempt to read property "node_id" on null
  • src/addons/Wutime/LimitedGuestViewing/XF/Session/Session.php:39
 
Top Bottom