[pmwiki-users] New Cookbook: RandomQuoteWiki

Daniel Scheibler scheibi at gmail.com
Tue Aug 2 05:01:54 CDT 2005


Hi Christophe,

there also exists a random quote receipe
http://www.pmwiki.org/wiki/Cookbook/RandomQuote

The last described version (at bottom of page) uses 
a wiki page by default called Main.Quotes were the different quotes
are structured as lists, like this:

* quota 1
* quote 2

It seems to be easier as your way.

Greets,

scheiby
-- 
Daniel Scheibler     ========:}       student at
eMail: scheibi at gmail.com              BTU Cottbus/Germany
WWW:   http://www.scheiby.de

2005/8/2, Christophe David <pmwiki at christophedavid.org>:
> Question : How can I display a random quote from a list stored in a PmWiki
> page, and not from a flat file that I cannot access easily ?
> 
> Answer: Copy RandomQuoteWiki.php to the cookbook directory and add
> include_once("cookbook/RandomQuoteWiki.php"); to config.php.
> 
> This script adds two markups (:RandomQuoteWiki_quote:) and
> (:RandomQuoteWiki_author:) that contain a random quote stored in a pmwiki
> page (instead of a flat file that cannot be accessed by most users).
> 
> The quotes must be structured like
> 
>     <quotes>
>        <quote>
>           <text>quote text 1</text>
>           <author> quote author 1</author>
>        </quote>
>        <quote>
>           <text>quote text 2</text>
>           <author>quote author 2</author>
>        </quote>
>        ...
>     </quotes>
> 
> To use this script, simply copy it into the cookbook/ directory and add
> the following line to config.php or a per-page/per-group customization
> file.
> 
> include_once('cookbook/RandomQuoteWiki.php');
> 
> Then add something like
>       || '''(:RandomQuoteWiki_quote:)''' ||
>       || (:RandomQuoteWiki_author:) ||
> 
> in your wiki page.
> 
> ---
> 
> Comments welcome.
> 
> Christophe




More information about the pmwiki-users mailing list