How do I print custom html in nodes of a certain type using template.php?
If you want to provide a new variable to your node template file you should implement hook_preprocess_node() in your theme and pass it from there:

function MYTHEME_preprocess_node(&amp;$vars) {
  if ($vars['node']-&gt;type == 'node_type') {
    $vars['extra_html'] = my_function_to_build_html_string();
  }
}


Then in your node.tpl.php file you can output that HTML wherever you want like so:

&lt;?php if (isset($extra_html)): print $extra_html; endif; ?&gt;


If you just want to add some HTML into the normal content of the node, you would do it like this:

function MYTHEME_preprocess_node(&amp;$vars) {
  if ($vars['node']-&gt;type == 'node_type') {
    $vars['content']['extra_html'] = array(
      '#markup' =&gt; my_function_to_build_html_string(),
      '#weight' =&gt; -10 // Control the display order of this element
    );
  }
}    


In either case you'll need to clear Drupal's caches once you've implemented this hook so the theme registry picks it up.