From foo@bar  Sun Apr 24 17:35:02 2005
Subject: WikiPlugin
From: foo@bar (PhpWiki)
Date: Sat, 23 Apr 2005 23:17:18 +0900
Mime-Version: 1.0 (Produced by PhpWiki 1.3.0-jeffs-hacks)
Content-Type: application/x-phpwiki;
  pagename=WikiPlugin;
  author=DbWiki;
  version=1;
  flags="";
  lastmodified=1114265838;
  author_id=DbWiki
Content-Transfer-Encoding: quoted-printable

The latest hacks include support for !WikiPlugins.

!WikiPlugins allow one to easily add new types of dynamic content (as well =
as other functionality)
to wiki pages within PhpWiki.  In this very wiki, the RecentChanges,  =
BackLinks,
LikePages and DebugInfo pages are all implemented using plugins.
I expect that the search result pages, as well as much =
PhpWikiAdministration will
soon be implemented via plugins as well.  (I think the oh-so-ugly
[MagicPhpWikiURLs] can be replaced by plugins, too.)

!Example

Currently, one invokes a plugin by putting something like:

  <?''''plugin !BackLinks?>

into a regular wiki-page.  That particular example produces as list
of pages which link to the current page.  Here it is:

<?plugin BackLinks?>

(This is great for Category and Topic pages.  You can use this to get
an automatic in-line listing of pages in the Category or Topic.)

!Details

(This is all subject to change.)

Plugins can take certain named arguments (most do).
The values of these arguments can be determined four different ways.
In order of precedence:
# The plugin invocation can specify the value for an argument, like so:
;;: <?''''plugin !BackLinks page=3D!OtherPage ?>
# The argument can be specified via an HTTP query argument.  This doesn't =
happen (is not allowed) unless the argument is mentioned in the plugin =
invocation:
;;: <?''''plugin !BackLinks page ?>
# Default values specified in the plugin invocation:
;;: <?''''plugin !BackLinks page||=3D!OtherPage ?>
# The plugin must supply default values for each argument it uses.  (The =
BackLinks plugin uses
the current page as the default value for the ''page'' argument.


!More Ideas for Plugins
* Search
* MostPopular
* WantedPages, OrphanPages, other various indexing schemes.
* Diff, PageHistory
* TitleSearch: LikePages (match_head, match_tail).
* Redirect plugin -- <?''''plugin Redirect target=3D!OtherPage ?>
* Calendar
