Loading...
Changes Saved.
Error Occurred!
Home Products Blog Community Support Resellers

Creating a New JEM Module

This document will attempt to outline steps for creating a module in JEM.  Because this requires advanced knowledge of PHP and MySQL programming, we ask that you consult a qualified developer to do this for you if you do not have the necessary skills to code this.

Why Create a Module in JEM?

JEM allows you to extend the functionality of certain parts of it system through the use of modules. With modules, you can access data and run functions that may be necessary for your site, for example, adding a new user to your forum database when someone signs up through JEM, or adding a new payment gateway that is not yet available with JEM.

Anatomy of a Module

Depending on the module that you want to create, you must create the following files:

  1. /system/application/models/modules/module_MODULE_TYPE_MODULE_NAME_model.php - this file will hold the main functions for the module such as database queries.
    • MODULE_TYPE is the the type of module you want to create.  The list of modules available are here
    • MODULE_NAME is the name of your module.  For example, forum_login
  2. /system/application/controllers/modules/module_MODULE_TYPE_MODULE_NAME.php - this is only needed if you are building a module that requires admin area administration, such as shipping, affiliate marketing, stats and reporting  or payment gateways.  Otherwise, just create a placeholder file similar to the example file in the same folder called module_login_testing.php
    • MODULE_TYPE is the the type of module you want to create. 
    • MODULE_NAME is the name of your module.  For example, forum_login
  3. /system/application/views/modules/tpl_adm_MODULE_TYPE_MODULE_NAME.php - this is only needed if you are building a module that requires admin area administration, such as shipping, affiliate marketing, stats and reporting  or payment gateways. 
    • MODULE_TYPE is the the type of module you want to create.
    • MODULE_NAME is the name of your module.  For example, forum_login

Adding Your Module

  1. Once you have built your Custom Module, you can add it to the system by clicking on Settings > Installed Modules > Install Module
  2. TYype in the name and description for your module, and the module file name as given in MODULE_NAME.  For example, if your module file name is called module_login_testing.php, enter login_testing
  3. the height and width are used for those modules that required admin configuration, and use layered windows for configuring, such as payment gateways.
  4. Module Type - select the module type,  In the previous example, the module type would be Account Login
  5. Once the module is added, it will show up in the module listings for Manage Modules

Activating Your Module

To activate your module, just click on the Status edit icon.

Example Modules

We have included example modules for testing in /system/application/models/modules folder. the modules are for login, called module_login_testing_model.php and for post purchase, called module_post_purchase_testing_model.php

You can add this directly via the Settings > Installed Modules area.




Related Articles