PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
load a block
bool pnBlockLoad(modname, block);
pnBlockLoad() loads a block into the PostNuke system.
This function returns true if the module loaded successfully, and 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 ID_NOT_EXIST if the block is unknown. This function raises MODULE_FILE_NOT_EXIST if the block file doesn't exist.
The PostNuke API keeps track of what blocks have been loaded, so multiple calls to pnBlockLoad() 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 display the block automatically, this must be carried out by a separate call to pnBlockShow().
// Load the past article block from the News module
if (!pnBlockLoad('News', 'past')) {
die('Could not load past articles block');
}
Previous |
Next |