Plugin API

From GregariusWiki

Jump to: navigation, search

Contents

[edit] rss_plugins_set_item_state

  function rss_plugins_set_item_state($itemId, $bit_mask, $set
                                          , $sqlwhere = "", $entire_db = false)

Versions</dt>
Available in Gregarius 0.5.3+ only</dd>
Input parameters</dt>

  • itemId

The ID of the item who's state is to be set.

  • bit_mask

State bits to be set or removed

    • RSS_MODE_UNREAD_STATE - item is unread
    • RSS_MODE_STICKY_STATE - item is sticky
    • RSS_MODE_PRIVATE_STATE - item is private
    • RSS_MODE_DELETED_STATE - item is deleted
  • set

If true, states listed in bit_mask are to be added to the item's state. If false, they are to be removed.

  • sqlwhere

Specify a where clause for the update. Mostly useful when passing null for itemID.

  • entire_db

Must be set to true if you wish to pass null for itemID. Serves as a sanity check. </dd>

Return Value</dt>
true if successful</dd>
Description</dt>
Provides a safe way to modify the state of an item.
Sample plugins using this API</dt>

</dd>

[edit] rss_plugins_get_plugins_http_path

 function rss_plugins_get_plugins_http_path()

Versions</dt>
Available in Gregarius 0.5.3+ only</dd>
Input parameters</dt>
none</dd>
Return Value</dt>
http://example.com/rss/plugins/</dd>
Description</dt>
Retuns the path plugins directory. Use this to access the path to the plugins directory.
Sample plugins using this API</dt>

</dd>

[edit] rss_plugins_is_submit

 function rss_plugins_is_submit()

Versions</dt>
Available in Gregarius 0.5.3+ only</dd>
Input parameters</dt>
none</dd>
Return Value</dt>
true if the plugin options are being saved.</dd>
Description</dt>
Used inside your plugin's configuration hook, this function will return true if the plugin options are being saved and false if they are being loaded. Please see the section entitled "Providing Configuration Options" for more information.
Sample plugins using this API</dt>

</dd>

[edit] rss_plugins_add_option

 function rss_plugins_add_option($key, $value, $type = "string", $default = "", $desc= "", $export = NULL)

Versions</dt>
Available in Gregarius 0.5.3+ only</dd>
Input parameters</dt>

  • key

Key of the configuration option to set

  • value

Value to store

  • type

Type of parameter. Currently valid values are "string" and "array"

  • default

Default value of the configuration option.

  • desc

Description of the configuration option.

  • export

Reserved for future functionality. Description of the </dd>

Return Value</dt>
True if successful</dd>
Description</dt>
Allows the plugin author to store configuration information in the database. Typically you will call this function in your plugin's configuration hook inside an if (rss_plugins_is_submit()) block. Please see the section entitled "Providing Configuration Options" for more information.
Sample plugins using this API</dt>

</dd>

[edit] rss_plugins_get_option

 function rss_plugins_get_option($key)

Versions</dt>
Available in Gregarius 0.5.3+ only</dd>
Input parameters</dt>

  • key

The key of the configuration option for which to retrieve the value. </dd>

Return Value</dt>
The value of the configuration option</dd>
Description</dt>
Allows the plugin author to retrieve stored configuration information from the database. Please see the section entitled "Providing Configuration Options" for more information.
Sample plugins using this API</dt>

</dd>

[edit] rss_plugins_delete_option

 function rss_plugins_delete_option($key)

Versions</dt>
Available in Gregarius 0.5.3+ only</dd>
Input parameters</dt>

  • key

Key of the configuration option that is to be removed. </dd>

Return Value</dt>
True if successful</dd>
Description</dt>
Allows the plugin author to delete stored configuration information from the database.

Personal tools
Advertisement