vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   how can i use html in Replacement Variable? (https://vborg.vbsupport.ru/showthread.php?t=246325)

Bester 07-11-2010 12:21 PM

how can i use html in Replacement Variable?
 
Hi,
I want to do like this:

when a user writes down a word 'buy' i'd like it to be automatically changed into Buy
i would like to set this with some other words too.

but at the same time i want thread titles to be excluded from this function.

Can you help me somehow,guys?

p.s. maybe it's not about Replacement Variable at all, i don't know...

thanks in advance!

Bester 07-12-2010 01:33 PM

No idea here? I have seen this on several forum before, is this really so dificult to do?

Lynne 07-12-2010 01:50 PM

There is a mod that shows you have to use str_replace to replace words in posts like this (I've even posted the plugin code several times). Go do a search for it (sorry, but I'm not searching for it while on dial-up).

Bester 07-12-2010 03:56 PM

Thank you very much Lynne for help!

I have found this thread https://vborg.vbsupport.ru/showthrea...ht=str_replace it is acutually very helping, this is just what i needed but:

i did 2 plugins

1st

Quote:

$search = array(
'what',
);
$replace = array(
'[.URL="http://www.what.com"]what[/URL]',
);
$this->post['pagetext'] = str_replace($search, $replace, $this->post['pagetext']);
and the other
Quote:

$search = array(
'what',
);
$replace = array(
'[.URL="http://www.what.com"]what[/URL]',
);
$this->post['pagetext'] = str_replace($search, $replace, $this->post['pagetext']);
(without these red dots)

and is seemingly works very fine but what i'm writing a post and take twice 'preview post' and then 'submit reply' it becomes like this:

http://img682.imageshack.us/img682/3...game127895.png

Uploaded with ImageShack.us

Need some further help :)


All times are GMT. The time now is 05:55 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.01045 seconds
  • Memory Usage 1,718KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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