I searched a lot in the ACP but I didn't find anywhere where I can add custom BBcode.
4 posters
I want to add a custom kotlin code BBcode
megamein- Forumember
- Posts : 74
Reputation : 3
Language : english
SLGray- Administrator
- Posts : 51499
Reputation : 3523
Language : English
Location : United States
There is not a default way to add custom BBCode in the AP. There might be a way with coding.
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.
Ikerepc- Active Poster
- Posts : 1186
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed
What forum version are you using?
If you are using Invision, this should work, if something else, just write which one.
This code will replace [g] and [/g] tags as bold. Tell me what exactly code you need so I can do it differently.
You only need to modify variables code and replacement.
Ask if you have any questions
Javascript code: (enable it In topics)
If you are using Invision, this should work, if something else, just write which one.
This code will replace [g] and [/g] tags as bold. Tell me what exactly code you need so I can do it differently.
You only need to modify variables code and replacement.
Ask if you have any questions
Javascript code: (enable it In topics)
- Code:
$(function() {
var elements = document.getElementsByClassName("post-entry");
var code = /\[g\](.*?)\[\/g\]/g;
var replacement = "<b>$1</b>";
for (var i = 0, l = elements.length; i < l; i++) {
elements[i].innerHTML = elements[i].innerHTML.replace(code, replacement);
}
});
Ikerepc- Active Poster
- Posts : 1186
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed
Or if you need few custom bbcodes, you can use arrays and one more for loop like this:
- Code:
$(function() {
var elements = document.getElementsByClassName("post-entry");
var code = [/\[g\](.*?)\[\/g\]/g, /\[m\](.*?)\[\/m\]/g];
var replacement = ["<b>$1</b>", "<i>$1</i>"];
for (var i = 0, l = elements.length; i < l; i++) {
for (t = 0; t < code.length; ++t) {
elements[i].innerHTML = elements[i].innerHTML.replace(code[t], replacement[t]);
}
}
});
Ikerepc- Active Poster
- Posts : 1186
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed
Soo... Is this helpful and do you need anything else on this topic?... I mean, do you understand regex code and all, what forum version you have, is this working?...
I see you were online today so just asking if you solved this or need any other help
I see you were online today so just asking if you solved this or need any other help
skouliki- Manager
- Posts : 15312
Reputation : 1705
Language : English,Greek
Location : Greece
helloÂ
is this solved?
is this solved?
    General Rules | Tips & Tricks | Lost Founder Password?Â
   Rules of the Graphic Design Section | Sticker Points |  Graphic Requests