vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need to replace a word in posts but not in titles (https://vborg.vbsupport.ru/showthread.php?t=49985)

amykhar 03-11-2003 10:53 PM

Need to replace a word in posts but not in titles
 
I just tried to use a replacement, but it replaces the word in thread titles as well.

Basically, I am trying to replace all instances of a word in a post with a link that I specify. Regular expressions make my eyes cross so I am going to need a wee bit of assistance on getting this one going please.

Amy

filburt1 03-11-2003 11:03 PM

If you want to do all past posts, you can use REPLACE in an UPDATE query. If you mean all future posts...no idea. You'd need a new hack.

mr e 03-11-2003 11:43 PM

you'd probably have to edit functions.php for the postbit part(unless you want it permanent, then just do a query), newreply.php, and newthread.php, not sure what you'd have to do right off hand though

amykhar 03-12-2003 02:33 PM

I am wondering if javascript would do it or something similar? You know those ad banners that change words on pages to links? Anybody know if such a thing exists in javascript?

filburt1 03-12-2003 04:31 PM

Javascript is virtually never the answer to any problem ;)

amykhar 03-12-2003 05:07 PM

I got it. I added a function in functions.php that does a string replace on the post before it is parsed for vbcode, etc. It works like a charm and this should help my affiliate programs do a bit better.

Amy

Boofo 03-12-2003 05:32 PM

I wish I had seen this message earlier. I just got through doing the very same thing a few days ago. Easy, wasn't it? ;)


All times are GMT. The time now is 07:59 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.00877 seconds
  • Memory Usage 1,714KB
  • 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
  • (7)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