3 function smarty_function_get_poll($params,&$smarty) {
5 if (!is_numeric($params['poll_id'])) $poll_id=$node['node_id'];
6 else $poll_id=$params['poll_id'];
7 $user_id=$_SESSION['user_id'];
8 $set=$db->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");
10 $option_array=unserialize($set->getString('node_content'));
11 $permission=$set->getString('node_permission');
13 if ($permission=='ban') $voted='yes';
16 $poll=Array("voted"=>$voted,"node_id"=>$set->getString('node_id'),"question"=>$set->getString('node_name'),"total"=>$set->getString('node_views'),"options"=>$option_array);
17 $smarty->assign('get_poll',$poll);
This page took 0.568495 seconds and 4 git commands to generate.