Sharetronix App structure

From Sharetronix Developer Documentation
Jump to: navigation, search


Sharetronix App structure overview

Sharetronix OPEN SOURCE app is a software module designed and developed to extend the power of our microblogging solution to levels limited only of contributors imagination. The following section is meant to provide a broader look at app technology and to answer some common questions. The app software serves to provide additional features that are not provided by Sharetronix OPEN SOURCE as a host application. The app software cannot be run as a standalone module — it must be installed along with Sharetronix OPEN SOURCE in order to function. Every plugin should be placed in


This folder should contain same name class which is supposed to inherit class plugin. Below is an example of a typical app file folder structure:

/{app_name}/static/images/img.png or js/css files

The main file responsible for the app functionallity is app_name.php. In case of an event this class is invoked to handle it. An app could contain his own controllers if needs them. This way the app could provide extra functionallity. If the app has his own controllers, they should be located in the /controllers_folder. It will be a good idea to have site_url/p/plugin_name/controllers_folder/home.php file as a default controller to be invoked by LOADER.php. Lets say an app needs some extra js files. These resources could be placed in /site_url/app_name/template/ folder and if needed to be invoked. In such way we could call all files except .php files without requesting LOADER.php.

App interaction with STX template

LOADER.php is calling specific events on which plugin provides results to the controller and these results are loaded in the template by the controller.


Events reference


Let's see the example app below.  

class Example_app extends plugin
  public function onPostLoad( &$var )
       global $C;
       $this->setVar( 'activity_footer', 'This is post with ID: '.$var[0]->post_id ); //this will print "This is post with ID: {N}" in the posts footer
Personal tools

STX User guide
STX Developer guide
Sharetronix Sites