-
Plugins provide a way for developers to modify or extend the behavior of applications within the IPS Community Suite.This guide will cover in detail the different features available within Plugins. Many of the features describes are accessed from the Plugin Developer Center - to access this, first place IPS Community Suite in developer mode. Once developer mode is enabled, a "Create Plugin" button will appear in the Admin CP under System --> Site Features --> Plugin. Use this tool to creat
-
Code Hooks allow you to extend any class within the IPS Community Suite or an application installed. You can create Code Hooks in the Plugin Developer Center.
You'll notice that throughout the code, classes are defined beginning with an underscore, but called without. For example, in /system/Member/Member.php, the declaration for is:
namespace IPS;
class _Member extends \IPS\Patterns\ActiveRecord
Yet throughout the code, \IPS\Member is called rather than \IPS\_Member. This is a technic
-
Theme hooks allow you to modify the HTML templates. The HTML templates within the IPS Community Suite are structured into groups, locations and applications. Each application will have at least 3 locations:
front (templates used for the front-end)
admin (templates used for the Admin CP)
global (templates which are used for both)
Though some applications may have more for specific purposes (for example, the core application has another location for installer/upgrader call
-
Much like full applications, plugins can have system settings that allow administrators to configure it. For example, you might have a setting that toggles some part of your functionality on and off, or fields that can accept some authentication values used by some other system. If your plugin requires some data or preferences to be set by the administrator, settings are the ideal way do implement it.
Allocating space in IPS\Settings
\IPS\Settings is a repository for scalar key/
-
Tasks are scripts which run at specific intervals. They are useful for performing any maintenance that must be ran on a regular basis. It is important to note however, that they cannot be relied on - though IPS Community Suite provides a way for administrators to run tasks using a cron, this may not be enabled, in which case tasks can only be triggered when users are active on the site - if the site is inactive at the time your task is scheduled to run, it will run at the soonest opportunity aft
-
Installs
To run code such as database changes when your plugin is installed, open the /plugins/<your plugin>/dev/setup/install.php file and follow the instructions given by the doc-comments.
Note: You must add an initial version in the developer center in order for the install.php installation file to be executed.
Please don't use any official application prefixes like cms_ core_ forums_ or blog_ to name your custom database tables, use some unique names to avoid any furthe
-
Plugins support external resources such as images, javascript files, CSS and templates, should you need to use them.
HTML templates
HTML files will become templates within the core -> global -> plugins group. In other words, you will get the content of the HTML files you create using this code in controllers, where filename is the name of your template file:
\IPS\Theme::i()->getTemplate( 'plugins', 'core', 'global' )->filename( ... );
Or the following code fro
-
IPS Community Suite supports multiple languages and translation tools such as the Visual Language Editor. Any text your plugin uses should be abstracted to language strings so that your plugin also supports these features.
Language strings are defined as key/value pairs. To add a language string, just open the /plugins/<your plugin>/dev/lang.php file and add an element to the array. Then to use the language string, use this in controllers:
\IPS\Member::loggedIn()->language()-&g
-
This guide will demonstrate step-by-step creating how to create simple plugin making use of most of the features provided. For this guide, you'll be shown how to create a plugin which displays a message at the top of every page on the community.
Step 1: Creating the Plugin
To begin, you'll need to have a test installation in developer mode. Once developer mode is enabled, a "Create Plugin" button will appear in the Admin CP under System --> Site Features --> Plugin. Use th