<?php	
	if($server) {
		$connection = mysql_select_db($PHORUM['DatabaseName'], $server); 
	}
?>

<tr><td colspan=4 align=right valign=top>
	<table><tr>
		<td valign=top>
			<a href="javascript:openwindowlink('<topicid>', '<topicname>')"><img src="forums-tny.gif" border=0 width=21 height=15"></a>
		</td>
		<td valign=top>&nbsp;<a href="JavaScript:openwindowlink('<topicid>', '<topicname>')">Comment on the above topic</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br></td>
	</tr></table>
</td></tr>

<tr><td><table cellpadding=5><tr><td rowspan=1000>&nbsp;&nbsp;</td></tr>
<?
	$result = mysql_query("SELECT * from COMMENTS where TOPIC_ID='<topicid>' ORDER BY exactdate");		
	
	if(@mysql_num_rows($result)) {
		$currow = 0;
		while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
			$name = $row[2];
			$email = $row[3];
			if(strlen($email) > 0) {
				$name = "<a href='mailto:$email'><font color='AAAAAA'><u>$name</u></font></a>";
			}
      printf ("<tr><td colspan=4><font color='AAAAAA'><i>Comment from %s on %s</i></font><br><font color='888888'>%s</font><br></td></tr>", $name, $row[1], $row[5]);  
      
      $currow = $currow + 1;
      if($currow >= 10) break;
	  }
	}
?>
</table></td></tr>
