Plugin Directory

Changeset 990833


Ignore:
Timestamp:
09/16/2014 07:46:03 AM (11 years ago)
Author:
susantabeura
Message:

Updating to Version 1.0.d

Location:
rss-via-shortcode-on-page-post
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • rss-via-shortcode-on-page-post/trunk/readme.txt

    r988820 r990833  
    1 === Plugin Name ===
     1=== RSS Via Shortcode for Page & Post ===
    22Contributors: susantabeura
    33Donate link: http://susantaslab.com/
     
    55Requires at least: 2.8
    66Tested up to: 4.0
    7 Stable tag: 1.0.c
     7Stable tag: 1.0.d
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Simple plugin to show RSS feeds in any posts and/or pages using a simple shortcode.
     11Simple plugin to show RSS feeds in any posts and/or pages. It is the simplest and best lugin for Amazon associate and eBay partner network product advertising.
    1212
    1313== Description ==
     
    1818`[rssonpage rss="Your Feed URL" feeds="Number of Feeds" excerpt="summery true/false" target="_blank|_self|_top|_anyname"]`
    1919Where:
    20 **rss** = URL of your RSS feed. This is the only tag required.
    21 **feeds** = Number of RSS items to be fetched from feed. Default is 10
    22 **excerpt** = Extract feed summery? True or False. Default is true.
    23 **target** = Default is '_blank'. By default it will open links in a new window/tab.
     20* **rss** = URL of your RSS feed. This is the only tag required.
     21* **feeds** = Number of RSS items to be fetched from feed. Default is 10
     22* **excerpt** = Extract feed summery? True or False. Default is true.
     23* **target** = Default is '_blank'. By default it will open links in a new window/tab.
    2424
    2525**NOTE** Feeds will only be displayed. They will not stored in database. So always new contents for search engines.
     
    47472. A page created with two RSS feeds from Elance & oDesk
    48483. Live page with text from Elance & oDesk RSS feeds
     494. A amazon associate product advertising page
     505. An eBay partner network product advertising
    4951
    5052== Changelog ==
     53
     54= 1.0.d =
     55* Error with reading RSS feeds fixed
     56* Support for Amazon associate and eBay partner advertising added
    5157
    5258= 1.0.c =
  • rss-via-shortcode-on-page-post/trunk/rss-via-shortcode.php

    r988820 r990833  
    22/*
    33Plugin Name: RSS Via Shortcode for Page & Post
    4 Version: 1.0.c
     4Version: 1.0.d
    55Plugin URI: http://susantaslab.com/
    66Description: Makes it easy to display an RSS feed on a page
     
    88Author URI: http://susantaslab.com/
    99License: GPL v2
    10 Usages: [rssonpage rss="Your Feed URL" feeds="Number of Feeds" excerpt="summery true/false" target="_blank|_self|_top|_anyname"]
     10Usages: [rssonpage rss="Your Feed URL" feeds="Number of Feeds" excerpt="true/false" target="_blank|_self|_top|_anyname"]
    1111*/
    1212
     
    1919    ), $atts));
    2020    require_once(ABSPATH.WPINC.'/rss.php'); 
    21     if ( $rss != "" && $rss = fetch_rss( $rss ) ) {
    22         $remWord = array(" - oDesk", "| Elance Job");
     21    if ( $rss != "" && $rssFeed = fetch_feed( $rss ) ) {
     22
     23        $rssFeed->enable_order_by_date(false);
     24        $maxitems = $rssFeed->get_item_quantity( $feeds );
     25        if ($maxitems == 0)
     26            return '<ul><li>Content not available at'.$rss .'.</li></ul>';
     27
     28        $rss_items = $rssFeed->get_items( 0, $maxitems );
     29
    2330        $content = '<ul>';
    24         if ( $feeds !== -1 ) {
    25             $rss->items = array_slice( $rss->items, 0, $feeds );
    26         }
    27         foreach ( (array) $rss->items as $item ) {
     31
     32        foreach ( $rss_items as $item ) {
    2833            $content .= '<li>';
    29             if ($target != '_self')
    30                 $content .= '<a href="'.esc_url( $item['link'] ).'" target="'.esc_attr($target).'">'. str_replace($remWord, "", esc_html($item['title'])) .'</a>';
    31             else
    32                 $content .= '<a href="'.esc_url( $item['link'] ).'">'. esc_html($item['title']) .'</a>';
     34            if ($target != '_self'){
     35                $content .= '<h3><a href="';
     36                $content .= trim($item->get_permalink());
     37                $content .= '" target="';
     38                $content .= $target;
     39                $content .= '" rel="external">';
     40                $content .=  $item->get_title();
     41                $content .= '</a></h3>';
     42            }
     43            else {
     44                $content .= '<h3><a href="';
     45                $content .= trim($item->get_permalink());
     46                $content .= '" rel="external">';
     47                $content .= $item->get_title();
     48                $content .= '</a></h3>';
     49            }
    3350            if ( $excerpt != false && $excerpt != "false") {
    34                 $content .= '<br/><span class="rss_excerpt">'. $item['description'] .'</span>';
     51                $content .= '<br/><span class="rss_excerpt">';
     52                $content .= $item->get_description();
     53                $content .= '</span>';
    3554            }
    3655            $content .= '</li>';
    37         }
     56        } 
    3857        $content .= '</ul>';
    3958    }
Note: See TracChangeset for help on using the changeset viewer.