Using fivestar_get_votes() to show the votes on a node I need to display a multi-axis review system using Fivestar in node.tpl.php in Drupal 7.

I created the content type according to this tutorial, which is for Drupal 6, and I need to know how I can call votingapi_select_results() and fivestar_theme() in Drupal 7.

Initially, I tried the following code.

$design_rating = votingapi_select_results(array('entity_id' =&gt; $node-&gt;nid, 'tag' =&gt;'design', 'function' =&gt; 'average'));
print_r($design_rating );


It caused a fatal error.

Later, I used fivestar_get_votes() as in the following code.

$design = fivestar_get_votes('node', $node-&gt;nid, 'design', NULL);
print_r($design);


I got an array.


  Array (
    [average] => Array (
      [vote_cache_id] => 128
      [entity_type] => node
      [entity_id] => 18
      [value] => 80
      [value_type] => percent
      [tag] => design
      [function] => average
      [timestamp] => 1332162918
    )
    [count] => Array(
      [vote_cache_id] => 127
      [entity_type] => node
      [entity_id] => 18
      [value] => 1
      [value_type] => percent
      [tag] => design
      [function] => count
      [timestamp] => 1332162918
    )
    [user] => Array(
      [vote_id] => 8
      [entity_type] => node
      [entity_id] => 18
      [value] => 80
      [value_type] => percent
      [tag] => design
      [uid] => 1
      [timestamp] => 1332162918
      [vote_source] => 122.164.241.37
      [function] => user
    )
  )


I don't know how to use it to show the result shown from the Fivestar module. How can I do it?

i tried with below code in node.tpl.php and it displayed result as '3' not a fivestar widget.

$variables=array('rating'=&gt;60,'stars'=&gt;5,'tag'=&gt;'design');
echo theme('fivestar_static',$variables); 


Am i missing anything in it? or is there any other procedure to call theme function in node.tpl.php in drupal 7?
Fivestar module for Drupal 7 implements fivestar as a field. Assuming the field name is field_fivestar_awesomeness you can print it anywhere with:

$fivestar = field_view_field('node', $node, 'field_fivestar_awesomeness');
print render($fivestar);


There are some display and language options, see more in the api docs.