<?php
ob_start();
include_once("../../admin/functions.php");
include("../../admin/config.php");
include("../../admin/session.php");
include("../../admin/header.php");
$user = loadUser($_SESSION['login'],$link,$table_users);
?>
<div id="submenu"><a href="../../admin/plugins.php" class="sub">plugins</a></div>
<div id="side">
<div class="title"> </div>
<div class="box"><?php
if(!empty($messages)){
displayErrors($messages);
}
elseif($_GET[message] && empty($messages)){
displayMessage($_GET[message]);
}
else{
echo "Delete or add spamwords, to avoid comments with spam.";
}
?>
</div></div>
<div id="main">
<h1>Manage Spamwords</h1><br />
<?php
if($_POST["newspamword"]){
if(!$_POST[spamword]){
$messages[]="You did not fill out a new spamword";
}
if(empty($messages)) {
$spamword = addslashes($_POST[spamword]);
$query="INSERT INTO $prefix" . "_spamwords (spamword) VALUES ('$spamword')";
$result=mysql_query($query, $link) or die("Died inserting spamword into db. Error returned if any: ".mysql_error());
header("Location: admin.php?message=Added Spamword");
ob_end_flush();
}
}
?>
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
<fieldset id="titlediv">
<legend>Add Spamword</legend>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="text">
<tr>
<td width="75%"><input name="spamword" type="text" id="spamword"></td>
<td width="25%"><div class="right"><input type="submit" name="newspamword" value="Submit"></div></td>
</tr>
</table>
</fieldset>
</form>
<br />
<form name="form1" method="post" action="../../admin/schredder.php">
<input name="plugintable" type="hidden" value="<?php echo "$prefix" . "_spamwords"; ?>">
<fieldset id="titlediv">
<legend>Spamwords</legend>
<div class="text">
<?php
$query = "SELECT * FROM $prefix" . "_spamwords ORDER BY spamword ASC";
$result = mysql_query($query,$link) or die("Could not load list of spamwords.");
$spamwords = arrayMaker($result);
if(!$spamwords){
echo "$lang_no_results";
}
?>
<ul class="List">
<?php
foreach($spamwords as $spamdata){
$spamword = stripslashes($spamdata[spamword]);
?>
<li>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="text">
<tr>
<td width="75%"><?php echo $spamword?></td>
<td width="25%"><div class="right"><input type="checkbox" name="id[]" value="<?php echo "$spamdata[id]"; ?>"></div></td>
</tr>
</table>
</li>
<?php
}
?>
</ul>
<?php
if($spamwords){
?>
<div class="right"><input type="submit" name="Submit" value="delete"></div><br />
<?php } ?>
</div>
</fieldset>
</form>
</div>
<?php
include("../../admin/footer.php");
?>