• Welcome to Simple Machines Community Forum. Please login or sign up.

Limit Thread Views for Guests -- Motive Guests to Register

Started by Doug Heffernan, March 04, 2018, 04:49:03 PM

Previous topic - Next topic

Doug Heffernan

Link to Mod

What does this mod do?


  • This mod is intended to use cookies to limit the number of times that your  guests can view threads your forum. The limit will be for a day, after which it will expire and it will be repeated again after the number of view limiti has been reached again. Individual boards can be excluded from the limit.
    The whole idea behind this concept is to hopefully motivate guests to register.

What about search bots?


  • The search bots will not be impacted by this when it comes to spidering your site, because usually bots do not generally use cookies. However, they are not excluded from the view limit. Because doing that is against Google toss and it is considered cloacking.

Installation.


  • The mod can be installed through the Package Manager in your Admin Panel.

Configuration.

The mod adds its own tab with 2 settings in the Modification Settings. The mod tab is called Limit Guest Views Settings. One setting is to enter the number of thread views that a guest can have before getting the error message. The other setting is to exclude individual boards from this limit.

-Rock Lee-

It seems pretty good let's try it also I leave the translations into Latin Spanish ;D

Code (Help.spanish_latin.php) Select
$helptxt['num_views'] = 'Este campo de configuración contiene el número de visitas que desea limitar a sus invitados para ver su foro. Una vez que se haya alcanzado el número de visitas, los invitados ya no podrán ver su foro. Tendrán que registrar una nueva cuenta o iniciar sesión.';
$helptxt['excluded_boards'] = 'Ingrese la(s) identificación(es) del(os) foro(s) que desea excluir del límite de vista. Para excluir más de una placa, separe los identificadores con una coma. es decir, 1,2,3,4';


Code (Help.spanish_latin-utf8.php) Select
$helptxt['num_views'] = 'Este campo de configuración contiene el número de visitas que desea limitar a sus invitados para ver su foro. Una vez que se haya alcanzado el número de visitas, los invitados ya no podrán ver su foro. Tendrán que registrar una nueva cuenta o iniciar sesión.';
$helptxt['excluded_boards'] = 'Ingrese la(s) identificación(es) del(os) foro(s) que desea excluir del límite de vista. Para excluir más de una placa, separe los identificadores con una coma. es decir, 1,2,3,4';


Code (Modifications.spanish_latin.php) Select
$txt['guestviews_settings'] = 'Limitar la configuración de visitas de invitados';
$txt['num_views'] = 'Ver Límite';
$txt['excluded_boards'] = 'Foros excluidos';
$txt['views_reached_error_message'] = 'Has alcanzado el número m&aacute;ximo de %s vistas establecidas por el administrador. Si desea continuar viendo el resto de los temas en nuestro foro, debe <a href="./index.php?action=login">Iniciar sesi&oacute;n</a> o <a href="./index.php?action=register">Reg&iacute;strarte</a>.';


Code (Modifications.spanish_latin-utf8.php) Select
$txt['guestviews_settings'] = 'Limitar la configuración de visitas de invitados';
$txt['num_views'] = 'Ver Límite';
$txt['excluded_boards'] = 'Foros excluidos';
$txt['views_reached_error_message'] = 'Has alcanzado el número máximo de %s vistas establecidas por el administrador. Si desea continuar viendo el resto de los temas en nuestro foro, debe <a href="./index.php?action=login">Iniciar sesión</a> o <a href="./index.php?action=register">Regístrarte</a>.';



Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

byproduct

TY for the mod.
I like the idea. DL'd, saving for when I get SMF setup.

NOT NIT PICKING, just letting you know about a almost INSIGNIFICANT typo - "inndex".
"GuestViews.xml". Line 94 "//Search engines will not inndex the error for guests"

Promise you, I am the last one that will complain about typing


Kiriakos GR

I do not think that warning text translation would be needed,  if this message was editable by the forum admin.
Food for thought about the next version.    :)

