page_exists($rate)) { return false; } } if (empty($id)) { $id = $polllib->get_random_poll("a"); } if ($id == "current") { $id = $polllib->get_random_poll("c"); } if ($tiki_p_view_poll_results != 'y' && $tiki_p_vote_poll != 'y') { return tra('You do not have the permission that is needed to use this feature'); } if ($id) { $menu_info = $polllib->get_poll($id); if ($menu_info) { $channels = $polllib->list_poll_options($id); if ($prefs['feature_poll_comments'] == 'y') { $comments_count = TikiLib::lib('comments')->count_comments("poll:" . $menu_info["pollId"]); } else { $comments_count = 0; } $smarty->assign('comments_cant', $comments_count); if ($tiki_p_view_poll_results == 'y') { $smarty->assign('ownurl', 'tiki-poll_results.php?pollId=' . $id); } $smarty->assign('menu_info', $menu_info); $smarty->assign('channels', $channels); $ret = $smarty->fetch('tiki-poll.tpl'); return $ret; } } }