The hPremium.php helper provides functions that return objects from the static view class in Osclass related to premium listings. It allows you to retrieve new premium ads, obtain the current premium data, and access specific fields for single premium items. Additional helper functions facilitate iterating over arrays of premiums, resources, comments, and meta fields.
osc_get_premiums($max = 2) – Gets new premium ads. The parameter $max determines the maximum number of premium ads to retrieve.
osc_premium() – Gets the current premium array from view.
osc_premium_field($field, $locale = "") – Gets a specific field from the current premium.
osc_premium_id() – Gets the ID of the current premium.
osc_premium_user_id() – Gets the user ID associated with the current premium.
osc_premium_description($locale = "") – Gets the description from the current premium. If $locale is unspecified, it defaults to the current user locale.
osc_premium_title($locale = "") – Gets the title from the current premium. If $locale is unspecified, it defaults to the current user locale.
osc_premium_category($locale = "") – Gets the category from the current premium.
osc_premium_category_description($locale = "") – Gets the category description from the current premium. If $locale is unspecified, it defaults to the current user locale.
osc_premium_category_id() – Gets the category ID of the current premium.
osc_premium_pub_date() – Gets the publication date of the current premium.
osc_premium_mod_date() – Gets the modification date of the current premium.
osc_premium_price() – Gets the price of the current premium.
osc_premium_formated_price() – Gets the formatted price of the current premium.
osc_premium_currency() – Gets the currency of the current premium.
osc_premium_contact_name() – Gets the contact name for the current premium.
osc_premium_contact_email() – Gets the contact email for the current premium.
osc_premium_country() – Gets the country name of the current premium.
osc_premium_country_code() – Gets the country code of the current premium (e.g., US).
osc_premium_region() – Gets the region of the current premium.
osc_premium_city() – Gets the city of the current premium.
osc_premium_city_area() – Gets the city area of the current premium.
osc_premium_address() – Gets the address of the current premium.
osc_premium_show_email() – Returns true if the contact email can be shown at the frontend; otherwise, returns false.
osc_premium_zip() – Gets the zip code of the current premium.
osc_premium_latitude() – Gets the latitude of the current premium.
osc_premium_longitude() – Gets the longitude of the current premium.
osc_premium_is_premium() – Returns true if the current premium is marked as premium; otherwise, returns false.
osc_premium_views() – Returns the number of views of the current premium.
osc_premium_status() – Gets the status of the current premium.
osc_premium_secret() – Gets the secret string of the current premium.
osc_premium_is_active() – Returns true if the current premium is active.
osc_premium_is_inactive() – Returns true if the current premium is inactive.
osc_premium_is_spam() – Returns true if the current premium is marked as spam.
osc_premium_total_comments() – Gets the total number of comments for the current premium.
osc_premium_comments_page() – Gets the current page number for comments pagination on the current premium.
osc_has_premiums() – Retrieves the next premium in the current array; returns null if there are no more premiums.
osc_reset_premiums() – Resets the internal pointer of the premiums array to its first element and returns it.
osc_count_premiums() – Returns the number of premiums in the current premiums array.
osc_count_premium_resources() – Returns the number of resources in the current premium’s resources array.
osc_has_premium_resources() – Retrieves the next resource from the current premium’s resources array if available; returns null otherwise.
osc_get_premium_resources() – Retrieves the current resource from the current premium’s resources array.
osc_count_premium_comments() – Returns the number of comments for the current premium.
osc_has_premium_comments() – Retrieves the next comment from the current premium’s comments array if available.
osc_priv_count_premiums() – Returns the total number of premiums (as a private count).
osc_count_premium_meta() – Returns the number of meta fields associated with the current premium.
osc_has_premium_meta() – Retrieves the next premium meta field if available; returns null otherwise.
osc_get_premium_meta() – Retrieves all premium meta fields.