Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

age defined boards

Aloittaja Jade Elizabeth, syyskuu 08, 2007, 07:15:31 IP

« edellinen - seuraava »

Jade Elizabeth

can i create either a usergroup that is age defined, or an actual board thats age defined?
so people over or under a certain age cannot get into it?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

karlbenson

I've not seen a mod to do it.

You can request it in the mod requests forum

greyknight17

Not really, at least not without some code changes. If you want to have a mod created for this, we can move it to the Mod Requests board for more attention.

There could be a work around. You can manually grant access for the new members to the restricted boards if you see them fit for the age limit. This leaves all new members within the public boards (can't access restricted boards). The way I see it, a member could always lie about their age though in the registration and this will get them in the restricted boards regardless. The same applies if you try to manually screen them...

Jade Elizabeth

#3
Lainaus käyttäjältä: greyknight17 - syyskuu 08, 2007, 07:39:41 IP
There could be a work around. You can manually grant access for the new members to the restricted boards if you see them fit for the age limit. This leaves all new members within the public boards (can't access restricted boards). The way I see it, a member could always lie about their age though in the registration and this will get them in the restricted boards regardless. The same applies if you try to manually screen them...

yeah, im aware of this and i believe if they wanna do the wrong thing then its their choice, but if i catch them they will regret it.

could we move it to the mod requests please?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

greyknight17


Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

greyknight17

Please give it time. If someone knows how to do this and has the time, they will try to make a mod or give you the code changes to make it work.

Not all requests can be fulfilled though.

codenaught

You may be able to adapt this:

http://www.simplemachines.org/community/index.php?topic=188715.msg1200834#msg1200834

To meet your needs. :)

Except the code that you would use in your case, may look something like this:

$birthday = empty($user_settings['birthdate']) || $user_settings['birthdate'] === '0001-01-01' ? '0000-00-00' : (substr($user_settings['birthdate'], 0, 4) === '0004' ? '0000' . substr($user_settings['birthdate'], 4) : $user_settings['birthdate']);
$datearray = getdate(forum_time());
list ($birth_year, $birth_month, $birth_day) = sscanf($birthday, '%d-%d-%d');
$age = $birth_year <= 4 ? $txt[470] : $datearray['year'] - $birth_year - (($datearray['mon'] > $birth_month || ($datearray['mon'] == $birth_month && $datearray['mday'] >= $birth_day)) ? 0 : 1);
if ($age >= 10)
$user_info['groups'][] = 5;


Changing the '10' in that code to the age the member must be to be in the group.
Dev Consultant
Former SMF Doc Coordinator

Jade Elizabeth

oh awesome
id love to use it, thanks :D
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Jade Elizabeth

lol...
it doesnt work?
i have members of all ages, but i want to restrict only a FEW boards from view so that adults can be free of pesky kids at times
and maybe even vice versa

so is there a way that when creating a new board i can select "age defined" and put in a number, then chose over/under but it ONLY AFFECT THAT ONE BOARD?!
and users without an age cannot enter?

also an option to hide the board from those not in the age range?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

codenaught

Make sure that no groups by default are being granted access to see the board except the one group that members are added to in the code.
Dev Consultant
Former SMF Doc Coordinator

Jade Elizabeth

i dont see any groups that their added too...
theres no new ones created :S
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

codenaught

Well the idea is to create a new membergroup, and then have a board only grant access to that group.

This is what this part of the code signifies:

$user_info['groups'][] = 5;

You would change '5' to the ID of the new group you created that has access to the board you want people with a certain amount of posts to see.
Dev Consultant
Former SMF Doc Coordinator

Jade Elizabeth

okay...i want to have one or two boards
where i can enter the age to be between (say 16-18....or 18-100) two numbers, or even just above one number (like 18)

and people who havent entered an age cannot enter the boards
and those who have can only enter if their age is the right one

and i NEED dummy instructions
you can give me all the code you want, but if i dont know i have to create a new file or group...i cant do it lol
and how am i supposed to know what number the group is?

and i dont want the FORUM to be age defined, just ONE board....and i want to be able to check if i want it age defined in the "create new board" thing...im not to hot on groups, because if they move into age groups (nice pun there ;)) they cant have other groups right?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

codenaught

#14
My idea is to create a new membergroup, give access to the age restricted board for that group but no other groups.

In that code to make it a range, you could make this:

if ($age >= 10)

Into something like this:

if ($age >= 16 && $age <= 18)

That code essentially assigns the member into the group that can see the age restricted board depending on the age the member is.

Lainaaand i want to be able to check if i want it age defined in the "create new board" thing
That's a problem then. This code does not provide an interface and I don't really have enough time to invest to add an interface for this like you suggested (and in other words release this as a mod). I do have ideas in my head of writing a mod at sometime that deals with being able to add specialty groups where members could automatically be put in them in certain conditions such as if the member has at least a certain karma and/or a certain age, gender, etc, but that would probably be way down the road. ;)

Dev Consultant
Former SMF Doc Coordinator

Advertisement: