brad45429 Posted February 9, 2007 Share Posted February 9, 2007 Ultrus, Everything is working fine with your BEAUTIFUL php script that you wrote FOR ME. I came across a problem today though. http://www.xenianaz.org/blogs/ One of my guys blogged today and posted a photo at the beginning of his blog post, and ONLY the image he posted shows up on my parsed, outputed feed. Is there a way to modify the script to NOT include images? Sorry man. YOU ROCK! Here is the script again if you need to see it.... <?php define('MAGPIE_DIR', '../blogs/magpie/'); require_once(MAGPIE_DIR.'rss_fetch.inc'); $rss = fetch_rss('http://xenianaz.org/blogs/jim/atom.xml'); $item = $rss->items[0]; //this changed a bit. It's not $content anymore $allContent = $item['atom_content']; //first 200 characters, some word might be chopped off here $content = substr($allContent, 0, 200); //whatever is being hidden, with possible chopped in half word at beginning $remainingContent = substr($allContent , 200, (strlen($allContent) - 200)); //might want to check if a space is the last character of the current content //if so, no words were chopped in half if(substr($content, (strlen($content) - 1), 1) == " ") { //this is where I made my mistake $remainingContent = false; } //if there were less than 200 characters to begin with, skip the following if($remainingContent && strlen($remainingContent) > 0) { $spacePosition = stripos($remainingContent, " "); //position of next space/word break if($spacePosition) $content .= substr($remainingContent, 0, ($spacePosition + 0)); } else { $content .= $remainingContent; } echo "<p>$content...</p>\n"; ?> Link to comment https://forums.phpfreaks.com/topic/37697-ultrus-rss-fetch-subtract-images-from-rss-parse/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.