vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Replace Text (https://vborg.vbsupport.ru/showthread.php?t=50116)

amykhar 03-14-2003 01:50 PM

If you lick the install button, nobody else is going to want to touch it to click it. ;)

Amy

Brad 03-14-2003 01:52 PM

Theres a reason we have paper towels ;).

Dean C 03-14-2003 03:59 PM

This is a very nice idea.. /me likes

- miSt

SgtSling 03-15-2003 03:22 AM

weird
if someone types in Amazon.com it posts it.. but if someone types amazon all lowercase.. it doesn't

limey 03-15-2003 04:10 AM

And to create more words we have to create more functions with:
($text1)
($text2)
($text3)

etc. right?

I'm pretty sure I'm right; just confirming ;). Very cool btw!

SgtSling 03-15-2003 04:31 AM

yeah but if the poster links to a certain page..
like amazon.com/apage.html
it screws with the hyperlink

Bane 03-15-2003 11:26 AM

Fantastic Idea Amy :)

amykhar 03-15-2003 12:37 PM

Quote:

Today at 01:10 AM limey said this in Post #15
And to create more words we have to create more functions with:
($text1)
($text2)
($text3)

etc. right?

I'm pretty sure I'm right; just confirming ;). Very cool btw!

No. You can actually do all of the replacements in the same function. If you look at the code, you can see that I replaced two different words: Netflix and netflix. You can do yours in the same way if you understand how the code works.

You would add code something along the lines of:

Code:

$affiliate_code2="Some other replacement string";
$text = str_replace("word2",$affiliate_code2,$text);


amykhar 03-15-2003 12:39 PM

Quote:

Today at 01:31 AM SgtSling said this in Post #16
yeah but if the poster links to a certain page..
like amazon.com/apage.html
it screws with the hyperlink

With a bit more work, you could code it to ensure that the word you are replacing is not already in a URL. If I get some time today, I will play with it and give you the code.

Amy

amykhar 03-15-2003 01:05 PM

Quote:

Today at 12:22 AM SgtSling said this in Post #14
weird
if someone types in Amazon.com it posts it.. but if someone types amazon all lowercase.. it doesn't


That is now fixed. See the new text file. To "upgrade" you will need to change calls of str_replace to stri_replace and add the new function stri_replace at the bottom of functions.php as outlined in the updated text file.

Amy


All times are GMT. The time now is 09:50 AM.

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.01192 seconds
  • Memory Usage 1,735KB
  • 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)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete