Credit Block

Purpose

What I would like to see is a "last edited by" block that includes everybody who had a hand in developing the page. It would be nice to show who originally started the page. Maybe add a block of text to PmWiki pages showing the last editor and all previous editors, such as:

Last edited by AliceFakename. Based on work by BobNotaperson, CharlieDoesntexist and anonymous users of SomeWiki.

Solution

v0.3

v0.2

Credits Block is a script that provides a customizable block that can include only the last author, or every contributer who had a hand in a page. This script creates a variable $CreditsBlock that can be used in Cookbook/PmWikiTemplates. The configuration variables below help customize the credits block.

This useful script was originally developed for the PmWiki 1.0 series. Version 0.3 was coded and tested using PmWiki 2.0.beta14.

Installation Instructions

To install the software, unpack the zip file, and copy its contents to your pmwiki directory:

  1. unzip pmwiki-credits-0.3.zip (or) tar xvfz pmwiki-credits-0.3.tar.gz
  2. cp -R pmwiki-credits-0.3/* /path/to/pmwiki/
  3. Activate this script by adding the following line to your local/config.php file:
include_once('cookbook/credits.php');

This will create a variable, $CreditBlock, that you can put into your PmWiki templates however you like. I put mine at the bottom at the page, right after the "last edited" stuff.

Configuration Variables:

This module uses the following configuration variables:

$CreditAnd (Default "and ")
This provides the conjunction to join the last contributer to the "CreditOthersFormat" list.
$CreditAnonymous (Default "an anonymous user of $WikiTitle")
A string meaning a single anonymous user.
$CreditAnonymousPlural (Default "anonymous users of $WikiTitle")
A string meaning a multiple anonymous users.
$CreditAuthorLinks (Default 1)
Determines if the author name links to the author page
  • 0 -- no link
  • 1 -- link
$CreditComma (Default
", "): The mortar that joins the contributers in the "CreditOthersFormat" list.
$CreditFirstFmt (Default "Originally by \$first.")
A pattern for the credit block, showing the original person to edit the page. The substitution variable "$first" shows where to put the name.
$CreditLangauge (Default "EN")
The two-letter language code (based on ISO 639-2) for the target language. When used with the language.php file, allows for more flexible joining of names for the other contributers.
$CreditLastFmt (Default "Last edited by \$last.")
A pattern for the credit block, showing the last person to edit the page. The substitution variable "$last" shows where to put the name.
$CreditLimit (Default 2)
Maximum number of credits to list. And, yes, it's a pun.
  • 0 -- omit the credit block
  • 1 -- Show the original author and the latest editor only
  • 2 -- Show all contributers.
$CreditOthersFormat (Defaults "Based on work by \$others.")
A pattern for the credit block, showing the other people who've edited the page. The substitution variable "$others" shows where to put the list of other contributors.

History

2004 May 28 -- 0.1.
First version, probably pretty buggy.
2004 July 20 -- 0.2.
Change to comply with the ComplexRecipes layout.
2005 January 3 --0.3
Recoded.
  1. Added ability to have the credit block provide links to the profile pages for each contributer.
  2. Will space names in accordance with SpaceWikiWords
  3. Added "language.php" that allows user to define the language for the other contributers listing. Presently there is only English (EN), Esperanto (EO), and German (DE). If you add a language, please share.

Comments

  • Should show "overflow" credits on a separate page.
  • Reads the page before any other code gets to it; it would be nice to figure out a way to "hook" into page display, so the file doesn't have to be read twice.
  • When the page history expires or is forced to expire, those authors are no longer credited.

Bugs

(These are specific code failures for v0.3)

Contributors

Copyright

Copyright 2004, Evan Prodromou. Made available to you through the General Public License (GPL), which is in the zip file.