Kiriakos GR

At Modification Settings menu, I do not see complete name of mod description ?  Only letter L   ? 

I think that mod description name when installed, it should become : LTV-Guests  ( for a shorter characters length)



shinglis

anyone using and seeing an increase in registrations ?? just curious if actually has the desired effect.

My concern would be that guest would just stop viewing the forum totally, but that's the challenge to get more registrations and more posts.

Kiriakos GR

Quote from: shinglis on April 02, 2018, 03:37:10 PM
anyone using and seeing an increase in registrations ?? just curious if actually has the desired effect.

My concern would be that guest would just stop viewing the forum totally, but that's the challenge to get more registrations and more posts.

This is a good question, I am using this mod for 24 hours and I have adjust the limit at 8 page loads.
I will test it for three months prior making any conclusion.
My forum this is six years old and overloaded with quality technical content, this mod it does help my new strategy as content creator.
No one supports any one today due donations, therefore if they wish to continue getting free food, at least they should be forced to register, so the forum to look alive too.

Fresh made Forum with out worthy content, does not need this mod. 


shinglis

Quote from: Kiriakos GR on April 02, 2018, 04:02:40 PM
Quote from: shinglis on April 02, 2018, 03:37:10 PM
anyone using and seeing an increase in registrations ?? just curious if actually has the desired effect.

My concern would be that guest would just stop viewing the forum totally, but that's the challenge to get more registrations and more posts.

This is a good question, I am using this mod for 24 hours and I have adjust the limit at 8 page loads.
I will test it for three months prior making any conclusion.
My forum this is six years old and overloaded with quality technical content, this mod it does help my new strategy as content creator.
No one supports any one today due donations, therefore if they wish to continue getting free food, at least they should be forced to register, so the forum to look alive too.

Fresh made Forum with out worthy content, does not need this mod.

Yes sounds like ideal for your forum, where mine is very limited (2 years old) and already has a limited potential registration scope so I don't really want to alienate them more than I have to.  Might have to dig into the stats a little more deeper and see how many visits / guests I actually have  :D

Kiriakos GR

Quote from: shinglis
Might have to dig into the stats a little more deeper and see how many visits / guests I actually have  :D

Forum Stats this is a weird mix of: search engines indexing bots (welcome activity) , website tracking engines send by web-hosting data centers, spam bots trying to register, crime prevention bots, and a few real people using known telecom brands as internet providers.
In past 12 months I do IP Block  due server configuration at data-center bots and anyone else who is unknown company which visiting my server.
In few months ahead my stats they would become more realistic, because I am now in control and always staying alerted.
 


Kiriakos GR

My SMF error log gets full of my own IP when I am logging at my forum.

2: Illegal string offset 'page_title'
File: /home/1234SMF/public_html/forum/Sources/GuestViewLimitSettings.php
Line  ==>9:    
return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' => array(sprintf($txt['guestviews_settings']['page_title'], '')));


Rob Lightbody

Quote from: Kiriakos GR on April 06, 2018, 08:49:59 AM
My SMF error log gets full of my own IP when I am logging at my forum.

2: Illegal string offset 'page_title'
File: /home/1234SMF/public_html/forum/Sources/GuestViewLimitSettings.php
Line  ==>9:    
return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' => array(sprintf($txt['guestviews_settings']['page_title'], '')));

I am having the same problem.

https://www.theqe2story.com/forum/index.php?action=admin;area=logs;sa=errorlog;desc
https://www.theqe2story.com/forum/index.php?action=admin;area=logs;sa=errorlog;desc
2: Illegal string offset 'page_title'
File: /home/public_html/forum/Sources/GuestViewLimitSettings.php
Line: 9


Also, the title for the message that pops up for a guest says "An Error Has Occurred!" - which is nasty.  It needs to say something softer like "Maximum guest views reached, please login" 

