I have searched for this EVERYWHERE and I can't find this for phpBB 3.0.0. Displaying a list recent phpBB threads on an external page. I can only find it for phpBB 2... Any help would be much appreciated.
its super easy ........ its a db query and basic pagination.. do not pay for it. You will need to input your username, password, db name etc. Also change the name of tables and fields to match your phpbb3 databse.. <?php //our function getPosts($number); function getPosts() { $username = "dbusername"; $password = "dbpassword"; $hostname = "localhost"; //or your host IP //connect to the phpbb database engine...... $dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); //select our phpbb databse $selected = mysql_select_db("phpbb1",$dbh) or die("Could not select DB"); //make a query to get last $number topics from the forum.... //the not in is where you can add the private or hidden forum ID's - just look in the forums table and you will see the forum names and the ID's. $myQuery = 'SELECT topic_id, topic_title FROM phpbb_topics WHERE forum_id NOT IN (\'16\', \'17\', \'18\') ORDER BY topic_id DESC LIMIT $number'; //run the query or fail with the error $myQueryExecute = mysql_query($myQuery) or die (mysql_errror()); //this is the pagination or ourput //while there are rows available from the result... while ($container = mysql_fetch_row($myQueryExecute)) { //echo to the browser ...... echo '<a href="' . 'http://myCoolSite.com/forum/viewtopic.php?t=' . //the image is a little image that looks pretty at the side of each recent post.... //there is a <hr> horizontal rule between the posts to make it look pretty when combines with css.... $container[0] . '"' . ">" . '<img src="images/comment.gif" />' . " " . $container[1] . "</a>" . "<br><hr>"; //close the loop } //close the database connection mysql_close($dbh); //unset our variable $number unset($number); //close the function } ?> PHP: Now to use this function in a page <?php require("ourFunctions.php"); //gets the last 5 posts and prints them to the screen with the formatting set in the function as above... echo "The last posts were...........<br /><br />"; getPosts(5); ?> PHP: Hope that helps a bit.
Thanks very much. I would of just written the code which would of taken me a while, but sharqi has already done it which saves me a lot of time. Thanks!