![]()
|
|||||||||||||||||
|
| |||||||||||||||||
|
News SyndicationNews articles posted to the RRCA News section are available as a Free RSS (Rich Site Summary) newsfeed. Webmasters can utilize php, perl or other scripts to list current RRCA news article titles and links on their own web sites. These will automatically update as new articles are posted by the RRCA. The most versatile way The XML newsfeed URL is: http://www.rrca.org.news/rrcanews.xml. To implement the RRCA News article list on your site using the RSS XML file directly, you need to embed some scripting in the body of your page to convert the XML to HTML. An example of a php implementation is shown below: <?php
$maxcount =5; // Maximum number of articles to display
$xml = fopen("http://www.rrca.org/news/rrcanews.xml","r"); // Open rss feed
if(!$xml)die("cannot connect to rrca");
$xmldata = fread($xml ,64000); // read feed contents
$parsexml = eregi("<item>(.*)</item>", $xmldata ,$articlearray); // parse items
$articles = explode("<item>", $articlearray[0]); // place articles in array
$count = count($articles) - 1; // determine # of articles
if($count > $maxcount) $count=$maxcount; // set number to display
for($i=1 ; $i<=$count ;$i++) // loop and display
{
ereg("<title>(.*)</title>",$articles[$i], $headline); // get titles
ereg("<description>(.*)</description>",$articles[$i], $time); // get times
ereg("<link>(.*)</link>",$articles[$i], $url); // get urls
printf("<a href='$url[1]' target='_new'>$headline[1]</a> - $time[1]<br>");
}
?>
This example displays the articles on your web page as a list of titles with their dates. The title is a link to the article on the RRCA web site. With a php approach such as this, you have complete control of the output format. The easy way The simple approach is to use the XML to Javascript converter on the RRCA site which will give you a one line listing for each article. Including the following line within your web page at the location you want the RRCA news articles listed is all you have to do: <script src="http://www.rrca.org/news/rrcajsfeed.php?maxcount=5"></script> The maxcount argument specifies the maximum
number of articles to be displayed, the most current first. You
can add a title (eg RRCA News) and formatting around this line
to give it the look and feel of your page. You can also use this
logo to mark the news: The cool way Scroller: Ticker: The cool approach is to use one of the FLASH XML
widgets above. Scroller: <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs /flash/swflash.cab#version=6,0,79,0" id="xmlrrcanews" width="400" height="65"> <param name="movie" value="http://www.rrca.org/news/xmlrrcanews.swf"> <param name="bgcolor" value="#E7E7CB"> <param name="quality" value="high"> <param name="menu" value="false"> <param name="allowscriptaccess" value="samedomain"> <embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="400" height="65" name="xmlrrcanews" src="http://www.rrca.org/news/xmlrrcanews.swf" bgcolor="#E7E7CB" quality="high" menu="false" swLiveConnect="true" allowScriptAccess="samedomain" ></embed> </object> Ticker: <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs /flash/swflash.cab#version=6,0,79,0" id="xmlrrcanewstick" width="300" height="19"> <param name="movie" value="http://www.rrca.org/news/xmlrrcanewstick.swf"> <param name="bgcolor" value="#DDDDDD"> <param name="quality" value="high"> <param name="menu" value="false"> <param name="allowscriptaccess" value="samedomain"> <embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="300" height="19" name="xmlrrcanewstick" src="http://www.rrca.org/news/xmlrrcanewstick.swf" bgcolor="#DDDDDD" quality="high" menu="false" swLiveConnect="true" allowScriptAccess="samedomain" ></embed> </object> |
||||||||||||||||