Difference between revisions of "Template:Card query"

From Yugipedia
Jump to: navigation, search
(fix $query_count when the query produces an error)
(properly support video game for medium; add "-only" variants for medium values)
Line 3: Line 3:
 
}}{{ #vardefine: $query_query_lc | {{ lc: {{ #var: $query_query }} }}
 
}}{{ #vardefine: $query_query_lc | {{ lc: {{ #var: $query_query }} }}
 
}}{{ #arraydefine: @check_query  | {{ #var: $query_query_lc }}
 
}}{{ #arraydefine: @check_query  | {{ #var: $query_query_lc }}
}}{{ #vardefine: $query_medium | {{ #switch: {{ lc: {{{medium}}} }}
+
}}{{ #vardefine: $query_medium | {{ #switch: {{ #replace: {{ #replace: {{ lc: {{{medium}}} }} }} | - }}
 
   | ocg | tcg | ocg/tcg | tcg/ocg | official = official
 
   | ocg | tcg | ocg/tcg | tcg/ocg | official = official
 
   | anime = anime
 
   | anime = anime
 +
  | animeonly = anime-only
 
   | manga = manga
 
   | manga = manga
   | nonofficial | non-official = non-official
+
   | mangaonly = manga-only
 +
  | vg | videogame = vg
 +
  | vgonly | videogameonly = vg-only
 +
  | nonofficial = non-official
 
   | #default =  
 
   | #default =  
 
   }}
 
   }}
Line 13: Line 17:
 
   | official = [[Class 1::Official]]
 
   | official = [[Class 1::Official]]
 
   | anime = [[Medium::Anime]]
 
   | anime = [[Medium::Anime]]
 +
  | anime-only = [[Category:Anime cards with no OCG/TCG counterpart]]
 
   | manga = [[Medium::Manga]]
 
   | manga = [[Medium::Manga]]
   | non-official = <q>[[Medium::Anime]] OR [[Medium::Manga]]</q>
+
  | manga-only = [[Category:Manga cards with no OCG/TCG counterpart]]
 +
  | vg = <q>[[Medium::Video game]] OR [[Class 4::VG]]</q>
 +
  | vg-only = [[Category:Video game cards with no OCG/TCG counterpart]]
 +
   | non-official = <q>[[Medium::Anime]] OR [[Medium::Manga]] OR [[Medium::Video game]] OR [[Class 4::VG]]</q>
 
   }}
 
   }}
 
}}{{ #vardefine: $query_query_medium
 
}}{{ #vardefine: $query_query_medium
Line 28: Line 36:
 
       | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | manga }}
 
       | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | manga }}
 
         | manga
 
         | manga
 +
        | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | video game }}
 +
                  {{ #pos: {{ #var: $query_query_lc }} | ::vg }}
 +
          | vg
 +
        }}
 
       }}
 
       }}
 
     }}
 
     }}

Revision as of 07:32, 10 December 2018

SQLStore debug output
ASK Query
SQL Query
SELECT DISTINCT
  t0.smw_id AS id,
  t0.smw_title AS t,
  t0.smw_namespace AS ns,
  t0.smw_iw AS iw,
  t0.smw_subobject AS so,
  t0.smw_sortkey AS sortkey, t0.smw_sort,
  t0.smw_title,
  t0.smw_subobject
FROM
  `smw_object_ids` AS t0
WHERE
  t0.smw_iw!=':smw'
  AND t0.smw_iw!=':smw-redi'
  AND t0.smw_iw!=':smw-border'
  AND t0.smw_iw!=':smw-intprop'
ORDER BY
  t0.smw_sort ASC,
  t0.smw_title ASC,
  t0.smw_subobject ASC
LIMIT
  55
OFFSET
  0
SQL Explain
IDselect_typetabletypepossible_keyskeykey_lenrefrowsExtra
1SIMPLEt0ALLsmw_iw,smw_iw_24568423Using where; Using filesort
Auxilliary Tables
No auxilliary tables used.
Query Metrics
Query-Size:0
Query-Depth:0
Errors and Warnings
The query description has an empty condition.

The query description has an empty condition.

  • #ask query:
  • $query_query:
  • $query_query_lc:
  • $query_medium:
  • $query_medium_query:
  • $query_query_medium:
  • $query_card_type:
  • $query_card_type_query:
  • $query_col_card_type: ?Card type =
  • $query_col_primary_type:
  • $query_col_secondary_type:
  • $query_col_attribute:
  • $query_col_type:
  • $query_col_stars:
  • $query_col_scale:
  • $query_col_link_rating:
  • $query_col_atk:
  • $query_col_def:
  • $query_col_card_type_st: ?Card type = [[Card type]]
  • $query_col_property: ?Property = [[Property]]
  • {{{extra_column}}}:
  • {{{extra_label}}}:
  • $query_col_extra:
  • limit: 50
  • $query_sort: #
  • $query_order:
  • $query_count: 0