Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2009, 05:11 PM
Anyoldname Anyoldname is offline
 
Join Date: Jan 2009
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Word replacement filter

I've had a look around for a word replacement mod, but I can't seem to find quite what I am after.
I want to find something that works, dare I say it, like my old phpbb2 bad word filter, where I can set a word, for example 'Ugly' and then set a word, or even multiple words to replace it, for example 'not so pretty'. I could put an * either before or after the word to be replaced if I wanted all examples to be replaced, otherwise the exactl word only would be replaced.

Ideally, what I'd like to be able to do is replace words with html or BB code so that I could do this.
Vbulletin mods gets replaced with <a href="http://www.vbulletin.org>Vbulletin mods</a>

The final output to be something like: I have some Vbulletin mods on my forum.

Anyone know of any kind of mod that might be able to do this? It would be great for creating internal links to particular FAQ when people type common questions.
Reply With Quote
  #2  
Old 02-10-2009, 05:32 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.vbulletin.com/docs/html/main/replacements_intro" target="_blank">Replacement Variables</a>
Reply With Quote
  #3  
Old 02-10-2009, 02:37 PM
Anyoldname Anyoldname is offline
 
Join Date: Jan 2009
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks
I did look at using replacement variables, but they would affect the entire forum so I'm not sure that it would work.
For example if I changed the word "stick" into "stone". If I typed "sticky", it would output "stoney" right?

I need to be able to distinguish the word on its own rather than the string of letters within other words.
Reply With Quote
  #4  
Old 02-10-2009, 03:22 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

plugin at postbit_display_complete:

PHP Code:
$find = array( 
'Vbulletin mods'
'Ugly',  
); 

$replace = array( 
'<a href="http://www.vbulletin.org">Vbulletin mods</a>'
'not so pretty'
); 

$this->post['message'] = str_ireplace($find$replace$this->post['message']); 
Reply With Quote
  #5  
Old 04-21-2009, 04:55 PM
Joey Link Joey Link is offline
 
Join Date: Aug 2008
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
plugin at postbit_display_complete:

PHP Code:
$find = array( 
'Vbulletin mods'
'Ugly',  
); 

$replace = array( 
'<a href="http://www.vbulletin.org">Vbulletin mods</a>'
'not so pretty'
); 

$this->post['message'] = str_ireplace($find$replace$this->post['message']); 
What's this mean Lynne?
Reply With Quote
  #6  
Old 04-21-2009, 05:00 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What does it mean? It's a sample plugin for replacing a couple of words/terms in posts. Although, it looks like I forgot a " in there (which I will now go fix).
Reply With Quote
  #7  
Old 04-21-2009, 05:23 PM
Joey Link Joey Link is offline
 
Join Date: Aug 2008
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this different/better than going to the Replacement Variable Manager and adding terms?
Reply With Quote
  #8  
Old 04-21-2009, 05:26 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It really depends on what you are trying to do. The plugin I listed will only replace words in posts. Replacement Variables replace words/code throughout the entire site.
Reply With Quote
  #9  
Old 04-21-2009, 06:01 PM
Joey Link Joey Link is offline
 
Join Date: Aug 2008
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, so it sounds like what you posted is definitely what I want. I'm just looking to replace bad words with words I specify (or rather, one word). Will this work retroactively or only from the time I install it?

Also, I'm not entirely sure where I put the code. I see it says postbit_display_complete but I don't see that style template.
Reply With Quote
  #10  
Old 04-21-2009, 06:02 PM
BlueNinjaGo's Avatar
BlueNinjaGo BlueNinjaGo is offline
 
Join Date: Mar 2009
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
The plugin I listed will only replace words in posts.
Would that add much (or any) extra work on the server? Enough to be noticeable is what I'm asking....
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 04:34 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04781 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete