FluxBB.org

 
Translations of this page?:

Constants

FluxBB's code makes use of constants in order to define certain set values that are used throughout the code (pre-defined constants) as well as for several configuration settings (user-defined constants).

Pre-defined constants

Pre-defined constants allow FluxBB to associate a value with a descriptive string in order to facilitate the common use of the value / simplify the process of changing that value throughout the code. A reference of such constants is provided below. The constants are grouped by the version of the software they exist in. They are given along with their value and a description of what they are/how to use them.

List of 1.3 constants

Constant name Value Description
FORUM_UNVERIFIED 0 The group ID given to users when email verification of registrations is enabled. When the users actually log in for the first time, their group ID is changed to that of the default group for new users.
FORUM_ADMIN 1 The group ID given to administrators.
FORUM_GUEST 2 The group ID given to the Guest user.

List of 1.2 constants

Constant name Value Description
PUN_UNVERIFIED 32000 See FORUM_UNVERIFIED
PUN_ADMIN 1 See FORUM_ADMIN
PUN_MOD 2 The group ID given to moderators. Does not exist in 1.3 because of the ability to have multiple moderator groups.
PUN_GUEST 3 See FORUM_GUEST
PUN_MEMBER 4 The group ID given to users in the member group created by install.php. Does not exist in 1.3 because it was found to be unnecessary.

User-defined constants

FluxBB's code uses several constants that, when defined, modify its behavior. Most of these constants do not ever need to be used by the average user. However, some are useful for debugging and others are important for advanced users. A reference is provided below for those users who may want/need to use these constants. The constants are given along a description of what they do/how to use them.

List of 1.3 constants

All constants (with the exception of certain per-page constants such as FORUM_ROOT) in 1.3 should be defined in config.php. Administrators should not edit the core to add these constants in.

FORUM_ROOT

  • Example Usage:
if (!defined('FORUM_ROOT'))
	define('FORUM_ROOT', './');
require FORUM_ROOT.'include/common.php';
  • Description: FORUM_ROOT is the relative path from the current folder to the folder where the FluxBB code resides. You should never need to define this constant yourself unless you are writing pages that use FluxBB / integrating FluxBB with another piece of software. You must check if FORUM_ROOT is defined before defining it if the page you are creating / integrating uses FluxBB's SEF URL system.

FORUM_DEBUG

  • Example Usage:
define('FORUM_DEBUG', 1);
  • Description: Defining FORUM_DEBUG enables debug mode, which makes FluxBB display more detailed/sensitive error messages. Script generation time and number of queries executed will also be shown in the footer. Debug mode should not be enabled on a production site, since it can potentially give a malicious user sensitive information about a server. However, enabling debug mode is an integral step to reporting/diagnosing forum errors. Without the information it provides, it can be nearly impossible for the developers to figure out the underlying cause of an issue.

FORUM_SHOW_QUERIES

  • Example Usage:
define('FORUM_SHOW_QUERIES', 1);
  • Description: Defining FORUM_SHOW_QUERIES makes all the queries executed during a pageview display in the footer. This feature is only useful for developing and should never be used in a production environment because of the potential for disclosure of sensitive information.

FORUM_DISABLE_HOOKS

  • Example Usage:
define('FORUM_DISABLE_HOOKS', 1);
  • Description: Defining FORUM_DISABLE_HOOKS stops extension code from executing. It should only be used if an extension has messed up your forum to such a degree that you can not otherwise reach the admin panel to disable it.

FORUM_TURN_OFF_MAINT

  • Example Usage:
define('FORUM_TURN_OFF_MAINT', 1);
  • Description: Defining FORUM_TURN_OFF_MAINT overrides the $forum_config setting to enable maintenance mode. It should be used temporarily in cases where all administrators have logged out of the forum while maintenance mode is enabled so that maintenance mode can be disabled in $forum_config.

FORUM_DISABLE_BUFFERING

  • Example Usage:
define('FORUM_DISABLE_BUFFERING', 1);
  • Description: Defining FORUM_DISABLE_BUFFERING disables output buffering. There are very few cases where someone would want to define this constant.

