Function __global->cns_make_member
Definitions
sources/cns_members_action.php
- Add a member.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $allow_emails | BINARY | No | No | 1 | N/A | N/A | Whether the member allows e-mails via the site |
| $allow_emails_from_staff | BINARY | No | No | 1 | N/A | N/A | Whether the member allows e-mails from staff via the site |
| $highlighted_name | BINARY | No | No | 0 | N/A | N/A | Whether the member username will be highlighted |
| $pt_allow | SHORT_TEXT | No | No | * | N/A | N/A | Usergroups that may PT the member |
| $pt_rules_text | LONG_TEXT | No | No | Blank (empty string) | N/A | N/A | Rules that other members must agree to before they may start a PT with the member |
| $validated | BINARY | No | No | 1 | N/A | N/A | Whether the account has been validated |
| $validated_email_confirm_code | SHORT_TEXT | No | No | Blank (empty string) | N/A | N/A | The code required before the account becomes active (blank: already entered) |
| $probation_expiration_time | ?TIME | No | No | Null | N/A | N/A | When the member is on probation until (null: not on probation) |
| $is_perm_banned | ID_TEXT | No | No | 0 | N/A | N/A | Whether the member is permanently banned |
| $check_correctness | boolean | No | No | True | N/A | N/A | Whether to check details for correctness |
| $ip_address | ?IP | No | No | Null | N/A | N/A | The member's IP address (blank: unknown) (null: IP address of current user) |
| $password_compat_scheme | ?ID_TEXT | No | No | Null | N/A | N/A | The compatibility scheme that the password operates in (blank: plain) (null: none [meaning normal bcrypt salted style] or plain, depending on whether passwords are encrypted) |
| $salt | SHORT_TEXT | No | No | Blank (empty string) | N/A | N/A | The password salt (blank: password compatibility scheme does not use a salt / auto-generate) |
| $join_time | ?TIME | No | No | Null | N/A | N/A | When the member joined (null: now) |
| $last_visit_time | ?TIME | No | No | Null | N/A | N/A | When the member last visited (null: now) |
| $last_submit_time | ?TIME | No | No | Null | N/A | N/A | The time the member last made a submission (null: set to now) |
| $profile_views | BINARY | No | No | 0 | N/A | N/A | Total number of views to the profile |
| $total_sessions | BINARY | No | No | 0 | N/A | N/A | Total number of sessions (basically, visits) |
| $id | ?AUTO_LINK | No | No | Null | N/A | N/A | Force an ID (null: don't force an ID) |
Returns
- The ID of the new member
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Add a member.
*
* @param BINARY $allow_emails Whether the member allows e-mails via the site
* @param BINARY $allow_emails_from_staff Whether the member allows e-mails from staff via the site
* @param BINARY $highlighted_name Whether the member username will be highlighted
* @param SHORT_TEXT $pt_allow Usergroups that may PT the member
* @param LONG_TEXT $pt_rules_text Rules that other members must agree to before they may start a PT with the member
* @param BINARY $validated Whether the account has been validated
* @param SHORT_TEXT $validated_email_confirm_code The code required before the account becomes active (blank: already entered)
* @param ?TIME $probation_expiration_time When the member is on probation until (null: not on probation)
* @param ID_TEXT $is_perm_banned Whether the member is permanently banned
* @param boolean $check_correctness Whether to check details for correctness
* @param ?IP $ip_address The member's IP address (blank: unknown) (null: IP address of current user)
* @param ?ID_TEXT $password_compat_scheme The compatibility scheme that the password operates in (blank: plain) (null: none [meaning normal bcrypt salted style] or plain, depending on whether passwords are encrypted)
* @param SHORT_TEXT $salt The password salt (blank: password compatibility scheme does not use a salt / auto-generate)
* @param ?TIME $join_time When the member joined (null: now)
* @param ?TIME $last_visit_time When the member last visited (null: now)
* @param ?TIME $last_submit_time The time the member last made a submission (null: set to now)
* @param BINARY $profile_views Total number of views to the profile
* @param BINARY $total_sessions Total number of sessions (basically, visits)
* @param ?AUTO_LINK $id Force an ID (null: don't force an ID)
* @return AUTO_LINK The ID of the new member
*/
function cns_make_member(int $allow_emails = 1, int $allow_emails_from_staff = 1, int $highlighted_name = 0, string $pt_allow = '*', string $pt_rules_text = '', int $validated = 1, string $validated_email_confirm_code = '', ?int $probation_expiration_time = null, string $is_perm_banned = '0', bool $check_correctness = true, ?string $ip_address = null, ?string $password_compat_scheme = null, string $salt = '', ?int $join_time = null, ?int $last_visit_time = null, ?int $last_submit_time = null, int $profile_views = 0, int $total_sessions = 0, ?int $id = null) : int
* Add a member.
*
* @param BINARY $allow_emails Whether the member allows e-mails via the site
* @param BINARY $allow_emails_from_staff Whether the member allows e-mails from staff via the site
* @param BINARY $highlighted_name Whether the member username will be highlighted
* @param SHORT_TEXT $pt_allow Usergroups that may PT the member
* @param LONG_TEXT $pt_rules_text Rules that other members must agree to before they may start a PT with the member
* @param BINARY $validated Whether the account has been validated
* @param SHORT_TEXT $validated_email_confirm_code The code required before the account becomes active (blank: already entered)
* @param ?TIME $probation_expiration_time When the member is on probation until (null: not on probation)
* @param ID_TEXT $is_perm_banned Whether the member is permanently banned
* @param boolean $check_correctness Whether to check details for correctness
* @param ?IP $ip_address The member's IP address (blank: unknown) (null: IP address of current user)
* @param ?ID_TEXT $password_compat_scheme The compatibility scheme that the password operates in (blank: plain) (null: none [meaning normal bcrypt salted style] or plain, depending on whether passwords are encrypted)
* @param SHORT_TEXT $salt The password salt (blank: password compatibility scheme does not use a salt / auto-generate)
* @param ?TIME $join_time When the member joined (null: now)
* @param ?TIME $last_visit_time When the member last visited (null: now)
* @param ?TIME $last_submit_time The time the member last made a submission (null: set to now)
* @param BINARY $profile_views Total number of views to the profile
* @param BINARY $total_sessions Total number of sessions (basically, visits)
* @param ?AUTO_LINK $id Force an ID (null: don't force an ID)
* @return AUTO_LINK The ID of the new member
*/
function cns_make_member(int $allow_emails = 1, int $allow_emails_from_staff = 1, int $highlighted_name = 0, string $pt_allow = '*', string $pt_rules_text = '', int $validated = 1, string $validated_email_confirm_code = '', ?int $probation_expiration_time = null, string $is_perm_banned = '0', bool $check_correctness = true, ?string $ip_address = null, ?string $password_compat_scheme = null, string $salt = '', ?int $join_time = null, ?int $last_visit_time = null, ?int $last_submit_time = null, int $profile_views = 0, int $total_sessions = 0, ?int $id = null) : int
