RSS_feed,_adding_to_a_plugin - e107inc/e107v1 GitHub Wiki


title: RSS feed, adding to a plugin permalink: /RSS_feed,_adding_to_a_plugin/

Adding RSS Feeds To A Plugin

As of e107 0.7 you can have RSS feeds generated for your particular plugin automatically. To add this functionality to your plugin, you need to create an e_rss.php file in the root of your plugin folder.

Each e_rss.php file consists of two main parts. The first part creates an array called $eplug_rss_feed[]. This array is used to 'locate' the rss feeds for the rss admin area import feature. This array consists of the following values:

  • name caption for display (used in rss.php rss feed list page)
  • url identifier for the rss feed url (rss.php?A.B.C -> A) (does not need to be numeric)
  • topic_id topic_id, empty on default (to select a certain category) (rss.php?A.B.C -> C), use '*' for dynamically read topic_id)
  • path plugin path location (use path|parm for multiple switches, see forum)
  • text description for the rss.php feed list page
  • class 0=active and visible in rss feed list, 1=active and not visible in rss feed list, 2=inactive (default=0)
  • limit number of items to show in the rss feed

The second part creates an array called $eplug_rss_data[]. This array is used to 'retrieve' the rss feeds records for the rss generator. This array consists of the following values:

Required elements:

  • author holds the name of the author of the retrieved item.
  • author_email holds the email address of the author of the retrieved item.
  • link the full url that is specific to the particular item.
  • linkid the identifying id value for retrieved item.
  • title field name where the title is located.
  • description a description for the retrieved item, could be a subheading, summery or posted text.
  • category_name the name of the category.
  • category_link the full url to the category page.
  • datestamp the date when the item was added.

Optional elements - particularly useful for Podcasting.

  • enc_url URL to related media. eg. mp3 file.
  • enc_leng size of the media in bytes.
  • enc_type path to the file (automatically converted to mime type. )

Category:PluginWriting Category:RSS