Jump to content

[SOLVED] fire_event() what does it do?


acctman

Recommended Posts

does anyone know what "fire_event()" does? $id and $line['m_id'] are the user ID. And, 'on_member_reg' and 'member_login' seem to be short descriptions of the pages. but what exactly is fire_event() doing. Before each function is just queries and user check info and after is just close bracets

 

...
        fire_event('on_member_reg', $id);             
        load_template('modules/members/templates/registration_success.tpl');
...

 

another file

 

...
        fire_event('member_login',$line['m_id']);
        header('Location: '.$redirect);
        exit;
...

Link to comment
https://forums.phpfreaks.com/topic/124836-solved-fire_event-what-does-it-do/
Share on other sites

That's a user defined function.  There's no way we can know what it does unless you show us the function itself.

 

i did a global search throughout the entire script files and sub-folders nothing came back for fire_event other than those two entries

Well it's got to be somewhere.  If it's nowhere then you'd be getting an undefined function error.

 

found it, one of my backup files is out of date. i think i understand whats happening. It calls the _events.php file and from reading through that coding its checked the database to see what payment level the user is.

 

 

//functions to execute on event
function fire_event($event, $param) {
        global $events;
        if (!is_array($events)) return false;
        $path = path;
        if (defined('in_admin')) $path = dirname($path).'/';
        if (is_array($events[$event]))
        foreach ($events[$event] as $key => $value) {
                list($mod, $func) = explode('/',$value);
                require_once($path.'modules/'.$mod.'/_events.php');
                eval($func.'($param);');
                }
        }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.