PLG getItemInfo

From GeeklogWiki
Revision as of 09:46, 10 December 2008 by Dirk (talk | contribs) (Started documentation of PLG_getItemInfo)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

PLG_getItemInfo was introduced in Geeklog 1.4.0. It is used internally as part of the implementation of Trackbacks and Pingbacks.

The basic idea for this function is to request information for an item that is under a plugin's control (where, in this case, the list of "plugins" also includes Geeklog's built-in articles).

Original API

The API, as implemented in Geeklog version 1.4.0-1.5.1:

function PLG_getItemInfo($type, $id, $what)

  • $type is the type of plugin we want to request information from. This is the internal name of the plugin, e.g. 'links' for the Links plugin. Additionally, 'article' can be used to request information for stories.
  • $id is the ID of the item we are requesting information about, e.g. the story ID (sid), link ID (lid), etc.
  • $what is a comma-separated list of keywords indicating the information we are requesting for the specified item.
    Currently, the following keywords are supported:
    • 'url' - the complete URL of the item
    • 'title' - the item's title or subject
    • 'excerpt' - a short description of the item
    • 'description' - the full description of the item, e.g. the article text