Implemented sets.
authorAndrew DeFaria <Andrew@DeFaria.com>
Mon, 5 Jun 2017 23:42:48 +0000 (16:42 -0700)
committerAndrew DeFaria <Andrew@DeFaria.com>
Mon, 5 Jun 2017 23:42:48 +0000 (16:42 -0700)
Mr.lst [deleted file]
San Elijo.lst [deleted file]
Songs/Andrew's Songs.lst [new file with mode: 0644]
Songs/KARR.lst [new file with mode: 0644]
Songs/New Songs.lst [new file with mode: 0644]
Songs/Set 1.lst [deleted file]
Wed.lst [deleted file]
web/displayset.php [new file with mode: 0644]
web/index.php
web/songbook.php

diff --git a/Mr.lst b/Mr.lst
deleted file mode 100644 (file)
index b2a4e4c..0000000
--- a/Mr.lst
+++ /dev/null
@@ -1,10 +0,0 @@
-Mr
-Lyin' Eyes - Eagles
-Norwegian Wood - Beatles
-Peaceful, Easy Feeling - Eagles
-Something - Beatles
-Space Oddity - David Bowie
-Dig a Pony - Beatles
-I'm a Believer - Monkees
-Maggie May - Rod Stewart
-More Than Words - Extreme
diff --git a/San Elijo.lst b/San Elijo.lst
deleted file mode 100644 (file)
index dbc8842..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Ello
-A Hard Day's Night - Beatles
-Here Today - Paul McCartney
-Love Her Madly - Doors
-Lyin' Eyes - Eagles
-Maggie May - Rod Stewart
-Norwegian Wood - Beatles
-Peaceful, Easy Feeling - Eagles
-Revolution - Beatles
-You Got a Friend - James Taylor
diff --git a/Songs/Andrew's Songs.lst b/Songs/Andrew's Songs.lst
new file mode 100644 (file)
index 0000000..b3bf2d9
--- /dev/null
@@ -0,0 +1,60 @@
+Andrew's Songs
+Across the Universe - Beatles
+All You Need Is Love - ohn Lennon/Paul McCartney
+Amie - Pure Prairie League
+Breakdown - Tom Petty
+Brown Eyed Girl - Van Morrison
+Country Road - John Denver
+Desperado - The Eagles
+Drugstore Novels - Cast of Shadows
+Fire and Rain - James Taylor
+Fool You Never Knew - Tempest
+Free Fallin - Tom Petty
+Give a Little Bit - Roger Hodgson
+Here Comes the Sun - George Harrison
+Here in Heaven - Mike Fraser
+Hold On - Kansas
+Hotel California - Eagles
+I Can See Clearly Now - Johnny Nash or Jimmy Cliff
+I Still Can't Say Goodbye - Chet Atkins
+I'm Your Captain - Grand Funk Railroad
+Imagine - John Lennon
+Kashmir - Led Zeppelin
+Last Man on Earth - Alice Cooper
+Leather And Lace - Stevie Nicks
+Let It Be - Beatles
+Listen to the Music - Doobie Brothers
+Love Her Madly - Doors
+Lyin' Eyes - Eagles
+Maggie May - Rod Stewart
+Margaritaville - Jimmy Buffett
+Me and Julio Down by the Schoolyard - Paul Simon
+Mother - Pink Floyd
+Mrs. Robinson - Paul Simon
+My Life - Tempest
+Naptime - Jen Hajj
+Nothing can stop us now - Tim Minchin
+Peaceful, Easy Feeling - Eagles
+Piano Man - Billy Joel
+Questions - Moody Blues
+Ramblin' Man - Allman Brothers Band
+Reason to Believe - Tim Hardin (Rod Stewart)
+Santa Monica - Everclear
+Seems Like a Dream - Tempest
+Serenade - Steve Miller
+Sister Golden Hair - America
+Sitting on the Dock of the Bay - Otis Redding
+Space Oddity - David Bowie
+Strong Enough To Win - Mike Fraser
+Swingtown - Steve Miller
+Take It Easy - Eagles
+Turn the Page - Bob Seager
+Voices - Red Shoes For Romeo
+What a Wonderful World - Louis Armstrong
+What I've Already Heard - Mike Fraser
+Where You Take Me - Jen Hajj
+Who'll Stop The Rain - Creedence Clearwater Revival
+You Ain't Seen Nothing Yet - Backman Turner Overdrive
+Young as You - Mike Fraser
+I'm a Believer - Monkees
+Daydream Believer - Monkees
diff --git a/Songs/KARR.lst b/Songs/KARR.lst
new file mode 100644 (file)
index 0000000..d3a3f9c
--- /dev/null
@@ -0,0 +1,46 @@
+Locomotive Breath - Jethro Tull
+Landslide - Fleetwood Mac
+Jenny Jenny - Tommy Tutone
+Norwegian Wood - Beatles
+Peaceful Easy Feeling - Eagles
+Angel
+The Letter - Joe Cocker
+Sweet Melisa - Allman Brothers
+Can't find My Way Home - Steve Windwood
+Wish You Were Here - Pink Floyd
+From the Beginning - ELP
+Drugstore Novels - Cast of Shadows
+Tequila Sunrise - Eagles
+Space Oddity - David Bowie
+Nowhere Man - Beatles
+Seven Bridges Road - Eagles
+Stuck in the Middle With You - Stealers Wheel
+Suite Judy Blue Eyes - Crosby, Stills and Nash
+Dust in the Wind - Kansas
+Badge
+For What It's Worth
+Ramblin' Man - Allman Brothers
+Sister Golden Hair - America
+Take It Easy - Eagles
+Ventura Highway - America
+Wild Nights - Van Morrison
+All Right Now - Free
+Blackbird - Beatles
+Lucky Man - ELP
+Casey Jones - Grateful Dead
+Turn the Page - Bob Segar
+Gold Dust Woman
+Lying Eyes - Eagles
+Panama Red
+Something - Beatles
+Best of My Love - Eagles
+Southern Cross
+The Weight
+What I Like About You - Romantics
+Let It Be - Beatles
+Pink Houses - John Cougar
+Can't You See - Marshall Tucker
+Wagon Wheel - Darius Rucker
+Under the Boardwalk - Drifters
+Bring It on Home
+Hold On/Your Move - Triumph/Yes
diff --git a/Songs/New Songs.lst b/Songs/New Songs.lst
new file mode 100644 (file)
index 0000000..f368d45
--- /dev/null
@@ -0,0 +1,29 @@
+People Get Ready - Curtis Mayfield
+I Can See Clearly Now - Johnny Nash
+California Dreaming - Mama's and the Papa's
+Mrs. Robinson - Simon and Garfunkel
+All You Need is Love - Beatles
+Dr. My Eyes - Jackson Browne
+Crossroads - Cream
+Our House - Crosby, Stills, Nash and Young
+My Back Pages
+Behind Blue Eyes - The Who
+I Can't Tell You Why - Eagles
+Wild World - Cat Stevens
+Crazy Love - Poco
+Evil Ways - Santana
+Harvest Moon - Neil Young
+Keep On Rockin' Me Baby - Steve Miller
+One of These Nights - Eagles
+Refugee - Tom Petty
+Sandman - America
+Seagull
+You're So Vain - Carly Simon
+What I've Already Heard - Mike Fraser
+Under the Milky Way - The Church
+Stray Cat Strut - Stray Cats
+One Way Out - Allman Brothers
+Dreams - Molly Hatchet
+Funk 49 - Joe Walsh
+Cherry, Cherry - Neil Diamond
+Sweet Caroline - Neil Diamond
diff --git a/Songs/Set 1.lst b/Songs/Set 1.lst
deleted file mode 100644 (file)
index 2b7b594..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-Set 1
-Across the Universe - Beatles
-All You Need Is Love - ohn Lennon/Paul McCartney
-Amie - Pure Prairie League
-Breakdown - Tom Petty
-Brown Eyed Girl - Van Morrison
-Country Road - John Denver
-Desperado - The Eagles
-Drugstore Novels - Cast of Shadows
-Fire and Rain - James Taylor
-Fool You Never Knew - Tempest
-Free Fallin - Tom Petty
-Give a Little Bit - Roger Hodgson
-Here Comes the Sun - George Harrison
-Here in Heaven - Mike Fraser
-Hold On - Kansas
-Hotel California - Eagles
-I Can See Clearly Now - Johnny Nash or Jimmy Cliff
-I Still Can't Say Goodbye - Chet Atkins
-I'm Your Captain - Grand Funk Railroad
-Imagine - John Lennon
-Kashmir - Led Zeppelin
-Last Man on Earth - Alice Cooper
-Leather And Lace - Stevie Nicks
-Let It Be - Beatles
-Listen to the Music - Doobie Brothers
-Love Her Madly - Doors
-Lyin' Eyes - Eagles
-Maggie May - Rod Stewart
-Margaritaville - Jimmy Buffett
-Me and Julio Down by the Schoolyard - Paul Simon
-Mother - Pink Floyd
-Mrs. Robinson - Paul Simon
-My Life - Tempest
-Naptime - Jen Hajj
-Nothing can stop us now - Tim Minchin
-Peaceful, Easy Feeling - Eagles
-Piano Man - Billy Joel
-Questions - Moody Blues
-Ramblin' Man - Allman Brothers Band
-Reason to Believe - Tim Hardin (Rod Stewart)
-Santa Monica - Everclear
-Seems Like a Dream - Tempest
-Serenade - Steve Miller
-Sister Golden Hair - America
-Sitting on the Dock of the Bay - Otis Redding
-Space Oddity - David Bowie
-Strong Enough To Win - Mike Fraser
-Swingtown - Steve Miller
-Take It Easy - Eagles
-Turn the Page - Bob Seager
-Voices - Red Shoes For Romeo
-What a Wonderful World - Louis Armstrong
-What I've Already Heard - Mike Fraser
-Where You Take Me - Jen Hajj
-Who'll Stop The Rain - Creedence Clearwater Revival
-You Ain't Seen Nothing Yet - Backman Turner Overdrive
-Young as You - Mike Fraser
-I'm a Believer - Monkees
-Daydream Believer - Monkees
diff --git a/Wed.lst b/Wed.lst
deleted file mode 100644 (file)
index c7d00cf..0000000
--- a/Wed.lst
+++ /dev/null
@@ -1,9 +0,0 @@
-Wed
-Drugstore Novels - Cast of Shadows
-Hey Jude - Beatles
-Suite Judy Blue Eyes - Crosby, Stills and Nash
-Goodbye Yellow Brick Road - Elton John
-The Letter - The Box Tops
-Nowhere Man - Beatles
-Seven Bridges Road - Eagles
-What I've Already Heard - Mike Fraser
diff --git a/web/displayset.php b/web/displayset.php
new file mode 100644 (file)
index 0000000..111c43a
--- /dev/null
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+   "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+  <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+  <title>Songbook Artist</title>
+  <link rel="stylesheet" type="text/css" media="screen" href="/css/Music.css">
+  <link rel="stylesheet" type="text/css" media="print" href="/css/Print.css">
+  <link rel="SHORTCUT ICON" href="http://defaria.com/favicon.ico" type="image/png">
+
+<?php
+include_once "songbook.php";
+$set = $_REQUEST ["set"];
+?>
+
+<style>
+li {
+width: 100%;
+}
+</style>
+</head>
+
+<div class="heading">
+<a href="/songbook"><img src="/Icons/Home.png" alt="Home"></a>
+  <h1 class="centered">Andrew DeFaria's Songbook</h1>
+
+  <h2 class="centered"><?php echo "Set: " . basename ($set, ".lst")?></h2>
+</div>
+
+<div id="content">
+
+<?php
+global $songDir;
+
+print "<ol>";
+
+$firstLine = true;
+
+foreach (file("$songDir/$set") as $line) {
+  // Skip first line which is merely the set name again
+  if ($firstLine) {
+    $firstLine = false;
+    continue;
+  } // if
+
+  if (preg_match ("/(.*)\s+-\s+(.*)/", $line, $matches)) {
+    $song   = trim ($matches[1]);
+    $artist = trim ($matches[2]);
+  } else {
+    $song   = trim ($line);
+    $artist = "";
+  } // if
+
+  if (file_exists ("$songDir/$song.pro")) {
+    print "<li><a href=\"webchord.cgi?chordpro=$song.pro\">";
+    print basename ($song);
+    print "</a>";
+  } else {
+    print "<li>";
+    print basename ($song);
+  }
+
+  if ($artist <> "") {
+    print " - <a href=\"displayartist.php?artist=$artist\">$artist</a>";
+  } // if
+
+  print "</li>";
+} // foreach
+
+print "</okkkl>";
+?>
+
+</body>
+</html>
index 6bb6b32..536929d 100644 (file)
@@ -26,8 +26,6 @@ include_once "songbook.php";
   </tbody>
 </table>
 
