/** * Automatically aggregate games from otg_rangers_games and update/insert otg_coach_statistics. */ private static function sync_rangers_season_stats($coach_id, $season) { global $wpdb; if ($coach_id <= 0 || empty($season)) { echo '

Invalid Coach or Season specified for sync.

'; return; } // 1. Regular Season Calculation (game_type = 2) $reg_sql = $wpdb->prepare( "SELECT COUNT(*) as gc, SUM(CASE WHEN rangers_score > opponent_score THEN 1 ELSE 0 END) as wins, SUM(CASE WHEN rangers_score < opponent_score AND overtime_status != 'OT' AND overtime_status != 'SO' THEN 1 ELSE 0 END) as losses, SUM(CASE WHEN rangers_score = opponent_score THEN 1 ELSE 0 END) as ties, SUM(CASE WHEN rangers_score < opponent_score AND overtime_status = 'OT' THEN 1 ELSE 0 END) as ot, SUM(CASE WHEN rangers_score < opponent_score AND overtime_status = 'SO' THEN 1 ELSE 0 END) as sol, SUM(CASE WHEN rangers_score > opponent_score AND overtime_status = 'SO' THEN 1 ELSE 0 END) as sow FROM otg_rangers_games WHERE game_type = 2 AND season = %s", $season ); $reg = $wpdb->get_row($reg_sql); // 2. Playoff Calculation (game_type = 3) - Fetching series/opponent details ordered by date/game $playoff_games_sql = $wpdb->prepare( "SELECT opponent, rangers_score, opponent_score FROM otg_rangers_games WHERE game_type = 3 AND season = %s ORDER BY game_date ASC, game_id ASC", $season ); $playoff_games = $wpdb->get_results($playoff_games_sql); $gc = $reg->gc ? intval($reg->gc) : 0; $w = $reg->wins ? intval($reg->wins) : 0; $l = $reg->losses ? intval($reg->losses) : 0; $t = $reg->ties !== null ? intval($reg->ties) : 0; $ot = $reg->ot !== null ? intval($reg->ot) : 0; $sol = $reg->sol !== null ? intval($reg->sol) : 0; $sow = $reg->sow !== null ? intval($reg->sow) : 0; $pgc = count($playoff_games); $pw = 0; $pl = 0; $pt = 0; $sw = 0; $sl = 0; $sc = 0; $scf = 0; if ($pgc > 0) { $series_records = []; $current_opponent = null; $opp_wins = 0; $nyr_wins = 0; foreach ($playoff_games as $g) { if (intval($g->rangers_score) > intval($g->opponent_score)) { $pw++; $nyr_wins++; } elseif (intval($g->rangers_score) < intval($g->opponent_score)) { $pl++; $opp_wins++; } else { $pt++; } if ($current_opponent === null) { $current_opponent = $g->opponent; $nyr_wins = (intval($g->rangers_score) > intval($g->opponent_score)) ? 1 : 0; $opp_wins = (intval($g->rangers_score) < intval($g->opponent_score)) ? 1 : 0; } elseif ($current_opponent !== $g->opponent) { // Previous series concluded because opponent changed if ($nyr_wins > $opp_wins) { $sw++; } else { $sl++; } $current_opponent = $g->opponent; $nyr_wins = (intval($g->rangers_score) > intval($g->opponent_score)) ? 1 : 0; $opp_wins = (intval($g->rangers_score) < intval($g->opponent_score)) ? 1 : 0; } } // Final series check after loop finishes if ($current_opponent !== null) { // Check if this was the Stanley Cup Finals (last series) and if they won the Cup (4 wins in final series or overall context, typically 4 wins wins a modern NHL playoff series) if ($nyr_wins > $opp_wins) { $sw++; // If it's the final round and they won, check if it's the Stanley Cup win // (Assuming final round win equates to SC = 1 if it's the ultimate round) } else { $sl++; } } // Determine if they won the Stanley Cup (e.g. won 4 rounds total, or check standard criteria) // If they won 4 series in a 4-round playoff format, they are Stanley Cup Champions if ($sw >= 4) { $sc = 1; $scf = 1; } elseif ($sw == 3 && $sl > 0) { $scf = 1; $sc = 0; } } $data = array( 'CoachID' => $coach_id, 'Team' => 'New York Rangers', 'League' => 'NHL', 'Season' => $season, 'GC' => $gc, 'W' => $w, 'L' => $l, 'T' => $t, 'OT' => $ot, 'SOL' => $sol, 'SOW' => $sow, 'PGC' => $pgc, 'PW' => $pw, 'PL' => $pl, 'PT' => $pt, 'SCF' => $scf, 'SC' => $sc, 'SW' => $sw, 'SL' => $sl, ); $existing = $wpdb->get_var($wpdb->prepare( "SELECT COUNT(*) FROM otg_coach_statistics WHERE CoachID = %d AND Season = %s AND Team = 'New York Rangers'", $coach_id, $season )); if ($existing > 0) { $wpdb->update('otg_coach_statistics', $data, array('CoachID' => $coach_id, 'Season' => $season, 'Team' => 'New York Rangers')); echo '

