Reducing the length of the content string in MagpieRSS

Discussion in 'XML & RSS' started by baselinej70, Jun 7, 2006.

  1. #1
    Does anyone know how to truncate the content item of an rss feed via MagpieRSS?

    I am receiving full feeds but only want to display eg. the first 100 characters of the content (ie. how do I turn a full feed into a partial feed via MagpieRSS?)

    eg.

    TITLE XYZ 123
    CONTENT blah blah blah[...]

    instead of


    TITLE XYZ 123
    CONTENT blah blah blah blah blah

    Thanks!
     
    baselinej70, Jun 7, 2006 IP
  2. rosytoes

    rosytoes Peon

    Messages:
    230
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    find
    $desc = $item['description'];
    Code (markup):
    and change to
    $desc = substr($item['description'], 0, 20).'[...]'
    Code (markup):
     
    rosytoes, Jun 8, 2006 IP
  3. baselinej70

    baselinej70 Active Member

    Messages:
    40
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #3
    Hey thanks for your reply Rosytoes,

    The closest match I can find is in this code block:

    $feed_link = htmlspecialchars($row['feed_link']);
    $feed_title = htmlspecialchars($row['feed_title']);
    $feed_description = htmlspecialchars($row['feed_description']);
    $item_id = $row['item_id'];
    $image = $row['image'];
    $item_link = htmlspecialchars($row['item_link']);
    $item_title = htmlspecialchars($row['item_title']);
    $item_content = fof_sanitize_content($row['item_content']);
    $item_content = fof_normalize_content_urls( $item_content, $item_link );

    Any ideas?

    Thanks!
     
    baselinej70, Jun 8, 2006 IP
  4. rosytoes

    rosytoes Peon

    Messages:
    230
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm not sure if it's $feed_description or $item_content, you need to find the echo statement that gives you your content and then use the substr function on it.
     
    rosytoes, Jun 8, 2006 IP