<?php
if (! defined ( 'BLOCK_FILE' )) {
	if (function_exists ( "location" ))
		location ( "../index.php" );
	else
		die ();
	exit ();
}
global $tracker_lang;
$blocktitle = $tracker_lang ['forum_last_messages'];
$res = sql_query ( "SELECT title, postid, userid, username FROM forum.post LIMIT 15" ) or sqlerr ( __FILE__, __LINE__ );
$num = mysql_num_rows ( $res );

If (! $num) {
	$content = "<center>" . $tracker_lang ['no_messages'] . "</center>";
} else {
	$content = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\"><td align=\"center\" class=\"embedded\">
<table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"10\ padding-bottom=\"0\">

<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">
  <tr>
    <td width=\"33%\" align=\"center\" style=\"border: none;\" valign=\"top\">
    <table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\"><tr><td class=colhead colspan=3 align=\"center\" width=\"100%\">" . $tracker_lang ['messages'] . "</td></tr><tr><td align=\"left\">" . $tracker_lang ['subject'] . "</td><td align=\"center\">" . $tracker_lang ['news_poster'] . "</td></tr>";
	
	while ( $row = mysql_fetch_assoc ( $res ) ) {
		$subject = $row ["title"];
		$t = $row ["postid"];
		$userid = $row ["userid"];
		$username = $row ["username"];
		$content .= "<tr><td><a class=online href=\"forum_folder/showthread.php?t=$t\">$subject</a></td><td><a href=\"forum_folder/member.php?u=$userid\">$username</a></td></tr>";
	}
	
	$content .= "</table>
</td></table></table>";
}
?>