rocknrollover Posted January 18, 2011 Share Posted January 18, 2011 If anyone can add some insight I would appreciate it. L FFAScript Advertising Discussion Forum FFAScript.com => FFAScript Project - Troubleshooting and Problems => Topic started by: rocknrollover on January 17, 2011, 06:42:40 PM -------------------------------------------------------------------------------- Title: goodwords.txt Post by: rocknrollover on January 17, 2011, 06:42:40 PM -------------------------------------------------------------------------------- Anyone customize your script? I've done that extensively (dogffa.com) but I'm stuck on goodwords.txt How can I change this part of the script so that a goodwords.txt list is required in the description to post. For example unless the discription contains "German Shepard" or "GSD" then the submission is rejected Thanks, L ################################################################################################## $filename = "badwords.txt"; if (file_exists($filename)) { chmod($filename,0666); $x = 0; $fil = fopen($filename,"r"); while(!feof($fil)) { $badword = fgets($fil,4096); $badword = trim($badword); if ($badword) { if (strpos($title,$badword)) { $x = 1; break; } } } fclose($fil); chmod($filename,0000); } if ($x) { echo "<center><b>You have forbidden words in your description<br>"; echo "<a href=\"javascript:window.history.go(-1)\">Click here to go back</b></a></center>"; exit; } ##################################################################################################### -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: webnet on January 17, 2011, 07:15:58 PM -------------------------------------------------------------------------------- This is the code you need... Just replace the new code with the old code. Then you can use the badwords text field in the admin area to put in the good words. ################################### $filename = "badwords.txt"; if (file_exists($filename)) { chmod($filename,0666); $x = 0; $fil = fopen($filename,"r"); while(!feof($fil)) { $badword = fgets($fil,4096); $badword = trim($badword); if ($badword) { if (!strpos($title,$badword)) { $x = 1; break; } } } fclose($fil); chmod($filename,0000); } if ($x) { echo "<center><b>You need some special words in your description before you can submit<br>"; echo "<a href=\"javascript:window.history.go(-1)\">Click here to go back</b></a></center>"; exit; } ########################################################### -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: rocknrollover on January 17, 2011, 07:53:37 PM -------------------------------------------------------------------------------- Talk about a fix... I'm in one... I have changed a great deal. I modified the script a long time ago... never noticed the badwords didn't work. Now I have the same problem as "Script Not Blocking Bad Words or Duplicate Posts!" And I can download the new script that is fixed but weeding through it to find the changes ... what a job! Can you give me a hint what correction and what file makes the badword funtion work? -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: webnet on January 17, 2011, 08:10:23 PM -------------------------------------------------------------------------------- The badword function is in the submit.php file. -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: rocknrollover on January 17, 2011, 08:17:22 PM -------------------------------------------------------------------------------- Thanks. I found that and replaced it with your new modification. But where is the fix to ""Script Not Blocking Bad Words or Duplicate Posts!" The bad word didn't used to work... you fixed it. I don't think it was at submit.php. THanks for your time. I appreciate it. -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: webnet on January 17, 2011, 08:47:28 PM -------------------------------------------------------------------------------- it is a good idea if you download the latest version of the ffa script. Then you take the submit.php file from the latest version and replace the code shown above and then use it in the version you are running right now. -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: rocknrollover on January 17, 2011, 08:55:34 PM -------------------------------------------------------------------------------- I'm sorry. I did that... ran the 4.1 original submit.php it didn't catch badwords. And then I substituted the news code.. and it didn't exclude words other than those in badwords.txt. Is there anything other than this... permissions... other modifications in other places? It is almost like it is still running... the old old version... hang on I have an idea... L -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: webnet on January 17, 2011, 09:07:21 PM -------------------------------------------------------------------------------- Use this code... ####################################### $filename = "badwords.txt"; if (file_exists($filename)) { chmod($filename,0666); $x = 0; $fil = fopen($filename,"r"); while(!feof($fil)) { $badword = fgets($fil,4096); $badword = trim($badword); if ($badword) { if (!strpos(strtolower($title),strtolower($badword))) { $x = 1; break; } } } fclose($fil); chmod($filename,0000); } if ($x) { echo "<center><b>You need some special words in your description before you can submit</b><br>"; echo "<a href=\"javascript:window.history.go(-1)\">Click here to go back</a></center>"; exit; } ####################################################### -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: rocknrollover on January 17, 2011, 09:28:31 PM -------------------------------------------------------------------------------- That seems to prevent all words... Listen, I got to run. I appreciate your time. I will have to start all over again on a different day. Thanks, LEe -------------------------------------------------------------------------------- Title: Re: goodwords.txt Post by: rocknrollover on January 18, 2011, 02:33:58 PM -------------------------------------------------------------------------------- Well, I created a new FFA.. from the 4.1 and it does exclude the bad words as it is snd upposed to. However I take 4.1 submit.php to my modified dog FFA pages and it fails. and I tried both of the suggested dogs pasted into the new FFA and neither work to require the words in badwords.txt Forget about fixing my modifications problem ... I would be happy find a code that will require certain words in 4.1. If something comes to mind please let me know. Appreciate it. Lee Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Quote Link to comment https://forums.phpfreaks.com/topic/224863-goodwordstxt/ Share on other sites More sharing options...
Maq Posted January 18, 2011 Share Posted January 18, 2011 Please do not post a thread with replies from another forum. Ask your original question or the spot where are you currently stuck, no one will help you otherwise. Quote Link to comment https://forums.phpfreaks.com/topic/224863-goodwordstxt/#findComment-1161457 Share on other sites More sharing options...
rocknrollover Posted January 18, 2011 Author Share Posted January 18, 2011 Okay, we will start all over... Anyone customize a FFA script? I've done that extensively (dogffa.com) but I'm stuck on goodwords.txt How can I change this part of the script so that a goodwords.txt list is required in the description to post. For example unless the discription contains "German Shepard" or "GSD" then the submission is rejected Thanks, L ################################################################################################## $filename = "badwords.txt"; if (file_exists($filename)) { chmod($filename,0666); $x = 0; $fil = fopen($filename,"r"); while(!feof($fil)) { $badword = fgets($fil,4096); $badword = trim($badword); if ($badword) { if (strpos($title,$badword)) { $x = 1; break; } } } fclose($fil); chmod($filename,0000); } if ($x) { echo "<center><b>You have forbidden words in your description<br>"; echo "<a href=\"javascript:window.history.go(-1)\">Click here to go back</b></a></center>"; exit; } ##################################################################################################### Quote Link to comment https://forums.phpfreaks.com/topic/224863-goodwordstxt/#findComment-1161458 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.