// ========================================================================= // 8. SHORTCODE: Team Development Camp Roster - /development-camp/ // ========================================================================= add_shortcode('dev_camp_roster_full', 'render_dev_camp_roster_full'); function render_dev_camp_roster_full() { global $wpdb; // 1. Handle Year Selection via GET parameter (default to max prospect/dev camp year if not set) $available_years = $wpdb->get_col("SELECT DISTINCT camp_year FROM otg_camp_roster WHERE camp_type = 'Prospect' ORDER BY camp_year DESC"); $latest_year = isset($_GET['camp_year']) ? intval($_GET['camp_year']) : 0; if (!$latest_year || !in_array($latest_year, $available_years)) { $latest_year = !empty($available_years) ? intval($available_years[0]) : intval($wpdb->get_var("SELECT MAX(camp_year) FROM otg_camp_roster WHERE camp_type='Prospect'")); } if (!$latest_year) { return "No development camp data found."; } // Retrieve Development Camp Settings by matching the first 4 characters of season to $latest_year $camp_settings = $wpdb->get_row($wpdb->prepare( "SELECT season, dev_start, dev_end, dev_location FROM otg_rangers_season_settings WHERE LEFT(season, 4) = %s LIMIT 1", $latest_year )); $dev_camp_dates_str = ''; $start_date_obj = null; $end_date_obj = null; if ($camp_settings && !empty($camp_settings->dev_start) && !empty($camp_settings->dev_end)) { $start_date_obj = new DateTime($camp_settings->dev_start); $end_date_obj = new DateTime($camp_settings->dev_end); $start_month = $start_date_obj->format('F'); $end_month = $end_date_obj->format('F'); if ($start_month === $end_month) { $dev_camp_dates_str = $start_date_obj->format('F j') . '-' . $end_date_obj->format('j'); } else { $dev_camp_dates_str = $start_date_obj->format('F j') . ' - ' . $end_date_obj->format('F j'); } if (!empty($camp_settings->dev_location)) { $dev_camp_dates_str .= '
Location: ' . $camp_settings->dev_location; } } // Check which camp types actually exist for this selected year to conditionally display navigation links $has_training = (intval($wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM otg_camp_roster WHERE camp_year = %d AND camp_type = 'Training'", $latest_year))) > 0); $has_rookie = (intval($wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM otg_camp_roster WHERE camp_year = %d AND camp_type = 'Rookie'", $latest_year))) > 0); $has_dev = (intval($wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM otg_camp_roster WHERE camp_year = %d AND camp_type = 'Prospect'", $latest_year))) > 0); $positions = ['Forward', 'Defenseman', 'Goaltender']; $target_date = new DateTime('2026-06-29'); // Start output wrapper constrained to 100% width, max-width 1800px, and left-justified matching stats browser $output = '
'; // Top Navigation & Filter Bar (Camp Type Switcher + Year Dropdown Selector) $output .= '
'; // Camp Type Navigation Links $output .= '
'; $output .= 'Camp View:'; if ($has_dev) { $dev_url = esc_url(add_query_arg('camp_year', $latest_year, home_url('/development-camp/'))); $output .= 'Development Camp'; } if ($has_rookie) { $rookie_url = esc_url(add_query_arg('camp_year', $latest_year, home_url('/rookie-camp/'))); $output .= 'Rookie Camp'; } if ($has_training) { $training_url = esc_url(add_query_arg('camp_year', $latest_year, home_url('/training-camp/'))); $output .= 'Training Camp'; } $output .= '
'; // Year Selector Dropdown Form if (!empty($available_years)) { $output .= '
'; $output .= ''; $output .= ''; $output .= '
'; } $output .= '
'; // Header Section (Updated to match training camp layout format) $output .= '
'; $output .= '
Development Camp Roster: ' . $latest_year . '
'; if (!empty($dev_camp_dates_str)) { $output .= '
Development Camp Dates:
' . $dev_camp_dates_str . '
'; } $output .= '
'; // Top Section Grid for Related Posts $output .= '
'; $output .= '
'; // Related WordPress Posts Section (Tag name matching: e.g., "2025 Development Camp") $camp_posts = get_posts(array( 'post_type' => 'post', 'posts_per_page' => 5, 'tax_query' => array( array( 'taxonomy' => 'post_tag', 'field' => 'name', 'terms' => $latest_year . ' Development Camp', ), ), 'post_status' => 'publish' )); if (!empty($camp_posts)) { $output .= '
'; $output .= '
Related Development Camp News & Updates
'; $output .= '
    '; foreach ($camp_posts as $post) { setup_postdata($post); $post_url = get_permalink($post->ID); $post_title = get_the_title($post->ID); $post_date = get_the_date('F j, Y', $post->ID); $output .= '
  • '; $output .= '' . esc_html($post_date) . ''; $output .= '' . esc_html($post_title) . ''; $output .= '
  • '; } $output .= '
