You are viewing the MafiaScum.net Wiki. To play the game, visit the forum.

Rubicon/Template:U: Difference between revisions

From MafiaWiki
Jump to navigation Jump to search
(explanation)
No edit summary
Line 1: Line 1:
<includeonly>{{ #ifexist: User:{{{1|thisuserdoesnotexist}}} |[[User:{{{1}}}|{{{2|{{{1|User}}}}}}]]|{{ #ifexist:{{{1|thisuserdoesnotexist}}} |[[{{{1|:Category:Scummers}}}|{{{2|{{{1|User}}}}}}]]|<span class="plainlinks">[http://forum.mafiascum.net/memberlist.php?mode=viewprofile&un={{urlencode:{{{1|}}}}} {{{2|{{{1|User}}}}}}]</span>}}}}</includeonly><noinclude>This is a revised version of the [[Template:U]] template. The original template fails when linking to any user who (1) has spaces in their username, and (2) doesn't have a wiki page. The reason is that it doesn't properly encode spaces in the username when making the link.
<includeonly>{{ #ifexist: User:{{{1|thisuserdoesnotexist}}} |[[User:{{{1}}}|{{{2|{{{1|User}}}}}}]]|{{ #ifexist:{{{1|thisuserdoesnotexist}}} |[[{{{1|:Category:Scummers}}}|{{{2|{{{1|User}}}}}}]]|<span class="plainlinks">[http://forum.mafiascum.net/memberlist.php?mode=viewprofile&un={{urlencode:{{{1|}}}}} {{{2|{{{1|User}}}}}}]</span>}}}}</includeonly><noinclude>This is a revised version of the [[Template:U]] template. The original template fails when linking to any user who (1) has unencoded spaces in their username, and (2) doesn't have a wiki page. The reason is that it doesn't properly encode spaces in the username when making the link.


This template links to a page of the user with username {{{1}}}.
This template links to a page of the user with username {{{1}}}.
Line 9: Line 9:
==={{{1}}}===
==={{{1}}}===


The user name. If the link shows up wrong, replace whitespace with %20.
The user name.


==={{{2}}}===
==={{{2}}}===

Revision as of 23:14, 22 March 2014

This is a revised version of the Template:U template. The original template fails when linking to any user who (1) has unencoded spaces in their username, and (2) doesn't have a wiki page. The reason is that it doesn't properly encode spaces in the username when making the link.

This template links to a page of the user with username {{{1}}}.

  • It will first check for a wiki page [[User:username]], and link to it if it exists.
  • If the page does not exist, it will check if there is a wiki page at [[username]] (without the User: prefix), and link to it if it exists.
  • If the page does not exist either, it will link to the user's profile page on the forum.

{{{1}}}

The user name.

{{{2}}}

The displayed text. If not specified, {{{1}}} is used.