delete_poll($id); unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate']); } if (isset($_POST['submit'])) { if($_POST['poll_title']) { $message = $poll -> submit_poll(); unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']); } else { $message = POLLAN_46; } } if (POLLACTION == "edit" && !$_POST['preview'] && !$_POST['submit']) { if ($sql->db_Select("polls", "*", "poll_id=".POLLID)) { $row = $sql->db_Fetch(); extract($row); $tmpArray = explode(chr(1), $poll_options); foreach($tmpArray as $option) { $_POST['poll_option'][] = $option; } $_POST['activate'] = $poll_active; $_POST['option_count'] = count($_POST['poll_option']); $_POST['poll_title'] = $poll_title; $_POST['poll_comment'] = $poll_comment; if ($poll_start_datestamp) { $tmp = getdate($poll_start_datestamp); $_POST['startmonth'] = $tmp['mon']; $_POST['startday'] = $tmp['mday']; $_POST['startyear'] = $tmp['year']; } if ($poll_end_datestamp) { $tmp = getdate($poll_end_datestamp); $_POST['endmonth'] = $tmp['mon']; $_POST['endday'] = $tmp['mday']; $_POST['endyear'] = $tmp['year']; } $_POST['multipleChoice'] = $poll_allow_multiple; $_POST['showResults'] = $poll_result_type; // Can't have everyone voting if tracking method is user ID $_POST['pollUserclass'] = (($poll_vote_userclass == e_UC_PUBLIC) && $poll_storage_method == 2) ? e_UC_MEMBER : $poll_vote_userclass; $_POST['storageMethod'] = $poll_storage_method; } } if (isset($_POST['preview'])) { // Can't have everyone voting if tracking method is user ID if (($_POST['pollUserclass'] == e_UC_PUBLIC) && ($_POST['storageMethod'] == 2)) $_POST['pollUserclass'] = e_UC_MEMBER; $poll->render_poll($_POST, "preview"); } if (isset($message)) { $ns->tablerender("", "
".$message."
"); } $text = "
"; if ($poll_total = $sql->db_Select("polls", "*", "poll_type=1")) { $text .= ""; while ($row = $sql->db_Fetch()) { extract($row); $text .= ""; } $text .= "
ID ".POLLAN_3." ".POLLAN_4."
$poll_id ".$tp -> toHTML($poll_title, TRUE,"no_hook, emotes_off, defs")."
". $rs->form_button("button", "main_edit_{$poll_id}", POLLAN_5, "onclick=\"document.location='".e_SELF."?edit.$poll_id'\""). $rs->form_button("submit", "main_delete_{$poll_id}", POLLAN_6, "onclick=\"confirm_($poll_id)\"")."
"; } else { $text .= "
".POLLAN_7."
"; } $text .= "
"; $ns->tablerender(POLLAN_1, $text); $poll_total = $sql->db_Select("polls"); $text = $poll -> renderPollForm(); $ns->tablerender(POLLAN_2, $text); require_once(e_ADMIN."footer.php"); function headerjs() { global $tp; $headerjs = ""; return $headerjs; } ?>