Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Word Replacement Details »»
Word Replacement
Version: 1.00, by applehat applehat is offline
Developer Last Online: May 2016 Show Printable Version Email this Page

Version: 3.5.0 RC2 Rating:
Released: 08-05-2005 Last Update: Never Installs: 36
 
No support by the author.

This is just a simple plug-in that will let you replace words in posts. This could be used for "AdWords" or Replacing curse words insted of just censoring.

Just thought I would share :-P

*cough* *cough*

I am a dumb novice, so this has no admin panel options or anything of that sort. If anyone ever wants to take this and make it all fancy, go ahead and just post.

Note: This should work on any 3.5 version that has the hook postbit_display_complete

This is the code...See how google is replaced with a link to google...make sence?
PHP Code:
$word = array(
'google',
'yahoo'
);

$link = array(
'<a href="http://google.com">google</a>',
'<a href="http://yahoo.com">yahoo</a>'
);


$this->post['message'] = str_replace($word$link$this->post['message']); 

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
Saudi Zoom

Comments
  #22  
Old 08-25-2005, 09:30 PM
TCM TCM is offline
 
Join Date: Dec 2004
Location: 3.6.8
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also, in the example, a link to google would be broken.

The user posts Google.

Instead of getting
HTML Code:
 <a href="http://google.com" target="_blank">Google</a>
They'd get

HTML Code:
 <a href="http://<a href="http://google.com">google</a>.com" target="_blank">Google</a>
The second google wouldn't even be replaced, beause this isn't even case sensitive.
Reply With Quote
  #23  
Old 08-26-2005, 02:56 AM
Audionuts Audionuts is offline
 
Join Date: Jun 2002
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you TCM
Reply With Quote
  #24  
Old 08-26-2005, 03:17 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TCM
Basicly all this hack is is a weakend verision of replacement variables. I don't even see why this thread still exists.

You can set replacement variables in Admin CP -> Styles & Templates -> Replacement Variables Manager
A hack like this is necessary BECAUSE it is weaker. If you change a word in the title of a thread to a link, then the replacement would mess up the link to the thread.

It would be ideal if the replacement system had an option. Replace everywhere or just replace in posts.
Reply With Quote
  #25  
Old 08-27-2005, 12:04 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You might need a simple regular expression here..
Reply With Quote
  #26  
Old 10-07-2005, 09:31 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nvm.
Reply With Quote
  #27  
Old 10-08-2005, 04:19 PM
G-man's Avatar
G-man G-man is offline
 
Join Date: Jun 2002
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works great but is there a workaround for the fact some people use caps in brand names and others do not? I tried to put in the same brand name twice once with and once without a cap not thinking it would try to apply the link to both. How can we make this where it does not matter if the word has caps in it or not?
Reply With Quote
  #28  
Old 11-20-2005, 06:06 AM
zagman76 zagman76 is offline
 
Join Date: Sep 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

-bump-


...any updates?
Reply With Quote
  #29  
Old 11-21-2005, 06:35 AM
GamerJunk.net's Avatar
GamerJunk.net GamerJunk.net is offline
 
Join Date: Jan 2004
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would be good for ads definatley...if I could find a good ad company that sells items like IGN does with their things
Reply With Quote
  #30  
Old 02-08-2006, 05:12 AM
Luggruff's Avatar
Luggruff Luggruff is offline
 
Join Date: Apr 2005
Posts: 239
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

don't have the postbit_display_complete template.. is there some other way? >_<
Reply With Quote
  #31  
Old 07-14-2006, 12:50 AM
kobescoresagain kobescoresagain is offline
 
Join Date: Feb 2005
Posts: 327
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so does this break links?
Reply With Quote
Reply

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

Forum Jump


All times are GMT. The time now is 11:29 PM.


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.04693 seconds
  • Memory Usage 2,307KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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