CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Ajax and Design (http://www.codingforums.com/forumdisplay.php?f=55)
-   -   RSS Ajax JavaScript ticker (http://www.codingforums.com/showthread.php?t=112503)

tieone 04-18-2007 05:12 AM

RSS Ajax JavaScript ticker
 
Hello

I have found this nice tutorial 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:

PHP Code:

$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.

PHP Code:

$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:
Code:

        <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

tieone 04-19-2007 02:43 AM

thanks!


All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.