r10 - 06 Jun 2006 - 01:01:24 - PeterThoenyYou are here: TWiki >  Plugins Web > RandomQuotePlugin
Tags:
, create new tag

RandomQuotePlugin

Note: Previos discussion moved to RandomQuotePluginDev

Retrieve a random quote from a specially formatted TWiki topic and display on a TWiki page

Syntax Rules

The %RANDOMQUOTE{...}% variable gets expanded to a random quote selected from a RandomQuotes? page.

%RANDOMQUOTE%
Parameter
down
Explanation Default
web Name of the web where the random quotes topic is stored. Main
quotes_file Alternate name for the random quotes topic RandomQuotes?
format Format of one item. Can include variables in the table below. "\"$saying\"--$author"

Format $variablesdown Description
$saying Text of the random quote
$category What type of quote is this?
(could be used to match with Topic Classification)
$author Who said it?

Examples

%RANDOMQUOTE{ web="Main" quotes_file="JunkQuotes" }%

Topic JunkQuotes? does not exist!

%RANDOMQUOTE{ web="Main" }%

"Anything that can go wrong will go wrong."--Murphy's Law

%RANDOMQUOTE{ format="<p><cite>$saying</cite></p><p align='right'>&#65533;$author</p>" }%

It is impossible to make anything foolproof because fools are so ingenious.

—Murphy's Law

RandomQuotePlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %INTERWIKIPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Display a random quote in a TWiki topic

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

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 RandomQuotePlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/Main/RandomQuotes.txt RandomQuotesPlugin data topic
    data/TWiki/RandomQuotePlugin.txt Plugin topic
    data/TWiki/RandomQuotePlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/RandomQuotePlugin.pm Plugin Perl module
  • Test if the installation was successful:
%RANDOMQUOTE{}%

Plugin Info

Plugin Author: JasonTromm
Plugin Version: 03 Jul 2003 (V0.001)
Change History:  
03 Jun 2003: 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: TWikiPreferences, TWikiPlugins

-- TWiki:Main/JasonTromm - 03 Jul 2003

Topic attachments
I Attachment Action Size Date Who Comment
zipzip RandomQuotePlugin.zip manage 8.5 K 03 Jul 2003 - 21:00 JasonTromm Complete package with example "Murphy's Laws"
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r10 < r9 < r8 < r7 < r6 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo