MyBB Community Forums

Full Version: Integrating into CMS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I've used MyBB for a few months now, and I decided to make an integration into my CMS for MyBB (MAP3 CMS) for personal use.

Yet, I tried lots of things like including init.php, global.php, even copying some of the code in index.php into the "module" for my CMS, however, I always get this error:

Fatal error: Call to a member function simple_select() on a non-object in C:\wamp\www\mybb\inc\class_datacache.php on line 80

I opened the file to see what was on line 80:
$query = $db->simple_select("datacache", "title,cache");

As far as I'm aware, there is no such variable as $db in my CMS.
I even did a var_dump to make that sure, and before the module was loaded, the var_dump returned "NULL".

So that got me caught, and I did another var_dump BEFORE line 80. That also returned "NULL".

So, how can I integrate MyBB into my CMS?

Right now I'm pretty much lost, and I'd greatly appreciate any help you guys can give me Smile
You need to globalise $db Smile

global $db;
Right, I feel stupid right now XD

That did work, but now more errors are occurring. I guess I can fix those myself Toungue

Thanks a lot!
Don't feel stupid, Everyone makes little mistakes like this.
(2011-09-10, 02:22 PM)Tyler K Wrote: [ -> ]Don't feel stupid, Everyone makes little mistakes like this.

Constructive.
(2011-09-10, 01:48 PM)Yoshi2889 Wrote: [ -> ]Right, I feel stupid right now XD

That did work, but now more errors are occurring. I guess I can fix those myself Toungue

Thanks a lot!

If you do need any more help, feel free to PM me Smile