MyBB Community Forums

Full Version: Accessing MyBB activity from PHP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

A group I work with is choosing a forum to go with our wiki. We are currently evaluating MyBB, SMF, vBulletin (we know it’s pay), and Vanilla. One of our biggest concerns is how closely we can integrate the forum with our main website, written in PHP.

I’m the programmer in the group, and I was wondering if people could comment on whether this forum has the hooks and general flexibility for this. Specifically, how hard or easy is it for a PHP script to get information about content and activity in a MyBB forum? I know that MyBB doesn’t have an API yet but that one is coming in version 2.0, which will be released when it’s done. However, in the short term, I’m much more interested in what can be done with the current version.

For example, from an external PHP program, is it possible to:
  • get an automatically updated list of all threads that have certain words in them?
  • display links to all threads currently in a certain subforum?
  • include a link that will start a new thread in a specific subforum?
  • run a hook when someone logs in or creates an account so that they can automatically be logged in to a corresponding account in our main website?

We completely control our server, so we can access the MySQL database directly, can apply arbitrary patches to the MyBB code, and can run periodic batch jobs. We’re just hoping to find a platform that makes this type of integration easier rather than harder.

Thanks in advance for any insight.
Forest
All that's possible. Some is fairly easy especially if you're decent with php or have a developer.
Glad to hear it. Thanks for you feedback.

So, in terms of accessing MyBB activity and content from a PHP program outside of MyBB am I right in thinking that I will mostly be writing SQL queries? It seems like that would be the easiest way to do the types of things I mentioned in the first post (mostly get an automatically updated list of subject headings and URLs for threads that have certain keywords in them).

From an external PHP program, is there any benefit to using the Database Methods listed here?
http://wiki.mybb.com/index.php/Database_Methods
Or can I just as simply write my own methods to access the database. We have passwords to the database, since we control the entire server.

For the record, I'll be writing an extension for MediaWiki, the software that powers Wikipedia - see it on our site here: http://www.tmswiki.org . However, I don't imagine that anyone else trying to access information about MyBB from PHP would end up doing anything differently.

Also, I'm considering using MyBB Integrator:
http://phpdave.com/MyBBIntegrator/
http://community.mybb.com/thread-44520.html
I'm a bit worried that it doesn't seem to have been updated in a year, but it looks simple enough that I could probably update it myself if need be. I made a donation to the author in hopes that he might put some effort into it again. Does anyone have any experience with that library or know of any similar libraries that I might look into?

Thanks again for any help....
The benefits of using the MyBB database class is that it's there and ready to use (why re-write it?) and you can also then see your queries using the MyBB debugger.

As for MyBBIntegrator, I'm not sure how well it works with recent versions of MyBB, though I know it powers the Wordpress bridge (which also may or may not work with the latest MyBB version too).
Isn't there a MediaWiki bridge on the mods site? You might want to look at that to see if it does some of the stuff you want. No point in reinventing the wheel.