Difference between revisions of "Misc. Functions"
From GeeklogWiki
(Added space and improved phrase) |
m (→Misc. Functions: No topic id (as written in lib-plugins.php)) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | The following is a list of (optional) functions for misc. purposes. | + | The following is a list of (optional) functions for misc. purposes: |
+ | |||
+ | ==Misc. Functions== | ||
<table cellpadding="2" cellspacing="2" border="1" width="90%" align="center"> | <table cellpadding="2" cellspacing="2" border="1" width="90%" align="center"> | ||
Line 10: | Line 12: | ||
<td valign="top" class="codeheader">plugin_centerblock_<plugin name></td> | <td valign="top" class="codeheader">plugin_centerblock_<plugin name></td> | ||
<td valign="top" class="code">Plugins can display a block in the site's center area, i.e. among the stories. This function is called several times during rendering of the site's index page. The parameters will tell the plugin where on the index page the block would appear.<br> | <td valign="top" class="code">Plugins can display a block in the site's center area, i.e. among the stories. This function is called several times during rendering of the site's index page. The parameters will tell the plugin where on the index page the block would appear.<br> | ||
− | Parameters are <code>where</code> (1 = top of page, 2 = after the featured story, 3 = bottom of page and 0 = full page), <code>page | + | Parameters are <code>where</code> (1 = top of page, 2 = after the featured story, 3 = bottom of page and 0 = full page), <code>page</code> (page number) and the <code>topic</code> (topic id. None = means the user is in the front page). |
<br>As mentioned, the first parameter, <code>where</code>, can also be 0 which means that the plugin can take over the entire page if it wants to and thus make the CMS just serve as infrastructure for the plugin (of course, in this case it will have to return the HTML for the <em>entire page</em>, i.e. including site header and footer).<br> | <br>As mentioned, the first parameter, <code>where</code>, can also be 0 which means that the plugin can take over the entire page if it wants to and thus make the CMS just serve as infrastructure for the plugin (of course, in this case it will have to return the HTML for the <em>entire page</em>, i.e. including site header and footer).<br> | ||
The function should return the complete HTML for the block (including header and footer) or an empty string.</td> | The function should return the complete HTML for the block (including header and footer) or an empty string.</td> |
Latest revision as of 18:55, 25 December 2008
The following is a list of (optional) functions for misc. purposes:
Misc. Functions
Function | Description of Function |
---|---|
plugin_centerblock_<plugin name> | Plugins can display a block in the site's center area, i.e. among the stories. This function is called several times during rendering of the site's index page. The parameters will tell the plugin where on the index page the block would appear. Parameters are |
plugin_getheadercode_<plugin name> | Plugins may add additional lines to the site's <head> tag by implementing this function, e.g. Javascript functions or additional Meta tags.The function should return a concatenated string of all its extra header code. |
plugin_whatsnewsupported_<plugin name> | Plugins can add their own section to Geeklog's What's New block by implementing this and the following function. The function should return an array of 2 strings. The first string is used as the headline for the plugin's section in What's New and the second string is used to indicate the timespan that the entries in this section cover (e.g. "last 2 weeks"). |
plugin_getwhatsnew_<plugin name> | This function should return the actual new entries to be listed in the What's New block (as an array) or a string to be displayed in case there are no new entries. |