Location: PHPKode > projects > ZompLog > plugins/poll/install.php
<?php

ob_start();

include_once("../../admin/functions.php");
include("../../admin/config.php");
include("../../admin/session.php");
include("../../admin/header.php");
?>

<div id="submenu"><a href="../../admin/plugins.php" class="sub">plugins</a></div>


<div id="side">
<div class="title">&nbsp;</div>
<div class="box"><?php
if(!empty($messages)){
	displayErrors($messages);
}

elseif($_GET[message] && empty($messages)){
  	displayMessage($_GET[message]);
}

else{
  	echo "Install plugin.";
}  
  
?>
</div></div>


<div id="main">
<h1>Install plugin</h1><br />
<?php

		
// create poll table

$query = "CREATE TABLE `$prefix"."_poll` (
`id` int(11) NOT NULL auto_increment,
`vraag` varchar(200) NOT NULL default '',
`actief` int(1) NOT NULL default '0',
`datum` int(20) NOT NULL default '0',
`keuze1` varchar(50) NOT NULL default '',
`keuze2` varchar(50) NOT NULL default '',
`keuze3` varchar(50) NOT NULL default '',
`keuze4` varchar(50) NOT NULL default '',
`keuze5` varchar(50) NOT NULL default '',
`keuze6` varchar(50) NOT NULL default '',
`keuze7` varchar(50) NOT NULL default '',
`keuze8` varchar(50) NOT NULL default '',
`keuze9` varchar(50) NOT NULL default '',
`keuze10` varchar(50) NOT NULL default '',
`antwoord1` int(11) NOT NULL default '0',
`antwoord2` int(11) NOT NULL default '0',
`antwoord3` int(11) NOT NULL default '0',
`antwoord4` int(11) NOT NULL default '0',
`antwoord5` int(11) NOT NULL default '0',
`antwoord6` int(11) NOT NULL default '0',
`antwoord7` int(11) NOT NULL default '0',
`antwoord8` int(11) NOT NULL default '0',
`antwoord9` int(11) NOT NULL default '0',
`antwoord10` int(11) NOT NULL default '0',
`gestemd` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=5"; 
		

$q = mysql_query($query) or die ("Plugin could not be installed or has already been installed.<br /><br />"); 
echo "<div class='text'><img src='../../install/images/check.gif'> poll created</div>";



// lastly we set the plugin to active, so it is available

   $query = "INSERT INTO $table_plugins (name,active,installed) VALUES ('poll','1','1')";

   mysql_query($query) or die (mysql_error());


echo "<div class='text'><img src='../../install/images/check.gif'> Plugin set to active! All set!</div><br />";

		echo "go back to <a href='../../admin/plugins.php'>plugins-panel</a>";

?>
</div>
<?php include ("../../admin/footer.php"); ?>
Return current item: ZompLog