Successfully synced Rangers stats for season ' . esc_html($season) . '!

'; } else { $wpdb->insert('otg_coach_statistics', $data); echo '

Successfully inserted synced Rangers stats for season ' . esc_html($season) . '!

'; } } Game 15 NYR @ Det 7PM MSG – Hit The Road Jake – OutsideTheGarden Boards
SEPTEMBER
«
Wed
24
Thu
25
Fri
26
Sat
27
Sun
28
Mon
29
Tue
30
»
Game 15 NYR @ Det 7...
 
Notifications
Clear all

Game 15 NYR @ Det 7PM MSG

Page 1 / 7
 
x10003q
(@x10003q)
Legend

LGR

Brian Boyle in the Booth - first time 

Chemlar in 


1 Cup in 86 years
2048

Quote
Topic starter Posted : 07/11/2025 7:06 pm
Rangerjunkiekimmie
(@rangerjunkie)
NHL All Star

On the road so, we have a chance


De Oppresso Liber..
from the left elites

ReplyQuote
Posted : 07/11/2025 7:07 pm
Doug Glatt
(@pierre_pdare)
Legend

RANGERS (6-6-2) at RED WINGS (9-5-0)

7 pm ET; FDSNDETX, NHLN, MSG, SNP, SNO, SNE, TVAS

Rangers projected lineup

Artemi Panarin — Mika Zibanejad — Taylor Raddysh
Will Cuylle — J.T. Miller — Alexis Lafreniere
Conor Sheary — Noah Laba — Jonny Brodzinski
Jaroslav Chmelar — Sam Carrick — Juuso Parssinen

Vladislav Gavrikov — Adam Fox
Carson Soucy — Will Borgen
Connor Mackey — Braden Schneider

Jonathan Quick
Igor Shesterkin

Scratched: Matthew Robertson, Adam Edstrom

Injured: Vincent Trocheck (upper body), Urho Vaakanainen (lower body)

Status report

The Rangers held an optional morning skate. Trocheck, a forward, and Vaakanainen, a defenseman, each took part, but neither is expected to play. … Chmelar will make his NHL debut

Red Wings projected lineup

Emmitt Finnie — Dylan Larkin — Lucas Raymond
Patrick Kane — Marco Kasper — Alex DeBrincat
Andrew Copp — J.T. Compher — Mason Appleton
James van Riemsdyk — Michael Rasmussen — Elmer Soderblom

Simon Edvinsson — Moritz Seider
Ben Chiarot — Axel Sandin-Pellikka
Travis Hamonic — Albert Johansson

Cam Talbot
John Gibson

Scratched: Jacob Bernard-Docker, Jonatan Berggren

Injured: None

Status report

Kane will play after missing nine games because of an upper-body injury. Berggren, a forward, will come out of the lineup.


If they need me to bleed, then I'll bleed for my team

ReplyQuote
Posted : 07/11/2025 7:11 pm
Rangerjunkiekimmie
(@rangerjunkie)
NHL All Star

Posted by: @pierre_pdare

RANGERS (6-6-2) at RED WINGS (9-5-0)

7 pm ET; FDSNDETX, NHLN, MSG, SNP, SNO, SNE, TVAS

Rangers projected lineup

Artemi Panarin — Mika Zibanejad — Taylor Raddysh
Will Cuylle — J.T. Miller — Alexis Lafreniere
Conor Sheary — Noah Laba — Jonny Brodzinski
Jaroslav Chmelar — Sam Carrick — Juuso Parssinen

Vladislav Gavrikov — Adam Fox
Carson Soucy — Will Borgen
Connor Mackey — Braden Schneider

Jonathan Quick
Igor Shesterkin

Scratched: Matthew Robertson, Adam Edstrom

