2 // bugfix. Opravuje zobrazovanie ankiet v nadparentoch kde nemaju byt.
3 function smarty_function_get_poll($params,&$smarty) {
5 $user_id=$_SESSION['user_id'];
6 $node_vector=$node['node_vector'];
7 if (!is_numeric($params['poll_id'])) $poll_id=$node['node_id'];
8 else $poll_id=$params['poll_id'];
10 if (is_array($params['poll'])) {
11 $array=$params['poll'];
16 $set=$db->query("select nodes.*,node_access.node_permission from nodes 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 template_id='1549834' order by node_id desc limit 1");
19 $array=$set->getRecord();
20 if ($array['node_permission']=='ban') $voted='yes';
24 $option_array=unserialize($array['node_content']);
25 $permission=$array['node_permission'];
27 $poll=Array("voted"=>$voted,"node_id"=>$array['node_id'],"question"=>$array['node_name'],"total"=>$array['node_views'],"options"=>$option_array);
28 $smarty->assign('get_poll',$poll);
This page took 0.258233 seconds and 4 git commands to generate.