Recent phpBB Topics on Wordpress Plugin
UPDATE: This Plugin has been updated, the latest version is available on wordpress.org please comment on the new post, thanks.
Written primarily for my wife to use in the future, but I’ve developed a pluging that allows you to post a list of recent phpBB threads/topics within wordpress.
If found this plugin by Brandon Alexander but it wasn’t right for my needs, firstly he looks up usernames from phpBB, now my phpBB & wordpress installs don’t share databases and I thought it was a bit of a security risk giving wordpress access to my users password hashes… and secondly that plugin gives a list of recent posts, not what I wanted, and wanted threads (topics).
This is the 1st version, the massive fault with it is that you have to edit the file (to tell it where to find phpBB), I’m not yet smart enough to include an admin interface.
Installation: Download phpbb_recent_topics.txt and save as phpbb_recent_topics.php in your wordpress plugins directory. Edit the file, and change these bits to your appropriate settings…
$PHPBBDB = "phpbb_database"; // phpBB db name $TOPIC_TABLE = "phpbb_topics"; // phpbb topics table $SITEURL = "http://www.domain.com/phpbb"; //Forum (phpbb) URL
A bit about Database configuration.
If wordpress & phpBB share a DB already then set $PHPBBDB to DB_NAME and everything will be fine, else you’re going to need to GRANT the wordpress user read access to phpBB.
How to GRANT wordpress read only access to phpBB ?
If you don’t know it already you need to find your wordpress mysql user id, it’ll be in wp-config.php
define('DB_USER', 'wp_user'); // Your MySQL username
and you should have already found your phpbb database & table for the above.
You need to type the following syntax into your mysql database
GRANT SELECT ON phpbb_database.phpbb_topics TO wp_user@localhost;
this can be achieved by logging into phpmyadmin as your phpbb user, selecting SQL and pasting the correct GRANT into the text box.
Plugin Usage.
The plugin can be used in two ways, for those who don’t like editing templates you can call (type)
{phpbb_recent_topics}
from any post or page, and it will be replaced with an list of the last 5 topics.
For those who want to include the list in a sidebar template or similar, call the following function: phpbb_topics(), something like
if ( function_exists('phpbb_topics') ) { phpbb_topics(5); }
where by the number 5 can be replaced with anything less that 10, and that’ll be the number of topics returned.
Hopefully that all makes sense, feel free to contact me with problems.
UPDATE: Comments about combatability issues here please.

That’s a really nice idea. Is there any chance you could do another one for Invision boards?
I’ll see how difficult it is and let you know
EDIT: Anyone know where I can download an Invision board.. goog is pointing me at some pay for only IP.Board :confused:
[...] phpBB recent topics lists of recent phpBB threads or Topics displayed in WordPress. [...]
Does it work for phpBB3 too ?
To be honest I’ve not tested it.
Looking at the phpBB3 install code, there is still a topic_table, and the mysql structure looks very similar, so it should pull the topics out the same; the only thing I can’t tell is if the URL structure has changed (so hyper links may or may not work).
Let me know how you get on
[...] phpBB recent topics zeigt eine Liste der letzten phpBB Threads oder Titel in WordPress an. [...]
[...] phpBB recent topics lista entradas recientes de phpBB o tópicos desplegados en Wordpress. [...]
Is there any way to exclude certain forums, ie those only available to administrators?
Hi David,
There is see this post.
As a side note, I’m about to release the next version that allows the config variables to be set in a wordpresses admin panel. Once I’m happy that’s all stable, I hoping to be able to setup a proper “include / exclude” settings area in wordpress.
Hope that helps
Nice one,
Great little plugin, so thanks very much. I am the kind of user that once everything is working I only upgrade when it is essential but that functionality should be great for new users.
There seem to be quite a few phpbb/wordpress sites out there. I could just not bring myself to use phpnuke.
Thanks again!
Sorry my php is awful, if I wanted to exclude multiple forums (ie 1 to 4) how would I do this with:
SELECT * FROM $TOPIC_TABLE WHERE forum_id != 1 ORDER BY topic_time DESC LIMIT $limit
Hi David,
That can probably be solved by selecting all forums greater than 4, ie.
WHERE forum_id > 4.I’m still trying to work out the proper logical expression for examples excluding numbers like 1 , 5 & 9.
I can let you know when I’ve got it sorted.
Hi,
Thanks this plugin is working great for me.
I was just wondering if there is a way to display the topics with the most recent replies? This would be a way to show the user which topics are currently active.
Thanks,
David
Glad to hear you got it sorted David.
TBH I can’t think of a way straight away; now that I’ve got the administrator panel working, I’ll add your suggestion to my planned features. I have a feeling I would have to check another table for that functionality as the “topc_time” date relates to the date the thread was started, not replied
Well, after sorting out the confused directory naming conventions (filenames, directories and php code all seemed confused as whether to use phpbb-recent-topics or phpbb_recent_topics) I was finally able to get the plugin to work.
The only problem now is that there is no place for the phpbb database password and it cannot connect. :-/
you don’t enter a password, you should give the wordpress user permissions to read the phpbb table.
“you don’t enter a password, you should give the wordpress user permissions to read the phpbb table.
”
Gotcha. Thanks, it’s working great now