I cant use $account in a block I'm using drupal 6, I wanted to give feed back on a simple quiz (that is answered during user registration - to be a profile field).  I made a template for the profile page:
user-profile.tpl.php

And the code (at the bottom of the page) works fine, but it doesn't work when I try the same code in the template(for the specific block I want):
block-block-10.tpl.php

I added this function to template.php, to (TRY) make $account avaialble to block-10

function blockaccess() {
// access globals  
global $account;
global $node; 
}


What do I need to change?

the code in block-block-10.tpl.php:

&lt;div class="block-content-inner"&gt;
    &lt;?php 
    blockaccess();
    dsm($node);
    dsm($block);
    dsm($account);
  $correct_ans = "3) I'm from Spain.";
  $quiz_ans = $account-&gt;profile_quizoffer_ans;
  print $quiz_ans;
  print "--------------------------------------------&lt;/br&gt;";
  print '&lt;h3&gt;チラシの裏のクイズ:&lt;/h3&gt;&lt;table&gt;&lt;tr&gt;&lt;th border="1"&gt;Q: Where are you from?&lt;/th&gt;&lt;th&gt;Result&lt;/th&gt;&lt;/tr&gt;'; 
  if ($quiz_ans == $correct_ans) {
    print '&lt;tr&gt;&lt;td width="200"&gt;&lt;p style="color:green"&gt;';
    print $quiz_ans; 
    print '&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&lt;p style="background-color:green"&gt;&lt;font color="white"&gt;CORRECT&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;You passed the quiz!&lt;/td&gt;&lt;/tr&gt;';

  }
  else {
    print '&lt;tr&gt;&lt;td width="200"&gt;&lt;p style="color:red"&gt;';
    print $account-&gt;profile_quizoffer_ans; 
    print '&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&lt;p style="background-color:red"&gt;&lt;font color="white"&gt;INCORRECT&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;You didn'."'".'t pass the quiz!&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;The correct answer was:&lt;/td&gt;&lt;td&gt;';
    print $correct_ans;
    print "&lt;/td&gt;&lt;/tr&gt;"  ;

  };
  print "&lt;/table&gt;"; ?&gt;
      &lt;/div&gt;
Try global $user; rather than global $account;.