Hi all, I have a small script publishing RSS on my site, and was wondering if someone would be able to quickly edit it to display only 5 lines of news, rather than displaying all the news in the feed. Also, edit it so it only displays xxx characters then puts in "..." at the end. something like: .substr(,0,150) Heres the script: <?php $insideitem = false; $tag = ""; $title = ""; $description = ""; $link = ""; function startElement($parser, $name, $attrs) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { $tag = $name; } elseif ($name == "ITEM") { $insideitem = true; } } function endElement($parser, $name) { global $insideitem, $tag, $title, $description, $link; if ($name == "ITEM") { printf("<div class=\"cell-white\" onmouseover=\"this.className='cell-grey';\" onmouseout=\"this.className='cell-white';\" style=\"padding:5px; border-right: 1px solid #333333; border-left: 1px solid #333333; border-bottom: 1px solid #333333; \"><a style=\"font-weight:normal;\" href='%s'>%s</a></div> ", trim($link),htmlspecialchars(trim($title))); $title = ""; $description = ""; $link = ""; $insideitem = false; } } function characterData($parser, $data) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { switch ($tag) { case "TITLE": $title .= $data; break; case "LINK": $link .= $data; break; } } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen("http://www.nintendo.com/rss.xml","r") or die("Error reading RSS data."); while ($data = fread($fp, 4096)) xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); fclose($fp); xml_parser_free($xml_parser); ?> PHP: Payment by paypal Thanks!
if you need any PHP coder in future.plz contact me.i work for really cheap rate.i prefer to work for small scripts that you can add to your sites.