Location: PHPKode > projects > ZompLog > plugins/spamwords/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 spamwords table

$query = "CREATE TABLE $prefix" . "_spamwords (

id int (10 ) NOT NULL auto_increment ,

spamword varchar (100 ) NOT NULL ,

PRIMARY KEY (id )

)";

$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'> $prefix" . "_spamwords created</div>";

// put some spamwords into the table

$spamwords = array("tramadol", "-online", "adipex", "advicer", "ambien", "bllogspot", "carisoprodol", "casino", "casinos", "baccarrat", "cialis", "cwas", "cyclen", "cyclobenzaprine", "day-trading", "discreetordering", "dutyfree", "duty-free", "fioricet", "freenet-shopping", "incest", "levitra", "macinstruct", "meridia", "online-gambling", "paxil", "phentermine", "platinum-celebs", "poker-chip", "poze", "prescription", "soma", "slot-machine", "taboo", "teen", "tramadol", "trim-spa", "ultram", "viagra", "xanax", "booker", "zolus", "chatroom");

foreach ($spamwords as $word) {

   $query = "INSERT INTO $prefix" . "_spamwords (spamword) VALUES ('$word')";

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

}

echo "<div class='text'><img src='../../install/images/check.gif'> List of spamwords added to $table_spamwords</div>";

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

   $query = "INSERT INTO $table_plugins (name,active,installed) VALUES ('spamwords','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