Difference between revisions of "Template:Auto-outdated"

From FamilySearch Wiki
Jump to: navigation, search
m (update)
m (fix)
Line 27: Line 27:
 
<br><br>
 
<br><br>
 
'''Calculated equation values:'''<br><br>
 
'''Calculated equation values:'''<br><br>
'''{{#if:{{{1|}}}|{{{1}}}|7}}''' &nbsp;&nbsp;&nbsp;&nbsp;Set point (Default template parameter one)<br>
+
'''{{#if:{{{1|}}}|{{{1}}}|7}}''' &nbsp;&nbsp;&nbsp;&nbsp;Set point (Default parameter one)<br>
 
'''{{#time:z|{{CURRENTTIMESTAMP}}}}'''&nbsp;&nbsp;CurrentYear - day of year<br>
 
'''{{#time:z|{{CURRENTTIMESTAMP}}}}'''&nbsp;&nbsp;CurrentYear - day of year<br>
 
'''{{#time:z|{{REVISIONTIMESTAMP}}}}'''&nbsp;&nbsp;RevisionYear - day of year<br>
 
'''{{#time:z|{{REVISIONTIMESTAMP}}}}'''&nbsp;&nbsp;RevisionYear - day of year<br>

Revision as of 02:07, 23 July 2014

__NORICHEDITOR__

Ambox outdated serious.png
Auto-outdated ( Setpoint: 7 days )
Current alert status:  error2
Last Rev Date:  23   07  2014 (d/m/y)







Calculated equation values:

7     Set point (Default parameter one)
348  CurrentYear - day of year
203  RevisionYear - day of year
145      Option 1: Current Year days minus Revision Year days
510  Option 2: Revision days (from end of year) plus Current Year days
875  Option 3: Revision days (from end of year) plus 365 plus Current Year days
Category:Auto-outdated  Category added when "expired".
Auto-outdated  Default category for parameter two.
Auto-outdated  Default category for parameter three.


Documentation:

The template is called using {{Auto-outdated}}

Parameter #1 is activated using {{Auto-outdated|14}} where “14” is the template parameter for the number of days from the last revision date before the template activates the “expired” condition (and installs the Category:Auto-outdated). The parameter value can be any integer number but the recommended values are 1 to 365 days (the default for parameter one is 7 days).

Parameter #2 is activated using {{Auto-outdated|14|sub-category name}} to create a sub-category to group the pages based on some criteria such as "New to Genealogy".

Parameter #3 results in an additional sub-category that can be used to further group the pages {{Auto-outdated|14|sub-category name|secondary sub-category name}}. This secondary sub-category could be used if the page fits multiple topics or if a sub-category is created for a specific individual or group (such as Wiki Support).

Note: The default setting for the two sub-category parameters is Category:Auto-outdated to prevent extra categories from being created. If a new parameter value is entered it will result in a red link if it did not previously exist and the sub-category page must be created. It must then be specified as a sub-category of "Category:Auto-outdated" by adding [[Category:Auto-outdated]] as the category for the new page.

Background information:

The purpose of this template is to provide a means of automatically outdating an article based on a set number of days since its last revision date. This could be used on general articles by setting the Auto-outdated parameter to something like 365 days or 180 days. This would actually be most beneficial when used with more time sensitive articles (such as, Community News or WikiProject status) by setting the parameter to 7 days to ensure weekly updates.

Besides checking and displaying the Current Alert Status on the template display as either “OKAY” or “Expired” the template will also install a category (Category:Auto-outdated) when the parser functions trip the “Expired” notification. By routinely checking the above category, all instances of pages that have tripped the expiration date can be reviewed and corrected (resetting the “timer” by updating the article or at least checking it and performing a dummy save).

The parser functions compare the CURRENT TIME STAMP with the REVISION TIME STAMP based on the values using the day of the year value. Initially a check is performed to determine if the two years are equal so the difference of the values can be determined but if they are not, the days to the end of the previous year are added to the days in the current year. A third result (a two year gap) has been added to allow for set points up to 730 days although greater than 365 days is probably impracticable.

Technically the template parameter could be any number greater than zero but realistically should be limited from 1 to 365 days (as a three year span during the initial check will result in an error). Although this could be adjusted to include more than the current two year span it is not of a high priority since an article worth tagging with this template should be reviewed at least yearly and there is a possibility that more appropriate parser functions (such as “AgeParse”) may become available with newer versions of MediaWiki.

Also note that there is currently a 1 day error that will occur in leap years but this calculation is not a critical operation therefore this is not considered important and again, newer parser functions with newer versions of MediaWiki could correct this issue.