Chapter 2. Modules

Table of Contents

2.1. Introduction
2.2. Terminology
2.2.1. Modules
2.2.2. Hacks
2.2.3. Add-ons
2.2.4. Hooks
2.2.5. Hook functions
2.3. Writing your own modules
2.3.1. Introduction
2.3.2. Module information
2.3.3. Module file structure
2.3.3.1. Introduction
2.3.3.2. Single file modules
2.3.3.3. Multiple file modules
2.3.4. Supporting multiple languages
2.3.5. Module data storage
2.3.5.1. Introduction
2.3.5.2. Storing data for messages
2.3.5.3. Storing data for users
2.3.6. Building URLs for Phorum
2.3.6.1. Introduction
2.3.6.2. Build URLs for Phorum PHP scripts: phorum_get_url()
2.3.6.3. Build URLs to files in the Phorum tree
2.3.7. Implementing a settings screen for your module
2.3.7.1. Building input forms
2.3.7.2. Error and success feedback messages
2.3.7.3. Saving module settings to the database
2.3.7.4. Prevent settings.php from being loaded directly
2.3.7.5. Full module settings page example

2.1. Introduction

This section describes Phorum's module system. It is targeted at developers who want to do customization and extend the functionality of Phorum. Modules are the preferred way to archieve this.

For much of this document, we will be talking about an example module "foo". Of course you will not name your module "foo", but something much more appropriate. If you're not familiar with the terms "foo" and "bar", you can visit Wikipedia to see why we chose them.

TODO: Link to section once it's ready Be sure to read at least the CAUTIONS AND SECURITY ISSUES section, before making your own modules.