Well, I guess if "youtemplate" is an existing vb template or one that's being rendered somewhere else, you'd want just the preRegister, like:
Code:
if ($vbulletin->userinfo['userid'])
{
require_once('./includes/functions_user.php');
$avatar_url = fetch_avatar_url($vbulletin->userinfo['userid']);
$avatar = $avatar_url[0];
$cus_avatar = '<a href="profile.php?do=editavatar"><img src="'.$avatar.'" border="0" alt="" /></a>';
vB_Template::preRegister('yourtemplate',array('cus_avatar' => $cus_avatar));
}
In any case I don't know why it would interfere with another mod.