Difference between revisions of "Template:Infobox former country/autocat"

From CWS Planet
Jump to navigation Jump to search
m
m
Line 60: Line 60:
     -->|{{#ifexist:Category:States and territories established in {{{year_start}}}<!--
     -->|{{#ifexist:Category:States and territories established in {{{year_start}}}<!--
       -->|[[Category:States and territories established in {{{year_start}}}|{{{common_name}}}, {{{year_start}}}]]<!--
       -->|[[Category:States and territories established in {{{year_start}}}|{{{common_name}}}, {{{year_start}}}]]<!--
       -->|{{#ifeq:{{Str find| {{{year_start}}} |BC}}|-1<!--
       -->|{{#ifeq:{{Str find| {{{year_start}}} |BCE}}|-1<!--
           -->|{{#ifexist:Category:States and territories established in the {{#expr: {{{year_start}}}-{{{year_start}}}mod10}}s<!--
           -->|{{#ifexist:Category:States and territories established in the {{#expr: {{{year_start}}}-{{{year_start}}}mod10}}s<!--
             -->|[[Category:States and territories established in the {{#expr: {{{year_start}}}-{{{year_start}}}mod10}}s|{{{common_name}}}, {{{year_start}}}]]<!--
             -->|[[Category:States and territories established in the {{#expr: {{{year_start}}}-{{{year_start}}}mod10}}s|{{{common_name}}}, {{{year_start}}}]]<!--
Line 68: Line 68:
                 -->}}<!--
                 -->}}<!--
             -->}}<!--
             -->}}<!--
           -->|{{#ifexist:Category:States and territories established in the {{#expr: {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}-{{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}mod10}}s BC<!--
           -->|{{#ifexist:Category:States and territories established in the {{#expr: {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}-{{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}mod10}}s BCE<!--
             -->|[[Category:States and territories established in the {{#expr: {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}-{{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}mod10}}s BC|{{{common_name}}}, {{{year_start}}}]]<!--
             -->|[[Category:States and territories established in the {{#expr: {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}-{{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}mod10}}s BCE|{{{common_name}}}, {{{year_start}}}]]<!--
             -->|{{#ifexist:Category:States and territories established in the {{Ordinal| {{#expr: ({{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }} - {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}mod100)/100+1}}}} century BC<!--
             -->|{{#ifexist:Category:States and territories established in the {{Ordinal| {{#expr: ({{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }} - {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}mod100)/100+1}}}} century BCE<!--
                 -->|[[Category:States and territories established in the {{Ordinal|{{#expr: ({{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }} - {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}mod100)/100+1}}}} century BC|{{{common_name}}}, {{{year_start}}}]]<!--
                 -->|[[Category:States and territories established in the {{Ordinal|{{#expr: ({{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }} - {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}mod100)/100+1}}}} century BCE|{{{common_name}}}, {{{year_start}}}]]<!--
                 -->|[[Category:Former country articles requiring maintenance|Y1]]<!--
                 -->|[[Category:Former country articles requiring maintenance|Y1]]<!--
                 -->}}<!--
                 -->}}<!--
Line 86: Line 86:
     -->|{{#ifexist:Category:States and territories disestablished in {{{year_end}}}<!--
     -->|{{#ifexist:Category:States and territories disestablished in {{{year_end}}}<!--
       -->|[[Category:States and territories disestablished in {{{year_end}}}|{{{common_name}}}, {{{year_end}}}]]<!--
       -->|[[Category:States and territories disestablished in {{{year_end}}}|{{{common_name}}}, {{{year_end}}}]]<!--
       -->|{{#ifeq:{{Str find| {{{year_end}}} |BC}}|-1<!--
       -->|{{#ifeq:{{Str find| {{{year_end}}} |BCE}}|-1<!--
           -->|{{#ifexist:Category:States and territories disestablished in the {{#expr: {{{year_end}}}-{{{year_end}}}mod10}}s<!--
           -->|{{#ifexist:Category:States and territories disestablished in the {{#expr: {{{year_end}}}-{{{year_end}}}mod10}}s<!--
             -->|[[Category:States and territories disestablished in the {{#expr: {{{year_end}}}-{{{year_end}}}mod10}}s|{{{common_name}}}, {{{year_end}}}]]<!--
             -->|[[Category:States and territories disestablished in the {{#expr: {{{year_end}}}-{{{year_end}}}mod10}}s|{{{common_name}}}, {{{year_end}}}]]<!--
Line 94: Line 94:
                 -->}}<!--
                 -->}}<!--
             -->}}<!--
             -->}}<!--
           -->|{{#ifexist:Category:States and territories disestablished in the {{#expr: {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}-{{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}mod10}}s BC<!--
           -->|{{#ifexist:Category:States and territories disestablished in the {{#expr: {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}-{{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}mod10}}s BCE<!--
             -->|[[Category:States and territories disestablished in the {{#expr: {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}-{{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}mod10}}s BC|{{{common_name}}}, {{{year_end}}}]]<!--
             -->|[[Category:States and territories disestablished in the {{#expr: {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}-{{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}mod10}}s BCE|{{{common_name}}}, {{{year_end}}}]]<!--
             -->|{{#ifexist:Category:States and territories disestablished in the {{Ordinal|{{#expr: ({{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }} - {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}mod100)/100+1}}}} century BC<!--
             -->|{{#ifexist:Category:States and territories disestablished in the {{Ordinal|{{#expr: ({{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }} - {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}mod100)/100+1}}}} century BCE<!--
                 -->|[[Category:States and territories disestablished in the {{Ordinal|{{#expr: ({{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }} - {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}mod100)/100+1}}}} century BC|{{{common_name}}}, {{{year_end}}}]]<!--
                 -->|[[Category:States and territories disestablished in the {{Ordinal|{{#expr: ({{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }} - {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}mod100)/100+1}}}} century BCE|{{{common_name}}}, {{{year_end}}}]]<!--
                 -->|[[Category:Former country articles requiring maintenance|Y2]]<!--
                 -->|[[Category:Former country articles requiring maintenance|Y2]]<!--
                 -->}}<!--
                 -->}}<!--
Line 116: Line 116:
*First the template tests to see if "Category:States and territories established in the {{{year_start}}}" exists.  If so, it is added.
*First the template tests to see if "Category:States and territories established in the {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories established in {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories established in {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories established in the DECADEs" where DECADE is the decade containing {{{year_start}}} (ie {{cl|States and territories established in the 120s BC}}).  If so, it is added.
*If not, the template tests to see if "Category:States and territories established in the DECADEs" where DECADE is the decade containing {{{year_start}}} (ie {{cl|States and territories established in the 120s BCE}}).  If so, it is added.
*If not, the template tests to see if "Category:States and territories established in the Nth century" where N is the century containing {{{year_start}}} (ie {{cl|States and territories established in the 1st century BC}}).  If so, it is added.
*If not, the template tests to see if "Category:States and territories established in the Nth century" where N is the century containing {{{year_start}}} (ie {{cl|States and territories established in the 1st century BCE}}).  If so, it is added.


The reason for the first case is in case an imprecise date is imputed, such as "the 820s" or "the 18th century", before trying exact dates like "1820".
The reason for the first case is in case an imprecise date is imputed, such as "the 820s" or "the 18th century", before trying exact dates like "1820".
Line 124: Line 124:
*First the template tests to see if "Category:States and territories disestablished in the {{{year_start}}}" exists.  If so, it is added.
*First the template tests to see if "Category:States and territories disestablished in the {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories disestablished in {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories disestablished in {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories disestablished in the DECADEs" where DECADE is the decade containing {{{year_start}}} (ie {{cl|States and territories disestablished in the 120s BC}}).  If so, it is added.
*If not, the template tests to see if "Category:States and territories disestablished in the DECADEs" where DECADE is the decade containing {{{year_start}}} (ie {{cl|States and territories disestablished in the 120s BCE}}).  If so, it is added.
*If not, the template tests to see if "Category:States and territories disestablished in the Nth century" where N is the century containing {{{year_start}}} (ie {{cl|States and territories disestablished in the 1st century BC}}).  If so, it is added.
*If not, the template tests to see if "Category:States and territories disestablished in the Nth century" where N is the century containing {{{year_start}}} (ie {{cl|States and territories disestablished in the 1st century BCE}}).  If so, it is added.


The reason for the first case is in case an imprecise date is imputed, such as "the 820s" or "the 18th century", before trying exact dates like "1820".
The reason for the first case is in case an imprecise date is imputed, such as "the 820s" or "the 18th century", before trying exact dates like "1820".
}}
}}
</noinclude>
</noinclude>

Revision as of 01:46, 2 June 2024

Script error: The function "main" does not exist.