תבנית:QueryGamesTemplate: הבדלים בין גרסאות בדף
מתוך מכביפדיה
אין תקציר עריכה
אין תקציר עריכה
 
(38 גרסאות ביניים של אותו משתמש אינן מוצגות)
שורה 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|}}} }} }}<!--
שורה 11: שורה 10:
                         -->{{#vardefine: GoalsForOpponentOperator| {{#בחר:{{{OpponentGoalsAction|}}}|מתחת ל=<|בדיוק==|מעל ל=> }} }}<!--
                         -->{{#vardefine: GoalsForOpponentOperator| {{#בחר:{{{OpponentGoalsAction|}}}|מתחת ל=<|בדיוק==|מעל ל=> }} }}<!--
                         -->{{#vardefine: GoalsDiffForMaccabiOperator| {{#בחר:{{{MaccabiGoalsDifferentAction|}}}|מתחת ל=<|בדיוק==|מעל ל=> }} }}<!--
                         -->{{#vardefine: GoalsDiffForMaccabiOperator| {{#בחר:{{{MaccabiGoalsDifferentAction|}}}|מתחת ל=<|בדיוק==|מעל ל=> }} }}<!--
                        -->{{#vardefine: GoalsDiffForOpponentOperator| {{#בחר:{{{OpponentGoalsDifferentAction|}}}|מתחת ל=<|בדיוק==|מעל ל=> }} }}<!--
                         -->{{#vardefine: PlayerEvent|{{המרות/תיאור אירוע לשליפת משחקים למספר אירוע| אירוע={{{PlayerAction|}}} }} }}<!--
                         -->{{#vardefine: PlayerEvent|{{המרות/תיאור אירוע לשליפת משחקים למספר אירוע| אירוע={{{PlayerAction|}}} }} }}<!--
                         -->{{#vardefine: PlayerSubEvent|{{תבנית: המרות/תיאור תת אירוע למספר תת אירוע| תת אירוע={{{PlayerSubAction|}}} }} }}<!--
                         -->{{#vardefine: PlayerSubEvent|{{תבנית: המרות/תיאור תת אירוע למספר תת אירוע| תת אירוע={{{PlayerSubAction|}}} }} }}<!--
                         -->{{#vardefine: PlayerEvent2|{{המרות/תיאור אירוע לשליפת משחקים למספר אירוע| אירוע={{{PlayerAction2|}}} }} }}<!--
                         -->{{#vardefine: PlayerEvent2|{{המרות/תיאור אירוע לשליפת משחקים למספר אירוע| אירוע={{{PlayerAction2|}}} }} }}<!--
                         -->{{#vardefine: PlayerSubEvent2|{{תבנית: המרות/תיאור תת אירוע למספר תת אירוע| תת אירוע={{{PlayerSubAction2|}}} }} }}<!--
                         -->{{#vardefine: PlayerSubEvent2|{{תבנית: המרות/תיאור תת אירוע למספר תת אירוע| תת אירוע={{{PlayerSubAction2|}}} }} }}<!--
                        -->{{#vardefine: Player1Defined| {{{Player|}}}{{{PlayerNumber|}}}{{{PlayerAction|}}}{{{PlayerActionMinute|}}}{{{PlayerSubAction|}}}{{{PlayerSubActionMinute|}}}{{{PlayerPosition|}}} }}<!--
                        -->{{#vardefine: Player2Defined| {{{Player2|}}}{{{PlayerNumber2|}}}{{{PlayerAction2|}}}{{{PlayerActionMinute2|}}}{{{PlayerSubAction2|}}}{{{PlayerSubActionMinute2|}}}{{{PlayerPosition2|}}} }}<!--




We use the hacky way of concating all player related params in order to "turn on" the check for Team=1,
We use the hacky way of concating all player related params in order to "turn on" the check for Team=1,
There are some games without any maccabi players, we dont want to avoid querying them if we can avoid it (means we search for the game data and not players data).
There are some games without any maccabi players, we don't want to avoid querying them if we can avoid it (means we search for the game data and not players data).
 
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, Players_Positions
tables=Football_Games, 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=Football_Games.Competition = Competitions.OriginalName
         ,Games_Catalog.ResultOpt = Games_Results.ResultType
         ,Football_Games.ResultOpt = Games_Results.ResultType
         ,Games_Catalog._pageID = Games_Events._pageID
         ,Football_Games._pageID = Games_Events._pageID
         ,Games_Catalog.MatchDay = Days_In_Week.DayNumber
         ,Football_Games.MatchDay = Days_In_Week.DayNumber
         ,Games_Catalog._pageID = Games_Videos._pageID  
         ,Football_Games._pageID = Games_Videos._pageID  
         ,Games_Events._pageID = Events2._pageID
         ,Games_Events._pageID = Events2._pageID
         ,Games_Catalog._pageID = Football_Games_Uniforms._pageID
         ,Football_Games._pageID = Football_Games_Uniforms._pageID
         ,Games_Catalog.Opponent = Opponents.OriginalName
         ,Football_Games.Opponent = Opponents.CanonicalName
         ,Games_Events.PlayerName = Profiles._pageName
         ,Games_Events.PlayerName = Profiles._pageName
         ,Profiles.Position HOLDS Players_Positions.PositionType
         ,Profiles._ID=Profiles__Position._rowID
        ,Profiles__Position._value = Players_Positions.PositionType
|where=1=1
|where=1=1
{{#if: {{{Player|}}}{{{PlayerNumber|}}}{{{PlayerAction|}}}{{{PlayerActionMinute|}}}{{{PlayerSubAction|}}}{{{PlayerSubActionMinute|}}}{{{PlayerPosition|}}}| And Games_Events.Team = 1}}
{{#if: {{{Player2|}}}{{{PlayerNumber2|}}}{{{PlayerAction2|}}}{{{PlayerActionMinute2|}}}{{{PlayerSubAction2|}}}{{{PlayerSubActionMinute2|}}}{{{PlayerPosition2|}}}| And Events2.Team = 1}}


{{#if: {{{Competition|}}} |  AND Games_Catalog.Competition IN ({{#var: SameCompetitions}}) }}<!-- the "()" around the SameCompetition required for "IN" operator -->
 
{{#if: {{{Stadium|}}} |  AND Games_Catalog.Stadium IN ({{#var: SameStadiums}}) }}<!-- the "()" around the SameStadiums required for "IN" operator -->
{{#if: {{{SpecificCompetition|}}} |  AND Competitions.OriginalName = "{{{SpecificCompetition}}}" }}
{{#if: {{{Opponent|}}} |  AND Games_Catalog.Opponent IN ({{#var: SameOpponents}}) }}<!-- the "()" around the SameOpponents required for "IN" operator -->
{{#ifeq: {{{CompetitionCategory|}}} | ליגה| AND Competitions.League=1 }}
{{#ifeq: {{{CompetitionCategory|}}} | גביע| AND Competitions.Trophy=1 }}
{{#ifeq: {{{CompetitionCategory|}}} | בינלאומי| AND Competitions.International=1 }}
{{#ifeq: {{{CompetitionCategory|}}} | רשמי| AND Competitions.Official=1 }}
{{#ifeq: {{{CompetitionCategory|}}} | לא רשמי| AND Competitions.Official=0 }}
 
{{#if: {{{Stadium|}}} |  AND Football_Games.Stadium IN ({{#var: SameStadiums}}) }}<!-- the "()" around the SameStadiums required for "IN" operator -->
{{#if: {{{Opponent|}}} |  AND Football_Games.Opponent IN ({{#var: SameOpponents}}) }}<!-- the "()" around the SameOpponents required for "IN" operator -->
{{#if: {{{OpponentCountry|}}} |  AND Opponents.Country ="{{{OpponentCountry}}}" }}
{{#if: {{{OpponentCountry|}}} |  AND Opponents.Country ="{{{OpponentCountry}}}" }}
{{#if: {{{Coach|}}} |  AND Games_Catalog.CoachMaccabi="{{{Coach}}}" }}
{{#if: {{{Coach|}}} |  AND Football_Games.CoachMaccabi="{{{Coach}}}" }}
{{#if: {{{CoachOpponent|}}} |  AND Games_Catalog.CoachOpponent="{{{CoachOpponent}}}" }}
{{#if: {{{CoachOpponent|}}} |  AND Football_Games.CoachOpponent="{{{CoachOpponent}}}" }}
{{#if: {{{Season|}}} |  AND Games_Catalog.Season = "{{{Season}}}" }}
{{#if: {{{Season|}}} |  AND Football_Games.Season = "{{{Season}}}" }}
{{#if: {{{HomeAway|}}} |  AND Games_Catalog.HomeAway = "{{{HomeAway}}}" }}
{{#if: {{{HomeAway|}}} |  AND Football_Games.HomeAway = "{{{HomeAway}}}" }}
{{#if: {{{Leg|}}} | {{#ifeq: {{{SimilarLegs|}}}| כן| AND Games_Catalog.Leg LIKE "{{{Leg}}}%" | AND Games_Catalog.Leg = "{{{Leg}}}" }} }}
{{#if: {{{Leg|}}} | {{#ifeq: {{{SimilarLegs|}}}| כן| AND Football_Games.Leg LIKE "%{{{Leg}}}%" | AND Football_Games.Leg = "{{{Leg}}}" }} }}
{{#if: {{{Referee|}}} |  AND Games_Catalog.Refs = "{{{Referee}}}" }}
{{#if: {{{Referee|}}} |  AND Football_Games.Refs = "{{{Referee}}}" }}
{{#if: {{{MaccabiGoals|}}} |  AND Games_Catalog.ResultMaccabi {{#var: GoalsForMaccabiOperator}} {{{MaccabiGoals}}} }}
{{#if: {{{MaccabiGoals|}}} |  AND Football_Games.ResultMaccabi {{#var: GoalsForMaccabiOperator}} {{{MaccabiGoals}}} }}
{{#if: {{{MaccabiGoalsDifferent|}}} |  AND Games_Catalog.ResultMaccabi - Games_Catalog.ResultOpponent {{#var: GoalsDiffForMaccabiOperator}} {{{MaccabiGoalsDifferent}}} }}
{{#if: {{{MaccabiGoalsDifferent|}}} |  AND Football_Games.ResultMaccabi - Football_Games.ResultOpponent {{#var: GoalsDiffForMaccabiOperator}} {{{MaccabiGoalsDifferent}}} }}
{{#if: {{{OpponentGoals|}}} |  AND Games_Catalog.ResultOpponent {{#var: GoalsForOpponentOperator}} {{{OpponentGoals}}} }}
{{#if: {{{OpponentGoals|}}} |  AND Football_Games.ResultOpponent {{#var: GoalsForOpponentOperator}} {{{OpponentGoals}}} }}
{{#if: {{{OpponentGoalsDifferent|}}} |  AND Football_Games.ResultOpponent - Football_Games.ResultMaccabi {{#var: GoalsDiffForOpponentOperator}} {{{OpponentGoalsDifferent}}} }}
{{#if: {{{GameResult|}}} |  AND Games_Results.ResultString = "{{{GameResult}}}" }}
{{#if: {{{GameResult|}}} |  AND Games_Results.ResultString = "{{{GameResult}}}" }}
{{#if: {{{Uniforms|}}} |  AND Football_Games_Uniforms.KitName = "{{{Uniforms}}}" }}
{{#if: {{{Uniforms|}}} |  AND Football_Games_Uniforms.KitName = "{{{Uniforms}}}" }}


{{#if: {{{GameDayInWeek|}}} | AND DATE_FORMAT(Games_Catalog.Date, '%w') + 1 = {{{GameDayInWeek}}} }}
{{#if: {{{GameDayInWeek|}}} | AND DATE_FORMAT(Football_Games.Date, '%w') + 1 = {{{GameDayInWeek}}} }}
Games_Catalog.Date >= 2020-01-01
{{#if: {{{StartDate|}}} | AND Football_Games.Date >= "{{{StartDate}}}" }}
{{#if: {{{StartDate|}}} | Games_Catalog.Date >= {{{StartDate}}} }}
{{#if: {{{EndDate|}}} | AND  Football_Games.Date <= "{{{EndDate}}}" }}
{{#if: {{{EndDate|}}} | Games_Catalog.Date <= {{{EndDate}}} }}




 
{{#if: {{#var: Player1Defined}}| And Games_Events.Team = 1}}
{{#if: {{{Player|}}} |  AND Games_Events.PlayerName= "{{{Player}}}" }}
{{#if: {{{Player|}}} |  AND Games_Events.PlayerName = "{{{Player}}}" }}
{{#if: {{{PlayerNumber|}}} |  AND Games_Events.PlayerNumber= {{{PlayerNumber}}} }}
{{#if: {{{PlayerNumber|}}} |  AND Games_Events.PlayerNumber = {{{PlayerNumber}}} }}
{{#if: {{{PlayerAction|}}} | AND Games_Events.EventType IN ({{#var: PlayerEvent}}) }}
{{#if: {{{PlayerAction|}}} | AND Games_Events.EventType IN ({{#var: PlayerEvent}}) }}
{{#if: {{{PlayerActionMinute|}}} | AND Games_Events.Minute = {{{PlayerActionMinute}}} }}
{{#if: {{{PlayerActionMinute|}}} | AND Games_Events.Minute = {{{PlayerActionMinute}}} }}
שורה 65: שורה 76:
{{#if: {{{PlayerSubActionMinute|}}} | AND Games_Events.Minute = {{{PlayerSubActionMinute}}} }}
{{#if: {{{PlayerSubActionMinute|}}} | AND Games_Events.Minute = {{{PlayerSubActionMinute}}} }}
{{#if: {{{PlayerPosition|}}} | AND Players_Positions.PositionString= "{{{PlayerPosition}}}" }}
{{#if: {{{PlayerPosition|}}} | AND Players_Positions.PositionString= "{{{PlayerPosition}}}" }}
{{#if: {{{Player2|}}} |  AND Events2.PlayerName= "{{{Player2}}}" }}
 
{{#if: {{{PlayerNumber2|}}} |  AND Events2.PlayerNumber= {{{PlayerNumber2}}} }}
 
{{#if: {{#var: Player2Defined}}| And Events2.Team = 1}}
{{#if: {{{Player2|}}} |  AND Events2.PlayerName = "{{{Player2}}}" }}
{{#if: {{{PlayerNumber2|}}} |  AND Events2.PlayerNumber = {{{PlayerNumber2}}} }}
{{#if: {{{PlayerAction2|}}} | AND Events2.EventType IN ({{#var: PlayerEvent2}}) }}
{{#if: {{{PlayerAction2|}}} | AND Events2.EventType IN ({{#var: PlayerEvent2}}) }}
{{#if: {{{PlayerActionMinute2|}}} | AND Events2.Minute = {{{PlayerActionMinute2}}} }}
{{#if: {{{PlayerActionMinute2|}}} | AND Events2.Minute = {{{PlayerActionMinute2}}} }}
{{#if: {{{PlayerSubAction2|}}} | AND Events2.SubType IN ({{#var: PlayerSubEvent2}}) }}
{{#if: {{{PlayerSubAction2|}}} | AND Events2.SubType IN ({{#var: PlayerSubEvent2}}) }}
{{#if: {{{PlayerSubActionMinute2|}}} | AND Events2.Minute = {{{PlayerSubActionMinute2}}} }}
{{#if: {{{PlayerSubActionMinute2|}}} | AND Events2.Minute = {{{PlayerSubActionMinute2}}} }}
{{#if: {{{PlayerPosition2|}}} | AND Players_Positions.PositionString= "{{{PlayerPosition2}}}" }}
{{#if: {{{PlayerPosition2|}}} | AND Players_Positions.PositionString = "{{{PlayerPosition2}}}" }}
 
{{#ifeq: {{{PlayersEventsInSameMinute|}}}| כן| AND Events2.Minute = Games_Events.Minute }}
 


{{#if: {{#var: Player2Defined}}{{#var: Player1Defined}}
|{{#ifeq: {{{PlayersEventsInSameMinute|}}}| כן| AND Events2.Minute = Games_Events.Minute| AND Events2.Minute != Games_Events.Minute }}
}}


{{#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}}
שורה 88: שורה 99:


Fields to display:
Fields to display:
-->|fields=CONCAT('[[', Games_Catalog._pageName, '|המשחק]]')=המשחק  
-->|fields=CONCAT('[[', Football_Games._pageName, '|המשחק]]')=המשחק  
           ,Games_Catalog.Date=תאריך
           ,Football_Games.Date=תאריך
           ,CONCAT('[[עונת ', Games_Catalog.Season, ']]')=עונה
           ,CONCAT('[[עונת ', Football_Games.Season, ']]')=עונה
           ,CONCAT('[[', Competitions_Catalog.Name, ']]')=מפעל <!-- Cast number to name from Competitions Table -->
           ,CONCAT('[[', Competitions._pageName, '|', Competitions.OriginalName, ']]')=מפעל
           ,Games_Catalog.Leg=שלב במפעל
           ,Football_Games.Leg=שלב במפעל
           ,CONCAT('[[', Games_Catalog.Opponent, ']]')=יריבה
           ,CONCAT('[[', Opponents.OriginalName, ']]')=יריבה
           ,Games_Catalog.HomeAway=בית או חוץ
           ,Football_Games.HomeAway=בית או חוץ
           ,CONCAT('[[', Games_Catalog.Stadium, ']]')=אצטדיון
           ,CONCAT('[[', Football_Games.Stadium, ']]')=אצטדיון
           ,Games_Catalog.ResultMaccabi=תוצאה למכבי
           ,Football_Games.ResultMaccabi=תוצאה למכבי
           ,Games_Catalog.ResultOpponent=תוצאה ליריבה
           ,Football_Games.ResultOpponent=תוצאה ליריבה
           ,Games_Results.ResultString=תוצאת משחק <!-- Cast number to string from games results table -->
           ,Games_Results.ResultString=תוצאת משחק <!-- Cast number to string from games results table -->
           ,CONCAT('[[', Games_Catalog.CoachMaccabi, ']]')=מאמן מכבי
           ,CONCAT('[[', Football_Games.CoachMaccabi, ']]')=מאמן מכבי
           ,Games_Catalog.CoachOpponent=מאמן יריבה
           ,Football_Games.CoachOpponent=מאמן יריבה
           ,CONCAT('[[שופט:', Games_Catalog.Refs, '|', Games_Catalog.Refs, ']]')=שופט
           ,CONCAT('[[כדורגל:', Football_Games.Refs, ' (שופט)|', Football_Games.Refs, ']]')=שופט
           ,Crowd=קהל
           ,Crowd=קהל
          ,Days_In_Week.DayString=יום המשחק בשבוע
           ,CONCAT('[', Games_Videos.FullGame,  ' לינק]')=משחק מלא
           ,CONCAT('[', Games_Videos.FullGame,  ' לינק]')=משחק מלא
           ,CONCAT('[', Games_Videos.Highlights, ' לינק]')=תקציר
           ,CONCAT('[', Games_Videos.Highlights, ' לינק]')=תקציר
           ,CONCAT('[[', 'מדי עונת ', Football_Games_Uniforms.Season, '|', Football_Games_Uniforms.KitName, ']]' )=מדים,
           ,CONCAT('[[', 'מדי עונת ', Football_Games_Uniforms.Season, '|', Football_Games_Uniforms.KitName, ']]' )=מדים
          ,Opponents.Country=מדינה
{{#if: {{#var: Player1Defined}} | ,Games_Events.PlayerName=1שחקן, Games_Events.PlayerNumber=1מספר, Games_Events.Minute=דקה1 }}
{{#if: {{#var: Player2Defined}} | ,Events2.PlayerName=2שחקן, Events2.PlayerNumber=2מספר, Events2.Minute=דקה2 }}
 


|limit=5000
|limit=5000
|format=dynamic table
|format=dynamic table
|rows per page=100
|rows per page=100
|group by=Games_Catalog._pageName, Games_Catalog.Date <!-- all fields from "fields=" should be here -->
|group by=Football_Games._pageName, Football_Games.Date <!-- all fields from "fields=" should be here -->
|order by=Games_Catalog.Date DESC
|order by=Football_Games.Date DESC
}}<!--
}}<!--



גרסה אחרונה מ־21:21, 4 ביולי 2025

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

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