vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Limit guests to viewing 5 threads max. (https://vborg.vbsupport.ru/showthread.php?t=36857)

Zzed 03-31-2002 10:00 PM

Limit guests to viewing 5 threads max.
 
This hack allows a guest to view 5 threads within the forums. After the 5th
thread, the hack will bring up the error_nopermission_loggedout template
to force them to register with the board.

This hack was requested by frozt and jjj0923.

Templates affected: 0
Files affected: showthread.php and admin/sessions.php
Tables affected: session

How to install this hack:

You need to alter the session table using the following command:

alter table session add visitcount smallint(5) unsigned DEFAULT 0;

The rest of the instructions are in the attached file.

Your comments will be greatly appreciated.

frozt 04-01-2002 09:34 PM

Thnxz man! its works great i think :-)

Zzed 04-01-2002 09:36 PM

You're welcome. :)

E 04-01-2002 09:42 PM

does it re-direct them too register page... im gonna try installing now

Zzed 04-01-2002 09:44 PM

They get sent to the screen that tells them they need to log in or register. :)

jjj0923 04-01-2002 11:06 PM

thank you - this is great.

- jeff

Remi 04-02-2002 12:00 AM

Can't he/she just clear the session and continue browsing!!

Zzed 04-02-2002 12:04 AM

Quote:

Originally posted by Remi
Can't he/she just clear the session and continue browsing!!
Yes, but I am sure it will get very annoying after a while. :)

Admin 04-02-2002 04:54 AM

Remi is right, it's only for the current session. :)

Zzed 04-02-2002 05:49 AM

Unless your cookie times out, or you kill your browser, you won't be able to read another thread.

Admin 04-02-2002 05:51 AM

You will be able 5 threads every 15 minutes, or whatever the admin set the cookie timeout for. :)

Zzed 04-02-2002 05:57 AM

Membership has its privileges. :D

kevinsdh 08-27-2002 01:03 AM

I get parsing errors in "session" when trying to run this on 2.2.6 Please give me a hand to get it right. This is a great hack and I reaaaaallllllllllllyyyyyyy need it! session table altered (visitcount added) and code in both php scripts changed and verified.

Thanks!!!!!!

Matt87 08-27-2002 01:14 AM

Wouldn't it be better to go to a template that says: "You cannot view any more than 5 threads"? :D

Zzed 08-27-2002 05:53 PM

Quote:

Originally posted by Matt87
Wouldn't it be better to go to a template that says: "You cannot view any more than 5 threads"? :D
Yes it would. But I have a few different template sets, and blame this on my laziness, but I used what was already available. ;)

Zzed 08-27-2002 05:54 PM

Quote:

Originally posted by kevinsdh
I get parsing errors in "session" when trying to run this on 2.2.6 Please give me a hand to get it right. This is a great hack and I reaaaaallllllllllllyyyyyyy need it! session table altered (visitcount added) and code in both php scripts changed and verified.

Thanks!!!!!!

Please Email me a copy of your sessions.php.

My Email is edwink@seebeyond.com :)

SgtSling 09-01-2002 08:36 PM

how can this be altered to come up with a different template thanerror_nopermission_loggedout template ?

I want to specify a different template..

amykhar 02-18-2003 11:34 PM

I thought this was a wonderful idea, and installed it. Then I remembered the googlebot and uninstalled it. I think I need to come back some time when I have a few brain cells working and see if I can't code it so that google and other bots that I like can stay and crawl.

Amy

Cluster One 04-15-2003 07:22 AM

Is there a way to change the value from say 5 to 10 or 15?

Zzed 04-15-2003 07:32 AM

Look for all instances of the following code. There are 2 of them:

Code:

if($session[visitcount] > 5)
And replace the number 5 with any number you want. ;)

007 05-16-2003 06:20 PM

Hey would there be any way to base this on an IP basis? So instead of checking for cookies, it would check if the IP had already viewed 5 threads?

Zzed 05-17-2003 08:04 AM

These visits are remembered per session. A guest does not use a cookie since cookies are given to registered users.
.
And to keep track of visits per IP address, you would need to create a brand new table to keep track of individual IP's and increment their visit count..


All times are GMT. The time now is 02:45 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01095 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete