Template:ArmorTable: Difference between revisions

From Horizon Wiki Mirror
Content deleted Content added
imported>Aramachus
improvement to regex syntax
imported>Aramachus
regex improved to correctly get the job in a bunch and all jobs
Line 9: Line 9:
|count = {{{count|}}}
|count = {{{count|}}}
|include={Item Statistics¦ArmorTable.dpl},{HorizonChangesBox}
|include={Item Statistics¦ArmorTable.dpl},{HorizonChangesBox}
|includematch = {{#if:{{{job|}}}|/jobs\s*=(?:\b¦\s)\[\[{{{job}}}\]\](?:\b¦\s)¦jobs\s*=\s*all\s*/|}}
|includematch = {{#if:{{{job|}}}|/jobs\s*=.*\[\[{{{job}}}\]\].*¦jobs\s*=\s*All\sJobs\s*/|}}
|table=class="wikitable sortable",Name,Level,Jobs,Slot,Stats,Horizon Changes {{changes}}
|table=class="wikitable sortable",Name,Level,Jobs,Slot,Stats,Horizon Changes {{changes}}
|tablesortcol=2
|tablesortcol=2
Line 43: Line 43:


{{ArmorTable|cat1=Artifact Armor|job=WHM}}
{{ArmorTable|cat1=Artifact Armor|job=WHM}}


===Example 3===
Syntax:
<pre>{{ArmorTable|cat1=Head|job=BLM}}</pre>

Will give out all head pieces equippable by BLM.

{{ArmorTable|cat1=Head|job=BLM}}

Revision as of 22:11, 30 August 2023

Usage

Wrapper Template to generate lists of armor based on categories.

Syntax:

{{ArmorTable|cat1|...|notcat1|...|job|count}}
  • Use cat1, cat2, cat3 to include required categories
  • Use notcat1, notcat2, notcat2 to exclude categories
  • Use job to include only gear by job XXX
  • (The count parameter is mainly used for testing)

Examples

Some Example tables have been limited to output only 5 items (through the optional parameter count=5) because they serve only as examples. The syntax shown in the examples would generate the full tables.

Example 1

Syntax:

{{ArmorTable|cat1=Artifact Armor|cat2=Feet|notcat1=White Mage}}

Will give out all pieces of armor which are categorized as "Artifact Armor" and "Feet" while excluding those, which are categorized as "White Mage". ("All AF Feet except WHM feet")

Extension:DynamicPageList4 (DPL4), version 4.0.0: Error: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:ArmorTable: The DynamicPageList4 extension (version 4.0.0) produced a SQL statement which led to a Database error.<br/>The reason may be an internal error of DynamicPageList4 or an error that you made; especially when using parameters like 'categoryregexp' or 'titleregexp'. Usage of non-greedy <code>*?</code> matching patterns are not supported.<br/>The error message was:<br/><code>Error 1054: Unknown column 'ecl1.cl_to' in 'WHERE' Function: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:ArmorTable Query: SET STATEMENT max_statement_time=10 FOR SELECT DISTINCT p.page_namespace AS `page_namespace`,p.page_id AS `page_id`,p.page_title AS `page_title` FROM `page` `p` JOIN `categorylinks` `cl1` ON (((p.page_id = cl1.cl_from) AND (cl1.cl_to = 'Artifact_Armor'))) JOIN `categorylinks` `cl2` ON (((p.page_id = cl2.cl_from) AND (cl2.cl_to = 'Feet'))) LEFT JOIN `categorylinks` `ecl1` ON (((p.page_id = ecl1.cl_from) AND (ecl1.cl_to = 'White_Mage'))) WHERE p.page_is_redirect = 0 AND ecl1.cl_to IS NULL LIMIT 5 </code>

Example 2

Syntax:

{{ArmorTable|cat1=Artifact Armor|job=WHM}}

Will give out all pieces of armor which are categorized as "Artifact Armor" and have "WHM" (or "all") in their job list.

Extension:DynamicPageList4 (DPL4), version 4.0.0: Error: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:ArmorTable: The DynamicPageList4 extension (version 4.0.0) produced a SQL statement which led to a Database error.<br/>The reason may be an internal error of DynamicPageList4 or an error that you made; especially when using parameters like 'categoryregexp' or 'titleregexp'. Usage of non-greedy <code>*?</code> matching patterns are not supported.<br/>The error message was:<br/><code>Error 1054: Unknown column 'cl1.cl_to' in 'ON' Function: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:ArmorTable Query: SET STATEMENT max_statement_time=10 FOR SELECT DISTINCT p.page_namespace AS `page_namespace`,p.page_id AS `page_id`,p.page_title AS `page_title` FROM `page` `p` JOIN `categorylinks` `cl1` ON (((p.page_id = cl1.cl_from) AND (cl1.cl_to = 'Artifact_Armor'))) WHERE p.page_is_redirect = 0 LIMIT 500 </code>


Example 3

Syntax:

{{ArmorTable|cat1=Head|job=BLM}}

Will give out all head pieces equippable by BLM.

Extension:DynamicPageList4 (DPL4), version 4.0.0: Error: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:ArmorTable: The DynamicPageList4 extension (version 4.0.0) produced a SQL statement which led to a Database error.<br/>The reason may be an internal error of DynamicPageList4 or an error that you made; especially when using parameters like 'categoryregexp' or 'titleregexp'. Usage of non-greedy <code>*?</code> matching patterns are not supported.<br/>The error message was:<br/><code>Error 1054: Unknown column 'cl1.cl_to' in 'ON' Function: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:ArmorTable Query: SET STATEMENT max_statement_time=10 FOR SELECT DISTINCT p.page_namespace AS `page_namespace`,p.page_id AS `page_id`,p.page_title AS `page_title` FROM `page` `p` JOIN `categorylinks` `cl1` ON (((p.page_id = cl1.cl_from) AND (cl1.cl_to = 'Head'))) WHERE p.page_is_redirect = 0 LIMIT 500 </code>