Jump to content

Catching events


simpilot

Recommended Posts

  • Administrators

Nabeel,

I have four modules catching the same event - 'registration_complete'

1 - forum registration

2 - teamspeak registration

3 - automatic AIRMail welcome message

4 - automatic forum post announcing the new hire

They all work individually if I remove the other three from the modules folder, but when I have all four in the folder only one will catch the event. Do i need to create an event at the end of each module to call the next, or should they all be able to catch the same event?

Link to comment
Share on other sites

  • Administrators

This is basically what I am using at the start of each function to register it and look for the event...


public function __construct()
{
     CodonEvent::addListener('ForumRegistration', array('registration_complete));
}
     public function EventListener($eventinfo)
{
     if($eventinfo[0] == 'registration_complete')
      { 
           ForumRegistrationData::register_user();
       }
}

Link to comment
Share on other sites

  • Administrators

What's happening in ForumRegistrationData::register_user();? You probably don't need a separate data class. The data classes should be used if you're sharing common code.

Is there an echo coming out?

You probably also need some way to test events without having to registering a user every time. I'll cook that up as well.

http://bugs.phpvms.net/ticket/2

Link to comment
Share on other sites

  • Administrators

Sorry this is totally not helpful but..

You have a working teamspeak registration code? Care to share?

Sorry Tom - Just caught this....

More than happy to share. I am on the road for work right now and I have the module running on my loacl development server at home. Should be home by the weekend and I will post it. It still needs to be cleaned up a little but I got it to work. The biggest hurdle was getting the password over to teamspeak. Also it is only working on teamspeak version2, I have not got it to work on the new version 3 beta teamspeak.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...