rss_live_archive

Plugin Details

Download:
rss_live_archive  v0.7
Textpattern Forum:
View discussion
Plugin Type:
Admin
Current Version:
0.7
Status on this site:
Active

The rss_live_archive plugin is an implementation of Michael Heilemann’s idea of a digging archive. It is an AJAX based plugin that works similarly to rss_live_search. This plugin is in many respects a Textpattern port of Jonas Rabbe’s Super Archives Plugin for Wordpress.

The plugin gives you the ability to drill down through your archives by selecting the year, then the month and finally the specific post.

See the plugin in action


Note

The plugin requires Textpattern 1.0 RC3 Rev 351 or greater to work completely. It actually will still work on revisions before that, the live archive settings tab will just look a little funky. So if you’d like you can try using it as far back as Rev 198 when admin plugin support was added.

Revision History

// Version 0.1 – 05/12/2005 – Initial implementation.
// Version 0.2 – 05/13/2005 – Rewrite of year month and post sql for performance.
// Version 0.3 – 05/23/2005 – Rewrite of pretty much everything. Added caching.
// Version 0.4 – 05/25/2005 – Addition of admin tab and automatic cache rebuilding.
// Version 0.5 – 05/27/2005 – No longer a self-closing tag to accomodate <noscript> code. Added subdate.

Caching

The live archive data is cached in your file upload directory to maxmize loading times while navigating through the archive. By default, the cache will only be rebuilt if a use views the live archive and an article or comment has been added.

You have the option (which I would recommend) to turn auto recaching on so that each time you save an article or a comment is posted the cache will automatically be rebuilt immediately. This will prevent a user from waiting while the cache is rebuilt.

When turning auto recaching on, be sure to set the same sections and categories that you use in your call to the rss_live_archive.

How to Use This Plugin

  • Install and activate the plugin of course.
  • Check the File Upload Path in your Site Preferences to be sure its correct and the directory is writable.
  • Navigate to the extensions -> live archive tab to turn auto recaching on. Set the sections and categories you want to cache and save your settings.
  • Go to any old article and hit the Publish button to initialize your cache.
  • Add a call to <txp:rss_live_archive_js /> in the <head> section of your page. Add any of the optional attributes below.
  • Add a call to <txp:rss_live_archive></txp:rss_live_archive> wherever you want the search form to appear. Add any of the optional attributes below. Anything placed inside the open and close tags will be displayed if javascript is not enabled.
  • Include the styles below in your stylesheet. Feel free to modify the styles as you see fit.

rss_live_archive_js Attributes

loading
The message that is displayed while the archive is loading.
Default: “Loading Article Archives…”
Example: loading=“Please Wait…”

rss_live_archive Attributes

section
Accepts a comma separated list of sections. NO spaces after commas.
Default: “article”
Example: section=“journal”

category
Accepts a comma separated list of categories. NO spaces after commas.
Default: “”
Example: category=“web,textpattern”

showpostscount
Shows the number of articles posted in a year/month next to the name of the year/month.
Default: “1”
Example: showpostscount=“0”

showcommentscount
Shows the number of comments next to an article.
Default: “1”
Example: showcommentscount=“0”

showzerocount
Shows the number of comments next to an article as the number zero (0) if there are no comments.
Default: “0”
Example: showzerocount=“1”

countprefix
Text displayed before the showcount number.
Default: “”
Example: countprefix=”(”

countsuffix
Text displayed after the showcount number.
Default: “”
Example: countsuffix=”)”

showsubdate
Displays a date preceeding the article title.
Default: “0”
Example: showsubdate=“1”

subdateformat
Accepts strftime formats.
Default: “%d”
Example: subdateformat=”%a”

subdatesep
Places the given text in between the subdate and the article title.
Default: “: “
Example: subdatesep=” – “

Example Usage

Anything placed inside the opening and closing of the rss_live_archive tag will be displayed if javascript is not enabled. That goes for Textpattern tags as well. Here’s an example that will degrade gracefully to a standard archive listing.
<txp:rss_live_archive> <txp:rss_suparchive /> </txp:rss_live_archive>

Example Styles

#rssLiveArchive { margin: 10px 0 0; }

#rssLiveArchive ul { padding: 0; list-style-type: none; }

#rssLiveArchive ul li { text-align: left; padding: 1px 8px; }

#rssLiveArchive-year { float: left; width: 100px; margin: 0; padding: 0; }

#rssLiveArchive-year li { position: relative; font-weight: bold; }

#rssLiveArchive-month { float: left; width: 100px; margin: 0; font-weight: bold; }

#rssLiveArchive-month li { position: relative; }

#rssLiveArchive-post { float: left; width: 250px; margin: 0; }

#rssLiveArchive-post li { position: relative; font-weight: bold; }

#rssLiveArchive ul li span { position: absolute; right: 8px; font-weight: normal; color: #333; }

*html #rssLiveArchive ul li span { top: -4px; }

#rssLiveArchive .selected { background: #eee; padding-top: 0; padding-bottom: 0; }

Textpattern Solutions

Textpattern Solutions

Textpattern Solutions is the first book published on Textpattern.

details at friends of ED or the official book website.

buy it at amazon.com