PDA

View Full Version : Pausing RSS Scroller



tperdue
03-12-2012, 08:53 PM
I have followed your instructions on the Pausing RSS Scroller (http://www.dynamicdrive.com/dynamicindex17/rsspausescroller/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.

jscheuer1
03-12-2012, 11:19 PM
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.

tperdue
03-13-2012, 02:09 AM
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

jscheuer1
03-13-2012, 02:40 AM
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):


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


<script type="text/javascript">

document.write("<br />") //add a divider for demo

new rsspausescroller("dynamicdrive", "pscroller2", "rssclass", 3000, "", "date+description")

</script>

to:


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

tperdue
03-14-2012, 01:33 PM
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

/*
======================================================================
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:

jscheuer1
03-14-2012, 04:48 PM
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:

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.

tperdue
03-14-2012, 11:06 PM
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?

jscheuer1
03-15-2012, 01:41 AM
Looks good! With it being so narrow though I think I'd decrease the limit on the description length to say 750:


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


#pscroller2 img {
display: none;
}

If you want to donate, look at my sig or hit this link:

Donate (http://home.comcast.net/~jscheuer1/side/donate.htm)