MyBB Community Forums

Full Version: How easy is it to integrate with MyBB?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
No, really! When I asked that question, I do not mean just a login and checking if user is logged in. What I mean is how easy can it be to add your existing customized code to this MyBB? I have tried it with SMF and phpBB3, and I haven't had much luck because of their complicated code and different method of communicating with the database. The normal query code like below will not work with SMF or phpBB3:

$query ="SELECT * FROM mpoints";
$result =mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
	$name = $row["id"];
	$id = $row["value"];
	$points[$name] = $id;
}

Instead, you have to use something like this:

$sql  = 'SELECT points * 
           FROM ' . USERS_TABLE .  ' u,
           mpoints p
           WHERE u.u.user_id = p.uid';
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);

The second query is more complicated and if my existing customized code is not uniformed as SMF or phpBB3 then I keep getting error message. I am just fed up with them and can hardly find somebody who can assist me in this.

So this is why I am asking! I would greatly appreciate your being straight with your answer. Thanks!
MyBB has a plugin based system to allow developers to easily intergrate their code into MyBB by using the plugin hooks.

MyBB has a $db variable that allows you to run database queries through it.

For more information see:
[wiki]Database Methods[/wiki]
[wiki]Database Tables[/wiki]


You could always communicate with the database like in your above code, but this poses a couple of issues. Firstly, you would have to open a second connection to the database and secondly, it is recommended to use the $db functions because MyBB 1.4 adds support for more types of database and using the $db functions ensures compatibility with them all.
Isn't This in the wrong forum 8-)
Aaron Wrote:Isn't This in the wrong forum 8-)

This is not a technical issue and I do not have forum installed on my server. It is more of a pre-installed question before I decide if it is worth my time investing into MyBB. Thanks!