Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: help with rsspausescroller

  1. #1
    Join Date
    Jan 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help with rsspausescroller

    1) Script Title: rsspausescroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ller/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
    Last edited by ddadmin; 01-29-2007 at 11:56 PM.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hi:
    You specify the URLs to the RSS feeds inside scrollerbridge.php:

    Code:
    // 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.
    Last edited by ddadmin; 01-30-2007 at 02:31 AM.

  3. #3
    Join Date
    Jan 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Aug 2006
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    could u show the source for :
    scrollerbridge.php?

  5. #5
    Join Date
    Jan 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

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

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try changing:

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

    Code:
    $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/...ge.php?id=test

  7. #7
    Join Date
    Jan 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  8. #8
    Join Date
    Jan 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry for the...

    bump

  9. #9
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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/...ge.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.

  10. #10
    Join Date
    Jan 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •