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
  #52  
Old 02-15-2004, 11:57 PM
bluecat's Avatar
bluecat bluecat is offline
 
Join Date: Apr 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I spoke too soon. Although it workds perfect if you manually change users to a primary usergroup, it blocks out "Secondary Usergroups" that are paid subscribers who have legitimate access.

What I'm wondering is if I can simply use the same codes, but instead of print_no_permission, add say three more that say if in a certain usergroup (paid subscribers that listed as registered id:2, and a secondary usergroup, id:35), then grant permission.

For example,

PHP Code:
if ($bbuserinfo['usergroupid'] == and $forumid == 95

    
grant_permission(); 

The "grant_permission" is totally wrong, I just don't know the term. But I'm just wondering how I can have it check userid and "allow" access. Any help is great. Thanks (also, even though the first 3 are disallowing the registered users, the secondary usergroups would have a different id number and should be able to enter). I hope this makes sense.
Reply With Quote
  #53  
Old 02-16-2004, 11:08 AM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Easier way would be to do it like this:
PHP Code:
if ($bbuserinfo['usergroupid'] == and ($forumid == 73 or $forumid == 45 or $forumid == 95))

    
print_no_permission(); 

This was a reply to your previous post, I'll look more into your latest one.
Reply With Quote
  #54  
Old 02-16-2004, 11:20 AM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bluecat
Well I spoke too soon. Although it workds perfect if you manually change users to a primary usergroup, it blocks out "Secondary Usergroups" that are paid subscribers who have legitimate access.

What I'm wondering is if I can simply use the same codes, but instead of print_no_permission, add say three more that say if in a certain usergroup (paid subscribers that listed as registered id:2, and a secondary usergroup, id:35), then grant permission.

For example,

PHP Code:
if ($bbuserinfo['usergroupid'] == and $forumid == 95

    
grant_permission(); 

The "grant_permission" is totally wrong, I just don't know the term. But I'm just wondering how I can have it check userid and "allow" access. Any help is great. Thanks (also, even though the first 3 are disallowing the registered users, the secondary usergroups would have a different id number and should be able to enter). I hope this makes sense.
Try this:
PHP Code:
$membergroups explode(',',$bbuserinfo[membergroupids]);

if (
$bbuserinfo['usergroupid'] == and ($forumid == 73 or $forumid == 45 or $forumid == 95) and !array_search(X,$membergroups)) 

    
print_no_permission(); 

and replace X with the paid subscriber usergroupid. This code will check if the user has a membergroup of the paid subscribers group.
Reply With Quote
  #55  
Old 02-22-2004, 06:43 AM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

could it be not only no_permission,
but

BIG letters: REgister as well?
Reply With Quote
  #56  
Old 02-23-2004, 11:11 AM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gmarik
could it be not only no_permission,
but

BIG letters: REgister as well?
Nope, not if I understand you correctly anyhow.
Reply With Quote
  #57  
Old 02-23-2004, 10:54 PM
gc1 gc1 is offline
 
Join Date: Sep 2002
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a Fantastic hack but I would like it to see it take one step further

I would like it to do what it does now but only if there is X amount of guests in the forum

Say when 10 people(or any #) are guests the script kicks in

Is this possible?
Reply With Quote
  #58  
Old 02-24-2004, 05:56 PM
SEShady's Avatar
SEShady SEShady is offline
 
Join Date: Jul 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be done in 2.3.4? If so, can someone steer me in the right direction?

Thanks,
Shady
Reply With Quote
  #59  
Old 02-28-2004, 11:52 PM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gary, great hack. Is there a way to turn this off for only one forum? I have a Guest forum that has site features etc that I link to across the site.

Thanks!!!

-Jason
Reply With Quote
  #60  
Old 02-29-2004, 01:31 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace
PHP Code:
if ($bbuserinfo['userid'] == 0

    
print_no_permission(); 

with
PHP Code:
if ($bbuserinfo['userid'] == and $forumid != X

    
print_no_permission(); 

Replace X with the guest forum ID
Reply With Quote
  #61  
Old 03-01-2004, 01:03 AM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!!!!!
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:18 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.05496 seconds
  • Memory Usage 2,337KB
  • 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
  • (12)bbcode_php
  • (2)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