Rangers Player Birthplace Search
Showing 1 to 50 of 1154 records
function otg_render_opening_night_page($atts) { global $wpdb; // 1. Get the current active season from otg_rangers_season_settings $active_season = $wpdb->get_var(" SELECT season FROM otg_rangers_season_settings WHERE active_season = 'y' LIMIT 1 "); // Fallback if no active_season row is flagged if (empty($active_season)) { $active_season = $wpdb->get_var(" SELECT season FROM otg_rangers_season_settings ORDER BY season DESC LIMIT 1 "); } // 2. Look up the earliest regular season game (game_type = 2) for that active season $opening_game = $wpdb->get_row($wpdb->prepare(" SELECT * FROM otg_rangers_games WHERE season = %s AND game_type = 2 AND (home_team_abbr = 'NYR' OR away_team_abbr = 'NYR') ORDER BY game_date ASC, game_id ASC LIMIT 1 ", $active_season)); // Fallback if active season schedule is not yet in otg_rangers_games if (!$opening_game) { $opening_game = $wpdb->get_row(" SELECT * FROM otg_rangers_games WHERE game_type = 2 AND (home_team_abbr = 'NYR' OR away_team_abbr = 'NYR') ORDER BY game_date DESC, game_id ASC LIMIT 1 "); } // 3. Determine Opponent Abbreviation and Logos $game_id = $opening_game ? intval($opening_game->game_id) : 0; $opp_abbr = ''; if ($opening_game) { $opp_abbr = ($opening_game->home_team_abbr === 'NYR') ? $opening_game->away_team_abbr : $opening_game->home_team_abbr; } $nyr_logo = function_exists('otg_get_team_logo') ? otg_get_team_logo('NYR', $active_season) : ''; $opp_logo = ($opp_abbr && function_exists('otg_get_team_logo')) ? otg_get_team_logo($opp_abbr, $active_season) : ''; // ========================================================================= // RENDER LAYOUT // ========================================================================= $html = '
Season Opener Matchup: NYR vs ' . esc_html($opp_abbr) . '
'; } $html .= '