Fw: [Magpierss-general] Re: RSS Title Length
Status: Beta
Brought to you by:
kellan
From: DJ W. <dj...@ho...> - 2004-12-15 20:20:52
|
He ment: $title= substr($title,0, 50); Put it like this: foreach ( $items1 as $item1 ) { $title1 = substr($item1[title], 0, 50); $url1 = $item1[link]; echo "» <a href=$url1>".$title1."</a></li><br>\n"; } Next time try more to read the manual people are refering to :) Wouter ----- Original Message ----- From: "Mikee" <blo...@gm...> To: <mag...@li...> Sent: Wednesday, December 15, 2004 6:28 PM Subject: [Magpierss-general] Re: RSS Title Length : ------ : : $title= substr("$title", 50) : See <http://php.net/substr>. <http://php.net/substr%3E.> : : ------ : : Thank you Matthias, : : Now I'm very very new to all this. I have tried to place this code in : multiple spots but cannot get it to work. If you don't mind I was going : to post my code and see if its possible with what I have now: : : ------ : : define('MAGPIE_CACHE_DIR', : '/home/httpd/vhosts/winforums.org/subdomains/forums/httpdocs/cache'); : require_once 'rss_fetch.inc'; : : // Section 1 : : echo '<table cellspacing="7" cellpadding="7" width="100%">'; : : // RSS 1 : : $url1 = 'http://rssnewsapps.ziffdavis.com/tech.xml'; : $num_items1 = 7; : $rss1 = fetch_rss($url1); : : if ( $rss1 ) { : : } : else { : echo "Error reading news feed " . : "Check back later" . : "<br>Error Message: " . magpie_error(); : } : : echo '<tr>'; : echo '<td valign="top">'; : echo " Source: <b>", $rss1->channel['title'], "</b><p>\n"; : $items1 = array_slice($rss1->items, 0, $num_items1); : foreach ( $items1 as $item1 ) { : $title1 = $item1[title]; : $url1 = $item1[link]; : echo "» <a href=$url1>$title1</a></li><br>\n"; : } : echo '</td>'; : echo '<td valign="top">'; : : ----- : : Thanks, : : : : : : ------------------------------------------------------- : SF email is sponsored by - The IT Product Guide : Read honest & candid reviews on hundreds of IT Products from real users. : Discover which products truly live up to the hype. Start reading now. : http://productguide.itmanagersjournal.com/ : _______________________________________________ : Magpierss-general mailing list : Mag...@li... : https://lists.sourceforge.net/lists/listinfo/magpierss-general : |