I have a set of polls that site members can vote on, and the poll needs to stay open indefinitely, but I want anonymous viewers to be able to see the results. Currently with printing out my nodes on my polls page, all the anonymous viewer gets are the questions + "Login to vote". How do I create a page just for results, or configure it so that anonymous sees results?

Currently I'm just doing this to display a series of polls in succession on one page

$node = node_load('123');
print node_view($node, $teasers, false, $links);

Comments

sansui’s picture

I found a patch here -> http://drupal.org/node/272637 that adds an option for the display of poll results. It worked great for me, and an anonymous user can click the results tab to see the results.

What I would really like, though, is to be able to display the result tab directly. Is this something that can be done fairly easily with the node_load and view functions? I'm not well versed in what can be done with them, so I appreciate the hand holding :P

sansui’s picture

No ideas out there for displaying the result tab directly instead of the questions? :(

sansui’s picture

Is there any way to use this function advpoll_view_results($node,$teaser,$page) to view results directly?

sansui’s picture

For anyone else that might have been trying to do this, I mucked about enough that this kinda works, where 123 is the node that I want to display. So now I can just embed the results directly into the page for an ongoing poll that anonymous can't vote on.

  $node = node_load('123');
  $mode = _advpoll_get_mode($node->type);
  if (_advpoll_can_view_results($node)) {
    if (function_exists('advpoll_view_results_'. $mode)) {
      $results = call_user_func('advpoll_view_results_'. $mode, $node, $teaser, $page);
      $output = theme('advpoll_results', check_plain($node->title), $results['results'], $results['votes'], $node->links, $node->nid, $node->voted, $node->cancel_vote);
    }
  }
print $output;
PeterZ’s picture

I tried the solution above, but it didn't work for me.

I'd like to display results in the node for people that haven't voted.

I'm on 6.x (above may be 5.x specific). Does anyone have a 6.x solution?

Thanks,

kirkcaraway’s picture

I, too, would be interesting in the same thing, for D6 version. In fact, I'm not sure why you can't show the poll results and the voting checkboxes at the same time. Seems to me that would be the most simple and best display of a poll. Anyone want to take a shot at that? thanks.

pomliane’s picture

Status: Active » Closed (won't fix)

This version of Advanced Poll is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.