$smarty->assign('path', $template_dir . '/poll.view.tpl'); break 1; // //Show the active polls // // //Show the active polls // default: $smarty->assign('main_layout', $config->get('poll', 'main-layout')); if (isset($_POST['inactive'])) { if ($poll->existsPoll($_POST['inactive'])) { $inactive = $poll->switchActive($_POST['inactive']); } } if (isset($_POST['send']) && $_POST['send'] == 1 && !$poll->hasAllreadyVoted($login->currentUserID(), $_POST['poll'])) { if (isset($_POST['question' . $_POST['poll']]) && is_array($_POST['question' . $_POST['poll']]) && $_POST['question' . $_POST['poll']] != null) { $voted = $poll->vote($login->currentUserID(), $_POST['poll'], $_POST['question' . $_POST['poll']]); } } // show a single poll if (isset($_GET['pollid'])) { if (isset($_POST['send_comment'])) { $comments->add('poll', $login->currentUserId(), $_POST['message'], $_GET['pollid']); } $poll_comments = $comments->get('poll', $_GET['pollid']); $poll_final_comments = array(); foreach ($poll_comments as $poll_comment) { $poll_comment['nickname'] = makeHtmlUrl($poll_comment['nickname'], makeUrl('profile', array('userid' => $poll_comment['userid']))); $poll_comment['date'] = date("d.m.Y H:i:s", $poll_comment['timestamp']); $poll_final_comments[] = $poll_comment;