Skip to content
Cameron edited this page Jan 28, 2017 · 1 revision

title: Modules permalink: /Modules/

Adding your own include code to every page via class2.php

A plugin module - also called addon in the core - is a piece of code that will be automatically loaded via class2.php so that it can be executed on each page load.

Plugin authors may wish to do this for a number of reasons.

  • Registering an 'event' Creating routines to be performed on core event triggers
  • Integrating a stats counter
  • Overriding a core function

As of e107 v0.7.6, this is accomplished by simply adding an e_module.php file to your plugin folder.

Your plugin will then be registered as a module. Any plugin that has registered itself as a module just needs to place an e_module.php in it's root directory. class2.php will auto-detect this file and execute the code within in at each page load.

The e_module.php files will be run through a require_once() just after the init_session() function. So all e107 variables and user information will be available in your e_module.php

NOTE: Your plugin has to be installed in order for it to register a module. 0.7.6 includes a plugin-scanner in admin->database->Scan plugin directories to register recent plugins' changes.

Category:API Category:PluginWriting

Clone this wiki locally