1
kerkyra
xoopsModuleConfig question
  • 2008/6/9 14:37

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hi, can somebody tell me why the following line is not working when run from a php file not in the root dir of the module

$xoopsTpl->assign('type',$xoopsModuleConfig['type']);

it is tested and running fine from the root of the module!

i have set the global xoopsmoduleconfig in the function of the file but refuses to find the variable! Any ideas??
whttp://www.guidemap.gr - Beta is out...

2
frankblack
Re: xoopsModuleConfig question
  • 2008/6/9 15:18

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


$xoopsModuleConfig only returns the values of the current module and not from another (I think so)?!

Maybe you have to add some more code your php-file and assign it to your template. Following code is just a guess:

$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname("nameoftheothermodule");
$config_handler =& xoops_gethandler('config');
$moduleConfig =& $config_handler->getConfigsByCat(0$module->getVar('mid'));
$xoopsTpl->assign('type',$moduleConfig['type']);


Non-tested-code, so no responsibility taken...

Notice: nameoftheothermodule should be replaced by the name of the module you want to take the config from, of course.

3
kerkyra
Re: xoopsModuleConfig question
  • 2008/6/10 8:26

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i tried the code you suggested mate but did seem to work!
i am trying to get the current module config value!
The php file is in a subfolder within the folder of the module!

In the admin folder and the root of the module it works fine! In this new folder i created it does not...
whttp://www.guidemap.gr - Beta is out...

4
hervet
Re: xoopsModuleConfig question
  • 2008/6/10 8:39

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Hello Frank

Quote:

frankblack wrote:
$xoopsModuleConfig only returns the values of the current module and not from another (I think so)?!

You are true.

@kerkyra
Look at the News module, in include/functions.php there is a function (news_getmoduleoption) to get module's options.
http://xoops.instant-zero.com/modules/mydownloads/singlefile.php?cid=2&lid=8

5
kerkyra
Re: xoopsModuleConfig question
  • 2008/6/10 9:12

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


thanks mate i did use that class and worked like a charm! If the class is included in the directory i was working on though it idnt work if included in the functions.php it works fine. thanks for the help :)
whttp://www.guidemap.gr - Beta is out...

6
banesto
Re: xoopsModuleConfig question
  • 2009/1/18 20:06

  • banesto

  • Just popping in

  • Posts: 61

  • Since: 2005/1/24


worked like a charm! Thanks a lot! helped me a lot in making module block, which uses block configuration data!
where's my red bull!

Login

Who's Online

172 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

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

Latest GitHub Commits