tieone
04-18-2007, 05:12 AM
Hello
I have found this nice tutorial (http://www.javascriptkit.com/dhtmltutors/ajaxticker/index.shtml) on JavaScript Kits.
Now I'm trying to make good use of it but all RSS feeds in this script are stored in an array.
Like this:
$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"
);
Than, this extract the feed URLs from the array.
$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("Error: Can't find requested RSS in list.");
Can someone teach me how to modify this script, so it fetch RSS feed URLs from a MySQL table/rows instead?
I'm just not sure how to makes this script work with a database.
I knows how to connect to my DB, how to fetch data from it, build my mysql query and my php codes but I'm not sure how to put everything together.:confused:
And there is this JS which output the content:
<script type="text/javascript">
//rss_ticker(RSS_id, cachetime, divId, divClass, delay, optionalswitch)
document.write("CNN:")
new rss_ticker("CNN", 660, "cnnbox", "cnnclass", 10000, "showdescription")
</script>
... can't figure how this will works with the modifications.:confused:
I think this very nice script would be more useful for most.
Thanks
I have found this nice tutorial (http://www.javascriptkit.com/dhtmltutors/ajaxticker/index.shtml) on JavaScript Kits.
Now I'm trying to make good use of it but all RSS feeds in this script are stored in an array.
Like this:
$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"
);
Than, this extract the feed URLs from the array.
$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("Error: Can't find requested RSS in list.");
Can someone teach me how to modify this script, so it fetch RSS feed URLs from a MySQL table/rows instead?
I'm just not sure how to makes this script work with a database.
I knows how to connect to my DB, how to fetch data from it, build my mysql query and my php codes but I'm not sure how to put everything together.:confused:
And there is this JS which output the content:
<script type="text/javascript">
//rss_ticker(RSS_id, cachetime, divId, divClass, delay, optionalswitch)
document.write("CNN:")
new rss_ticker("CNN", 660, "cnnbox", "cnnclass", 10000, "showdescription")
</script>
... can't figure how this will works with the modifications.:confused:
I think this very nice script would be more useful for most.
Thanks