vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   plugin for removing a string of text from a post... (https://vborg.vbsupport.ru/showthread.php?t=250140)

BirdOPrey5 09-08-2010 05:27 AM

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...

kh99 09-08-2010 12:47 PM

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.

BirdOPrey5 09-08-2010 01:38 PM

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.


All times are GMT. The time now is 06:31 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00983 seconds
  • Memory Usage 1,706KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete