X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Finc%2Feventz%2Fvote.inc;h=77d484769304ebf2441d320b44417a8783a856ca;hb=ac3bdc7218ef24f47f2d6adaae65c59079900665;hp=31571d7ac3ad1e9deba188b981207e1dcfdb93fc;hpb=51ff32267c4949bad6a8dddc502cbc01ed56edc8;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/inc/eventz/vote.inc b/wwwroot/inc/eventz/vote.inc index 31571d7..77d4847 100644 --- a/wwwroot/inc/eventz/vote.inc +++ b/wwwroot/inc/eventz/vote.inc @@ -1,37 +1,38 @@ query("select * from node_access where node_id='$node_id' and user_id='$user_id' and node_permission='ban'"); - if($set->getNumRows()>0) { - global $error; - $error="F ankete si uz hlasoval. nene..uz sa to neda viackrat...dufam:-)"; - return false; } + $set=$db->query("select * from node_access where node_id='$node_id' + and user_id='$user_id' and node_permission='ban'"); + if($set->getNumRows()>0) { + global $error; + $error="One vote is enough for everyone"; + return false; + } -$option=$_POST['poll_option']; + $option=$_POST['poll_option']; + $option--; -$option--; + if (!is_numeric($option)) { + $error="incorrect poll_option. fck"; + } -if (!is_numeric($option)) { - $error="incorrect poll_option. fck"; - } + $poll=unserialize($node['node_content']); + ++$poll[$option]['number']; + $node_content=serialize($poll); + $db->query("update nodes set node_content='$node_content' + where node_id='$node_id'"); - $poll=unserialize($node['node_content']); - ++$poll[$option]['number']; - $node_content=serialize($poll); - $db->query("update nodes set node_content='$node_content' -where node_id='$node_id'"); + $db->query("update node_access set node_permission='ban' where + node_id='$node_id' and user_id='$user_id'"); + Header("Location: /id/".$node['node_parent']."/"); +} -$db->query("update node_access set node_permission='ban' where -node_id='$node_id' and user_id='$user_id'"); - Header("Location: /id/".$node['node_parent']."/"); - - } -?> \ No newline at end of file +?>