1
highlander
$xoopsModuleConfig is driving me nuts !
  • 2005/7/12 13:17

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


Hi All,

I am attempting to wirte a module and have become stuck on the module config options.

In xoops_version.php I have the following :
$modversion['config'][1]['name'] = 'pics';
$modversion['config'][1]['title'] = '_MI_PED_PICS';
$modversion['config'][1]['description'] = '_MI_PED_PICS_DESC';
$modversion['config'][1]['formtype'] = 'yesno';
$modversion['config'][1]['valuetype'] = 'int';
$modversion['config'][1]['default'] = 0;
(shows up nicely in the admin side)

in my index.php I check for the value and assign it to the template :
$pic $xoopsModuleConfig['pics'];
$xoopsTpl->assign("pics"$pic);


"Smarty debug" shows me the value for "pics" is always 1. But I can see it is 0 in the database (prefix_config).
I can change the value on the admin side (yes or no) but it stays the same (value:1) once it reaches the template.
"Echo"ing $pic does not show any value at all.

I have also tried Herve's "getmoduleoption"-snippet with exactly the same results.

Does anyone know what is going on here ???
How do I get admin variables (yes/no in my case) into my template ??

Kind regards,
A confused Highlander
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
http://www.AnimalPedigree.com

2
highlander
Re: $xoopsModuleConfig is driving me nuts !
  • 2005/9/28 21:04

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


OK,

I've foud the problem (an solution ages ago but forget to post them here.

Turns out I had forgotten the :
global $xoopsModuleConfig;


I hope this will help someone else when they have a go at their first module !

Kind regards,
Highlander
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
http://www.AnimalPedigree.com

Login

Who's Online

125 user(s) are online (102 user(s) are browsing Support Forums)


Members: 0


Guests: 125


more...

Donat-O-Meter

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

Latest GitHub Commits