PDA

View Full Version : How do I include two different instances of RSSdisplay box on same page



mharrsch
01-27-2007, 08:17 PM
1) Script Title: RSSdisplaybox

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/index.htm

3) Describe problem: I have a two column format online magazine. I wish to display a different RSS feed in each column. I have included each RSS feed reference in main.php and named each one uniquely. However, when I try to insert the script calling one feed in the first column then the script calling the second feed in the next column, I end up seeing the last feed called where I have specified but the first feed request just spins and spins without displaying anything.

ddadmin
01-27-2007, 10:38 PM
Did you make sure that each instance of the RSS ticker invocation code on your page contains a unique variable name? For example:


<script type="text/javascript">
var showbbc=new rssdisplaybox("bbc", "bbcdiv", "someclass")
showbbc.set_items_shown(10) //show 10 entries from feed
showbbc.start() //Required: start script
</script>

<script type="text/javascript">
var showcnn=new rssdisplaybox("bbc", "cnndiv", "someclass")
showcnn.set_items_shown(10) //show 10 entries from feed
showcnn.start() //Required: start script
</script>

The code in red is what I'm referring to as far as unique variable name. Notice the name in orange- they too must be unique, as they correspond to the ID of the generated DIV that will contain each RSS feed instance.

mharrsch
01-28-2007, 01:35 AM
Yes, I did. When the page loads, you see the first RSS feed start to load then the second RSS feed loads in its proper place in the second column but the first RSS feed shows the spinning wheel and just keeps spinning. Script example:

First column:

<script type="text/javascript">
var showromanarch=new rssdisplaybox("romanarch")
showromanarch.set_items_shown(10) //show 10 entries from feed
showromanarch.start() //Required: start script
</script>

Second column:

<script type="text/javascript">
var showgames=new rssdisplaybox("games")
showgames.set_items_shown(10) //show 10 entries from feed
showgames.start() //Required: start script
</script>

In main.php:

$rsslist=array(
"romanarch" => "http://uoregon.edu/~mharrsch/romanwonders.rss",
"games" => "http://uoregon.edu/~mharrsch/ancientgames.rss",
"scholars" => "http://uoregon.edu/~mharrsch/rscholars.rss",
"acadpres" => "http://uoregon.edu/~mharrsch/academicpres.rss" //no trailing comma after last RSS URL!!

Maybe I didn't wait long enough but it kept spinning even after several minutes. If I use the script just in column 1 romanarch.rss displays really quickly. Likewise, if I use the script in just column 2 ancientgames.rss displays really quickly.

ddadmin
01-28-2007, 07:09 AM
Did you remember to pass in a unique ID for each RSS instance? In your code posted above you didn't do that:


var showromanarch=new rssdisplaybox("romanarch", "missingid", "missingclass")