plugin

Contains utility functions for dealing with plugins.

Methods:

get
key
key_types
status_codes

Direct Link

get

( name )
Returns the plugin object with this name. Currently this object is just the settings that the plugin author has defined for this plugin.

Parameters

  • name String
    The name of the plugin to retrieve.

Returns

Object
The author-defined settings for this plugin.

Direct Link

key

( key )
Returns a handle to the plugin key object with the given key. The associated utility methods provide an easy interface to modifying the value of this key.

A few general notes on these functions:

Unless otherwise noted, all error functions will default to creating a proboards.error dialog box with the error message and error code. This is so that errors will be more obvious during the construction of code.

If you're attempting to set the value of a plugin key that is not a super forum key, and you do not supply an object_id, the setting functions will attempt to infer an object_id from the page you're on. For example, on a post creation page, if you try to set an anonymous post key, the object_id will be the id of the post you're creating.

You can use any of these key functions that manipulate the data of a key on a key that is not currently loaded onto the page, however the key's data will not become available to you unless you use the set function.

Example:
// To get the value stored in the key "my_plugin_key" with the object_id of "4": pb.plugin.key('my_plugin_key').get(4);

Parameters

  • key String
    The identifying string for this key.

Returns

Object
The plugin key with the passed-in key name.

Direct Link

key_types

( )
Returns a reference object with all plugin key types listed.

Returns

Object
A list of all plugin key types mapped to their key_type code.

Direct Link

status_codes

( )
Returns a reference object with all plugin status codes listed.

Returns

Object
A list of all plugin statuses mapped to their plugin_status code.