if ($board==0 && !($board=="")) Header ("Location: http://www.lyricfind.com/requestboard.php3?requestid=$id"); require "common.php3"; $lefthead[0]="Search LyricFind"; $leftbody[0]=$commonsearch; $lefthead[1]="Listings"; $leftbody[1]=$commonlist; require "db2con.php"; print gettop("Message Boards",$lefthead,$leftbody); ################## PRINTMESSAGE ###################### ####### prints each message ####### showbar displays reply info function printmessage ($obj,$showbar=1) { global $board, $debug; $time=strftime("%b %d, %Y @ %T EST",$obj->time); if ($showbar) { $count=$obj->ccount; $mtime=time()-$obj->mtime; if ($mtime < 60) { $mtime=floor($mtime); $plu= ($mtime=="1"?"":"s"); $lasttime= "(Last reply: $mtime second$plu ago) "; } elseif ($mtime < 3600) { $mtime=floor($mtime/60); $plu= ($mtime=="1"?"":"s"); $lasttime= "(Last reply: $mtime minute$plu ago) "; } else { $mtime=floor($mtime/3600); $plu= ($mtime=="1"?"":"s"); $lasttime= "(Last reply: $mtime hour$plu ago) "; } if ($count==1) $punc="y"; else $punc="ies"; if ($count) { $link="id\">View Repl$punc | "; } else { $link=""; $lasttime=""; } } $obj->comment=nl2br($obj->comment); if ($obj->userid>0) { $queryu="select login, vis from users where id='$obj->userid'"; $resultu=mysql_query($queryu); if ($obju=mysql_fetch_object($resultu)) { $obj->name=$obju->login; $obj->email=$obju->vis; } } if (!($obj->email=="")) $email=" (email\">$obj->email)"; if ($obj->admin) $staff=" (STAFF)"; print "
| "; if ($showbar==1) print "id \">$obj->subject"; else print "$obj->subject "; print " by $obj->name$email$staff | $time | \n
| $obj->comment | |
| [ $count Repl$punc $lasttime| $linkid \">Reply To This Message$extra] | |
| $count repl$punc to this message [ id\">Post a reply | Return ] | |
| "; while ($obj=mysql_fetch_object($result)) { printmessage($obj,0); } print " |
Threaded Messageboards:
";
$query="select b.*, count(m.id) as num from boardtypes b, messageboard m where b.boardid=m.boardid and site=0 group by b.boardid order by b.boardid";
$result=mysql_query($query);
print mysql_error();
$obj=mysql_fetch_object($result);
$rbout= "
Request Board
$obj->description
";
while ($obj=mysql_fetch_object($result))
{
print "
boardid\">$obj->boardname [$obj->num messages]
$obj->description
";
}
print $rbout;
print "
Other Discussions:
";
$query="select count(*) as num from comments where id < 0 and site=0";
$result=mysql_query($query);
$obj=mysql_fetch_object($result);
print "Voting Booth [$obj->num messages]";
$timeoffset=time()- 604800;
$query="select artists.artist, comments.id, song, count(*) as num from comments, lyrics, artists where lyrics.id=comments.id
and lyrics.artistid=artists.artistid and comments.time > $timeoffset and site=0 group by comments.id order by num desc limit 5";
$result=mysql_query($query);
#print "
Most Recently Popular Song Discussions:
";
#while($obj=mysql_fetch_object($result))
#{
# print "
$obj->artist - id\">$obj->song [$obj->num recent messages]";
#}
#print "
All-Time Most Popular Song Discussions:
";
#$query="select artists.artist, comments.id, song, count(*) as num from comments, lyrics, artists where lyrics.id=comments.id and site=0
#and lyrics.artistid=artists.artistid group by comments.id order by num desc limit 5";
#$result=mysql_query($query);
#while($obj=mysql_fetch_object($result))
#{
# print "
$obj->artist - id\">$obj->song [$obj->num messages]";
#}
}
print getbottom();
?>