1
louisg1
checking for module version
  • 2008/10/15 7:53

  • louisg1

  • Just popping in

  • Posts: 57

  • Since: 2004/9/8 4


i am making a patch for wfchannel and there are a few things i am trying to do.

there is an upgrade notice on wfchannel i want to put an if statement to where it can check the module version number. how can do i make the if statement read the module. in MySQL it goes by dirname varable so how do i tell the if statment to check that version.


2
louisg1
Re: checking for module version
  • 2008/10/15 8:34

  • louisg1

  • Just popping in

  • Posts: 57

  • Since: 2004/9/8 4


basically i only want to enable to something to only work if the XOOPS version is prior to 2.3 i know i need to do it by if statements but i don't know how to check the XOOPS version in the code.

3
ghia
Re: checking for module version
  • 2008/10/15 10:19

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Adapted from snippet from News.
le="color: #000000"><?php $x23=false; $xv=str_replace('XOOPS ','',XOOPS_VERSION); if(substr($xv,2,1)=='3') { $x23=true; }

4
louisg1
Re: checking for module version
  • 2008/10/15 14:23

  • louisg1

  • Just popping in

  • Posts: 57

  • Since: 2004/9/8 4


i don't think that is what i am looking for.

i need 2 different codes

1. that can check the wfchannel version number
2. XOOPS version number check

i will be using the smarty {IF} {/IF} as well as a normal if statement

5
stefan88
Re: checking for module version
  • 2008/10/17 13:24

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

you may try something like:

le="color: #000000"><?php $module_handler =& xoops_gethandler('module'); $mod_modinfo =& $module_handler->getByDirname('wfchannel'); $mod_modversion = $mod_modinfo->getVar( 'version' );


Quote:
i will be using the smarty {IF} {/IF} as well as a normal if statement


then maybe you will have to use smarty plugin.

..