finding the last person to post in a thread?
Posted: Tue May 14, 2002 11:16 pm
I'm using a little scripts to get the 5 most recent replied to/started threads to display on my homepage.
I show the topic title as a link to the thread, the user who started the thread, the number of replies, & i'm trying to get the last poster of that thread but don't know how?
here's the code I have so far:
Here's the site. I need to know what to do to get the last poster to work.
TIA for any help.
I show the topic title as a link to the thread, the user who started the thread, the number of replies, & i'm trying to get the last poster of that thread but don't know how?
here's the code I have so far:
Code: Select all
$resultbb = mysql_query("SELECT topic_id, topic_title, topic_replies, topic_last_post_id, username
FROM phpbb_topics
LEFT JOIN phpbb_users ON topic_poster = user_id
LEFT JOIN phpbb_forums ON phpbb_forums.forum_id = phpbb_topics.forum_id
WHERE auth_view=0
ORDER BY 'topic_last_post_id' DESC
LIMIT 5");
$countit = 0;
while ($rowinfo = mysql_fetch_array($resultbb))
{
if($countit == 0){$bcolor = "#222222";} else {$bcolor = "";}
echo ("<tr bgcolor=\"$bcolor\">
<td><font size=\"1\"><a href='phpBB2/viewtopic.php?t=" . $rowinfo["topic_id"] . "'Target=\"blank\">" . $rowinfo["topic_title"] . "</a></font></td>
<td><font size=\"1\">" . $rowinfo["username"] . "</font></td>
<td><font size=\"1\">" . $rowinfo["user_id"] . "</font></td>
<td align=\"CENTER\"><font size=\"1\">" . $rowinfo["topic_replies"] . "</font></td></tr>");
$countit++;
if($countit == 2)
{
$countit = 0;
}
}//End while
TIA for any help.