I suggest that the outputRSS_JS function be revised to the following:
Code:
function outputRSS_JS($url, $divid) {
global $rss;
if ($rs = $rss->get($url)){
echo "rsscontentdata.$divid=new Array();\n";
$i=0;
foreach ($rs['items'] as $item) {
echo "rsscontentdata.$divid" . "[$i]={link:\"" . sla****($item['link']) . "\", title:\"" . sla****($item['title']) . "\", description:\"" . sla****($item['description']) . "\", date:\"" . sla****($item['pubDate']) . "\"}\n";
$i++;
}
echo "CurTime = new Date();\n";
if ($rs['items_count'] <= 0) { echo "rsscontentdata.$divid" . "[0]={link:\"" . "" . "\", title:\"" . "Error" . "\", description:\"" . "Sorry, no items found in the RSS file" . "\", date: CurTime}\n"; }
}
else {
echo "rsscontentdata.$divid=new Array();\n";
echo "CurTime = new Date();\n";
echo "rsscontentdata.$divid" . "[0]={link:\"" . "" . "\", title:\"" . "Error" . "\", description:\"" . "Sorry: It's not possible to reach RSS file $url" . "\", date: CurTime}\n";
// All else fails
// Prevents other scrollers from freezing due to incorrect data format being sent to Javascript functions
}
}
The later half (the main "else" statement) has been changed in order to send data to the javascript functions. Without this, any time a single rss file fails to open, all rsspausescrollers on the page will freeze. With this change, only the failed file's scroller will show a problem, which will display error text formatted by the javascript. This should make pages that use multiple scrollers less prone to complete failure.
Bookmarks