I'm trying to get Drupal to generate/create a new poll at certain times

3 replies [Last post]
Offline
Joined: 07/24/2010
I am trying to get Drupal to generate/create a new binary poll (with the use of the advanced poll module) every time a new subject is posted. I am trying to create a site where people log on and post arguments on different subjects and then anyone, including anonymous users can vote on which side of the argument that they side with. How can I get Drupal to create a new binary poll when a new subject is posted? Please help me please. I am still new to Drupal. I am brand new to this site's forum. This is my first post to this forum. I am thinking that I need to use the Views module, but the problem with that is that I am not good with using the Views module. Any help would be grateful. - Brett Deason
Offline
Joined: 07/24/2010
a new poll per new subject
I am trying to get Drupal to automatically create/generate a new poll for each new subject that is posted so that each subject has its own poll for everyone to vote to - Brett
philipnorton42's picture
Offline
Joined: 04/04/2010
I'm pretty sure you'll need
I'm pretty sure you'll need to use the hook_nodeapi() hook to do that sort of thing. http://api.drupal.org/api/function/hook_nodeapi Should be a process of creating the poll you want (which would be a node) every time a new node of a particular type is created. In this case, the $op parameter would read 'insert'. It's quite easy to create nodes in Drupal, this page on the Ddrupal forums is quite helpful: http://drupal.org/node/283261
philipnorton42's picture
Offline
Joined: 04/04/2010
Another thought might be to
Another thought might be to use a ratings module, like Fivestar: http://drupalmodules.com/module/fivestar Based on your description you will probably want Vote Up Down, which would give you your binary voting mechanism. http://drupal.org/project/vote_up_down

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <h4> <h5> <h6> <pre> <span> <p> <br />
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.