Documentation

Database structure

The following is a complete list of all FluxBB database tables and their structures. Primary key fields are underlined, foreign keys are in italics.

Type conventions

  • Artificial primary keys are of type int(10).
  • Boolean values are of type tinyint(1), with the value 1 representing true and 0 representing false.

List of tables

Please note: The below descriptions are based off the database structure when using MySQL(i). In other supported RDBMS the field type and default values may vary slightly.


bans

The bans table is used to hold details of all current bans. It is important to note that bans work on usernames, IP addresses or email addresses - not specific user accounts.

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
usernamevarchar(200)NULLThe username this ban applies to, or NULL for none.
ipvarchar(255)NULLThe IP address(es) this ban applies to, or NULL for none.
emailvarchar(80)NULLThe email address this ban applies to, or NULL for none.
messagevarchar(255)NULLA message to be displayed to the banned user.
expireint(10)NULLA UNIX timestamp representing the time the ban should expire.
ban_creatorint(10)0The ID of the user who created the ban.

categories

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
cat_namevarchar(80)“New Category”The name of the category.
disp_positionint(10)0The position of this category in relation to the others.

censoring

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
search_forvarchar(60)“”The term to search for.
replace_withvarchar(60)“”The term to replace with.

config

The config table holds key, value pairs for all the main configuration options. For performance reasons FluxBB caches these values and will only refresh the cache when they are updated via the admin panel.

For more information about the actual contents of the config table, see the $pun_config global variable.

FieldTypeDefaultDescription
conf_namevarchar(255)“”The name of the configuration variable. General configuration options start with the prefix o_ and general permission options start with the prefix p_.
conf_valuetextNULLThe value of the configuration variable.

forums

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
forum_namevarchar(80)“New forum”The name of the forum.
forum_desctextNULLA description of the forum (may contain HTML).
redirect_urlvarchar(100)NULLThe URL to redirect users to upon clicking the forum link, or NULL for a normal forum.
moderatorstextNULLA serialized associative PHP array with moderator names ⇒ user IDs.
num_topicsmediumint(8)0The number of topics the forum contains.
num_postsmediumint(8)0The number of posts the forum contains.
last_postint(10)NULLA UNIX timestamp representing the time the last post was made in the forum.
last_post_idint(10)NULLThe ID of the last post that was made in the forum.
last_postervarchar(200)NULLThe username (or guest name) of the user that made the last post in the forum.
sort_bytinyint(1)0How the posts in the forum should be sorted. 0 = By last post time, 1 = By topic start time.
disp_positionint(10)0The position of this forum in relation to the others.
cat_idint(10)0The ID of the category in which this forum resides.

forum_perms

FieldTypeDefaultDescription
group_idint(10)0The ID of the group this permission set applies to.
forum_idint(10)0The ID of the forum this permission set applies to.
read_forumtinyint(1)1Allow members of the group to view this forum?
post_repliestinyint(1)1Allow members of the group to post replies in this forum?
post_topicstinyint(1)1Allow members of the group to start new topics in this forum?

groups

All fields in the groups table are prefixed with g_. This is to allow them to be easily combined with all the fields from the users table without any conflicting field names.

FieldTypeDefaultDescription
g_idint(10) The auto-incrementing primary key for this table.
g_titlevarchar(50)“”The name of this group.
g_user_titlevarchar(50)NULLThe user title to be used for members of this group.
g_moderatortinyint(1)0Does this group have moderator privileges?
g_mod_edit_userstinyint(1)0If g_moderator, can members of this group edit users profiles?
g_mod_rename_userstinyint(1)0If g_moderator, can members of this group rename users?
g_mod_change_passwordstinyint(1)0If g_moderator, can members of this group change users passwords?
g_mod_ban_userstinyint(1)0If g_moderator, can members of this group ban users?
g_read_boardtinyint(1)1Can members of this group view boards? If this is 0 the group basically has no access to the forums.
g_view_userstinyint(1)1Can members of this group view the user list?
g_post_repliestinyint(1)1Can members of this group post replies?
g_post_topicstinyint(1)1Can members of this group start new topics?
g_edit_poststinyint(1)1Can members of this group edit their own posts?
g_delete_poststinyint(1)1Can members of this group delete their own posts?
g_delete_topicstinyint(1)1Can members of this group delete their own topics (including all replies)?
g_set_titletinyint(1)1Can members of this group set their own user title?
g_searchtinyint(1)1Can members of this group use the search features?
g_search_userstinyint(1)1Can members of this group search the user list?
g_send_emailtinyint(1)1Can members of this group send emails to users?
g_post_floodsmallint(6)30How many seconds members of this group must wait between making posts.
g_search_floodsmallint(6)30How many seconds members of this group must wait between making search requests.
g_email_floodsmallint(6)60How many seconds members of this group must wait between sending emails.

online

FieldTypeDefaultDescription
user_idint(10)1The ID of the user (or 1 if the user is a guest).
identvarchar(200)“”Identification string for the user (Username for logged in users, IP address for guests).
loggedint(10)0A UNIX timestamp representing the time of the users last activity.
idletinyint(1)0If the user is idle or not (i.e. their last visit was more than o_timeout_online seconds ago, but less than o_timeout_visit seconds ago - see the $pun_config global variable).
last_postint(10)NULLA UNIX timestamp representing the time the user last made a post.
last_searchint(10)NULLA UNIX timestamp representing the time the user last performed a search.

posts

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
postervarchar(200)“”The username of the user who created this post.
poster_idint(10)1The ID of the user who created this post.
poster_ipvarchar(39)NULLThe IP address of the user who created this post.
poster_emailvarchar(80)NULLIf the post was created by a guest, their email address. If it was created by a logged in user, then NULL.
messagemediumtextNULLThe contents of the post.
hide_smiliestinyint(1)0Should smilies be hidden in this post?
postedint(10)0A UNIX timestamp representing the time this post was created.
editedint(10)NULLA UNIX timestamp representing the time this post was last edited, or NULL if it hasn't been edited.
edited_byvarchar(200)NULLThe username of the user who last edited this post, or NULL if it hasn't been edited.
topic_idint(10)0The ID of the parent topic for this post.

ranks

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
rankvarchar(50)“”The rank title.
min_postsmediumint(8)0The number of posts a user must attain in order to reach the rank.

reports

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
post_idint(10)0The ID of the reported post.
topic_idint(10)0The ID of topic in which the reported post is contained.
forum_idint(10)0The ID of the forum in which the reported post is contained.
reported_byint(10)0The ID of the user who created the report.
createdint(10)0A UNIX timestamp representing the time this report was created.
messagetextNULLThe report message entered by the user.
zappedint(10)NULLA UNIX timestamp representing the time this report was zapped (marked as read).
zapped_byint(10)NULLThe ID of the user who zapped (marked as read) this report.

search_cache

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
identvarchar(200)“”An identifier for the user who initiated the search. For a guest their IP address is used, for a logged in user, their username.
search_datamediumtextNULLA serialized array containing search results.

search_matches

FieldTypeDefaultDescription
post_idint(10)0The ID of the post which this word can be found.
word_idint(10)0The ID of the word which can be found there.
subject_matchtinyint(1)00 = The word is in the post body, 1 = the word is in a topic subject.

search_words

FieldTypeDefaultDescription
idint(10)0The auto-incrementing primary key for this table.
wordvarchar(20)“”The word to be indexed.

topic_subscriptions

FieldTypeDefaultDescription
user_idint(10)0The ID of the user which this subscription belongs to.
topic_idint(10)0The ID of the topic which this subscription belongs to.

forum_subscriptions

FieldTypeDefaultDescription
user_idint(10)0The ID of the user which this subscription belongs to.
forum_idint(10)0The ID of the forum which this subscription belongs to.

topics

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
postervarchar(200)“”The username of the user who posted this topic.
subjectvarchar(255)“”The subject of the topic.
postedint(10)0A UNIX timestamp representing the time this topic was posted.
first_post_idint(10)0The ID of the first post in this topic.
last_postint(10)0A UNIX timestamp representing the time the last post was made to this topic.
last_post_idint(10)0The ID of the last post in this topic.
last_postervarchar(200)NULLThe username of the user who posted the last reply to this topic.
num_viewsmediumint(8)0The number of times this topic has been viewed.
num_repliesmediumint(8)0The number of replies this topic has.
closedtinyint(1)0Is this topic closed?
stickytinyint(1)0Is this topic a sticky?
moved_toint(10)NULLIf the topic has been moved, the ID of the new topic (this one now solely acts as a redirect).
forum_idint(10)0The ID of the forum this topic is within.

users

FieldTypeDefaultDescription
idint(10) The auto-incrementing primary key for this table.
group_idint(10)3The ID of the group to which this user belongs. The default is PUN_MEMBER.
usernamevarchar(200)“”The users username.
passwordvarchar(40)“”The users password hash.
emailvarchar(80)“”The users email address.
titlevarchar(50)NULLThe user title. If this field is empty, the title from the user's usetgroup will be used.
realnamevarchar(40)NULLThe real name of the user.
urlvarchar(100)NULLThe website of the user.
jabbervarchar(80)NULLThe Jabber address of the user.
icqvarchar(12)NULLThe Icq address of the user.
msnvarchar(80)NULLThe MSN address of the user.
aimvarchar(30)NULLThe Aim address of the user.
yahoovarchar(30)NULLThe Yahoo! address of the user.
locationvarchar(30)NULLThe location of the user. This can be a country, city or something else.
signaturetextNULLThe contents of the users signature.
disp_topicstinyint(3)NULLThe number of topics to display per page, or the forum default o_disp_topics_default (see $pun_config) if NULL.
disp_poststinyint(3)NULLThe number of posts to display per page, or the forum default o_disp_posts_default (see $pun_config) if NULL.
email_settingtinyint(1)1The level of privacy for the users email address. 0 = Show email address to other users, 1 = Hide email address but allow others users to send emails via the forums, 2 = Hide email address and don't allow other users to send emails.
notify_with_posttinyint(1)0Should a plain-text version of the post be included in subscription emails to the user?
auto_notifytinyint(1)0Should the user automatically be subscribed to their own posts?
show_smiliestinyint(1)1Should smilies in posts be shown to the user?
show_imgtinyint(1)1Should images in posts be shown to the user?
show_img_sigtinyint(1)1Should images in signatures be shown to the user?
show_avatarstinyint(1)1Should avatars be shown to the user?
show_sigtinyint(1)1Should signatures to shown to the user?
timezonefloat0The users timezone.
dsttinyint(1)0Is the user currently observing daylight saving time?
time_formattinyint(1)0The time format that the user uses.
date_formattinyint(1)0The date format that the user uses.
languagevarchar(25)“English”The language that should be used for this user.
stylevarchar(25)“Air”The name of the style that should be used for this user.
num_postsint(10)0The number of posts the user has made. Note: This is the number made, not the number that currently exist (i.e. when a post is deleted this isn't decremented).
last_postint(10)NULLA UNIX timestamp representing the time the user last made a post.
last_searchint(10)NULLA UNIX timestamp representing the time the user last performed a search.
last_email_sentint(10)NULLA UNIX timestamp representing the time the user last sent an email via the forums.
registeredint(10)0A UNIX timestamp representing the time the user registered.
registration_ipvarchar(39)“0.0.0.0”The IP address used by the user when registering.
last_visitint(10)0A UNIX timestamp representing the time of the users last visit.
admin_notevarchar(30)NULLA note that the administrator has entered.
activate_stringvarchar(80)NULLA temporary storage string for new passwords and new e-mail addresses.
activate_keyvarchar(8)NULLA temporary storage string for new password and new e-mail address activation keys.