vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Disallow guests to view threads, must register first (https://vborg.vbsupport.ru/showthread.php?t=59859)

VirtualBurn 07-30-2005 11:42 PM

Code:

if ($bbuserinfo['userid'] == 0 and $forumid != X) 

    print_no_permission(); 
}

Quote:

Originally Posted by Gary King
Replace
PHP Code:

$forumid != 102 or $forumid != 103 

with
PHP Code:

$forumid != 102 and $forumid != 103 


I've found this thread to be really interesting and it has helped out with a lot of things. I've added the code to dissalow guest to view a couple of non vb pages but these pages should be only accessable by a certain user group.

Usergroup (id:9) are the only members that should have access to these pages, how can I modify this code to enable this feature?

Thankyou.

VirtualBurn 07-31-2005 01:29 AM

Ok, after scanning back through all the replies to this thread I finaly sussed it also added something else on ;)

This code stops guests (ID:0) and registered users (ID:2) from accesing the non-vb pages but with let the 'Premium Member' group (ID:9) walk right in.

For the users who aren't allwowed in a custom notice will appear telling the user to subscribe to access these areas.

https://vborg.vbsupport.ru/showthrea...threadid=93253

Thanks greg and all who replied here.

swa 08-07-2005 02:00 PM

awesome, works on 3.07!

Bozkurtum 08-26-2005 08:57 AM

Works on 3.5.x?

stan111 09-16-2005 11:35 AM

thanks a lot
i will try to get this installed when i get home

mkdevo 09-23-2005 12:29 PM

great hack!

i have a question as far as spiders go:

i have Kanoodle and TargetPoint ads on my board. after installing this hack, the TargetPoint ads (in threads) still show up, but the Kanoodle ads do not (because you now need to be logged in to view threads, etc.).

is there something i can add to this line in order to allow the Kanoodle ads in?

PHP Code:

preg_match("#(googlebot|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|Googlebot)#si"$_SERVER['HTTP_USER_AGENT'

?

etaslim 11-07-2005 03:51 PM

Quote:

Originally Posted by Bozkurtum
Works on 3.5.x?

same here, pls inform if there's any. thanks

99SIVTEC 12-08-2005 10:55 PM

I got it to work with 3.5, but it took a couple modifications. The code that you paste in showthread should now be
Code:

if ($vbulletin->userinfo['userid'] == 0 AND !preg_match("#(googlebot|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|Googlebot)#si", $_SERVER['HTTP_USER_AGENT']))
{
    print_no_permission();
}

and should be done right after:

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

Zachery 12-09-2005 12:41 AM

Quote:

Originally Posted by 99SIVTEC
I got it to work with 3.5, but it took a couple modifications. The code that you paste in showthread should now be
Code:

if ($vbulletin->userinfo['userid'] == 0 AND !preg_match("#(googlebot|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|Googlebot)#si", $_SERVER['HTTP_USER_AGENT']))
{
    print_no_permission();
}

and should be done right after:

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

Yo, stock feature in vB 3.5, nice job hacking a feature thats already in the system :)

99SIVTEC 12-09-2005 04:13 AM

and how is this a feature in the system already? The stock system doesn't allow search engine spiders while blocking guests.


All times are GMT. The time now is 06:59 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.01263 seconds
  • Memory Usage 1,746KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete