in mysql create:
no that should be it. you will have to find a pic to use for the cp or you can use the one that is in this code. also i did not change the way the background of the table so if you want it to look like the rest then you will have to change it yourself. i hope you enjoy ^_^
CREATE TABLE `censor` (
`word` varchar(10) NOT NULL default '',
`censor` varchar(10) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `censor` VALUES ('fuck', 'f**k');now open functions.php and find:// Smilies
require_once("backend/smilies.php");
reset($smilies);
while (list($code, $url) = each($smilies))
$s = str_replace($code, "<img border=0 src=" . $site_config['SITEURL'] . "/images/smilies/$url>", $s);
add after:
//censored words
$result = mysql_query("SELECT * FROM censor");
while ($row = mysql_fetch_assoc($result))
$s = str_replace($row['word'], $row['censor'], $s);
now open admincp.php and find:
<td align="center"><a href=admincp.php?action=style><img src="images/admin/themes.gif" border=0 width=32 height=32><BR>Theme Management</a><BR></td>
add this after:
<td align="center"><a href=admincp.php?action=censor><img src="images/admin/settings.png" border=0 width=32 height=32><BR>Censor</a><BR></td>
now at the end of the page befor the ?> add:
#======================================================================#
# Word Censor Filter
#======================================================================#
if($action == "censor") {
stdhead("Censor");
navmenu();
//Output
if ($_POST['submit'] == 'Add Censor'){
$query = "INSERT INTO censor (word, censor) VALUES ('" . $_POST['word'] . "','" . $_POST['censor'] . "');";
mysql_query($query);
}
if ($_POST['action'] == 'Delete Censor'){
$aquery = "DELETE FROM censor WHERE word = '" . $_POST['censor'] . "' LIMIT 1";
mysql_query($aquery);
}
begin_frame("Edit Censored Words", center);
/*------------------
|HTML form for Word Censor
------------------*/
?>
<div align="center">
<table width='100%' cellspacing='3' cellpadding='3'>
<tr>
<td bgcolor='#eeeeee' colspan="2"><b><font face="Verdana" size="1">
Client Agent Ban Settings<br /></font><font size="1" face="Times New Roman">
</font></b><font size="1" face="Verdana">These settings control the Censored Words.<font></td>
</tr>
<form id="Add Censor" name="Add Censor" method="POST" action="./admincp.php?action=censor">
<tr>
<td bgcolor='#eeeeee'><font face="Verdana" size="1">Add Word Censor: <input type="text" name="word" id="word" size="50" maxlength="255" value=""></font></td></tr>
<tr><td bgcolor='#eeeeee'><font face="Verdana" size="1">Censor Word With: <input type="text" name="censor" id="censor" size="50" maxlength="255" value=""></font></td></tr>
<tr><td bgcolor='#eeeeee' align='left'>
<font size="1" face="Verdana"><input type="submit" name="submit" value="Add Censor"></font></td>
</tr>
</form>
<form id="Delete Censor" name="Delete Censor" method="POST" action="./admincp.php?action=censor">
<tr>
<td bgcolor='#eeeeee'><font face="Verdana" size="1">Remove Censor For: <select name="censor">
<?
/*-------------
|Get the words currently censored
-------------*/
$select = "SELECT word FROM censor ORDER BY word";
$sres = mysql_query($select);
while ($srow = mysql_fetch_array($sres))
{
echo "<option>" . $srow[0] . "</option>\n";
}
echo'</select></font></td></tr><tr><td bgcolor="#eeeeee" align="left">
<font size="1" face="Verdana"><input type="submit" name="action" value="Delete Censor"></font></td>
</tr></form></table><br>';
end_frame();
}
// End forum Censored Wordsno that should be it. you will have to find a pic to use for the cp or you can use the one that is in this code. also i did not change the way the background of the table so if you want it to look like the rest then you will have to change it yourself. i hope you enjoy ^_^