#!/usr/local/bin/perl
require "/home/roger/lib/weblib.lib";
#use DB_File;
@PATH_INFO=split(m#/#,$ENV{PATH_INFO});
$db=shift(@PATH_INFO);
$db=shift(@PATH_INFO);
$ENV{PATH_INFO}=join("/",@PATH_INFO);
$ENV{PATH_INFO}="/$ENV{PATH_INFO}" if $ENV{PATH_INFO};
if($db && -f "/home/todd/db/${db}notes.db"){
	dbmopen(%TAPE,"/home/todd/db/$db",0644);
	dbmopen(%NOTES,"/home/todd/db/${db}notes",0644);
	dbmopen(%INDEX,"/home/todd/db/${db}index",0644);
}
else{
	&htmlopen("Todd Trader Network|");
	print <<EOF;
<center><table><tr>
<td><img src=/~todd/pictures/onionhead-l.jpg></td>
<td><h1>Todd Trader Network</h1></td>
<td><img src=/~todd/pictures/onionhead-r.jpg></td>
</tr></table></center>
You are witnessing the evolution of the Todd Trader Network. Right now, only one
offering is available. Check out "<a href=/todd/trade/arogers>Anthony Rogers'
Tape List</a>."
<p>
If you have Todd Rundgren/Utopia/Nazz related items for trade contact me at <a
href=mailto:roger\@rocemabra.com>roger\@rocemabra.com</a>
to get listed.
EOF
&htmlclose;
exit;
}
&ReadParse;
&htmlopen($NOTES{"CONFIG%%TITLE"}."|");
print <<EOF;
<form action=$weblib::URL/$db method=POST>
<center><table><tr>
<td><img src=/~todd/pictures/onionhead-l.jpg></td>
<td><h1>$NOTES{"CONFIG%%TITLE"}</h1></td>
<td><img src=/~todd/pictures/onionhead-r.jpg></td>
<tr><th colspan=3>Search: <input name=Search size=60></th></tr>
<tr><td colspan=3 align=center>Words or Phrases, separated by commas</td></tr>
</tr></table></center>
</form>
EOF
if($S=$in{Search}){
	@terms=split(/,\s*/,$S);
	foreach $term(@terms){
		@keys=();
		($first,$remain)=split(/\s+/,$term,2);
		push(@keys,split(/%/,$INDEX{"\U$first"}));
		%keys=map{$_,1}@keys;
		@keys=sort keys %keys;
		foreach $key(@keys){
			($range,$date,$text,$time,$quality)=split(/%%/,$TAPE{$key});
			if($text!~/\b$term/i){delete $keys{$key};}
		}
		@keys=sort keys %keys;
		print "<center><table><caption><h2>$term</h2></caption>\n";
		if(@keys){
			foreach $key(sort @keys){
				($range,$date,$text,$time,$quality)=split(/%%/,$TAPE{$key});
				$text=~s#ABOVE:(\d+)#<a href=$weblib::URL/$db/\1>ABOVE</a>#;
				if($NOTES{"NOTE%%$key"}){
					$date="<a href=$weblib::URL/$db/${key}>$date</a>";
				}
			print "<tr><td>$date</td><td>$text</td><td>$time</td><td>$quality</td></tr>\n";
			}
		}
		else{print "<tr><th>No tapes found</th></tr>\n";}
		print "</table></center>\n";
	}
	print "<center><a href=$weblib::URL/$db>Return to Main Index</a></center>\n";
}
elsif($ENV{PATH_INFO}=~m#/(\d{10})#){
	$key=$1;
	($range,$date,$text,$time,$quality)=split(/%%/,$TAPE{$key});
	print "<center><table>\n";
	print "<tr><td>$date</td><td>$text</td><td>$time</td><td>$quality</td></tr>\n";
	print "</table></center>\n";
	print $NOTES{"NOTE%%$key"},"\n";
print "<center><a href=$weblib::URL/$db>Return to Main Index</a></center>\n";
}
elsif($ENV{PATH_INFO}=~m#/(\d{4})#){
$year=$1;
$yearprint=$year eq "0000"?"Unknown":$year eq "9999"?"Various":$year;
print "<center><table><caption>$yearprint</caption>\n";
foreach $key(sort keys %TAPE){
	($range,$date,$text,$time,$quality)=split(/%%/,$TAPE{$key});
	last if $key gt $year."999999";
	next unless $key=~/^$year/;
	$text=~s#ABOVE:(\d+)#<a href=$weblib::URL/$db/\1>ABOVE</a>#;
	if($NOTES{"NOTE%%$key"}){
		$date="<a href=$weblib::URL/$db/${key}>$date</a>";
	}
	print "<tr><td>$date</td><td>$text</td><td>$time</td><td>$quality</td></tr>\n";
}
print "</table></center>\n";
print "<center><a href=$weblib::URL/$db>Return to Main Index</a></center>\n";
}
elsif($ENV{PATH_INFO}=~m#/([ABCDF][mp]?)#){
	$grade=$1;
	$caption=$grade;
	$caption=~s/m/-/;
	$caption=~s/p/+/;
	print "<center><table><caption>$caption</caption>\n";
	$tapes=0;
	foreach $key(sort keys %TAPE){
		($range,$date,$text,$time,$quality)=split(/%%/,$TAPE{$key});
		$quality=~s/ *//;
		$sign=substr($quality,1,1);
		$gradetest=substr($quality,0,1).($sign eq "+"?"p":$sign eq "-"?"m":"");
		next unless $grade eq $gradetest;
		$tapes=1;
		$text=~s#ABOVE:(\d+)#<a href=$weblib::URL/$db/\1>ABOVE</a>#;
		if($NOTES{"NOTE%%$key"}){
			$date="<a href=$weblib::URL/$db/${key}>$date</a>";
		}
		print "<tr><td>$date</td><td>$text</td><td>$time</td><td>$quality</td></tr>\n";
	}
	print "<tr><th>No tapes in this category</td></tr>\n" unless $tapes;
	print "</table></center>\n";
	print "<center><a href=$weblib::URL/$db>Return to Main Index</a></center>\n";
}
else{
	foreach $key(sort keys %TAPE){
		($year)=unpack("a4",$key);
		$year{$year}++;
	}
	foreach $year(sort keys %year){
		$line="<A href=$weblib::URL/$db/$year>";
		if($year eq "0000"){$line.="Unknown";$col=4;}
		elsif($year eq "9999"){$line.="Various";$col=4;}
		else{$line.="$year";$col=int(($year-1900)/10)-6;}
		$s=$year{$year}==1?"":"s";
		$line.="</a> - $year{$year} selection$s<br>\n";
		$col[$col].=$line;
	}
	print "<center><table><tr>\n";
	foreach $heading("Sixties","Seventies","Eighties","Nineties","Other"){
		print "<th>$heading</th>\n";
	}
	print "</tr>\n";
	print "<tr>\n<td>",join("</td>\n<td>",@col),"</td>\n</tr></table></center>\n";
}
print $NOTES{"CONFIG%%TEXT"};
&htmlclose;
__END__
print <<EOF;
<center><h1>Ratings</h1>
<table>
EOF
while(<DATA>){
chop;
($grade,$explain)=split(/\t/);
$grade=~s/ *//;
$sign=substr($grade,1,1);
$gradelink=substr($grade,0,1).(($sign eq "+")?"p":($sign eq "-"?"m":""));
print "<tr><td><a href=$weblib::URL/$db/$gradelink>$grade</a></td>";
print "<td>$explain</td></tr>\n";
}
print <<EOF;
</table></center>
<p>
These ratings are a result of my impression of: 
<ol>
<li>Overall sound quality 
<li>Volume level and condition
</ol>
<center><h1>General B.S.</h1></center>
As you know, all ratings are subjective. If you are interested or have
questions, etc. please feel free to contact me at the address or phone
listed below. I prefer to trade even up, but am willing to trade for
blanks, copy, etc... as long as it's fair. I want to make it clear that
I do not, never have and never will sell any item on this list. I prefer
to receive TDK SA90s or Maxell XLIIs and always send tapes out on these
but if unavailable: like quality. Please refrain from sending tapes
longer than 90 minutes. As for video, I do have a good bit, but I cannot
dub at the present time. I also have a large amount of collectibles
(LPs, etc by related bands that Todd played on or produced, solo albums,
posters, etc) I make it my policy (as do most other honorable folks) not
to copy anything that is available in the stores or on PatroNet.
This, in effect, helps
to protect the income flow to the main man. If you want to trade or sell
other items (45s, LPs, posters, etc.), I would welcome your list of these
as well. I am always looking to expand the above list and my collection
in general with quality stuff. Hope to hear from you soon. I am looking
for a copy of Special Interest 45. Please help, thanks.
<p>
This list is effective as of 12/2/1998.
<p>
Email : <a href=mailto:arogers1\@mindspring.com>arogers1\@mindspring.com</a><br>
ANTHONY ROGERS:  RT 4 BOX 204  KEYSER WV 26726 304 788 2753
EOF
A 	Perfect quality from the source, no audiences, no cuts/splices
A-	Excellent, near perfect, clear, good depth, few gens away
B+	Very solid top quality tape, minor imperfections,if any
B 	Good, well above average sound quality (excellent audience)
B-	Above average w/a few flaws in factors below (good audience)
C+	Decent, listenable, more serious flaws (average audience tape)
C 	Most are audience, still listenable w/perhaps muddy sound, etc
C-	Almost exclusively audience, big flaws, can be painful at times
D+	Identifiable only b/c we know how it should go; won't get converts
D 	Merely a place holder, almost not worth the tape it's on
D-	Worthless with some moments of illusion or sentimental value
F 	No excuse-could be Todd or anyone?-we can't tell by listening
