Pausing RSS scroller
Requirement of this script: Support for PHP for the site hosting the LastRSS script.
Here are some features of Pausing RSS scroller:
- Displays any RSS feed on the web in a scroll and pause fashion. Specify exactly what components of the feed items to display, such as the title of the item, description, or post date.
- Each RSS feed is cached on the server for best performance. LastRSS feature.
- RSS feed is fetched asynchronously similar to in Ajax, so its loading process does not affect that of the rest of the page.
- Scroller pauses onMouseover.
- Display multiple RSS tickers on a page, each with their own independent settings.
- Scroller can be embedded on any site, allowing for syndication of a feed on other sites.
- Ability to limit the domains that are allowed to show the RSS scroller through referral checking, if you do not wish any site to show it (anti-syndication).
Each scroller instance is called independently on the page, using the core function:
Detailed info below.
Directions: The easiest way to install Pausing RSS scroller is to download the zip file below:-rsspausescroller.zip
which contains all the files that make up the script. They are:
- demo.htm: working demo of Pausing RSS Scroller
- lastrss/lastRSS.php: lastRSS.php class, unmodified.
Follow the below instructions step by step to install the scroller on your page:
1) For demo.htm:
Open up "demo.htm", and copy the code found inside into the page(s) you wish the ticker to be displayed in. Make sure the code:
//credit notice here
inside the HEAD section correctly references the location of "rsspausescroller.js" on your server, if it's been moved to a different directory.
The code inside the BODY section shows how to invoke an RSS scroller instance:
//new rsspausescroller(RSS_id, divId, divClass, delay, linktarget, optionalswitch)
//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", or "date+description" to also show these parts of a RSS feed.
new rsspausescroller("dynamicdrive", "pscroller2", "rssclass", 3000, "", "date+description")
2) For rsspausescroller.js:
Open up "rsspausescroller.js", and at the top, simply make sure the URL to "scrollerbridge.php" on your server is correct:
//URL to "scrollerbridge.php" on your server: var bridgepath="lastrss/scrollerbridge.php"
3) For scrollerbridge.php:
Two variables of interest are:
$rss->cache_time = 1800; //Global cache time before fetching RSS feed again, in seconds. $allowedDomains=""; //Domains that are authorized to display scroller.
The first one sets the caching period of every RSS feed on your server, in seconds. A good value is at least 1/2 hour (1800). Note that while you're testing out the script privately on your server, you may wish to set it to "0" temporarily, so any changes you make are instantly acknowledged.
4) For lastRSS.php: No editing required. Upload as is.
And that's it!
Syndicating your RSS feed on other sites using Pausing RSS scroller
A) The reference to rsspausescroller.js (inside the script of step 1) is absolute and correct:
B) On your own server, that the reference to "scrollerbridge.php" inside rsspausescroller.js is absolute and correct:
C) And finally, on your own server, that the $allowedDomains variable inside "scrollerbridge.php" is set to a blank string:
Time to display some nice RSS feeds on your site, and spread that love as well!