'; $output .= '
'; wp_reset_postdata(); } $output .= '
'; $output .= '
'; // Close Top Section Grid // Styles matching modern uniform layout $output .= ''; foreach ($positions as $pos) { $display_pos = ($pos == 'Defenseman') ? 'Defensemen' : $pos . 's'; $output .= '
' . $display_pos . '
'; $players = $wpdb->get_results($wpdb->prepare( "SELECT * FROM otg_camp_roster WHERE camp_year = %d AND camp_type = 'Prospect' AND position = %s ORDER BY player_name ASC", $latest_year, $pos )); $h_goals_wins = ($pos === 'Goaltender') ? 'W' : 'G'; $h_assists_losses = ($pos === 'Goaltender') ? 'L' : 'A'; $h_pts_ot = ($pos === 'Goaltender') ? 'OT' : 'PTS'; $h_pim_gaa = ($pos === 'Goaltender') ? 'GAA' : 'PIM'; $output .= ''; if (empty($players)) { $output .= ''; } else { foreach ($players as $p) { $clean_jersey = ltrim($p->jersey_number, '#'); $name = $p->id ? '' . esc_html($p->player_name) . '' : esc_html($p->player_name); $birthdate = !empty($p->birthdate) ? new DateTime($p->birthdate) : null; $age = $birthdate ? $target_date->diff($birthdate)->y : ''; // Calculate GAA for goalies, PIM for skaters $stat_five = ($pos === 'Goaltender') ? number_format($p->pim / 100, 2) : $p->pim; $output .= ''; } } $output .= '
Player #HtWt HandBirthdateAge Team Birthplace Country GP' . $h_goals_wins . ' ' . $h_assists_losses . ' ' . $h_pts_ot . ' ' . $h_pim_gaa . '
No players found for this position.
' . $name . ' ' . esc_html($clean_jersey) . ' ' . esc_html($p->height) . ' ' . esc_html($p->weight) . ' ' . esc_html($p->hand) . ' ' . esc_html($p->birthdate) . ' ' . esc_html($age) . ' ' . esc_html($p->team_name) . ' ' . esc_html($p->birth_city) . ' ' . esc_html($p->country) . ' ' . esc_html($p->gp) . ' ' . esc_html($p->goals) . ' ' . esc_html($p->assists) . ' ' . esc_html($p->points) . ' ' . esc_html($stat_five) . '
'; } $output .= '
'; // Close main wrapper return $output; } Fish – Activity – OutsideTheGarden Boards – Page 36
JANUARY
«
Sat
16
12:00PM
Sun
17
6:00PM
Mon
18
Tue
19
7:00PM
Wed
20
Thu
21
8:00PM
Fri
22
»
Fish
Fish
Group: Moderator
Joined: 2023-08-22
Title: Member Moderator
3
Follow
After being called up today, Rempe is set to serve the last ...

In forum Where Smit Hits The Fan

2 years ago
Kreider on IR

In forum Where Smit Hits The Fan

2 years ago
Well, he had 103 points last year, 82 the prior season, and ...

In forum Where Smit Hits The Fan

2 years ago
6-2 210 Bit of a "change of scenery" kind of opportunity, ...

In forum Where Smit Hits The Fan

2 years ago
No Kreider (day to day), so J Brod is in Louis in net

In forum Where Smit Hits The Fan

2 years ago
I think the issue is more his partner. You have a better pl...

In forum Where Smit Hits The Fan

2 years ago
I disagree...but his effort level has certainly dropped as m...

In forum Where Smit Hits The Fan

2 years ago
Still dirty on that high stick they missed before the non-Cu...

In forum Where Smit Hits The Fan

2 years ago
Sam Kraken with what would have been the tying goal

In forum Where Smit Hits The Fan

2 years ago
May have...been a long season 🙂

In forum Where Smit Hits The Fan

2 years ago
Will Cuylle has had at least 3 goals called back this year b...

In forum Where Smit Hits The Fan

2 years ago
And now Caps challenging for offside about 10 minutes ago

In forum Where Smit Hits The Fan

2 years ago
Chytil line had been on for 2 goals against this period, get...

In forum Where Smit Hits The Fan

2 years ago
Well, 3-1...hard to see the NYR coming back in this one give...

In forum Where Smit Hits The Fan

2 years ago
Thought he had a much better game against Boston.

In forum Where Smit Hits The Fan

2 years ago
Page 36 / 245