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)

dontpanic 01-26-2004 09:30 PM

Great hack, I too am wondering how it could be used selectively on one or more specific forums though.

dano 01-26-2004 10:02 PM

Quote:

Originally Posted by Gary W
This template: username_loggedout

Oh crap, looks like it has been split into MANY different phrases

n00belit3 02-07-2004 11:32 AM

Very nice, i have only one problem, for those of us using portals such as vbindex i figured out taht you can still view threads as unregistered by clicking under "latest threads". Is there any way from preventing unregistered users from doing this?

Gary King 02-08-2004 01:11 PM

Quote:

Originally Posted by n00belit3
Very nice, i have only one problem, for those of us using portals such as vbindex i figured out taht you can still view threads as unregistered by clicking under "latest threads". Is there any way from preventing unregistered users from doing this?

I would normally tell you to ask in the vBIndex support thread, but I'm feeling nice today :p

So here we go:

Open up the vbindex.php for vBIndex and find
PHP Code:

if ($vbindex['options'] & VBI_SHOWTHREADS) { 

Replace with
PHP Code:

if ($vbindex['options'] & VBI_SHOWTHREADS and $bbuserinfo[userid] != 0) { 

There we go that should work :D

bluecat 02-11-2004 02:27 AM

Great hack, thank you. Can someone tell me how to accomplish this though: I have a few forums that only certain usergroups (paid subscribers) can access, but I want regular registered users to be able to see the post counts and threads, but not the content, just like guests now see with this hack (as opposed to "Never" and 0's). Is this possible? Thank you. Also, it works perfect for guests in these areas, just not registered users. :(

bluecat 02-13-2004 11:37 AM

anyone?

PixelFx 02-14-2004 09:10 PM

this is very cool :)

bluecat 02-14-2004 09:59 PM

I checked my stats and we now have on average between 40 to 55 new registrations a day with this, thanks (compared to our usual 5 a day)! But man, I apologize to ask again, but I have a paid restricted area that we used to get about 3 people a week sign up for, but now we only one in the last month, and it's definitely because these protected areas always look empty. Any advice? :(

Gary King 02-15-2004 12:19 PM

Quote:

Originally Posted by bluecat
I checked my stats and we now have on average between 40 to 55 new registrations a day with this, thanks (compared to our usual 5 a day)! But man, I apologize to ask again, but I have a paid restricted area that we used to get about 3 people a week sign up for, but now we only one in the last month, and it's definitely because these protected areas always look empty. Any advice? :(

Try this:

Below the newly added code from this hack, add the following:
PHP Code:

if ($bbuserinfo['usergroupid'] == and $forumid == X)
{
    
print_no_permission();


Of course replacing X with their respective numbers.

bluecat 02-15-2004 11:26 PM

Thank you very much! That worked. I had to go through and add one for each forum. Not sure if there's an easier way, but this works. Thank you very much.

Here's what I added which is for 3 different forums that are only for certain groups (paid subscribers):

PHP Code:

if ($bbuserinfo['usergroupid'] == and $forumid == 73

    
print_no_permission(); 
}
if (
$bbuserinfo['usergroupid'] == and $forumid == 45

    
print_no_permission(); 
}
if (
$bbuserinfo['usergroupid'] == and $forumid == 95

    
print_no_permission(); 



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!!!!!

dontpanic 03-02-2004 04:14 PM

Quote:

Originally Posted by Gary W
PHP Code:

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

    
print_no_permission(); 


Replace X with the guest forum ID :)

OK, this works like a champ...so let's make it even more complex. :)

How about configuring multiple forums that a user CAN view as a guest? Is there a simpler way than writing a statement for each forum? I tried the code below with no luck.
PHP Code:

if ($bbuserinfo['userid'] == and ($forumid != 102 or $forumid != 103)) 

I'd ideally like to prevent guests and awaiting email confirmation from seeing all but a few select forums.

Gary King 03-03-2004 07:02 PM

Quote:

Originally Posted by dontpanic
OK, this works like a champ...so let's make it even more complex. :)

How about configuring multiple forums that a user CAN view as a guest? Is there a simpler way than writing a statement for each forum? I tried the code below with no luck.
PHP Code:

if ($bbuserinfo['userid'] == and ($forumid != 102 or $forumid != 103)) 

I'd ideally like to prevent guests and awaiting email confirmation from seeing all but a few select forums.

Replace
PHP Code:

$forumid != 102 or $forumid != 103 

with
PHP Code:

$forumid != 102 and $forumid != 103 


dontpanic 03-04-2004 06:15 PM

Great, thanks! :)

Gary King 03-05-2004 11:15 AM

Glad I could help :D

zennifer 03-09-2004 01:55 PM

I have installed this and it is working great for us. I have one question though is there any way to get the thread title to appear in the title or in the actual text of the error page? The thread/forum/post ID# is in the url. I have tried a couple of things with out any success.

Skaterscafe.com 03-16-2004 03:14 AM

Great hack! My question is this, I have about 3 forums with a few selected sub-forums I want to allow. How do I deperate them?

I tried the above and can only get one or two to work.

alkahf 03-16-2004 07:51 AM

Thank you for this good hack, but....
Very important:

Open template:threadbit and find:
PHP Code:

<td class="alt1Active" id="t$thread[threadid]title="$thread[preview]"

Replace with:
PHP Code:

<td class="alt1Active" id="t$thread[threadid]<if condition="$show['member']">title="$thread[preview]"</if>> 

save edit.

Notice: Make this change with all your styles.

Best regards

contramontanum 03-16-2004 01:24 PM

God bless all the makers of "fancy" hacks (I've installed a few myself ;)), but this one is really useful. Thanks!

Gary King 03-16-2004 02:17 PM

Quote:

Originally Posted by alkahf
Thank you for this good hack, but....
Very important:

Open template:threadbit and find:
PHP Code:

<td class="alt1Active" id="t$thread[threadid]title="$thread[preview]"

Replace with:
PHP Code:

<td class="alt1Active" id="t$thread[threadid]<if condition="$show['member']">title="$thread[preview]"</if>> 

save edit.

Notice: Make this change with all your styles.

Best regards

Thanks, added that :)

hasan2k 03-18-2004 08:56 PM

Quote:

Originally Posted by Gary W
Thanks, added that :)

I have one concern about the hack. With this hack implemented, will google media bot and adsense bot be able to spider...I have adsense in my forums and also would like my pages cached in the google.

Please respond.

Gary King 03-19-2004 12:26 PM

Quote:

Originally Posted by hasan2k
I have one concern about the hack. With this hack implemented, will google media bot and adsense bot be able to spider...I have adsense in my forums and also would like my pages cached in the google.

Please respond.

Google can still browse the archive pages, which is what they normally browse anyhow.

Symbian.info 03-19-2004 01:00 PM

Quote:

Originally Posted by Gary W
Google can still browse the archive pages, which is what they normally browse anyhow.

Great script! Just what the doctor orderd!!

hasan2k 03-19-2004 11:11 PM

Quote:

Originally Posted by Gary W
Google can still browse the archive pages, which is what they normally browse anyhow.

Well the my forum pages that are cached in google are not from the archive pages, they are from the main forums pages. So please address the issue regarding that.

Gary King 03-21-2004 01:32 PM

Quote:

Originally Posted by hasan2k
Well the my forum pages that are cached in google are not from the archive pages, they are from the main forums pages. So please address the issue regarding that.

Problem solved, check new instructions :) (The part where you have to add new code)

