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 […]
Category: Plugins
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) […]
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 […]
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 […]
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); }); […]
How to create osclass plugin
Osclass functionality could be extended via Plugins, refer to Plugins page to know more about plugins, this page is about to create them. Plugins files structure Each plugins should consist in one plugin folder, you can call it whatever you want, and one index.php file at least. You could add several files and libraries. Plugins use Hooks to trigger functions at several places […]
Plugins
In computing, a plug-in is a set of software components that adds specific capabilities to a larger software application. If supported, plug-ins enable customizing the functionality of an application. For example, plug-ins are commonly used in web browsers to play video, scan for viruses, and display new file types. (from Wikipedia) There is a large […]
Hooks
A hook is a small piece of code that allows you to insert more code (plugin) in the middle of certain Osclass’ actions. Usage of hooks To use a hook add the following code to your plugin file : osc_add_hook(‘hook_name’, ‘function_name’, ‘priority’); Substitute ‘hook_name’ by the name of the hook you want to attach ‘function_name’, and […]