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

List of filters

name_of_filter / file_where_it_is.php / short description item_title / item.php / affects the title of the item item_description / item.php / affects the description of the item slug / model/Category.php / could change the slug of the categories (usefull for especial characters as ä, ü, …) resource_path / media_processing.php(oc-admin) / affects the resource path * actions_manage_items / items_processing.php / could […]

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_user_public_profile_url($id = […]

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_resend_flash_messages($section = “pubMessages”) – Re-send the flash messages of the given section. Usefull for custom theme/plugins files.

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 form view osc_resource() – Gets resource array from view osc_item_field($field, $locale = “”) – Gets a specific field from current item osc_comment_field($field, $locale = ) – Gets a specific field from current comment osc_resource_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

Translating and editing language files (.po and .mo)

Typically each theme will have its own language file, located in the theme folder languages (ex: /oc-content/themes/modern/languages/…). There will be at least two files, theme.po and theme.mo, these are the main ones. There may also be additional files, such as messages.po and messages.mo. theme.po – this is a ASCII file (readable text). It’s responsible for most of the text displayed on the website. This is the file […]

Read More

How to create child theme

A child theme is a theme that inherits the functionality of another theme, called the parent theme. Child themes allow you to modify, or add to the functionality of that parent theme. A child theme is the best, safest, and easiest way to modify an existing theme, whether you want to make a few tiny […]

Read More

How to create theme

Osclass allows you to use themes in order to change the appearance of your site and make it unique. This page will explain the process to create a theme for your site. Themes must be placed inside oc-content/themes/ folder. What is GUI? GUI is a fallback theme, included in Osclass, if you mess up and delete your themes […]

Read More

Updating your themes to Osclass 3.x

In Osclass 3.x we introduce some changes on theme’s information, which is located in <your_theme_folder>/index.php From this : <?php function yourtheme_theme_info() { return array( ‘name’ => ‘Your Theme’ ,’version’ => ‘1.0’ ,’description’ => ‘This is Your theme’ ,’author_name’ => ‘You’ ,’author_url’ => ‘http://www.example.com/’ ,’locations’ => array(‘header’, ‘footer’) ); }   ?> To this : <?php /* Theme […]

Read More