function advpoll_update in Advanced Poll 6.2
Same name and namespace in other branches
- 5 advpoll.module \advpoll_update()
- 6.3 advpoll.module \advpoll_update()
- 6 advpoll.module \advpoll_update()
Implementation of hook_update().
This is called upon node edition.
File
- ./
advpoll.module, line 771 - Advanced Poll - a sophisticated polling module for voting, elections, and group decision-making.
Code
function advpoll_update($node) {
db_query("UPDATE {advpoll} SET active = %d, max_choices = %d, algorithm = '%s', use_list = %d, show_votes = %d, create_view_block = %d, start_date = '%s', end_date = '%s', writeins = %d, show_writeins = %d, question = '%s' 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->question) ? $node->question : '', $node->nid);
_advpoll_insert_choices($node);
votingapi_recalculate_results('advpoll', $node->nid);
advpoll_update_views();
}