I love the idea of this mod, but I've uninstalled it because of the above 2 points.

Kiriakos GR

I am seeing the glass as half-full, and I got a few new members.

My own question this is if the person whom made this mod, if he does take under consideration the feedback that we provide?

He looks silent for a month time.     

Doug Heffernan

Quote from: The QE2 Story Forum on April 07, 2018, 01:17:06 PM
Quote from: Kiriakos GR on April 06, 2018, 08:49:59 AM
My SMF error log gets full of my own IP when I am logging at my forum.

2: Illegal string offset 'page_title'
File: /home/1234SMF/public_html/forum/Sources/GuestViewLimitSettings.php
Line  ==>9:    
return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' => array(sprintf($txt['guestviews_settings']['page_title'], '')));

I am having the same problem.

https://www.theqe2story.com/forum/index.php?action=admin;area=logs;sa=errorlog;desc
https://www.theqe2story.com/forum/index.php?action=admin;area=logs;sa=errorlog;desc
2: Illegal string offset 'page_title'
File: /home/public_html/forum/Sources/GuestViewLimitSettings.php
Line: 9


Also, the title for the message that pops up for a guest says "An Error Has Occurred!" - which is nasty.  It needs to say something softer like "Maximum guest views reached, please login" 

I love the idea of this mod, but I've uninstalled it because of the above 2 points.
Quote from: Kiriakos GR on April 06, 2018, 08:49:59 AM
My SMF error log gets full of my own IP when I am logging at my forum.

2: Illegal string offset 'page_title'
File: /home/1234SMF/public_html/forum/Sources/GuestViewLimitSettings.php
Line  ==>9:    
return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' => array(sprintf($txt['guestviews_settings']['page_title'], '')));


I can not reproduce that error myself. I can not fix something that I can not reproduce.

An Error Has Occurred! is the Smf standard language that outputs errors. It is not added by my mod.

vii

From what I can tell, your code is treating the $txt string entry as an array:


return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' => array(sprintf($txt['guestviews_settings']['page_title'], '')));


Should be:


return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' => array(sprintf($txt['guestviews_settings'], '')));


no? Since it's defined as:


$txt['guestviews_settings'] = 'Limit Guest Views Settings';


in GuestView.xml

-

Also, in regards to QE2's error message title request, I think it could 'fixed' if this code was added before the fatal_lang_error function call (GuestView.xml):


//Throw the error when view limit is reached
              fatal_lang_error('views_reached_error_message', false, array($modSettings['num_views']));


Change to:


//Throw the error when view limit is reached
$context['error_title'] = 'Custom title';
              fatal_lang_error('views_reached_error_message', false, array($modSettings['num_views']));


Although since this is kind of a special request, maybe best left up to each individual to add manually if they so wish.

Either way, good idea/mod doug_ips.

Kiriakos GR

Quote from: doug_ips

I can not reproduce that error myself. I can not fix something that I can not reproduce.

Here are few more clues:
a) My SMF Ver 2.0.15
b) Every page load made by administrator account, this is recorded by Error log.
c) In my attempt to clear  Error log ( delete old entries) a new one this is instantly generated. 
d) I am using several other mods all working in harmony, in the past three years.
e)  I am an electrician and electronics specialist, I do not do codding.

Quote from: doug_ipsAn Error Has Occurred! is the Smf standard language that outputs errors. It is not added by my mod.

Warning pop-up message title,  this is a much lesser significant  detail.

In summary :
a) Mod text description this is very long, and rename this is required.
+
b) Every page load made by administrator account, this is recorded by Error log.
c) In my attempt to clear  Error log ( delete old entries) a new one this is instantly generated. 
d) I am using several other mods all working in harmony, in the past three years.
e)  I am an electrician and electronics specialist, I do not do codding, but I can return feedback if you request it, by you saying of what you need.  :)   

efk

Interesting idea, make possible to change text on that page which is displayed as error for limitation.

Kiriakos GR

