Clone this wiki locally
PunBB 1.4 constants
The forum uses constants to define some values, which are used in the code. The values of the constants can be:
- Flag (Is debug mode enabled, etc.)
- String value (file path, etc.)
- Numeric (group id, etc.)
The forum has two groups of constants:
- Pre-defined constants
- User-defined constants.
Here is the description of most used constants.
|Constant||Default value||Shot description|
|FORUM_UNVERIFIED||0||The group ID for users before verification of user's e-mail address.|
|FORUM_ADMIN||1||The group ID for administrators.|
|FORUM_GUEST||2||The group ID for the Guest user.|
|FORUM_MAX_POSTSIZE_BYTES||65535||Maximum size of post in bytes.|
- Enables the debug mode, which provides detailed output of error messages, shows script generation times, number of queries executed in the footer. The debug mode should be disabled on a production server.
- All executed SQL queries will be shown in the footer if this constant is defined. Use this constant only for development purposes, it must not be used on a production server.
- The version a code is written for. It is used only during installation and update processes. You can get the version of the forum from ''$forum_config['o_cur_version']''.
- The database revision a code is written for. It is used only during installation and update processes. You can get the DB reversion of the forum from ''$forum_config['o_database_revision']''.
- If this constant is defined, the database layer will not to send ''SET NAMES 'utf8';'' query to the database. This constant is used only to allow the update script to access non UTF-8 data.
- The relative path from a current folder to the forum's folder. This constant is defined on every forum page. If you create a new forum page, you should define it manually.
- When a user requests a forum page, PunBB try to automatically fix $_SERVER['REQUEST_URI'], if it isn't valid. Defining this constant will prevent the forum from doing this. Use this constant for integration, if you have some problems with URI.
- If this constant is defined, the code of installed extensions will not be executed.
- Defining this constant stops the forum's CSRF protection. It is strongly not recommended to do this.
- Define this constant if all administrators are logged out of the forum, to turn off the maintenance mode.
- The path to the cache directory (by default it is set to ''FORUM_ROOT.'cache/' '').
- The name of the forum page which is currently running. This constant is defined on every forum page. If you create a new forum page, you should define it manually.