I am working on integrating Advanced Poll, but extensive research of the Adv. Poll issues has proven fruitless into making it work.

I am using the following code I found here :
[code]
$node = node_load('114');
$node->teaser = $content;
unset($node->title);

print "

Your vote:

";
print node_view($node, $teasers, false, $links);
$output = theme('advpoll_results', check_plain($node->title), $results['results'], $results['votes'], $node->links, $node->nid, $node->voted, $node->cancel_vote);
[/code]

What happens with this code is that the vote doesn't get registered on certain computer figurations, they are thanked for the vote, but even after a refresh, the results do not show up. I am using version 5.x-1.x.-dev.

Before I do further debugging, I want to make sure I am using the preferred code to display a poll. Thanks for any help!

Comments

ChrisKennedy’s picture

Status: Active » Postponed (maintainer needs more info)

I have no idea what you mean, please elaborate.

Paintbox’s picture

Well, what I want to do is display a poll I made. I need the code for this. I grabbed the code I posted earlier from these threads but it doesn't work and I am sure I am doing something wrong.

I would be grateful if you could post the code you use to display an advanced poll. This may be code you use in a block, or code you can use in a say a node-frontpage.tpl file...

I hope I explained myself better this time, and thank you for any reply.

mrrjpp’s picture

The issue with advpoll is that the way poll form is loaded isn't very useful outside of the normal drupal scope. What should happen is a new function added that handles loading up the poll form (css, js, and the form itself) that way it can be reused in not so typical scenarios.

Anyways, this should do what you need, but it's still not the ideal solution:

$poll = advpoll_view($node, FALSE, TRUE);
print $poll->content['poll']['#value'];
Paintbox’s picture

Thank you very much for your reply, I will try this out ASAP. From what I understand it would be great if a function would be added for easy of use outside a node.

kenorb’s picture

Maybe something like:

node_view(node_load($node->nid), FALSE, TRUE);

Where $node->nid is nid of node to load.

PeterZ’s picture

I used this:

<div style="margin-left: auto; width: 240px; margin-right: auto">
<?php
  print node_view(node_load(array('nid' => 436)), 1);
?>
</div>

Replace 436 with the nodeid of your poll. Make sure to use PHP code as your input format.

pomliane’s picture

Status: Postponed (maintainer needs more info) » 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.

kenorb’s picture

Status: Closed (won't fix) » Closed (fixed)