get_col("SELECT DISTINCT season FROM otg_rangers_games ORDER BY season DESC"); // Find the season of the most recently played game $most_recent_season = $wpdb->get_var("SELECT season FROM otg_rangers_games ORDER BY game_date DESC LIMIT 1"); // Fallback if no games are found, though unlikely $default_season = !empty($most_recent_season) ? $most_recent_season : (!empty($available_seasons) ? reset($available_seasons) : ''); $view_side = isset($_GET['view_side']) ? sanitize_text_field($_GET['view_side']) : 'nyr'; $opponent_abbr = isset($_GET['opponent_abbr']) ? sanitize_text_field($_GET['opponent_abbr']) : 'ALL'; $game_type = isset($_GET['game_type']) ? sanitize_text_field($_GET['game_type']) : '2'; // Set both default start and end to the most recent season $season_start = isset($_GET['season_start']) ? sanitize_text_field($_GET['season_start']) : $default_season; $season_end = isset($_GET['season_end']) ? sanitize_text_field($_GET['season_end']) : $default_season; $exclude_empty_net = isset($_GET['exclude_empty_net']) ? (int)$_GET['exclude_empty_net'] : 0; // Modal drill-down parameters $selected_minute = isset($_GET['modal_min']) ? $_GET['modal_min'] : ''; $selected_type = isset($_GET['modal_type']) ? sanitize_text_field($_GET['modal_type']) : ''; // 'normal' or 'en' // Smart Year Validation / Auto-Correction Logic if (!empty($season_start) && !empty($season_end)) { if ($season_start > $season_end) { if (isset($_GET['season_start']) && !isset($_GET['season_end'])) { $season_end = $season_start; } else { $season_start = $season_end; } } } // Fetch Opponent teams active for the selected start season $season_teams_query = $wpdb->prepare(" SELECT DISTINCT st.abbreviation, st.team FROM otg_standings_nhl st JOIN otg_rangers_games g ON st.abbreviation = g.opponent_abbr AND st.season = g.season WHERE g.season = %s ORDER BY st.team ASC ", $season_start); $season_teams = $wpdb->get_results($season_teams_query); // Fetch all teams for the remainder section $all_teams_query = "SELECT DISTINCT abbreviation, team FROM otg_standings_nhl ORDER BY team ASC"; $all_teams = $wpdb->get_results($all_teams_query); if (empty($all_teams)) return 'No standings/team data available.'; $season_team_abbrs = []; foreach ($season_teams as $st) { $season_team_abbrs[] = $st->abbreviation; } // 2. Build Query Conditions for Standard vs Response Views $season_where = ""; if (!empty($season_start) && !empty($season_end)) { $season_where = $wpdb->prepare("AND g.season BETWEEN %s AND %s", $season_start, $season_end); } $response_modes = ['response_for', 'response_against', 'rangers_response', 'opponent_response']; $is_response_mode = in_array($view_side, $response_modes, true); $is_player_period_mode = ($view_side === 'player_period_breakdown'); $game_filter = ""; if ($opponent_abbr !== 'ALL') { $game_filter = $wpdb->prepare("AND g.opponent_abbr = %s", $opponent_abbr); } $goals_query = $wpdb->prepare(" SELECT s.game_id, s.period, s.time_elapsed, s.team_abbr, g.opponent_abbr, s.goal_modifier, g.season, g.game_date FROM otg_rangers_scoring s JOIN otg_rangers_games g ON s.game_id = g.game_id WHERE s.time_elapsed != '00:00' AND g.game_type = %s $season_where $game_filter ORDER BY s.game_id ASC, s.period ASC, CAST(SUBSTRING_INDEX(s.time_elapsed, ':', 1) AS UNSIGNED) ASC, CAST(SUBSTRING_INDEX(s.time_elapsed, ':', -1) AS UNSIGNED) ASC ", $game_type); $all_game_goals = $wpdb->get_results($goals_query); // Group goals by game_id and calculate breakdown arrays (Expanded to 65 buckets to include OT minutes 60-64 for standard view) $max_buckets = $is_response_mode ? 60 : 65; $breakdown_normal = array_fill(0, $max_buckets, 0); $breakdown_en = array_fill(0, $max_buckets, 0); $total_goals_counted = 0; // Track matching items per minute for the modal drill-down popup view $matching_games_by_minute = []; for ($m = 0; $m < $max_buckets; $m++) { $matching_games_by_minute[$m] = ['normal' => [], 'en' => []]; } if ($is_response_mode) { $games_grouped = []; foreach ($all_game_goals as $g_item) { $games_grouped[$g_item->game_id][] = $g_item; } foreach ($games_grouped as $g_id => $g_list) { $count_goals = count($g_list); for ($i = 0; $i < $count_goals - 1; $i++) { $curr = $g_list[$i]; $next = $g_list[$i + 1]; $is_valid_trigger = false; if ($view_side === 'response_for') { if ($curr->team_abbr === 'NYR' && $next->team_abbr === 'NYR') { $is_valid_trigger = true; } } elseif ($view_side === 'response_against') { $is_curr_opp = ($curr->team_abbr !== 'NYR' && ($opponent_abbr === 'ALL' || $curr->team_abbr === $opponent_abbr)); if ($is_curr_opp && $next->team_abbr === $curr->team_abbr) { $is_valid_trigger = true; } } elseif ($view_side === 'rangers_response') { $is_curr_opp = ($curr->team_abbr !== 'NYR' && ($opponent_abbr === 'ALL' || $curr->team_abbr === $opponent_abbr)); if ($is_curr_opp && $next->team_abbr === 'NYR') { $is_valid_trigger = true; } } elseif ($view_side === 'opponent_response') { $is_next_opp = ($next->team_abbr !== 'NYR' && ($opponent_abbr === 'ALL' || $next->team_abbr === $opponent_abbr)); if ($curr->team_abbr === 'NYR' && $is_next_opp) { $is_valid_trigger = true; } } if ($is_valid_trigger) { $next_is_en = isset($next->goal_modifier) && strtolower($next->goal_modifier) === 'empty-net'; if ($exclude_empty_net && $next_is_en) { continue; } $curr_sec = helper_convert_to_seconds($curr->period, $curr->time_elapsed); $next_sec = helper_convert_to_seconds($next->period, $next->time_elapsed); $diff_sec = $next_sec - $curr_sec; if ($diff_sec > 0) { $diff_minutes = floor($diff_sec / 60); if ($diff_minutes >= 0 && $diff_minutes < 60) { $m_idx = (int)$diff_minutes; $type_key = $next_is_en ? 'en' : 'normal'; if ($next_is_en) { $breakdown_en[$m_idx]++; } else { $breakdown_normal[$m_idx]++; } $total_goals_counted++; // Store game meta for modal breakdown $matching_games_by_minute[$m_idx][$type_key][] = [ 'game_id' => $next->game_id, 'season' => $next->season, 'game_date' => $next->game_date, 'opponent_abbr' => $next->opponent_abbr, 'period' => $next->period, 'time_elapsed' => $next->time_elapsed, 'desc' => 'Follow-up goal at P' . $next->period . ' ' . $next->time_elapsed . ' (' . floor($diff_sec / 60) . 'm ' . ($diff_sec % 60) . 's after prior goal)' ]; } } } } } } else { // Standard Minute-by-Minute Mode (Up to 65 Buckets covering Regulation + OT) foreach ($all_game_goals as $goal) { if ($view_side === 'nyr' && $goal->team_abbr !== 'NYR') continue; if ($view_side === 'opp') { if ($opponent_abbr === 'ALL' && $goal->team_abbr === 'NYR') continue; if ($opponent_abbr !== 'ALL' && $goal->team_abbr !== $opponent_abbr) continue; } $goal_is_en = isset($goal->goal_modifier) && strtolower($goal->goal_modifier) === 'empty-net'; if ($exclude_empty_net && $goal_is_en) { continue; } // Calculate absolute minute bucket across periods (Regulations P1-P3 = 0-59, OT P4+ = 60+) $p = (int)$goal->period; $parts = explode(':', $goal->time_elapsed); $min_in_period = isset($parts[0]) ? (int)$parts[0] : 0; $m = -1; if ($p >= 1 && $p <= 3) { $m = (($p - 1) * 20) + $min_in_period; } elseif ($p >= 4) { // Overtime periods (P4 is minute 60+, P5 is 65+, etc.) $m = 60 + (($p - 4) * 5) + min($min_in_period, 4); } if ($m >= 0 && $m < $max_buckets) { $type_key = $goal_is_en ? 'en' : 'normal'; if ($goal_is_en) { $breakdown_en[$m]++; } else { $breakdown_normal[$m]++; } $total_goals_counted++; $matching_games_by_minute[$m][$type_key][] = [ 'game_id' => $goal->game_id, 'season' => $goal->season, 'game_date' => $goal->game_date, 'opponent_abbr' => $goal->opponent_abbr, 'period' => $goal->period, 'time_elapsed' => $goal->time_elapsed, 'desc' => $goal->team_abbr . ' goal at P' . $goal->period . ' ' . $goal->time_elapsed ]; } } } // Combine breakdowns for total scale calculation $breakdown_combined = []; for ($m = 0; $m < $max_buckets; $m++) { $breakdown_combined[$m] = $breakdown_normal[$m] + $breakdown_en[$m]; } $raw_max_goal_count = max($breakdown_combined); if ($raw_max_goal_count < 1) $raw_max_goal_count = 1; $allowed_multiples = [1, 2, 5, 10, 25, 50, 100]; $scale_max = 1; $found_scale = false; $magnitude = 1; while (!$found_scale) { foreach ($allowed_multiples as $mult) { $step = $mult * $magnitude; if ($step * 4 >= $raw_max_goal_count) { $scale_max = $step * 4; $found_scale = true; break; } } $magnitude *= 10; if ($magnitude > 10000) { $scale_max = ceil($raw_max_goal_count / 4) * 4; break; } } $input_style = 'width: 100%; height: 38px; padding: 0 10px; background: #222; border: 1px solid #444; color: #fff; border-radius: 4px; box-sizing: border-box; font-size: 0.9em; line-height: normal;'; // Build base URL query for preserving filters when reopening or passing state $base_query_params = $_GET; unset($base_query_params['modal_min'], $base_query_params['modal_type']); $current_url_clean = strtok($_SERVER["URI"] ?? $_SERVER['REQUEST_URI'], '?'); // 5. Output Layout Wrapper $output = '
'; $header_titles = [ 'nyr' => 'Rangers Goal Timing Breakdown (Minute-by-Minute)', 'opp' => 'Opponent Goal Timing vs Rangers (Minute-by-Minute)', 'response_for' => 'Follow-up Goal: Goals Scored by Rangers Following a Rangers Goal', 'response_against' => 'Follow-up Goal: Goals Scored by Opponents Following an Opponent Goal', 'rangers_response' => 'Rangers Response Goal: Rangers Goal Following an Opponent Goal', 'opponent_response' => 'Opponent Response Goal: Opponent Goal Following a Rangers Goal', 'player_period_breakdown' => 'Rangers Player Scoring Breakdown by Period' ]; $current_title = $header_titles[$view_side] ?? 'Goal Timing Breakdown'; $output .= '
'; $output .= '
' . $current_title . '
'; $query_params_base = '&opponent_abbr='.urlencode($opponent_abbr).'&view_side='.urlencode($view_side).'&season_start='.urlencode($season_start).'&season_end='.urlencode($season_end).'&exclude_empty_net='.$exclude_empty_net; $output .= '
'; $output .= 'Regular Season'; $output .= 'Playoffs'; $output .= '
'; $output .= '
'; // 6. Filter Form $output .= '
'; foreach ($base_query_params as $bk => $bv) { if (!in_array($bk, ['game_type', 'view_side', 'opponent_abbr', 'season_start', 'season_end', 'exclude_empty_net'])) { if (is_array($bv)) { foreach($bv as $bvk => $bvv) { $output .= ''; } } else { $output .= ''; } } } $output .= ''; $output .= ''; $output .= '
'; // View Side Toggle Selector $output .= '
'; $output .= ''; $output .= ''; $output .= '
'; // Opponent Filter $output .= '
'; $output .= ''; $output .= ''; $output .= '
'; // Season Start Filter $output .= '
'; $output .= ''; $output .= ''; $output .= '
'; // Season End Filter $output .= '
'; $output .= ''; $output .= ''; $output .= '
'; // Empty Net Exclusion Toggle Dropdown (Hidden for player breakdown view) if (!$is_player_period_mode) { $output .= '
'; $output .= ''; $output .= ''; $output .= '
'; } // Action Buttons $output .= '
'; $output .= ''; $output .= 'Clear'; $output .= '
'; $output .= '
'; $output .= '
'; // 7. Render Conditional Branch: Player Period Breakdown Report vs Charts if ($is_player_period_mode) { // Query goals specifically for Rangers, mapping player info, grouping by period $player_goals_query = $wpdb->prepare(" SELECT p.id as player_id, s.scorer_name, s.period, COUNT(*) as goal_count FROM otg_rangers_scoring s JOIN otg_rangers_games g ON s.game_id = g.game_id LEFT JOIN otg_players p ON s.scorer_name = p.Name WHERE s.team_abbr = 'NYR' AND s.time_elapsed != '00:00' AND g.game_type = %s $season_where $game_filter GROUP BY s.scorer_name, s.period ORDER BY s.scorer_name ASC, s.period ASC ", $game_type); $raw_player_data = $wpdb->get_results($player_goals_query); // Organize into a structured matrix: player => [period => count] $player_matrix = []; $totals_by_period = [1 => 0, 2 => 0, 3 => 0, 'ot' => 0]; foreach ($raw_player_data as $row) { $name = !empty($row->scorer_name) ? $row->scorer_name : 'Unknown / Unattributed'; $p_id = !empty($row->player_id) ? $row->player_id : ''; $p = (int)$row->period; $p_key = ($p >= 4) ? 'ot' : $p; if (!isset($player_matrix[$name])) { $player_matrix[$name] = [ 'player_id' => $p_id, 1 => 0, 2 => 0, 3 => 0, 'ot' => 0, 'total' => 0 ]; } $player_matrix[$name][$p_key] += (int)$row->goal_count; $player_matrix[$name]['total'] += (int)$row->goal_count; if (empty($player_matrix[$name]['player_id']) && !empty($p_id)) { $player_matrix[$name]['player_id'] = $p_id; } if (isset($totals_by_period[$p_key])) { $totals_by_period[$p_key] += (int)$row->goal_count; } } // Parse sorting parameters for player breakdown table (default to total goals descending) $sort_input = isset($_GET['sort']) ? sanitize_text_field($_GET['sort']) : 'total:desc'; $active_sorts = []; foreach (explode(',', $sort_input) as $sort_pair) { $parts = explode(':', trim($sort_pair)); if (!empty($parts[0])) { $active_sorts[] = [ 'col' => trim($parts[0]), 'dir' => (isset($parts[1]) && strtolower($parts[1]) === 'asc') ? 'asc' : 'desc' ]; } } if (empty($active_sorts)) { $active_sorts[] = ['col' => 'total', 'dir' => 'desc']; } $active_sort_map = []; foreach ($active_sorts as $index => $s_item) { $active_sort_map[$s_item['col']] = [ 'dir' => $s_item['dir'], 'priority' => count($active_sorts) > 1 ? ($index + 1) : null ]; } // Apply Multi-column Sorting to Player Matrix uasort($player_matrix, function($a, $b) use ($active_sorts) { foreach ($active_sorts as $sort) { $col = $sort['col']; $dir = $sort['dir']; $valA = $a[$col] ?? 0; $valB = $b[$col] ?? 0; if ($col === 'player_name') { $cmp = strcasecmp($a['player_name'] ?? '', $b['player_name'] ?? ''); } else { $cmp = ($valA == $valB) ? 0 : (($valA < $valB) ? -1 : 1); } if ($cmp !== 0) { return ($dir === 'asc') ? $cmp : -$cmp; } } return 0; }); $output .= ''; // Hidden sort input to support column clicking for player breakdown report $output .= ''; $output .= '
'; $output .= '
Rangers Player Scoring Breakdown by Period
'; $output .= '
'; $output .= ''; $output .= ''; $output .= ''; $headers_map = [ 'player_name' => 'Player Name', '1' => 'Period 1', '2' => 'Period 2', '3' => 'Period 3', 'ot' => 'Overtime (OT+)', 'total' => 'Total Goals' ]; foreach ($headers_map as $col_key => $col_label) { $is_sorted = isset($active_sort_map[$col_key]); $arrow = ''; $priority_badge = ''; if ($is_sorted) { $arrow = ($active_sort_map[$col_key]['dir'] === 'asc') ? ' ' : ' '; if ($active_sort_map[$col_key]['priority'] !== null) { $priority_badge = ' ' . $active_sort_map[$col_key]['priority'] . ''; } } $th_class = $is_sorted ? 'highlight-col' : ''; $align_style = ($col_key === 'player_name') ? 'text-align: left;' : 'text-align: center;'; $output .= ''; } $output .= ''; $output .= ''; $output .= ''; if (!empty($player_matrix)) { $grand_total = 0; foreach ($player_matrix as $p_name => $counts) { $grand_total += $counts['total']; $output .= ''; // Player Name column with profile link $name_display = esc_html($p_name); if (!empty($counts['player_id'])) { $profile_url = home_url('/profile/?player_id=' . $counts['player_id']); $name_display = '' . esc_html($p_name) . ''; } $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; } // Totals Row $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; } else { $output .= ''; } $output .= ''; $output .= '
'.$col_label.$arrow.$priority_badge.'
' . $name_display . '' . ($counts[1] > 0 ? $counts[1] : '-') . '' . ($counts[2] > 0 ? $counts[2] : '-') . '' . ($counts[3] > 0 ? $counts[3] : '-') . '' . ($counts['ot'] > 0 ? $counts['ot'] : '-') . '' . $counts['total'] . '
Team Totals' . $totals_by_period[1] . '' . $totals_by_period[2] . '' . $totals_by_period[3] . '' . $totals_by_period['ot'] . '' . $grand_total . '
No player scoring records found for the selected filters.
'; $output .= '
'; $output .= '
'; $js_player_sorts = json_encode($active_sorts); $output .= ''; } else { // Summary Count Note for Visual Chart Card $note_label = $is_response_mode ? 'Total Follow-up Goal Intervals Analyzed: ' : 'Total Goals Analyzed (time elapsed > 00:00): '; $output .= '
' . $note_label . '' . $total_goals_counted . ' (Tip: Click any bar or segment to inspect game boxscores)
'; // 8. Render Visual Chart Card $card_title = $is_response_mode ? 'Time Elapsed Following Prior Goal' : 'Minute-by-Minute Period Breakdown'; $output .= ''; $output .= '
'; $output .= '
' . $card_title . ' (Total Count: ' . $total_goals_counted . ')
'; $max_val = (int)$scale_max; $three_quarter_val = (int)round($max_val * 0.75); $mid_val = (int)round($max_val * 0.5); $quarter_val = (int)round($max_val * 0.25); $output .= '
'; // Left Scale Axis $output .= '
'; $output .= '' . $max_val . ''; $output .= '' . $three_quarter_val . ''; $output .= '' . $mid_val . ''; $output .= '' . $quarter_val . ''; $output .= '0'; $output .= '
'; // Main Bar Grid Area $output .= '
'; if (!$is_response_mode) { $p1_pct = (20 / $max_buckets) * 100; $p2_pct = (40 / $max_buckets) * 100; $p3_pct = (60 / $max_buckets) * 100; $output .= '
'; $output .= '
'; if ($max_buckets > 60) { $output .= '
'; } } for ($m = 0; $m < $max_buckets; $m++) { $count_norm = $breakdown_normal[$m]; $count_en = $breakdown_en[$m]; $total_count = $count_norm + $count_en; $height_pct = ($scale_max > 0) ? max(4, round(($total_count / $scale_max) * 100)) : 4; if ($total_count == 0) $height_pct = 3; if (!$is_response_mode && $m >= 60) { $ot_min_num = $m - 60; $time_range_label = sprintf('Overtime (OT %d:%02d-%d:%02d)', $ot_min_num, 0, $ot_min_num, 59); } else { $time_range_label = $is_response_mode ? sprintf('%d-%d min elapsed after goal', $m, $m + 1) : sprintf('%02d:00-%02d:59', $m, $m); } $col_label = ''; if ($is_response_mode) { $col_label = ($m % 5 == 0) ? ($m + 1) : ''; } else { if ($m < 60) { $col_label = $m + 1; } else { $col_label = $m - 60; } } $title_tooltip = $time_range_label . ': ' . $total_count . ' occurrences (Click bar segments to view games)'; if ($count_en > 0) { $title_tooltip .= ' (' . $count_norm . ' regular, ' . $count_en . ' empty-net)'; } $output .= '
'; $output .= '
'; if ($total_count > 0) { $output .= '
' . $total_count . '
'; } else { $output .= '
0
'; } $output .= '
'; if ($count_en > 0) { $en_pct = ($total_count > 0) ? ($count_en / $total_count) * 100 : 0; $en_click_url = add_query_arg(array_merge($base_query_params, [ 'game_type' => $game_type, 'view_side' => $view_side, 'opponent_abbr' => $opponent_abbr, 'season_start' => $season_start, 'season_end' => $season_end, 'exclude_empty_net' => $exclude_empty_net, 'modal_min' => $m, 'modal_type' => 'en' ]), $current_url_clean); $output .= '
'; } if ($count_norm > 0) { $norm_pct = ($total_count > 0) ? ($count_norm / $total_count) * 100 : 0; $norm_click_url = add_query_arg(array_merge($base_query_params, [ 'game_type' => $game_type, 'view_side' => $view_side, 'opponent_abbr' => $opponent_abbr, 'season_start' => $season_start, 'season_end' => $season_end, 'exclude_empty_net' => $exclude_empty_net, 'modal_min' => $m, 'modal_type' => 'normal' ]), $current_url_clean); $output .= '
'; } if ($total_count == 0) { $output .= '
'; } $output .= '
'; $output .= '
'; $output .= '
'; $output .= '' . $col_label . ''; $output .= '
'; $output .= '
'; } $output .= '
'; // Right Scale Axis $output .= '
'; $output .= '' . $max_val . ''; $output .= '' . $three_quarter_val . ''; $output .= '' . $mid_val . ''; $output .= '' . $quarter_val . ''; $output .= '0'; $output .= '
'; $output .= '
'; $output .= '
'; } // 9. Render Modal Popup if selected_minute is active if ($selected_minute !== '' && $selected_type !== '') { $m_idx = (int)$selected_minute; $t_key = ($selected_type === 'en') ? 'en' : 'normal'; $games_in_modal = $matching_games_by_minute[$m_idx][$t_key] ?? []; if (!$is_response_mode && $m_idx >= 60) { $time_title_label = sprintf('Overtime Minute %d', $m_idx - 60); } else { $time_title_label = $is_response_mode ? sprintf('%d-%d Minutes After Prior Goal', $m_idx, $m_idx + 1) : sprintf('%02d:00-%02d:59 Elapsed', $m_idx, $m_idx); } $type_title_label = ($t_key === 'en') ? 'Empty-Net Goals' : 'Regular Goals'; $close_modal_url = add_query_arg($base_query_params, $current_url_clean); $close_modal_url = add_query_arg([ 'game_type' => $game_type, 'view_side' => $view_side, 'opponent_abbr' => $opponent_abbr, 'season_start' => $season_start, 'season_end' => $season_end, 'exclude_empty_net' => $exclude_empty_net ], $close_modal_url); $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
' . $time_title_label . ' (' . $type_title_label . ') - ' . count($games_in_modal) . ' Games Found
'; $output .= '×'; $output .= '
'; $output .= '
'; if (!empty($games_in_modal)) { $output .= ''; $output .= ''; $output .= ''; foreach ($games_in_modal as $gm) { $boxscore_url = home_url('/box/?game_id=' . $gm['game_id']); $date_disp = !empty($gm['game_date']) ? $gm['game_date'] : $gm['season']; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; } $output .= ''; $output .= '
Season / DateOpponentMatch DetailsAction
' . esc_html($date_disp) . 'vs ' . esc_html($gm['opponent_abbr']) . '' . esc_html($gm['desc']) . 'View Box →
'; } else { $output .= '

