תבנית:QueryGamesTemplate: הבדלים בין גרסאות בדף
מתוך מכביפדיה
(Use CanonicalName for opponents in order to avoid ')
אין תקציר עריכה
שורה 5: שורה 5:
</noinclude><includeonly><!--
</noinclude><includeonly><!--
Define local parameters:
Define local parameters:
                        -->{{#vardefine: SameCompetitions|{{המרות/המרות מפעל/מפעל לרשימת מפעלים מקושרים| מפעל={{{Competition|}}} }} }}<!--
                         -->{{#vardefine: SameStadiums|{{המרות/המרות אצטדיון/אצטדיון לרשימת אצטדיונים מקושרים| אצטדיון={{{Stadium|}}} }} }}<!--
                         -->{{#vardefine: SameStadiums|{{המרות/המרות אצטדיון/אצטדיון לרשימת אצטדיונים מקושרים| אצטדיון={{{Stadium|}}} }} }}<!--
                         -->{{#vardefine: SameOpponents|{{המרות/המרות יריבה/יריבה לרשימת יריבות מקושרות| יריבה={{{Opponent|}}} }} }}<!--
                         -->{{#vardefine: SameOpponents|{{המרות/המרות יריבה/יריבה לרשימת יריבות מקושרות| יריבה={{{Opponent|}}} }} }}<!--
שורה 25: שורה 24:
Moreover, It seems that writing "Profiles.Position HOLDS Players_Positions.PositionType" on the join clause is doing right join and therefore disable the ability to query games without players, so we have to follow the plain SQL way to do it: https://www.mediawiki.org/wiki/Extension:Cargo/Querying_data#The_"HOLDS"_command
Moreover, It seems that writing "Profiles.Position HOLDS Players_Positions.PositionType" on the join clause is doing right join and therefore disable the ability to query games without players, so we have to follow the plain SQL way to do it: https://www.mediawiki.org/wiki/Extension:Cargo/Querying_data#The_"HOLDS"_command
-->{{#cargo_query:
-->{{#cargo_query:
tables=Games_Catalog, Competitions_Catalog, Games_Results, Games_Events, Games_Events=Events2, Days_In_Week, Games_Videos, Football_Games_Uniforms, Opponents, Profiles, Profiles__Position, Players_Positions
tables=Games_Catalog, Competitions, Games_Results, Games_Events, Games_Events=Events2, Days_In_Week, Games_Videos, Football_Games_Uniforms, Opponents, Profiles, Profiles__Position, Players_Positions
|join on=Games_Catalog.Competition = Competitions_Catalog.CompID
|join on=Games_Catalog.Competition = Competitions.CurrentName
         ,Games_Catalog.ResultOpt = Games_Results.ResultType
         ,Games_Catalog.ResultOpt = Games_Results.ResultType
         ,Games_Catalog._pageID = Games_Events._pageID
         ,Games_Catalog._pageID = Games_Events._pageID
שורה 40: שורה 39:




{{#if: {{{Competition|}}} |  AND Games_Catalog.Competition IN ({{#var: SameCompetitions}}) }}<!-- the "()" around the SameCompetition required for "IN" operator -->
{{#if: {{{SpecificCompetition|}}} |  AND Competitions.OriginalName = "{{{SpecificCompetition}}}" }}
{{#ifeq: {{{CompetitionCategory|}}} | ליגה| AND League=1 }}
{{#ifeq: {{{CompetitionCategory|}}} | גביע| AND Trophy=1 }}
{{#ifeq: {{{CompetitionCategory|}}} | בינלאומי| AND International=1 }}
{{#ifeq: {{{CompetitionCategory|}}} | רשמי| AND Office=1 }}
{{#ifeq: {{{CompetitionCategory|}}} | לא רשמי| AND Office=0 }}
 
{{#if: {{{Stadium|}}} |  AND Games_Catalog.Stadium IN ({{#var: SameStadiums}}) }}<!-- the "()" around the SameStadiums required for "IN" operator -->
{{#if: {{{Stadium|}}} |  AND Games_Catalog.Stadium IN ({{#var: SameStadiums}}) }}<!-- the "()" around the SameStadiums required for "IN" operator -->
{{#if: {{{Opponent|}}} |  AND Games_Catalog.Opponent IN ({{#var: SameOpponents}}) }}<!-- the "()" around the SameOpponents required for "IN" operator -->
{{#if: {{{Opponent|}}} |  AND Games_Catalog.Opponent IN ({{#var: SameOpponents}}) }}<!-- the "()" around the SameOpponents required for "IN" operator -->
שורה 85: שורה 90:
{{#ifeq: {{{FullGame|}}}| רק משחקים עם משחק מלא| AND Games_Videos.FullGame IS NOT NULL}}
{{#ifeq: {{{FullGame|}}}| רק משחקים עם משחק מלא| AND Games_Videos.FullGame IS NOT NULL}}
{{#ifeq: {{{Highlights|}}}| רק משחקים עם תקציר| AND Games_Videos.Highlights IS NOT NULL}}
{{#ifeq: {{{Highlights|}}}| רק משחקים עם תקציר| AND Games_Videos.Highlights IS NOT NULL}}
{{#ifeq: {{{OfficialGames|}}}| רק משחקים רשמיים| AND Games_Catalog.Competition NOT IN (19, 21)}}
{{#ifeq: {{{OfficialGames|}}}| רק משחקים לא רשמיים| AND Games_Catalog.Competition IN (19, 21)}}


{{#ifeq: {{{UniformsTag|}}}| משחקים עם תיוג מדים| AND Football_Games_Uniforms.KitName IS NOT NULL}}
{{#ifeq: {{{UniformsTag|}}}| משחקים עם תיוג מדים| AND Football_Games_Uniforms.KitName IS NOT NULL}}
שורה 97: שורה 99:
           ,Games_Catalog.Date=תאריך
           ,Games_Catalog.Date=תאריך
           ,CONCAT('[[עונת ', Games_Catalog.Season, ']]')=עונה
           ,CONCAT('[[עונת ', Games_Catalog.Season, ']]')=עונה
           ,CONCAT('[[', Competitions_Catalog.Name, ']]')=מפעל <!-- Cast number to name from Competitions Table -->
           ,CONCAT('[[', Competitions.OriginalName, ']]')=מפעל
           ,Games_Catalog.Leg=שלב במפעל
           ,Games_Catalog.Leg=שלב במפעל
           ,CONCAT('[[', Opponents.OriginalName, ']]')=יריבה
           ,CONCAT('[[', Opponents.OriginalName, ']]')=יריבה

גרסה מ־21:23, 1 בספטמבר 2022

לינק לעמוד לחיפוש משחקים

ערכו את הדף כדי לצפות בטקסט התבנית.