Difference between revisions of "User:K-Mac/Template:Random userbox"

From Team Fortress Wiki
Jump to: navigation, search
(Let us test)
 
Line 1: Line 1:
{{#if:{{{font|}}}|{{#switch:{{#expr:(({{NUMBEROFEDITS:R}} mod 10) + {{{offset|0}}}) + 1}}
+
{{#switch:{{#expr:{{#time:U}} mod 10}}
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 = 000000
+
| 0 = User:K-Mac/User Officer
| 10 = FFFFFF
+
| 1 = User Lumbricus Lid
}}|{{#switch:{{#expr:(({{NUMBEROFEDITS:R}} mod 10) + {{{offset|0}}}) + 1}}
+
| 2 = User IRC regular
| 1 = {{User Lumbricus Lid}}
+
| 3 = User Bill Hat
| 2 = {{User IRC regular}}
+
| 4 = User Fire
| 3 = {{User Bill Hat}}
+
| 5 = User Highlander Participant
| 4 = {{User Fire}}
+
| 6 = User Credit to Wiki
| 5 = {{User Highlander Participant}}
+
| 7 = User Medieval Medic
| 6 = {{User Credit to Wiki}}
+
| 8 = User Saharan Spy
| 7 = {{User Medieval Medic}}
+
| 9 = User Primeval Warrior
| 8 = {{User Saharan Spy}}
+
}}<noinclude>
| 9 = {{User Primeval Warrior}}
 
| 10 = {{Userbox
 
  |border-c = #2d339d
 
  |border-s = 1
 
  |id-c    = #cf2225
 
  |id-s    = 8
 
  |id-fc    = #aa2225
 
  |info-c  = #2d339d
 
  |info-s  = 7.5
 
  |info-fc  = white
 
  |id      = [[File:Freelance Police Badge.png|40px]]
 
  |info    = This user is a Police Officer (yes in real life).
 
}}
 
}}}}<noinclude>
 
  
 
{{doc begin}}
 
{{doc begin}}
This template is a shortened and modified version of <code>[[Template:Random skin colour]]</code>
+
This template is a simple switching template, that can be adapted for almost any use.
  
 
If you have any further questions about this template, feel free to ask me by posting on my [[User_talk:MogDog66|talk]] page, or by asking me on the [[Team_Fortress_Wiki:IRC|IRC]] channel.
 
If you have any further questions about this template, feel free to ask me by posting on my [[User_talk:MogDog66|talk]] page, or by asking me on the [[Team_Fortress_Wiki:IRC|IRC]] channel.
  
 
== Function ==
 
== Function ==
*This template uses the number of edits on the page to select a number, which in turn designates the value assigned to the number.
+
*This template uses the current time to select an item from the provided list.
  
 
== Conversion ==
 
== Conversion ==
 
To use this template for yourself you must do the following:
 
To use this template for yourself you must do the following:
 
:*Create the proper directory under your userpage .
 
:*Create the proper directory under your userpage .
::*<b>Example:</b> {{code|User:username/template/randomimage}}
+
::*<b>Example:</b> {{code|User:username/template:randomimage}}
:*Fill out the list of values with your desired list. If there are more than 10, simply add more.
+
:*Fill out the list of values with your desired list. If you need to add more are more simply add them.
::*<b>Example:</b> <code>| 11 = [custom value]</code>
+
::*<b>Example:</b> <code>| 9 = [custom value]</code>
:*Change <b>both</b> {{code|mod 10}}'s to use the proper number of values you used.  
+
:*Change the {{code|mod X}} (where X is the given number of items in the list) to use the proper number of values you used.  
::*<b>Example:</b> <code><nowiki>{{#if:{{{font|}}}|{{#switch:{{#expr:(({{NUMBEROFEDITS:R}} </nowiki><b><u>mod 8</u></b><nowiki>) + {{{offset|0}}}) +
+
::*<b>Example:</b> {{code|<nowiki>{{#switch:{{#expr:{{#time:U}} mod 24}}</nowiki>}}
1}}</nowiki></code>
 
:::<small><i>Note:The above example uses 8, yours may be anything.The important part to note has been put in bold and underline. Additionally, this example only uses the first {{code|mod 10}} example, the same rules must be applied to the second as well</i></small>
 
:*Delete (or add) any extra values that have changed.
 
::<b>Example:</b> <code><i><nowiki>| 1 | 2 | 3 | 4 | 5 | 6 | 7 = 000000
 
| 8 = FFFFFF</nowiki></i></code>
 
:::<small><i>Note: The above example is formatted is there were only 8 values, yours must be changed according to your number of values</i></small>
 
 
</noinclude>
 
</noinclude>

Latest revision as of 02:55, 7 October 2011

User IRC regular

Documentation for K-Mac/Template:Random userbox

This template is a simple switching template, that can be adapted for almost any use.

If you have any further questions about this template, feel free to ask me by posting on my talk page, or by asking me on the IRC channel.

Function

  • This template uses the current time to select an item from the provided list.

Conversion

To use this template for yourself you must do the following:

  • Create the proper directory under your userpage .
  • Example: User:username/template:randomimage
  • Fill out the list of values with your desired list. If you need to add more are more simply add them.
  • Example: | 9 = [custom value]
  • Change the mod X (where X is the given number of items in the list) to use the proper number of values you used.
  • Example: {{#switch:{{#expr:{{#time:U}} mod 24}}