if (strtoupper(getenv("HTTP_HOST")) == "EMP3.LYRICFIND.COM") $site="eMP3Finder";
##print "$site
$REQUEST_URI";
if (strlen($artistid)==0) {
$myPath=explode("/",getenv("REQUEST_URI"));
$artistid=$myPath[2];
}
else {
Header("Location: http://www.lyricfind.com/artists/$artistid/");
exit;
}
require "rw-mp3.php3";
if ($site=="") {
include "common.php3";
$site="LyricFind";
$siteid=0;
}
elseif (substr($site,0,8)=="RapLyrix") {
include "raplyrix/common.php3";
$site="RapLyrix";
$siteid=1;
}
else {
include "ecommon.php3";
$site="eMP3Finder";
$siteid=2;
}
$query="select artistid, artist from artists where artists.artistid=$artistid";
$result=mysql_query($query);
if ($result)
{
if ($obj=mysql_fetch_object($result)){
#$queryr="select reviews.id, title from reviews where substring(refid,1,1)='R' and substring(refid,2)=$artistid";
$queryr="select reviews.id, title from reviews, lyrics where ((substring(refid,1,1)='L' and substring(refid,2)=albumid)
or (substring(refid,1,1)='R' and substring(refid,2)=$artistid)) and
lyrics.artistid=$artistid group by reviews.id";
$resultr=mysql_query($queryr);
print mysql_error();
if (mysql_num_rows($resultr)) { $righthead[0]="Reviews"; $isreview=1; } else { $isreview=0; }
while ($objr=mysql_fetch_object($resultr)) {
$rightbody[0].="
id/\">$objr->title";
}
$query= "select albums.albumid as albumid, album from albums, lyrics where lyrics.albumid=albums.albumid and lyrics.artistid=$artistid
group by albums.albumid order by album";
$result2=mysql_query($query);
if ($result2)
{
$body2=$body2."$obj->artist";
if ($siteid==0 && $isreview) $body2.= "| ".sidebox($righthead,$rightbody,160,"001A82","")." |
|
";
while ($obj2=mysql_fetch_object($result2)) {
if ($obj2->albumid==1)
$body2=$body2."Album Not Available";
else
$body2=$body2."Songs from \"albumid/>$obj2->album\" by $obj->artist";
$query3="select song, id from lyrics where artistid=$artistid and albumid=$obj2->albumid order by song";
$result3=mysql_query($query3);
while ($obj3=mysql_fetch_object($result3)) {
$body2.= "- id>$obj3->song";
}
if ($obj2->albumid>1) {
$query="select 1 from lyrics where albumid=$obj2->albumid and artistid<>$artistid";
$result4=mysql_query($query);
if (mysql_num_rows($result4) )
$body2.="
albumid/
\">>>Other songs from this album";
}
$body2=$body2."
";
}
}
$body=$body2;
$found=1;
$query="select artist, links.artistid from links, artists where mainartistid=$obj->artistid and links.artistid=artists.artistid
order by artist";
$result=mysql_query($query);
if (mysql_num_rows($result)) {
$lefthead[2]= "See Also...";
while ($obj3=mysql_fetch_object($result)) {
$leftbody[2].= "- artistid/\">$obj3->artist";
}
$leftbody[2].="
";
}
$query="select links.mainartistid as artistid from links, artists where links.artistid=$obj->artistid and
links.artistid=artists.artistid";
$result=mysql_query($query);
if (mysql_num_rows($result)) {
$lefthead[2]= "See Also...";
while ($obj3=mysql_fetch_object($result)) {
$query="select artist from artists where artistid=$obj3->artistid";
$result4=mysql_query($query);
if ($obj4=mysql_fetch_object($result4)) {
$leftbody[2].= " - artistid/\">$obj4->artist";
}
}
$leftbody[2].="
";
}
else $found=1;
}
else $found=0;
}
####################DISPLAY GOES HERE##################
if ($found)
{
$leftbody[0]=$commonsearch;
$lefthead[0]="Search $site";
$leftbody[1]=$commonlist;
$lefthead[1]="Listings";
print gettop("$obj->artist Lyrics",$lefthead,$leftbody);
print "$body";
print getbottom();
}
else
{
$leftbody[2]="Artist Not Found";
$lefthead[2]="Artist Not Found";
print gettop("Artist Not Found",$lefthead,$leftbody);
print "Sorry, that artist id was not found in the database
Return to LyricFind";
print getbottom();
}
?>