Plugin API

From GeeklogWiki
Revision as of 07:35, 24 May 2009 by Dirk (talk | contribs) (Search API)

Jump to: navigation, search

Geeklog's Plugin API defines the interface between the core Geeklog code and the plugins. From Geeklog's point of view, all the Plugin API functions are called PLG_something, which will result in a function plugin_something_foo being called in the "foo" plugin (if it exists - all the API functions are optional).

For details about Plugin API functions that are not documented yet, please refer to the documented source code of lib-plugins.php


Installation

API Function Description
plugin_autouninstall_ Plugin should provide data for uninstallation
plugin_chkVersion_ Called to check if a plugin upgrade is required
plugin_enablestatechange_ Inform plugin that it's about to be enabled or disabled
plugin_install_ (not currently used)
plugin_migrate_ Site migration underway; plugin should migrate its data
plugin_uninstall_ Plugin should uninstall itself
plugin_upgrade_ Plugin should upgrade itself


Moderation / Submission

API Function Description
plugin_ismoderator_ Check to see if the current user is a moderator for this plugin
plugin_itemlist_ Provide information to build the list of items in the plugin's submission queue
plugin_moderationapprove_ Approve an item in the plugin's submission queue
plugin_moderationdelete_ Remove an item from the plugin's submission queue
plugin_moderationvalues_ Set plugin-specific moderation values
plugin_savesubmission_ Save an item in the plugin's submission queue
plugin_submissioncount_ Return the number of items in the plugin's submission queue
plugin_submit_ Display the plugin's submission form

Also see Adding Moderation Capability.


Comments

API Function Description
plugin_commentPreSave_ Called before a comment is saved
plugin_deletecomment_ Delete a comment
plugin_displaycomment_ Display one or several comment(s)
plugin_getcommenturlid_ Provide URL of page to view comments and the unique identifier
plugin_savecomment_ Save a comment

Note that these are the only Comment API functions still in use. Also see Integrating the Comment Engine.


Statistics

API Function Description
plugin_showstats_ Provide statistics information (summary and specifics)
plugin_statssummary_ Provide statistics for the summary only

Also see Extending Site Statistics with your plugin and Stats Function.


Search

API Function Description
plugin_dopluginsearch_ Perform search (v1 API) or provide search details and let Geeklog perform the search (v2 API)
plugin_searchtypes_ Provide entries for the "type" dropdown on the Advanced Search page
plugin_supportsexpandedsearch_ (not used any more)

Plugin authors are encouraged to Use Geeklog's Improved Search Engine, available as of Geeklog 1.6.0.

For backward compatibility with older Geeklog versions, also see Using Geeklog's Search Engine and Search Functions.


UI and Templates

User

Feeds

Spam Filter

Misc