I want to alter fivestar_form and add
case 'notitle':
$form['vote']['#description'] = theme('fivestar_summary', $current_avg->value, $current_count->value, $stars);
break;
in switch section.
my alter function is:
function my_form_alter ($form_id, &$form) {
if ($form_id == 'fivestar_form'){
switch ($style) {
case 'notitle':
$form['vote']['#description'] = theme('fivestar_summary', $current_avg->value, $current_count->value, $stars);
break;
}
return $form;
}
}
but I can't see fivestar_summary', $current_avg->value
This is function I want to alter:
<?php
function fivestar_form($content_type, $content_id, $style = 'default') {
global $user;
$current_avg = votingapi_get_voting_result($content_type, $content_id, 'percent', 'vote', 'average');
$current_count = votingapi_get_voting_result($content_type, $content_id, 'percent', 'vote', 'count');
if ($user->uid) {
$current_vote = votingapi_get_vote($content_type, $content_id, 'percent', 'vote', $user->uid);
}
else {
// If the user is anonymous, we never both loading their existing votes.
// Not only would it be hit-or-miss, it would break page caching. Safer to always
// show the 'fresh' version to anon users.
$current_vote->value = 0;
}
if ($content_type == 'node') {