function advpoll_process_writein in Advanced Poll 7
Same name and namespace in other branches
- 7.3 advpoll.module \advpoll_process_writein()
- 7.2 advpoll.module \advpoll_process_writein()
2 calls to advpoll_process_writein()
- advpoll_form_submit in ./
advpoll.module - Submit handler for voting
- advpoll_ranking_submit in advpoll_ranking/
advpoll_ranking.module
File
- ./
advpoll.module, line 750
Code
function advpoll_process_writein($nid, $writein, $data) {
$node = node_load($nid);
$id = dechex(time() * rand(5, 50));
$writein_choice = array();
if ($node) {
$nodeChoices = $node->advpoll_choice[$node->language];
$writein_choice = array(
'choice' => $writein,
'write_in' => 1,
'choice_id' => $id,
);
$nodeChoices[] = $writein_choice;
$node->advpoll_choice[$node->language] = $nodeChoices;
node_save($node);
}
return $writein_choice;
}