| Samurize.com |
Chat
Forum Help
Search
Member List
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| Spewed |
Posted: Apr 6 2006, 12:44 PM
|
Our Blind Friend![]() ![]() ![]() ![]() ![]() ![]() Group: Moderating Crew
Joined: Jan 12 2006
Posts: 1,555
Offline |
I have a php gbook template (see attachment). How to add an action that defines a list of words, if the message that user try to send contain some of these words, the script don't allow the message to be sent?
It's enough, if the page just refresh after clicking submit, so I don't need a specific error page which tells the reason to user why the message didn't update. Why I need this is that I've got lots of poker, viagra etc. spam into my guestbook and I want to filter those messages into the deepest hell. ![]() Thanks. Attached File ( Number of downloads: 842 )
index.php
|
| Spewed |
Posted: Apr 9 2006, 10:28 AM
|
Our Blind Friend![]() ![]() ![]() ![]() ![]() ![]() Group: Moderating Crew
Joined: Jan 12 2006
Posts: 1,555
Offline |
Heyy, come on!
![]() Anyone have a glue or should I do some more googling here? |
| KMDonlon |
|
The Weather Freak![]() ![]() ![]() ![]() ![]() Group: Member
Joined: Feb 19 2004
Posts: 3,535
Offline |
Don't look at me
Also, the word you are looking for is CLUE, not glue -------------------- |
| Spewed |
Posted: Apr 9 2006, 12:08 PM
|
Our Blind Friend![]() ![]() ![]() ![]() ![]() ![]() Group: Moderating Crew
Joined: Jan 12 2006
Posts: 1,555
Offline |
Haha!
Or maybe I need some glue here..? |
| KMDonlon |
|
The Weather Freak![]() ![]() ![]() ![]() ![]() Group: Member
Joined: Feb 19 2004
Posts: 3,535
Offline |
I suck at PHP, usually Adam has to come to my rescue with issues here on our site when it is PHP related...........
Some times I feel Sofa King We Todd Ed -------------------- |
| Mythril |
Posted: Apr 9 2006, 05:34 PM
|
||
Samurai![]() ![]() ![]() ![]() Group: Member
Joined: May 8 2004
Posts: 134
Offline |
The easiest way I can think of doing this is to just define a list of words that you want to disable, then loop through that list and do a stripos() on the word and the input. Something like:
Note that I haven't tested the code nor do I know if this is the best way, but unless your guestbook is quite frequently used, performance shouldn't be an issue anyway. I guess. This post has been edited by Mythril on Apr 10 2006, 09:30 AM |
||
| Spewed |
Posted: Apr 10 2006, 06:37 AM
|
Our Blind Friend![]() ![]() ![]() ![]() ![]() ![]() Group: Moderating Crew
Joined: Jan 12 2006
Posts: 1,555
Offline |
That could do the job, thanks! I'll test it when I get home.
|
| Spewed |
Posted: Apr 10 2006, 02:31 PM
|
Our Blind Friend![]() ![]() ![]() ![]() ![]() ![]() Group: Moderating Crew
Joined: Jan 12 2006
Posts: 1,555
Offline |
Damn, can't figure it out where to add that foreach thing in the code. Could you do that for me Mythril?
|
| Mythril |
Posted: Apr 21 2006, 02:53 AM
|
||||
Samurai![]() ![]() ![]() ![]() Group: Member
Joined: May 8 2004
Posts: 134
Offline |
Ups, sorry, I've been on vacation, and adding in the fact that "Show new messages" hasn't worked in a while, I totally missed your message. Anyway, I've been looking more closely at the script, and I found that there is actually already a "bad words" list! It's on line 40 of the script. However, it seems like it just replaces the words with stars when they are shown! If you still want bad words messages to be completely blocked, you should add something similar to the code I gave on line 442 of the script. I added some example code in your script. If it doesn't work, you may need to change the line:
to
because stripos is only supported in PHP5. stripos should be faster though, which is why I used that in the script first. Attached File ( Number of downloads: 519 )
fixed.php
|
||||
| Spewed |
Posted: Apr 21 2006, 02:50 PM
|
Our Blind Friend![]() ![]() ![]() ![]() ![]() ![]() Group: Moderating Crew
Joined: Jan 12 2006
Posts: 1,555
Offline |
Actually got it working already. The publisher of the script had updated a $bannedwords function in it. Hope you didn't spend too much time to solve it.
I should have comment that before to this thread but I forgot. Thanks anyway! |
| Mythril |
Posted: Apr 21 2006, 02:55 PM
|
Samurai![]() ![]() ![]() ![]() Group: Member
Joined: May 8 2004
Posts: 134
Offline |
Heh, it's ok, glad you got it working. I don't think I spent too much time on it. Probably.
|
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
|
![]() ![]() ![]() |
Integrated by Koudanshi v1.4E © 2004 Bulletin Board Module.
Powered by Invision Power Board(U) v1.31 Final © 2003 IPS, Inc.
Powered by Invision Power Board(U) v1.31 Final © 2003 IPS, Inc.




















