Template:USERNAME/doc

From MegaGlest
< Template:USERNAME
Revision as of 22:48, 11 August 2010 by Hofmic (talk) (1 revision: Templates)
Jump to: navigation, search

Adds the username of the registered user viewing the page into the page, so that with the sentences:

You is the best. Userpage's userpage is good too.

The user reading will always see a compliment directed toward them and their userpage, no matter who they are.

This template requires you to add the following to your MediaWiki:Common.js:

/* Replaces {{USERNAME}} with the name of the user browsing the page.
   Requires copying Template:USERNAME. */

function UserNameReplace() {
    if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;
    $("span.insertusername").html(wgUserName);
 }
 addOnloadHook(UserNameReplace);

/* End of the {{USERNAME}} replacement */