-<?php getSongs(); ?>
-
 <div class="heading">
   <h1 class="centered">Andrew DeFaria's Songbook</h1>
 </div>
@@ -42,18 +40,19 @@ Windows. More info on this is available <a href="songbook.html">here</a>. For
 people who must remain with paper...</p>
 
 <p>The following songs are available here. Select an artist or a song and then
-Go or type in a lyric or song title into the search box. You can print the 
+Go or type in a lyric or song title into the search box. You can print the
 result if you wish to have a paper copy. If new songs are added by me or others
-this page will automatically update so you can come back here and get your 
+this page will automatically update so you can come back here and get your
 copy.</p>
 
 <?php
 artistsDropdown();
+setsDropdown();
 songsDropdown();
 ?>
 
 <form method="post" action="search.php" name="search">
-Search:&nbsp;&nbsp;<input type="text" name="searchterm"><input type="submit" value="Search">
+Search:&nbsp;<input type="text" name="searchterm"><input type="submit" value="Search">
 
 </form>
 </body>
index a231add..cbfe933 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 $baseDir = getcwd();
-$songs   = glob (dirname($baseDir) . "/Songs/*.pro");
+$songDir = "/opt/songbook/Songs";
 $debug   = $_REQUEST["debug"];
 
 function debug ($msg) {
@@ -12,16 +12,19 @@ function debug ($msg) {
 } // debug
 
 function getSongs () {
-  global $songs;
+  global $songDir;
 
-  $path = "/opt/songbook/Songs";
-
-  // Why didn't the previous one execute correctly?
-  $songs = glob("$path/*.pro");
+  return glob("$songDir/*.pro");
 } // getSongs
 
+function getSets () {
+  global $songDir;
+
+  return glob("$songDir/*.lst");
+} // getSets
+
 function songsDropdown () {
-  global $songs;
+  $songs = getSongs();
 
   print "<form method=\"get\" action=\"webchord.cgi\" name=\"song\">";
   print "Songs:&nbsp;&nbsp;";
@@ -39,14 +42,13 @@ function songsDropdown () {
     } // if
   } // foreach
 
-  print "<input type=\"submit\" value=\"Go\">";
   print "</select>";
+  print "&nbsp;<input type=\"submit\" value=\"Go\">";
   print "</form>";
 } // songsDropdown
 
 function artistsDropdown () {
-  global $songs;
-
+  $songs = getSongs();
   $artists = getArtists ($songs);
 
   print "<form method=\"get\" action=\"displayartist.php\" name=\"artist\">";
@@ -58,11 +60,31 @@ function artistsDropdown () {
     print "<option>$artist</option>";
   } // foreach
 
-  print "<input type=\"submit\" value=\"Go\">";
   print "</select>";
+  print "&nbsp;<input type=\"submit\" value=\"Go\">";
   print "</form>";
 } // artistsDropdown
 
+function setsDropdown () {
+  $sets = getSets();
+
+  print "<form method=\"get\" action=\"displayset.php\" name=\"set\">";
+  print "Sets:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+  print "<select name=\"set\">";
+
+  sort ($sets);
+  foreach ($sets as $set) {
+    print "Processing set<br>";
+    $title = basename ($set, ".lst");
+
+    print "<option value=\"$title.lst\">$title</option>";
+  } // foreach
+
+  print "</select>";
+  print "&nbsp;<input type=\"submit\" value=\"Go\">";
+  print "</form>";
+} // setsDropdown
+
 function getArtist ($song) {
   $lyrics = file_get_contents ($song);