Fixed bugs with handling of globals
Updated displayset.php to only link artists we know about
Sorted set lists
Andrew's Songs
Across the Universe - Beatles
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
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
Desperado - The Eagles
Drugstore Novels - Cast of Shadows
Fire and Rain - James Taylor
Hold On - Kansas
Hotel California - Eagles
I Can See Clearly Now - Johnny Nash or Jimmy Cliff
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
+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
Kashmir - Led Zeppelin
Last Man on Earth - Alice Cooper
Leather And Lace - Stevie Nicks
Sister Golden Hair - America
Sitting on the Dock of the Bay - Otis Redding
Space Oddity - David Bowie
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
Swingtown - Steve Miller
Take It Easy - Eagles
Turn the Page - Bob Seager
Who'll Stop The Rain - Creedence Clearwater Revival
You Ain't Seen Nothing Yet - Backman Turner Overdrive
Young as You - Mike Fraser
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
-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
Cherry Bomb - John Mellencamp
Eight Miles High - The Bryds
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
-Locomotive Breath - Jethro Tull
-Landslide - Fleetwood Mac
-Jenny Jenny - Tommy Tutone
-Norwegian Wood - Beatles
-Peaceful Easy Feeling - Eagles
-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
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
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
Dust in the Wind - Kansas
-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
+Hold On/Your Move - Triumph/Yes
+Jenny Jenny - Tommy Tutone
+Landslide - Fleetwood Mac
+Let It Be - Beatles
+Locomotive Breath - Jethro Tull
+Lucky Man - ELP
+Norwegian Wood - Beatles
+Nowhere Man - Beatles
+Peaceful Easy Feeling - Eagles
+Pink Houses - John Cougar
+Ramblin' Man - Allman Brothers
+Seven Bridges Road - Eagles
+Sister Golden Hair - America
-Best of My Love - Eagles
+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
-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
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
-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
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
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
+Crossroads - Cream
+Dreams - Molly Hatchet
+Dr. My Eyes - Jackson Browne
Harvest Moon - Neil Young
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
Keep On Rockin' Me Baby - Steve Miller
+Mrs. Robinson - Simon and Garfunkel
+My Back Pages
One of These Nights - Eagles
One of These Nights - Eagles
+One Way Out - Allman Brothers
+Our House - Crosby, Stills, Nash and Young
Refugee - Tom Petty
Sandman - America
Seagull
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
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
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
Turn The Page
Venus
We Can Work it Out
Turn The Page
Venus
We Can Work it Out
+Wild Nights
\ No newline at end of file
+debug ("Processing songs");
+
foreach ($songs as $song) {
foreach ($songs as $song) {
$songArtist = getArtist ($song);
if ($songArtist == $artist) {
$songArtist = getArtist ($song);
if ($songArtist == $artist) {
+global $songDir, $artists;
print basename ($song);
}
print basename ($song);
}
- if ($artist <> "") {
- print " - <a href=\"displayartist.php?artist=$artist\">$artist</a>";
+ print " - ";
+
+ if (in_array ($artist, $artists)) {
+ print "<a href=\"displayartist.php?artist=$artist\">$artist</a>";
+ } else {
+ print $artist;
} // if
print "</li>";
} // foreach
} // if
print "</li>";
} // foreach
$songDir = "/opt/songbook/Songs";
$debug = $_REQUEST["debug"];
$songDir = "/opt/songbook/Songs";
$debug = $_REQUEST["debug"];
+// Initialize music objects
+$songs = getSongs($songDir);
+$sets = getSets($songDir);
+$artists = getArtists($songs);
+
function debug ($msg) {
global $debug;
function debug ($msg) {
global $debug;
-function getSongs () {
- global $songDir;
-
+function getSongs ($songDir) {
return glob("$songDir/*.pro");
} // getSongs
return glob("$songDir/*.pro");
} // getSongs
-function getSets () {
- global $songDir;
-
+function getSets ($songDir) {
return glob("$songDir/*.lst");
} // getSets
function songsDropdown () {
return glob("$songDir/*.lst");
} // getSets
function songsDropdown () {
print "<form method=\"get\" action=\"webchord.cgi\" name=\"song\">";
print "Songs: ";
print "<form method=\"get\" action=\"webchord.cgi\" name=\"song\">";
print "Songs: ";
} // songsDropdown
function artistsDropdown () {
} // songsDropdown
function artistsDropdown () {
- $songs = getSongs();
- $artists = getArtists ($songs);
print "<form method=\"get\" action=\"displayartist.php\" name=\"artist\">";
print "Artists: ";
print "<form method=\"get\" action=\"displayartist.php\" name=\"artist\">";
print "Artists: ";
} // artistsDropdown
function setsDropdown () {
} // artistsDropdown
function setsDropdown () {
print "<form method=\"get\" action=\"displayset.php\" name=\"set\">";
print "Sets: ";
print "<form method=\"get\" action=\"displayset.php\" name=\"set\">";
print "Sets: ";
} // getArtist
function getArtists ($songs) {
} // getArtist
function getArtists ($songs) {
foreach ($songs as $song) {
$artist = getArtist ($song);
foreach ($songs as $song) {
$artist = getArtist ($song);
return array_keys ($artists);
} // getArtists
return array_keys ($artists);
} // getArtists
-function formatTable ($songs) {
- echo "<ol>";
-
- foreach ($songs as $song) {
- $artist = getArtist ($song);
-
- $title = basename ($song, ".pro");
-
- echo "<li><a href=\"webchord.cgi?chordpro=$song\">$title</a>";
-
- if ($artist != "") {
- echo " ($artist)";
- } // if
- } // foreach
-
- echo "</ol>";
-} // formatTable