This is an old revision of the document!
Global variables
On every forum page, there is a list of forum variables, which are used for page generation. These variables are available after including the file FORUM_ROOT.'include/common.php' to the code. Here the list of variables:
$forum_user
This variable correlates an associative array with some information about a user (user id, group id, username, profile options, user permissions, etc.) For example:
- $forum_user['id'] contains user's id;
- $forum_user['language'] contains the language selected in user's profile;
- $forum_user['g_post_topics'] shows whether the user can post topics or not.
$forum_config
This variable correlates an associative array with all configuration options (board title, sef scheme, etc.) For example:
- $forum_config['o_default_lang'] contains the default language of the forum;
- $forum_config['o_avatars_dir'] is the path to the directory, where avatars are saved.
$forum_db
This variable is an instance of the database layer. It is used to perform SQL queries. On how to use it, read this article.