/** * 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 1: NYR v PIT 8:00pm ESPN – Hit The Road Jake – OutsideTheGarden Boards
FEBRUARY
«
Wed
24
Thu
25
Fri
26
7:00PM
Sat
27
Sun
28
1:00PM
Mon
1
Tue
2
»
GAME 1: NYR v PIT 8...
 
Notifications
Clear all

GAME 1: NYR v PIT 8:00pm ESPN

Page 1 / 8
 
Fish
 Fish
(@fish)
Member Moderator

First game of the season, Sullivan against his old team, Muse against is his old team


Quote
Topic starter Posted : 07/10/2025 11:44 am
Doug Glatt
(@pierre_pdare)
Legend

Lineup

https://www.dailyfaceoff.com/teams/new-york-rangers/line-combinations

 


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

ReplyQuote
Posted : 07/10/2025 3:09 pm
Fish
 Fish
(@fish)
Member Moderator

I'm not feeling very excited about this game tonight, hopefully something good will happen


ReplyQuote
Topic starter Posted : 07/10/2025 5:24 pm
PV29
 PV29
(@pv29)
Team MVP

Well, we're here again for another season.  Quite frankly, sports in NY has kinda sucked of late and there's no compelling reason why the Rangers will deliver anything above what the other teams have given us.  Hope and optimism aside, there are talented players on the team and a world-class goalie, so the season should not be a complete disaster (see, NY Jets).  A wild card spot that is not clinched until Game 81 or 82, plus a second round series seems about right.

Greetings to all, let the cheering, bitching and moaning commence.


ReplyQuote
Posted : 07/10/2025 5:58 pm
x10003q reacted
Fish
 Fish
(@fish)
Member Moderator

Posted by: @pv29

Well, we're here again for another season.  Quite frankly, sports in NY has kinda sucked of late and there's no compelling reason why the Rangers will deliver anything above what the other teams have given us.  Hope and optimism aside, there are talented players on the team and a world-class goalie, so the season should not be a complete disaster (see, NY Jets).  A wild card spot that is not clinched until Game 81 or 82, plus a second round series seems about right.

Greetings to all, let the cheering, bitching and moaning commence.

The East as a whole is a bit of a question mark this year, the West looks tougher to start the season.  I guess we'll see, and there's always hope that Mike Sullivan can unlock these guys.  I think the defense is still pretty questionable, and we're going to need some big years from the likes of Lafreniere and Cuylle.  Feels like a lot has to go right for this season to be meaningful.

 


ReplyQuote
Topic starter Posted : 07/10/2025 6:22 pm
CuyllRanger
(@cuyllranger)
Hall of Famer

All you can ask is play with your heart. No cheating like last year. If they have heart and play balls out hockey I can live with that. Then it becomes a don’t have the horses issue. When you play like they did last year you don’t know what you got. 


ReplyQuote
Posted : 07/10/2025 6:40 pm
Fish
 Fish
(@fish)
Member Moderator

Posted by: @cuyllranger

All you can ask is play with your heart. No cheating like last year. If they have heart and play balls out hockey I can live with that. Then it becomes a don’t have the horses issue. When you play like they did last year you don’t know what you got. 

I think last year is still hanging over me, hard to shake that feeling, it's like a really bad stink

 


ReplyQuote
Topic starter Posted : 07/10/2025 6:48 pm
CuyllRanger reacted
Fish
 Fish
(@fish)
Member Moderator

About time they put Messier and Levy out to pasture


ReplyQuote
Topic starter Posted : 07/10/2025 7:08 pm
x10003q
(@x10003q)
Legend

LGR


1 Cup in 86 years
2048

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

Bad first shift and Fox get tripped and they call it


1 Cup in 86 years
2048

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

Welcome back my friends to the shit show that never ends... Rangers got hemmed in on that first shift and then we get a PP


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

ReplyQuote
Posted : 07/10/2025 7:13 pm
Fish
 Fish
(@fish)
Member Moderator

Posted by: @x10003q

Bad first shift and Fox get tripped and they call it

They missed the earlier trip behind the net, but they got that hook by the rookie south african

 


ReplyQuote
Topic starter Posted : 07/10/2025 7:14 pm
x10003q reacted
x10003q
(@x10003q)
Legend

Rempe on the 2nd PP unit


1 Cup in 86 years
2048

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

Posted by: @fish

About time they put Messier and Levy out to pasture

I think they were doing the FL CHI game...or maybe just the pregame... but I saw them

 


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

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

Not digging these jerseys so far... maybe they will grow on me


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

ReplyQuote
Posted : 07/10/2025 7:16 pm
Page 1 / 8
Share: