Location: PHPKode > projects > Content*Builder > contentbuilder/plugins/poll/pollOverview.inc.php
<?php
	/*
	* Comment (ger)
	* Funktion, die alle Artikel dieser Seite online setzt.
	*/
	if(isset($onbox)) {
		reset($onbox);
		while(list($k, $v) = each($onbox)) {
			$dquery = mysql_query("UPDATE ".TABLE."_pollsquery SET active = 'yes' WHERE id = '$v'");
		}
	}
		
	/*
	* Comment (ger)
	* Funktion zum Offline-Schalten der Artikel - alle markierten Artikel
	* gehen damit offline.
	*/
	if(isset($offbox)) {
		reset($offbox);
		while(list($k, $v) = each($offbox)) {
			$dquery = mysql_query("UPDATE ".TABLE."_pollsquery SET active = 'no' WHERE id = '$v'");
		}
	}
	
	if(isset($delbox)) {
		$delbox2 = $delbox;
		unset($delbox);
		reset($delbox2);
		while(list($k, $v) = each($delbox2)) {
			$delbox[$k] = $v;
		}
		reset($delbox);
		while(list($k, $v) = each($delbox)) {
			$dquery = mysql_query("DELETE FROM ".TABLE."_pollsquery WHERE  id='$v'");
			$dquery = mysql_query("DELETE FROM ".TABLE."_pollsanswer WHERE poll='$v'");
		}
	}	
	
	$queryt = mysql_query("SELECT * FROM ".TABLE."_pollsquery ORDER BY valid_from DESC");
	
	if(!$queryt) {
		$errorList[] = $poll["noPoll"];
	} else {
		$counter = 0;
		while($getquery = mysql_fetch_array($queryt)) {
			$title = substr($getquery["description"],0,25);
			if(strlen($getquery["description"]) > 25) {
				$title .= "...";
			}

			$validFrom      = $getquery["valid_from"];
			$validTo        = $getquery["valid_until"];
			
			// Off Box checked
			if($getquery["active"] != "yes") {$thisBox = '1';} else {$thisBox = '0';}

			$pollData[$counter]['id']       = $getquery["id"];
			$pollData[$counter]['title']    = $title;
			$pollData[$counter]['dateFrom'] = $validFrom;
			$pollData[$counter]['dateTo']   = $validTo;
			$pollData[$counter]['checked']  = $thisBox;
			++$counter;		
		}
		$tpl->assign("overview_set", "1");
	}	

	$tpl->assign("pollData", $pollData);
	
	$mainPluginContent[]  = $tpl->fetch($config['templates']."overview.template", null, "pluginPoll".$cbUserID);
	$mainMessageContent[] = $tpl->fetch($config['templates']."messages.template", null, "pluginPoll".$cbUserID);
?>
Return current item: Content*Builder