2 // pokus urobit neco z anketami:-))nerehocte sa moc hlasno:-))
5 global $node,$db,$error,$referer_id;
6 if (!$referer_id) $referer_id=1;
8 $node_id=$node['node_id'];
9 $user_id=$_SESSION['user_id'];
11 $set=$db->query("select * from node_access where node_id='$node_id' and user_id='$user_id' and node_permission='ban'");
12 if($set->getNumRows()>0) {
14 $error="F ankete si uz hlasoval. nene..uz sa to neda viackrat...dufam:-)";
18 $option=$_POST['poll_option'];
22 if (!is_numeric($option)) {
23 $error="incorrect poll_option. fck";
26 $poll=unserialize($node['node_content']);
27 ++$poll[$option]['number'];
28 $node_content=serialize($poll);
29 $db->query("update nodes set node_content='$node_content'
30 where node_id='$node_id'");
32 $db->query("update node_access set node_permission='ban' where
33 node_id='$node_id' and user_id='$user_id'");
34 Header("Location: /id/".$node['node_parent']."/");