<?php
/**
 * Podcast Show & Host Planner
 * Framework: Vanilla PHP + PDO + MySQL
 * Features:
 *  - Episode scheduling and planning
 *  - Host task planner (notes, talking points)
 *  - Guest management
 *  - Dynamic blog-post link selector
 */

// config.php: Database connection
return [
    'db' => [
        'host' => '127.0.0.1',
        'dbname' => 'podcast_planner',
        'user' => 'db_user',
        'pass' => 'db_pass',
    ]
];

// bootstrap.php: Initialize PDO
$config = require __DIR__ . '/config.php';
try {
    $dsn = "mysql:host={$config['db']['host']};dbname={$config['db']['dbname']};charset=utf8";
    $pdo = new PDO($dsn, $config['db']['user'], $config['db']['pass'], [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
} catch (PDOException $e) {
    die('DB Connection failed: ' . $e->getMessage());
}

// Database schema definitions omitted for brevity

// seed.php: Populate blog_posts if empty
$seedPosts = [
    // original seed entries...
    ['url'=>'https://podcastpontifications.com/','images'=>1,'last_modified'=>'2025-07-08 11:48:00'],
    // ... (existing entries) ...
];

$additionalPosts = [
    ['url'=>'https://podcastpontifications.com/episode/making-room-for-dissent-in-podcasting/','images'=>0,'last_modified'=>'2024-02-11 14:17:00'],
    ['url'=>'https://podcastpontifications.com/episode/is-clubhouse-the-future-of-podcasting/','images'=>0,'last_modified'=>'2024-02-11 14:17:00'],
    ['url'=>'https://podcastpontifications.com/helpful-info/podcast-app-manifesto/','images'=>0,'last_modified'=>'2024-02-11 14:18:00'],
    // ... include all provided slugs here ...
    ['url'=>'https://podcastpontifications.com/uncategorized/best-podcast-platform-for-monetization/','images'=>0,'last_modified'=>'2025-07-08 22:34:00'],
];

$posts = array_merge($seedPosts, $additionalPosts);

foreach ($posts as $p) {
    $stmt = $pdo->prepare("INSERT IGNORE INTO blog_posts (url, images, last_modified) VALUES (?, ?, ?)");
    $stmt->execute([$p['url'], $p['images'], $p['last_modified']]);
}

// Models and routing unchanged
