Quote from: splittingred at Jan 05, 2011, 03:43 PM
$user =& $hook->getValue('register.user');
$id = $user->get('id');
Should work.
Thank you... I got it working, but it was a big scary nightmare! That’s what I get with messing with alpha software I guess. Plus, most of the xPDO stuff still makes my head swim.
For the curios:
This is what my postHook snippet ended up looking like:
<?php
$user =& $hook->getValue('register.user');
$id = $user->get('id');
require_once $modx->getOption('discuss.core_path').'model/discuss/discuss.class.php';
$discuss = new Discuss($modx,$scriptProperties);
$discuss->initialize($modx->context->get('key'));
$modx->lexicon->load('discuss:user');
// create Discuss User Profile
$profile = $modx->newObject('disUserProfile');
$profile->set('user',$id);
$profile->set('createdon',strftime('%Y-%m-%d %H:%M:%S'));
$profile->set('ip',$_SERVER['REMOTE_ADDR']);
$profile->set('last_login',strftime('%Y-%m-%d %H:%M:%S'));
$profile->set('status',disUserProfile::UNCONFIRMED);
$profile->set('last_active',strftime('%Y-%m-%d %H:%M:%S'));
$profile->set('show_email', '');
$profile->save();
return true;
With this, I kept getting a "Fatal error: Call to a member function set() on a non-object." The error was generated by the Discuss class itself at line 167: "$activity->set(’day’,$now);" (in the _initSession function).
Long story short, I randomly and desperately placed the main Discuss snippet call [[!Discuss]] at the top of the page just above the FormIt call and it all started working. I don’t know why or how

, but at 2am I just want to be done!