Oh, yeah, if you didn't create a template named 'countrytemplate' then that's the problem. You could do this:
PHP Code:
$country = $user['field58'];
$ccode = get_ccode($country);
if ($ccode != null) {
$imgoutput = "<img src='images/flags/$ccode.png' /> ";
}
$templatevalues['ccimg'] = $imgoutput;
vB_Template::preRegister('postbit_legacy', $templatevalues);
or if you want you could create a template called countrytemplate. Maybe it could contain this:
Code:
<img src='images/flags/{vb:raw ccode}.png' />
and then the plugin would be
PHP Code:
$country = $user['field58'];
$ccode = get_ccode($country);
$templater = vB_Template::create('countrytemplate');
$templater->register('cccode', $ccode);
$templatevalues['ccimg'] = $templater->render();
vB_Template::preRegister('postbit_legacy', $templatevalues);
I don't think it matters much, but some people like to keep all html in templates.