Results 1 to 8 of 8

Thread: Pausing RSS Scroller

  1. #1
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pausing RSS Scroller

    I have followed your instructions on the Pausing RSS Scroller (http://www.dynamicdrive.com/dynamici...ller/index.htm), but can’t figure out how to place my own RSS content (feed) on it.

    Would you be willing to help?

    Please let me know if you can help and I will follow up with details about my site. Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Probably.

    But unless there's something odd about your feed, just follow the instructions on the demo page, it should be fine.

    The script does require a PHP enabled server though. Is that where you're testing this? It will never work on the local machine alone.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,

    Thanks for your response. Here are a copy of my files:

    Test Page: http://www.contiwarehouses.com/index1.php
    RSS Feed: http://www.contiwarehouses.com/rss.xml

    When I tried to make changes on the files below, I could not get it to work with my RSS feed --- so perhaps you can direct me better on what to change?

    rsspausescroller.js
    scrollerbridge.php
    lastRSS.php

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The only thing I think it might not specifically tell you on the demo page is that in scrollerbridge.php you have to configure your feed (addition highlighted):

    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(
    "myfeed" => "http://www.contiwarehouses.com/rss.xml",
    "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",
    );
    
    //Domains that are authorized to display scroller:
    //Seperate multiple domains eac . . .
    Then on the contiwarehouses.com/index1.php page you can change (this part is explained on the demo page, but I'll repeat it here):

    Code:
    <script type="text/javascript">
    
    document.write("<br />") //add a divider for demo
    
    new rsspausescroller("dynamicdrive", "pscroller2", "rssclass", 3000, "", "date+description")
    
    </script>
    to:

    Code:
    <script type="text/javascript">
    
    new rsspausescroller("myfeed", "pscroller2", "rssclass", 3000, "", "date+description");
    
    </script>
    Since what you have there now is working for the Dynamic Drive feed, those are the only changes you should need, at least to get your feed displaying.

    Note: This script is a bit outdated and at times doesn't handle things exactly right (notice the CDATA tags in the DD feed, and sometimes non-English characters or even just characters that aren't in the page's charset can present problems). If you have either of those problems with your feed once you get it displaying, let me know - I have an updated version. But, as long as it works for you as is, no need to update.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    AS you had seen from previous posts, my example on the /index1.php was working.
    After following the above instruction, it is no longer working - It's doing exactly what I had happen prior to me posting my problem originally. Here's the link again:
    http://www.contiwarehouses.com/index1.php

    Should I attempt to use your updated version? or is there something else missing?

    btw, I did change all that you suggested above and reloaded it. Since you probably can't see my scrollerbridge.php file, here is what I pasted and uploaded as new:

    PHP Code:
    <?php

    /*
    ======================================================================
    Pausing RSS Scroller bridge script
    Author: Dynamic Drive ([url]http://www.dynamicdrive.com[/url])
    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(
    "myfeed" => "http://www.contiwarehouses.com/rss.xml",
    "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",
    );

    //Domains that are authorized to display scroller:
    Last edited by jscheuer1; 03-14-2012 at 02:58 PM. Reason: Format

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's what I was afraid of. I later tried it out on my local host and got the same thing. So, I've made up an archive for you of the updated version already configured to your needs:

    Attachment 4398

    Hopefully that will take care of it for you, works here.

    Notes:

    • Just about everything has changed in at least some subtle way so backup what you have, and use all the files in this archive instead. Most things are the same though, so it should be easy to find your way around in the new files if you have to.

    • It now uses simplepie (included in the archive) instead of LastRSS.

    • Modified the rsspausescroller.js to fix a bug where mouseover of the first item wouldn't pause it on the first time.

    • Added an optional 7th parameter for new rsspausescroller (descriptionlimit) to limit the description length, some of those descriptions were pretty long. It's use is documented in the demo_conti.htm file.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You are the bomb diggety!!!

    http://www.contiwarehouses.com/index1.php

    ... I am about to redo their website (I did not create the one you see), but once I do, it will look great using the code you helped me with. I feel I owe you something... please let me know how I can donate?

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Looks good! With it being so narrow though I think I'd decrease the limit on the description length to say 750:

    Code:
    <script type="text/javascript">
    //new rsspausescroller(RSS_id, divId, divClass, delay, linktarget, optionalswitch, descriptionlimit)
    //1) RSS_id: "Array key of RSS feed in scrollerbridge.php script"
    //2) divId: "ID of DIV to display ticker in. DIV is dynamically created"
    //3) divClass: "Class name of this ticker, for styling purposes"
    //4) delay: delay between message change, in milliseconds
    //5) linktarget: Target of links inside RSS feed. Set to "" for current page.
    //6) optionalswitch: "optional arbitrary" string to create additional logic for formatrssmessage() to use.
    	// By default, optionalswitch supports "date", "description', or "date+description" to also show these parts of a RSS feed.
    //7) descriptionlimit: if optionalswitch is used and includes description, optional character limit for the description
    
    new rsspausescroller("conti", "pscroller2", "rssclass", 3000, "_new", "date+description", 750)
    
    </script>
    You should be able to see all of what the script provides as the first two items without having to wait for it to scroll.

    Another thing I notice is that there are tracking images on some of the feed items. These are very small but for some reason (borders perhaps) they show up as white squares. I think it looks bad. You can make them go away by adding this rule to the stylesheet:

    Code:
    #pscroller2 img {
    	display: none;
    }
    If you want to donate, look at my sig or hit this link:

    Donate
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •