Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 08 Sep 2010, 06:27
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Question plugin for removing a string of text from a post...

I saw this posted before but can't find it after extensive searching...

Say I need to remove 1 word 1 time from every post if it's in there when the post is submitted... can someone give me the php code to put in a plugin to do this- mainly I need what piece of data I need to edit, like is it $post[text] ? I know I can use a string function to search for a string and replace it with an empty string effectively removing the word if exists...

Also what hook location would you recommend I use? I want to remove the text before it gets into the database if possible.

Thanks...
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #2  
Old 08 Sep 2010, 13:47
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You could use newpost_process and change $post['message']. That changes the message text even if the user is just previewing (although if that's not what you want you could check for that). Also, it doesn't do anything to posts being edited, only new posts.

Is this any different than the built-in censoring? I've never tried to use that.
Reply With Quote
  #3  
Old 08 Sep 2010, 14:38
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Thanks...

It's different because the censor replaces each letter with a character like * or + whereas this will remove it altogether. Also my intent is to use it on a fairly large string that I don't think would work well with the censor.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.

Last edited by BirdOPrey5; 08 Sep 2010 at 14:55.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:07.

Layout Options | Width: Wide Color: