=================================================================== RCS file: /cvs/mp3/bin/showall.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mp3/bin/showall.pl 2006/08/12 01:14:53 1.2 +++ mp3/bin/showall.pl 2007/02/08 20:04:03 1.3 @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# $RedRiver$ +# $RedRiver: showall.pl,v 1.2 2006/08/12 00:14:53 andrew Exp $ ######################################################################## # showall.pl *** Displays all MP3's in all subdirs # @@ -13,7 +13,6 @@ #my qw/ %mp3s %dirs /; my $basedir = '/home/mp3/Sorted'; -my $subdir = $ENV{'QUERY_STRING'}; my $addurl = 'addmp3playlist.pl'; my $countdir = 0; @@ -22,12 +21,19 @@ # *** MAIN *** ####################################################################### -if ($subdir) { - $subdir =~ s/%(..)/pack("c",hex($1))/ge; +my ($prefix, $subdir) = split /\&/, $ENV{'QUERY_STRING'}; +if ($subdir) { + $subdir =~ s/%(..)/pack("c",hex($1))/ge; } else { - $subdir =''; + $subdir =''; } +if ($prefix) { + $prefix =~ s/%(..)/pack("c",hex($1))/ge; +} else { + $prefix =''; +} + #$basedir = $basedir . "/" . $subdir; print "Content-Type: text/html\n\n"; @@ -39,8 +45,10 @@ if ($subdir) { print "

"; SplitDir($subdir); - print " - All"; - print " - Add
"; + print " - Show"; + print " - Play"; + print " - Approve" if $prefix; + print "
"; print "

\n"; print "
\n"; } @@ -61,7 +69,7 @@ # my $count; # my @sorted = sort { lc($dirs{$a}) cmp lc($dirs{$b}) } (keys %dirs); # foreach my $dir (@sorted) { -# print "$dirs{$dir}
"; +# print "$dirs{$dir}
"; # $count++; # } # print "Total dirs displayed: $count

\n"; @@ -73,7 +81,7 @@ # my $count; # foreach my $mp3dir (sort keys %mp3s) { # foreach $mp3 (@{ $mp3s{$mp3dir} }) { -# print "\t

  • Song: $mp3
  • \n"; +# print "\t
  • Song: $mp3
  • \n"; # $count++; # } # } @@ -106,9 +114,11 @@ print "\n"; @@ -208,7 +218,7 @@ for ($j=0;$j<=$i;$j++) { $url = "$url/$filename[$j]"; } - print "/$filename[$i]"; + print "/$filename[$i]"; } } else {