// Create the user object
$user = $modx->getObject( 'modUser', array( 'username' => $userName ));
if ( !is_object($user) || !($user instanceof xPDOObject) ) {
$errorMsg = 'Failed to create object of type: modUser';
$modx->log(modX::LOG_LEVEL_ERROR, $errorMsg, '', 'utilityProcessor Reader Portal');
return;
}
$userID = $user->get('id');
$userAliasMeta = $modx->getObject('UserMeta', array( 'user_id' => $userID, 'key' => 'alias' ));
if ( !is_object($userMeta) || !($userMeta instanceof xPDOObject) ) {
$errorMsg = 'Failed to create object of type: UserMeta. There may not be an alias meta for this user.';
$modx->log(modX::LOG_LEVEL_ERROR, $errorMsg, '', 'utilityProcessor Reader Portal');
}
$userAlias = $userAliasMeta->get('value');
$modx->setPlaceholders(array('oztitle' => $userAlias));
$userMeta = $modx->getCollection('UserMeta', array( 'user_id' => $userID ));
if ( !is_object($userMeta) || !($userMeta instanceof xPDOObject) ) {
$errorMsg = 'Failed to create object of type: UserMeta. There may not be any meta for this user.';
$modx->log(modX::LOG_LEVEL_ERROR, $errorMsg, '', 'utilityProcessor Reader Portal');
}$output .= '[[!viewProfilePreProcessor?&user='.$user.'&userMeta='.$userMeta.']]';
$output .= '[[!$profile_view]]';
$modx->setPlaceholders( array( 'utility.pageClass' => 'profile', 'utility.output' => $output ));
return;This question has been answered by aaronkent. See the first response.
$params = array();
$params['userMeta'] = $userMeta;
$output = $modx->runSnippet('yoursnippet',$params);