News:

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

Main Menu

How to enable access to certain boards based on member registration date?

Started by sharks, September 29, 2010, 10:25:03 AM

Previous topic - Next topic

sharks

I have some boards that i would like to be made visible and accessible only to the older members (based on registration date) who get some sort of exclusive access for being a long-time member of my forum. How to enable access based on the registration date? For example, i would like all members who registered before 1st of March 2010 to have additional access to some specific boards.
Any help would be most welcome. :) Thanks in advance!

goldwinggl

The only way I know to do this would be to create a member group that has access to the boards you want to do that on, and then change them to it.

sharks

Quote from: goldwinggl on September 29, 2010, 10:41:07 AM
The only way I know to do this would be to create a member group that has access to the boards you want to do that on, and then change them to it.

That's not feasible at all, especially if you have to manually sort through over 10,000 existing members.
An automatic way to sort through the member list and assign this permission would be best.
I think maybe a new option when modifying each board, where there would be a text area where i can type in the registration date. That way, when any member clicks to view inside the board, there is a check made right then against the member's registration date. If the date matches the set date, then access is enabled, otherwise it should be disabled, with an error message.

goldwinggl

Sounds like you have it all figured out, so now you just have to make it.

xenovanis

Is this a one time change? There should be a query that will move all members based on a fixed point (registration date) to a specific group.
"Insanity: doing the same thing over and over again and expecting different results."

sharks

Quote from: goldwinggl on October 01, 2010, 01:32:07 AM
Sounds like you have it all figured out, so now you just have to make it.

WTF? If i had the knowledge i would, and your reply isn't being any helpful either, so stop wasting my time.

Quote from: xenovanis on October 01, 2010, 06:00:38 AM
Is this a one time change? There should be a query that will move all members based on a fixed point (registration date) to a specific group.

Hi xenovanis

Yes, it is a one-time change. i have already created a specific group to contain all members who have a registration date prior to the set date. But how do i safely go about doing this? I am going to do this on my live DB, unless you think it's better to do this on a test DB first?
Thanks a lot for your help, as always. :)

xenovanis

Nonono, let's test it first :P

I'll poke around in my testdatabase and see if I can come up with a query. Do you want them to be added to an additional membergroup or a primary? Note that you can only use one primary membergroup for a member, but several additional membergroups.

What's the date?
"Insanity: doing the same thing over and over again and expecting different results."

xenovanis

Quote from: goldwinggl on October 01, 2010, 03:09:23 PM
Actually that is a Mod Request so this is the Wrong place to ask it....

Really? And how is a one time to run query a modrequest?
"Insanity: doing the same thing over and over again and expecting different results."

sharks

Quote from: xenovanis on October 01, 2010, 02:37:40 PM
Note that you can only use one primary membergroup for a member, but several additional membergroups.

What's the date?

In that case, i would prefer to add these selected members to an additional membergroup, rather than change their primary membergroup.

The date is 31st March 2010, meaning that all members who registered till that date should be sorted out and be assigned to an additional membergroup with group ID: ? (say, 45). All members who registered as from 1st April 2010 should remain unaffected.

Thanks again. :)

xenovanis

Okay, I'm getting there. Have one minor issue to fix though. Basically it works, but it's ugly.
"Insanity: doing the same thing over and over again and expecting different results."

xenovanis

sharks, please backup your database, or the smf_members table first before applying it. It would be a pain to reverse it, so make sure to understand the risks. With a little help from Sleepy I found this query working:


UPDATE `smf_members` SET `additional_groups` = IF(additional_groups = '', '45', CONCAT_WS(',' , `additional_groups` , NULL , '45')) WHERE `date_registered` < '1270080001'


where:
smf_ is the prefix used for your database
45 is the id for the additional membergroup
1270080001 = the date, Thu, 01 Apr 2010 00:00:01 GMT

Basically, every member that has a registerdate smaller than 1270080001, will be added to the group id 45.

Hope this helps you :)
"Insanity: doing the same thing over and over again and expecting different results."

elbeer

This would be good if it was made into a mod where you could add members to certain groups after say 1 month, then add to another group after 2 months and so on. This way you could drip feed information to your members.

This could be based on a choice of registration date OR paid subscription date.

If anyone fancies making this work please do let me know. This would be invaluable to online courses.

EDIT: Also for more recent versions of SMF 2.0+

d3vcho

"Greeting Death as an old friend, they departed this life as equals"

Advertisement: