Location: PHPKode > projects > Content*Builder > contentbuilder/plugins/poll/pollAddOption.inc.php
<?php
if(ADMIN & $cbPerms) {
	if(isset($addanswers)) {
		for($z = 1; $z <= $fields; $z++) {
			$text = "answer".$z;
			$text = $$text;
			if(!empty($text)) {
				$insertOption = mysql_query("INSERT INTO ".TABLE."_pollsanswer (poll, answer, type) VALUES ('$id', '$text', 'default')");
			}
			$messageList[] = $poll["answerAdded"];
			$tpl->assign("poll_answer_set", "0");
			
		}
		header("Location: $PHP_SELF?load=$load&sub=2&id=$id");
		exit();
	}
	
	$pollData = array();
	
	if(!ereg("(^[1-9]?[0-9]*$)", $fields)) $fields = 1;
	for($z = 1; $z <= $fields; $z++) {
		$answerNr[$z] = $z;
	}
	
	$pollData['pollID'] = $id;
	$pollData['fields'] = $fields;
	$pollData['answerNr'] = $answerNr;
	
	$tpl->assign("pollData", $pollData);
	
	$mainPluginContent[]  = $tpl->fetch($config['templates']."addAnswers.template", null, "pluginPoll".$cbUserID);
}


?>
Return current item: Content*Builder