Advertisement:

Author Topic: Limit Thread Views for Guests -- Motive Guests to Register  (Read 1213 times)

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Limit Thread Views for Guests -- Motive Guests to Register
« on: March 04, 2018, 04:49:03 PM »
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.

Brought to you by generalcartalk.com
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline Rock Lee

  • SMF Hero
  • ******
  • Posts: 1,635
  • Gender: Male
  • Digitalizando un nuevo mundo :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #1 on: March 04, 2018, 07:04:23 PM »
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 © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline byproduct

  • Semi-Newbie
  • *
  • Posts: 82
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #2 on: March 21, 2018, 05:50:44 AM »
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


Offline Kiriakos GR

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • @ITTSB_EU on Twitter
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #3 on: April 01, 2018, 07:00:35 AM »
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.    :)
 

Offline Kiriakos GR

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • @ITTSB_EU on Twitter
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #4 on: April 01, 2018, 07:16:34 AM »
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)



Offline shinglis

  • Semi-Newbie
  • *
  • Posts: 25
    • Somersetroadend
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #5 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.

Offline Kiriakos GR

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • @ITTSB_EU on Twitter
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #6 on: April 02, 2018, 04:02:40 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. 
 

Offline shinglis

  • Semi-Newbie
  • *
  • Posts: 25
    • Somersetroadend
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #7 on: April 02, 2018, 04:24:04 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

Offline Kiriakos GR

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • @ITTSB_EU on Twitter
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #8 on: April 02, 2018, 04:47:53 PM »
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.
 
 
 

Offline Kiriakos GR

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • @ITTSB_EU on Twitter
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #9 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'], '')));


Offline The QE2 Story Forum

  • Charter Member
  • Jr. Member
  • *
  • Posts: 144
    • The QE2 Story
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #10 on: April 07, 2018, 01:17:06 PM »
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.

Code: [Select]
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.

Offline Kiriakos GR

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • @ITTSB_EU on Twitter
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #11 on: April 07, 2018, 02:19:24 PM »
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.     

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #12 on: April 07, 2018, 05:25:05 PM »
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.

Code: [Select]
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.
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.
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline Virginiaz

  • Semi-Newbie
  • *
  • Posts: 26
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #13 on: April 07, 2018, 09:49:37 PM »
From what I can tell, your code is treating the $txt string entry as an array:

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

Should be:

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

no? Since it's defined as:

Code: [Select]
$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):

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

Change to:

Code: [Select]
//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.
« Last Edit: April 07, 2018, 10:07:25 PM by Virginiaz »

Offline Kiriakos GR

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • @ITTSB_EU on Twitter
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #14 on: April 08, 2018, 04:49:16 AM »
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_ips
An 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.  :)   

Offline efk

  • Jr. Member
  • **
  • Posts: 119
  • Gender: Male
Re: Limit Thread Views for Guests -- Motive Guests to Register
« Reply #15 on: June 16, 2018, 08:49:53 PM »
Interesting idea, make possible to change text on that page which is displayed as error for limitation.