<?php

/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     modifier
 * Name:     xoops_user
 * Purpose:  Adapter for XoopsUserObject::getVar with using $uid parameter.
 * Input:    uid: user id
 *           key: XoopsUserObject property name
 * -------------------------------------------------------------
 */
function smarty_modifier_xoops_user($uid, $key)
{
	$handler=&xoops_gethandler('member');
	$user=&$handler->getUser(intval($uid));
	if(is_object($user)&&$user->isActive()) {
		return $user->getVar($key);
	}

	return null;
}

?>
