Hi Ola,
From someone who was exactly where you are just a few weeks ago, I'd be happy to share what I've learned so far...
First off, it sounds like what you are describing would use the 'createNewUser' hook instead -- it's on the Hooks page of the Website as well, and has a very similar syntax.
I would also read Tru's blog series on writing a custom module. In your case the first part of his series would be useful -- where he creates the file and folder structure of his custom module, and explains the logic behind why those are set up the way they are -- http://blog.qzminski.com/2010/04/create ... -part-one/.
You'd essentially be creating a custom module that has two files:
/system/modules/myCustomModule/config/config.php, Which Contains:
Code:
$GLOBALS['TL_HOOKS']['createNewUser'][] = array('myCustomModuleClass', 'myCustomClassMethod');
/system/modules/myCustomModule/myCustomModuleClass.php, Which Contains:
Code:
class myCustomModuleClass // Make sure this class name matches the first item in the above line of code
{
public function __construct() {}
public function myCustomClassMethod($intId, $arrData) // And make sure this method matches as well
{
print_r($intId); // Print the ID of the new User
print_r($arrData); // Print out the user's data, which should include the fields you need.
}
}
And then that method would automatically run every time a new user registers.
Does that help?
Bookmarks