NeedsHelp
03-26-2011, 02:27 PM
1) Script Title: RSS Ajax Ticker
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/rsstickerajax/index.htm
3) Describe problem: The script, as copied from DD works on my site, exactly as it does on DD.
I want to modify it, so I can include other news feeds, besides CNN and BBC, while keeping those.
How/Which of the files do I need to modify?
jscheuer1
03-26-2011, 04:48 PM
Using a text only editor like NotePad, open up bridge.php in the lastrss folder. There you will see:
// List of RSS URLs
$rsslist=array(
"CNN" => "http://rss.cnn.com/rss/cnn_topstories.rss",
"BBC" => "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml",
"news.com" => "http://news.com.com/2547-1_3-0-5.xml",
"slashdot" => "http://rss.slashdot.org/Slashdot/slashdot",
"dynamicdrive" => "http://www.dynamicdrive.com/export.php?type=new"
);
Using the same format, add your additional feed(s). Notice each is a quoted keyword (the RSS_id for that feed, pick any unique keyword for this) followed by => followed by the quoted URL to that feed. Each entry line has a comma after it, except the last one. It's important that yours do to, and that the last one and only the last one has no comma following it.
Once you have that set the way you want it, save it.
Then on your HTML page (your equivalent to demo.htm from the distribution archive), add the call(s) for the additional feed(s). Follow the format as given on the demo page:
<script type="text/javascript">
//rssticker_ajax(RSS_id, cachetime, divId, divClass, delay, optionalswitch)
//1) RSS_id: "Array key of RSS feed in PHP script"
//2) cachetime: Time to cache the feed in seconds (0 for no cache)
//3) divId: "ID of DIV to display ticker in. DIV dynamically created"
//4) divClass: "Class name of this ticker, for styling purposes"
//5) delay: delay between message change, in milliseconds
//6) optionalswitch: "string" to control which parts of an item to display: "date" or "date+description"
new rssticker_ajax("BBC", 600, "ddbox", "bbcclass", 3500, "date+description")
</script>
For the RSS_id (BBC in the above), use the same keyword for that feed as you just set it in bridge.php. Set the cache time as desired. Choose a unique divId for the id of div element that will be created by the script for this feed, use any class you like, set the delay as desired and your preference for date or date+description for that feed. Place this call on your page in the body where you want the feed to appear. If desired, style the feed in your stylesheet using the divId and/or divClass you set in the call.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.