PDA

View Full Version : help with rsspausescroller



breakwater
01-29-2007, 11:01 PM
1) Script Title: rsspausescroller

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

3) Describe problem:

I would like to know where, and in which file given with this script to change the names and url's of the Rss feeds for the script to stream.

everything i have done has just lead to "Error: Can't find requested RSS in list.
I give up trying to fetch RSS feed."

I am ok with html, but don't understand javascript, or php

thank you

ddadmin
01-29-2007, 11:56 PM
Hi:
You specify the URLs to the RSS feeds inside scrollerbridge.php:


// Define your list of RSS URLs- "RSS_id"=> "URL to RSS feed"
$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"
);

The first portion are just identifiers, such as "cnn", "bbc" etc, which you can change to your own. The 2nd portion is the full valid URL to the RSS feed.

breakwater
01-30-2007, 12:32 AM
Thanks,

I've actually done that but something isnt working correctly.
here is what's happening:

http://www.brinyfishing.com/demo

please let me know if there is something i can do to better show you what i've got.

cursed
01-30-2007, 01:15 AM
could u show the source for :
scrollerbridge.php?

breakwater
01-30-2007, 01:32 AM
<?php

/*
======================================================================
Pausing RSS Scroller bridge script
Author: Dynamic Drive (http://www.dynamicdrive.com)
Created: March 16th, 2006.
Function: Converts requested RSS feed from lastRSS into JavaScript array
======================================================================
*/

// include lastRSS
include "lastRSS.php"; //path to lastRSS.php on your server relative to scrollerbridge.php

// Create lastRSS object
$rss = new lastRSS;
$rss->cache_dir = 'cache'; //path to cache directory on your server relative to scrollerbridge.php. Chmod 777!
$rss->date_format = 'M d, Y g:i:s A'; //date format of RSS item. See PHP date() function for possible input.
$rss->cache_time = 1800; //Global cache time before fetching RSS feed again, in seconds.

// Define your list of RSS URLs- "RSS_id"=> "URL to RSS feed"
$rsslist=array(
"test" => "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml",
);

//Domains that are authorized to display scroller:
//Seperate multiple domains each with a comma (",")
//For example: $allowedDomains="dynamicdrive.com, javascriptkit.com"
//OR enter a blank string to allow any domain (ie: for RSS feed syndication):
$allowedDomains="";

////Beginners don't need to configure past here////////////////////

Header("content-type: application/x-javascript");
$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("rsscontentdata=\"Error: Can't find requested RSS in list.\"");
$divid=$_GET['divid']; //ID of DIV scroller

// -------------------------------------------------------------------
// checkdomains()- Checks that current site is authorized to display scroller
// -------------------------------------------------------------------

function checkdomains($allowed, $referral){
if ($allowed!=""){
$found=0;
$allowlist=split (",", $allowed);
foreach ($allowlist as $allow){
$allow=trim($allow);
$found+=strpos(" ".$referral, $allow);
}
if (!$found)
die("rsscontentdata=\"This domain isn't authorized to show scroller.\"");
}
}

@checkdomains($allowedDomains, $_SERVER["HTTP_REFERER"]); //check if domain is authorized to display scroller

// -------------------------------------------------------------------
// outputRSS_JS()- Outputs the "title", "link", "description", and "pubDate" elements of an RSS feed in XML format
// -------------------------------------------------------------------

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++;
}
if ($rs['items_count'] <= 0) { echo "rsscontentdata=\"Sorry, no items found in the RSS file\""; }
}
else {
echo "rsscontentdata=\"Sorry: It's not possible to reach RSS file $url\"";
// All else fails
}
}

function sla****($what){ //Encode text for storing in JavaScript array
$newstring=str_replace('&apos;', '\'', $what); //replace those half valid apostrophe entities with actual apostrophes
return rawurlencode($newstring);
}

// ===============================================================================

outputRSS_JS($rssurl, $divid);

?>

the current rss feed that is listed is not the one i will be using on the site. I am only using that valid BBC feed to make this work.

Thank You

ddadmin
01-30-2007, 02:32 AM
Try changing:


$rsslist=array(
"test" => "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml",
);

inside scrollbridge.php to:


$rsslist=array(
"test" => "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml",
"dynamicdrive" => "http://www.dynamicdrive.com/export.php?type=new"
);

Then, see if the script can at least retrieve your RSS feeds, by making a direct call: http://www.brinyfishing.com/lastrss/scrollerbridge.php?id=test

breakwater
01-30-2007, 04:19 PM
Ok, i've done that.

Its still not displaying the rss feed. on the demo page.

though i think it can retrieve the feed.

thanks, what should i try now?

breakwater
02-02-2007, 05:41 PM
sorry for the...

bump

ddadmin
02-03-2007, 03:58 AM
though i think it can retrieve the feed.

Actually, it still doesn't seem like you can even do that. For example: http://www.brinyfishing.com/lastrss/scrollerbridge.php?id=test It it worked, you should be seeing the contents of the RSS feed in your browser.

I'm inclined to think the issue is with your server not meeting all the requirements need to run LastRSS. Do you have a different server you can test this script on to confirm if that's true? Either that, or you can try installing RSS boxes, which uses a different PHP RSS parsing script. If that works, then it confirms my suspicion.

breakwater
02-05-2007, 03:45 PM
Yes, i do have different servers to test the script on, but they are all on the same hosting company. Godaddy.

The attraction to this script is that i can have other sites cut and paste the code to display the feeds on thier site, as opposed to the ajax one. So i'd love to somehow get this working if possible.

Is there a way i can find out for sure if this server doesnt meet the requirements?

Thank You

ddadmin
02-05-2007, 10:25 PM
Is there a way i can find out for sure if this server doesnt meet the requirements?

Thank You

Yep, the best way is to try installing LastRSS (http://lastrss.oslab.net/)on its own on your server (just follow the directions on their webpage). If you can get RSS feeds to show up, then we know for sure your server can at least run the LastRSS component of this scroller, the most important part.

breakwater
02-09-2007, 03:06 AM
well, if I were a coder, perhaps i'd understand more than .02% of that webpage. :(