DeeEmm

Pragmatism in code

Waxing lyrical about life the universe and everything software related since lunchtime 2006.

Dolphin - Auto membership level on join

If you would like to automatically apply membership levels to new members, then this mod is for you.

This can also be useful when wanting to differentiate between different member groups - ie - making all female members of a female only member group. Both methods are shown below.

in profile_activate.php

Find

//Promotional membership
if ( getParam('enable_promotion_membership') == 'on' )
{
$memership_days = getParam('promotion_membership_days');
setMembership( $p_arr['Couple'], MEMBERSHIP_ID_PROMOTION, $memership_days, true );
}
}

add underneath

setMembership( $p_arr['ID'], MEMBERSHIP_GROUP_ID, 0, true );

Change MEMBERSHIP_GROUP_ID to the ID of the group you want members to automatically become a member of. You can get this by looking in the sys_acl_levels database table.

If you wish to target a specific type of member - for example females, then you need to determine which type the new member belongs to. In this case instead of the code above, use the following code instead.

if ($p_arr['Sex'] == 'female') {
setMembership( $p_arr['ID'], FEMALE_MEMBERSHIP_ID, 0, true )
}

Simply change $p_arr['Sex'] to whatever profile field you wish to check for, this also includes any custom profile fields that you have added.

/DM

Dolphin - Redirect users after editing profile
Syntax highlighting code in TinyMCE
 

Comments 4

MrSmall on Saturday, 10 September 2011 23:54

Hello, I'm having a slight issue and I may have misunderstood the steps. I have a 'Family Member' membership level that I wish to be default. Looking at theses instructions this is what I understand the file to look like:

//Promotional membership
if ( getParam('enable_promotion_membership') == 'on' )
{
$memership_days = getParam('promotion_membership_days');
setMembership( $p_arr['Couple'], MEMBERSHIP_ID_PROMOTION, $memership_days, true );
}
}
setMembership( $p_arr['ID'], FAMILY MEMBER, 0, true );

Also, my promotional option is turned off and it keeps showing standard. I need help, Please advise.

Thank you.

0
Hello, I'm having a slight issue and I may have misunderstood the steps. I have a 'Family Member' membership level that I wish to be default. Looking at theses instructions this is what I understand the file to look like:

//Promotional membership
if ( getParam('enable_promotion_membership') == 'on' )
{
$memership_days = getParam('promotion_membership_days');
setMembership( $p_arr['Couple'], MEMBERSHIP_ID_PROMOTION, $memership_days, true );
}
}
setMembership( $p_arr['ID'], FAMILY MEMBER, 0, true );

Also, my promotional option is turned off and it keeps showing standard. I need help, Please advise.

Thank you.
Admin on Sunday, 11 September 2011 00:16

You need to replace the text FAMILY MEMBER with the value for your group - this should be an integer by memory (number)

To find this value you will need to look at the sys_acl_levels database table.

HTH

/DM

0
You need to replace the text FAMILY MEMBER with the value for your group - this should be an integer by memory (number)

To find this value you will need to look at the sys_acl_levels database table.

HTH

/DM
MrSmall on Sunday, 11 September 2011 00:20

Cool,

I'm glad you said that, cause I was just looking at that and was going to ask, where do I find the sys_acl_levels database? is that in my inc folder? I'm sorry if that sound dumb.

0
Cool,

I'm glad you said that, cause I was just looking at that and was going to ask, where do I find the sys_acl_levels database? is that in my inc folder? I'm sorry if that sound dumb.
Admin on Sunday, 11 September 2011 01:09

You can usually access the database from your websites control panel, normally by accessing a database client. If your webspace provider uses 'cpanel', then the client will be phpMyAdmin - just scroll down the page until you see it. once opened you will see a list of tables on the left - look for sys_acl_levels and click on it.

At the top you will see several tabs, click browse to view the table contents.

if the table has more info than can be viewed on one page, you will see navigation controls to browse the other pages.

Look for the entry that corresponds with your group, the value under the column ID is the one you need.

If your host uses a different database client you may need to contact their support to find out how to access it

/DM

0
You can usually access the database from your websites control panel, normally by accessing a database client. If your webspace provider uses 'cpanel', then the client will be phpMyAdmin - just scroll down the page until you see it. once opened you will see a list of tables on the left - look for sys_acl_levels and click on it.

At the top you will see several tabs, click browse to view the table contents.

if the table has more info than can be viewed on one page, you will see navigation controls to browse the other pages.

Look for the entry that corresponds with your group, the value under the column ID is the one you need.

If your host uses a different database client you may need to contact their support to find out how to access it

/DM
Already Registered? Login Here
Guest
Wednesday, 13 December 2017
If you'd like to register, please fill in the username, password and name fields.

Captcha Image