Next
Phorum Developer Reference Manual
Maurice
Makaay
Brian
Moon
Thomas
Seifert
Andy
Taylor
Joe
Curia
Copyright © 2008 Phorum.org
Table of Contents
Introduction
1. Templates
1.1. Introduction
1.2. Template structure
1.3. How to start your own template
1.4. The Phorum template language
1.4.1. Introduction
1.4.2. General syntax
1.4.3. Data types
1.4.3.1. Integers
1.4.3.2. Strings
1.4.3.3. PHP constants
1.4.3.4. Template variables
1.4.4. Statements
1.4.4.1. Display a variable
1.4.4.2. In line comments
1.4.4.3. DEFINE
1.4.4.4. VAR
1.4.4.5. IF .. ELSEIF .. ELSE ..
1.4.4.6. LOOP
1.4.4.7. INCLUDE
1.4.4.8. HOOK
1.4.5. Need the power of PHP?
2. Modules
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
3. Module hooks
3.1. Introduction
3.2. Message search
3.2.1. search_redirect
3.2.2. search_output
3.3. Templating
3.3.1. javascript_register
3.3.2. javascript_filter
3.3.3. css_register
3.3.4. css_filter
3.4. Login/Logout
3.4.1. before_logout
3.4.2. after_logout
3.4.3. after_login
3.4.4. failed_login
3.5. Buddies system
3.5.1. buddy_list
3.6. Private message system
3.6.1. pm_list
3.6.2. pm_read
3.7. Module hooks
3.7.1. bbcode_register
3.8. Miscellaneous
3.8.1. ajax_<call>
3.8.2. database_error
3.8.3. external
3.8.4. scheduled
3.9. Message handling
3.9.1. posting_init
3.9.2. posting_permissions
3.9.3. posting_custom_action
3.9.4. before_editor
3.9.5. check_post
3.9.6. before_edit
3.9.7. after_edit
3.9.8. before_post
3.9.9. after_message_save
3.9.10. after_post
3.10. Request initialization
3.10.1. parse_request
3.10.2. common_pre
3.10.3. common_no_forum
3.10.4. common_post_user
3.10.5. common
3.10.6. page_<phorum_page>
3.11. Page output
3.11.1. phorum_shutdown
3.11.2. get_template_file
3.11.3. start_output
3.11.4. after_header
3.11.5. before_footer
3.11.6. end_output
3.12. File storage
3.12.1. after_detach
3.12.2. before_attach
3.12.3. after_attach
3.12.4. file_retrieve
3.12.5. file_purge_stale
3.13. Admin interface
3.13.1. admin_general
3.14. Moderation
3.14.1. email_user_start
3.14.2. send_mail
3.14.3. moderation
3.14.4. before_delete
3.14.5. delete
3.14.6. move_thread
3.14.7. close_thread
3.14.8. reopen_thread
3.14.9. after_approve
3.14.10. hide_thread
3.14.11. after_merge
3.14.12. after_split
3.15. Page data handling
3.15.1. index
3.16. User data handling
3.16.1. user_save
3.16.2. user_register
3.16.3. user_get
3.16.4. user_list
3.16.5. user_delete
3.16.6. before_register
3.16.7. after_register
3.17. User authentication and session handling
3.17.1. user_authenticate
3.17.2. user_session_create
3.17.3. user_session_restore
3.17.4. user_session_destroy
3.18. Control center
3.18.1. cc_panel
3.18.2. cc_save_user
List of Tables
2.1.
Keys and values in module information
List of Examples
1.1.
Template information file: $info.php
1.2.
Template example
1.3.
Integer values
1.4.
Code using integer values
1.5.
String values
1.6.
Escaped quotes in string values
1.7.
Code using string values
1.8.
Code using a PHP constant definition
1.9.
Code using built-in PHP constants
1.10.
Template variables
1.11.
Referencing elements in a template variable array
1.12.
Code using template variables
1.13.
Display a variable
1.14.
Add in line comments
1.15.
DEFINE statement usage
1.16.
VAR statement usage
1.17.
IF .. ELSEIF .. ELSE .. statement usage
1.18.
LOOP statement usage
1.19.
INCLUDE statement usage
1.20.
HOOK statement usage
2.1.
Module information
2.2.
Single file module
2.3.
Multi file module
2.4.
Tree structure for a module that supports languages
2.5.
Custom language file for a module
2.6.
Filling custom profile fields for a user with data
2.7.
Generating a profile URL using phorum_get_url()
2.8.
Generating a custom script URL using phorum_get_url()
2.9.
Generating an absolute URL for a file in a module directory
2.10.
Storing settings for a module in the database
2.11.
An example module settings.php script