Documentation

Quick Start

Summary

  1. Installation [+]
    1. Activation Key
  2. Upgrade [+]
    1. Automatic Upgrade
  3. Contents Restricted To Members [+]
    1. Specific Content To A Member Area
    2. Specific Content To Several Members Areas
    3. The delay Attribute (Content Dripping)
    4. The date Attribute
    5. Specific Content To A Member Category
    6. Partially Protected Post
    7. Nested Shortcodes
  4. Pages Restricted To Members [+]
    1. Specific Page To A Member Area
    2. Specific Page To Several Members Areas
    3. The delay Attribute (Content Dripping)
    4. The date Attribute
    5. Specific Page To A Member Category
    6. Logout Page
    7. Non-WordPress Static Websites
  5. Comments Restricted To Members [+]
    1. Specific Comments To A Member Area
    2. Specific Comments To Several Members Areas
    3. The delay Attribute (Content Dripping)
    4. The date Attribute
    5. Specific Comments To A Member Category
  6. Member Status [+]
    1. Activation Link
    2. Automatic Login
  7. Members Areas [+]
    1. Included Members Areas
    2. Commercial Members Areas
    3. Automatic Modifications
  8. Display Of Informations About A Member Area [+]
    1. The default Attribute
    2. The filter Attribute
  9. Display Of Informations About A Member Area Category [+]
    1. The default Attribute
    2. The filter Attribute
    3. Display Of Informations About The Member Area Category
  10. Display Of Informations About The Member [+]
    1. The default Attribute
    2. The filter Attribute
  11. Display Of Informations About A Member Category [+]
    1. The default Attribute
    2. The filter Attribute
    3. Display Of Informations About The Member Category
  12. Counters [+]
    1. Display Of Numbers And The Limit
    2. Automatic Content Substitution
    3. Succession Of Counters
    4. The range Attribute
  13. Display Of The Options [+]
    1. The default Attribute
    2. The filter Attribute
  14. Encryption Of URLs
  15. Emails
  16. Autoresponders [+]
    1. AWeber
    2. CyberMailing
    3. GetResponse
    4. MailChimp
    5. SG Autorepondeur
  17. Registration As A Client
  18. Registration To Affiliate Program
  19. WordPress
  20. Display Of Informations About The User [+]
    1. The default Attribute
    2. The filter Attribute
  21. Custom Instructions
  22. Display Of Forms [+]
    1. Redirection
    2. Automatic Positioning Of The Cursor
    3. Automatic Completion Of Fields
    4. The Registration Form
    5. Attributes
  23. Creation Of Forms [+]
    1. The [input] Shortcode
    2. Attributes Of The [input] Shortcode
    3. The [textarea] Shortcode
    4. Attributes Of The [textarea] Shortcode
    5. The [select] Shortcode
    6. Attributes Of The [select] Shortcode
    7. The [option] Shortcode
    8. Attributes Of The [option] Shortcode
    9. Required Fields
    10. Error Messages
    11. Attributes Of The [error] Shortcode
    12. The [label] Shortcode
    13. Attributes Of The [label] Shortcode
    14. CAPTCHAs
    15. Attributes Of The [captcha] Shortcode
    16. Double Entry
    17. Current Password
    18. The Submit Button
    19. The [validation-content] Shortcode
    20. The [indicator] Shortcode
    21. Attributes Of The [indicator] Shortcode
  24. Members List [+]
    1. The [if] Shortcode
    2. The [foreach] Shortcode
  25. Creation Of Your Pages Relating To Membership [+]
    1. Your Registration Page
    2. Your Registration Confirmation Page
    3. Your Password Reset Page
    4. Your Login Page
    5. Your Logout Page
    6. Your Members Home Page
    7. Your Profile Edit Page
    8. Your Menu
  26. Custom Fields
  27. Non-WordPress Static Websites [+]
    1. Installation Of WordPress
    2. The Files Of Your Website
    3. Loading Of WordPress
    4. Using Shortcodes
  28. Advanced Customization [+]
    1. Navigation Menu
    2. Generation And Evaluation Of Passwords
    3. Custom Autoresponders
    4. Custom Files
    5. Custom Languages
  29. FAQ [+]
    1. Can I use shortcodes in fields of admin pages?
    2. How can I use shortcodes in my WordPress theme?
    3. How can I use shortcodes in comments?
    4. How can I use shortcodes in attributes of shortcodes?
    5. How can I nest several identical shortcodes?
  30. Changelog

Quick Start

Here's how to set up a member area in less than 3 minutes:

1. Create a member area through the Add Member Area page of Membership Manager. Enter a name for this member area and click on one of the Save buttons.

2. Create with a single click the pages relating to membership (Registration, Profile, etc...) through the Pages creation module of the Front Office page of Membership Manager.

That's all!

The Back Office page of Membership Manager allows you to customize your interface. With this page, you will can display the items that are useful for you and remove the others. In short, you will get an interface that fits precisely to your needs. We advise you to quickly browse through the admin pages of Membership Manager in order to have a global vision, and then take the time to properly configure your options.

You can test the pages of the member area by creating your member account through the Add Member page, or through the registration page of your member area. If you want to display a different navigation menu for members, follow these guidelines. If you want to create a commercial member area, follow these guidelines.

If you have installed one or more cache plugins on your website, we strongly recommend you to deactivate them. The principle of these plugins is to speed up your website by preventing it from working properly, more precisely by preventing the scripts of your website from generating pages on the fly and by using a cached version instead. Cache plugins are therefore likely to cause serious problems.

Deactivate all your cache plugins (after emptying their caches). And in your wp-config.php file, remove this line if it exists:

define('WP_CACHE', true);

Among the many problems that can occur, the visitors of your website could access pages restricted to your members/clients/affiliates without logging in, and see the personal informations of another member/client/affiliate instead of their own. If you use Commerce Manager, your purchase buttons/links/forms may not work properly.

1. Installation

  1. Unzip the plugin file.
  2. Upload with your FTP software the membership-manager folder, and only this folder, to your plugins directory (it should be wp-content/plugins).
  3. Activate the plugin through the Plugins menu in WordPress.
  4. Personalize the plugin interface through the Back Office page of Membership Manager in WordPress.
  5. Configure the plugin through the Options page of Membership Manager in WordPress.

You can also install Membership Manager through the Add Plugins page of the Plugins menu in WordPress (Plugins => Add New => Upload Plugin). Upload the plugin file without unzipping it.

1.1 Activation Key

You must enter your activation key in the Activation key field of the Activation/Upgrade module in the Options page of Membership Manager. This key is mandatory to avoid an automatic deactivation of Membership Manager in a few hours. You can find it in the home page of your client area, and in the emails you received just after your order.

2. Upgrade

When you upgrade Membership Manager, you don't lose any settings or any data.

  1. Unzip the plugin file.
  2. Upload with your FTP software the membership-manager folder, and only this folder, to your plugins directory (it should be wp-content/plugins), without deleting the membership-manager folder that already exists in this directory.

You don't need to deactivate and reactivate the plugin.

2.1 Automatic Upgrade

You can choose to automatically install all the upgrades of Membership Manager as soon as they become available, by checking the Automatically upgrade Membership Manager box of the Activation/Upgrade module in the Options page of Membership Manager. To make sure it works well, enter your FTP credentials in your wp-config.php file, like this:

define('FTP_HOST', 'your-ftp-host');
define('FTP_USER', 'your-ftp-username');
define('FTP_PASS', 'your-ftp-password');

If it still doesn't work, make sure the PECL Zip extension is enabled on the server that hosts your website.

3. Contents Restricted To Members

To display a content restricted to members, insert into your posts/pages/widgets a code like this:

[membership-content]Content displayed if you are logged in as a member[/membership-content]

You can also define a content that will be displayed if the user is not logged in as a member, like this:

[membership-content]
Content displayed if you are logged in as a member[other]
Content displayed if you are not logged in as a member
[/membership-content]

Result (with a little formatting):

Content displayed if you are not logged in as a member

3.1 Specific Content To A Member Area

To display a content restricted to users who have access to one of your members areas, insert into your posts/pages/widgets a code like this:

[membership-content id=N]Content displayed if you have access to this member area[/membership-content]

by replacing N with the ID of the member area.

You can also define a content that will be displayed if the user has not access to the member area, like this:

[membership-content id=N]
Content displayed if you have access to this member area[other]
Content displayed if you have not access to this member area
[/membership-content]

Result (with a little formatting):

Content displayed if you have not access to this member area

3.2 Specific Content To Several Members Areas

It is possible to specify several IDs for the id attribute, by separating the different IDs by /, like this:

[membership-content id=id1/id2/.../idN]Content displayed if you have access to at least one of these members areas[/membership-content]

Example:

[membership-content id=5/3/8]
Content displayed if you have access to at least one of these members areas[other]
Content displayed if you have not access to any of these members areas
[/membership-content]

Result (with a little formatting):

Content displayed if you have not access to any of these members areas

3.3 The delay Attribute (Content Dripping)

You can display a content to which the members will have access only after a certain time after their registration, like this:

[membership-content delay=d:h:m:s]
Content displayed if you are logged in as a member and if you are registered for long enough[other]
Content displayed if you are not logged in as a member or if you are not registered for long enough
[/membership-content]

d = number of days
h = number of hours
m = number of minutes
s = number of seconds

In some cases, you can specify the delay more simply:

  • d is equivalent to d:0:0:0
  • d:h is equivalent to d:h:0:0
  • d:h:m is equivalent to d:h:m:0

Example:

[membership-content id=1 delay=7]
Content displayed if you have access to this member area and if you are registered for at least one week[other]
Content displayed if you have not access to this member area or if you are registered for less than one week
[/membership-content]

Result (with a little formatting):

Content displayed if you have not access to this member area or if you are registered for less than one week

You can also use the following values for the delay attribute:

  • nY to indicate a number of years
  • nM to indicate a number of months
  • nW to indicate a number of weeks

Examples:

[membership-content id=1 delay=1Y]
Content displayed if you have access to this member area and if you are registered for at least one year[other]
Content displayed if you have not access to this member area or if you are registered for less than one year
[/membership-content]
[membership-content id=1 delay=3M]
Content displayed if you have access to this member area and if you are registered for at least 3 months[other]
Content displayed if you have not access to this member area or if you are registered for less than 3 months
[/membership-content]
[membership-content id=1 delay=5W]
Content displayed if you have access to this member area and if you are registered for at least 5 weeks[other]
Content displayed if you have not access to this member area or if you are registered for less than 5 weeks
[/membership-content]

