osc_base_url($with_index = false) – Gets the root url for your installation
osc_admin_base_url($with_index = false) – Gets the root url of oc-admin for your installation
osc_base_path() – Gets the root path for your installation
osc_admin_base_path() – Gets the root path of oc-admin
osc_lib_path() – Gets the libraries path
osc_content_path() – Gets the content path
osc_themes_path() – Gets the themes path
osc_plugins_path() – Gets the plugins path
osc_translations_path() – Gets the translations path
osc_uploads_path() – Gets the uploads path
osc_lib_url() – Gets the libraries url
osc_content_url() – Gets the content url
osc_themes_url() – Gets the themes url
osc_plugins_url() – Gets the plugins url
osc_translations_url() – Gets the translations url
osc_current_admin_theme() – Gets the current oc-admin theme
osc_current_admin_theme_url($file = ) – Gets the complete url of a given admin’s file
osc_current_admin_theme_path($file = ) – Gets the complete path of a given admin’s file
osc_current_admin_theme_styles_url($file = ) – Gets the complete url of a given style’s file
osc_current_admin_theme_js_url($file = ) – Gets the complete url of a given js’s file
osc_current_web_theme() – Gets the current theme for the public website
osc_current_web_theme_url($file = ) – Gets the complete url of a given file using the theme url as a root
osc_current_web_theme_path($file = ) – Gets the complete path of a given file using the theme path as a root and include file (using require function)
osc_current_web_theme_path_value($file = ) – Gets the complete path of a given file using the theme path as a root
osc_current_web_theme_styles_url($file = ) – Gets the complete path of a given styles file using the theme path as a root
osc_current_web_theme_js_url($file = ) – Gets the complete path of a given js file using the theme path as a root
Helpers for the public website
osc_contact_url() – Create automatically the contact url
osc_item_post_url_in_category() – Create automatically the url to post an item in a category
osc_item_post_url() – Create automatically the url to post an item
osc_search_category_url($pattern = ) – Create automatically the url of a category
osc_user_dashboard_url() – Create automatically the url of the users’ dashboard
osc_user_logout_url() – Create automatically the logout url
osc_user_login_url() – Create automatically the login url
osc_register_account_url() – Create automatically the url to register an account
osc_user_activate_url($id, $code) – Create automatically the url to activate an account
osc_item_renew_url($secret = ”, $id = ”) – Generate URL to renew listing once expired
osc_item_comments_url($page = ‘all’, $locale = ) – Create automatically the url of the item’s comments page
osc_comment_url($locale = ) – Create automatically the url of the item’s comments page
osc_item_url($locale = ) – Create automatically the url of the item details page
osc_premium_url($locale = ) – Create automatically the url of the item details page
osc_item_url_ns($id, $locale = ) – Create the no friendly url of the item using the id of the item
osc_item_admin_edit_url($id) – Create automatically the url to for admin to edit an item
osc_user_alerts_url() – Gets current user alerts’ url
osc_user_unsubscribe_alert_url($email = , $secret = ) – Gets current user alert unsubscribe url
osc_user_activate_alert_url( $secret , $email ) – Gets user alert activate url
osc_user_profile_url() – Gets current user profile/account url
osc_user_public_profile_url($user_id = ”) – Gets user public profile url
osc_user_list_items_url($page = ) – Gets current user alert activate url
osc_change_user_email_url() – Gets url to change email
osc_change_user_email_confirm_url($userId, $code) – Gets confirmation url of change email
osc_change_user_password_url() – Gets url for changing password
osc_recover_user_password_url() – Gets url for recovering password
osc_forgot_user_password_confirm_url($userId, $code) – Gets url for confirm the forgot password process
osc_forgot_admin_password_confirm_url($adminId, $code) – Gets url for confirmation admin password recover process
osc_change_language_url($locale) – Gets url for changing website language (for users)
Helpers for items
osc_item_edit_url($secret = , $id = ) – Gets url for editing an item
osc_item_delete_url($secret = , $id = ) – Gets url for delete an item
osc_item_activate_url($secret = , $id = ) – Gets url for activate an item
osc_item_deactivate_url($secret = , $id = ) – Gets url for deactivate an item
osc_item_resource_delete_url($id, $item, $code, $secret = ) – Gets url for deleting a resource of an item
osc_item_send_friend_url() – Gets url of send a friend (current item)
Helpers for search
osc_get_countries() – Gets list of countries
osc_get_regions($country = ) – Gets list of regions (from a country)
osc_get_cities($region = ) – Gets list of cities (from a region)
osc_get_country_row($code) – Gets country record
osc_get_region_row($code) – Gets region record
osc_get_city_row($code) – Gets city record
Helpers for location
osc_is_ad_page() – Get if user is on ad page
osc_is_search_page() – Get if user is on search page
osc_is_static_page() – Get if user is on a static page
osc_is_home_page() – Get if user is on homepage
osc_is_user_dashboard() – Get if user is on user dashboard
osc_is_publish_page() – Get if user is on item publish page
osc_is_edit_page() – Get if user is on item edit page
osc_is_login_form() – Get if user is on login form
osc_get_osclass_location() – Get location
osc_get_osclass_section() – Get section
Utility helpers
osc_is_backoffice() – Returns true if back office is visited
osc_is_frontoffice() – Returns true if front office is visited
osc_add_option_menu($option = null) – Prints the additional options to the menu
Helpers for subdomains
osc_subdomain_enabled() – Returns true when subdomains are enabled. Otherwise returns false.
osc_subdomain_id() – Returns related ID/code of current subdomain. Is same value as stored in sCategory/sCountry/sRegion/sCity/sUser parameter.
osc_subdomain_name() – Returns related name of current subdomain. It is category name, user name, country name, region name or city name. If you are not on subdomain (but on root domain), returns null. Example: for us.yourdomain.com it returns United States.
osc_subdomain_slug() – Returns related slug of current subdomain. It is category slug, user slug, country slug, region slug or city slug. If you are not on subdomain (but on root domain), returns null. Example: for us.yourdomain.com it returns “us” or “united-states”.
osc_is_subdomain() – Returns true when viewing subdomain (not root domain). Based on non-empty slug.
osc_is_topdomain() – Returns true when viewing top-domain (root). Is negation of osc_is_subdomain().
osc_is_subdomain_base() – Returns true wehn viewing top-domain (root) and subdomains are enabled. Otherwise false.
osc_subdomain_type_name() – Returns name of enabled subdomain type (Country, Region, …).
osc_subdomain_top_url($with_index = false, $stop_redirect_param = NULL) – Returns URL to top-domain page. If automatic redirect is enabled, ?nored=1 will be added to URL to avoid this redirection.
Subdomain parameters
When subdomain is active, Osclass will define following parameters in BaseModel:
- sCategory – subdomain category ID
- sCountry – subdomain country code
- sRegion – subdomain region ID
- sCity – subdomain city ID
- sUser – subdomain user ID
Even it may sound confusing, this parameter will always hold ID/code so when filtering results for subdomain, there is no need to check if it is name, slug or ID.
There is always just one and only one array key – depends on subdomain setup.
osc_subdomain_base_url($params = array ()) – Return URL to subdomain based on specified parameter (array key & value).