No specific games found for this segment.

'; } $output .= '
'; $output .= '
'; $output .= 'Close Window'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= ''; } // JavaScript for View Switching & Smart Year Auto-Correction $output .= ''; $output .= '
'; return $output; } // Helper utility to convert period and MM:SS into absolute elapsed seconds for delta calculation function helper_convert_to_seconds($period, $time_elapsed) { $parts = explode(':', $time_elapsed); $min = isset($parts[0]) ? (int)$parts[0] : 0; $sec = isset($parts[1]) ? (int)$parts[1] : 0; $period_offset_seconds = 0; $p = (int)$period; if ($p === 2) { $period_offset_seconds = 1200; } elseif ($p === 3) { $period_offset_seconds = 2400; } elseif ($p > 3) { $period_offset_seconds = 3600 + (($p - 4) * 300); } return $period_offset_seconds + ($min * 60) + $sec; } CuyllRanger – Activity – OutsideTheGarden Boards – Page 46
NOVEMBER
«
Thu
11
Fri
12
Sat
13
Sun
14
Mon
15
Tue
16
Wed
17
»
CuyllRanger
CuyllRanger
Group: Registered
Joined: 2024-12-02
Hall of Famer
3
Follow
  I’d like to see him moved to. Can probably get a fi...

In forum Where Smit Hits The Fan

