Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Replace Text Details »»
Replace Text
Version: 1.00, by amykhar amykhar is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-12-2003 Last Update: Never Installs: 18
 
No support by the author.

This is more of a getting you started piece of code than a copy and paste your board is hacked kind of release. If you don't know how to code in PHP, this hack is NOT for you.


What this "hack" does is it allows you to replace a word in a post with something else. It doesn't replace the word in titles or anywhere else like replacements do. Just in a post.

What I use it for: I replace the word Netflix in every post with a link to my Netflix affilliate.

What you might use it for: affilliate links, swear word replacements with style, pranks, whatever

You will need to modify the function that I have included to set up your own replacement words. You might want to replace more than one thing. It's up to you. Have fun with this and share what you have done.

Demo:

http://www.eaforums.com/forums/showt...threadid=22557

I will help as much as I can in customizing this for you within reason.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 07-05-2003, 03:16 PM
limey's Avatar
limey limey is offline
 
Join Date: Dec 2001
Location: -
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone gotten this to work without turning on HTML in their forums? I thought that was a big security risk? I would like to get this to work so it posts with VB url code, but can't seem to figure it out.

thanks.
Reply With Quote
  #53  
Old 10-19-2003, 02:57 PM
xug xug is offline
 
Join Date: Oct 2001
Location: The Grand Strand, SC
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by limey
Has anyone gotten this to work without turning on HTML in their forums? I thought that was a big security risk? I would like to get this to work so it posts with VB url code, but can't seem to figure it out.

thanks.
Yes, it's very simple to do it without HTML ON!!!!!!!

PHP Code:
function affiliateparse($text) {
   
$affiliate_code "[ URL=http://www.google.com ]Google[ /URL ]";
   
$text stri_replace("Google",$affiliate_code,$text); 

   return 
$text;

PS:
Remove the Spaces
Reply With Quote
  #54  
Old 10-19-2003, 03:45 PM
limey's Avatar
limey limey is offline
 
Join Date: Dec 2001
Location: -
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeh but can you pull images? It pulls the url for me.
Reply With Quote
  #55  
Old 10-19-2003, 04:40 PM
limey's Avatar
limey limey is offline
 
Join Date: Dec 2001
Location: -
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you do mulitple keywords like "johnny","johnny2" ?
Reply With Quote
  #56  
Old 10-19-2003, 05:40 PM
xug xug is offline
 
Join Date: Oct 2001
Location: The Grand Strand, SC
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by limey
Yeh but can you pull images? It pulls the url for me.

You mean an image as an URL?

Then it would be like:

PHP Code:
function affiliateparse($text) {
   
$affiliate_code "[ URL=http://www.google.com ][ img]http://www.site.com/yourimage[ /img][ /URL ]";
   
$text stri_replace("Google",$affiliate_code,$text); 

   return 
$text;

PS:
Remove the Spaces
Reply With Quote
  #57  
Old 10-19-2003, 06:03 PM
xug xug is offline
 
Join Date: Oct 2001
Location: The Grand Strand, SC
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
function affiliateparse($text) {

   
$affiliate_code1 "[ URL=http://www.google.com ][ img]http://www.site.com/yourimage[ /img][ /URL ]";
   
$text stri_replace("Google",$affiliate_code1,$text); 

   
$affiliate_code2 "[ URL=http://www.google.com ][ img]http://www.site.com/yourimage[ /img][ /URL ]";
   
$text stri_replace("Google",$affiliate_code2,$text); 

   return 
$text;

Reply With Quote
  #58  
Old 12-28-2003, 03:41 AM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so what happens when someone puts the keyword in a URL on their own?
Does the link get messed up?
Reply With Quote
  #59  
Old 12-28-2003, 04:12 AM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yup, just found out that is does. damn, this would have been good.
Reply With Quote
  #60  
Old 01-06-2004, 08:13 PM
limey's Avatar
limey limey is offline
 
Join Date: Dec 2001
Location: -
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This still work for vb3?
Reply With Quote
  #61  
Old 06-23-2004, 02:48 AM
yellowbird yellowbird is offline
 
Join Date: Mar 2004
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How about a VB3 version? Anyone?
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 02:40 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.16657 seconds
  • Memory Usage 2,305KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_php
  • (2)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • 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