Using phpBB as your Joomla Comments Engine

E-mail Print

Note: if you were looking for my old article on this for phpBB 2.0 and Joomla 1.0, it is unsupported, but available here.

New release: version 0.21

New name: Now plugin is called "Boylan Comments"

There was a mistake in version 0.2, which has been fixed in 0.21. Please upgrade to 0.21 if you have not done so yet. The instructions remain the same.

For upgraders:

If you have installed an earlier version of this plugin and want to upgrade (you should upgrade - v 0.2 contains serious bugfixes)

  1. Just uninstall the plugin currently on your site. Don't worry, you won't lose any comments. However, failing to uninstall the old plugin first will cause problems.
  2. Install the new plugin, downloadable below.
  3. After installing, modify the plugin parameters as necessary - note: the new installation will lose all of your parameter settings, but you can re-enter them in seconds.
  4. Check out this bug and modify your phpBB Group permissions to stop the comment threads from appearing as unapproved.
  5. Finally, publish the plugin.
  6. When you're done, subscribe to the comment thread for this article - I will post a new comment for new releases.

For first time installers:

OK, we are currently in an alpha release.  I would highly recommend backing up your database before proceeding, as you'll have to add a table.

This plugin is only compatible with Joomla 1.5x and phpBB 3.0.x - IT WILL NOT WORK with phpBB 2 or Joomla 1.0.x

I have only tested this plugin with Joomla 1.5.8 and phpBB 3.0.4, but presumably it will work with any releases up to this point.  If phpBB has a new release that modifies the common.php file or the utf_tools.php file, a new plugin will have to be released.  If you upgrade to a new release before I have updated the plugin, it may break the plugin or your site in ways I cannot predict. The plugin also works with SEF enabled or disabled.  I use sh404SEF, and it works fine.  It also works with the phpBBSEO Mod installed with a quick dropdown selection in the plugin parameters.

Also note: THIS PLUGIN WILL GENERATE A THREAD FOR EVERY ARTICLE IN YOUR JOOMLA SITE! That could be thousands of threads generated in one quick shot (the page has to be loaded to generate the thread, but web crawlers and search spiders should do that in short order). If you have a lot of articles, make sure you create a separate forum for the comments, or it will blow your current threads into oblivion - many, many pages deep.

Seriously, you can't just try this out on one or two articles.  It's all or nothing - for now.  If you want to test it small, close your site to external visitors while you poke around and test.  Just remember, if you have a blog page with 10 articles on it, loading that page will create 10 threads.  It won't swamp your server or anything, it will just fill your forum really quickly. Or, you can wait until I release a new version that will let you limit comments to certain categories, sections or even articles.

DOWNLOAD THE PLUGIN (v 0.21) (GPL v3)

Things to do after installing, but before publishing the plugin:

  1. Create a comments table using this SQL:

    CREATE TABLE IF NOT EXISTS `jos_phpbb_comments` ( `source` int(11) NOT NULL default '0', `topic` int(11) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    This is presuming that your table prefix is 'jos_'.  Change it if necessary.
  2. Create a forum for comments - you can mix it in with another forum if you want, but I prefer a separate comments forum. (Note the id # of the forum. You'll need it for the plugin parameters.)
  3. Create a user that has topic creation privileges in that forum. (Note the id # of the user you created. You'll need it for the plugin parameters.) I'd also recommend removing the ability of others to start topics in that forum to keep it clean.
  4. Check out this bug and modify your phpBB Group permissions to stop the comment threads from appearing as unapproved.
  5. Fill out the parameters for this plugin with appropriate values.  Check to make sure your phpBB root path is correct - the default is just what I use, it likely will not be the same for you.

You then can publish the plugin.

If you find any bugs or see any weird or unexpected behavior (especially error messages), please post to the comments thread at the bottom this article.  Please include a copy of your error messages in your post.  I would like to keep all bug reports and questions here to make things easier for both myself and other users. Also, feel free to make feature requests in this comments thread.  I'm sure there are things I did not think of yet.  I may not get around to them as soon as you would like, but this plugin will be under active development, especially over the next few weeks.


How the plugin works:

When the onPrepareContent event is raised, the plugin checks the jos_phpbb_comments table we've created to see if there is a row with the id of the current article.  If there is an entry, the plugin inserts a link to the pre-existing thread and appends it to the article.  If no entry exists, then a topic is created using submit_post.  A link to the Joomla article and title are inserted into the first post of the new thread by the "CommentBot" user in the forum specified in the plugin parameters. Then, the topic id and the article id are linked in the jos_phpbb_comments table, so that the next time the article is displayed, the proper link will be displayed, as explained earlier.

As explained above, there is a very tenuous link between comment threads and articles.  If an article is unpublished or deleted, the comments thread still exists and vice versa.  There is no moderation of comments in the Joomla side of things - that's handled entirely in phpBB, just like any other thread. This does not work like other comment engines you may be familiar with and likely never will.  However, it does do one very powerful thing - draw forum users to your Joomla site and article readers to your forums.  I've wanted to do just that ever since I installed my first forum many years ago.

If you unpublish the plugin later, the comments are not deleted, only the link between the articles and the comments on the Joomla side.  The comment threads will still link to the articles, since their links are hard-coded in the first post. Unpublishing or deleting the plugin will NOT remove the jos_phpbb_comments table, so upgrading to a new version of the plugin is as easy as uninstalling your current one and installing the new version. You can publish and unpublish this as much as you want if you run into errors and need to wait for bugfixes from me - the comments will still be there when you publish it again.

Still To Do:

Thanks for helping to test this thing out before release to the JED.  Enjoy!

Chris

 

Popular Entries