Which forum/discussion board can be best integrated with a custom system?

I will be creating a community site in PHP and MySQL and I will need to equip it with a forum. The forum will not be the main part of the site but will be important nevertheless. I don’t need many advanced features, however writing a forum from scratch is a lot of work so I’m thinking of using an existing package. My main requirement is that it can be quite easily integrated with a separate system - I will code most of the side while I want to use the ready-made forum software with the site. Which forum software would best fit this requirement? Basically what I need is a forum with these features:

  1. Easy integration with a separate system: ability to use single logon system for users; easy integration of themes/styles/templates into a separate system

  2. Extensible with plugins so I can add my own functionality. Currently these would be ability to trigger my custom plugins whenever a user posts a message (e.g. in order to send out automated messages, etc.); being able to create forums and subforums easily from my application; being able to add new elements to display within existing forum templates. It would be best if I didn’t need to hack the forum code but use its plugin system so that I can upgrade the forum in the future.

  3. Fairly organized code so I won’t have to spend weeks figuring out what does what. (some time ago I made a community site and integrated it with phpBB 3 and don’t want to do it again - phpBB’s code is very messy and unintuitive.)

  4. Features I would like:

  • standard things like forums, subforums, bbcode, avatars, message subscriptions, moderation system, banning
  • private messaging
  • private groups/forums
  • simple search

There will be much more information stored about each user than the forum would allow so I want to extend the forum’s existing user table with more fields or create a separate table if that will help keep things clean and make future updates easier.

The best would be open source but I can consider commercial sultions as well if they are worth it. I have found plenty of forums on the web but I have experience only with phpBB so I’d like to hear opinions of people who worked with the code of other forums and which they found easiest to integrate. Thanks.

Take a look at the Vanilla forum. Good project.