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)

bluecat 02-15-2004 11:57 PM

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.

Gary King 02-16-2004 11:08 AM

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.

Gary King 02-16-2004 11:20 AM

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.

gmarik 02-22-2004 06:43 AM

could it be not only no_permission,
but

BIG letters: REgister as well?

Gary King 02-23-2004 11:11 AM

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.

gc1 02-23-2004 10:54 PM

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?

SEShady 02-24-2004 05:56 PM

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

Thanks,
Shady

trackpads 02-28-2004 11:52 PM

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

Gary King 02-29-2004 01:31 PM

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 :)

trackpads 03-01-2004 01:03 AM

Thanks!!!!!


All times are GMT. The time now is 02:30 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.01257 seconds
  • Memory Usage 1,753KB
  • 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
  • (6)bbcode_php_printable
  • (2)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