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 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.

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 constants

All constants (with the exception of certain per-page constants such as FORUM_ROOT) in v1.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.
 
v1.3/constants.txt · Last modified: 2009/02/03 20:41 by lie2815
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki