View Full Version : how can i use html in Replacement Variable?
Bester
07-11-2010, 12:21 PM
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 (www.buy.com)
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/showthread.php?t=235769&highlight=str_replace it is acutually very helping, this is just what i needed but:
i did 2 plugins
1st
$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
$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/3426/soccerbettinggame127895.png (http://img682.imageshack.us/i/soccerbettinggame127895.png/)
Uploaded with ImageShack.us (http://imageshack.us)
Need some further help :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.