From: Andrew DeFaria Date: Wed, 7 Jun 2017 04:40:32 +0000 (-0700) Subject: New version X-Git-Url: https://defaria.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=674da66f3a92ece352779909a33494d30cf9c869;p=songbook.git New version Fixed bugs with handling of globals Updated displayset.php to only link artists we know about Sorted set lists --- diff --git a/Songs/Andrew's Songs.lst b/Songs/Andrew's Songs.lst index b3bf2d9..c27e951 100644 --- a/Songs/Andrew's Songs.lst +++ b/Songs/Andrew's Songs.lst @@ -1,10 +1,11 @@ Andrew's Songs Across the Universe - Beatles -All You Need Is Love - ohn Lennon/Paul McCartney +All You Need Is Love - Beatles Amie - Pure Prairie League Breakdown - Tom Petty Brown Eyed Girl - Van Morrison Country Road - John Denver +Daydream Believer - Monkees Desperado - The Eagles Drugstore Novels - Cast of Shadows Fire and Rain - James Taylor @@ -16,9 +17,10 @@ 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 +I'm a Believer - Monkees Imagine - John Lennon +I'm Your Captain - Grand Funk Railroad +I Still Can't Say Goodbye - Chet Atkins Kashmir - Led Zeppelin Last Man on Earth - Alice Cooper Leather And Lace - Stevie Nicks @@ -45,7 +47,7 @@ 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 +Strong Enough to Win - Mike Fraser Swingtown - Steve Miller Take It Easy - Eagles Turn the Page - Bob Seager @@ -56,5 +58,3 @@ 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/Herb Medley.lst b/Songs/Herb Medley.lst index 75a9521..49c6c88 100644 --- a/Songs/Herb Medley.lst +++ b/Songs/Herb Medley.lst @@ -1,7 +1,7 @@ Herb Medley -Panama Red - New Riders of the Purple Sage -One Toke Over the Line - Brewer and Shipley -Last Dance with Mary Jane - Tom Petty Cherry Bomb - John Mellencamp -Mellow Yellow - Donovan Eight Miles High - The Bryds +Last Dance with Mary Jane - Tom Petty +Mellow Yellow - Donovan +One Toke Over the Line - Brewer and Shipley +Panama Red - New Riders of the Purple Sage diff --git a/Songs/KARR.lst b/Songs/KARR.lst index 8264c4b..2996dc6 100644 --- a/Songs/KARR.lst +++ b/Songs/KARR.lst @@ -1,47 +1,47 @@ KARR -Locomotive Breath - Jethro Tull -Landslide - Fleetwood Mac -Jenny Jenny - Tommy Tutone -Norwegian Wood - Beatles -Peaceful Easy Feeling - Eagles +All Right Now - Free Angel -The Letter - Joe Cocker -Sweet Melisa - Allman Brothers +Badge +Best of My Love - Eagles +Blackbird - Beatles +Bring It on Home Can't find My Way Home - Steve Windwood -Wish You Were Here - Pink Floyd -From the Beginning - ELP +Can't You See - Marshall Tucker +Casey Jones - Grateful Dead 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 +From the Beginning - ELP Gold Dust Woman +Hold On/Your Move - Triumph/Yes +Jenny Jenny - Tommy Tutone +Landslide - Fleetwood Mac +Let It Be - Beatles +Locomotive Breath - Jethro Tull +Lucky Man - ELP Lying Eyes - Eagles +Norwegian Wood - Beatles +Nowhere Man - Beatles Panama Red +Peaceful Easy Feeling - Eagles +Pink Houses - John Cougar +Ramblin' Man - Allman Brothers +Seven Bridges Road - Eagles +Sister Golden Hair - America Something - Beatles -Best of My Love - Eagles Southern Cross +Space Oddity - David Bowie +Stuck in the Middle With You - Stealers Wheel +Suite Judy Blue Eyes - Crosby, Stills and Nash +Sweet Melisa - Allman Brothers +Take It Easy - Eagles +Tequila Sunrise - Eagles +The Letter - Joe Cocker 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 +Turn the Page - Bob Segar Under the Boardwalk - Drifters -Bring It on Home -Hold On/Your Move - Triumph/Yes +Ventura Highway - America +Wagon Wheel - Darius Rucker +What I Like About You - Romantics +Wild Nights - Van Morrison +Wish You Were Here - Pink Floyd diff --git a/Songs/New Songs.lst b/Songs/New Songs.lst index 84c84d8..94a3c0a 100644 --- a/Songs/New Songs.lst +++ b/Songs/New Songs.lst @@ -1,29 +1,29 @@ New Songs -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 +California Dreaming - Mama's and the Papa's +Cherry, Cherry - Neil Diamond Crazy Love - Poco +Crossroads - Cream +Dreams - Molly Hatchet +Dr. My Eyes - Jackson Browne Evil Ways - Santana +Funk 49 - Joe Walsh Harvest Moon - Neil Young +I Can See Clearly Now - Johnny Nash +I Can't Tell You Why - Eagles Keep On Rockin' Me Baby - Steve Miller +Mrs. Robinson - Simon and Garfunkel +My Back Pages One of These Nights - Eagles +One Way Out - Allman Brothers +Our House - Crosby, Stills, Nash and Young 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 +Under the Milky Way - The Church +What I've Already Heard - Mike Fraser +Wild World - Cat Stevens +You're So Vain - Carly Simon diff --git a/Songs/RickSet.lst b/Songs/RickSet.lst index 989fccd..451f3b7 100644 --- a/Songs/RickSet.lst +++ b/Songs/RickSet.lst @@ -34,4 +34,4 @@ Tuesday Afternoon Turn The Page Venus We Can Work it Out -Wild Nights +Wild Nights \ No newline at end of file diff --git a/web/displayartist.php b/web/displayartist.php index a99fb5e..1e40ccd 100644 --- a/web/displayartist.php +++ b/web/displayartist.php @@ -24,9 +24,14 @@ $artist = $_REQUEST ["artist"];
"; @@ -61,14 +61,18 @@ foreach (file("$songDir/$set") as $line) { print basename ($song); } - if ($artist <> "") { - print " - $artist"; + print " - "; + + if (in_array ($artist, $artists)) { + print "$artist"; + } else { + print $artist; } // if print ""; } // foreach -print ""; +print ""; ?> diff --git a/web/songbook.php b/web/songbook.php index cbfe933..113af43 100644 --- a/web/songbook.php +++ b/web/songbook.php @@ -3,6 +3,11 @@ $baseDir = getcwd(); $songDir = "/opt/songbook/Songs"; $debug = $_REQUEST["debug"]; +// Initialize music objects +$songs = getSongs($songDir); +$sets = getSets($songDir); +$artists = getArtists($songs); + function debug ($msg) { global $debug; @@ -11,20 +16,16 @@ function debug ($msg) { } // if } // debug -function getSongs () { - global $songDir; - +function getSongs ($songDir) { return glob("$songDir/*.pro"); } // getSongs -function getSets () { - global $songDir; - +function getSets ($songDir) { return glob("$songDir/*.lst"); } // getSets function songsDropdown () { - $songs = getSongs(); + global $songs; print "
"; print "Songs:  "; @@ -48,8 +49,7 @@ function songsDropdown () { } // songsDropdown function artistsDropdown () { - $songs = getSongs(); - $artists = getArtists ($songs); + global $artists; print ""; print "Artists:  "; @@ -66,7 +66,7 @@ function artistsDropdown () { } // artistsDropdown function setsDropdown () { - $sets = getSets(); + global $sets; print ""; print "Sets:     "; @@ -96,8 +96,6 @@ function getArtist ($song) { } // getArtist function getArtists ($songs) { - $artists = array(); - foreach ($songs as $song) { $artist = getArtist ($song); @@ -109,20 +107,3 @@ function getArtists ($songs) { return array_keys ($artists); } // getArtists -function formatTable ($songs) { - echo "
    "; - - foreach ($songs as $song) { - $artist = getArtist ($song); - - $title = basename ($song, ".pro"); - - echo "
  1. $title"; - - if ($artist != "") { - echo " ($artist)"; - } // if - } // foreach - - echo "
"; -} // formatTable