So many of us know that the Rate module does not smoothly integrate with Panels.
I discovered out a way to get the voting widget to show using a custom content with the following PHP code:
<?php
if (arg(0) == 'node' && is_numeric(arg(1)) && ($node = node_load(arg(1)))) {
print rate_embed($node, 'bias', RATE_FULL);
}
?>
Has anyone had any luck with doing something similar to display only the vote results (i.e. display total percent of that vote)?
I'm not a PHP wizard, but I think there is way by doing something like the following.
<?php
if (arg(0) == 'node' && is_numeric(arg(1)) && ($node = node_load(arg(1)))) {
print get_rate_resluts($node, 'bias', RATE_FULL);
}
?>
But end up getting either blank pages or some fatal database errors. Thoughts?
Update: I think I figured out that I need to create a custom content to print the output after reading it here. Tried this:
$block['content'] = rate_get_results('bias', $nid, $widget_id) $output['rating'];
But it looks like it does not do anything which is better then seeing a blank page.
rate_get_results('node', $nid, $widget_id)
found here drupal.stackexchange.com/a/2483/12342 is what sparked the idea that this could be done.