User:Stux/template-sandbox2

From Homestar Runner Wiki

< User:Stux(Difference between revisions)
Jump to: navigation, search
(testing change to tally time template)
(revert for now, don't need this page to show up in categories.)
 
(includes 12 intermediate revisions)
Line 1: Line 1:
-
<includeonly>{{hcount|{{{1}}}_tally|{{{2}}}}} {{format seconds|{{{2}}}}} {{hcount|{{{1}}}_count}}</includeonly><noinclude>
+
<noinclude>PLACEHOLDER</noinclude>
-
This template is used for tallying total time in a group of toons.
+
-
 
+
-
'''Usage:'''
+
-
:<code><nowiki>{{ </nowiki> tally time | ''countername'' | ''number_of_seconds'' }}</code>
+
-
* where ''countername'' is the name of the counter being used. '''''This parameter is required.''''' 
+
-
* and ''number_of_seconds'' is the number of total length of the toon in seconds. 
+
-
 
+
-
The template will do two things with this information:
+
-
* The counter ''countername'' will be incremented by ''number_of_seconds'' seconds.  This counter will then be used to keep track of the total number of seconds for all toons in the group.
+
-
* The value ''number_of_seconds'' will be converted to "hh:mm:ss" format using the {{t|format seconds}} template.
+
-
 
+
-
'''IMPORTANT:'''
+
-
 
+
-
Please be sure to first reset the counter using the {{t|hresetcount}} template before making any calls to this template in order for this process to work correctly.  This template initializes two counters: one to keep track of time in seconds and one to keep track of the total number of toon entries (used in calculating average running time).  Both counters are initialized to 0.  Here is the syntax:
+
-
 
+
-
:<code><nowiki>{{</nowiki>[[Template:hresetcount|hresetcount]] | ''countername'' | tally=1 }}</code>
+
-
 
+
-
* Note that the <code>tally=1</code> parameter is mandatory!  This tells the template that we need to initialize tally counters.  For the ''countername'' the template will create a counter called ''countername''_tally to track the total number of seconds and a counter called ''countername''_count to track the total number of toon entries.
+
-
* Multiple counters may be initialized using the {{t|hresetcount}} template.  See {{t|hcount}} for more information.
+
-
 
+
-
 
+
-
'''Example:'''
+
-
<pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;">
+
-
{{hresetcount|sample|tally=1}}
+
-
 
+
-
* {{tally time|sample|60}}
+
-
* {{tally time|sample|33}}
+
-
* {{tally time|sample|72}}
+
-
* {{tally time|sample|192}}
+
-
 
+
-
* Total time: {{display time|sample|seconds}} seconds ({{display time|sample|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample|average_seconds}} seconds ({{display time|sample|average}} in hh:mm:ss) for {{display time|sample|count}} entries
+
-
* Compare to the original mechanism {{--}} Total time: {{#count:sample_tally|0}} seconds / {{format seconds|{{#count:sample_tally|0}}}} for {{#count:sample_count|0}} entries
+
-
</pre>
+
-
 
+
-
'''Yields:'''
+
-
{{hresetcount|sample|tally=1}}
+
-
 
+
-
* {{tally time|sample|60}}
+
-
* {{tally time|sample|33}}
+
-
* {{tally time|sample|72}}
+
-
* {{tally time|sample|192}}
+
-
 
+
-
* Total time: {{display time|sample|seconds}} seconds ({{display time|sample|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample|average_seconds}} seconds ({{display time|sample|average}} in hh:mm:ss) for {{display time|sample|count}} entries
+
-
* Compare to the original mechanism {{--}} Total time: {{#count:sample_tally|0}} seconds / {{format seconds|{{#count:sample_tally|0}}}} for {{#count:sample_count|0}} entries
+
-
 
+
-
 
+
-
'''Offset Examples:'''
+
-
 
+
-
<pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;">
+
-
* {{display time|sample|seconds|offset_seconds=3}} {{--}} {{display time|sample|total|offset_seconds=3}}
+
-
* {{display time|sample|seconds|offset_seconds=43}} {{--}} {{display time|sample|total|offset_seconds=43}}
+
-
* {{display time|sample|seconds|offset_seconds=143}} {{--}} {{display time|sample|total|offset_seconds=143}}
+
-
 
+
-
* Add 1 to count: {{display time|sample|count|offset_count=1}}
+
-
* Remove 1 from count: {{display time|sample|count|offset_count=-1}}
+
-
 
+
-
* {{display time|sample|average_seconds|offset_seconds=3|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=3|offset_count=1}}
+
-
* {{display time|sample|average_seconds|offset_seconds=43|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=43|offset_count=1}}
+
-
* {{display time|sample|average_seconds|offset_seconds=143|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=143|offset_count=1}}
+
-
* {{display time|sample|average_seconds|offset_seconds=-60|offset_count=-1}} {{--}} {{display time|sample|average|offset_seconds=-60|offset_count=-1}}
+
-
 
+
-
</pre>
+
-
 
+
-
'''Yields:'''
+
-
 
+
-
* {{display time|sample|seconds|offset_seconds=3}} {{--}} {{display time|sample|total|offset_seconds=3}}
+
-
* {{display time|sample|seconds|offset_seconds=43}} {{--}} {{display time|sample|total|offset_seconds=43}}
+
-
* {{display time|sample|seconds|offset_seconds=143}} {{--}} {{display time|sample|total|offset_seconds=143}}
+
-
 
+
-
* Add 1 to count: {{display time|sample|count|offset_count=1}}
+
-
* Remove 1 from count: {{display time|sample|count|offset_count=-1}}
+
-
 
+
-
* {{display time|sample|average_seconds|offset_seconds=3|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=3|offset_count=1}}
+
-
* {{display time|sample|average_seconds|offset_seconds=43|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=43|offset_count=1}}
+
-
* {{display time|sample|average_seconds|offset_seconds=143|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=143|offset_count=1}}
+
-
* {{display time|sample|average_seconds|offset_seconds=-60|offset_count=-1}} {{--}} {{display time|sample|average|offset_seconds=-60|offset_count=-1}}
+
-
 
+
-
 
+
-
====See Also====
+
-
* {{t|display time}} {{--}} Used to display various total values from tallies gathered by this template.
+
-
* {{t|format seconds}}
+
-
* {{t|hcount}}
+
-
* [[HRWiki:Counter|Counter function usage]]
+
-
 
+
-
[[Category:Counter Formatting Templates|{{PAGENAME}}]]
+
-
</noinclude>
+

Current revision as of 13:18, 9 June 2025

PLACEHOLDER

Personal tools