PDA

View Full Version : Require registration to view posts


hadley
11-11-2002, 09:09 PM
This hack may already exist, but in an hour of searching I've not been able to find exactly what I want:

I want unregistered users to be able to see my forums page and the descriptions of the 12 forums it contains, and I want them to be able to click on a particular forum and view all the titles of threads. However, when they click on a thread to view the posts inside that thread, I want them to get a prompt asking them to register.

vB can't do this for me -- anybody got a hack that will? Thanks in advance for any help...

Logician
11-12-2002, 07:45 AM
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=41815&highlight=showthread.php" target="_blank">https://vborg.vbsupport.ru/showt...showthread.php</a>

hadley
11-12-2002, 02:31 PM
Thank you -- but there are a couple things I don't understand in that thread:
(Replace X with the forum id and Y with user group id)
You mean the id of the group I wish to keep out, right? So, if there are three, how do I name them? (COPPA, unregistered, and awaiting email confirm)

Create a new template named "error_youdonthavepermission" and specify your custom message for no permission..
Okay, I understand this, but...

(Dont forget to enable their permissions in Admin CP)
..whose permissions do I need to enable? I already have registered users' permissions set to read posts; will this hack change something for them? Or do I need to set permissions differently for unregistered users? Sorry, I'm confused...

Logician
11-12-2002, 02:58 PM
Originally posted by hadley
You mean the id of the group I wish to keep out, right? So, if there are three, how do I name them? (COPPA, unregistered, and awaiting email confirm)

its the usergroup of the group which can list the threads but can not view them.. If there are more than 1, apply the line in this context:

if ($forumid==X AND ($bbuserinfo[usergroupid]==Y OR $bbuserinfo[usergroupid]==Z OR $bbuserinfo[usergroupid]==W))
Now you can replace Y, Z and W with the usergroupids..(COPPA, unregistered, and awaiting email confirm in your example)

Originally posted by hadley
..whose permissions do I need to enable? I already have registered users' permissions set to read posts; will this hack change something for them? Or do I need to set permissions differently for unregistered users? Sorry, I'm confused...
You have to enable access permissions for these 3 usergroups (COPPA, unregistered, and awaiting email confirm) in that forum so that they can view other's threads.. Then apply the hack..

Otherwise your board will not display the thread list to them so hack will be pointless..

hadley
11-12-2002, 03:03 PM
Gotcha -- many thanks.

Btw, the permissions are already enabled for those non-registered groups -- i.e., they now can do everything except post -- so I shouldn't have to change anything prior to the hack.

Logician
11-12-2002, 03:10 PM
nope.. you are all set..

BigJohnson
11-12-2002, 09:14 PM
Instead of typing out everysingle forumid number how do I make it work so it just works for every single forum.

Logician
11-12-2002, 09:22 PM
Originally posted by BigJohnson
Instead of typing out everysingle forumid number how do I make it work so it just works for every single forum.
just remove $forumid==X AND part