function invite_generate_code in Invite 6.2
Same name and namespace in other branches
- 5.2 invite.module \invite_generate_code()
- 7.4 includes/invite.controller.inc \invite_generate_code()
- 7.2 invite.module \invite_generate_code()
Generates a unique tracking code.
Return value
An 8-digit unique tracking code.
1 call to invite_generate_code()
- invite_form_submit in ./
invite.module - Forms API callback; process submitted form data.
File
- ./
invite.module, line 1194 - Allows your users to send and track invitations to join your site.
Code
function invite_generate_code() {
do {
$reg_code = user_password(8);
$result = db_query("SELECT COUNT(*) FROM {invite} WHERE reg_code = '%s'", $reg_code);
} while (db_result($result));
return $reg_code;
}