put the code into the template.php file? &lt;div class="meta"&gt;
  &lt;?php 
    echo  $submitted;
    $common = $content['body']['#object']-&gt;field_fenlei['zh-hans'];
    foreach($common as $vocab){
      echo  l($vocab['taxonomy_term']-&gt;name,$vocab['taxonomy_term']-&gt;uri['path']);
    } 
  ?&gt;
&lt;/div&gt;


This code is the one I wrote for node.tpl.php, and it's too bad. Is there a way to put the code into the template.php file? How do I do?
It's fine to put code in template.php, but do not print or echo there. All print or echo code should be in template files (.tpl.php). If you need to prepare variables for output in a template file, alter a preprocess function (eg. THEMENAME_preprocess_page if you need them in page.tpl.php), add your variables to the $variables array (eg. $variables['greeting'] = 'Hello!'; and print those variables in the template file (print $greeting;).

So for this example it would be something like:

function THEMENAME_preprocess_node(&amp;$variables) {
  $common = $variables['content']['body']['#object']-&gt;field_fenlei['zh-hans'];
  $term_links = '';
  foreach($common as $vocab){
    $term_links .= l($vocab['taxonomy_term']-&gt;name,$vocab['taxonomy_term']-&gt;uri['path']);
  } 
  $variables['fenlei_term_links'] = $term_links;
}


Now you can access the output with the variable $fenlei_term_links in your node.tpl.php:

&lt;?php print $fenlei_term_links; ?&gt;


In general you might want to use something like http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_links or http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_items