User model represents a user in the ForkBB forum system. It extends DataModel and provides properties and methods for managing user data, permissions, and profile information.
Location
app/Models/User/User.php
Properties
Unique user identifier
User’s group ID. Determines user role and permissions
User’s display name
User’s email address
Custom user title
User’s signature displayed below posts
Timestamp of last visit
Avatar file path or URL
User’s preferred language code
User’s preferred theme/style
Number of topics to display per page (minimum 10)
Number of posts to display per page (minimum 10)
Status Properties
Returns
true if user is a guest (not authenticated)Returns
true if user account is unverifiedReturns
true if user is an administratorReturns
true if user is an administrator or moderatorReturns
true if user is banned by usernameReturns
true if user is currently onlineReturns
true if user has a signature configuredReturns
true if user can use private messagesMethods
isModerator()
Checks if user is a moderator for a specific model.The model (typically a Forum) to check moderator status for
bool - true if user moderates the given forum
Example:
deleteAvatar()
Deletes the user’s avatar file.title()
Returns the user’s display title based on status and custom settings.linkPromote()
Generates a link to promote a user based on a post they made.The post to evaluate for user promotion
string|null - Promotion URL or null if not available
Example:
fLog()
Returns formatted user information for logging purposes.Computed Properties
URL to user’s profile page. Returns
null for guests.Full URL to user’s avatar image. Returns
null if no avatar.Timestamp of current or last visit
HTML-formatted signature (parsed and censored)
Normalized email address
Normalized username
Link or mailto URL for contacting the user via email
Usage Example
Constants
The User model uses the following constants for group IDs:FORK_GROUP_GUEST- Guest user groupFORK_GROUP_UNVERIFIED- Unverified user groupFORK_GROUP_ADMIN- Administrator group