Use functions: uc_file_user_downloads function and theme function I would like to print files user download from ubercart on  a new page. I find this theme function "uc_file_user_downloads" but i don't know how to use it.

To print the table i write this little code:

&lt;?php 

 print $user-&gt;uid;
 $account = $GLOBALS['user'];
 print theme('uc_file_user_downloads', $account);
?&gt;


And the result i have:


  26 Fatal error: Cannot use object of type stdClass as array in
  /code/includes/theme.inc
  on line 1070


Could you explain me the correct way to pass the parameter on this function. I tried to cast the stdclass to array but this is not working.
If it is drupal 6 in order to print the  table you can simply do print uc_file_user_downloads($account); ,this function will internally call the theme function theme_uc_file_user_downloads

What you are trying in your code is combination of both.So in drupal 6 try witih the following code.

global $user;
print uc_file_user_downloads($user);


In drupal 7 the function uc_file_user_downloads($account); returns array unlike html in drupal 6. So try the following with drupal 7

module_load_include('inc', 'uc_file', 'uc_file.pages');
global $user;
$table = uc_file_user_downloads($user);
print drupal_render($table['downloads']);