3.4 The date Attribute

You can display a content to which the members will have access only if they have registered before a certain date, like this:

[membership-content date=YYYY/MM/DD-hh:mm:ss]
Content displayed if you are logged in as a member and if you have registered before this date[other]
Content displayed if you are not logged in as a member or if you have not registered before this date
[/membership-content]

YYYY = year
MM = month (from 1 to 12)
DD = day of the month (from 1 to 31)
hh = hours
mm = minutes
ss = seconds

In some cases, you can specify the date more simply:

  • YYYY/MM/DD is equivalent to YYYY/MM/DD-00:00:00
  • YYYY/MM/DD-hh is equivalent to YYYY/MM/DD-hh:00:00
  • YYYY/MM/DD-hh:mm is equivalent to YYYY/MM/DD-hh:mm:00

The date shall be indicated according to the time zone of your website. Set correctly your time zone via the WordPress Administration Panel if you have not done. To automatically apply the publication date of the post/page, enter post as the value for the date attribute.

Example:

[membership-content id=1 date=post]
Content displayed if you have access to this member area and if you are registered at the time of publication of the post/page[other]
Content displayed if you have not access to this member area or if you are not registered at the time of publication of the post/page
[/membership-content]

Result (with a little formatting):

Content displayed if you have not access to this member area or if you are not registered at the time of publication of the post/page

3.5 Specific Content To A Member Category

To display a content restricted to members of a certain category, insert into your posts/pages/widgets a code like this:

[membership-content category=N]Content displayed if you belong to this member category[/membership-content]

by replacing N with the ID of the category.

It is possible to specify several IDs for the category attribute, by separating the different IDs by /, like this:

[membership-content category=id1/id2/.../idN]Content displayed if you belong to one of these members categories[/membership-content]

3.6 Partially Protected Post

Here is an example of code that you can insert into your posts/pages/widgets in order to partially protect the content:

[membership-content]
Content protected, to which only your members have access[other]
To read more, you must be a member.

[membership-login-form]

<a href="URL of the registration page">Register</a> now!
<a href="URL of the password reset page">Click here if you have lost your password</a>
[/membership-content]

3.7 Nested Shortcodes

When you nest several identical shortcodes, you must add an integer between 1 and 3 at the end of the tags of these shortcodes, like this:

[membership-content...]...
[membership-content1...]...
[membership-content2...]...
[membership-content3...]...
[/membership-content3]...
[/membership-content2]...
[/membership-content1]...
[/membership-content]

4. Pages Restricted To Members

You can create pages restricted to users logged in as members, and redirect the users to another page if they're not logged in as members. If you use Membership Manager on a non-WordPress static website, follow these instructions.

