PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
load module
int pnModLoad(modname, type);
pnModLoad() loads extra display functions into the PostNuke system to extend its abilities.
The well-known name of a module to load
The type of module functions to load; currently one of 'user' or 'admin'.
This function returns true if the module loaded successfully. This function returns void if an exception was raised.
This function raises BAD_PARAM if you pass an invalid parameter. This function raises DATABASE_ERROR if an error occurs while querying data. This function raises MODULE_FILE_NOT_EXIST if a module file doesn't exist. This function raises MODULE_NOT_EXIST if the module doesn't exist.
The PostNuke API keeps track of what modules have been loaded, so multiple calls to pnModLoad() with the same parameters will return true each time.
For more information on well-known names of modules please refer to the documentation for pnModGetVar()
This function does not load in the relevant API functionality for this module automatically, this must be carried out by a separate call to pnModAPILoad().
// See if News module is available
if (pnModAvailable('News')) {
// Load the News module
if (!pnModLoad('News', 'user')) {
die('Could not load News module');
}
}
Previous |
Next |