You are here

function advpoll_update in Advanced Poll 6.3

Same name and namespace in other branches
  1. 5 advpoll.module \advpoll_update()
  2. 6 advpoll.module \advpoll_update()
  3. 6.2 advpoll.module \advpoll_update()

Implementation of hook_update().

This is called upon node edition.

File

./advpoll.module, line 846
Advanced Poll - a sophisticated polling module for voting, elections, and group decision-making.

Code

function advpoll_update($node) {
  db_query("UPDATE {advpoll} \n              SET active = %d, \n              max_choices = %d, \n              algorithm = '%s', \n              use_list = %d, \n              show_votes = %d, \n              create_view_block = %d,  \n              start_date = '%s', \n              end_date = '%s', \n              writeins = %d, \n              show_writeins = %d, \n              footer_message = '%s'  \n              WHERE nid = %d", !$node->settings['close'], $node->settings['max_choices'], $node->settings['algorithm'], $node->settings['use_list'], $node->settings['show_votes'], $node->settings['create_view_block'], $node->settings['start_date'] ? strtotime($node->settings['start_date']) : 0, $node->settings['end_date'] ? strtotime($node->settings['end_date']) : 0, $node->settings['writeins'], $node->settings['show_writeins'], isset($node->footer_message) ? filter_xss($node->footer_message) : '', $node->nid);
  _advpoll_insert_choices($node);
  votingapi_recalculate_results('advpoll', $node->nid);
}