Dynadot โ€” .com Registration $8.99

Help with magpierss

Spaceship Spaceship
Watch

Captain Clay

Established Member
Impact
0
[resolved] Help with magpierss

Hey all,

Can someone please offer a suggestion. I'm using magpierss but I don't want to display the "email this" and bookmark links at the end of each item description. (I know this is rather specific - I can't seem to find a solution for this ANYWHERE!) Any help much appreciated...

This is what I've got:
PHP:
  ...

  <!-- start magpie rss feed -->
  <?php include('rss_fetch.inc');

    $rss = fetch_rss($url);

    if ($rss)
    {

      // Split the array to show first 5
      $items = array_slice($rss->items, 0, 5);

      // Cycle through each item and echo
      foreach ($items as $item ) 
      {
      echo '<div class="newsheader">';
      echo '<a href="'.$item['link'].'">'.$item['title'].'</a>';
      echo '</div>';
      echo $item['description'];
      }
      //description includes email and bookmark links...

      ...

Thanks in advance...

Clay
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
you'll want to use preg_replace to remove the email and bookmark links from the description if you have an example output I can give you the regex
 
0
•••
Thanks for the reply Baxter.

Yeah, therein lies the problem. The description seems to only include the text before the email/bookmark. I'm a bit green to php so stumbling my way through - how should I get an example (other than the straight text above these elements) that I could then strip with preg_replace?

Clay.
 
0
•••
Don't fret - I've worked it out. Ta.
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back