Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-18-2007, 05:12 AM   PM User | #1
tieone
New to the CF scene

 
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
tieone is an unknown quantity at this point
Question 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.

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.

I think this very nice script would be more useful for most.

Thanks

Last edited by tieone; 04-18-2007 at 06:10 AM..
tieone is offline   Reply With Quote
Old 04-19-2007, 02:43 AM   PM User | #2
tieone
New to the CF scene

 
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
tieone is an unknown quantity at this point
thanks!
tieone is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:48 PM.


Advertisement
Log in to turn off these ads.