Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
i18npoll_view_results(&$node, $teaser, $page, $block)
contributions/i18n/i18npoll/i18npoll.module, line 127
Generates a graphical representation of the results of a poll.
<?php
function i18npoll_view_results(&$node, $teaser, $page, $block) {
// Load the appropriate choices into the $poll object.
$result = db_query("SELECT c.chorder, SUM(c.chvotes) AS votes FROM {poll_choices} c INNER JOIN {node} n ON c.nid = n.nid WHERE n.tnid = %d GROUP BY c.chorder", $node->tnid);
while ($choice = db_fetch_object($result)) {
// If this option not set for the source node, do not show
if (isset($node->choice[$choice->chorder])) {
$node->choice[$choice->chorder]['chvotes'] = $choice->votes;
}
}
return poll_view_results($node, $teaser, $page, $block);
}
?>