$xoopsMailer->setToUsers($author); $xoopsMailer->assign("POLL_QUESTION", $poll->getVar("question")); $xoopsMailer->assign("POLL_START", formatTimestamp($poll->getVar("start_time"), "l", $author->timezone())); $xoopsMailer->assign("POLL_END", formatTimestamp($poll->getVar("end_time"), "l", $author->timezone())); $xoopsMailer->assign("POLL_VOTES", $poll->getVar("votes")); $xoopsMailer->assign("POLL_VOTERS", $poll->getVar("voters")); $xoopsMailer->assign("POLL_ID", $poll->getVar("poll_id")); $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']); $xoopsMailer->assign("ADMINMAIL", $xoopsConfig['adminmail']); $xoopsMailer->assign("SITEURL", $xoopsConfig['xoops_url'] . "/"); $xoopsMailer->setFromEmail($xoopsConfig['adminmail']); $xoopsMailer->setFromName($xoopsConfig['sitename']); $xoopsMailer->setSubject(sprintf(_PL_YOURPOLLAT, $author->uname(), $xoopsConfig['sitename'])); if ($xoopsMailer->send() != false) { $poll->setVar("mail_status", POLL_MAILED); $poll->store(); } } } if ($url != null) { redirect_header($url, 1, $msg); } else { redirect_header(XOOPS_URL . "/modules/xoopspoll/pollresults.php?poll_id={$poll_id}", 1, $msg); } exit; } elseif (!empty($poll_id)) { $xoopsOption['template_main'] = 'xoopspoll_view.html'; include XOOPS_ROOT_PATH . "/header.php"; $poll = new XoopsPoll($poll_id); $renderer = new XoopsPollRenderer($poll); $renderer->assignForm($xoopsTpl);
} else { $poll->setVar("end_time", time() + 86400 * 10); } if (!empty($_POST["notify"]) && $end_time > time()) { // if notify, set mail status to "not mailed" $poll->setVar("mail_status", POLL_NOTMAILED); } else { // if not notify, set mail status to already "mailed" $poll->setVar("mail_status", POLL_MAILED); } if (!empty($_POST["reset"])) { // reset all logs XoopsPollLog::deleteByPollId($poll->getVar("poll_id")); XoopsPollOption::resetCountByPollId($poll->getVar("poll_id")); } if (!$poll->store()) { newbb_message($poll->getHtmlErrors()); exit; } $poll->updateCount(); include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($xoopsModule->getVar('mid')); redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); //exit(); } if ($op == "log") { //include XOOPS_ROOT_PATH."/header.php"; echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; echo "<br />View Log<br /> Sorry, not yet. ;-)"; //include XOOPS_ROOT_PATH."/footer.php"; //exit();