10 months ago
Sulleary didn’t need to give the puck up on the delayed pena...

In forum Where Smit Hits The Fan

10 months ago
AI says Draisaital then Kurri.

In forum Where Smit Hits The Fan

10 months ago
Temu is trivia answer

In forum Where Smit Hits The Fan

10 months ago
Good start

In forum Where Smit Hits The Fan

10 months ago
  And there you have it. More nepotism.  

In forum Where Smit Hits The Fan

10 months ago
Rangers were good. Be nice to see Panarin and Miller a littl...

In forum Where Smit Hits The Fan

10 months ago
Edstrom out there looking to finish checks. 👍ὄ...

In forum Where Smit Hits The Fan

10 months ago
  Id take my chances with Othmann or Bérard over him....

In forum Where Smit Hits The Fan

10 months ago
Shesterkin with a Four game Ranger Hardy Astrom like save on...

In forum Where Smit Hits The Fan

10 months ago
  Ouch, poor Skinner .  

In forum Where Smit Hits The Fan

10 months ago
Skinner isn’t exactly Bernie Parent. Hammer pucks at him.

In forum Where Smit Hits The Fan

10 months ago
Sheary looks like arm problems left the ice.

In forum Where Smit Hits The Fan

10 months ago
Beauvillier couldn’t do that tip again, horseshit luck.

In forum Where Smit Hits The Fan

10 months ago
Playing well enough to keep up to Washington, just need a co...

In forum Where Smit Hits The Fan

10 months ago
Page 46 / 213