User Tools

Site Tools


Nucleus CMS SQL Table Reference

This document contains information on the fields inside the Nucleus database tables.

The structure as presented here is for Nucleus v3.22, August 21, 2005.

Color codes

This document uses some visual styles to indicate the type of columns. An overview is listed below:

primary Primary keys
foreignForeign keys (click to go to the references value in other columns). Please note that MySQL does not enforce foreign key restrictions.
toremoveTables/columns that will probably be removed in upcoming Nucleus version, in favor of plugins that provide the same functionality.
fulltextThere is a fulltext index on the column (used for searches).


Column Name Type Default Description
bnumberint(11) Blog ID
bnamevarchar(60)''Blog Name
bshortnamevarchar(15)''Short Blog Name (as used in skinvars <%blog%> etc.)
bdescvarchar(200)NULLBlog Description
bcommentstinyint(2)'1'Enable comments (1=true, 0=false)
bmaxcommentsint(11)'0'Maximum amount of comments to show on index skintypes (inline comments). The default value (0) means that there is no limit. If you don't use inline comments, you shouldn't edit this.
btimeoffsetdecimal(3,1)'0.0'Time offset to use. The items will be stored in the database using the correct time (server time+offset).
bnotifyvarchar(60)NULLNotify e-mail address. On certain events (see bnotifytype for the exact definition of these events), a notification e-mail is sent out to this e-mail address.
burlvarchar(100)NULLBlog URL
bupdatevarchar(60)NULLUpdate file that needs to be altered each time a new item is posted to the weblog. Its an absolute path of a file on the server.
bdefskinint(11)'1'Default skin to use when displaying this weblog
bpublictinyint(2)'1'Allow comments by non-registered members? (1=true/0=false)
bsendpingtinyint(2)'0'Send a ping to on update? (1=true/0=false)
bconvertbreakstinyint(2)'1'Convert line breaks to <br />? (1=true/0=false)
bdefcatint(11)NULLDefault category. This category will be selected by default when no other category is selected.
bnotifytypeint(11)'15'Which events to send notification e-mails on (see bnotify for the specification of the e-mail address). It's a combination of three values (multiply the values to get the notify type):
33: New comment
55: New karma vote
77: New item
Default = New comments & New karma votes (3*5=15)
ballowpasttinyint(2)'0'Allow backdating of items and editing the timestamp of an item (1=true/0=false)
bincludesearchtinyint(2)'0'Always include in search queries, even if the query is on another blog (1=true/0=false)


Column Name Type Default Description
catidint(11) Category ID
cblogint(11)'0'Blog to which the category belongs
cnamevarchar(40)NULLCategory Name
cdescvarchar(200)NULLCategory Description


Column Name Type Default Description
inumberint(11) Item ID
ibodytext Body text
imoretext Extended text
iblogint(11)'0'Blog to which the item belongs to
iauthorint(11)'0'Member that is the author of the item
itimedatetime'0000-00-00 00:00:00'Item time (this is the corrected time, with offset already applies)
iclosedtinyint(2)'0'Is item closed? (1=true/0=false). When an item is closed, it's no longer possible to add new comments or cast 'karma votes'
idrafttinyint(2)'0'Is the item a draft version? Draft versions only show up in the admin area.
ikarmaposint(11)'0'Total amount of positive karma votes casted
ikarmanegint(11)'0'Total amount of negative karma votes casted
icatint(11)NULLCategory to which the item belongs


Column Name Type Default Description
cnumberint(11) Comment ID
cbodytext Comment text
cuservarchar(40)NULLAnonymous user name (only used when comment was placed by a non-member. For members, see cmember)
cmailvarchar(100)NULLE-mail address or URL (only used when comment was placed by a non-member. For members, see cmember)
cmemberint(11)NULLID of site member that placed the commend (0 for comments by non-members)
citemint(11)'0'Item ID to which the comment is attached
ctimedatetime'0000-00-00 00:00:00'Time of comment
chostvarchar(60)NULLHostname from where the comment was placed
cipvarchar(15)''IP address from where the comment was placed
cblogint(11)'0'Blog to which the comment belongs (this is redundant information)


