How To Do An Automatic Forum Post, When Making A Blog Post
Recently we added a phpBB forum to our Speeltijd website, to start a community where people can discuss the articles posted on the site.
The website itself is a WordPress blog, and I wanted to do some integration between the blog and the forum. When making a blog post, I want a forum thread to be created automatically, where the blog post can be discussed. Unfortunately, I couldn’t find any plugin which does this.
So, I devised my own solution
I found some PHP code by netclectic on the phpBB forum, that allows you to insert a post in your forum with a single funtion call. The code can be downloaded here. Then I started to write a WordPress plugin to call this code when a blog post is published.
This, of course, was the tricky part… It turned out that it’s not possible to call phpBB code from WordPress code, because both have several functions with the same name. This resulted in PHP errors about function redeclarations!
So I did the following: I wrote some PHP code that uses this insert post function to create a thread in the forum, for a blog post with a given title and URL, passed as GET parameters. And then I wrote a very simple WordPress plugin that calls this PHP script through a socket, with the blog post’s title and link. This solution turns out to work very nicely!
The code for this is currently very specific for my situation, that’s why I don’t make it available yet. But if I can find the time, and there’s enough interest, I will publish a decent customizable solution here!
Related Articles:

























February 21st, 2007 at 2:32 am
Hi, i’m wanting to do the same. I’ve switched from phpbb to simple machines forum. I’m running a wordpress blog. Do you know if what you’ve written works with other forums? Cheers, Ainslee
February 21st, 2007 at 11:23 am
Well, I don’t have experience with simple machines forum, but in theory you should be able to do the same. If you can find or write some code that allows to insert a forum post from within your own php code, than you can follow the same approach.