SmartFAQ is developed by The SmartFactory (https://www.smartfactory.ca), a division of InBox Solutions (https://www.inboxsolutions.net)

How do I access a module's configuration settings?
Suppose that a parameter named 'foo' is defined in /modules/bar/xoops_version.php:

$modversion['config'][-]['name'] = 'foo';


1) To access this setting from within the module you use:

global $xoopsModuleConfig// needed only if within a function
echo "The  current value of 'foo' is: " $xoopsModuleConfig['foo'];


2) To access this setting anywhere, such as in a block, you use:

$module_handler =& xoops_gethandler('module');
$module         =& $module_handler->getByDirname('bar');
$config_handler =& xoops_gethandler('config');
$moduleConfig   =& $config_handler->getConfigsByCat(0$module->getVar('mid'));
echo 
"The  current value of 'foo' is: " $moduleConfig['foo'];


The comments are owned by the author. We aren't responsible for their content.


Login

Who's Online

165 user(s) are online (7 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 165


more...

Donat-O-Meter

Stats
Goal: AU$15.00
Due Date: Jun 30
Gross Amount: AU$0.00
Net Balance: AU$0.00
Left to go: AU$15.00
Make donations with PayPal!

Did you know ?

you can reduce website spam fairly easily.

Random question

What's the maximum password length that Xoops will accept for my users?