Topic: Wordpress plugin to post to PunBB
I'm currently using WordPress as my blog and PunBB as a forum on my site and having read these discussions, I decided to try to give something back and make a wordpress plugin that crossposts a new topic to punbb.
I've been messing around with it for a while, and with a lot of inspiration from the NP_PunBB plugin mentioned here, I finally cobbled something together.
It really is very basic at the moment, but adds a WordPress options submenu, where all the configurable variables can be changed. There is no checking of userid or permissions yet, and I take no responsibility for anything that might happen, so please back up your wordpress and punbb databases.
To install the plugin place the file ih_wp2punbb.php in the wp-content/plugins directory of your wordpress install. Then activate it in the Plugins menu.
If you want a separate comments forum then create it now in punbb. Access the configurable options in Wordpress in the WP2PunBB menu under Options. The username and userid must be for the same user in punbb. Also you need the full file path to the punbb installation, e.g. /var/www/httpdocs/forum/ . The forum id can be found by looking at the link on the main punbb page (viewforum.php?id=#).
To add a link to the forum on each wordpress post add the following to your main template page where you want the link:
<?php ih_add_comment($post->ID); ?>
There is currently no way to batch add old posts into the forum, only new posts are added.
Security and checking of permissions is non-existent.
Due to some function name clash or other reason, I can't get the forum to update with new values for last post etc. This means that even after a blog post is added to the forum it won't show up in the main index. It will be in the comment forum index though.
Editing wordpress posts will not change the post in punbb.
This is pretty much my first post here, so please be kind! As mentioned in the file comments, the code borrows a lot from the NP_PunBB plugin by Radek Hulan, Bert Garcia and Rickard Andersson, so thank you to them.