NP_RandomQuote.php

Display a randomly selected quote from a text file database.

General Plugin info
Author: Aspirant
Current Version: 1.1
Code: NP_RandomQuote_code

Installing

  1. Copy and paste and save as NP_RandomQuote.php
  2. Install the plugin…

How to use the plugin

I have a collection of quotes that I find inspirational that I have been collecting for many years. I wanted a way to display them on my blog. Since I already have the database, I wanted a plugin that would use the format I have been using in other software for years. NP_RandomQuote does this.

The quote files must be in the format demonstrated below. There may be any number of quote files, and the files may contain any number of entries. Put them in the content directory configured in the options.

<p>It's choice - not chance - that determines your destiny.</p>

<p>- Jean Nidetch</p> 
$END

<p>Character - the willingness to accept responsibility
for one's own life - is the source from which self respect
springs.</p>

<p>- Joan Didion, <ul>Slouching Towards Bethlehem</ul></p>
$END

Available SkinVars and/or TemplateVars

<%RandomQuote( file, time to live )%> file: filename with quotes (example: quotes.txt) time to live: time after which the displayed quote is rotated in milliseconds (this was not documented, made up from looking at the code - Armon)

Options

There are three configurable options:

  • The content directory - this is the path to the files containing the quotations
  • The content extension - this defaults to .txt. Files with a different extension will be ignored
  • The cache directory - this is where the currently selected quotes are cached. You http server must have write permissions in this directory or the plugin will fail.

These options may be configured from the plugin management screen.

Tips and Tricks

Wishlist

Bugs

History

  • [Version 0.1, released 2005-02-17]
    • [CHANGED: foobar]

Plugin review

NP_RandomQuote version 0.1 works with Nucleus CMS 3.31 - 2007-10-28 Armon

randomquote.txt · Last modified: 2009/12/07 16:37 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki