Forum phpBB2 10 derniers post ?????

Bonjour tlm

voilà j'utilise le forum phpBB2 et j'affiche sur ma première page les dix derniers post seulement si une réponse est donner 10 fois à un sujet c'est ce sujet qui appait 10 fois.

donc le sujet : test

alors si une réponse est donner 10 fois à test ben test sera afficher dix fois

comment je peut faire pour que sa ne soit pas les 10 dernières réponse à un sujet mais les 10 dernier sujet aillant eu une réponse, je vous montre ma requête.

echo" 	<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"94\" scrollamount= \"1\" scrolldelay= \"10\" onmouseover='this.stop()' onmouseout='this.start()'><table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"010130\"><tr bgcolor=\"000000\"><td><b>$lang[Topic]</b></td>
	<td align=\"center\"><b>$lang[Author]</b></td><td align=\"center\"><b>$lang[Replies]</b></td><td align=\"center\"><b>$lang[Views]</b></td><td align=\"center\"><b>$lang[Last_Post]</b></td></tr>";
	
	
 $sql = "SELECT * FROM phpbb_posts ORDER BY post_time DESC LIMIT 10";
	$req=mysql_query($sql);
	while ($row = mysql_fetch_array($req)) {
	$poster_id = $row[poster_id];
	$post_time = strftime("%d/%m/%y %H:%M", $row[post_time]);
	$forum_id = $row[forum_id];
	$topic_id = $row[topic_id];

	$sql5 = "SELECT topic_title , topic_replies, topic_views, topic_poster FROM phpbb_topics WHERE topic_id='$topic_id'";
	$req5=mysql_query($sql5);
	$row4 = mysql_fetch_array($req5);
	$topic_title = $row4[topic_title];
	$topic_replies = $row4[topic_replies];
	$topic_views = $row4[topic_views];
	$topic_poster = $row4[topic_poster];

	$sql6 = "SELECT username FROM phpbb_users WHERE user_id='$topic_poster'";
	$req6=mysql_query($sql6);
    	$row5 = mysql_fetch_array($req6);
	$auteur_topic = $row5[username];

	$sql4 = "SELECT username FROM phpbb_users WHERE user_id='$poster_id'";
	$req4=mysql_query($sql4);
    	$row3 = mysql_fetch_array($req4);
	$auteur = $row3[username];

	$sql3 = "SELECT auth_view, auth_read FROM phpbb_forums WHERE forum_id='$forum_id'";
    	$req3=mysql_query($sql3);
    	$row2 = mysql_fetch_array($req3);
    	$auth_view = $row2[auth_view];
    	$auth_read = $row2[auth_read];
    	if (($auth_view != 2) OR ($auth_read != 2)) {

echo"	<td> <a href=\"http://aod-team.ath.cx/phpbb/viewtopic.php?t=$topic_id\" target=\"_blank\"><b>$topic_title</b></a></td>
	<td align=\"center\"><a href=\"http://aod-team.ath.cx/phpbb/profile.php?mode=viewprofile&u=$poster_id\" target=\"_blank\">$auteur_topic</a></td>
	<td align=\"center\">$topic_replies</td><td align=\"center\">$topic_views</td><td align=\"center\">$post_time <br>
	<img src=images/posticon.gif> 
	<a href=\"http://aod-team.ath.cx/phpbb/profile.php?mode=viewprofile&u=$poster_id\" target=\"_blank\">$auteur</a></td></tr>";


}


voilà donc je voudrais voire les dix derniers sujet aillant eu une réponse et pas dix fois le même sujet

merci d'avance de votre aide

wolf

1 réponse

  • Votes
  • Date
  • Date décroissante
  1. Utilise : SELECT DISTINCT
    ou WHERE forum_id!='$forum_id'" ( Pour chaque forum déjà lister , genre une variable que tu complette ... )