The hLocation.php helper offers a comprehensive suite of functions to manage location-related data in Osclass. It allows you to retrieve the current country, region, city, and city area, iterate over lists of locations, count available locations, and obtain details such as names and URLs. Additionally, the helper includes a utility function to properly display native location names based on user locale settings.
osc_country() – Gets current country.
osc_region() – Gets current region.
osc_city() – Gets current city.
osc_city_area() – Gets current city area.
osc_has_countries() – Iterator for countries; returns null if there are no more countries.
osc_has_regions($country = '%%%%') – Iterator for regions; returns null if there are no more regions.
osc_has_cities($region = '%%%%') – Iterator for cities; returns null if there are no more cities.
osc_has_city_areas($city = '%%%%') – Iterator for city areas; returns null if there are no more city areas.
osc_count_countries() – Gets the number of countries.
osc_count_regions($country = '%%%%') – Gets the number of regions.
osc_count_cities($region = '%%%%') – Gets the number of cities.
osc_count_city_areas($city = '%%%%') – Gets the number of city areas.
osc_country_name() – Gets the country’s name.
osc_country_items() – Gets the country’s items.
osc_region_name() – Gets the region’s name.
osc_region_items() – Gets the region’s items.
osc_city_name() – Gets the city’s name.
osc_city_items() – Gets the city’s items.
osc_city_area_name() – Gets the city area’s name.
osc_city_area_items() – Gets the city area’s items.
osc_country_url() – Gets the country’s URL.
osc_region_url() – Gets the region’s URL.
osc_city_url() – Gets the city’s URL.
osc_city_area_url() – Gets the city area’s URL.
osc_location_native_name_selector($array) – Returns the native location name from the given array. If the current user locale is set to show native names and the array contains a non-blank value for s_name_native, that value is returned; otherwise, the value of s_name is returned.