Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Disallow guests to view threads, must register first Details »»
Disallow guests to view threads, must register first
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-06-2004 Last Update: Never Installs: 89
 
No support by the author.

Yes I know that there is already a a feature to stop guests from viewing threads, but then this also shows all the posts and threads counters to zero, and under Last Post it will say never (which sucks ). But, with my hack, it just asks guests to either login or register when viewing a thread and still shows all the right numbers

Instructions

Open archive/index.php and find
PHP Code:
    $title .= ' - ' $foruminfo['title'];
}
else
{
    
$do 'index';

Below, add
PHP Code:
if ($bbuserinfo['userid'] == AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si"$_SERVER['HTTP_USER_AGENT'])) 

    
print_no_permission(); 

Open showthread.php and find
PHP Code:
globalize($_REQUEST, array('perpage' => INT'pagenumber''highlight' => STR'goto')); 
Below, add:
PHP Code:
if ($bbuserinfo['userid'] == AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si"$_SERVER['HTTP_USER_AGENT']))
{
    
print_no_permission();

Open template threadbit and find:
PHP Code:
<td class="alt1Active" id="t$thread[threadid]title="$thread[preview]"
Replace it with
PHP Code:
<td class="alt1Active" id="t$thread[threadid]<if condition="$show['member']">title="$thread[preview]"</if>> 
Done!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #172  
Old 07-30-2005, 11:42 PM
VirtualBurn VirtualBurn is offline
 
Join Date: Nov 2003
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #173  
Old 07-31-2005, 01:29 AM
VirtualBurn VirtualBurn is offline
 
Join Date: Nov 2003
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #174  
Old 08-07-2005, 02:00 PM
swa swa is offline
 
Join Date: Apr 2005
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

awesome, works on 3.07!
Reply With Quote
  #175  
Old 08-26-2005, 08:57 AM
Bozkurtum's Avatar
Bozkurtum Bozkurtum is offline
 
Join Date: Aug 2003
Location: TH / Turkey
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works on 3.5.x?
Reply With Quote
  #176  
Old 09-16-2005, 11:35 AM
stan111 stan111 is offline
 
Join Date: Aug 2005
Location: CA
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks a lot
i will try to get this installed when i get home
Reply With Quote
  #177  
Old 09-23-2005, 12:29 PM
mkdevo mkdevo is offline
 
Join Date: May 2004
Location: CT, USA
Posts: 269
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'
?
Reply With Quote
  #178  
Old 11-07-2005, 03:51 PM
etaslim etaslim is offline
 
Join Date: Jul 2004
Location: Indonesia
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bozkurtum
Works on 3.5.x?
same here, pls inform if there's any. thanks
Reply With Quote
  #179  
Old 12-08-2005, 10:55 PM
99SIVTEC 99SIVTEC is offline
 
Join Date: Nov 2001
Posts: 281
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ############################
// ################################################## #####################
Reply With Quote
  #180  
Old 12-09-2005, 12:41 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #181  
Old 12-09-2005, 04:13 AM
99SIVTEC 99SIVTEC is offline
 
Join Date: Nov 2001
Posts: 281
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:28 PM.


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.05047 seconds
  • Memory Usage 2,330KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (9)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete