Jamroom Module Structure
The first step in creating a new Jamroom Module is to understand the proper file and directory structure for the module. All Jamroom add-on modules will be found in the "modules" directory within your Jamroom directory.
For example, if your Jamroom was installed in the:
directory, the Jamroom modules would be installed in:
EACH module must have it's own directory inside the /modules directory.
As an example, in this guide we will be creating a small Jamroom Module that will allow user's to add YouTube videos to their profile. This module will be called "jrYouTube".
So for our example, our module would be located at:
It is HIGHLY recommended that you use a 2 letter "prefix" for your module name to ensure it is unique. We use "jr", so you'll want to use something else ;)
Within the module directory there are several other files and directories - some required, and some optional. The following files and directories would be located INSIDE your module directory (i.e. /home/jamroom/public_html/modules/jrYouTube):
- include.php - this is the main "includer" for the module and is required. If your module does not have a include.php script within, Jamroom will ignore the module as if it does not exist.
- quota.php - (optional) The quota.php script defines settings that can be adjusted and set on a per Jamroom Quota basis for your modules.
- schema.php (optional) If your module creates a Jamroom database table, the schema.php script is where the database table definitions reside, and includes the main function that is run for the module when the user runs a Jamroom Integrity Check.
- theme.php - (optional) If your module creates an item that can be used in a Profile Theme, the theme.php script gives you control over that items "loop" when the Profile Theme is being generated.
- image.php - (optional) If your module saves images uploaded by the user, the image.php script is used to integrate the image display with Jamroom's image.php script.
- cp/ - (directory, optional) - the cp directory will contain any Control Panel interface PHP scripts that generate "sections" in the Jamroom Control Panel.
- include/ - (directory, optional) - the include directory is where you would want to store any PHP function libraries or classes for use in your module.
- language/ - (directory, optional) - If your module provides a Control Panel interface, the custom language strings for your module would be found in the language directory.
- ranking/ - (directory, optional) - Any custom Jamroom Ranking System plugins will be located here.
- smarty/ (directory, optional) - Any custom Smarty (Jamroom templates) functions, blocks and modifiers would be located here.
Each of these scripts and directories will be covered in detail on the following pages.