hUsers.php

The hUsers.php helper provides a collection of functions for managing and retrieving user information in Osclass. These functions allow you to access specific user fields, determine login status (both for web and admin users), generate profile URLs, and work with user alerts and other utility operations.

Functions Description

osc_user_field($field, $locale = '') – Gets a specific field from the current user.

osc_user() – Retrieves the user array from the view.

osc_is_web_user_logged_in() – Returns true if a web user is logged in.

osc_logged_user_id() – Returns the logged user ID.

osc_logged_user_email() – Returns the logged user email.

osc_logged_user_name() – Returns the logged user name.

osc_logged_user_phone() – Returns the logged user phone.

osc_logged_user() – Retrieves the complete logged user record (available from Osclass 8.0.3).

osc_user_public_profile_url($id = null) – Returns the public profile URL for the specified user (or the current user if no ID is provided).

osc_is_admin_user_logged_in() – Returns true if an admin user is logged in.

osc_logged_admin_id() – Returns the logged admin user ID.

osc_logged_admin_username() – Returns the logged admin username.

osc_logged_admin_name() – Returns the logged admin name.

osc_logged_admin_email() – Returns the logged admin email.

osc_user_name() – Returns the name of the current user.

osc_user_email() – Returns the email of the current user.

osc_user_regdate() – Returns the registration date of the current user.

osc_user_id() – Returns the ID of the current user.

osc_user_website() – Returns the website URL of the current user.

osc_user_info($locale = '') – Returns the description or additional information of the current user.

osc_user_phone_land() – Returns the landline phone number of the current user.

osc_user_phone_mobile() – Returns the mobile phone number of the current user.

osc_user_phone() – Returns the landline phone if available; otherwise, returns the mobile phone; if neither exists, returns an empty string.

osc_user_country() – Returns the country of the current user.

osc_user_region() – Returns the region of the current user.

osc_user_city() – Returns the city of the current user.

osc_user_city_area() – Returns the city area of the current user.

osc_user_address() – Returns the address of the current user.

osc_user_zip() – Returns the postal zip code of the current user.

osc_user_latitude() – Returns the latitude of the current user.

osc_user_longitude() – Returns the longitude of the current user.

osc_user_items_validated() – Returns the number of items validated for the current user.

osc_user_comments_validated() – Returns the number of comments validated for the current user.

osc_user_profile_img() – Returns the filename of the user's profile picture.

osc_user_profile_img_url() – Returns the URL of the user's profile picture.

osc_user_profile_img_path() – Returns the filesystem path of the user's profile picture.

Alerts

osc_alert_field($field) – Retrieves a specific field from the current alert.

osc_has_alerts() – Returns the next alert if one exists; otherwise, returns null.

osc_count_alerts() – Returns the total number of alerts in the alerts array.

osc_alert() – Retrieves the current alert from the view.

osc_alert_search() – Retrieves the search field of the current alert.

osc_alert_secret() – Retrieves the secret of the current alert.

osc_alert_search_object() – Retrieves the search object associated with a specific alert.

osc_prepare_user_info() – Returns the next user in the users array.

Utility Functions

osc_total_users($type = '') – Returns the total number of users. The optional $type parameter accepts values such as 'active', 'enabled', 'custom', or 'online'.

osc_user_def_locale_code($user_id = '', $email = '') – Returns the locale code most recently selected by the user. If not set, it returns an empty string, indicating that the site default locale is used. This is useful for disconnected processes, such as sending CRON emails.