I am starting to believe that this Mod code this is work of another programmer, this is why there is no support of any type from this person.

landyvlad

Quote from: Kiriakos GR on August 21, 2018, 08:52:23 AM
I am starting to believe that this Mod code this is work of another programmer, this is why there is no support of any type from this person.

If you look here https://custom.simplemachines.org/mods/index.php?mod=4169 you will see that doug_ips is the author.

He has already stated that:
QuoteI can not reproduce that error myself. I can not fix something that I can not reproduce.

Obviously he'll need more information from you so he might be able to investigate further.

Remember too, that doug_ips will have a life outside SMF and is also offering this mod (and three others) for free.  He can't be expected to meet your timetable for resolution of issues. His priorities don't necessarily align with yours. I'm sure he'll be along at some point and let you know what he needs from you.


As far as your problem is concerned
QuoteNo one supports any one today due donations, therefore if they wish to continue getting free food, at least they should be forced to register, so the forum to look alive too.
there are a number of other ways to approach that problem too. 

You could always set-up your forum so that only registered members can download technical documents etc.

If you do a search, there are a number of posts regarding such issues and generating income from a forum (even if just to support the running costs).
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

Kiriakos GR

By all this amount of reported issues by me and others, and also by our demonstrated willingness about us to further assist with clues about troubleshooting, the conclusion this is that we are not the insane ones or the unreasonable ones.



delta5

I'm running 2.0.15 and I installed this mod with no errors so far. Can anyone tell me how the cookie settings should be set? I'm using https with a security cert. Also I have the Sucuri firewall installed. So far I have not been able to see the limit warning pop up while testing.

Thx

Kathryn_

I understand this is an old post but I hope someone would be able to help me.. the mod works and the only reason I have it is because I don't use attachments, and post directly with a button .
the error of the mod appears on my logs like this:


9:    return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' =>            array(sprintf($txt['guestviews_settings']['page_title'], '')));

I have removed this mod more than once I really would like to have it.

my forum is run on installation 2.0.15

Kathryn_

Quote from: Kathryn_ on June 17, 2019, 05:43:31 PM
I understand this is an old post but I hope someone would be able to help me.. the mod works and the only reason I have it is because I don't use attachments, and post directly with a button .
the error of the mod appears on my logs like this:


9:    return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' =>            array(sprintf($txt['guestviews_settings']['page_title'], '')));

I have removed this mod more than once I really would like to have it.

my forum is run on installation 2.0.15

With the configurations from Virginia posted earlier  It saved my forum  thank you I now have the mod working without an error and the title shows perfect in Admin Panel   thank you!

Sectomy

same here as Kiriakos,
same error message
2: Illegal string offset 'page_title'

any ideas ? :)

Shambles

Quote from: Sectomy on July 19, 2020, 10:48:40 AM
same here as Kiriakos,
same error message
2: Illegal string offset 'page_title'

any ideas ? :)

Did you try the solution offered earlier in the thread?

https://www.simplemachines.org/community/index.php?topic=559168.msg3968507#msg3968507

Sectomy

For all others who got this:
2: Illegal string offset 'page_title'
in Error Log, do this:

Code:
return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' => array(sprintf($txt['guestviews_settings']['page_title'], '')));


Should be:

Code:
return $admin_areas['config']['areas']['modsettings']['subsections'] += array('guestviews' => array(sprintf($txt['guestviews_settings'], '')));




in GuestViewLimitSettings.php

thanx  ! :D

Sectomy

Quote from: Shambles on July 19, 2020, 11:26:18 AM
Quote from: Sectomy on July 19, 2020, 10:48:40 AM
same here as Kiriakos,
same error message
2: Illegal string offset 'page_title'

any ideas ? :)

Did you try the solution offered earlier in the thread?

https://www.simplemachines.org/community/index.php?topic=559168.msg3968507#msg3968507
thx, i quoted it b4... Thank You !!!!

Advertisement: