0

I am working on a project that will solely use the SMF member system. Meaning that SMF is the only member system that I am using to have logins, not my own system along with SMF, just plain SMF. However, I am running into one problem... I need to be able to get information from SMF based on a given ID_MEMBER. My article database uses SMF's ID_MEMBER field as the author information. Seeing that CodeIgniter is MVC and uses classes, I searched for a general SMF class all over the internet, but could not find one. I decided to write my own, but cannot get it to work correctly... I don't have much experience with OOP.

<?php

class smf {

    var $context;
    var $memberContext;

    function __construct($who){

        include('/../../forums/SSI.php');
        $this->context = $context;
    }

    function user_context(){

        return $this->context['user'];

    }

    function member_context($id = NULL){

        loadMemberData($id);
        loadMemberContext($id);
        return $memberContext[$id];    
    }

}

The user_context function works fine, but not the member_context function. In the SSI.php file, the LoadmemberContext function compiles all of the information into an array called $memberContext[$id]. When I call the method from my CodeIgniter controller, I get an error saying that the $memberContext variable is undefined. Why is this happening?

ShoeLace1291
  • 4,551
  • 12
  • 45
  • 81

1 Answers1

0

I stumbled upon this question too and managed to fix it. Try this, it worked for me:

function member_context($id = NULL) {

    loadMemberData($id);
    loadMemberContext($id);
    global $user_profile;
    return $user_profile[$id];    
}
Switching Brains
  • 290
  • 4
  • 15