restrict Forum view ?

erich37

Well-known member
how do I make a specific Forum being viewable only for registered members and only for people over the age of 18 ?

You must be 18 or older to view or post in this forum.

Many thanks!
 
If using an add-on, this code could help:
PHP:
$userAge = $this->_getUserProfileModel()->calculateAge($year, $month, $day);
if ($userAge < intval($options->get('registrationSetup', 'minimumAge')))
{
// do something
}
Obviously tweaked to your own desire.
 
Go to your:

Admin CP -> Users -> Node Permissions -> [click the forum]

Make it a private node and click Update:

View attachment 11559

Then grant access to the Registered group (in the same area):

Admin CP -> Users -> Node Permissions -> [click the forum] -> [click Registered]

Set Allow permissions.

The nature of a private node is that everyone is denied access except those which you explicitly allow.

If you can think of a way to verify people's age during registration...

You might consider just adding a notice with a warning that you must be 18 years or older. See this thread:

http://xenforo.com/community/threads/message-for-your-guests.5934/

Can I do the same with a Category?
So setting the "Category" as "private" and all Forums underneath it will then also be private?

Thanks!
 
Top Bottom