X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=inc%2Fsmarty%2Fnode_methodz%2Ffunction.get_poll.php;fp=inc%2Fsmarty%2Fnode_methodz%2Ffunction.get_poll.php;h=fbe6c8fae2c877aedc1b9de392e67655829c194a;hb=e586807dafc64c3fe152ab518599e6cf3f0f84e1;hp=0000000000000000000000000000000000000000;hpb=bc13d5d6e1834068f8b690c32bba114e352dacdd;p=mirrors%2FKyberia-bloodline.git diff --git a/inc/smarty/node_methodz/function.get_poll.php b/inc/smarty/node_methodz/function.get_poll.php new file mode 100644 index 0000000..fbe6c8f --- /dev/null +++ b/inc/smarty/node_methodz/function.get_poll.php @@ -0,0 +1,30 @@ +query("select nodes.*,node_content.node_content,node_access.node_permission from nodes left join node_content on node_content.node_id=nodes.node_id left join node_access on (nodes.node_id=node_access.node_id and node_access.user_id='$user_id') where node_parent='$poll_id' and node_type='11' order by node_id desc limit 1"); +// echo "select nodes.*,node_content.node_content,node_access.node_permission from nodes left join node_content on node_content.node_id=nodes.node_id left join node_access on (nodes.node_id=node_access.node_id and node_access.user_id='$user_id') where node_parent='$poll_id' and node_type='11' order by node_id desc limit 1"; + $set->next(); + $array=$set->getRecord(); + if ($array['node_permission']=='ban') $voted='yes'; + else $voted='no'; + } + + $option_array=unserialize($array['node_content']); + $permission=$array['node_permission']; + + $poll=Array("voted"=>$voted,"node_id"=>$array['node_id'],"question"=>$array['node_name'],"total"=>$array['node_views'],"options"=>$option_array); + $smarty->assign('get_poll',$poll); + +} +?> \ No newline at end of file