Code:
<?
// Main.php by Rogean
require('forums/config.php');
mysql_connect($dbhost, $dbuser, $dbpasswd);
@mysql_select_db("$dbname")or die(mysql_error());
//GET FORUM NEWS
$getnews=mysql_query("SELECT topic_id,forum_id,topic_title,topic_poster,topic_time,topic_views,topic_replies,topic_first_post_id FROM phpbb_topics WHERE forum_id='11' ORDER by topic_time DESC LIMIT 4");
while(list($topic[id],$forum[id],$topic[title],$topic[poster],$topic[time],$topic[views],$topic[replies],$topic[firstpostid])=mysql_fetch_row($getnews)){
$newsbody=mysql_query("SELECT * FROM phpbb_posts_text WHERE post_id=$topic[firstpostid]");
$text=mysql_fetch_array($newsbody);
$userinfo=mysql_query("SELECT * FROM phpbb_users WHERE user_id=$topic[poster]");
$user=mysql_fetch_array($userinfo);
$text[post_text]=str_replace("\n", "<br>", $text[post_text]);
$text[post_text]=str_replace("[b]", "<b>", $text[post_text]);
$text[post_text]=str_replace("[/b]", "</b>", $text[post_text]);
$text[post_text]=str_replace("[i]", "<i>", $text[post_text]);
$text[post_text]=str_replace("[/i]", "</i>", $text[post_text]);
$text[post_text]=str_replace("&lt;", "<", $text[post_text]);
$text[post_text]=str_replace("&gt;", ">", $text[post_text]);
echo "<div class=\"content\">
<span class=\"title\">$text[post_subject]</span><br>
<font size=1>Posted by: $user[username] :: $topic[replies] Replies :: $topic[views] Views<br><br>
$text[post_text]
</div>
<hr width=80% color=darkblue align=left>";
}
?>