Yes, you're right. The user profile fields for the logged in user are already queried and your example works.
I now have in my plugin in the 'global_bootstrap_init_start' hook.
PHP Code:
## Create array of custom user profile fields
$customfields = array(
'ReferingHostName' => $vbulletin->userinfo['field5'],
'ReferingHostMemberCode' => $vbulletin->userinfo['field6']);
## preRegister variables for desired templates
# For 'modifypassword' template
vB_Template::preRegister('modifypassword',array('RTRvalues' => $customfields));
And I can refer to each of these like so (in the 'modifypassword' template).
PHP Code:
{vb:raw RTRvalues.ReferingHostName}
PHP Code:
{vb:raw RTRvalues.ReferingHostMemberCode}
With regards to the hook I amusing; should I use a more specific hook for 'modifypassword' template (if that was all I needed) so that it isnt invoked when not required? I was thinking of unnecessary overheads!
Thanks for your help Lynne, you're a star,
Kris...