- Moderated by:
- Support Team
-
- rank:
-
Helper
- registered:
- December 2003
- Status:
- offline
- last visit:
- 10.10.06
- Posts:
- 172
I just started digging through the great module document from the forums and I have a silly question.
Is it possible to call the function of a module from a different module? I have a module that I would like to be able to take the info and post it as news. Rather than pulling the function, can I just call the function directly if permissions permit?
Thanks! -
- rank:
-
Steering Committee
- registered:
- December 2002
- Status:
- offline
- last visit:
- 23.11.08
- Posts:
- 13415
You may need to do a pnModLoad() call first. Check the API guide.
--
Regards,
Simon
itbegins.co.uk - Zikula Consulting
Please read the Support Guide -
- rank:
-
Helper
- registered:
- December 2003
- Status:
- offline
- last visit:
- 10.10.06
- Posts:
- 172
Hammerhead, Which guide would that be? I've found two on postnuke.com and neither seem to have much outside a list of the API's themselves. Is there a better location to read about the pnAPI?
Thanks,
--
Atomm Nihilo
/www.gamenuke.org" title="PostNuke Resources For Gamers">/www.rtfg.net" title="Read The F#$%ing Google!"> -
- rank:
-
Helper
- registered:
- November 2002
- Status:
- offline
- last visit:
- 29.05.07
- Posts:
- 203
Actually, I noticed this when I was documenting the Example module. The API docs say you must call pnModLoad() before calling pnModAPIFunc(), but the Example module doesn't. I was going to dig into this a little further, but I haven't had time yet. Another example is in the RSS module, which calls functions from the Categories module, but doesn't call pnModLoad(). -
- rank:
-
Steering Committee
- registered:
- December 2002
- Status:
- offline
- last visit:
- 23.11.08
- Posts:
- 13415
Quote
Actually, I noticed this when I was documenting the Example module. The API docs say you must call pnModLoad() before calling pnModAPIFunc(), but the Example module doesn't.
All the docs have yet to be updated to reflect this, you no longer have to explicitly load the API for your module before calling API functions, as the core handles this automatically. Additionally, all system modules (which probably includes Categories) are loaded by the core already and so don't need explicit loading. The only modules you must now load before calling are non-system modules.
--
Regards,
Simon
itbegins.co.uk - Zikula Consulting
Please read the Support Guide -
- rank:
-
Helper
- registered:
- December 2003
- Status:
- offline
- last visit:
- 10.10.06
- Posts:
- 172
This is good stuff. THANK YOU!
--
Atomm Nihilo
/www.gamenuke.org" title="PostNuke Resources For Gamers">/www.rtfg.net" title="Read The F#$%ing Google!"> -
- rank:
-
Helper
- registered:
- December 2003
- Status:
- offline
- last visit:
- 10.10.06
- Posts:
- 172
I've started working on this, but it is not working how I understood it. Would someone tell me if this looks right?
Code
$output .= pnModAPIFunc('AddStory',
'admin',
'adminStory');
The error I receive is Error! Called unknown function: AddStory_adminapi_adminStory()
Thanks!
--
Atomm Nihilo
/www.gamenuke.org" title="PostNuke Resources For Gamers">/www.rtfg.net" title="Read The F#$%ing Google!"> -
- rank:
-
Helper
- registered:
- December 2003
- Status:
- offline
- last visit:
- 10.10.06
- Posts:
- 172
I've started working on this, but it is not working how I understood it. Would someone tell me if this looks right?
Code
$output .= pnModAPIFunc('AddStory',
'admin',
'adminStory');
The error I receive is Error! Called unknown function: AddStory_adminapi_adminStory()
Thanks!
--
Atomm Nihilo
/www.gamenuke.org" title="PostNuke Resources For Gamers">/www.rtfg.net" title="Read The F#$%ing Google!"> -
- rank:
-
Helper
- registered:
- December 2003
- Status:
- offline
- last visit:
- 10.10.06
- Posts:
- 172
DOH!
Thanks for the info....
--
Atomm Nihilo
/www.gamenuke.org" title="PostNuke Resources For Gamers">/www.rtfg.net" title="Read The F#$%ing Google!"> -
- rank:
-
Moderator
- registered:
- March 2002
- Status:
- offline
- last visit:
- 26.08.08
- Posts:
- 7720
Gamersradio,
Just FYI - modules that are API compliant are identified by a type 2 entry in the type field of the modules type and have functions in pnuser(API).php and pnadmin(API).php.
PostNuke 0.8x will be fully pnAPI compliant - absolutely no legacy module code at all....
-Mark -
- rank:
-
Helper
- registered:
- May 2005
- Status:
- offline
- last visit:
- 20.11.08
- Posts:
- 129
What is the time line for PostNuke 0.8? I am especially interested in the improved speed of loading. :D
Don't get me wrong, I am not complaining. I am very happy with the pace of development and the thinking behind the gradual roll-out. Just wondering. -
- rank:
-
Steering Committee
- registered:
- December 2002
- Status:
- offline
- last visit:
- 23.11.08
- Posts:
- 13415
Quote
What is the time line for PostNuke 0.8? I am especially interested in the improved speed of loading.
There's never a long term timeframe for releases I'm afraid, however we'd like to see a .8 Mile Stone release to give developers a chance to test their third party code sometime in this quarter, preferably earlier rather than later.
--
Regards,
Simon
itbegins.co.uk - Zikula Consulting
Please read the Support Guide
