Call User Profile Field in Node Template
global $user is that of the currently logged in user, not specifically the owner of any specific content.

So what your code was doing was just looping through printing your byline, eg, admin, eg uid 1.  What you need to do is grab the uid from the specific user's content, user_load(THAT-UID) into a variable, and then use that to get the byline into vars[] in hook_preprocess_node() so it goes to the specific node in question, not the page it is printed on.

(in D6 at least, still learning D7 but I am sure it's pretty similar)

Addition/Edit:  In D6, you can get the uid of the node author like this:

function hook_preprocess_node(&amp;$vars) {

  $node=$vars['node'];
  $uid=$node-&gt;uid;

  $byline= "whatever you need to do to get it with $uid"

  $vars['byline']=$byline;

}


just change hook to your theme or module name and you should be on your way.  You can now use the byline variable in your node.tpl.php (barring any typos or brainfades of mine above :)