Jump to content

Auto-Post


syco

Recommended Posts

If you want to integrate with a existing forum system, then all you need to do is SELECT the last few posts from the forum's thread table and display them. For example, phpBB3 stores the threads in a table called phpbb_topics, which has some information. Say your news was all in forum 2 (check in phpbb_forums), then you could do it as such:

//connect to phpbb database$result = mysql_query("SELECT * FROM phpbb_topics WHERE forum_id = 2 ORDER BY topic_time DESC LIMIT 5");echo "<table>";echo "<th>Date</th><th>Topic</th><th>Posts</th>";while ($topic = mysql_fetch_assoc($result)) {echo "<tr>";echo "<td>" . date("d/m/y", $topic['topic_time']) . "</td>";echo "<td><a href=\"forum/viewtopic.php?f=2&t={$topic['topic_id']}\">{$topic['topic_title']}</a></td>";echo "<td>{$topic['topic_replies']}</td>";echo "</tr>";}echo "</table>";

That should work if you are using phpBB3 (though there are probably errors, I just wrote it then).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...