Create a new page in WordPress. In the edit page of this page, create the membership custom field (if you don't see the module of custom fields, click on Screen Options at the top right of the page and check the Custom fields box in order to display it) and enter as the value a code like this:

[membership-redirection condition=condition url=URL]

by replacing URL with the URL to which you want to redirect the user and condition with:

  • session to redirect the user only if he's logged in as a member
  • !session to redirect the user only if he's not logged in as a member

Custom fields
Custom fields

For example, in the edit page of the page containing your login form, create the membership custom field and enter as the value a code like this:

[membership-redirection condition=session url=URL]

When he will be logged in as a member, the user will be immediately redirected to the URL.

To understand how to create your pages relating to membership, refer to this section.

4.1 Specific Page To A Member Area

You can create a page restricted to users who have access to one of your members areas, and redirect the users to another page if they don't have access to this member area. In the edit page of this page, create the membership custom field and enter as the value a code like this:

[membership-redirection condition=!session url=URL id=N]

by replacing URL with the URL to which you want to redirect the user and N with the ID of the member area.

Users who don't have access to this member area will be redirected to the URL.

4.2 Specific Page To Several Members Areas

You can specify several IDs for the id attribute, by separating the different IDs by /, like this:

[membership-redirection condition=!session url=URL id=id1/id2/.../idN]

Users who don't have access to any of these members areas will be redirected to the URL.

4.3 The delay Attribute (Content Dripping)

You can create pages to which the members will have access only after a certain time after their registration, like this:

[membership-redirection condition=!session url=URL delay=d:h:m:s]

d = number of jours
h = number of hours
m = number of minutes
s = number of seconds

In some cases, you can specify the delay more simply:

  • d is equivalent to d:0:0:0
  • d:h is equivalent to d:h:0:0
  • d:h:m is equivalent to d:h:m:0

Example:

[membership-redirection condition=!session url=URL id=1 delay=7]

In this example, users who don't have access to the member area whose the ID is equal to 1 and users who are registered for less than one week will be redirected to the URL.

You can also use the following values for the delay attribute:

  • nY to indicate a number of years
  • nM to indicate a number of months
  • nW to indicate a number of weeks

Examples:

[membership-redirection condition=!session url=URL id=1 delay=1Y]
[membership-redirection condition=!session url=URL id=1 delay=3M]
[membership-redirection condition=!session url=URL id=1 delay=5W]

4.4 The date Attribute

You can create pages to which the members will have access only if they have registered before a certain date, like this:

[membership-redirection condition=!session url=URL date=YYYY/MM/DD-hh:mm:ss]

YYYY = year
MM = month (from 1 to 12)
DD = day of the month (from 1 to 31)
hh = hours
mm = minutes
ss = seconds

In some cases, you can specify the date more simply:

  • YYYY/MM/DD is equivalent to YYYY/MM/DD-00:00:00
  • YYYY/MM/DD-hh is equivalent to YYYY/MM/DD-hh:00:00
  • YYYY/MM/DD-hh:mm is equivalent to YYYY/MM/DD-hh:mm:00

The date shall be indicated according to the time zone of your website. Set correctly your time zone via the WordPress Administration Panel if you have not done. To automatically apply the publication date of the page, enter post as the value for the date attribute.

Example:

[membership-redirection condition=!session url=URL id=1 date=post]

In this example, users who don't have access to the member area whose the ID is equal to 1 and users who are not registered at the time of publication of the page will be redirected to the URL.

4.5 Specific Page To A Member Category

The category attribute works like the attribute of the same name for the [membership-content] shortcode.

4.6 Logout Page

To logout the member, he must click on a link that points to urlindex.php?action=logout, where url is the URL of the membership-manager directory (in your plugins directory). The logged out member is redirected to your home page.

Your logout URL should look like this:

http://www.your-domain-name.com/wp-content/plugins/membership-manager/index.php?action=logout

You can create a logout page with a custom redirection URL. Create a new page in WordPress. In the edit page of this page, create the membership custom field and enter as the value a code like this:

[membership-redirection action=logout url=URL]

by replacing URL with the URL to which you want to redirect the user.

Access to this page will have the effect of logout the member and redirect him to the specified URL.

4.7 Non-WordPress Static Websites

If you use Membership Manager on a non-WordPress static website, you can't use custom fields. To replace them, you must insert these lines of code into the PHP file of your webpage:

add_shortcode('membership-redirection', create_function('$atts', 'include_once MEMBERSHIP_MANAGER_PATH."shortcodes.php"; return membership_redirection($atts);'));
$membership = '[your-shortcode]'; do_shortcode($membership);

just after this line:

include_once $file;

by replacing [your-shortcode] with a shortcode allowing to redirect the user.

If your page contains a login form, you must also insert this line of code:

<?php $redirection = do_shortcode($membership); if ($redirection!= '') { echo '<script type="text/javascript">window.location = \''.$redirection.'\';</script>'; } ?>

just after this line:

<?php wp_footer(); ?>

5. Comments Restricted To Members

You can create posts/pages whose comments are restricted to users logged in as members.

In the edit page of this post/page, create the membership custom field (if you don't see the module of custom fields, click on Screen Options at the top right of the page and check the Custom fields box in order to display it) and enter as the value a code like this:

[membership-comments condition=condition]

by replacing condition with:

  • session so that the comments are restricted to users logged in as members
  • !session so that the comments are restricted to users who are not logged in as members

5.1 Specific Comments To A Member Area

You can create a post/page whose comments are restricted to users who have access to one of your members areas. In the edit page of this post/page, create the membership custom field and enter as the value a code like this:

[membership-comments condition=session id=N]

by replacing N with the ID of the member area.

Users who don't have access to this member area will not see the comments.

5.2 Specific Comments To Several Members Areas

You can specify several IDs for the id attribute, by separating the different IDs by /, like this:

[membership-comments condition=session id=id1/id2/.../idN]

Users who don't have access to any of these members areas will not see the comments.

5.3 The delay Attribute (Content Dripping)

The delay attribute works like the attribute of the same name for the [membership-redirection] shortcode.

5.4 The date Attribute

The date attribute works like the attribute of the same name for the [membership-redirection] shortcode.

5.5 Specific Comments To A Member Category

The category attribute works like the attribute of the same name for the [membership-content] shortcode.

6. Member Status

Your members can have 3 statuses: Active, Inactive and Deactivated. An active member can login. At the opposite, an inactive (or deactivated) member inactive can't.

You can choose the status assigned to your members upon their registration. If they're inactive, you will must activate them manually, or send them an activation link.

You can also deactivate your members at any time.

The activation confirmation/notification emails are sent only when the member status moves from Inactive to Active, and the deactivation notification email is sent only when the member has been deactivated.

6.1 Activation Link

If when they register, your members are inactive, you can send them an activation link so they can activate their account. To send your members an activation URL, use the following code:

[membership-activation-url]

In the Body field of your registration confirmation email, you can insert a code like this:

Click on the link below to activate your member account:

[membership-activation-url]

6.2 Automatic Login

You can choose to automatically login your members after their registration through the registration form of Membership Manager. If your members are active when they register, they will be logged in immediately. Otherwise, they will be logged in immediately after clicking on their activation link.

7. Members Areas

The Members areas field of the edit page of a member (or a member category) allows you to specify the list of members areas to which the member can access. Enter the IDs of the members areas, separated by commas, into this field. Enter 0 if you want the member can access to all members areas of your website.

7.1 Included Members Areas

Each of your members areas may include other members areas of your website. Access to a member area automatically provides access to all the members areas included.

Example:

You want to have two members areas on your website: Standard and Premium. You want the members who can access to the Premium member area can also access to the Standard member area.

Solution:

Create a first member area that you appoint Standard. Then create the Premium member area and include the Standard member area into it.

7.2 Commercial Members Areas

To create a commercial member area, simply start by creating a member area in Membership Manager, then in Commerce Manager, create a product you can name Subscription to the member area for example, and use the Membership module of the product's page to automatically subscribe buyers in the member area.

For more information, refer to the Membership section of the Commerce Manager's documentation.

You can give to the buyer his login name and his password, by inserting a code like this one in the Body field of your order confirmation email or in the Instructions to the customer field of your product:

Your login name: [member login]
Your password: [member password default="the same as before"]

You can choose to automatically unsubscribe the member from the member area if his order is refunded or if his recurring payments profile is deactivated while he owes at least one payment. In case of refund, the unsubscription is always immediate.

If the member has paid his order by installments, then in case of premature deactivation of the recurring payments profile, you can choose to unsubscribe him immediately, or only at the date on which the next payment was scheduled.

7.3 Automatic Modifications

You can automatically modify the list of members areas to which a member can access when a certain date is reached. This allows you to offer a temporary access (limited to a few months or one year, for example) to a member area. To do this, insert into the Automatic modifications field of his edit page a code like this:

+N (YYYY-MM-DD hh:mm:ss)

by replacing N with the ID of the member area. This code means that the member gets access to the member area whose the ID is equal to N when the date is reached. To withdraw access, replace the + sign with -, like this:

-N (YYYY-MM-DD hh:mm:ss)

You can configure Membership Manager to notify the member of his unsubscription/imminent unsubscription from the member area.

YYYY = year
MM = month (from 1 to 12)
DD = day number of the month (from 1 to 31)
hh = hours
mm = minutes
ss = seconds

In some cases, you can specify the date differently:

  • YYYY-MM-DD is equivalent to YYYY-MM-DD 00:00:00
  • YYYY-MM-DD hh is equivalent to YYYY-MM-DD hh:00:00
  • YYYY-MM-DD hh:mm is equivalent to YYYY-MM-DD hh:mm:00

You can also use the following values for the date:

  • nY to indicate a number of years
  • nM to indicate a number of months
  • nW to indicate a number of weeks

Access to the member area will be added (or removed) when the date is reached. This date is the current date (or the registration date if the member is not yet registered), increased by the specified duration. If the access should be removed and if a date was already planned for this withdrawal, this date will be increased by the specified duration.

Example:

+2 (5W),
-1 (1Y)

The first code means that the member will get access to the member area whose the ID is equal to 2, 5 weeks later. The second code means that access to the member area whose the ID is equal to 1 will be removed one year after his registration if he's not yet registered, or one year after the current date if he's already registered (if a date was already planned for this withdrawal, this date will be increased by one year).

You can insert several codes separated with commas in the Automatic modifications field.

You can also use a value like this one for the date:

d:h:m:s

d = number of days
h = number of hours
m = number of minutes
s = number of seconds

Access to the member area will be added (or removed) when the date is reached. This date is the current date (or the registration date if the member is not yet registered), increased by the specified duration. If the access should be removed and if a date was already planned for this withdrawal, this date will be increased by the specified duration.

In some cases, you can specify the duration differently:

  • d is equivalent to d:0:0:0
  • d:h is equivalent to d:h:0:0
  • d:h:m is equivalent to d:h:m:0

Example:

+2 (2015-09-23),
-1 (10)

The first code means that the member will get access to the member area whose the ID is equal to 2 on 23 September 2015. The second code means that access to the member area whose the ID is equal to 1 will be removed 10 days after his registration if he's not yet registered, or 10 days after the current date if he's already registered (if a date was already planned for this withdrawal, this date will be increased by 10 days).

8. Display Of Informations About A Member Area

To display an information about a member area, insert into your posts/pages/widgets a code like this:

[member-area information id=N]

by replacing N with the ID of the member area and information with:

  • category-id to display the ID of the category
  • date to display the creation date
  • date-utc to display the creation date according to UTC time
  • description to display the description
  • id to display the ID
  • instructions to display the instructions
  • keywords to display the keywords
  • members-areas to display the IDs of the included members areas
  • name to display the name
  • url to display the URL

This list is not complete and has only the most relevant items. You can find all possible values of information in the tables.php file of Membership Manager.

Example:

[member-area name id=1]

Result:

Member Area

8.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty, using the default attribute, like this:

[member-area information default="text" id=N]

Don't forget to include the quotes at the beginning and the end of the default value.

8.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[member-area information filter=function id=N]

Replace function by the name of the function you want to apply.

Sometimes, the information is an English word. You can translate it into the language of your website by entering i18n as the value for the filter attribute.

Example:

Initial status of the members: [member-area members-initial-status filter=i18n id=1]

Result:

Initial status of the members: active

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[member-area information filter=function1/function2/.../functionN id=N]

The functions will be applied in the specified order.

9. Display Of Informations About A Member Area Category

To display an information about a member area category, insert into your posts/pages/widgets a code like this:

[member-area-category information id=N]

by replacing N with the ID of the member area category and information with:

  • category-id to display the ID of the parent category
  • date to display the creation date
  • date-utc to display the creation date according to UTC time
  • description to display the description
  • id to display the ID
  • instructions to display the instructions
  • keywords to display the keywords
  • members-areas to display the IDs of the included members areas
  • name to display the name
  • url to display the URL

This list is not complete and has only the most relevant items. You can find all possible values of information in the tables.php file of Membership Manager.

Example:

[member-area-category name id=1]

Result:

Members Areas

9.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty, using the default attribute, like this:

[member-area-category information default="text" id=N]

Don't forget to include the quotes at the beginning and the end of the default value.

9.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[member-area-category information filter=function id=N]

Replace function by the name of the function you want to apply.

Sometimes, the information is an English word. You can translate it into the language of your website by entering i18n as the value for the filter attribute.

Example:

Initial status of the members: [member-area-category members-initial-status filter=i18n id=1]

Result:

Initial status of the members: active

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[member-area-category information filter=function1/function2/.../functionN id=N]

The functions will be applied in the specified order.

9.3 Display Of Informations About The Member Area Category

You can specify a shortcode for the id attribute, provided to replace [ by ( and ] by ). It allows you to display an information about the category of a member area, like this:

[member-area-category information id="(your-shortcode)"]

Don't forget to include the quotes at the beginning and the end of the shortcode.

Example:

Category of [member-area name id=1]: [member-area-category name default="None" id="(member-area category-id id=1)"]

Result:

Category of Member Area: Members Areas

10. Display Of Informations About The Member

To display an information about the member, insert into your posts/pages/widgets a code like this:

[member information]

by replacing information with:

  • activation-date to display the activation date
  • activation-date-utc to display the activation date according to UTC time
  • address to display the address
  • category-id to display the ID of the category
  • country to display the country
  • date to display the registration date
  • date-utc to display the registration date according to UTC time
  • deactivation-date to display the deactivation date
  • deactivation-date-utc to display the deactivation date according to UTC time
  • email-address to display the email address
  • first-name to display the first name
  • id to display the ID
  • ip-address to display the IP address
  • last-name to display the last name
  • login to display the login name
  • members-areas to display the IDs of the members areas to which the member can access
  • password to display the password
  • phone-number to display the phone number
  • postcode to display the postcode
  • referrer to display the referrer
  • referring-url to display the referring URL
  • status to display the status (possible values: active, inactive, deactivated)
  • town to display the town
  • user-agent to display the browser
  • website-name to display the website name
  • website-url to display the website URL

Example:

Your login name: [member login]

Result:

Your login name:

10.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty, using the default attribute, like this:

[member information default="text"]

Don't forget to include the quotes at the beginning and the end of the default value.

10.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[member information filter=function]

Replace function by the name of the function you want to apply.

Sometimes, the information is an English word. You can translate it into the language of your website by entering i18n as the value for the filter attribute.

Example:

Your status: [member status default="inactive" filter=i18n]

Result:

Your status: inactive

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[member information filter=function1/function2/.../functionN]

The functions will be applied in the specified order.

11. Display Of Informations About A Member Category

To display an information about a member category, insert into your posts/pages/widgets a code like this:

[member-category information id=N]

by replacing N with the ID of the member category and information with:

  • category-id to display the ID of the parent category
  • date to display the creation date
  • date-utc to display the creation date according to UTC time
  • description to display the description
  • id to display the ID
  • keywords to display the keywords
  • members-areas to display the IDs of the members areas to which the member can access
  • name to display the name

Example:

[member-category name id=1]

Result:

Members

11.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty, using the default attribute, like this:

[member-category information default="text" id=N]

Don't forget to include the quotes at the beginning and the end of the default value.

11.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[member-category information filter=function id=N]

Replace function by the name of the function you want to apply.

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[member-category information filter=function1/function2/.../functionN id=N]

The functions will be applied in the specified order.

11.3 Display Of Informations About The Member Category

You can specify a shortcode for the id attribute, provided to replace [ by ( and ] by ). It allows you to display an information about the category of the member, like this:

[member-category information id="(your-shortcode)"]

Don't forget to include the quotes at the beginning and the end of the shortcode.

Example:

Your category: [member-category name default="None" id="(member category-id)"]

Result:

Your category: None

12. Counters

To display a counter, insert into your posts/pages/widgets a code like this:

[membership-counter data=data limit=L]
Data: [number][/membership-counter]

by replacing L with a positive number and data with:

  • members to count the number of members
  • members-areas to count the number of members areas
  • members-areas-categories to count the number of members areas categories
  • members-categories to count the number of members categories

When the limit is reached, the content between [membership-counter data=data limit=L] and [/membership-counter] disappears. You can format this content as any content of your website. The limit attribute is optional. If you don't use it, the content will not disappear:

[membership-counter data=data]
Data: [number][/membership-counter]

You can insert the [number] shortcode as many times as you want between [membership-counter data=data limit=L] and [/membership-counter]. If you don't insert it, Membership Manager allows you to schedule a content disappearance without displaying a counter:

[membership-counter data=data limit=L]
When the data reaches [limit], this sentence will disappear!
[/membership-counter]

12.1 Display Of Numbers And The Limit

You are not limited to the [number] shortcode. You can use the following shortcodes:

  • [limit] to display the limit
  • [number] to display the data
  • [remaining-number] to display the difference between the limit and the data

The filter attribute (defined here) is also available for these shortcodes.

12.2 Automatic Content Substitution

If you want to schedule a content substitution, insert into your posts/pages/widgets a code like this:

[membership-counter data=data limit=L]
Data: [number][after]The limit is reached.[/membership-counter]

by replacing L with a positive number.

Insert the content you want to substitute between [after] and [/membership-counter]. When the limit is reached, the content between [membership-counter data=data limit=L] and [after] disappears, and the content between [after] and [/membership-counter] appears. The content between [after] and [/membership-counter] is never sent to the browser until the limit is reached.

You can insert the [number] shortcode as many times as you want between [membership-counter data=data limit=L] and [/membership-counter]. If you don't insert it, Membership Manager allows you to schedule a content substitution without displaying a counter:

[membership-counter data=data limit=L]
The limit will be reached soon.
[after]The limit is reached.[/membership-counter]

12.3 Succession Of Counters

It is possible to specify several limits for the limit attribute, by separating the different limits by /, like this:

[membership-counter data=data limit=50/100]
The first limit will be reached soon.
[after]The second limit will be reached soon.
[after]The second limit has been reached.[/membership-counter]

You can use the following shortcodes:

  • [limit] to display the current limit
  • [number] to display the difference between the current data and the previous limit
  • [remaining-number] to display the difference between the current limit and the current data
  • [total-limit] to display the last limit of the limit attribute
  • [total-number] to display the current data
  • [total-remaining-number] to display the difference between the last limit of the limit attribute and the current data

The filter attribute (defined here) is also available for these shortcodes.

12.4 The range Attribute

You can count only data recorded during a specific time range by using the range attribute, like this:

[membership-counter data=data range=range limit=L]
Data: [number][/membership-counter]

Replace range with:

  • a positive number N to count only data recorded during the N last days
  • previous-week to count only data recorded during the previous week
  • previous-half-month to count only data recorded during the previous half-month
  • previous-month to count only data recorded during the previous month
  • previous-bimester to count only data recorded during the previous bimester
  • previous-trimester to count only data recorded during the previous trimester
  • previous-quadrimester to count only data recorded during the previous quadrimester
  • previous-semester to count only data recorded during the previous semester
  • previous-year to count only data recorded during the previous year

13. Display Of The Options

To display an option of Membership Manager, insert into your posts/pages/widgets a code like this:

[membership-manager option]

by replacing option with:

  • automatically-generated-password-length to display the length of the automatically generated password
  • encrypted-urls-validity-duration to display the validity duration of encrypted URLs
  • maximum-login-length to display the maximum length of the login name
  • maximum-password-length to display the maximum length of the password
  • minimum-login-length to display the minimum length of the login name
  • minimum-password-length to display the minimum length of the password
  • version to display the version of Membership Manager

This list is not complete and has only the most relevant items. You can find all possible values of option in the initial-options.php file of Membership Manager.

Example:

Initial status of the members: [membership-manager members-initial-status]

Result:

Initial status of the members: active

13.1 The default Attribute

You can specify a text that will be displayed instead of the option when this one is empty, using the default attribute, like this:

[membership-manager option default="text"]

Don't forget to include the quotes at the beginning and the end of the default value.

13.2 The filter Attribute

You can specify a PHP function that will be applied to the option before this one is displayed, using the filter attribute, like this:

[membership-manager option filter=function]

Replace function by the name of the function you want to apply.

Sometimes, the option is an English word. You can translate it into the language of your website by entering i18n as the value for the filter attribute.

Example:

Initial status of the members: [membership-manager members-initial-status filter=i18n]

Result:

Initial status of the members: active

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[membership-manager option filter=function1/function2/.../functionN]

The functions will be applied in the specified order.

14. Encryption Of URLs

You can encrypt the URLs. The encryption key and the validity duration of encrypted URLs are configurable through the Options page of Membership Manager. Enter a random string (difficult to guess) into the Encryption key field.

To send to your members an encrypted activation URL, use the following code:

[membership-activation-url filter=encrypt-url]

instead of this one:

[membership-activation-url]

In the Body field of your registration confirmation email, you can insert a code like this:

Click the link below to activate your member account:

[membership-activation-url filter=encrypt-url]

You have 48 hours to do it. Then this link will no longer be valid.

15. Emails

You can insert shortcodes into Sender, Receiver, Subject and Body fields of emails to display informations about the member. These shortcodes are simply the same as those presented in Display Of Informations About The Member and Display Of Informations About A Member Area sections.

When you don't use the id attribute for the [member-area] shortcode, it is automatically set to the ID of the member area to which the member can access, if there is only one.

You can also insert in these fields all shortcodes available on your website.

If you register the member as a client, you can insert shortcodes into these fields in order to display informations (login name and password for example) about the client. These shortcodes are presented in this section.

If you register the member to your affiliate program, you can insert shortcodes into these fields in order to display informations (login name and password for example) about the affiliate. These shortcodes are presented in this section.

If you register the member as a WordPress user, you can insert shortcodes into these fields in order to display informations (login name and password for example) about the user. These shortcodes are presented in this section.

You can also enter several email addresses separated with commas in the Receiver field of emails. And you can insert HTML code into the Body field of emails.

16. Autoresponders

Membership Manager allows you to subscribe your members to an autoresponder list. You must make the settings shown in this section so that works.

For the following autoresponders, you must enter the ID of the list into the List field of the Autoresponders module:

  • AWeber
  • CyberMailing
  • MailChimp
  • SG Autorepondeur

For the other autoresponders, enter the name of the list.

You can find the ID of a MailChimp list in the List name & defaults page.

You can allow the user to choose an autoresponder list by inserting a code like this one into the Code field of your form:

<p><label><strong>List:</strong> [select autoresponder-list]
[option value=list1]List 1[/option]
[option value=list2]List 2[/option]
...
[option value=listN]List N[/option]
[/select]</label></p>

Replace list1, list2, ... listN with the IDs or names of the lists.

You can also allow him to subscribe or not to an autoresponder list, by inserting a code like this one into the Code field of your form:

<p><label>[input subscribed-to-autoresponder value=yes] Subscribe to this list</label></p>

16.1 AWeber

You must make some adjustments so that Membership Manager works with AWeber. You have two methods. If the first doesn't work, try the second.

First method:

Go to this page to get your authorization code and copy it to the API key field in the AWeber module of the Options page. Membership Manager will automatically extract your API key from it when you click a button to update your options.

Second method:

Go to your AWeber account, place your pointer on List Options, click on Email Parsers in the dropdown list that appears and then click on add new at the bottom of the page.

AWeber Email Parser
AWeber Email Parser

Enter what you want into the Description field and insert this code into the Trigger Rule field:

From:[^\n|.]+wordpress\@domain\.extension

by replacing domain with the domain name of your website (without the extension) and extension the extension of your domain name (without the dot).

If your domain name (with the extension) contains more than 35 characters, insert this code into the Trigger Rule field instead of the previous code:

From:[^\n|.]+w\@domain\.extension

Insert this code into the Rule 1 field:

\n[>\s]*Email:\s+(.+?)\n

In the Store In field to the right of the Rule 1 field, select Email.

Insert this code into the Rule 2 field:

\n[>\s]*Name:\s+(.+?)\n

In the Store In field to the right of the Rule 2 field, select Name.

Insert this code into the Rule 3 field:

\n[>\s]*Referrer:\s+(.+?)\n

In the Store In field to the right of the Rule 3 field, select Ad Tracking.

Click on Save to record your parser. Then edit it, check the Enable parser for all lists in this account box and click on Save to enable your parser for all lists of your AWeber account.

16.2 CyberMailing

You have no adjustment to make so that Membership Manager works with CyberMailing.

16.3 GetResponse

You must enter the API key of your GetResponse account in the Autoresponders integration module of the Options page of Membership Manager so that Membership Manager works with GetResponse. You can get your API key by logging into your GetResponse account.

16.4 MailChimp

You must enter the API key of your MailChimp account in the Autoresponders integration module of the Options page of Membership Manager so that Membership Manager works with MailChimp. You can get your API key by logging into your MailChimp account.

16.5 SG Autorepondeur

You must enter the ID of your SG Autorepondeur account and your additional functionalities activation code in the Autoresponders integration module of the Options page of Membership Manager so that Membership Manager works with SG Autorepondeur. You can get these informations by logging into your SG Autorepondeur account.

17. Registration As A Client

You can register your members as clients, if you have installed and activated Commerce Manager. The Autoresponders, Registration to affiliate program, WordPress and Custom instructions modules of Membership Manager supersede the modules of the same name in Commerce Manager.

If the user registers to your member area while logged in as a client, or by specifying an email address identical to that of an existing client, Membership Manager will not create a new client account, but will update the category of the client, if you want to assign the member to a client category.

The client's login name of the member is his member's login name, if there is no client with the same login name. Otherwise, a number will be added to the end.

You can give to the member his login name and his password, by inserting a code like this one in the Body field of your registration confirmation email:

Your login name: [client login]
Your password: [client password default="the same as before"]

The member can always change his login name and password through the profile form of Commerce Manager.

You can insert shortcodes into the Sender, Receiver, Subject and Body fields of registration confirmation/notification emails in order to display informations about the client. These shortcodes are presented in this section.

The connection as a member automatically creates a connection as a client if the member also has a client account and if the email addresses of the two accounts are identical. And under the same conditions, the connection as a client automatically creates a connection as a member.

18. Registration To Affiliate Program

You can register your members to your affiliate program, if you have installed and activated Affiliation Manager. The Autoresponders, Registration as a client, WordPress and Custom instructions modules of Membership Manager supersede the modules of the same name in Affiliation Manager.

If the user registers to your member area while logged in as an affiliate, or by specifying an email address identical to that of an existing affiliate, Membership Manager will not create a new affiliate account, but will update the category of the affiliate, if you want to assign the member to an affiliate category.

The affiliate's login name of the member is his member's login name, if there is no affiliate with the same login name. Otherwise, a number will be added to the end.

You can give to the member his login name and his password, by inserting a code like this one in the Body field of your registration confirmation email:

Your login name: [affiliate login]
Your password: [affiliate password default="the same as before"]

The member can always change his login name and password through the profile form of Affiliation Manager.

You can insert shortcodes into the Sender, Receiver, Subject and Body fields of registration confirmation/notification emails in order to display informations about the affiliate. These shortcodes are presented in this section.

The connection as a member automatically creates a connection as an affiliate if the member also has an affiliate account and if the email addresses of the two accounts are identical. And under the same conditions, the connection as an affiliate automatically creates a connection as a member.

19. WordPress

You can register your members as WordPress users. Upon registration, the user's login name of the member is his member's login name, if there is no WordPress user with the same login name. Otherwise, a number will be added to the end.

If the user registers to your member area while logged in as a WordPress user, or by specifying an email address identical to that of an existing WordPress user, Membership Manager will not create a new WordPress user account.

You can give to the member his login name and his password, by inserting a code like this one in the Body field of your registration confirmation email:

Your login name: [user login]
Your password: [user password]

You can insert shortcodes into the Sender, Receiver, Subject and Body fields of registration confirmation/notification emails in order to display informations about the user. These shortcodes are presented in the Display Of Informations About The User section.

The connection as a WordPress user automatically creates a connection as a member, if the user is not an administrator (or editor), also has a member account and if the email addresses of the two accounts are identical. And under the same conditions, the connection as a member automatically creates a connection as a WordPress user.

20. Display Of Informations About The User

To display an information about a WordPress user, insert into your posts/pages/widgets a code like this:

[user information]

by replacing information with:

  • date to display the registration date
  • date-utc to display the registration date according to UTC time
  • email-address to display the email address
  • first-name to display the first name
  • id to display the ID
  • last-name to display the last name
  • login to display the login name
  • password to display the password (only in emails)
  • website-url to display the website URL

Example:

Your login name: [user login]

20.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty (this is generally the case when the user is not logged in as a WordPress user), using the default attribute, like this:

[user information default="text"]

Don't forget to include the quotes at the beginning and the end of the default value.

20.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[user information filter=function]

Replace function by the name of the function you want to apply.

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[user information filter=function1/function2/.../functionN]

The functions will be applied in the specified order.

21. Custom Instructions

You can add custom instructions that will be executed just after the registration of a member, or other events. This allows you, among other things, to subscribe the member to a list of an autoresponder that is not yet supported by Membership Manager.

Some PHP skills are required. The custom instructions (for the registration of a member) are executed inside the includes/add-member.php file of Membership Manager.

You can find where the custom instructions of other events are executed by opening all files of Membership Manager with a text editor like Notepad++ and searching for the string of characters eval( in these files.

The custom instructions of form submission are executed inside the includes/forms/processing.php file of Membership Manager. You can execute different instructions depending on the form by doing a test on the $id variable set in the forms.php file of Membership Manager.

22. Display Of Forms

Insert into your posts/pages/widgets the code:

  • [membership-login-form] to display the login form
  • [membership-login-compact-form] to display the compact login form
  • [membership-password-reset-form] to display the password reset form
  • [membership-profile-form] to display the profile form
  • [membership-registration-form] to display the registration form (to know the options relating to this form, refer to this section)
  • [membership-registration-compact-form] to display the compact registration form (to know the options relating to this form, refer to this section)

The login form, the password reset form and the registration form appear only if the user is not logged as a member. The profile form appears only if the user is logged as a member.

The member can also login by entering his email address instead of his login name, and reset his password by entering his login name instead of his email address.

To understand how to create your pages relating to membership, refer to this section.

22.1 Redirection

You can redirect the user to a page of your choice when he completed the form, by using the redirection attribute:

[membership-login-form redirection=URL]

Replace URL with the URL to which you want to redirect the user.

The redirection attribute is available for all the forms shortcodes.

You can also redirect the user to a specific part of the page where he submitted the form, like this:

[your-shortcode-of-form redirection=#your-anchor]

To redirect the user to the top of the form, simply enter # as the value for the redirection attribute:

[your-shortcode-of-form redirection=#]

You can also redirect the user to the page he saw just before the current page, if this page belongs to your website, by entering referring-url as the value for the redirection attribute:

[your-shortcode-of-form redirection=referring-url]

If the user just attempted to access a page restricted to members but has been redirected to a login page because he was not logged in, you can redirect him to this private page when he's logged in, by entering private-page as the value for the redirection attribute:

[membership-login-form redirection=private-page]

22.2 Automatic Positioning Of The Cursor

You can decide, for each of your forms, if the cursor is or not automatically positioned in the first field when the page loads. Insert into your posts/pages/widgets a code like this:

[your-shortcode-of-form focus=yes]

22.3 Automatic Completion Of Fields

You can significantly improve your conversion rate by automatically completing form fields with informations from the user when the page loads. Membership Manager allows you to do this when the page link has been sent through an autoresponder, by you or one of your affiliates.

To do this, simply add:

  • ?name-of-the-field=value-of-the-field to the URL of your page if it doesn't contain the ? and # characters
  • &name-of-the-field=value-of-the-field to the URL of your page if it doesn't contain the ? and # characters

Example 1 (automatic completion of the first name):

https://www.kleor.com/member-area/registration/?first-name=John

Example 2 (automatic completion of the email address):

https://www.kleor.com/member-area/registration/?email-address=johnsmith@kleor.com

Example 3 (automatic completion of the first name and the email address):

https://www.kleor.com/member-area/registration/?first-name=John&email-address=johnsmith@kleor.com

Use the dynamic tags provided by your autoresponder to automatically complete the fields.

22.4 The Registration Form

By default, when a user registers as a member through the registration form, the Members areas field of his profile is empty.

You can complete this field by using the id attribute, like this:

[membership-registration-form id=N]

by replacing N with the ID of the member area.

You can specify several IDs for the id attribute, by separating the different IDs by /, like this:

[membership-registration-form id=id1/id2/.../idN]

The member will can then access each of these members areas after his registration.

You can automatically modify the list of members areas to which the member can access when a certain date is reached, using the modification attribute. For more informations about automatic modifications, refer to this section.

Example:

[membership-registration-form modification="+2 (2015-09-23),-1 (1Y)"]

Don't forget to include the quotes at the beginning and the end of the value of the modification attribute.

The first code means that the member will get access to the member area whose the ID is equal to 2 on 23 September 2015. The second code means that access to the member area whose the ID is equal to 1 will be removed one year after his registration.

To understand how to create your pages relating to membership, refer to this section.

22.5 Attributes

All attributes (except action, id and name) of the <form> HTML tag are also available for the shortcodes that display a form, with an identical role.

23. Creation Of Forms

You can customize the forms through the Front Office page of Membership Manager. To customize a form, you must insert into the Code field of this form a special code.

This code is very similar to a normal HTML code, with the exception of the following characteristics:

  • The opening <form> tag and the closing </form> tag are absent.
  • Some HTML tags are replaced with shortcodes. For example, the <input /> tag is replaced with the [input] shortcode.

23.1 The [input] Shortcode

Insert into the Code field a code like this:

[input name]

by replacing name with:

  • address to display a form field allowing the user to enter his address
  • captcha to display a form field allowing the user to enter the CAPTCHA
  • country to display a form field allowing the user to enter his country
  • email-address to display a form field allowing the user to enter his email address
  • first-name to display a form field allowing the user to enter his first name
  • id to display a form field allowing the user to enter his ID
  • last-name to display a form field allowing the user to enter his last name
  • login to display a form field allowing the user to enter his login name
  • password to display a form field allowing the user to enter his password
  • phone-number to display a form field allowing the user to enter his phone number
  • postcode to display a form field allowing the user to enter his postcode
  • remember to display a checkbox allowing the user to login with cookies
  • submit to display a button allowing the user to submit the form
  • town to display a form field allowing the user to enter his town
  • website-name to display a form field allowing the user to enter the name of his website
  • website-url to display a form field allowing the user to enter the URL of his website

Example:

<p><label><strong>Your first name:</strong> [input first-name]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [input email-address]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

The above code displays a form containing a field allowing the user to enter his first name, a field allowing him to enter his email address, and a button allowing him to submit the form.

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[input your-name]

23.2 Attributes Of The [input] Shortcode

All attributes (except id and name) of the <input /> HTML tag are also available for the [input] shortcode, with an identical role.

Example:

<p><label><strong>Your first name:</strong> [input first-name size=20]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [input email-address size=30]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

The above code displays a form containing a field (width of 20 characters) allowing the user to enter his first name, a field (width of 30 characters) allowing him to enter his email address, and a button allowing him to submit the form.

You can use the pattern HTML5 attribute to specify a syntax that the field must respect. In your regular expression, replace the [ and ] characters with their corresponding HTML entities: &#91; and &#93;.

Example:

<p><label><strong>Postcode:</strong> 
[input postcode pattern="&#91;0-9&#93;{5,5}" size=20]<br />
[error postcode]</label></p>
<div>[input submit value="Submit"]</div>

23.3 The [textarea] Shortcode

Insert into the Code field a code like this:

[textarea name]Content[/textarea]

by replacing Content with the content you want display in the text area before the user completes the form and name with:

  • address to display a text area allowing the user to enter his address
  • captcha to display a text area allowing the user to enter the CAPTCHA
  • country to display a text area allowing the user to enter his country
  • email-address to display a text area allowing the user to enter his email address
  • first-name to display a text area allowing the user to enter his first name
  • id to display a text area allowing the user to enter his ID
  • last-name to display a text area allowing the user to enter his last name
  • login to display a text area allowing the user to enter his login name
  • password to display a text area allowing the user to enter his password
  • phone-number to display a text area allowing the user to enter his phone number
  • postcode to display a text area allowing the user to enter his postcode
  • town to display a text area allowing the user to enter his town
  • website-name to display a text area allowing the user to enter the name of his website
  • website-url to display a text area allowing the user to enter the URL of his website

Example:

<p><label><strong>Your first name:</strong> [textarea first-name][/textarea]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [textarea email-address][/textarea]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

The above code displays a form containing a text area allowing the user to enter his first name, a text area allowing him to enter his email address, and a button allowing him to submit the form.

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[textarea your-name]Content[/textarea]

23.4 Attributes Of The [textarea] Shortcode

All attributes (except id and name) of the <textarea> HTML tag are also available for the [textarea] shortcode, with an identical role.

Example:

<p><label><strong>Your first name:</strong> [textarea first-name cols=20 rows=1][/textarea]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [textarea email-address cols=30 rows=1][/textarea]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

The above code displays a form containing a text area (20 columns and 1 row) allowing the user to enter his first name, a text area (30 columns and 1 row) allowing him to enter his email address, and a button allowing him to submit the form.

23.5 The [select] Shortcode

The [select] shortcode has the same role as the <select> HTML tag. Insert into the Code field a code like this:

[select name]Content[/select]

by replacing name with:

  • country to display a dropdown list allowing the user to select his country
  • postcode to display a dropdown list allowing the user to select his postcode
  • town to display a dropdown list allowing the user to select his town

Example:

<p><label><strong>Your country:</strong> [select country]
[option]Canada[/option]
[option]France[/option]
[option]Ireland[/option]
[/select]</label></p>
<div>[input submit value="Submit"]</div>

The above code displays a form containing a dropdown list allowing the user to select his country, and a button allowing him to submit the form.

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[select your-name]Content[/select]

To display easily a dropdown list allowing the user to select a country, insert into the Code field the code below:

[country-selector]

23.6 Attributes Of The [select] Shortcode

All attributes (except id and name) of the <select> HTML tag are also available for the [select] and [country-selector] shortcodes, with an identical role.

23.7 The [option] Shortcode

The [option] shortcode has the same role as the <option> HTML tag. Insert into the Code field a code like this:

[option value="Value of the option"]Name of the option[/option]

If the name and the value of the option are identical, you can also insert into the Code field a code like this:

[option]Name of the option[/option]

Example:

<p><label><strong>Your country:</strong> [select country]
[option]Canada[/option]
[option]France[/option]
[option]Ireland[/option]
[/select]</label></p>
<div>[input submit value="Submit"]</div>

The above code displays a form containing a dropdown list allowing the user to select his country, and a button allowing him to submit the form.

23.8 Attributes Of The [option] Shortcode

All attributes of the <option> HTML tag are also available for the [option] shortcode, with an identical role.

23.9 Required Fields

By default, all form fields are optional. To insert a required field, use a code like this:

[input name required=yes]

by replacing name with one element of this list.

The required attribute is also available for the [textarea], [select] and [country-selector] shortcodes.

23.10 Error Messages

When the user does not complete one of the required fields of the form, or enters an invalid email address, error messages are displayed. You can customize these messages through the Options page of Membership Manager or through the interface of Membership Manager.

Insert into the Code field a code like this:

[error name]

by replacing name with:

  • address to display the error message of address
  • country to display the error message of country
  • email-address to display the error message of email address
  • first-name to display the error message of first name
  • id to display the error message of ID
  • inactive-account to display the error message of inactive account
  • inexistent-account to display the error message of inexistent account
  • invalid-captcha to display the error message of invalid CAPTCHA
  • invalid-fields to display the error message of invalid fields
  • invalid-login-or-password to display the error message of invalid login or password
  • last-name to display the error message of last name
  • login to display the error message of login name
  • numeric-login to display the error message of numeric login name
  • password to display the error message of password
  • phone-number to display the error message of phone number
  • postcode to display the error message of postcode
  • too-long-login to display the error message of too long login name
  • too-long-password to display the error message of too long password
  • too-short-login to display the error message of too short login name
  • too-short-password to display the error message of too short password
  • town to display the error message of town
  • unavailable-email-address to display the error message of unavailable email address
  • unavailable-login to display the error message of unavailable login name
  • unfilled-fields to display the error message of unfilled required fields
  • website-name to display the error message of website name
  • website-url to display the error message of website URL

Example:

<p><label><strong>Your first name:</strong> [input first-name]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [input email-address]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[error your-name]

To display error messages in red, add this code to your CSS stylesheet:

.error { color: #c00000; }

23.11 Attributes Of The [error] Shortcode

All attributes (except id) of the <span> HTML tag are also available for the [error] shortcode, with an identical role.

You can set different error messages for each field of a form, like this:

[error field data-name-message="Your error message"]

by replacing name with:

  • invalid-email-address to enter the message of invalid email address
  • invalid-field to enter the message of invalid field
  • unfilled-field to enter the message of unfilled field

Example:

<p><label><strong>Your first name:</strong> [input first-name required=yes]<br />[error first-name data-unfilled-field-message="The first name is required."]</label></p>
<p><label><strong>Your email address:</strong> [input email-address]<br />[error email-address data-invalid-email-address-message="The email address is invalid."]</label></p>
<div>[input submit value="Submit"]</div>

23.12 The [label] Shortcode

The [label] shortcode has the same role as the <label> shortcode. Insert into the Code field a code like this:

[label name]Content[/label]

by replacing name with:

  • address to link the label to the field of address
  • country to link the label to the field of country
  • email-address to link the label to the field of email address
  • first-name to link the label to the field of first name
  • id to link the label to the field of ID
  • last-name to link the label to the field of last name
  • login to link the label to the field of login name
  • password to link the label to the field of password
  • phone-number to link the label to the field of phone number
  • postcode to link the label to the field of postcode
  • town to link the label to the field of town
  • website-name to link the label to the field of website name
  • website-url to link the label to the field of website URL

Example:

<p>[label first-name]<strong>Your first name:</strong>[/label] [input first-name]<br />[error first-name]</p>
<p>[label email-address]<strong>Your email address:</strong>[/label] [input email-address]<br />[error email-address]</p>
<div>[input submit value="Submit"]</div>

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[label your-name]Content[/label]

23.13 Attributes Of The [label] Shortcode

All attributes (except for) of the <label> HTML tag are also available for the [label] shortcode, with an identical role.

23.14 CAPTCHAs

You can use CAPTCHAs in forms. Insert into the Code field a code like this:

[captcha type=type]

by replacing type with:

  • arithmetic to display a CAPTCHA of the Arithmetic operation type
  • question to display a CAPTCHA of the Question type
  • recaptcha to display a CAPTCHA of the reCAPTCHA type
  • reversed-string to display a CAPTCHA of the Reversed string type

To use a CAPTCHA of the reCAPTCHA type, you must get a public key and a private key here and enter these keys in the CAPTCHA module of the Options page of Membership Manager.

You can then select the theme you want to use, like this:

[captcha type=recaptcha theme=theme]

by replacing theme with:

  • blackglass for the Black Glass theme
  • clean for the Clean theme
  • red for the Red theme
  • white for the White theme

Example 1 (CAPTCHA of the reCAPTCHA type):

[captcha type=recaptcha theme=blackglass]

Example 2 (CAPTCHA of the Arithmetic operation type):

<p>[captcha type=arithmetic] = [input captcha size=3] (enter your answer in digits)</p>

Example 3 (CAPTCHA of the Reversed string type):

<p>Type the following characters in reverse order:<br />
[captcha type=reversed-string] : [input captcha size=20]</p>

Example 4 (CAPTCHA of the Question type):

<p>[captcha type=question question="Question" answer="Correct answer"] [input captcha size=20]</p>

23.15 Attributes Of The [captcha] Shortcode

All attributes of the <span> HTML tag are also available for the [captcha] shortcode, with an identical role, only if you don't use a CAPTCHA of the reCAPTCHA type.

23.16 Double Entry

You can require the double entry of a form field (email address, password, ...), like this:

[input confirm-name]

by replacing name with the name of the field that the user must enter a second time.

Example:

<p><label><strong>Your email address:</strong>*<br />
[input email-address size=40 required=yes]<br />[error email-address]</label></p>

<p><label><strong>Confirm your email address:</strong><br />
[input confirm-email-address size=40]<br />[error confirm-email-address]</label></p>

23.17 Current Password

You can require that the member enters his current password to change his profile or preferences, like this:

[input current-password]

Example:

<p><label><strong>Your current password:</strong>*<br />
[input current-password size=30 required=yes]<br />
[error current-password data-invalid-field-message="The password you entered is incorrect."]</label></p>

23.18 The Submit Button

To display a button allowing the user to submit the form, insert into the Code field a code like this:

[input submit value="Text of the button"]

by replacing Text of the button with the text of your button.

If you want to use an image, insert a code like this:

[input submit type=image src="URL of the image" alt="Alternative text"]

by replacing URL of the image with the image URL of your button and Alternative text with the text displayed when the image can not be displayed.

You can also use the <button> HTML tag, like this:

<button type="submit">Text of the button</button>

23.19 The [validation-content] Shortcode

To display a content restricted to users who have submitted the form without any error, insert into the Code field a code like this:

[validation-content]Content displayed if the user has submitted the form without any error[/validation-content]

You can also define a content that will be displayed if the user has submitted the form and at least one error was generated, like this:

[validation-content]
Content displayed if the user has submitted the form without any error[other]
Content displayed if the user has submitted the form and at least one error was generated
[/validation-content]

Example:

[validation-content]
<p style="color: green;">Your profile has been changed successfully.</p>
[other]<p style="color: red;">[error unavailable-login] [error numeric-login] [error too-short-login] [error too-long-login] [error too-short-password] [error too-long-password] [error unavailable-email-address] [error unfilled-fields] [error invalid-captcha]</p>
[/validation-content]

You can also define a content that will be displayed if the user has not submitted the form, like this:

[validation-content]
Content displayed if the user has submitted the form without any error[other]
Content displayed if the user has submitted the form and at least one error was generated[other]
Content displayed if the user has not submitted the form
[/validation-content]

23.20 The [indicator] Shortcode

You can tell the user if the login name he chooses is available or not when he completes the registration form or the profile form. Insert into the Code field the code below:

[indicator login]

To indicate the availability of his email address, insert the code below:

[indicator email-address]

And to indicate the strength of the password he chose, insert the code below:

[indicator password]

You can customize the messages displayed by the indicators through the interface of Membership Manager.

23.21 Attributes Of The [indicator] Shortcode

All attributes (except id) of the <span> HTML tag are also available for the [indicator] shortcode, with an identical role.

24. Members List

To display a list of your members, insert into your posts/pages/widgets the code below:

[members-list]

You can customize the members list through the Members list module of the Front Office page of Membership Manager. You can enter into the Code field some HTML code and all the shortcodes available on your website.

24.1 The [if] Shortcode

To display a content only if you have at least one member, insert into the Code field a code like this:

[if member]Content displayed only if you have at least one member[/if]

You can also define a content that will be displayed if you don't have any member, like this:

[if member]
Content displayed only if you have at least one member
[else]Content displayed only if you don't have any member[/if]

Example:

[if member]
<p>Number of members: [membership-counter data=members][number][/membership-counter]</p>
[else]<p>No members</p>[/if]

24.2 The [foreach] Shortcode

To repeat a content for each member of the list, insert into the Code field a code like this:

[foreach member]Content repeated for each member of the list[/foreach]

Example:

[foreach member]
<tr>
<td>[member login]</td>
<td>[member first-name]</td>
<td>[member last-name]</td>
<td><a href="[member website-url filter=htmlspecialchars]">[member website-name default="(member website-url filter=htmlspecialchars)"]</a></td>
</tr>[/foreach]

By default, the members are sorted by login name ascending. You can sort them differently by using the orderby and order attributes that work as in the SQL language.

Example:

[foreach member orderby=id order=asc]
<tr>
<td>[member login]</td>
<td>[member first-name]</td>
<td>[member last-name]</td>
<td><a href="[member website-url filter=htmlspecialchars]">[member website-name default="(member website-url filter=htmlspecialchars)"]</a></td>
</tr>[/foreach]

In this example, the members are sorted by ID ascending. You can find all possible values of the orderby attribute in the tables.php file of Membership Manager.

25. Creation Of Your Pages Relating To Membership

This section explains with examples how to create your pages relating to membership (registration page, registration confirmation page, password reset page, login page, profile edit page, etc...). You can create these pages with a single click through the Front Office page of Membership Manager.

To know and understand all the shortcodes used, refer to the Contents Restricted To Members, Pages Restricted To Members, Display Of Informations About The Member, Display Of The Options and Display Of Forms sections.

The creation of pages relating to membership needs custom fields. If you don't see the module of custom fields, click on Screen Options at the top right of the page and check the Custom fields box in order to display it.

25.1 Your Registration Page

To allow users to register as members, create a new page in WordPress. In the edit page of this page, create the membership custom field and enter as the value a code like this:

[membership-redirection condition=session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's logged in as a member (URL of the members home page for example).

In the text area of this page, through the Text tab, enter a code like this:

<p>Registration is fast and free! Only fields marked * are required.</p>

[membership-registration-form]

The [membership-registration-form] shortcode displays the registration form. To know the options relating to this form, refer to this section.

25.2 Your Registration Confirmation Page

When a user registers as a member, he's redirected to a registration confirmation page. You can customize the URL of this page through the Options page of Membership Manager or through the edit page of the member area to which the member can access if there is only one.

25.3 Your Password Reset Page

Your members can forget their password. To allow them to reset it, create a new page in WordPress. In the edit page of this page, create the membership custom field and enter as the value a code like this:

[membership-redirection condition=session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's logged in as a member (URL of the members home page for example).

In the text area of this page, through the Text tab, enter a code like this:

<p>If you have forgotten your password, you can reset it and your new password will be sent by email.</p>

[membership-password-reset-form]

<p style="text-align: center;"><a href="URL of the registration page">Register</a> | <a href="URL of the login page">Login</a></p>

The [membership-password-reset-form] shortcode displays the password reset form.

25.4 Your Login Page

To allow your members to login, create a new page in WordPress. In the edit page of this page, create the membership custom field and enter as the value a code like this:

[membership-redirection condition=session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's logged in as a member (URL of the members home page for example).

In the text area of this page, through the Text tab, enter a code like this:

[membership-login-form]

<p style="text-align: center;"><a href="URL of the registration page">Register</a> | <a href="URL of the password reset page">Lost password</a></p>

The [membership-login-form] shortcode displays the login form.

25.5 Your Logout Page

You can create a logout page with a custom redirection URL. Create a new page in WordPress. In the edit page of this page, create the membership custom field and enter as the value a code like this:

[membership-redirection action=logout url=URL]

by replacing URL with the URL to which you want to redirect the user.

Access to this page will have the effect of logout the member and redirect him to the specified URL.

25.6 Your Members Home Page

When your members login, you can redirect them to a page of your choice. Create a new page in WordPress. In the edit page of this page, create the membership custom field and enter as the value a code like this:

[membership-redirection condition=!session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's not logged in as a member (URL of the login page for example).

In the text area of this page, through the Text tab, enter a code like this:

<p>Welcome to the member area, [member first-name]!</p>

<p>Here are the contents that you can view as a member:</p>

<ul>
[membership-content id=1]<li><a href="URL of a page of the first member area">Name of this page</a></li>[/membership-content]
[membership-content id=2]<li><a href="URL of a page of the second member area">Name of this page</a></li>[/membership-content]
[membership-content id=3]<li><a href="URL of a page of the third member area">Name of this page</a></li>[/membership-content]
...
</ul>

25.7 Your Profile Edit Page

To allow your members to edit their personal informations, create a new page in WordPress. In the edit page of this page, create the membership custom field and enter as the value a code like this:

[membership-redirection condition=!session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's not logged in as a member (URL of the login page for example).

In the text area of this page, through the Text tab, enter a code like this:

<p>You can edit your personal informations. Fields marked * are required.</p>

[membership-profile-form]

The [membership-profile-form] shortcode displays the profile form.

25.8 Your Menu

To facilitate the navigation of your members in the pages that are restricted to them, you can display a navigation menu into these pages. Insert this code:

[membership-pages-menu]

You can customize this navigation menu through the Menu module of the Front Office page of Membership Manager.

26. Custom Fields

You can, through the Back Office page of Membership Manager, add an unlimited number of custom fields in the Add Member Area, Add Member Area Category, Add Member and Add Member Category pages to record additional data. Enter a name and a key for each custom field.

For example, if you want to save the favorite color of the member, enter Favorite color as the name and favorite-color as the key.

To display a custom information about a member, insert into your posts/pages/widgets a code like this (don't forget the custom-field- prefix just before the key):

[member custom-field-key]

by replacing key with the key of the custom field.

To allow the member to fill this field, insert into the Code field of your forms a code like this (don't forget the custom-field- prefix just before the key):

[input custom-field-key]

by replacing key with the key of the custom field.

27. Non-WordPress Static Websites

Membership Manager is designed to work with a WordPress site, but you can also use it with a non-WordPress static website, by following the instructions below.

27.1 Installation Of WordPress

Download WordPress and install it on your website. You will not use WordPress as a CMS to manage the pages of your website, but as an interface allowing you to manage your members areas.

27.2 The Files Of Your Website

If the files of your website have the extension .htm or .html, replace it with .php. Open them with a text editor like Notepadd++, click on File, and then click on Save as.... A window opens. In the Type field, select PHP and click on Save.

You can also recreate these files with this model.

27.3 Loading Of WordPress

To load WordPress functions in the files of your website, add on top of these files the following code:

<?php
$wordpress_directory = 'WordPress directory';
$file = $wordpress_directory.'/wp-load.php';
while (strstr($file, '//')) { $file = str_replace('//', '/', $file); }
if (substr($file, 0, 1) == '/') { $file = substr($file, 1); }
$i = 0; while ((!file_exists($file)) && ($i < 8)) { $file = '../'.$file; $i = $i + 1; }
include_once $file;
?>

Replace WordPress directory with the name of the directory where you installed WordPress. If you installed it at the root of your website, replace this line:

$wordpress_directory = 'WordPress directory';

by this one:

$wordpress_directory = '';

Insert this line of code:

<?php wp_head(); ?>

just before the </head> tag, and this line of code:

<?php wp_footer(); ?>

just before the </body> tag.

27.4 Using Shortcodes

The documentation of Membership Manager provides you several shortcodes. To use these shortcodes in the PHP files of your website, insert a code like this:

<?php echo do_shortcode('[your-shortcode]'); ?>

28. Advanced Customization

28.1 Navigation Menu

You can display a different navigation menu for members with Menu Item Visibility Control. Create your menu through the Menus page of the Appearance menu in WordPress (Appearance => Menus). For each item of your menu, enter membership_session() as the value for the Visibility field if you want that this item appears only if the user is logged in as a member. Or enter !membership_session() as the value if you want that this item appears only if the user is not logged in as a member.

Without Menu Item Visibility Control, you can also do it like this:

Through the Menus page of the Appearance menu in WordPress (Appearance => Menus), create a menu for the members and a menu for the other users.

In your WordPress theme (most often in the header.php file), you should find one or several lines containing a call to the wp_nav_menu function, like this:

wp_nav_menu(array( ... ));

Immediately after array(, add this code:

'menu' => (((function_exists('membership_session')) && (membership_session())) ? M : N),

Replace M with the ID of the menu for the members, and N with the ID of the menu for the other users. The ID of a menu is the number located at the end of the URL of the page allowing to edit it.

You should get a code like this:

wp_nav_menu(array('menu' => (((function_exists('membership_session')) && (membership_session())) ? M : N), ... ));

28.2 Generation And Evaluation Of Passwords

Membership Manager has several functions for generating passwords and evaluating their strength. These functions are defined in the libraries/passwords-functions.php file of the plugin. You can replace them with your own functions by creating a plugin containing all of the following functions:

<?php function kleor_generate_password($length = 0) {
$length = (int) $length; if ($length <= 0) { $length = 12; }
$characters = 'bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ01234567890123456789()[]{}<>-+=*.!?@#$%&';
$minimum_strength = min(64, $length*(3 + log($length, 2)) - ($length == 1 ? 2 : 3));
$n = 0; $best_password = ''; $best_strength = 0;
while (($n < 8) && ($best_strength < $minimum_strength)) {
$password = ''; for ($i = 0; $i < $length; $i++) { $password .= substr($characters, mt_rand(0, 79), 1); }
if ((function_exists('strip_shortcodes')) && ($password != strip_shortcodes($password))) { $password = str_replace('[', '(', $password); }
$n += 1; $strength = kleor_password_strength($password);
if ($strength > $best_strength) { $best_strength = $strength; $best_password = $password; } }
return $best_password; }


function kleor_generate_password_js() { ?>
<script type="text/javascript">
function kleor_generate_password(length) {
var length = parseInt(length); if (length <= 0) { length = 12; }
var characters = 'bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ01234567890123456789()[]{}<>-+=*.!?@#$%&';
if (length == 1) { var minimum_strength = 1; }
else { var minimum_strength = Math.min(64, length*(3 + (Math.log(length))/Math.LN2) - 3); }
var n = 0; var best_password = ''; var best_strength = 0;
while ((n < 8) && (best_strength < minimum_strength)) {
var password = ''; for (i = 0; i < length; i++) { password += characters.substr(Math.floor(80*Math.random()), 1); }
n += 1; strength = kleor_password_strength(password);
if (strength > best_strength) { best_strength = strength; best_password = password; } }
return best_password; }
</script>
<?php }


function kleor_password_strength($password) {
$password = kleor_strip_accents($password);
$length = strlen($password); $strength = 0;
if ($length > 0) {
if ((strtolower($password) != $password) && (strtoupper($password) != $password)) { $strength += 1; }
foreach (array('/[0-9]/', '/[^a-zA-Z0-9 ]/') as $pattern) {
if (preg_replace($pattern, '', $password) != $password) { $strength += 1; } }
$characters = array(); for ($i = 0; $i < $length; $i++) { $characters[] = substr($password, $i, 1); }
$strength = $length*($strength + log(count(array_unique($characters)), 2)); }
return $strength; }


function kleor_password_strength_js() { ?>
<script type="text/javascript">
function kleor_password_strength(password) {
var password = kleor_strip_accents(password);
var length = password.length; var strength = 0;
if (length > 0) {
if ((password.toLowerCase() != password) && (password.toUpperCase() != password)) { strength += 1; }
if (password.replace(/[0-9]/g, '') != password) { strength += 1; }
if (password.replace(/[^a-zA-Z0-9 ]/g, '') != password) { strength += 1; }
var characters = []; for (i = 0; i < length; i++) {
var character = password.substr(i, 1);
if (password.substr(0, i).indexOf(character) == -1) { characters.push(character); } }
strength = length*(strength + (Math.log(characters.length))/Math.LN2); }
return strength; }
</script>
<?php }

Of course, you can change the source code of these functions, but don't change their names.

28.3 Custom Autoresponders

You can add an autoresponder that is not natively integrated with Membership Manager. To do this, create a plugin with a code like this (simple version):

function add_my_autoresponder($autoresponders) {
$autoresponders['My Autoresponder'] = array('function' => 'subscribe_to_my_autoresponder');
return $autoresponders; }

add_filter('membership_autoresponders', 'add_my_autoresponder');


function subscribe_to_my_autoresponder($list, $contact) {
...
...
}

or like this one (more elaborate version):

function add_my_autoresponder($autoresponders) {
$autoresponders['My Autoresponder'] = array(
'function' => 'subscribe_to_my_autoresponder',
'display_function' => 'display_my_autoresponder',
'update_function' => 'update_my_autoresponder');
return $autoresponders; }

add_filter('membership_autoresponders', 'add_my_autoresponder');


function subscribe_to_my_autoresponder($list, $contact) {
...
...
}


function display_my_autoresponder($options, $back_office_options) { ?>
<table class="form-table"><tbody>
<tr style="vertical-align: top;"><th scope="row" style="width: 20%;"><strong><label for="my_autoresponder_api_key"><?php _e('API key', 'membership-manager'); ?></label></strong></th>
<td><textarea style="padding: 0 0.25em; height: 1.75em; width: 50%;" name="my_autoresponder_api_key" id="my_autoresponder_api_key" rows="1" cols="50"><?php echo (isset($options['my_autoresponder_api_key']) ? $options['my_autoresponder_api_key'] : ''); ?></textarea> 
<span class="description" style="vertical-align: 25%;"><a target="<?php echo $back_office_options['documentations_links_target']; ?>" href="https://www.kleor.com/membership-manager/documentation/#my-autoresponder"><?php _e('More informations', 'membership-manager'); ?></a></span></td></tr>
<tr style="vertical-align: top;"><th scope="row" style="width: 20%;"></th>
<td><input type="submit" class="button-secondary" name="submit" value="<?php _e('Update', 'membership-manager'); ?>" /></td></tr>
</tbody></table>
<?php }


function update_my_autoresponder($options) {
if (isset($_POST['my_autoresponder_api_key'])) {
$_POST['my_autoresponder_api_key'] = trim($_POST['my_autoresponder_api_key']);
$options['my_autoresponder_api_key'] = $_POST['my_autoresponder_api_key']; }
return $options; }

The subscribe_to_my_autoresponder function subscribes the user in a list of the autoresponder. The display_my_autoresponder function displays the options of the autoresponder in the Autoresponders integration module of the Options page of Membership Manager. And the update_my_autoresponder function updates these options when submitting the form of this page.

To better understand how to do this, look at the source code of this plugin.

28.4 Custom Files

You can replace all Membership Manager files (except membership-manager.php) with your own files. For this, create the membership-manager-custom-files folder in the plugins directory (the one where you installed Membership Manager) of your website.

For example, if you want to replace the includes/data.php file of Membership Manager with a file you have customized, create the includes folder in the membership-manager-custom-files folder, and upload your data.php file to this folder.

You can set yourself the directory where your custom files are stored, by inserting this line:

define('MEMBERSHIP_MANAGER_CUSTOM_FILES_PATH', ABSPATH.'custom-files/membership-manager/');

just after:

if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');

in your wp-config.php file.

Replace custom-files/membership-manager with what you want. The value of MEMBERSHIP_MANAGER_CUSTOM_FILES_PATH must end with a /.

28.5 Custom Languages

Membership Manager is developed in English and contains files that translate it in French. If you wish, you can translate it into another language.

To do this, create your custom files directory by following these guidelines. Create the languages folder inside of it, and upload your translation files to this folder.

You can create your translation files with the languages/membership-manager.pot file of the plugin, and by using the free software Poedit. Your MO and PO translation files must be named like this:

membership-manager-ll_CC.mo
membership-manager-ll_CC.po

ll_CC is the value displayed by this line of code:

echo get_locale();

when it's executed in one of the files of your WordPress website.

29. FAQ

29.1 Can I use shortcodes in fields of admin pages?

Yes. You can insert all the shortcodes available on your website in most fields of Membership Manager admin pages.

29.2 How can I use shortcodes in my WordPress theme?

Insert into the PHP files of your theme a code like this:

<?php echo do_shortcode('[your-shortcode]'); ?>

29.3 How can I use shortcodes in comments?

Edit the functions.php file (create it if it doesn't exist) of your WordPress theme and add this line of code:

add_filter('comment_text', 'do_shortcode');

29.4 How can I use shortcodes in attributes of shortcodes?

You can use shortcodes in most attributes of Membership Manager shortcodes, provided to replace [ by ( and ] by ), like this:

[your-shortcode attribute='(your-other-shortcode)']

Don't forget to include the quotes at the beginning and the end of the shortcode.

29.5 How can I nest several identical shortcodes?

When you nest several identical shortcodes, you must add an integer between 1 and 3 at the end of the tags of these shortcodes, like this:

[membership-content...]...
[membership-content1...]...
[membership-content2...]...
[membership-content3...]...
[/membership-content3]...
[/membership-content2]...
[/membership-content1]...
[/membership-content]

30. Changelog

  • Version 6.8.3
    • New API of SG Autorépondeur
  • Version 6.8.2
    • Improvement of the registration as a user
  • Version 6.8.1
    • Addition of an email address's availability indicator
  • Version 6.8
    • Improvement of the Activation/Upgrade module
  • Version 6.7.6
    • New API of SG Autorépondeur
  • Version 6.7.5
    • Addition of some options
  • Version 6.7
    • Addition of the ability to use custom languages
  • Version 6.6
    • Addition of the ability to use custom files
  • Version 6.5.2
    • Improvement of some shortcodes
  • Version 6.5
    • Addition of the ability to add a custom autoresponder
    • Improvement of the membership_mail function
  • Version 6.3.5
    • Optimization of the CSS styles of the admin pages for WordPress 4.4
  • Version 6.3
    • Adaptation to WordPress 4.3
  • Version 6.2.2
    • Improvement of AWeber support
  • Version 6.2
    • Improvement of the security of custom instructions
    • Improvement of the ergonomics of admin pages
  • Version 6.1.2
    • Addition of a password strength indicator
    • Improvement of the password generator
  • Version 6.1.1
    • Improvement of the ergonomics of admin pages
  • Version 6.1
    • Improvement of the Capabilities module of the Back Office page
  • Version 6.0.7
    • Addition of the [membership-pages-menu] shortcode
  • Version 6.0.3
    • Addition of the country_code field in the table of members
  • Version 6.0
    • Addition of the ability to automatically upgrade the plugin
    • Improvement of the ergonomics of admin pages
  • Version 5.9.8
    • Addition of the ability to automatically login the member just after his registration or activation, and to automatically logout him after a period of inactivity
  • Version 5.9.7
    • Addition of the ability to execute custom instructions just after the submission of a form
  • Version 5.9.4
    • Fixation of a bug with PHP 5.5
  • Version 5.9.2
    • Improvement of the ergonomics of admin pages
    • Optimization of the CSS styles of the admin pages for WordPress 3.9.1
  • Version 5.9.1
    • Improvement of the stability of the plugin
  • Version 5.9
    • Improvement of the ergonomics of admin pages
  • Version 5.8.9
    • Addition of the [members-list] shortcode
  • Version 5.8.6
    • Improvement of the cron
  • Version 5.8.5
    • Addition of the ability to require the double entry of some form fields (email address, password, ...)
  • Version 5.8.4
    • Addition of the support of the pattern HTML5 attribute
  • Version 5.8.3
    • Addition of the ability to set different error messages for each field of a form
  • Version 5.8.2
    • Improvement of the stability of the plugin when its folder is renamed
  • Version 5.8.1
    • Addition of the ability to be notified of new versions of the plugin through the WordPress interface
  • Version 5.8
    • Optimization of the CSS styles of the admin pages for WordPress 3.8
    • Improvement of the uninstallation of the plugin
    • Addition of the category attribute to the [membership-content], [membership-redirection] and [membership-comments] shortcodes