From 9a1e8a33a6889610d764d2679761d81d8c1bcb60 Mon Sep 17 00:00:00 2001 From: Daniel Messer Date: Thu, 29 Oct 2026 06:20:07 -0500 Subject: [PATCH] Add database connection helper and live now-playing page - includes/db.php: getDB() returns a shared PDO connection to MariaDB - config/db_credentials.example.php: credentials template; the real db_credentials.php is gitignored and deployed separately via SFTP - live.php: page for active broadcasts, with the player on the left and a placeholder Recently Played table on the right Co-Authored-By: Claude Opus 5.5 --- .gitignore | 3 + config/db_credentials.example.php | 18 ++++ includes/db.php | 30 ++++++ live.php | 161 ++++++++++++++++++++++++++++++ 4 files changed, 212 insertions(+) create mode 100644 config/db_credentials.example.php create mode 100644 includes/db.php create mode 100644 live.php diff --git a/.gitignore b/.gitignore index 3b19991..8a22d15 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ Temporary Items # Don't commit the code-workspace files *.code-workspace + +# Database credentials — keep out of version control +config/db_credentials.php diff --git a/config/db_credentials.example.php b/config/db_credentials.example.php new file mode 100644 index 0000000..b109b7d --- /dev/null +++ b/config/db_credentials.example.php @@ -0,0 +1,18 @@ + 'localhost', + 'port' => 3306, + 'database' => '', + 'username' => '', + 'password' => '', + 'charset' => 'utf8mb4', +]; diff --git a/includes/db.php b/includes/db.php new file mode 100644 index 0000000..918ccd3 --- /dev/null +++ b/includes/db.php @@ -0,0 +1,30 @@ + PDO::ERRMODE_EXCEPTION, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + PDO::ATTR_EMULATE_PREPARES => false, + ]); + return $pdo; +} diff --git a/live.php b/live.php new file mode 100644 index 0000000..22f137b --- /dev/null +++ b/live.php @@ -0,0 +1,161 @@ + + + + + Live Now | Radio Free Elsewhere + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+

Recently Played

+
+
+ + + + + + + + + + + + + + + +
TimeTitleArtistAlbum
Track history coming soon.
+
+
+ +
+ + + + + + + + + + + + + + + \ No newline at end of file