1
Hello,
I am facing the following problem.
1) In the xoops_version.php I have added the follwing code to get all the existing group in my module preferences :
global $xoopsDB, $xoopsUser, $xoopsModule, $xoopsModuleConfig;
$member_handler =& xoops_gethandler('member');
$xoopsgroups = &$member_handler->getGroupList();
foreach ($xoopsgroups as $key=>$group) {
$groups[$group] = $key;
}
$modversion['config'][4]['name'] = 'groups';
$modversion['config'][4]['title'] = '_MI_MYHOME_GROUPS';
$modversion['config'][4]['description'] = '_MI_MYHOME_GROUPS_DSC';
$modversion['config'][4]['formtype'] = 'select_multi';
$modversion['config'][4]['valuetype'] = 'array';
$modversion['config'][4]['options'] = $groups;
$modversion['config'][4]['default'] = $groups;
2) Then I try to get those value in my main index.php page as following:
$group = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
$groups = explode(" ", $xoopsModuleConfig["groups"]);
if (count(array_intersect($group,$groups)) > 0)
{
My code;
}
Unfortunatly, all I get as a result is a poor :
Notice [PHP]: Array to string conversion in file modules/myhome/index.php line 21
How can I convert the xoops_version.php to be used by the index.php code?