Smut Stoper

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
SXL WEB
-


Joined: 13 Nov 2002
Posts: 28
Location: Elmira, NY - a small pleace from hell

PostPosted: Sat Nov 30, 2002 5:11 pm    Post subject: Smut Stoper Reply with quote

Dose any one know how to stop smut

i need a snippet of code. in php.

how to stop words from being used

ie.
i make a txt file full of words.
people go to my script. and try to use the word (f***)

it stops them from useing that word and replys "sorry but no vulgarity"

i want this to use many words not just the word f***.

so what ever word is in the txt file cant be used on my script.
_________________
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Sat Nov 30, 2002 6:36 pm    Post subject: Reply with quote

so you want a code that if ppl type CENSORED (sorry :-)) it shows ****

in that case:

<?php

/*

---scheldwoorden.txt-------

bitch
CENSORED
dick
goddamn

---------------------------

*/

class rude
{

function replace_rude_language($filename, $text)
{
// Lees het bestand regel voor regel in, en zet het in een array
$ar_words = file ($filename) or die ("Kan het opgegeven scheldwoordenbestand niet vinden, controleer of het bestand bestaat.");

/* Bij deze for-lus wordt het enter teken gefilterd; het enter teken bestaat uit twee bytes, het
Cr en het Lf teken. Het Cr teken is ascii 10 en het Lf teken is ascii 13
*/
for ($j = 0; $j < count($ar_words); $j++)
{
$replace_temp = str_replace(chr(10), '', $ar_words[$j]);
$ar_words_minus_enter[$j] = str_replace(chr(13), '', $replace_temp);
}

/* Dit is de lul die al het werk doet, deze lul bekijkt of er in het bericht een woord staat
dat niet is toegestaan, als het woord niet is toegestaan worden de middelste letter vervangen
door sterretje. VB: eikel -> e***l of lul -> l*l of klootzak -> k******k
*/
for ($i = 0; $i < count($ar_words_minus_enter); $i++)
{
// Zet het aantal sterretjes weer op nul, voor het volgende woord
$star = "";
/* Bepaal hoeveel sterretjes er moeten komen
die min twee slaat op het eerste teken en het laatste teken, die twee moeten tenslotte wel zichtbaar
blijven.
*/
for ($k = 0; $k < (strlen($ar_words_minus_enter[$i]) - 2); $k ++)
{
$star = $star . "*";
}

/* Hier wordt het woord vervangen: eerst de eerste letter, daarachter geplakt komt het aantal sterretjes en
daarachter het laatste teken
*/
$replace_by = substr($ar_words_minus_enter[$i], 0, 1) . $star . substr($ar_words_minus_enter[$i], -1);
$text = str_replace($ar_words_minus_enter[$i], $replace_by, $text);

}
// Geef het resultaat terug aan de functie
return $text;
}
}

$rude = new rude;
echo $rude->replace_rude_language('scheldwoorden.txt', *****);
?>
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
SXL WEB
-


Joined: 13 Nov 2002
Posts: 28
Location: Elmira, NY - a small pleace from hell

PostPosted: Sat Nov 30, 2002 6:39 pm    Post subject: OMG Reply with quote

if i know it was that long. i would of not asked but thanks for the help.
ill add a thank you spot on the readme for ya. do you have a site url
_________________
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Sat Nov 30, 2002 6:48 pm    Post subject: Reply with quote

My site url? i havn´t got one :P what do you mean? :roll:

my site, just some easy testsi still need a good design:

http://217.120.133.142/
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
SXL WEB
-


Joined: 13 Nov 2002
Posts: 28
Location: Elmira, NY - a small pleace from hell

PostPosted: Sat Nov 30, 2002 6:52 pm    Post subject: O Reply with quote

o ok dude i still have a problem with the script though
http://frozen-hell.net/script/sxtag_v4/post.php

its working but it only works with the word CENSORED (sorry)
_________________
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
SXL WEB
-


Joined: 13 Nov 2002
Posts: 28
Location: Elmira, NY - a small pleace from hell

PostPosted: Sat Nov 30, 2002 6:53 pm    Post subject: opps Reply with quote

http://frozen-hell.net/scripts/sxtag_v4/post.php
_________________
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Sat Nov 30, 2002 7:04 pm    Post subject: Reply with quote

first of all: make the newest post all up (SELECT bla bla bla bla(mysql command) ASC (or DESC, i forgot))

and euhm, it doesnt work :( try http://www.hotscripts.com, you can always find good working scripts there, i´m just a lonely php guy :-)
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
SXL WEB
-


Joined: 13 Nov 2002
Posts: 28
Location: Elmira, NY - a small pleace from hell

PostPosted: Sun Dec 01, 2002 3:25 am    Post subject: HE HE Reply with quote

lol well thanks man, im a vary new persion to php.
_________________
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Sun Dec 01, 2002 10:46 am    Post subject: Reply with quote

Wish i had GOOD and free websites in english, i only know dutch sites(http://www.phpfreakz.nl and http://www.jacqieline.com)

but hotscripts, you can find quite good scripts there
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
SXL WEB
-


Joined: 13 Nov 2002
Posts: 28
Location: Elmira, NY - a small pleace from hell

PostPosted: Thu Dec 05, 2002 10:02 pm    Post subject: believe Reply with quote

i believe i found away

$word = file("badwords.txt");
for($w=0;$w<count($word);$w++){
list($curse,$replacement,) = explode("|^|",$word[$w]);
$curse = str_replace("\\","\\\\\\\\",stripslashes($curse));
$replacement = str_replace("\\","\\\\\\\\",stripslashes($replacement));
$post = eregi_replace($curse,$replacement,$post);
}
_________________
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
!Keys
-


Joined: 23 Nov 2002
Posts: 156
Location: Holland, Enschede

PostPosted: Thu Dec 05, 2002 10:04 pm    Post subject: Reply with quote

$post = eregi_replace($theinput, thelinewhatitshouldbe);

is enough :roll:
_________________
!Keys || MwM^computerware
Back to top View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group