Plugin Directory

RSSImport

Author: Frank Bültge

Import and display Feeds in your blog, use PHP, a Widget or the Shortcode. The plugin use the standards of WordPress, non extra library; use MagpieRSS or SimplePie for parse feeds.

Use following code with a PHP-Plugin or in a template, example sidebar.php or single.php, for WordPress:

Example: <?php RSSImport(10, 'http://bueltge.de/feed/'); ?>

This is smallest code for use the plugin with your own feed-url. The plugin have many parameters for custom import of content form a feed. See the list of parameters. You can also use all parameters with shorcode in posts and pages.

Example for Shortcode: [RSSImport display="5" feedurl="http://bueltge.de/feed/"]

For all boolean parameter it is possible to use the string true or false or the integer value 0 or 1.

  1. display - How many items, Default is 5
  2. feedurl - Feed-Adress, Default is http://bueltge.de/feed/
  3. before_desc - string before description, Default is empty
  4. displaydescriptions - (bool) true or false for display description of the item, Default is false
  5. after_desc - string after description, Default is empty; you can use the follow strings for custom html %title for title of entry and %href for link of entry
  6. html - (bool) display description include HTML-tags, Default is false
  7. truncatedescchar - truncate description, number of chars, Default is 200, set the value to empty '' for non truncate
  8. truncatedescstring - string after truncate description, Default is ...
  9. truncatetitlechar - (int) truncate title, number of chars, Default is empty, set a integer 50 to the value for truncate
  10. truncatetitlestring - string after truncate title, Default is ' ... '
  11. before_date - string before date, Default is <small>
  12. date - (bool) return the date of the item, Default is false
  13. after_date - string after the date, Default is </small>
  14. date_format- your format for the date, leave empty for use format of your WordPress installation, alternativ give the php date string, Example: F j, Y; see also doku in Codex
  15. before_creator - string before creator of the item, Default is <small>
  16. creator - (bool) return the creator of th item, Default is false
  17. after_creator - string after creator of the item, Default is </small>
  18. start_items - string before all items, Default is <ul>
  19. end_items - string after all items, Default is </ul>
  20. start_item - string before the item, Default is <li>
  21. end_item - string after the items, Default is </li>
  22. target - string with the target-attribut, Default is empty; use blank, self, parent, top
  23. rel- string with the rel-attribut, Default is empty, use string, nofollow, follow
  24. charsetscan - Scan for charset-type, load slowly; use this for problems with strings on the return content, Default is false
  25. debug - activate debug-mode, echo the array of Magpie-Object; Default is false, Use only for debug purpose
  26. before_noitems - HTML or string before message, when the feed is empty, Default is <p>
  27. noitems- Message, when the feed is empty, Default is No items, feed is empty.
  28. after_noitems - HTML or string before message, when the feed is empty, Default is </p>
  29. before_error - HTML or string before message, when the feed have an error, Default is <p>
  30. error - Errormessage, Default is Error: Feed has a error or is not valid
  31. after_error - HTML or string before message, when the feed have an error, Default is </p>
  32. paging - Pagination on, set true, Default is false
  33. prev_paging_link - Linkname for previous page, Default is &laquo; Previous
  34. next_paging_link - Linkname for next page, Default is Next &raquo;
  35. prev_paging_title - Title for the link of previous page, Default is more items
  36. next_paging_title - Title for the link of next page, Default is more items
  37. use_simplepie- Use the class SimplePie for parse the feed; SimplePie is include with WordPress 2.8 and can parse RSS and ATOM-Feeds, Default is false
  38. view - echo or return the content of the function RSSImport, Default is true; Shortcode Default is false

The pagination function add a div with the class rsspaging for design with CSS. Also youcan style the previous and next link with the classes: rsspaging_prev and rsspaging_next.

All parameters it is possible to use in the function, only in templates with PHP, and also with the Shortcode in posts and pges.

Examples:

The function with many parameters:

RSSImport(
                    $display = 5, $feedurl = 'http://bueltge.de/feed/',`
                        $before_desc = '', $displaydescriptions = false, $after_desc = '', $html = false, $truncatedescchar = 200, $truncatedescstring = ' ... ',
                        $truncatetitlechar = '', $truncatetitlestring = ' ... ',
                        $before_date = ' <small>', $date = false, $after_date = '</small>',
                        $before_creator = ' <small>', $creator = false, $after_creator = '</small>',
                        $start_items = '<ul>', $end_items = '</ul>',
                        $start_item = '<li>', $end_item = '</li>'
                    )

The shortcode with a lot of parameters:

[RSSImport display="10", feedurl="http://your_feed_url/", 
displaydescriptions="true", html="true"
start_items="<ol>", end_items="</ol>", paging="true" ]

Localizations

Please visit the official website for further details and the latest information on this plugin.

Tags: , , ,