FORUM_CACHE_DIR

  • Example Usage:
// This should make FluxBB's cache system work with Sourceforge
define('FORUM_CACHE_DIR', '/tmp/persistent/');
  • Description: Defining FORUM_CACHE_DIR overrides the default cache directory (FORUM_ROOT.'cache/). It is useful for people installing FluxBB on sites where writing files is limited to certain folders (eg: Sourceforge).

FORUM_NO_SET_NAMES

  • Example Usage:
define('FORUM_NO_SET_NAMES', 1);
  • Description: Defining FORUM_NO_SET_NAMES tells the dblayer for MySQL(i) and PostgreSQL not to send SET NAMES commands to the database. This constant is included mostly to allow the database update script to access non UTF-8 data in its original form. It should not need to be used otherwise.

FORUM_DISABLE_CSRF_CONFIRM

  • Example Usage:
define('FORUM_DISABLE_CSRF_CONFIRM', 1);
  • Description: Defining FORUM_DISABLE_CSRF_CONFIRM bypasses FluxBB's CSRF protection. This should not be defined in config.php, since that would completely disable CSRF protection on the entire site, which is bad. It is useful mostly for integration, where the software that is being integrated might not be able to easily use FluxBB's CSRF system.

FORUM_IGNORE_REQUEST_URI

  • Example Usage:
define('FORUM_IGNORE_REQUEST_URI', 1);
  • Description: Defining FORUM_IGNORE_REQUEST_URI will stop FluxBB from trying to automatically fix the REQUEST_URI if it doesn't think it is valid. This should not be defined in config.php, It is mostly used for integration, where the software that is being integrated also uses rewrite rules.

FORUM_DISABLE_URL_CONFIRM

  • Example Usage:
define('FORUM_DISABLE_URL_CONFIRM', 1);
  • Description: Defining FORUM_DISABLE_URL_CONFIRM will stop FluxBB from confirming you are viewing the page using the correct link. This can cause odd behaviour sometimes with some versions of IIS, if you are having issues with infinite redirecting try defining this constant in your config file.

List of 1.2 constants

All constants (with the exception of certain per-page constants such as PUN_ROOT) in 1.2 should be defined at the top of include/common.php. Some are already defined but commented out. In that case, simply uncommenting them will work.

PUN_ROOT

  • Example Usage:
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
  • Description: PUN_ROOT is the relative path from the current folder to the folder where the FluxBB code resides. You should never need to define this constant yourself unless you are writing pages that use FluxBB / integrating FluxBB with another piece of software.

PUN_DEBUG

  • Example Usage:
define('PUN_DEBUG', 1);
  • Description: Defining PUN_DEBUG enables debug mode, which makes FluxBB display more detailed/sensitive error messages. Script generation time and number of queries executed will also be shown in the footer. Debug mode should not be enabled on a production site, since it can potentially give a malicious user sensitive information about a server. However, enabling debug mode is an integral step to reporting/diagnosing forum errors. Without the information it provides, it can be nearly impossible for the developers to figure out the underlying cause of an issue.

PUN_SHOW_QUERIES

  • Example Usage:
define('PUN_SHOW_QUERIES', 1);
  • Description: Defining PUN_SHOW_QUERIES makes all the queries executed during a pageview display in the footer. This feature is only useful for developing and should never be used in a production environment because of the potential for disclosure of sensitive information.

PUN_TURN_OFF_MAINT

  • Example Usage:
define('PUN_TURN_OFF_MAINT', 1);
  • Description: Defining PUN_TURN_OFF_MAINT overrides the $pun_config setting to enable maintenance mode. It is used by the turn_off_maintenance_mode.php script in the extras directory, which is used to turn off maintenance mode when all administrators have logged out a forum that is in maintenance mode.

PUN_DISABLE_BUFFERING

  • Example Usage:
define('PUN_DISABLE_BUFFERING', 1);
  • Description: Defining PUN_DISABLE_BUFFERING disables output buffering. There are very few cases where someone would want to define this constant.
 
constants.txt · Last modified: 2008/09/22 21:49 by Reines
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki