We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Help with extension hooks

Development and Programming

LoonyToons's avatar
LoonyToons
1 posts
15 years ago
LoonyToons's avatar LoonyToons

Hi all,

I’ve been looking over the developer docs for extensions, and I can’t really get my head around things.

Basically, I’m looking to understand the member_member_register function in EE2.

From the developer docs I know this is the hook

edata = $this->extensions->call('member_member_register', $data, $member_id);
if ($this->extensions->end_script === TRUE) return;

Is $member_id available to use in an extension? If so, how do I reference it?

If not, can anyone point me in the direction of how I might get the member_id?

Thanks!

       
the3mus1can's avatar
the3mus1can
426 posts
15 years ago
the3mus1can's avatar the3mus1can

In your extension you do something like:

function my_method($data, $member_id) 
{
   .... use $member_id ....
}
       
LoonyToons's avatar
LoonyToons
1 posts
15 years ago
LoonyToons's avatar LoonyToons

Thanks the3mus1can! Works a treat!

       
Deep Arora's avatar
Deep Arora
153 posts
15 years ago
Deep Arora's avatar Deep Arora

I need little help too here..

This calling of hook can create new user accounts? I am looking for a way to register a new member from an extension, if user is not present in the users table.

       
the3mus1can's avatar
the3mus1can
426 posts
15 years ago
the3mus1can's avatar the3mus1can

Look at this class APPPATH.’models/member_model.php’ for creating a new member. There is also some username/email validation stuff in APPPATH.’libraries/EE_Form_validation.php’.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.