Support Forums

Bad Word filter

This is a discussion on Bad Word filter within the Modules / Plugins / Modifications forums, part of the Developer Forums category; What version of 68 Classifieds are you running? V 4.1.10 Developer Hey guys here is what I was thinking. I ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 05-04-2010, 01:39 AM   #1
Customer
 
Join Date: Mar 2010
Posts: 26
Rep Power: 7
danth6961 has a spectacular aura about
Lightbulb Bad Word filter

What version of 68 Classifieds are you running?
V 4.1.10 Developer

Hey guys here is what I was thinking. I have a pretty long list of bad words that I want to filter for and tbh I don't really want to hand jam them all into the database. So here is what I was thinking.

include "connect.php";

if(isset($_POST['submit']))

{
$filename=$_POST['filename'];

$forbidden = fopen("$filename", "r");

while (($data = fgets($forbidden)) !== FALSE)

{
$import="INSERT into "TABLE"("field1","field2")values('$data[0]','Quagmire')";

mysql_query($import) or die(mysql_error());
}

fclose($forbidden);
print "Import done";

}

else

{
print "<form action='import.php' method='post'>";

print "Type file name to import:<br>";

print "<input type='text' name='filename' size='20'><br>";

print "<input type='submit' name='submit' value='submit'></form>";
}

Any inputs or better ideas would be greatly appreciated.
danth6961 is offline   Reply With Quote
Old 05-04-2010, 11:12 AM   #2
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I'm still a rookie with all of the php stuff and may be talking out my [badword filter = 'ON'] &$#!, but wouldn't you need to 'explode' the file to import it first?

If you already have your list in a CSV, why don't you simply import it into the table with phpmyadmin?
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 05-04-2010, 01:58 PM   #3
Customer
 
Join Date: Mar 2010
Posts: 26
Rep Power: 7
danth6961 has a spectacular aura about
Default

LOL you think you're a rookie with php. This is honestly my first foray into the unix world. I have been a windows sys admin my entire career.

Any way I put the starter code up there and figured we could collaborate. Anyone can ad to it.

This isn't a CSV its a straight text file. Evey bad word will be replace with quagmire or your word of choice. Now we could do a fgetcsv and put two colums in so that you could have every bad word have a new and interesting word.

and as far as phpamin goes... see there's that second part about a better idea.
danth6961 is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Charge per word Unregistered Pre Sales Questions 2 11-28-2009 06:03 PM
Not sure how to word this... goin4savvy Technical Support 5 05-02-2008 10:06 AM
Bad Word Settings Success Technical Support 2 02-26-2008 10:20 PM


All times are GMT -4. The time now is 09:40 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0