Item publish & edit hook variants

In Osclass v8.2.0, we brought possibility to use multiple category-based hooks for item publish and item edit pages. Until now, there was one and only one hook for publish/edit, that was very limiting. This hook was usually shown at the end of publish/edit page. (Keep in mind default one still need to exists on publish/edit […]

Read More

Integrate user image uploader to user profile

Osclass now provides built-in profile (avatar) image uploader feature, however most of themes does not leverage it as they were built on profile picture or avatar plugins. Let’s take a look how to quickly integrate built-in image uploader to your theme as well. We will use “your_theme” as sample, replace it with folder name of […]

Read More

Alpha and Beta Osclass testing

When new Osclass version is close to release, Alpha or Beta testing may be available (follow forums for call on testing). Anyone can join testing and post feedback on forums. To join Alpha or Beta test, you just need to add new row to your config.php. Alpha testing: define(‘ALPHA_TEST’, true); Beta testing: define(‘BETA_TEST’, true); Never […]

Read More

Subdomains configuration

Osclass has very powerful feature that allows you to setup subdomains based on your data (dynamical subdomains). Subdomain types: User based subdomains Category based subdomains Location based subdomains. This includes country, region and city Updates in Osclass Go to your file system or FTP open config.php located in root folder of your osclass installation Change: […]

Read More

Remove links to Osclass.org

As osclass website and osclass market has been shut down, there is need to remove linkage of osclass script to these sites, othervise your oc-admin (backoffice) will be very slow. Please follow this step by step guide to remove any links to osclass sites. Disable auto-upgrade Will disable any way to osclass to be automatically […]

Read More

How to upgrade your plugins to new DAO classes

In version 2.3 we introduced much better DAO (Data Access Object) classes. The new classes introduce an easier way to work with the database. Also, all input is sanitized now, so you not need to worry about insecure input anymore. Yay! The best way to work with the new DAO, is to create a new model (class) […]

Read More

How to extend fields

This page will show you hot to create an attributes plugin to extend the fields of the ads in your Osclass installation. In most cases the built-in functionality custom fields of Osclass is enough to extend the fields of an ad, however, sometime is necessary to add a search functionality or have a more deep customization. In […]

Read More

Plugin info

How to use the plugin info you added at the top of the index.php file of your plugin. /*   Plugin Name: My Plugin Plugin URI: myPlugin.com Description: This is my plugin. Version: 1.0 Author: me Author URI: me.com Short Name: myPlugin Plugin update URI: my-plugin-update */ To retrieve the data you need to first […]

Read More

Filters

A filter is functionality that allows to modify content of particular functions (price format, item title etc.). Function added to filter have 1 input parameter – content that can be modified. Function returns output as modified content. osc_add_filter(‘filter_name’, ‘function_name’); Example for filters might be need to capitalize items title: osc_add_filter(‘item_title’, function($title) { return ucwords($title); }); […]

Read More

hValidate.php

osc_validate_text ($value = , $count = 1, $required = true) – Validate the text with a minimum of non-punctuation characters (international) osc_validate_int ($value) – Validate one or more numbers (no periods) osc_validate_nozero ($value) – Validate one or more numbers (no periods), must be more than 0. osc_validate_number ($value = null, $required = false) – Validate $value […]

Read More

hUtils.php

__get($key) – Getting from View the $key index osc_get_param($key) – Get variable from $_REQUEST[$key] osc_field($item, $field, $locale) – Generic function for view layer, return the $field of $item osc_show_widgets($location) – Print all widgets belonging to $location osc_show_recaptcha($section = ) – Print recaptcha html, if $section = “recover_password” osc_format_date($date) – Formats the date using the appropiate format. […]

Read More

hUsers.php

osc_user_field($field, $locale = “”) – Gets a specific field from current user osc_user() – Gets user array from view osc_is_web_user_logged_in() – Gets true if user is logged in web osc_logged_user_id() – Gets logged user id osc_logged_user_email() – Gets logged user mail osc_logged_user_name() – Gets logged user email osc_logged_user_phone() – Gets logged user phone osc_logged_user() – […]

Read More

hTranslations.php

__($key, $domain = ‘core’) – Translate strings _e($key, $domain = ‘core’) – Translate strings (echo them) _m($key) – Translate string (flash messages) _n($single_key, $plural_key, $count, $domain = ‘core’) – Retrieve the singular or plural translation of the string. _mn($single_key, $plural_key, $count) – Retrieve the singular or plural translation

Read More

hTheme.php

osc_admin_render_theme_url($file = ) – Gets urls for current theme administrations options osc_render_file($file = ) – Render the specified file osc_render_file_url($file = ) – Gets urls for render custom files in front-end osc_theme_get_info($theme) – Returns information about front-office theme (from index.php of theme). Enter only theme name (name of theme folder). Example: bender, sigma, delta osc_resend_flash_messages($section = “pubMessages”) […]

Read More

hSearch.php

osc_search() – Gets search object osc_list_orders() – Gets available search orders osc_search_page() – Gets current search page osc_search_total_pages() – Gets total pages of search osc_search_has_pic() – Gets if “has pic” option is enabled or not in the search osc_search_order() – Gets current search order osc_search_order_type() – Gets current search order type osc_search_pattern() – Gets current […]

Read More

hSanitize.php

osc_sanitize_url($value) – Sanitize a website URL osc_sanitize_name($value) – Sanitize capitalization for a string. Capitalize first letter of each name. If all-caps, remove all-caps. osc_sanitize_allcaps($value) – Sanitize string that’s all-caps osc_sanitize_int($value) – Sanitize number (with no periods) osc_sanitize_phone($value) – Format phone number. Supports 10-digit with extensions, and defaults to international if cannot match US number. osc_esc_html($str […]

Read More

hPremium.php

Functions that returns object from static class (view) osc_get_premiums($max = 2) – Gets new premiums ads osc_premium() – Gets current premium array from view osc_premium_field($field, $locale = “”) – Gets a specific field from current premium Helpers for single premiums osc_premium_id() – Gets id from current premium osc_premium_user_id() – Gets user id from current premium […]

Read More

hPreference.php

osc_time_cookie() – Gets cookie’s life osc_comments_enabled() – Gets if comments are enabled or not osc_comments_per_page() – Gets comments per page osc_timezone() – Gets comments per page osc_reg_user_post_comments() – Gets if only users can post comments osc_reg_user_can_contact() – Gets if only users can contact to seller osc_users_enabled() – Gets if users are enabled or not osc_user_registration_enabled() […]

Read More

hPlugins.php

osc_run_hook($hook) – Run a hook osc_apply_filter($hook, $content) – Apply a filter to a text osc_add_hook($hook, $function, $priority = 5) – Add a hook osc_add_filter($hook, $function, $priority = 5) – Add a filter osc_remove_hook($hook, $function) – Remove a hook’s function osc_remove_filter($hook, $function) – Remove a filter’s function osc_is_this_category($name, $id) – If the plugin is attached to […]

Read More

hPagination.php

osc_search_pagination() – Gets the pagination links of search pagination osc_comments_pagination() – Gets the pagination links of comments pagination osc_pagination($params = null) – Gets generic pagination links

Read More

hPage.php

osc_static_page() – Gets current page object osc_static_page_field($field, $locale = ) – Gets current page field osc_static_page_title($locale = ) – Gets current page title osc_static_page_text($locale = ) – Gets current page text osc_static_page_id() – Gets current page ID osc_static_page_order() – Get page order osc_static_page_mod_date() – Gets current page modification date osc_static_page_pub_date() – Gets current page publish date osc_static_page_url($locale = ) […]

Read More

hMessages.php

osc_add_flash_message($msg, $section = ‘pubMessages’) – Adds an ephemeral message to the session. (error style) osc_add_flash_ok_message($msg, $section = ‘pubMessages’) – Adds an ephemeral message to the session. (ok style) osc_add_flash_error_message($msg, $section = ‘pubMessages’) – Adds an ephemeral message to the session. (error style) osc_add_flash_info_message($msg, $section = ‘pubMessages’) – Adds an ephemeral message to the session. (info […]

Read More

hLocation.php

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, return null if there’s no more countries osc_has_regions($country = ‘%%%%’) – Iterator for regions, return null if there’s no more regions osc_has_cities($region = ‘%%%%’) – Iterator for cities, return […]

Read More

hLocale.php

osc_locale_field($field, $locale = ”) – Gets locale generic field osc_locale() – Gets locale object osc_get_locales() – Gets list of locales osc_priv_count_locales() – Private function to count locales osc_goto_first_locale() – Reset iterator of locales osc_count_web_enabled_locales() – Gets number of enabled locales for website osc_has_web_enabled_locales() – Iterator for enabled locales for website osc_locale_code() – Gets current locale’s code […]

Read More

hItems.php

Helpers that return objects from the static class (view) osc_item() – Gets current item array from view osc_comment() – Gets comment array from view osc_comment_reply() – Gets comment reply (identical to comment) array from view osc_resource() – Gets resource array from view osc_item_field($field, $locale = “”) – Gets a specific field from current item osc_comment_field($field, […]

Read More

hErrors.php

osc_die($title, $message) – Kill OSClass with an error message osc_get_absolute_url() – Gets absolute URL

Read More

hDefines.php

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() – […]

Read More

hDatabaseInfo.php

osc_db_name() – Gets database name osc_db_host() – Gets database host osc_db_user() – Gets database user osc_db_password() – Gets database password osc_multisite_url() – Gets multisite url

Read More

hCategories.php

osc_category() – Gets current category osc_get_categories() – Gets the list of categories as a tree osc_field_toTree($item, $field) – If the result of toTree had the same format as items or comments, it would be the same as osc_field osc_category_field($field, $locale = ) – Gets the value of the category attribute osc_priv_count_categories() – Gets the number of […]

Read More