Difference between revisions of "Template:Card query"
Dinoguy1000 (talk | contribs) (if ATK or DEF are being queried, but not for a specific value (a comparator is used), display the column anyways) |
(Restoring revision 5181833 by User:Dinoguy1000 on 2023-02-10 14:15:07. "fix the first query on Card Tips:Revolution Synchron: that query currently has a query size of 16, which is fine, except this template uses the full query plus `[[MAXIMUM A...) |
||
Line 1: | Line 1: | ||
+ | <templatestyles src="Template:Card query/styles.css" /> | ||
<!-- the actual query the user wants - at the top so we can do fun stuff auto-determining the needed medium/type | <!-- the actual query the user wants - at the top so we can do fun stuff auto-determining the needed medium/type | ||
− | -->{{ #vardefine: $ | + | -->{{ #vardefine: $cq_query | {{ #invoke: string | replace |{{{1|}}}|%s*::%s*|::|plain=false}}<!-- strip whitespace around :: --> |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_query_lc | {{ lc: {{ #var: $cq_query }} }} |
− | }}{{ # | + | }}{{ #vardefine: $cq_query_normalized | {{ #replace: {{ #var: $cq_query_lc }} | <nowiki/> string:: | :: }} |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_query_normalized | {{ #invoke: string | replace |{{ #var: $cq_query_normalized }}|::([<>≤≥!+])|::^%1|plain=false}}<!-- fold comparators for easier matching --> |
+ | }}{{ #vardefine: $cq_query_normalized | {{ #invoke: string | replace |{{ #var: $cq_query_normalized }}|::([^{{!}}%[%]]+){{!}}{{!}}|::^%1{{!}}{{!}}|plain=false}}<!-- detect || alternation --> | ||
+ | }}{{ #vardefine: $cq_medium | {{ #switch: {{ #replace: {{ #replace: {{ #replace: {{ #replace: {{ lc: {{{medium}}} }} }} | - }} | ! }} | yugioh }} | ||
| ocg | tcg | ocg/tcg | tcg/ocg | official = official | | ocg | tcg | ocg/tcg | tcg/ocg | official = official | ||
− | | ocgonly = ocg-only | + | | ocgonly = ocg-only |
− | | tcgonly = tcg-only | + | | tcgonly = tcg-only |
− | | anime = anime | + | | rushduel = rush duel |
− | | animeonly = anime-only | + | | anime = anime |
− | | manga = manga | + | | animeonly = anime-only |
− | | mangaonly = manga-only | + | | manga = manga |
− | | vg | videogame = vg | + | | mangaonly = manga-only |
− | | vgonly | videogameonly = vg-only | + | | vg | videogame = {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | release:: }} || vg }} |
− | | nonofficial = non-official | + | | vgonly | videogameonly = {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | release:: }} || vg-only }} |
− | | #default = {{ #if: {{{medium|}}} | {{ #vardefine: $ | + | | dl | duellinks = duel links |
+ | | nonofficial = non-official | ||
+ | | #default = {{ #if: {{{medium|}}} | {{ #vardefine: $cq_medium_unknown | 1 }} }} | ||
}} | }} | ||
− | }}{{ #vardefine: $ | + | }}<!-- |
− | | official = [[ | + | |
− | | ocg-only = [[Medium::OCG-only]] | + | also update the properties on [[Template:Card list]] when updating these |
− | | tcg-only = [[Medium::TCG-only]] | + | |
− | | | + | -->{{ #vardefine: $cq_medium_query | {{ #switch: {{ #var: $cq_medium }} |
− | | anime-only = [[Category:Anime cards with no OCG/TCG counterpart]] | + | | official = [[Concept:CG cards]] |
− | | manga = [[ | + | | ocg-only = [[Medium::OCG-only]] |
− | | manga-only = [[Category:Manga cards with no OCG/TCG counterpart]] | + | | tcg-only = [[Medium::TCG-only]] |
− | | vg = | + | | rush duel = [[Medium::Rush Duel]] |
− | | vg-only = [[Category:Video game cards with no OCG/TCG counterpart]] | + | | anime = [[Concept:Anime cards]] |
− | | non-official = <q>[[ | + | | anime-only = [[Category:Anime cards with no OCG/TCG counterpart]] |
+ | | manga = [[Concept:Manga cards]] | ||
+ | | manga-only = [[Category:Manga cards with no OCG/TCG counterpart]] | ||
+ | | vg = [[Concept:Video game cards]] | ||
+ | | vg-only = [[Category:Video game cards with no OCG/TCG counterpart]] | ||
+ | | duel links = [[Release::Yu-Gi-Oh! Duel Links]] | ||
+ | | non-official = <q>[[Concept:Anime cards]] OR [[Concept:Manga cards]] OR [[Concept:Video game cards]]</q> | ||
}} | }} | ||
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_query_medium |
| {{ #if: | | {{ #if: | ||
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | official }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | ::ocg }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | ::tcg }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | {{!!}}ocg }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | {{!!}}tcg }} |
| official | | official | ||
− | | {{ #if: {{ #pos: {{ #var: $ | + | | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | anime }} |
− | | anime | + | | {{ #if: {{ #pos: {{ #var: $cq_query }} | Fairy Tale (anime) }} || anime }} |
− | | {{ #if: {{ #pos: {{ #var: $ | + | | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | manga }} |
| manga | | manga | ||
− | | {{ #if: {{ #pos: {{ #var: $ | + | | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | video game }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | ::vg }} |
| vg | | vg | ||
}} | }} | ||
Line 47: | Line 58: | ||
}} | }} | ||
}} | }} | ||
− | }}{{ #if: {{ #var: $ | + | }}{{ #if: {{ #var: $cq_query_medium }} |
− | | {{ #vardefine: $ | + | | {{ #ifeq: {{ #var: $cq_medium }} | duel links || {{ #ifeq: {{ #replace: {{ #var: $cq_medium }} | -only }} | {{ #var: $cq_query_medium }} | {{ #vardefine: $cq_medium_query }} }} }} |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_card_type | {{ #switch: {{ #replace: {{ #replace: {{ #replace: {{ lc: {{{type}}} }} }} | cards }} | card }} |
− | | monster = monster | + | | monster = monster |
− | | spell = spell | + | | spell = spell |
− | | trap = trap | + | | trap = trap |
+ | | skill = skill | ||
| speedspell = speed spell | | speedspell = speed spell | ||
− | | virus = virus | + | | virus = virus |
− | | equip = equip | + | | equip = equip |
− | | illusion = illusion | + | | illusion = illusion |
− | | ritual = ritual | + | | ritual = ritual |
| trap-spell | trapspell | spell-trap | spelltrap = trap spell | | trap-spell | trapspell | spell-trap | spelltrap = trap spell | ||
| trap-equip | trapequip = trap-equip | | trap-equip | trapequip = trap-equip | ||
− | | ??? = ??? | + | | ??? = ??? |
| spell/trap | s/t | nonmonster | non-monster = non-monster | | spell/trap | s/t | nonmonster | non-monster = non-monster | ||
− | | tip = tip | + | | tip = tip |
− | | strategy = strategy | + | | strategy = strategy |
− | | faq = faq | + | | faq = faq |
− | | #default = {{ #if: {{{type|}}} | {{ #vardefine: $ | + | | #default = {{ #if: {{{type|}}} | {{ #vardefine: $cq_card_type_unknown | 1 }} }} |
}} | }} | ||
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_card_type_query | {{ #switch: {{ #var: $cq_card_type }} |
| monster = [[Card type::Monster Card]] | | monster = [[Card type::Monster Card]] | ||
| spell = [[Card type::Spell Card]] | | spell = [[Card type::Spell Card]] | ||
| trap = [[Card type::Trap Card]] | | trap = [[Card type::Trap Card]] | ||
+ | | skill = [[Card type::Skill Card]] | ||
| speed spell = [[Card type::Speed Spell Card]] | | speed spell = [[Card type::Speed Spell Card]] | ||
| virus = [[Card type::Virus Card]] | | virus = [[Card type::Virus Card]] | ||
Line 84: | Line 97: | ||
| faq = [[Card type::FAQ Card]] | | faq = [[Card type::FAQ Card]] | ||
}} | }} | ||
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_card_type | {{ #var: $cq_card_type | {{ #if: |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | primary type:: }} |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | secondary type:: }} | |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | attribute:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}type:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_normalized }} | level:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_normalized }} | rank:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_normalized }} | stars:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | pendulum scale:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | link arrows:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}atk }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}def }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | link rating:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | maximum atk:: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | belongs to::extra deck }} |
− | {{ #pos: {{ #var: $ | ||
| monster | | monster | ||
− | }} | + | | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | property:: }} | non-monster }} |
+ | }} | ||
}} | }} | ||
+ | }}{{ #vardefine: $cq_concept_query | {{ #switch: {{ #var: $cq_medium }}/{{ #var: $cq_card_type }} | ||
+ | | official/monster = [[Concept:CG monsters]] | ||
+ | | official/spell = [[Concept:CG Spell Cards]] | ||
+ | | official/trap = [[Concept:CG Trap Cards]] | ||
+ | | official/non-monster = [[Concept:CG non-monster cards]] | ||
+ | | anime/monster = [[Concept:Anime monsters]] | ||
+ | | anime/spell = [[Concept:Anime Spell Cards]] | ||
+ | | anime/trap = [[Concept:Anime Trap Cards]] | ||
+ | | anime/non-monster = [[Concept:Anime non-monsters]] | ||
+ | | manga/monster = [[Concept:Manga monsters]] | ||
+ | | manga/spell = [[Concept:Manga Spell Cards]] | ||
+ | | manga/trap = [[Concept:Manga Trap Cards]] | ||
+ | | manga/non-monster = [[Concept:Manga non-monsters]] | ||
+ | | vg/monster = [[Concept:Video game monsters]] | ||
+ | | vg/spell = [[Concept:Video game Spell Cards]] | ||
+ | | vg/trap = [[Concept:Video game Trap Cards]] | ||
+ | | vg/non-monster = [[Concept:Video game non-monsters]] | ||
+ | }} | ||
+ | }}{{ #vardefine: $cq_full_query | {{ #var: $cq_concept_query | {{ #var: $cq_medium_query }}{{ #var: $cq_card_type_query }} }}{{ #var: $cq_query }} | ||
}}<!-- | }}<!-- | ||
Line 109: | Line 141: | ||
of course, if it allowed using {{!}} for pipes (as it should), this could be simplified further... | of course, if it allowed using {{!}} for pipes (as it should), this could be simplified further... | ||
− | -->{{ #vardefine: $ | + | -->{{ #ifeq: {{ #var: $cq_card_type }} | skill |
− | }}{{ #ifeq: {{ #var: $ | + | | {{ #vardefine: $cq_col_character | ?Character }} |
− | | {{ #vardefine: $ | + | | {{ #vardefine: $cq_col_japanese_name | ?Japanese name |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_card_type | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}card type:: }} || ?Card type = }} |
− | + | }} | |
− | }}{{ #vardefine: $ | + | }}{{ #ifeq: {{ #var: $cq_card_type }} | monster |
+ | | {{ #vardefine: $cq_col_primary_type | ?Primary type | ||
+ | }}{{ #vardefine: $cq_col_secondary_type | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Secondary type::+]] | format=count }} | 0 || {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}secondary type:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}secondary type::^ }} | ?Secondary type }} | ?Secondary type }} }} | ||
+ | }}{{ #vardefine: $cq_col_attribute | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}attribute:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}attribute::^ }} | ?Attribute = [[Attribute]] }} | ?Attribute = [[Attribute]] }} | ||
+ | }}{{ #vardefine: $cq_col_type | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}type:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}type::^ }} | ?Type = [[Type]] }} | ?Type = [[Type]] }} | ||
}}<!-- | }}<!-- | ||
− | -->{{ #vardefine: $ | + | * if the query doesn't do anything special regarding Level, Rank, monster (sub)type, or medium, display "Level/Rank" |
− | }}{{ #ifeq: {{ #var: $ | + | * if the query searches for Rush Duel cards, display "Level" |
− | }}{{ #vardefine: $ | + | * if the query searches for a Link Monster (via [[Primary type::Link Monster]], [[Link Arrows::...]], or [[Link Rating::...]]), hide the column |
− | + | * if the query searches for Xyz Monsters (via [[Primary type::Xyz Monster]] or [[Rank::...]]/[[Rank string::...]]), display "Rank" | |
− | + | * if the query searches for a specific Level/Rank value (e.g. [[Level::7]] or [[Rank string::?]]), hide the column | |
− | + | * if the query searches for a nonspecific Level (e.g. [[Level::>4]]), show the column and display "Level" | |
− | + | * if the query searches for a nonspecific Rank (e.g. [[Rank::>4]]), show the column and display "Rank" | |
− | + | -->{{ #vardefine: $cq_level_in_results | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Level string::+]] | format=count }} | 0 || 1 }} | |
− | + | }}{{ #vardefine: $cq_rank_in_results | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Rank string::+]] | format=count }} | 0 || 1 }} | |
− | + | }}<!--{{ #vardefine: $cq_link_in_results | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Link Rating::+]] | format=count }} | 0 || 1 }} | |
− | + | }}-->{{ #vardefine: $cq_col_level/rank/link_label | |
− | + | | {{ #ifexpr: {{ #var: $cq_level_in_results | 0 }} + {{ #var: $cq_rank_in_results | 0 }} + {{ #var: $cq_link_in_results | 0 }} > 1 | |
− | + | | {{ #if: {{ #var: $cq_level_in_results }} | |
− | + | | [[Level]]/<br /> | |
+ | }}{{ #if: {{ #var: $cq_rank_in_results }} | ||
+ | | [[Rank]]{{ #if: {{ #var: $cq_link_in_results }} | /<br /> }} | ||
+ | }}{{ #if: {{ #var: $cq_link_in_results }} | ||
+ | | [[Link Rating|Link]] | ||
+ | }} | ||
+ | | {{ #if: {{ #var: $cq_level_in_results }} | ||
+ | | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | level:: }} | ||
+ | {{ #pos: {{ #var: $cq_query_normalized }} | stars:: }} | ||
+ | | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | level::^ }} | ||
+ | {{ #pos: {{ #var: $cq_query_normalized }} | stars::^ }} | ||
+ | | [[Level]] | ||
}} | }} | ||
− | + | | [[Level]] | |
− | + | }} | |
− | + | }}{{ #if: {{ #var: $cq_rank_in_results }} | |
− | | {{ #if: {{ #pos: {{ #var: $ | + | | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | rank:: }} |
− | + | {{ #pos: {{ #var: $cq_query_normalized }} | stars:: }} | |
+ | | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | rank::^ }} | ||
+ | {{ #pos: {{ #var: $cq_query_normalized }} | stars::^ }} | ||
+ | | [[Rank]] | ||
+ | }} | ||
+ | | [[Rank]] | ||
+ | }} | ||
+ | }}{{ #if: {{ #var: $cq_link_in_results }} | ||
+ | | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | link rating:: }} | ||
+ | {{ #pos: {{ #var: $cq_query_normalized }} | stars:: }} | ||
+ | | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | link rating::^ }} | ||
+ | {{ #pos: {{ #var: $cq_query_normalized }} | stars::^ }} | ||
+ | | [[Link Rating|Link]] | ||
+ | }} | ||
+ | | [[Link Rating|Link]] | ||
+ | }} | ||
}} | }} | ||
− | + | }} | |
− | }} }}{{ #if: {{ # | + | }}{{ #vardefine: $cq_col_level/rank/link | {{ #if: {{ #var: $cq_col_level/rank/link_label }} |
− | + | | ?Stars string = {{ #var: $cq_col_level/rank/link_label }} | |
− | + | }} | |
− | | {{ #if: {{ # | + | }}<!-- |
− | + | -->{{ #vardefine: $cq_col_scale | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[Pendulum Scale::+]] | format=count }} | 0 || ?Pendulum Scale = [[Pendulum Scale|Scale]] }} | |
+ | }}{{ #vardefine: $cq_equal_atkdef | {{ #if: {{ #pos: {{ #var: $cq_query }} | Equal ATK and DEF }} | {{ #if: {{ #pos: {{ #var: $cq_query }} | !Equal ATK and DEF }} || 1 }} }} | ||
+ | }}{{ #vardefine: $cq_col_atk | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}atk }} | ||
+ | | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | atk::^ }}{{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}def }} | ||
+ | | ?ATK string = [[ATK]]{{ #if: {{ #var: $cq_equal_atkdef }} | /<br />[[DEF]] }} | ||
+ | }} | ||
+ | | ?ATK string = [[ATK]]{{ #if: {{ #var: $cq_equal_atkdef }} | /<br />[[DEF]] }} | ||
+ | }} }}{{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[DEF string::+]] | format=count }} | 0 | ||
+ | | {{ #vardefine: $cq_col_link_rating | ?Link Rating = [[Link Rating|Link]] }} | ||
+ | | {{ #vardefine: $cq_col_def | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}def }} | ||
+ | | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | def::^ }}{{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}atk }} | ||
+ | | {{ #if: {{ #var: $cq_equal_atkdef }} || ?DEF string = [[DEF]] }} | ||
}} | }} | ||
− | | ?DEF string = [[DEF]] | + | | {{ #if: {{ #var: $cq_equal_atkdef }} || ?DEF string = [[DEF]] }} |
}} }} | }} }} | ||
+ | }}{{ #vardefine: $cq_col_maximum_atk | {{ #ifeq: {{ #var: $cq_medium }} | Rush Duel | {{ #ifeq: {{ #ask: {{ #var: $cq_full_query }} [[MAXIMUM ATK::+]] | format=count }} | 0 || ?MAXIMUM ATK#- = [[MAXIMUM ATK]] }} }} | ||
}} | }} | ||
− | | {{ #vardefine: $ | + | | {{ #vardefine: $cq_col_property | {{ #if: {{ #pos: {{ #var: $cq_query_lc }} | {{!((}}property:: }} | {{ #if: {{ #pos: {{ #var: $cq_query_normalized }} | {{!((}}property::^ }} | ?Property = [[Property]] }} | ?Property = [[Property]] }} |
− | }}{{ # | + | }}{{ #ifeq: {{ #var: $cq_card_type }} | skill |
− | + | || {{ #vardefine: $cq_col_card_type_st | {{ #if: {{ #var: $cq_col_card_type }} | {{ #switch: {{ #var: $cq_card_type }} | non-monster | <!-- empty --> = {{ #var: $cq_col_card_type }} [[Card type]] }} }} | |
+ | }}{{ #vardefine: $cq_col_card_type_st | {{ #if: {{ #var: $cq_col_property }} | {{ #var: $cq_col_card_type_st }} }} | ||
+ | }} | ||
}} | }} | ||
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_extra | {{ #if: {{{extra_column|}}} | ?{{{extra_column}}} }} |
+ | }}{{ #vardefine: $cq_col_extra_2 | {{ #if: {{{extra_column2|}}} | ?{{{extra_column2}}} }} | ||
}}<!-- | }}<!-- | ||
some other stuff | some other stuff | ||
− | -->{{ #vardefine: $ | + | -->{{ #vardefine: $cq_limit | {{ #if: {{{limit|}}} | {{ #iferror: {{ #expr: {{{limit}}} }} || {{{limit}}} }} }} |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_limit | {{ #ifexpr: {{ #var: $cq_limit | 50 }} > 500 | 500 | {{ #var: $cq_limit | 50 }} }}<!-- $smwgQMaxInlineLimit = 500 --> |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_sort | {{{sort|#}}}{{ #if: {{{sort|}}} | {{ #if: {{ #pos: {{{sort}}} | # }} || ,# }} }} |
− | }}{{ # | + | }}{{ #vardefine: $cq_order | {{{order|}}} |
+ | }}{{ #vardefine: $cq_count | {{ #explode: {{ #ask: {{ #var: $cq_full_query }} | format=count }} | < }} | ||
+ | }}{{ #vardefine: $cq_default | {{{default|}}} | ||
}}<!-- | }}<!-- | ||
we finally get to the actual query | we finally get to the actual query | ||
− | -->{{ #ask: {{ #var: $ | + | -->{{ #ask: {{ #var: $cq_full_query }} |
− | + | |{{ #if: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }}{{ #pos: {{ #var: $cq_query_lc }} | release:: }} | {{ #ifeq: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }} | vg || ?English name (linked) = Name }} }} | |
− | | | + | |{{ #var: $cq_col_japanese_name }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_character }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_primary_type }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_secondary_type }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_attribute }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_card_type_st }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_type }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_level/rank/link }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_scale }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_atk }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_def }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_link_rating }} |
− | |{{ #var: $ | + | |{{ #var: $cq_col_maximum_atk }} |
− | | {{ #if: {{ #var: $ | + | |{{ #var: $cq_col_property }} |
+ | |{{ #var: $cq_col_extra }} | ||
+ | |{{ #var: $cq_col_extra_2 }} | ||
+ | | {{ #if: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }}{{ #pos: {{ #var: $cq_query_lc }} | release:: }} | {{ #ifeq: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }} | vg || mainlabel = - }} | mainlabel = Name }} | ||
| headers = plain | | headers = plain | ||
− | | class = sortable wikitable smwtable card-list | + | | class = sortable wikitable smwtable card-list card-query-main |
− | | {{ #if: {{ #var: $ | + | | {{ #if: {{ #var: $cq_limit }} | limit = {{ #var: $cq_limit }} }} |
− | | {{ #if: {{ #var: $ | + | | {{ #if: {{ #var: $cq_sort }} | sort = {{ #var: $cq_sort }} }} |
− | | {{ #if: {{ #var: $ | + | | {{ #if: {{ #var: $cq_order }} | order = {{ #var: $cq_order }} }} |
− | | | + | | {{ #if: {{ #var: $cq_default }} | default = {{ #var: $cq_default }} }} |
+ | | searchlabel = <!-- nothing --> | ||
| {{ #if: {{{debug<includeonly>|</includeonly>}}} | format = debug }} | | {{ #if: {{{debug<includeonly>|</includeonly>}}} | format = debug }} | ||
+ | }}{{ #ifeq: {{ #var: $cq_count }} | 0 || <!-- | ||
+ | |||
+ | footer table - currently only has results count + links to see more results | ||
+ | |||
+ | -->{{ #vardefine: $cq_further_results_url | https://yugipedia.com/wiki/Special:Ask<!-- unfortunately we can't use {{fullurl:}} because we're generating only part of the URL here | ||
+ | -->?q={{ urlencode: {{ #var: $cq_full_query }} }}<!-- | ||
+ | -->&p={{ urlencode: mainlabel={{ #if: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }}{{ #pos: {{ #var: $cq_query_lc }} | release:: }} | {{ #ifeq: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }} | vg | Name | -2D }} | Name }} }}<!-- | ||
+ | -->&po={{ urlencode: {{ #if: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }}{{ #pos: {{ #var: $cq_query_lc }} | release:: }} | {{ #ifeq: {{ #var: $cq_query_medium | {{ #var: $cq_medium }} }} | vg || ?English name (linked) = Name }} }} | ||
+ | {{ #var: $cq_col_japanese_name }} | ||
+ | {{ #var: $cq_col_character }} | ||
+ | {{ #var: $cq_col_primary_type }} | ||
+ | {{ #var: $cq_col_secondary_type }} | ||
+ | {{ #var: $cq_col_attribute }} | ||
+ | {{ #var: $cq_col_card_type_st }} | ||
+ | {{ #var: $cq_col_type }} | ||
+ | {{ #var: $cq_col_level/rank/link }} | ||
+ | {{ #var: $cq_col_scale }} | ||
+ | {{ #var: $cq_col_atk }} | ||
+ | {{ #var: $cq_col_def }} | ||
+ | {{ #var: $cq_col_link_rating }} | ||
+ | {{ #var: $cq_col_maximum_atk }} | ||
+ | {{ #var: $cq_col_property }} | ||
+ | {{ #var: $cq_col_extra }} | ||
+ | {{ #var: $cq_col_extra_2 }} }}<!-- | ||
+ | -->&format=broadtable<!-- | ||
+ | -->&headers=plain<!-- | ||
+ | -->&class={{ urlencode: sortable wikitable smwtable card-list }}<!-- | ||
+ | -->{{ #if: {{ #var: $cq_sort }} | &sort={{ urlencode: {{ #var: $cq_sort }} }}&order={{ urlencode: {{ #var: $cq_order | asc }} }} }} | ||
+ | }} | ||
+ | <table class="wikitable smwtable plainlinks card-list card-query-more-links"> | ||
+ | <tr><td>{{ #ifexpr: {{ #var: $cq_count }} < {{ #var: $cq_limit }} + 1 | ||
+ | | {{ #ifeq: {{ #var: $cq_count }} | 1 | ||
+ | | Showing the only result | ||
+ | | Showing all {{ #var: $cq_count }} results | ||
+ | }} | ||
+ | | Showing first {{ #var: $cq_limit }} results, of {{ #var: $cq_count }} total<!-- | ||
+ | -->{{ #ifexpr: {{ #var: $cq_count }} > {{ #var: $cq_limit }} - 1 | ||
+ | | ¦ [{{ #var: $cq_further_results_url }}&limit={{ #var: $cq_limit }}&offset={{ #var: $cq_limit }} <!-- | ||
+ | -->{{ #ifexpr: {{ #var: $cq_count }} < {{ #var: $cq_limit }} * 2 | ||
+ | | {{ #ifexpr: {{ #var: $cq_count }} - {{ #var: $cq_limit }} = 1 | ||
+ | | Show remaining result | ||
+ | | Show remaining {{ #expr: {{ #var: $cq_count }} - {{ #var: $cq_limit }} }} results | ||
+ | }} | ||
+ | | Show next {{ #var: $cq_limit }} results | ||
+ | }}] | ||
+ | }}<!-- | ||
+ | -->{{ #ifexpr: {{ #var: $cq_count }} > 20 | ||
+ | | ¦ {{ #ifexpr: {{ #var: $cq_count }} < 50 | ||
+ | | [{{ #var: $cq_further_results_url }}&limit=20 Show first 20 results] | ||
+ | | Show first [[{{ #var: $cq_further_results_url }}&limit=20 20] · [{{ #var: $cq_further_results_url }}&limit=50 50]<!-- | ||
+ | -->{{ #ifexpr: {{ #var: $cq_count }} > 100 | · [{{ #var: $cq_further_results_url }}&limit=100 100] }}<!-- | ||
+ | -->{{ #ifexpr: {{ #var: $cq_count }} > 250 | · [{{ #var: $cq_further_results_url }}&limit=250 250] }}<!-- | ||
+ | -->{{ #ifexpr: {{ #var: $cq_count }} > 500 | · [{{ #var: $cq_further_results_url }}&limit=500 500] }}<!-- | ||
+ | -->] results | ||
+ | }} | ||
+ | }}<!-- | ||
+ | -->{{ #ifexpr: {{ #var: $cq_count }} < 501 | ¦ [{{ #var: $cq_further_results_url }}&limit=500 Show all {{ #var: $cq_count }} results] }} <!-- | ||
+ | -->(all links open a new page) | ||
+ | }} | ||
+ | </td></tr> | ||
+ | </table> | ||
}}<!-- | }}<!-- | ||
Line 192: | Line 336: | ||
-->{{ #if: {{{debug<includeonly>|</includeonly>}}} | <nowiki/> | -->{{ #if: {{{debug<includeonly>|</includeonly>}}} | <nowiki/> | ||
− | * <code>#ask</code> query: <code>{{ #tag: nowiki | {{ #var: $ | + | * <code>#ask</code> query: <code>{{ #tag: nowiki | {{ #var: $cq_full_query }} }}</code> |
− | * <abbr title="query entered">$ | + | * <abbr title="query entered">$cq_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_query }} }}</code> |
− | * <abbr title="lowercased query entered">$ | + | * <abbr title="lowercased query entered">$cq_query_lc</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_query_lc }} }}</code> |
− | * <abbr title="normalized < | + | * <abbr title="normalized lowercased query entered">$cq_query_normalized</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_query_normalized }} }}</code> |
− | * <abbr title=" | + | * <abbr title="normalized <nowiki>{{{medium}}}</nowiki> entered">$cq_medium</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_medium }} }}</code> |
− | * <abbr title=" | + | * <abbr title="processed $cq_medium ready to use on the query">$cq_medium_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_medium_query }} }}</code> |
− | * <abbr title=" | + | * <abbr title="type of the medium (if for cards, to enable/disable labels)">$cq_query_medium</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_query_medium }} }}</code> |
− | * <abbr title=" | + | * <abbr title="normalized <nowiki>{{{type}}}</nowiki> entered">$cq_card_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_card_type }} }}</code> |
− | * <abbr title=" | + | * <abbr title="processed $cq_card_type ready to use on the query">$cq_card_type_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_card_type_query }} }}</code> |
− | * <abbr title="for | + | * <abbr title="concept used to reduce load for queries asking for common medium+card type combos">$cq_concept_query</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_concept_query }} }}</code> |
− | * <abbr title=" | + | * <abbr title="enable/disable «?Card type» column">$cq_col_card_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_card_type }} }}</code> |
− | * <abbr title="for monster cards, enable/disable «? | + | * <abbr title="for monster cards, enable/disable «?Primary type» column">$cq_col_primary_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_primary_type }} }}</code> |
− | * <abbr title="for monster cards, enable/disable «? | + | * <abbr title="for monster cards, enable/disable «?Secondary type» column">$cq_col_secondary_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_secondary_type }} }}</code> |
− | * <abbr title="for monster cards, enable/disable «? | + | * <abbr title="for monster cards, enable/disable «?Attribute» column">$cq_col_attribute</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_attribute }} }}</code> |
− | * <abbr title="for monster cards, enable/disable «? | + | * <abbr title="for monster cards, enable/disable «?Type» column">$cq_col_type</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_type }} }}</code> |
− | * <abbr title="for monster cards, enable/disable «? | + | * <abbr title="for monster cards, enable/disable «?Stars string» column">$cq_col_level/rank/link</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_level/rank/link }} }}</code> |
− | * <abbr title="for monster cards, enable/disable «? | + | * <abbr title="for monster cards, enable/disable «?Pendulum Scale» column">$cq_col_scale</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_scale }} }}</code> |
− | * <abbr title="for monster cards, enable/disable «? | + | * <abbr title="for monster cards, enable/disable «?Link Rating» column">$cq_col_link_rating</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_link_rating }} }}</code> |
− | * <abbr title="for | + | * <abbr title="for monster cards, enable/disable «?ATK string» column">$cq_col_atk</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_atk }} }}</code> |
− | * <abbr title="for | + | * <abbr title="for monster cards, enable/disable «?DEF string» column">$cq_col_def</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_def }} }}</code> |
− | * <abbr title=" | + | * <abbr title="for monster cards, enable/disable «?MAXIMUM ATK» column">$cq_col_maximum_atk</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_maximum_atk }} }}</code> |
− | * <abbr title=" | + | * <abbr title="for Spell/Traps, enable/disable «?Card type» column">$cq_col_card_type_st</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_card_type_st }} }}</code> |
− | + | * <abbr title="for Spell/Traps, enable/disable «?Property» column">$cq_col_property</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_property }} }}</code> | |
− | + | * <abbr title="to add an extra column"><code><nowiki>{{{extra_column}}}</nowiki></code></abbr>: <code>{{ #tag: nowiki | {{{extra_column|}}} }}</code> | |
− | * <abbr title="<nowiki>{{{ | + | * <abbr title="to add a second extra column"><code><nowiki>{{{extra_column2}}}</nowiki></code></abbr>: <code>{{ #tag: nowiki | {{{extra_column2|}}} }}</code> |
− | * <abbr title="<nowiki>{{{ | + | * <abbr title="full new column (with label, if passed)">$cq_col_extra</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_extra }} }}</code> |
− | * <abbr title="results count">$ | + | * <abbr title="second full new column (with label, if passed)">$cq_col_extra_2</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_col_extra_2 }} }}</code> |
+ | * limit: {{ #var: $cq_limit | 50 }} | ||
+ | * <abbr title="<nowiki>{{{sort}}}</nowiki>, for sorting the results by property">$cq_sort</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_sort }} }}</code> | ||
+ | * <abbr title="<nowiki>{{{order}}}</nowiki>, for ordering the results by values">$cq_order</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_order }} }}</code> | ||
+ | * <abbr title="<nowiki>{{{default}}}</nowiki>, to be displayed if a query has no results">$cq_default</abbr>: <code>{{ #tag: nowiki | {{ #var: $cq_default }} }}</code> | ||
+ | * <abbr title="results count">$cq_count</abbr>: {{ #var: $cq_count }} | ||
}}<!-- | }}<!-- | ||
we have to blank the column variables to keep from polluting subsequent transclusions (since they aren't always defined above, and therefore aren't guaranteed to be blank from previous transclusions) | we have to blank the column variables to keep from polluting subsequent transclusions (since they aren't always defined above, and therefore aren't guaranteed to be blank from previous transclusions) | ||
− | -->{{ #vardefine: $ | + | -->{{ #vardefine: $cq_col_japanese_name |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_character |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_card_type |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_card_type_st |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_primary_type |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_secondary_type |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_attribute |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_type |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_level_rank_flags |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_level/rank/link |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_scale |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_atk |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_def |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_link_rating |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_maximum_atk |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_property |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_extra |
− | }}{{ #vardefine: $ | + | }}{{ #vardefine: $cq_col_extra_2 |
+ | }}{{ #vardefine: $cq_limit | ||
+ | }}{{ #vardefine: $cq_sort | ||
+ | }}{{ #vardefine: $cq_order | ||
+ | }}{{ #vardefine: $cq_default | ||
+ | }}{{ #vardefine: $cq_count | ||
}}<!-- | }}<!-- | ||
− | last, any tracking categories | + | last, any tracking categories/properties |
− | -->{{ #if: {{ #pos: {{ #var: $ | + | -->{{ #if: {{{t|}}} |<!-- stuff we don't want applied if {{Card query}} is added via another template (e.g. by {{Card list}}) --> |
− | + | | [[((Card query)) query value::{{ #replace: {{ #replace: {{ #replace: {{ #var: $cq_query }} | {{!}} | | }} | {{!(}} | [ }} | {{)!}} | ] }}| ]] | |
− | + | }}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | card category }} | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | s/t class }} | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | rfp:: }}<!-- replace with "Banishing" --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | remove from play }}<!-- replace with "banish" --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | removes from play }}<!-- replace with "banishes" --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | removed from play }}<!-- replace with "banished" --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | removing from play }}<!-- replace with "banishing" --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | monster type:: }}<!-- replace with "Primary type" or "Secondary type" as appropriate --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | life points:: }}<!-- replace with "LP" --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | token monster }}<!-- replace with "Monster Token" --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | ?atk }}<!-- replace with "ATK string" (usually) --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | ?def }}<!-- replace with "DEF string" (usually) --> | |
− | + | {{ #pos: {{ #var: $cq_query_lc }} | ?level }}<!-- replace with "Level string" (usually) --> | |
+ | {{ #pos: {{ #var: $cq_query_lc }} | ?rank }}<!-- replace with "Rank string" (usually) --> | ||
+ | {{ #pos: {{ #var: $cq_query_lc }} | ?stars }}<!-- replace with "Stars string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | card category | 1 }} | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | s/t class | 1 }} | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | rfp | 1 }}<!-- replace with "Banishing" --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | monster type | 1 }}<!-- replace with "Primary type" or "Secondary type" as appropriate --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | life points | 1 }}<!-- replace with "LP" --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?atk | 1 }}<!-- replace with "ATK string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?def | 1 }}<!-- replace with "DEF string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?level | 1 }}<!-- replace with "Level string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?rank | 1 }}<!-- replace with "Rank string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column}}} }} | ?stars | 1 }}<!-- replace with "Stars string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | card category | 1 }} | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | s/t class | 1 }} | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | rfp | 1 }}<!-- replace with "Banishing" --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | monster type | 1 }}<!-- replace with "Primary type" or "Secondary type" as appropriate --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | life points | 1 }}<!-- replace with "LP" --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?atk | 1 }}<!-- replace with "ATK string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?def | 1 }}<!-- replace with "DEF string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?level | 1 }}<!-- replace with "Level string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?rank | 1 }}<!-- replace with "Rank string" (usually) --> | ||
+ | {{ #ifeq: {{ lc: {{{extra_column2}}} }} | ?stars | 1 }}<!-- replace with "Stars string" (usually) --> | ||
| [[Category:((Card query)) transclusions querying deprecated properties]] | | [[Category:((Card query)) transclusions querying deprecated properties]] | ||
− | }}{{ #if: {{ #pos: {{ #var: $ | + | }}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | class 1 }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | medium:: }} |
| [[Category:((Card query)) transclusions which should use (((medium)))]] | | [[Category:((Card query)) transclusions which should use (((medium)))]] | ||
− | }}{{ #if: {{ #var: $ | + | }}{{ #if: {{ #var: $cq_medium_unknown }} |
| [[Category:((Card query)) transclusions with an unknown (((medium))) value]] | | [[Category:((Card query)) transclusions with an unknown (((medium))) value]] | ||
− | }}{{ #if: {{ #pos: {{ #var: $ | + | }}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | card type:: }} |
| [[Category:((Card query)) transclusions which should use (((type)))]] | | [[Category:((Card query)) transclusions which should use (((type)))]] | ||
− | }}{{ #if: {{ #var: $ | + | }}{{ #if: {{ #var: $cq_card_type_unknown }} |
| [[Category:((Card query)) transclusions with an unknown (((type))) value]] | | [[Category:((Card query)) transclusions with an unknown (((type))) value]] | ||
− | |||
− | |||
}}{{ #if: {{{extra_column|}}} | }}{{ #if: {{{extra_column|}}} | ||
− | | [[Category:Queries with an extra column]]{{ #ifeq: {{{extra_column}}} | {{{ | + | | [[Category:Queries with an extra column]]{{ #if: {{{extra_column2|}}} |
− | + | | [[Category:Queries with two extra columns]]{{ #ifeq: {{{extra_column}}} | {{{extra_column2}}} | |
+ | | [[Category:((Card query)) transclusions with duplicate extra_column and extra_column2]] | ||
+ | }} | ||
}} | }} | ||
− | | {{ #if: {{{ | + | | {{ #if: {{{extra_column2|}}} |
− | | [[Category:((Card query)) transclusions with | + | | [[Category:Queries with an extra column]][[Category:((Card query)) transclusions with extra_column2 but no extra_column]] |
}} | }} | ||
}}{{ #if: {{{sort|}}} | }}{{ #if: {{{sort|}}} | ||
Line 283: | Line 459: | ||
}}{{ #if: {{{order|}}} | }}{{ #if: {{{order|}}} | ||
| [[Category:Queries with a custom order]] | | [[Category:Queries with a custom order]] | ||
+ | }}{{ #if: {{{default|}}} | ||
+ | | [[Category:Queries with a custom default value]] | ||
}}{{ #if: {{{limit|}}} | }}{{ #if: {{{limit|}}} | ||
| {{ #iferror: {{ #expr: {{{limit}}} }} | | {{ #iferror: {{ #expr: {{{limit}}} }} | ||
Line 288: | Line 466: | ||
| {{ #ifeq: {{{limit}}} | 50 | | {{ #ifeq: {{{limit}}} | 50 | ||
| [[Category:((Card query)) transclusions with an unnecessary limit]] | | [[Category:((Card query)) transclusions with an unnecessary limit]] | ||
− | | [[Category:Queries with a custom limit]] | + | | {{ #ifexpr: {{{limit}}} > 500 |
+ | | [[Category:((Card query)) transclusions with a limit above $smwgQMaxInlineLimit]] | ||
+ | | [[Category:Queries with a custom limit]] | ||
+ | }} | ||
}} | }} | ||
}} | }} | ||
− | }}{{ #if: {{ #pos: {{ #var: $ | + | }}{{ #if: {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}} }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | {{))!}} or {{!((}} }} |
| [[Category:Queries with disjunctions]] | | [[Category:Queries with disjunctions]] | ||
− | }}{{ #if: {{ #pos: {{ # | + | }}{{ #if: {{ #pos: {{ #replace: {{ #var: $cq_query }} }} | {{))!}}{{!((}} }} |
− | |||
| [[Category:Queries with multiple terms]] | | [[Category:Queries with multiple terms]] | ||
− | }}{{ #if: {{ #pos: {{ #var: $ | + | }}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | <q> }} |
| [[Category:Queries with subqueries]] | | [[Category:Queries with subqueries]] | ||
− | }}{{ #if: {{ #pos: {{ #var: $ | + | }}{{ #if: {{ #pos: {{ #var: $cq_query }} | ::~ }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}~ }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | {{!((}}~ }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | ::!~ }} |
+ | {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}!~ }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}!~ }} | ||
| [[Category:Queries with a like comparator]] | | [[Category:Queries with a like comparator]] | ||
− | }}{{ #if: {{ #pos: {{ #var: $ | + | }}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | ::like: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | {{!}}{{!}}like: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | ::nlike: }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query_lc }} | {{!}}{{!}}nlike: }} |
| [[Category:Queries with a like comparator]][[Category:Queries using LIKE/NOT LIKE SQL notation]] | | [[Category:Queries with a like comparator]][[Category:Queries using LIKE/NOT LIKE SQL notation]] | ||
− | }}{{ #if: {{ #pos: {{ #replace: {{ #var: $ | + | }}{{ #if: {{ #pos: {{ #replace: {{ #var: $cq_query }} | ::!~ }} | ::! }} |
− | {{ #pos: {{ #replace: {{ #var: $ | + | {{ #pos: {{ #replace: {{ #var: $cq_query }} | {{!}}{{!}}!~ }} | {{!}}{{!}}! }} |
+ | {{ #pos: {{ #replace: {{ #var: $cq_query }} | {{!((}}!~ }} | {{!((}}! }} | ||
| [[Category:Queries with a not equal comparator]] | | [[Category:Queries with a not equal comparator]] | ||
− | }}{{ #if: {{ #pos: {{ #var: $ | + | }}{{ #if: {{ #pos: {{ #var: $cq_query }} | ::< }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | ::> }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | ::≤ }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | ::≥ }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}< }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}> }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}≤ }} |
− | {{ #pos: {{ #var: $ | + | {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}≥ }} |
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}< }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}> }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}≤ }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}≥ }} | ||
| [[Category:Queries with comparators]] | | [[Category:Queries with comparators]] | ||
+ | }}{{ #if: {{ #pos: {{ #var: $cq_query }} | ::+ }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!}}{{!}}+ }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}+ }} | ||
+ | | [[Category:Queries with wildcards]] | ||
+ | }}{{ #if: {{ #pos: {{ #var: $cq_query_lc }} | english name }} | ||
+ | {{ #pos: {{ #var: $cq_query_lc }} | page name }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}~ }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}! }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}< }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}> }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}≤ }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}≥ }} | ||
+ | {{ #pos: {{ #var: $cq_query }} | {{!((}}+ }} | ||
+ | | [[Category:Queries which specify cards for inclusion/exclusion]] | ||
+ | }}{{ #if: {{ #pos: {{ #var: $cq_query }} | <> }} | ||
+ | | [[Category:Queries with a bad comparator]] | ||
+ | }}{{ #invoke: check for unknown parameters | check | ||
+ | | unknown = [[Category:((Card query)) transclusions using unknown parameters]] | ||
+ | | showblankpositional = 1 | ||
+ | | preview = unknown <nowiki>{{Card query}}</nowiki> parameter "_VALUE_" | ||
+ | | 1 | medium | type | ||
+ | | extra_column | extra_column2 | ||
+ | | limit | sort | order | default | ||
+ | | debug | t | ||
}}<noinclude> | }}<noinclude> | ||
{{Documentation}}</noinclude> | {{Documentation}}</noinclude> |
Revision as of 02:25, 15 March 2023
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
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
ID | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | t0 | ALL | smw_iw,smw_iw_2 | 4826650 | Using where; Using filesort |
Auxilliary Tables
No auxilliary tables used.Query Metrics
Query-Size:0Query-Depth:0
Errors and Warnings
The query description has an empty condition.The query description has an empty condition.
#ask
query:- $cq_query:
- $cq_query_lc:
- $cq_query_normalized:
- $cq_medium:
- $cq_medium_query:
- $cq_query_medium:
- $cq_card_type:
- $cq_card_type_query:
- $cq_concept_query:
- $cq_col_card_type:
?Card type =
- $cq_col_primary_type:
- $cq_col_secondary_type:
- $cq_col_attribute:
- $cq_col_type:
- $cq_col_level/rank/link:
- $cq_col_scale:
- $cq_col_link_rating:
- $cq_col_atk:
- $cq_col_def:
- $cq_col_maximum_atk:
- $cq_col_card_type_st:
?Card type = [[Card type]]
- $cq_col_property:
?Property = [[Property]]
{{{extra_column}}}
:{{{extra_column2}}}
:- $cq_col_extra:
- $cq_col_extra_2:
- limit: 50
- $cq_sort:
#
- $cq_order:
- $cq_default:
- $cq_count: 0