You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* Get a user status by the numeric code of status.
*
* @param int $userstatus Status code 0 - 8.
* @param int $join_timestamp
*
* @return string|null The name of the given user status, null if it does not exist.
*/
function getuserstatus(int $userstatus, int $join_timestamp = 0)
: ?string {
$locale = fusion_get_locale();
if ( $join_timestamp ) {
return ( $userstatus >= 0 and $userstatus <= 8 ) ? $locale[ 'status' . $userstatus ] : NULL;
}
return $locale['status_pending'];
}
* Get a user status by the numeric code of status.
*
* @param int $userstatus Status code 0 - 8.
* @param int $join_lastvisit
*
* @return string|null The name of the given user status, null if it does not exist.
*/
function getuserstatus(int $userstatus, int $join_lastvisit = 0)
: ?string {
$locale = fusion_get_locale();
if ( $join_lastvisit ) {
return ( $userstatus >= 0 and $userstatus <= 8 ) ? $locale[ 'status' . $userstatus ] : NULL;
}
return $locale['status_pending'];
}
user_joined always has a value, I would use user_lastvisit instead, it has no value until the user has logged in
Describe the bug
Add new user into database with email verification on. (Where user need to click on activation link)
$data = fusion_get_user(2);
echo getuserstatus($data['user_status']); // will generate return as 'active'
Version
All
Expected behavior
$data = fusion_get_user(2);
echo ($data['user_joined'] ? getuserstatus($data['user_status']); : 'Pending Activation')
** Improvisation to getuserstatus **
function getuserstatus($status, $user_joined)
The text was updated successfully, but these errors were encountered: