How to replace a forum tag to an html tag?
4 posters
Page 1 of 1
How to replace a forum tag to an html tag?
hello
I want to replace [size=48]text[/size] to <h1>text</h1> and the same as [size=32]text[/size] to <h2>text</h2> in the .post-entry.
How can I do that? Please help me!
Thanks in advanced!
p/s: I adready known how to insert a script to Javascript codes management module but don't know how to code a script to replace them
I want to replace [size=48]text[/size] to <h1>text</h1> and the same as [size=32]text[/size] to <h2>text</h2> in the .post-entry.
How can I do that? Please help me!
Thanks in advanced!
p/s: I adready known how to insert a script to Javascript codes management module but don't know how to code a script to replace them
Re: How to replace a forum tag to an html tag?
Dear @congdantoancau
do you want this to be effective on topics view, right? It's something with effect after the topic has been published, is it?
do you want this to be effective on topics view, right? It's something with effect after the topic has been published, is it?
Re: How to replace a forum tag to an html tag?
Niko wrote:Dear @congdantoancau
do you want this to be effective on topics view, right? It's something with effect after the topic has been published, is it?
Yes, I want to affect it when the topics is loaded.
Re: How to replace a forum tag to an html tag?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: How to replace a forum tag to an html tag?
[quote="congdantoancau"]
and sorry @congdantoancau, forgot to ask, is you forum version Invision, right ?
edit: if so, give a try with this javascript code:
Niko wrote:Yes, I want to affect it when the topics is loaded.
and sorry @congdantoancau, forgot to ask, is you forum version Invision, right ?
edit: if so, give a try with this javascript code:
- Code:
$(function() {
$('.post-entry div').each(
function(){
var content = $(this).html().replace(/\[size=32\]/g,'<h2>').replace(/\[size=48\]/g,'<h1>').replace(/\[\/size\]/g,'</h2>');
$(this).html(content);
});
});
SarkZKalie, TonnyKamper and congdantoancau like this post
Re: How to replace a forum tag to an html tag?
[quote="Niko"]
Thanks you very much! It works. I didn't thought that was so simple before. Think it might need to use REGEX or something
congdantoancau wrote:Niko wrote:Yes, I want to affect it when the topics is loaded.
and sorry @congdantoancau, forgot to ask, is you forum version Invision, right ?
edit: if so, give a try with this javascript code:
- Code:
$(function() {
$('.post-entry div').each(
function(){
var content = $(this).html().replace(/\[size=32\]/g,'<h2>').replace(/\[size=48\]/g,'<h1>').replace(/\[\/size\]/g,'</h2>');
$(this).html(content);
});
});
Thanks you very much! It works. I didn't thought that was so simple before. Think it might need to use REGEX or something
Niko likes this post
Re: How to replace a forum tag to an html tag?
When your request is complete, please mark it as Solved.
Similar topics
» Replace html with bbcode (in posts)
» How to replace forum board from solid color, to texture background?
» Making the forum tables for default widgets disappear and replace them with a background image
» My forum has a html page but whats the forum index address i know what it usually is but stopped not working help?
» HTML Forum
» How to replace forum board from solid color, to texture background?
» Making the forum tables for default widgets disappear and replace them with a background image
» My forum has a html page but whats the forum index address i know what it usually is but stopped not working help?
» HTML Forum
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum