%META:TOPICINFO{author="TWikiContributor" date="1289453392" format="1.1" version="1"}%
---+!! <nop>%TOPIC%
<!--
   Contributions to this TWiki plugin are appreciated. Please update the plugin page at
   http://twiki.org/cgi-bin/view/Plugins/RandomQuotePlugin or provide feedback at
   http://twiki.org/cgi-bin/view/Plugins/RandomQuotePluginDev.
   If you are a TWiki contributor please update the plugin in the SVN repository.
-->
<sticky><div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;">
%TOC{title="Page contents"}%
</div></sticky>
%SHORTDESCRIPTION%

---++ Syntax Rules

The =%<nop>RANDOMQUOTE{...}%= variable gets expanded to a random quote selected from a %USERSWEB%.RandomQuotes page.

%TABLE{ sort="on" headerrows="1" initsort="1" }% 
| *%<nop>RANDOMQUOTE%%BR%Parameter* | *Explanation* | *Default* |
| =format= | Format of one item. Can include variables in the table below. | "\"$saying\"--$author" |
| =web= | Name of the web where the random quotes topic is stored. | %USERSWEB% |
| =quotes_file= | Alternate name for the random quotes topic | %USERSWEB%.RandomQuotes |

%TABLE{ sort="on" headerrows="1" initsort="1" }%
| *Format $variables* | *Description* |
| $author | Who said it? |
| $saying | Text of the random quote |
| $category | What type of quote is this?%BR%(could be used to match with Topic Classification) |

---++ Examples

%<nop>RANDOMQUOTE{ web="Sandbox" quotes_file="NotableQuotes" }%

%RANDOMQUOTE{ web="Sandbox" quotes_file="NotableQuotes" }% 

%<nop>RANDOMQUOTE{ web="%USERSWEB%" }%

%RANDOMQUOTE{ web="%USERSWEB%" }%

<verbatim>
%RANDOMQUOTE{ format="<p><cite>$saying</cite></p><p align='right'>- $author</p>" }%
</verbatim>

<table width="50%" align="center">
<td><tr>
%RANDOMQUOTE{ format="<p><cite>$saying</cite></p><p align='right'>- $author</p>" }%
</td></tr>
</table>

---++ <nop>%TOPIC% Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, i.e. ==%<nop>RANDOMQUOTEPLUGIN_SHORTDESCRIPTION%==

   * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic:
      * Set SHORTDESCRIPTION = Display a random quote

   * Debug plugin: (See output in =data/debug.txt=)
      * Set DEBUG = 0

---++ Plugin Installation Instructions

__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running. 

   * Download the ZIP file from the Plugin web (see below)
   * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
     | *File:* | *Description:* |
     | ==data/Main/RandomQuotes== | RandomQuotePlugin data topic |
     | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
     | ==data/Sandbox/NotableQuotes.txt== | Sample quotes |
     | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
   * Test if the installation was successful:
%RANDOMQUOTE{}%

---++ Plugin Info

|  Plugin Author: | TWiki:Main.JasonTromm |
|  Copyright: | &copy; 2003, TWiki:Main.JasonTromm <br /> &copy; 2006-2010 TWiki:TWiki/TWikiContributor |
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
|  Plugin Version: | 2010-11-10 (V1.0) |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  2010-11-10: | TWikibug:Item6530: Doc improvements |
|  2003-07-03: | Initial version |
|  CPAN Dependencies: | none |
|  Other Dependencies: | none |
|  Perl Version: | 5.005 |
|  Plugin Home: | http://twiki.org/cgi-bin/view/Plugins/RandomQuotePlugin |
|  Feedback: | http://twiki.org/cgi-bin/view/Plugins/RandomQuotePluginDev |

__Related Topics:__ %SYSTEMWEB%.TWikiPreferences, %SYSTEMWEB%.TWikiPlugins
