Extension:Realnames

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
Realnames

Release status:Extension status beta

ImplementationTemplate:Extension#type Parser extension
DescriptionTemplate:Extension#description Displays a user's real name everywhere
Author(s)Template:Extension#username Olivier Beatontalk
Latest versionTemplate:Extension#version 0.3.1 (2011-12-25)
MediaWikiTemplate:Extension#mediawiki 1.7.0
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license BSD 2-clause "Simplified" License
Download Extension website, pay what you want
Release notes
ParametersTemplate:Extension#parameters

$wgRealnamesLinkStyle

$wgRealnamesBareStyle

$wgRealnamesBlank

$wgRealnamesStyles

$wgRealnamesReplacements

$wgRealnamesSmart

$wgRealnamesNamespaces

Hooks usedTemplate:Extension#hook
BeforePageDisplayManual:Hooks/BeforePageDisplay
PersonalUrlsManual:Hooks/PersonalUrls

Translate the Realnames extension if it is available at translatewiki.net

Check usage and version matrix.

What can this extension do?[edit]

Attempts to replace any username links into realname links. This extension differs from other approaches in that it searches the page for links and replaces them, and does not rely on page hooks so should work in many more places. Compatibility with other extensions should also be very strong.

This means it works on:

While the focus of the extension is for realname display, it can be co-oped to change the display of username links to anything desired (add an image? another class?). This makes it incredibly powerful.

It was developed mainly for Enterprise/Corporate users of MediaWiki where realnames are much more important, and often make much more sense than algorithmically chosen usernames.

While the defaults do a wholesale replacement of usernames with realnames, the extension can easily be configured to append realnames (or display realnames and append usernames). See the configuration options bellow.

Currently there is no way to preserve User: prefixes on links or text.

Usage[edit]

Download instructions[edit]

You can download the extension from the author's website:

You can consult the CHANGELOG for version history.

Installation[edit]

To install this extension, add the following to LocalSettings.php:

require_once("$IP/extensions/Realnames/Realnames.php");
#add configuration parameters here

Configuration parameters[edit]

For your convenience, we also support Extension:Configure for settings these from within your wiki. See the talk page FAQ for further details.

Parameter Values Example Description
$wgRealnamesLinkStyle
  • "standard"
  • "append"
  • "replace"
  • "reverse"
  • "dash"
mw305

mw305 [Martha Stewart]
Martha Stewart
Martha Stewart [mw305]
mw305 – Martha Stewart

Provided for convenience, this is the default MediaWiki behavior


Default

$wgRealnamesBareStyle
  • false
  • "standard"
  • "append"
  • "replace"
  • "reverse"
  • "dash"
N/A

mw305
mw305 [Martha Stewart]
Martha Stewart
Martha Stewart [mw305]
mw305 – Martha Stewart

Uses same style name as $wgRealnamesLinkStyle

Provided for convenience, this is the standard MediaWiki behavior

Default

$wgRealnamesBlank
  • true
  • false
mw305 []
Do you want to show blank real names? This can make sense for append style but looks silly in reverse. The default false which shows a standard link instead.
$wgRealnamesStyles array ['mystyle'] = '<span class="custom">$1$3$4</span>' Allows for the custom creation of style types that can then be assigned for link and bare styles. Usually to add custom text. You get 4 variables in your style:
  • $1 link start
  • $2 username
  • $3 real name
  • $4 link end

Ensure to use ' quotes around your style string instead of " quotes, so that the $x do not get evaluated.

$wgRealnamesReplacements array ['title'] = TRUE

['subtitle'] = TRUE

['personnal'] = TRUE

['body'] = TRUE

Allows you to turn off replacement in specific sections.
$wgRealnamesSmart array ['same'] = TRUE Allows you to turn off specific smart features

same — does not replace if username=realname

$wgRealnamesNamespaces array [] = 'CustomUserBasedNamespace'; Allows you to add more namespaces for it to search for. Use this only if the article name is the username in a given namespace. Do not include the :, and keep it mind this is a regular expression string, you can use regexp modifiers, but as well may need to escape some characters.

Support[edit]

It's hoped that you will enjoy the extension, and if you do, consider purchasing it as a pay-what-you-want scheme on the author's website.

If you find a bug or wish to make a feature request, you can add to or start a topic on the talk page or contact the author.

Testing[edit]

It has been tested with:

  • MediaWiki svn trunk 2011-12-25, 1.18.0, 1.17.1, 1.16.5, 1.15.5

See also[edit]

Alternatives[edit]