Extension:Realnames

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
Realnames
Release status: beta
Implementation Parser extension
Description Displays a user's real name everywhere
Author(s) ofbeatontalk
Latest version 0.3.1 (2011-12-25)
MediaWiki 1.7.0
PHP 5.3+
Database changes No
License BSD 2-clause "Simplified" License
Download
Release notes
Parameters

$wgRealnamesLinkStyle

$wgRealnamesBareStyle

$wgRealnamesBlank

$wgRealnamesStyles

$wgRealnamesReplacements

$wgRealnamesSmart

$wgRealnamesNamespaces
Hooks used
BeforePageDisplay
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 github:

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.

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]

Alternative extensions[edit]