Grow your CSS skills. Land your dream job.

Help needed kinda fast for defining a previous loop output

  • # June 23, 2009 at 6:05 pm

    I have a client using simple press forum plugin for wordpress and needs to limit the rss feed.

    Here’s a relevant part:

    Code:
    < ?php
    if($rssItem)
    {
    foreach($rssItem as $item)
    {
    ?>

    < ?php sf_rss_filter($item->link) ?>

    < ?php sf_rss_filter($item->guid) ?>
    < ![CDATA[description) ?>]]>

    < ?php sf_rss_filter($item->pubDate) ?>

    < ?php
    }
    }
    ?>

    What I need to do is make sure that if the title has been outputted before it does not show again, so there is no duplicates. Any ideas?

    I was thinking of an if statment working on past outputs, but I don’t know how.

    # June 24, 2009 at 8:31 am

    does this work?

    Code:
    < ?php
    if($rssItem)
    {
    $array = array();
    foreach($rssItem as $item)
    {
    if(!in_array($item->title,$array)){
    ?>

    < ?php sf_rss_filter($item->link) ?>

    < ?php sf_rss_filter($item->guid) ?>
    < ![CDATA[description) ?>]]>

    < ?php sf_rss_filter($item->pubDate) ?>

    < ?php

    array_push($array, $item->title);
    }
    }
    }
    ?>

    # June 24, 2009 at 4:46 pm

    Yes it did! Thank you so so much!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".