Fork me on GitHub

Obtaining module information  Bottom

  • MAybe a little off thread, but a module I am designing requires the version info from pnversion - I have no trouble getting this when the module is active, but I also need the info for the blocks as well, so at times a different module is loaded and I can't use the $GLOBALS['modinfo']['version'] global.

    I looked in the credits module and found that it was done by including the pnverison file of the module like this:


    include 'modules/mymodule/pnversion.php';
    $version = $modversion['version'];

    Now this works fine, but I am wondering if this should be done with a pnModDBInfoLoad('<modname>'); type call - anyone know? MAybe it could be done like this for pntables as well or would that cause a conflict?

    -Lobos

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment</modname>
  • Lobos,

    Yes - off topc ;) .... but the API you should look at is pnModGetInfo - it's not everything from pnversion.php but the info that's stored in the DB about the module.

    The credits module directly accesses pnversion.php for other reasons but, in general, there should be no reason to do so.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Ok thanks Mark, but I don't seem to get much out of this function:

    $minfo = pnModGetInfo('mymodule');

    $output->text(print_r($minfo));

    only give me a value of 1

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • oops I need to get the modid:

    $modid = pnModGetIDFromName('mymodule');
    $minfo = pnModGetInfo($modid);

    $output->text($minfo[version]);

    Works a charm, thanks man :)

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • Lobos,

    Cool....

    Most of the module functions rely on the module id rather than the name since name can be fairly variable (e.g. Example vs example vs ExAmPlE etc.).

    -Mark

    --
    Visit My homepage and Zikula themes.

This list is based on users active over the last 60 minutes.