The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

I want to add a custom kotlin code BBcode

4 posters

Go down

In progress I want to add a custom kotlin code BBcode

Post by megamein July 14th 2019, 9:17 pm

I searched a lot in the ACP but I didn't find anywhere where I can add custom BBcode.
avatar
megamein
Forumember

Posts : 74
Reputation : 3
Language : english

Back to top Go down

In progress Re: I want to add a custom kotlin code BBcode

Post by SLGray July 14th 2019, 9:33 pm

There is not a default way to add custom BBCode in the AP.  There might be a way with coding.


I want to add a custom kotlin code BBcode Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51555
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: I want to add a custom kotlin code BBcode

Post by Ikerepc July 14th 2019, 10:54 pm

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)
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
Ikerepc
Active Poster

Male Posts : 1187
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed

http://admins.forumotion.com

Back to top Go down

In progress Re: I want to add a custom kotlin code BBcode

Post by Ikerepc July 14th 2019, 11:00 pm

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
Ikerepc
Active Poster

Male Posts : 1187
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed

http://admins.forumotion.com

Back to top Go down

In progress Re: I want to add a custom kotlin code BBcode

Post by Ikerepc July 17th 2019, 8:41 pm

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 Smile
Ikerepc
Ikerepc
Active Poster

Male Posts : 1187
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed

http://admins.forumotion.com

Back to top Go down

In progress Re: I want to add a custom kotlin code BBcode

Post by skouliki July 24th 2019, 11:28 am

hello 

is this solved?
skouliki
skouliki
Manager
Manager

Female Posts : 15391
Reputation : 1709
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum