Thread:Ozuzanna/@comment-24106442-20140714064726/@comment-4399679-20140714192839

Hey there, by [Enter Username] I am assuming you mean how some wiki’s insert the username of the person viewing the page. Doing this is quite simple, simply add the following to Template:USERNAME (On your wiki):

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.

Once you’ve done that add this to MediaWiki:Common.js on your wiki:

/* Replaces 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 replacement */

After you’ve done both of these you can simply insert anywhere you want and the username of the person viewing the page will appear there. :)

Also, You’d probably be a bit better off posting questions like this on the Getting Technical Board of our forums. Posting there will give you a better chance of getting a quick reply because there’s a lot more people viewing that board. :)

Cheers!