XoopsModuleConfig is a global variable that allows system-wide preferences to be stored and used within your module. The options are initially instantiated through inclusion in the xoops_version.php file in the module's directory. These are retrieved and become available when the mainfile.php is included. Defining
Within your xoops_version.php file, include this information for each configuration variable:
$modversion['config'][1] = array(
'name' => 'config_name',
'title' => 'Title',
'description' => 'Description',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1);
or this way:
$modversion['config'][1]['name'] = 'config_name';
$modversion['config'][1]['title'] = 'Title';
$modversion['config'][1]['description'] = 'Description';
$modversion['config'][1]['formtype'] = 'yesno';
$modversion['config'][1]['valuetype'] = 'int';
$modversion['config'][1]['default'] = 1;
Potential values for 'formtype':
'yesno'
'select'
'select_multi'
'group'
'group_multi'
'textbox'
'textarea'
'user'
'user_multi'
'timezone'
'language'
Potential values for 'valuetype':
'int'
'float'
'text'
'array'
All items with formtype 'multi_xxx' must have the valuetype 'array'.
Each set must be numbered differently. You can leave the number off if you use the first listing style.
Useful Functions
* To retrieve the value of the configuration variable:
$xoopsModuleConfig['config_name']
* Still need to figure out how to change the value and update it in the database.
Note: concerning performance issue, only necessary configs should be registered to $xoopsConfig.



![[Main Page]](/modules/mediawiki/images/mediawiki.png)





