Example #1
0
		$poll->setVar("end_time", time() + (86400 * 10));
	}
	if ( $notify == 1 && $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 ( $reset == 1 ) {
		// reset all logs
		XoopsPollLog::deleteByPollId($poll->getVar("poll_id"));
		XoopsPollOption::resetCountByPollId($poll->getVar("poll_id"));
	}
	if (!$poll->store()) {
		echo $poll->getHtmlErrors();
		exit();
	}
	$poll->updateCount();
	include_once XOOPS_ROOT_PATH.'/class/template.php';
	xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
	redirect_header("index.php",1,_AM_DBUPDATED);
	exit();
}

if ( $op == "log" ) {
	xoops_cp_header();
	echo "<h4>"._AM_POLLCONF."</h4>";
	echo "<br>View Log<br> Sorry, not yet. ;-)";
	xoops_cp_footer();
	exit();
Example #2
0
		$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()) {
		forum_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();
Example #3
0
        $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();
}
Example #4
0
                $option = new XoopsPollOption();
                $option->setVar("option_text", $optxt);
                $option->setVar("option_color", $option_color[$i]);
                $option->setVar("poll_id", $new_poll_id);
                $option->store();
            }
            $i++;
        }
        $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET topic_haspoll = 1, poll_id = {$new_poll_id} WHERE topic_id = {$topic_id}";
        if (!($result = $xoopsDB->query($sql))) {
            xoops_error($xoopsDB->error());
        }
        include_once XOOPS_ROOT_PATH . '/class/template.php';
        xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
    } else {
        xoops_error($poll->getHtmlErrors());
        exit;
    }
    redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED);
    //exit();
}
if ($op == "edit") {
    $poll = new XoopsPoll($_GET['poll_id']);
    $poll_form = new XoopsThemeForm(_MD_POLL_EDITPOLL, "poll_form", "polls.php");
    $author_label = new XoopsFormLabel(_MD_POLL_AUTHOR, "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $poll->getVar("user_id") . "'>" . newbb_getUnameFromId($poll->getVar("user_id"), $xoopsModuleConfig['show_realname']) . "</a>");
    $poll_form->addElement($author_label);
    $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255, $poll->getVar("question", "E"));
    $poll_form->addElement($question_text);
    $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description", $poll->getVar("description", "E"));
    $poll_form->addElement($desc_tarea);
    $date = formatTimestamp($poll->getVar("end_time"), "Y-m-d H:i:s");