[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 08-21-2008, 05:46 AM   #1 (permalink)
New Member
 
Join Date: Jul 2007
Location: CVVCC.com
Posts: 23
0.00 NP$ (Donate)

Captain Clay is an unknown quantity at this point


[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 Code:
  ...

  <!-- 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 by Captain Clay; 08-22-2008 at 04:45 AM.
Captain Clay is offline  
Old 08-21-2008, 06:36 AM   #2 (permalink)
NamePros Regular
 
baxter's Avatar
 
Join Date: Apr 2006
Posts: 289
1,990.00 NP$ (Donate)

baxter is a jewel in the roughbaxter is a jewel in the roughbaxter is a jewel in the rough

Ethan Allen Fund Save The Children
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
__________________
Chimps.ca - Swans.ca - Snails.ca
baxter is offline  
Old 08-21-2008, 02:24 PM   #3 (permalink)
New Member
 
Join Date: Jul 2007
Location: CVVCC.com
Posts: 23
0.00 NP$ (Donate)

Captain Clay is an unknown quantity at this point


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.
Captain Clay is offline  
Old 08-22-2008, 04:44 AM   #4 (permalink)
New Member
 
Join Date: Jul 2007
Location: CVVCC.com
Posts: 23
0.00 NP$ (Donate)

Captain Clay is an unknown quantity at this point


Don't fret - I've worked it out. Ta.
Captain Clay is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 07:53 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85