X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=inc%2Fsmarty%2Fnode_methodz%2Ffunction.get_polls.php;fp=inc%2Fsmarty%2Fnode_methodz%2Ffunction.get_polls.php;h=b54fb4cc4b81ee54e570cee9286e73f0b50c8491;hb=e586807dafc64c3fe152ab518599e6cf3f0f84e1;hp=0000000000000000000000000000000000000000;hpb=bc13d5d6e1834068f8b690c32bba114e352dacdd;p=mirrors%2FKyberia-bloodline.git diff --git a/inc/smarty/node_methodz/function.get_polls.php b/inc/smarty/node_methodz/function.get_polls.php new file mode 100644 index 0000000..b54fb4c --- /dev/null +++ b/inc/smarty/node_methodz/function.get_polls.php @@ -0,0 +1,20 @@ +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"); + $set->next(); + $option_array=unserialize($set->getString('node_content')); + $permission=$set->getString('node_permission'); + + if ($permission=='ban') $voted='yes'; + else $voted='no'; + + $poll=Array("voted"=>$voted,"node_id"=>$set->getString('node_id'),"question"=>$set->getString('node_name'),"total"=>$set->getString('node_views'),"options"=>$option_array); + $smarty->assign('get_poll',$poll); + print_r($poll); +} +?> \ No newline at end of file