restrict Forum view ?

James

Well-known member
#23
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.
 

erich37

Well-known member
#26
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