glFusion Wiki

Site Tools


PLG_ Plugin Interface Functions

The PLG_ functions provide a bridge between glFusion and its plugins. Generally, a plugin will not call the PLG_ functions directly, instead the plugin will implement the necessary plugin_ function to provide the integration with glFusion's functions and features.

There are some PLG_ functions that plugins may call directly to provide integration with other plugins. For example, the PLG_replaceTags() function may be used so the plugin can take advantage of other plugin's auto tags. Or, the PLG_itemSaved() function may be called to allow other plugins to be alerted that the plugin has saved an item to the database.

The PLG_ functions are defined in lib-plugins.php which is included in glFusion by default.

Function Plugin API Function Description
PLG_afterSaveSwitch n/a Forward the user depending on config setting after saving something
PLG_approveSubmission plugin_moderationapprove_ Approves an item from the submission queue for a plugin.
PLG_checkforSpam plugin_checkforSpam_ Allows plugins and Core glFusion Components to filter out spam.
PLG_chkVersion plugin_chkVersion_ Calls the plugin function to return the current version of code.
PLG_commentDelete plugin_deletecomment_ Plugin should delete a comment
PLG_commentEditSave plugin_editcomment_ Called when a plugin's comment is edited (and saved).
PLG_commentPreSave plugin_commentPreSave_ Allows plugins a chance to handle a comment before glFusion does.
PLG_commentSave plugin_savecomment_ Plugin should save a comment
PLG_createUser plugin_user_create_ This function will inform all plugins when a new user account is created.
PLG_deleteSubmission plugin_moderationdelete_ Deletes an item from the submission queue for a plugin.
PLG_deleteUser plugin_user_delete_ This function will inform all plugins when a user account is deleted.
PLG_displayAdBlock PLG_displayAdBlock($plugin, $counter) This function hooks into displaying an ad block every X iterations EXPERIMENTAL.
PLG_displayComment plugin_displaycomment_ Plugin should display [a] comment[s]
PLG_doSearch plugin_dopluginsearch_ Allows plugin the opportunity to do their search and return their results.
PLG_doSearchComment plugin_dopluginsearch_comment_ Allows plugin the opportunity to do their search on their comments and return their results.
PLG_enableStateChange plugin_enablestatechange_ Inform plugin that it is either being enabled or disabled.
PLG_feedUpdateCheck plugin_feedupdatecheck_ The plugin is expected to check if the feed content needs to be updated.
PLG_getAdminOptions plugin_getadminoption_ Show any plugin adminstrative options in the admin functions block
PLG_getBlocks plugin_getBlocks_ Gets glFusion blocks from plugins
PLG_getCCOptions plugin_cclabel_ Shows the option for all plugins at the top of the command and control center.
PLG_getConfigElementHelp plugin_getconfigelementhelp_ Ask plugin to return the help URL for a configuration element.
PLG_getCommentUrlId plugin_getcommenturlid_ Get view URL and name of unique identifier
PLG_getFeedContent plugin_getfeedcontent_ Get the content of a feed from the plugin.
PLG_getFeedElementExtensions plugin_feedElementExtensions_ Get extension tags for a feed.
PLG_getFeedExtensionTags plugin_feedExtensionTags_ Get meta tag extensions for a feed.
PLG_getFeedNames plugin_getfeednames_ Ask the plugin for a list of feeds it supports.
PLG_getFeedNSExtensions plugin_feedNSExtensions_ Get namespaces extensions for a feed.
PLG_getHeaderCode plugin_getheadercode_ This function is called from COM_siteHeader and will return additional header information.
PLG_getIcon plugin_geticon_ Get the URL of a plugin's icon
PLG_getItemInfo plugin_getiteminfo_ Ask plugin for information about one of its items
PLG_getMenuItems plugin_getmenuitems_ Gives plugins a chance to print their menu items in header
PLG_getModerationValues plugin_moderationvalues_ Sets the plugin-specific values needed by moderation.php to approve stuff.
PLG_getPluginStats plugin_statssummary_
Allow plugin to return stats
PLG_getSearchTypes plugin_searchtypes_ Gives each plugin the opportunity to put a value(s) in the 'Type' drop down box on the search.php page
PLG_getSubmissionCount plugin_submissioncount_ Asks each plugin to report any submissions they may have in their submission queue
PLG_getUserOptions plugin_getuseroption_ Show any plugin user options in the user block on every page
PLG_getWhatsNew plugin_whatsnewsupported_
Ask plugins if they want to add something to glFusion's What's New block.
PLG_getWhatsNewComment plugin_whatsnewcomment_ Ask plugins if they want to add any comments to the What's New block comment section.
PLG_groupChanged plugin_group_changed_ Called to inform plugins when a group's information has changed or a new group has been created.
PLG_handlePingComment plugin_handlepingoperation_
PLG_install plugin_install_ DEPRECIATED
PLG_invokeService service_action_ Invoke a service
PLG_isModerator plugin_ismoderator_ Checks to see if user is a plugin moderator
PLG_isOnPageLoad plugin_isOnPageLoad_ Plugin hook to Infinite Scroll - allows a plugin to set JavaScript to run when afterPageLoad() is called by the infinite scroll handler.
PLG_itemDeleted plugin_itemdeleted_ Called whenever glFusion removes an item from the database.
PLG_itemPreSave plugin_itemPreSave_ Allows plugins a chance to handle an item before glFusion does.
PLG_itemSaved plugin_itemsaved_ Called whenever glFusion saves an item into the database.
PLG_loginUser plugin_user_login_ Inform all plugins when a user logs in
PLG_logoutUser plugin_user_logout_ Inform all plugins when a user logs out.
PLG_outputFilter plugin_outputfilter_ Called immediately before displaying the output from articles and staticpages. Allows a plugin to filter or modify the final output.
PLG_profileBlocksDisplay plugin_profileblocksdisplay_ Plugins now get a chance to add their own blocks below the standard profile form.
PLG_profileBlocksEdit plugin_profileblocksedit_ DEPRECIATED
PLG_profileEdit plugin_profileedit_ Plugins now get a chance to add their own variables and input fields to the form.
PLG_profileExtrasSave plugin_profileextrassave_ DEPRECIATED
PLG_profileIconDisplay plugin_profileicondisplay_ NEW
PLG_profileSave plugin_profilesave_ Called when user's profile page is saved.
PLG_profileVariablesDisplay plugin_profilevariablesdisplay_ Plugins now get a chance to add their own variables to the profile
PLG_profileVariablesEdit DEPRECIATED
PLG_replaceSocialShare plugin_social_share_replacement_ Allows a plugin to replace the default Social Share block
PLG_replaceTags Parses auto tags in content
PLG_runScheduledTask plugin_runScheduledTask_ Check if plugins have a scheduled task they want to run.
PLG_saveSubmission plugin_savesubmission_ Plugin saves item to submission queue.
PLG_showCenterblock plugin_centerblock_ Display centerblock for a plugin
PLG_showModerationList Displays list of items in the submission queue.
PLG_showSubmitForm plugin_submit_ Displays the plugins submission form
PLG_spamAction plugin_spamaction_ Act on spam
PLG_supportAdBlock plugin_supportadblock_ Allows a plugin to inform if they support the PLG_displayAdBlock() API
PLG_supportingFeeds plugin_getfeednames_ Prepare a list of all plugins that support feeds.
PLG_templateSetVars plugin_templatesetvars_ Called to check if an plugin wants to set a template variable
PLG_uninstall plugin_autouninstall_
Tells a plugin to uninstall itself.
PLG_upgrade plugin_upgrade_ Upgrades a plugin. Tells a plugin to upgrade itself.
PLG_userInfoChanged plugin_user_changed_ called to inform plugins when a user's information (profile or preferences) has changed.
PLG_wsEnabled plugin_wsEnabled_ Returns true if the plugin supports webservices
glfusion/development/api/plg.txt · Last modified: 2017/09/27 10:32 (external edit)

Page Tools