MyBB Community Forums

Full Version: Get myBB cookies from another application
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello to all,
I'm trying to integrate my mybb login data with my mediawiki installation.
I got the first part which was to use the mybb db to login from mediawiki and that is working just fine, now I wanted it to take it to the next step and in my mediawiki page I'd like to check whether the user has already logged in on mybb, so I thought I'll just use $mybb->user (my mediawiki user table has an extra value with mybb id's to validate). The thing is that I expected that with just 'requiring' (from php) global.php, $mybb would've become available but it's giving me an error.

Fatal error: Call to a member function simple_select() on a non-object in /usr/home/abarth/public_html/ on line 80

I understand what the error means, I just don't know how to fix it to meet my needs.

Am I on the right path, is there a plugin that would do this for me?

EDIT: Just in case, this is the structure

Thank you very much. Smile
Add $db in global object.
Thanks for the quick reply, I did what you told me and it did fix the error, now the problem is that after that one I keep getting the same error for different objects. Below is the list of the objects I've added (and I still keep getting errors).
Should I keep doing this ?
 global $db;
 global $cache;
 global $plugins;
 global $templates;
 global $maintimer;
 global $lang;

EDIT: I kept on adding the globals and now I'm getting a myBB error. See attachment for details.


(2012-05-22, 09:45 AM)Yaldaram Wrote: [ -> ]Add $db in global object.
Paste the complete code you've used.
So I've added the globals into the global.php as shown in my previous post and then a test file (home/wiki/test.php) with this method inside.
function test() {
        require_once $this->path_to_global;
        echo "<pre>";
        echo "</pre>";