RandomQuote

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Goal

Insert a random quote into a wiki page.

Solution

Attach:randomquote.zip

randomquote.zip unpacks into local/quote.php and pub/quotes.txt.

Discussion

Randomquote adds the markup [[randquote]] which will be replaced by a randomly chosen line from quotes.txt. The line is enclosed in a div with id=randquote.

The format for quotes.txt is one quote per line with pipes ( | ) used to denote line breaks within the quote. Each pipe will be replaced with <br> before the quote is inserted.

I've noted one CSS related problem. Margins and padding on the div randquote don't seem to work.

You can see it in action at: http://wiki.thunderbunny.org/GeekStuff/RandomQuote

Contributor

  • Dave Noonan

For a different version that takes the quotes from a Wiki page have a look at my markup extension at http://www.b-a-l-u.de/index.php/Projects/RandomQuote -- Balu (2004-03-22)


I extended Balu's version of randomquote.php to use CSS (Attach:randomquote-thom.php.txt). For an example see http://beeblebrox.net.

--thom pmwiki-2.2.115 -- Last modified by {{thom}}

from IP: 85.171.160.186 ip should be disabled by default for security reasons