<?
/*** phpBB3 - Last Active Topics System ***/
//Author: Ioan Filipov
//Email: jonidev@gmail.com
//Date: 04.06.2007
//------------------------------
//Edit these parameters:
//MySQL server adress
$host="localhost";
//Username
$user="";
//Password
$pass="";
//Database
$db="";
//Table prefix
$table="phpbb3_";
//Show last x topics
$laforums="10";
$link=mysql_connect($host, $user, $pass);
$db=mysql_select_db($db);
$query="select * from $table".topics." WHERE topic_approved = '1' order by topic_last_post_time desc limit 0,$laforums";
$query2="select config_name,config_value from $table".config." where config_name = 'server_name' limit 0,1";
$result2=mysql_query($query2);
$row2 = mysql_fetch_array($result2);
extract($row2);
$result=mysql_query($query);
while ($row=mysql_fetch_array($result)) {
extract($row);
$date = date("d.m.Y", $topic_last_post_time );
echo "<a href='http://".$config_value."/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='_blank'>".$topic_title."</a> view: ".$topic_views.", replies: ".$topic_replies.", topic first poster: ".$topic_first_poster_name.", topic last poster: ".$topic_last_poster_name.", topic last post time: ".$date."<br>\n";
}
//-------------------------- END
?>