bluecat 03-22-2004 02:03 AM

Anyone know if vb changed this in Gold (so I don't have to add this)?

Gary King 03-22-2004 11:10 AM

Quote:

Originally Posted by bluecat
Anyone know if vb changed this in Gold (so I don't have to add this)?

No new functionality has been added AFAIK, only bugfixes.

hasan2k 03-22-2004 07:14 PM

Quote:

Originally Posted by Gary W
Problem solved, check new instructions :) (The part where you have to add new code)

Gary I saw your revised hack in post#1 (is that where you changed the hack?) just making sure.

Also, I just wanted to confirm it will allow google bot, adsense bot (2 different google bots), yahoo, MSN or other big bots. Seems like you had added some. But I am technically challenged. Please respond. And once again thanks for helping us out

Gary King 03-23-2004 01:17 PM

Quote:

Originally Posted by hasan2k
Gary I saw your revised hack in post#1 (is that where you changed the hack?) just making sure.

Also, I just wanted to confirm it will allow google bot, adsense bot (2 different google bots), yahoo, MSN or other big bots. Seems like you had added some. But I am technically challenged. Please respond. And once again thanks for helping us out

It should basically allow whatever bots the default vBulletin thinks is a bot, so yes it should allow all the major bots :)

hasan2k 03-23-2004 10:12 PM

Quote:

Originally Posted by Gary W
It should basically allow whatever bots the default vBulletin thinks is a bot, so yes it should allow all the major bots :)

Amazing...you are wondeful man.

Zilvia 03-25-2004 06:38 PM

Does this work with vB 3.0.0 Final? I cant find the first edit in showthread.php


All times are GMT. The time now is 04:16 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.01552 seconds
  • Memory Usage 1,875KB
  • 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
  • (19)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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