Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[HACK] Word censor in shoutbox
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-02-14 14:58:35
in mysql create:

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 Words



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 ^_^
Unknown User
2008-02-14 15:09:44
Thanks very nice
Unknown User
2008-03-09 14:06:08
Missing something from this code?

		//censored words

$result = mysql_query("SELECT * FROM censor");

while ($row = mysql_fetch_assoc($result))

$s = str_replace($row['word'], $row['censor'], $s);
beacause when i try to acces "Morte tags" i got this error




Warning: mysql_query() [function.mysql-query]: Access denied for user 'myuser'@'localhost' (using password: NO) in /home/xxx/public_html/xx/backend/functions.php on line 757



Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/xx/backend/functions.php on line 758



and to this line 757, 758 i have this 2 line

for line 757:        $result = mysql_query("SELECT * FROM censor");

for line 758:          while ($row = mysql_fetch_assoc($result))
Unknown User
2008-03-09 14:24:13
add dbconn(false); to backend/tags.php

Also: this isn't just for the shoutbox, it's for everywhere (comments, PMs, torrent descriptions, etc..)

- Added to SVN
Unknown User
2008-03-09 15:08:38
"TorrentialStorm, post: 39886":
add dbconn(false); to backend/tags.php
Also: this isn't just for the shoutbox, it's for everywhere (comments, PMs, torrent descriptions, etc..)

- Added to SVN



working, thanks verry mutch
Unknown User
2008-03-21 22:51:14
helo

i can't deleet words ilt's normal ?
Unknown User
2008-03-22 13:40:55
Thank You  :D
Unknown User
2008-03-22 17:52:16
i have noticed that problem. just delete it in your phpadmin.

"sharkange, post: 40350":
helo
i can't deleet words ilt's normal ?
Unknown User
2008-03-22 18:47:50
thank you  :D

but dent can't add the command to this ?
Unknown User
2008-05-31 22:10:45
in shootbox censor not working
Unknown User
2008-06-14 00:14:08
word censor don't work in shoutbox

please??
Unknown User
2008-07-24 22:45:10
help me
Unknown User
2008-08-13 22:27:14
"kevito, post: 44808":
help me

This my code as whe i add a bad word and it is said in shoutbox it automatically puts the censored image

censoredword.JPG
censoredword.JPG
Unknown User
2008-08-15 17:23:38
Has he there a code has to put in shoutbox.php
Unknown User
2008-08-16 14:07:41
"kevito, post: 45584":
Has he there a code has to put in shoutbox.php

there isn't any code for the shoutbox. all the code you see here is what you need.
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728