Injured: Vincent Trocheck (upper body), Urho Vaakanainen (lower body)

Status report

The Rangers held an optional morning skate. Trocheck, a forward, and Vaakanainen, a defenseman, each took part, but neither is expected to play. … Chmelar will make his NHL debut

 

Red Wings projected lineup

Emmitt Finnie — Dylan Larkin — Lucas Raymond
Patrick Kane — Marco Kasper — Alex DeBrincat
Andrew Copp — J.T. Compher — Mason Appleton
James van Riemsdyk — Michael Rasmussen — Elmer Soderblom

Simon Edvinsson — Moritz Seider
Ben Chiarot — Axel Sandin-Pellikka
Travis Hamonic — Albert Johansson

Cam Talbot
John Gibson

Scratched: Jacob Bernard-Docker, Jonatan Berggren

Injured: None

Status report

Kane will play after missing nine games because of an upper-body injury. Berggren, a forward, will come out of the lineup.

 

Poor Laba.......

 


De Oppresso Liber..
from the left elites

ReplyQuote
Posted : 07/11/2025 7:14 pm
Doug Glatt
(@pierre_pdare)
Legend

Posted by: @rangerjunkie

On the road so, we have a chance

One of the best road teams in the NHL....Too bad they don't have a stinking win at home...

 


If they need me to bleed, then I'll bleed for my team

ReplyQuote
Posted : 07/11/2025 7:15 pm
Rangerjunkiekimmie
(@rangerjunkie)
NHL All Star

Posted by: @pierre_pdare

Posted by: @rangerjunkie

On the road so, we have a chance

One of the best road teams in the NHL....Too bad they don't have a stinking win at home...

 

I believe they rank 1st on the road in wins and points

Last at home though

 


De Oppresso Liber..
from the left elites

ReplyQuote
Posted : 07/11/2025 7:16 pm
Doug Glatt
(@pierre_pdare)
Legend

Posted by: @rangerjunkie

Posted by: @pierre_pdare

Posted by: @rangerjunkie

On the road so, we have a chance

One of the best road teams in the NHL....Too bad they don't have a stinking win at home...

 

I believe they rank 1st on the road in wins and points

Last at home though

 

Upside down

 


If they need me to bleed, then I'll bleed for my team

ReplyQuote
Posted : 07/11/2025 7:21 pm
Doug Glatt
(@pierre_pdare)
Legend

Larkin is a helluva player


If they need me to bleed, then I'll bleed for my team

ReplyQuote
Posted : 07/11/2025 7:23 pm
Doug Glatt
(@pierre_pdare)
Legend

Johnnie B with a nice chance


If they need me to bleed, then I'll bleed for my team

ReplyQuote
Posted : 07/11/2025 7:24 pm
Rangerjunkiekimmie
(@rangerjunkie)
NHL All Star

Posted by: @pierre_pdare

Larkin is a helluva player

Did you mean Lafrienere?

 


De Oppresso Liber..
from the left elites

ReplyQuote
Posted : 07/11/2025 7:24 pm
x10003q
(@x10003q)
Legend

Laba with a nice feed to Brodz, talbot save


1 Cup in 86 years
2048

ReplyQuote
Topic starter Posted : 07/11/2025 7:26 pm
Doug Glatt
(@pierre_pdare)
Legend

Posted by: @rangerjunkie

Posted by: @pierre_pdare

Larkin is a helluva player

Did you mean Lafrienere?

 


Season 2 No GIF by Paramount+

 

 


If they need me to bleed, then I'll bleed for my team

ReplyQuote
Posted : 07/11/2025 7:27 pm
Rangerjunkiekimmie
(@rangerjunkie)
NHL All Star

Cuylle........FINALLY


De Oppresso Liber..
from the left elites

ReplyQuote
Posted : 07/11/2025 7:29 pm
x10003q
(@x10003q)
Legend

Brodz still fast pulls the puck out of the dmans skates and gets a good shot on Talbot and then Copp hooks Sheary following to the goal


1 Cup in 86 years
2048

ReplyQuote
Topic starter Posted : 07/11/2025 7:29 pm
Doug Glatt
(@pierre_pdare)
Legend

Gee you put Cuylle on the #1 PP and he scores right away.... I would have never thought he could be better on the PP than LaFartierre


If they need me to bleed, then I'll bleed for my team

ReplyQuote
Posted : 07/11/2025 7:30 pm
Page 1 / 7
Share: