Code: Select all
<?
/*** phpBB3 - Last Active Topics System ***/
//Author: Ioan Filipov
//Email: [email protected]
//Date: 04.06.2007
//------------------------------
//Edit these parameters:
//MySQL server adress
$host="localhost";
//Username
$user="username";
//Password
$pass="password";
//Database
$db="database";
//Table prefix
$table="prefix";
//Show last x topics
$laforums="5";
$link=mysql_connect($host, $user, $pass);
$db=mysql_select_db($db);
$query="select * from $table".topics." WHERE topic_visibility = '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);
$query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id."";
$result3=mysql_query($query3);
$row2 = mysql_fetch_array($result3);
echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."'>".$topic_title."</a> in ".$row2[forum_name]." gepost door ".$topic_last_poster_name." op ".$date." (replies: ".$topic_posts_approved.") <a href='http://".$config_value."/bb/viewtopic.php?f=".$forum_id."&p=".$topic_last_post_id."#p".$topic_last_post_id."'>go to last post<br>\n";
}
//-------------------------- END
?>
Code: Select all
while ($row=mysql_fetch_array($result)) {
extract($row);
$date = date("d/m/y", $topic_last_post_time);
$query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id."";
$result3=mysql_query($query3);
$row2 = mysql_fetch_array($result3);
echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."'>".$topic_title."</a> in ".$row2[forum_name]." gepost door ".$topic_last_poster_name." op ".$date." (replies: ".$topic_posts_approved.") <a href='http://".$config_value."/bb/viewtopic.php?f=".$forum_id."&p=".$topic_last_post_id."#p".$topic_last_post_id."'>go to last post<br>\n";
}
Code: Select all
$forum_id = 5; // just enter the forum-id, you want to display
while ($row=mysql_fetch_array($result)) {
extract($row);
$date = date("d/m/y", $topic_last_post_time);
$query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id."";
$result3=mysql_query($query3);
$row2 = mysql_fetch_array($result3);
echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."'>".$topic_title."</a> in ".$row2[forum_name]." gepost door ".$topic_last_poster_name." op ".$date." (replies: ".$topic_posts_approved.") <a href='http://".$config_value."/bb/viewtopic.php?f=".$forum_id."&p=".$topic_last_post_id."#p".$topic_last_post_id."'>go to last post<br>\n";
}