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 "\n
"; if ($showbar==1) print "id \">$obj->subject"; else print "$obj->subject "; print " by $obj->name$email$staff

$time

"; if ($showbar==1) print " "; elseif ($showbar==2) print ""; print "
$obj->comment
[ $count Repl$punc $lasttime| $linkid \">Reply To This Message$extra]
$count repl$punc to this message
[ id\">Post a reply | Return ]

"; } if ($board) { if ($page=="") $page=1; $start=$page*20-20; $end=$start+21; if ($order=="") $order="first"; $queryorder="m.time desc"; if ($order=="last") { $queryorder="mtime desc, m.time desc"; $ordermessage = "Last Reply"; } if ($order=="first") { $ordermessage = "Thread Start"; } if ($id) { $query="select m.*, count(n.id) as ccount from messageboard m left join messageboard n on m.id=n.parentid where m.boardid=$board and m.id=$id and m.site=0 group by m.id"; $result=mysql_query($query); if (!$result) { print "Invalid message"; return; } if (!mysql_num_rows($result)) { print "No message found"; return; } printmessage ($obj=mysql_fetch_object($result),2); $query="select messageboard.* from messageboard where boardid=$board and parentid=$obj->id and site=0 order by time"; $result=mysql_query($query); print "
 "; while ($obj=mysql_fetch_object($result)) { printmessage($obj,0); } print "
"; } else { $query="select m.*, ifnull(max(n.time),m.time) as mtime, count(n.id) as ccount from messageboard m left join messageboard n on m.id=n.parentid where m.site=0 and m.boardid=$board and (m.parentid is null) group by m.id order by $queryorder limit $start,21"; $result=mysql_query($query); print mysql_error(); if (!$result) { print "Invalid board"; return; } $query="select * from boardtypes where boardid=$board"; $result2=mysql_query($query); $obj2=mysql_fetch_object($result2); print "
$obj2->boardname Message Board
[ Post A Message | Other Boards ]


"; print "Sorting by: ["; if ($order=="last") print ""; print " Thread Start"; print " |"; if ($order=="first") print ""; print " Last Reply"; print " ]

"; $i=1; while ($obj=mysql_fetch_object($result)) { if ($i==21) $nextpage="Next Page"; else printmessage($obj); $i+=1; } if ($page>1) $prevpage="Previous Page"; print "
$prevpage      $nextpage


"; } } else { print "
Welcome to LyricFind.com's Message Boards

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(); ?>