Template:CardSearch: Difference between revisions

From LOTR-TCG Wiki
No edit summary
Tag: Reverted
No edit summary
(32 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{#template_params:isUnique|sort}}
{{#template_params:isUnique|sort}}
</noinclude><includeonly>
</noinclude><includeonly>


{{#cargo_query:tables=Cards=C,CardReleases=EN,CardReleases=CR,CardSets=S,Languages=L
{{#cargo_query:tables=Cards=C,CardReleases=EN,CardReleases=CR,CardSets=S,Languages=L
Line 26: Line 27:
AND ("{{{usesCardtype|}}}" = "" OR CR.GameText RLIKE "(?<!this )({{#replace:{{#replace:{{#replace:{{{usesCardtype|}}}|,|{{!}}}}||}}|TheOneRing|The One Ring}})" )
AND ("{{{usesCardtype|}}}" = "" OR CR.GameText RLIKE "(?<!this )({{#replace:{{#replace:{{#replace:{{{usesCardtype|}}}|,|{{!}}}}||}}|TheOneRing|The One Ring}})" )


AND ("{{{race|}}}" = "" OR (C.CardType IN ('Minion', 'Companion', 'Ally') AND ("{{{race|}}}" LIKE CONCAT('%', CR.Subtypes__full, '%') OR ("{{{race|}}}" = "[Raceless]" AND CR.Subtypes__full IS NULL)) ))
AND ("{{{race|}}}" = "" OR (C.CardType IN ('Minion', 'Companion', 'Ally') AND ("{{{race|}}}" LIKE CONCAT('%', CR.Subtypes__full, '%') OR ("{{{race|}}}" = "[Raceless]" AND CR.Subtypes__full IS NULL AND CR.Revision = 0)) ))
AND ("{{{usesRace|}}}" = "" OR CR.GameText RLIKE "({{#replace:{{#replace:{{{usesRace|}}}|,|{{!}}}}||}})" OR ("{{{usesRace|}}}" LIKE '%Dwarf%' AND CR.GameText LIKE '%Dwarves%') OR ("{{{usesRace|}}}" LIKE '%Elf%' AND CR.GameText LIKE '%Elves%') )
 
AND ("{{{itemClass|}}}" = "" OR (C.CardType IN ('Artifact', 'Possession') AND ("{{{itemClass|}}}" LIKE CONCAT('%', CR.Subtypes__full, '%') OR ("{{{itemClass|}}}" = "[Classless]" AND CR.Subtypes__full IS NULL AND CR.Revision = 0)) ))
AND ("{{{usesItemClass|}}}" = "" OR CR.GameText RLIKE "({{#replace:{{#replace:{{#replace:{{#replace:{{{usesItemClass|}}}|,|{{!}}}}||}}|RangedWeapon|Ranged Weapon}}|HandWeapon|Hand Weapon}})" )
 
AND ("{{{keyword|}}}" = "" OR CR.GameText RLIKE '(?<!\\w )({{#replace:{{#replace:{{#replace:{{#replace:{{{keyword|}}}|,|{{!}}}}||}}|+|XX \\+}}|XX|}})\\.' OR ("{{{keyword|}}}" LIKE '%Ring-bound%' AND (C.Title IN ('Frodo', 'Sam') OR CR.CanBearRing = 1)) OR ("{{{keyword|}}}" LIKE '%Unbound%' AND (C.CardType = 'Companion' AND C.Title NOT IN ('Frodo', 'Sam') AND CR.GameText NOT RLIKE '(?<!\\w )Ring-bound\\.')) OR ("{{{keyword|}}}" LIKE '%Ambush%' AND CR.GameText RLIKE '(?<!\\w )Ambush \\(\\d+\\)\\.') )
 
AND ("{{{usesKeyword|}}}" = "" OR (CR.GameText RLIKE '(?<=\\w )({{#replace:{{#replace:{{{usesKeyword|}}}|,|{{!}}}}||}})' AND (1 = CASE WHEN "{{{usesKeyword|}}}" LIKE '%Archer%' AND CR.GameText LIKE '%Archer%' THEN CR.GameText RLIKE '(?<=\\w )archer\\b' ELSE 1 END )) )




Line 69: Line 78:
AND ("{{#replace:{{{loreSearch|}}}|"|}}" = "" OR CR.Lore RLIKE "{{#replace:{{{loreSearch|}}}|"|}}")
AND ("{{#replace:{{{loreSearch|}}}|"|}}" = "" OR CR.Lore RLIKE "{{#replace:{{{loreSearch|}}}|"|}}")


AND {{PromoFilter}}


|group by=C._pageName, CR.LanguageCode, CR.Subset, CR.Revision
|group by=C._pageName, CR.LanguageCode, CR.Subset, CR.Revision

Revision as of 11:41, 26 September 2022

This is the "CardSearch" template.

It should be called in the following format:

{{CardSearch
|isUnique=
|sort=
}}

Edit the page to see the template text.