Re: parsing message properly
some steps may not be neccessary due to the way my site was setup, might be different from yours (and yours can be simpler/more complicated)
here, i will assume your forum is in the folder called "mybb" and your site is in a folder parallel to that folder.
1) make a copy of "mybb/inc/init.php" and "mybb/global.php".
2) place them in the folder where your site is (i'm assuming your forums and main site are on different folders)
3) modify copied global so it links to the copied init.php
FROM: require "./inc/init.php";
TO: require "init.php";
4) modify copied init.php so it links to the old files located in the /mybb folder
FROM: require "./inc/class_core.php";
TO: require "../mybb/inc/class_core.php";
there are tons of this in this file, you will have to change them all.
5) now add these lines of code to your site
6) Do the database access codes given earlier in this thread. NOTE: now that you have included all those stuff, you can use mybb's DB wrapper class ($db)
7) before you echo the message, apply this function into it
$message[post] = postify($message[post], $allowhtml="yes", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0);
that should do it