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>
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Obtaining module information
-
- Rank: Expert
- Registered: Dec 02, 2002
- Last visit: Apr 30, 2010
- Posts: 1474
-
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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. -
- Rank: Expert
- Registered: Dec 02, 2002
- Last visit: Apr 30, 2010
- Posts: 1474
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 -
- Rank: Expert
- Registered: Dec 02, 2002
- Last visit: Apr 30, 2010
- Posts: 1474
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 -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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.
- Moderated by:
- Support
