Legacy Documentation
You are using the documentation for version 3.5.17. Go here for the latest version or check here for your available upgrades to the latest version.
Member Management¶
Introduction¶
Many member management features are built-in to ExpressionEngine, so unlike other modules, the Member Management module is not managed from the Modules area of the Control Panel.
Note
The Member Module is available only with a purchased ExpressionEngine license.
You’ll find many member management options available at:
The Members section, which hosts a comprehensive suite of member management utilities including the Membership Preferences page.
The My Account Page, accessible from the Control Panel’s sidebar. It can also display information for any member if you choose a particular member from
.The public side of your website also has a Member Profile area, enabling your site members to manage their personal profile information without having access to your Control Panel. Typically, this Member Profile area is found at:
http://example.com/index.php/member/profile/
Note
A member account’s Username and Screen Name can be identical, but must be unique system-wide.
Member Profile Templates¶
The public profile area has its own set of templates which can be edited to change the look. You’ll find the templates located at:
themes/ee/member/default/
These templates can be edited with a text editor, or you may choose to edit them via your Control Panel at
A good strategy is to make a copy of the entire default templates folder, then edit your copy so you can leave the default files intact. Save your new copy to:
themes/user/member/custom_theme_name/
Set your new copy as the site default under
Note
When building your member profile templates, consider that any external links will pass along referrer data. This can cause security problems if someone clicks on an external link from a secure page. For example, if a user clicks an external link from the password reset page, the external site could use the password reset link from the referrer data to gain access to a user’s account.
You can strip everything but the base URL by linking to
{path=""}?URL=<your url>
.
Login Form Tag¶
The Login Form Tag allows you to place a login form in any template you choose, so that site members can log in.
Note
The Member Profile Templates described above also contain a login form, which appears when someone who is not logged in tries to access a member-only area.
Here is how you might use the tag:
{exp:member:login_form return="site/index"}
<p>
<label>Username</label><br>
<input type="text" name="username" value="" maxlength="32" size="25">
</p>
<p>
<label>Password</label><br>
<input type="password" name="password" value="" maxlength="32" size="25">
</p>
{if auto_login}
<p><input type="checkbox" name="auto_login" value="1"> Auto-login on future visits</p>
{/if}
<p><input type="checkbox" name="anon" value="1" checked="checked"> Show my name in the online users list</p>
<p><input type="submit" name="submit" value="Submit"></p>
<p><a href="{path='member/forgot_password'}">Forgot your password?</a></p>
{/exp:member:login_form}
Parameters¶
action=¶
action="https://example.com/"
Allows you to specify the action attribute of the <form> tag. Handy if you need to ensure that authentication points to SSL portions of your site from non-SSL portions. Often used in conjunction with the return= parameter and the {current_url} global variable so your visitors will go back to the page and domain they logged in from.
form_class=¶
form_class="login"
This parameter allows you to specify the class attribute for the <form> tag.
form_name=¶
form_name="login"
This parameter allows you to specify a name attribute for the <form> tag.
return=¶
return="site/index"
This parameter allows you to define where the user will be returned after successfully logging in. The parameter can be defined in two ways:
- Use the standard Template_Group/Template syntax to specify where to return the user. For instance, if you want the user to be returned to the “local” Template in the “news” Template Group, you would use: return=”news/local”
- Use a full URL. For example: return=”http://example.com/return.html”
Variables¶
{if auto_login}¶
{if auto_login} {/if}
It is recommended that you use this variable as indicated in the example code at the top. This conditional will display the contents inside (typically the “stay logged in” checkbox) based on how your session preference is set. In order for this feature to work you must be set to use “cookies only” and not sessions.:
{if auto_login}
<p><input class="checkbox" type="checkbox" name="auto_login" value="1"> Auto-login on future visits</p>
{/if}
Creating Member Links¶
You can create links that point to various member-related pages, enable visitors to sign-up for an account, log-in, log-out, edit their profile, etc.
Log In¶
This link points to the personal profile login page. To create the link, use this variable:
{path='member/login'}
Place the variable inside of a link tag:
<a href="{path='member/login'}">Log In</a>
Log Out¶
This link allows users to log-out of the system. To create the link, use this variable:
{path='logout'}
Place the variable inside of a link tag:
<a href="{path='logout'}">Log Out</a>
Registration Page¶
This link points to the member registration page. To create the link, use this variable:
{path='member/register'}
Place the variable inside of a link tag:
<a href="{path='member/register'}">Register as a new member</a>
View Memberlist¶
This link points to the page showing a list of all registered members. To create the link, use this variable:
{path='member/memberlist'}
Place the variable inside of a link tag:
<a href="{path='member/memberlist'}">View the Memberlist</a>
Member Profile Page¶
This link points to the personal profile page of the logged-in user, allowing them to edit any of their settings. To create the link, use this variable:
{path='member/profile'}
Place the variable inside of a link tag:
<a href="{path='member/profile'}">Edit your profile</a>
When the link is rendered it will appear similar to: http://example.com/index.php/member/profile/
Forgotten Password?¶
This link points to the page where users can retrieve their password:
{path='member/forgot_password'}
Place the variable inside of a link tag:
<a href="{path='member/forgot_password'}">Forget your password?</a>
Custom Profile Data Tag¶
The Custom Profile Data Tag allows you to display member profile information in your Templates. The data can either be shown from the currently logged-in user or from a specified user using the member_id=”” parameter.
Note
Remember that the profile information for the current visitor, such as {screen_name}, {location}, {email}, etc. are always available in any template as Global Variables. Therefore, only use this tag if you need to show custom profile data (that is, Member Fields that you have created yourself) or information for a specific user.
Here is a basic example:
{exp:member:custom_profile_data}
<p>{age}, {gender}</p>
{/exp:member:custom_profile_data}
Important
If you omit the member_id= parameter as in the above example, do not enable Template Caching on any Template containing this tag. Otherwise the data will not be dynamic and whoever happens to load the page when it is cached will have their information shown for everyone until the cache expires. Unlike this tag, Global Variables can be used in templates that are cached.
Parameters¶
member_id=¶
member_id="147"
Specifies a particular member’s information to display. By default (if you do not include the member_id parameter), the tag will simply display information pertaining to the currently logged-in user.
Variables¶
- avatar_height
- avatar_width
- avatar_url
- bio
- birthday
- group_id
- join_date
- language
- location
- last_activity
- last_comment_date
- last_entry_date
- last_forum_post_date
- last_visit
- local_time
- member_group
- member_id
- photo_height
- photo_width
- photo_url
- screen_name
- search_path
- send_private_message
- signature
- timezone
- total_comments
- total_entries
- total_forum_posts
- total_forum_topics
- url
- username
- Other Member Fields
avatar_height¶
{avatar_height}
The height of the avatar image associated with the user. Typically used as such:
{if avatar}
<img src="{avatar_url}" width="{avatar_width}" height="{avatar_height}" alt="{screen_name}'s avatar">
{/if}
avatar_width¶
{avatar_width}
The width of the avatar image associated with the user. Typically used as such:
{if avatar}
<img src="{avatar_url}" width="{avatar_width}" height="{avatar_height}" alt="{screen_name}'s avatar">
{/if}
avatar_url¶
{avatar_url}
The URL to the avatar image associated with the user. Typically used as such:
{if avatar}
<img src="{avatar_url}" width="{avatar_width}" height="{avatar_height}" alt="{screen_name}'s avatar">
{/if}
last_forum_post_date¶
{last_forum_post_date format="%Y %m %d"}
The date of the user’s last forum post.
last_visit¶
{last_visit format="%Y %m %d"}
The date when the user was last active on the site PRIOR to their current session.
photo_height¶
{photo_height}
The height of the photo image associated with the user. Typically used as such:
{if photo}
<img src="{photo_url}" width="{photo_width}" height="{photo_height}" alt="{screen_name}'s photo">
{/if}
photo_width¶
{photo_width}
The width of the photo image associated with the user. Typically used as such:
{if photo}
<img src="{photo_url}" width="{photo_width}" height="{photo_height}" alt="{screen_name}'s photo">
{/if}
photo_url¶
{photo_url}
The URL to the photo image associated with the user. Typically used as such:
{if photo}
<img src="{photo_url}" width="{photo_width}" height="{photo_height}" alt="{screen_name}'s photo">
{/if}
search_path¶
{search_path}
The search path to show entries and posts by this user:
<a href="{search_path}">View Entries by User</a>
send_private_message¶
{send_private_message}
The URL to send a Private Message to this user:
<a href="{send_private_message}">Send Private Message to {screen_name}.</a>
Other Member Fields¶
All other member fields that you created can be accessed using the Short Name of the field:
{age}
{gender}
{zodiac}
etc..
Ignore List Tag¶
The Ignore List Tag allows you to display member profile information for members in a member’s Ignore List. Fields can either be shown from the ignore list of currently logged-in user or from a specified user.
Important
Avoid using Template Caching on any Template containing this tag. If you do not avoid caching, then data will not be dynamic for each user. Instead, whoever happens to load the page when it is cached will have their information shown for everyone until the cache expires. Unlike this tag, Global Variables can be used in templates that are cached.
Here is the basic tag syntax:
{exp:member:ignore_list}
<p>{ignore_screen_name}</p>
{/exp:member:ignore_list}
Parameters¶
member_id=¶
member_id="147"
You can specify a particular member’s information to display. By default (if you do not include the member_id parameter), the tag will simply display information pertaining to the currently logged-in user.
Variables¶
The following member variables are available. The unique prefix “ignore_” ensures that the Ignore List variables do not conflict with Global Variables or member variables from other tags.
- {ignore_member_id}
- {ignore_group_id}
- {ignore_group_description}
- {ignore_username}
- {ignore_screen_name}
- {ignore_email}
- {ignore_ip_address}
- {ignore_location}
- {ignore_total_entries}
- {ignore_total_comments}
- {ignore_private_messages}
- {ignore_total_forum_topics}
- {ignore_total_forum_replies}
- {ignore_total_forum_posts}