get_users
Retrieves users from the database with optional filtering by client and search terms.Signature
Parameters
Filter users by associated client name. If provided, only returns users who have played games associated with this client.
Search term to filter users by display name or email address. Uses SQL LIKE with wildcards.
Maximum number of results to return. Hard capped at 500 to prevent performance issues.
Number of results to skip for pagination.
Returns
Array of user objects with the following properties:
Example Usage
Implementation Details
This function implements a hard limit of 500 results per query to prevent performance degradation. The limit parameter is clamped between 1 and 500 using
min(max(1, $limit), 500).When
$client_filter is provided, the function performs additional JOINs across de_app_sessions, de_posts, and de_postmeta tables to filter users by client association. This may impact query performance for large datasets.Error Handling
The function uses try/catch blocks for database errors. On failure, it logs the error and returns an empty array:get_user_meta
Retrieves a specific metadata value for a user.Signature
Parameters
User ID
Meta key to retrieve (e.g., ‘area’, ‘_user_cliente_id’)
Returns
The meta value, or
false if not foundExample Usage
get_user_client_name
Retrieves the client name associated with a user based on their metadata.Signature
Parameters
User ID
Returns
Client name, or
null if no client is associatedExample Usage
get_user_client_logo
Retrieves the logo URL for the client associated with a user.Signature
Parameters
User ID
Returns
Full URL to the client’s logo image, or
null if no logo existsExample Usage
Related Functions
Sessions
Retrieve user session data
Games
Get games played by users