global $wpdb; // 1. Fetch all top 100 players ordered by rank // Replace 'nhl_player_stats' with your actual table name $table_name = 'nhl_player_stats'; $top_100 = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE rank <= 100 ORDER BY rank ASC" ); if ( ! $top_100 ) { return '

No player data found.

'; } // Map the top 100 by rank for quick O(1) lookups $rank_map = []; foreach ( $top_100 as $player ) { $rank_map[intval( $player->rank )] = $player; } // 2. Identify active players within the top 100 and determine their windows (±3) $included_ranks = []; foreach ( $top_100 as $player ) { // Adjust this condition based on how you flag active players in your database if ( isset( $player->is_active ) && $player->is_active == 1 ) { $target_rank = intval( $player->rank ); // Define the window (3 ahead, 3 behind, bounded between 1 and 100) $start = max( 1, $target_rank - 3 ); $end = min( 100, $target_rank + 3 ); for ( $r = $start; $r <= $end; $r++ ) { $included_ranks[$r] = true; } } } // Sort the captured ranks ascending ksort( $included_ranks ); // 3. Build the final display list and check for gaps $players_to_display = []; foreach ( array_keys( $included_ranks ) as $rank ) { if ( isset( $rank_map[$rank] ) ) { $players_to_display[] = $rank_map[$rank]; } } // 4. Render the Output Table $output = '
'; $output .= ''; $output .= ''; $output .= ''; $prev_rank = null; foreach ( $players_to_display as $player ) { $current_rank = intval( $player->rank ); // If there's a gap greater than 1 between the previous rank and current rank, insert a separator row if ( $prev_rank !== null && $current_rank > ( $prev_rank + 1 ) ) { $output .= ''; } // Add a CSS class or highlight style if the player is active $is_active_class = ( isset( $player->is_active ) && $player->is_active == 1 ) ? ' active-target-player' : ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $prev_rank = $current_rank; } $output .= ''; $output .= '
RankPlayerTeamStats
• • •
' . esc_html( $player->rank ) . '' . esc_html( $player->player_name ) . '' . esc_html( $player->team_abbr ) . '' . esc_html( $player->points ?? '' ) . '
'; $output .= '
'; echo $output; Transactions - OutsideTheGarden
SEPTEMBER
«
Sun
27
Mon
28
Rosters Set - 5:00pm
Tue
29
8:00PM
Wed
30
Thu
1
7:00PM
Fri
2
6:30PM
Sat
3
»
NHL Transactions Explorer
Clear
DatePlayerTransactionPartnerIncludedNotes
July 15, 2026Albert’s SmitsSigned--3 years - 1.075M AAV
July 13, 2026Braden SchneiderSigned--1 year - $5.5M AAV
July 6, 2026William TrudeauSigned--1 year - $850K AAV
July 6, 2026William TrudeauAcquiredMontréal Canadiens-Brett Berard
July 2, 2026Dennis CholowskiSigned--2 year - $875K AAV
July 1, 2026Glenn GawdinSigned--2 years - $875K AAV
July 1, 2026Will BorgenTradedBoston Bruins-2027 2nd round pick and conditional 2028 3rd round pick
July 1, 2026Marcus PetterssonAcquiredVancouver Canucks-Conditional 2030 1st round pick
July 1, 2026Cole BeaudoinAcquiredUtah MammothSean Durzi and 2027 3rd pickVincent Trocheck
July 1, 2026Sean DurziAcquiredUtah MammothCole Beaudoin and 2027 3rd round pickVincent Trocheck
July 1, 2026Vincent TrocheckTradedUtah Mammoth-for Sean Durzi, Cole Beaudoin and 2027 3rd round pick
July 1, 2026Marc Del GaizoSigned--2 years - AAV TBD
July 1, 2026Oliver BjorkstrandSigned--1 year - $4.5M
July 1, 2026Jonathan QuickRetired---
July 1, 2026Brandon ScanlinBecame Free Agent---
July 1, 2026Casey FitzgeraldBecame Free Agent---
July 1, 2026Connor MackeyBecame Free Agent---
July 1, 2026Conor ShearyBecame Free Agent---
July 1, 2026Jonny BrodzinskiBecame Free Agent---
July 1, 2026Hugo OllasBecame Free Agent---
July 1, 2026Talyn BoykoBecame Free Agent---
July 1, 2026Brendan BrissonBecame Free Agent---
July 1, 2026Massimo RizzoBecame Free Agent---
July 1, 2026Joe VelenoSigned--1 year - $1.2M
July 1, 2026Kalle VaisanenTradedBoston Bruins2028 4th round pickJoonas Korpisalo
Showing page 1 of 173 (4301 total transactions)