Column Name Type Default Description
mnumberint(11) Member ID
mnamevarchar(16)''Display name (the one used to login)
mrealnamevarchar(60)NULLFull name
mpasswordvarchar(40)''password (md5 hash)
memailvarchar(60)NULLE-mail address. This should always be a valid address.
murlvarchar(100)NULLURL of members site
mnotesvarchar(100)NULLExtra notes (members can fill these out themselves)
madmintinyint(2)'0'Is super-admin? (1=true/0=false; super-admins have all rights; there must be at least one super-admin in the system)
mcanlogintinyint(2)'1'Can logon to admin area? (1=true/0=false)
mcookiekeyvarchar(40)NULLA copy of the key that is stored in the users cookie. This key is used to log on. When a member logs on, a random cookiekey is generated. One copy goes into the database, another one goes into a cookie on the users computer. (together with the username).
deflangvarchar(20)''Language file to use for this member. When empty, uses the default site language.


For each team member of a blog, there is a row in this table.

Column Name Type Default Description
tmemberint(11)'0'Member ID
tblogint(11)'0'Blog of which member is on team
tadmintinyint(2)'0'Is blog admin? (0=false/1=true; each blog must have at least one admin)


Column Name Type Default Description
pidint(11) Plugin ID
pfilevarchar(40)''Filename (e.g. NP_CommentControl) of plugin. This must be a file in the plugins directory (.php extension).
porderint(11)'0'Order in which the plugins are called, and in which they are displayed on the plugins page. A lower order number places the plugin earlier in the list.


A cache that remembers which plugins are registered to which events. Thsi information is stored to avoid having to load all plugins on each requests just to find out which events they want to have. More info on plugins events.

Column Name Type Default Description
pidint(11)'0'Plugin ID
eventvarchar(40)NULLName of event


Values for the plugin options. See the nucleus_plugin_option_desc table for the definition of the options itself.

Column Name Type Default Description
oidint(11) Identification of the option (See the nucleus_plugin_option_desc table)
ovalueTEXT''Value of the option
ocontextidint(11)'0'Semantics depend on the option context type,
* global context: not used
* blog context: blog id
* category context: category id
* member context: member id


For each option created by a plugin, a row is present in this table.

Column Name Type Default Description
oidint(11) Option ID. Used from nucleus_plugin_option
opidint(11)'0'Plugin to which the option belongs
onamevarchar(20)''Name of the option
ocontextvarchar(20)''Context of the option (global, blog, category, member)
odescvarchar(255)NULLOption description
otypevarchar(20)NULLoption type. See plugin documentation.
odeftext Default value for options
oextratext Extra data needed for some option types (e.g. select option type)


Column Name Type Default Description
sdescint(11)'0'Reference to the skin description
stypevarchar(20)''Skinpart type
* index
* item
* archive
* archivelist
* search
* error
* member
* imagepopup
scontenttext Contents of the skinpart


Column Name Type Default Description
sdnumberint(11) Skin ID
sdnamevarchar(20)''Name of skin
sddescvarchar(200)NULLSkin description
sdtypevarchar(40)'text/html'mimetype of skin
sdincmodevarchar(10)'normal'Include mode
* normal
* skindir
sdincprefvarchar(50)''Prefix to use when including files


Column Name Type Default Description
tdescint(11)'0'Reference to template description info
tpartnamevarchar(20)''Name of template part
tcontenttext Contents of templatepart


Column Name Type Default Description
tdnumberint(11) Template ID
tdnamevarchar(20)''Name of template
tddescvarchar(200)NULLTemplate description


Column Name Type Default Description
timestampdatetime'0000-00-00 00:00:00'Time of action
messagevarchar(255)''Action message


Nucleus stores some global options in the nucleus_config table. They can be accessed at any time using $CONF['OptionName'] (the values are read on each request and stored in a global array named $CONF)

Column Name Type Default Description
namevarchar(20)''Option name
valuevarchar(128)NULLOption value

Available Options

An overview of available options is given below:

Options for yes/no options are represented using 1/0 (1=yes/true, 0=no/false)

Name Default Value Description
DefaultBlog1Default weblog. This is the blog that will be used when no other blog has been specified in the request.
AdminEmail E-mail address of site administrator
IndexURL URL of website. Should end with a slash.
LanguageenglishLanguage file to use by default. A file languagename.php must exist in the languages directory.
SessionCookie0Use session cookie instead of cookies with a lifetime of one month?
AllowMemberCreate0Allow visitors to create their own account?
AllowMemberMail1Allow members to send messages to each other through the member mail forms (e-mail addresses remain hidden)
SiteName Name of the website
AdminURL URL of admin area. Should end with a slash.
NewMemberCanLogon1Can newly registered members login right away? If not, the administrator will have to change their 'can login' option first
DisableSite0Is the website disabled? If so, only the administrator can access it. All other visitors are redirected to DisableSiteURL.
DisableSiteURL An URL to redirect to when the site is disabled.
LastVisit0Save 'Last Visit' cookies
MediaURL URL of media folder. Should end with a slash.
AllowedTypesjpg, jpeg, gif, mpg, mpeg, avi, mov, mp3, swf, pngFiletypes that can be uploaded
AllowLoginEdit0Allow members to edit their login name and password?
AllowUpload1Allow file uploads?
DisableJsTools2Style of the javascript toolbar:
00: full featured (IE)
11: toolbar disabled
22: simpler (Gecko)
CookiePath/Path to set cookie on
CookiePrefix String to prefix cookie names with. This is useful when multiple Nucleus installs are on the same domain, as it prevents login sessions to interfere with each other.
CookieDomain Domain to set cookie on
CookieSecure0Secure cookie (https)
MediaPrefix1If true, the uploaded files get the current date in their filename.
MaxUploadSize1048576Max. size of uploaded files (in bytes)
NonmemberMail0Allow non-members to send e-mail messages to site members?
PluginURL URL of plugin folder. Should end with a slash.
ProtectMemNames1When this option is enabled, non-logged in members cannot add comments using the same name as registered members. The reason to do this would be to avoid guest impersonating members.
BaseSkin1The option tells Nucleus which skin to fall back to when no such decision can be automatically made. This happens when skin parts are empty, when no blog or skin is implicitly/explicitly selected.
SkinsURL URL of skins folder. Should end with a slash.
ActionURL URL of action.php script.
URLModenormaleither normal or pathinfo
DatabaseVersion250Last Nucleus version for which the database structure has been updated (introduced in Nucleus v2.5)


Nucleus uses the nucleus_tickets to prevent against certain security issues. In particular: each action on the admin area that affects the settings or database contents, requires a ticket. These tickets are generated when requesting an admin area page and passed along with the form. Tickets are destroyed one hour after their creation.

Column Name Type Default Description
ticketvarchar(40) Unique ticket, valid for one particular member. A typical ticket looks like this: 65303a785423b4d53c7b3e6579766f26
memberint(11) Member for which this ticket is valid.
ctimedatetime Time of ticket creation. A ticket is valid no longer than one hour.


When a new member registers, Nucleus doesn't allow that member to log in before his account is activated. This activation is done by sending out an activation link to the members email address. The nucleus_activation table keeps track of the activations that are in progress.

Column Name Type Default Description
vkeyvarchar(40) Activation key. This key needs to be passed to the member activation code. A typical key looks like this: 41cf637d4fbeeff954b4ca70b8bde9dd
vmemberint(11) Member which needs to be activated.
vtimedatetime Time at which activation key was generated. Each activation key is valid no longer than 2 days.
vtypevarchar(15) Type of activation.
* forgot: member forgot his password.
* register: new member registration.
* addresschange: member changed his e-mail address.
vextravarchar(128) Extra information. For an addresschange type of activation, this contains oldemailaddress/x with x either 0 or 1 and refering to the previous value of the mcanlogin field in the member table. (untill fully re-activated, a user cannot login)


This table will most likely be removed in future Nucleus version, in favor of plugins with the same functionality.

This table keeps track of IP addresses that have already voted for an item. This way, each IP address can cast only one vote.

Column Name Type Default Description
itemidint(11)'0'Item ID
ipchar(15)''IP address of voter


This table will most likely be removed in future Nucleus version, in favor of plugins with the same functionality.

IP bans. These people cannot comment or cast karma votes.

Column Name Type Default Description
iprangevarchar(15)''IP 'range'. This can either be a full IP address or part of an IP address (starting from the left) to ban ranges
reasonvarchar(255)''A message with the reason why someone was banned. This message will be shown when they try to add a comment/cast a vote.
blogidint(11)'0'Blog for which the ban is active
nupusi/nucleus/sqltables.txt · Last modified: 2008/12/06 13:56 (external edit)