How Do I Create My Own BB Codes?
3 posters
Page 1 of 1
How Do I Create My Own BB Codes?
I apologize if this is somewhere already, but after several searches throughout the site, I found nothing. I'm new to this type of forum and really rusty at coding in general but if I get to it enough, I'll remember it.
I want to make my own custom BB Codes for my forum, is this possible? I was hoping there was a place in the admin CP that would let me make my own, like a few boards I was apart of in the pasts, but I'm not seeing anything like that here. If I have to add it through JS, that's fine, but I'm an absolute novice at it and would really appreciate some sort of example I can go by. Thank you for your time.
I want to make my own custom BB Codes for my forum, is this possible? I was hoping there was a place in the admin CP that would let me make my own, like a few boards I was apart of in the pasts, but I'm not seeing anything like that here. If I have to add it through JS, that's fine, but I'm an absolute novice at it and would really appreciate some sort of example I can go by. Thank you for your time.
Re: How Do I Create My Own BB Codes?
Hi there, this script I know creates a new BBcode '[mod][/mod]' and '[adm][/adm]'. Maybe you can study and try to learn from that?
Re: How Do I Create My Own BB Codes?
Draxion wrote:Hi there, this script I know creates a new BBcode '[mod][/mod]' and '[adm][/adm]'. Maybe you can study and try to learn from that?
Thanks for replying. I'll take a look over it tomorrow, much appreciated.
Re: How Do I Create My Own BB Codes?
Anyone have an additional suggestions? The buttons are an idea, but I'm still learning. Is there really no easy way to make and insert your own BBCode?
Re: How Do I Create My Own BB Codes?
If you need help, I could try with that script I gave you. As long as I know what particular codes you want to make.
Re: How Do I Create My Own BB Codes?
Draxion wrote:If you need help, I could try with that script I gave you. As long as I know what particular codes you want to make.
Possibly. What I'm trying to do is similar to what a different site I used to be at would do. The [indent] bbcode is apparently attached to this js
- Code:
"indent": {
trimContents: true,
openTag: function(params, content) {
return '<div class="bb-indent">';
},
closeTag: function(params, content) {
return '</div>';
}
The bbcode would basically do what you see in the top part of the image below (don't ask about the content, it came from a role playing site):
Another code I'm trying to work out is how to make the editor use the tab key to indent a line instead of pushing on to the next button. I had a friend give me this code in suggestion:
- Code:
$("textarea").keydown(function(e) {
if(e.keyCode === 9) { // tab was pressed
// get caret position/selection
var start = this.selectionStart;
end = this.selectionEnd;
var $this = $(this);
// set textarea value to: text before caret + tab + text after caret
$this.val($this.val().substring(0, start)
+ "\t"
+ $this.val().substring(end));
// put caret at right position again
this.selectionStart = this.selectionEnd = start + 1;
// prevent the focus lose
return false;
//alert("TEST");
}
});
and the one listed here : Enable Tab Indentation (github)
But neither of them yield any results. When I enter them into the JS area, I have them set to all pages (could this be a problem?).
Re: How Do I Create My Own BB Codes?
Since you will only be using them in topics, you should try just in topics.
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 Do I Create My Own BB Codes?
SLGray wrote:Since you will only be using them in topics, you should try just in topics.
Ok, I tried changing things yesterday so that it was only in topics and nothing changed outwardly.
I was able to jerryrig the warning button code to give me the desired paragraph padding I needed for a bbCode for [indent], so that's not so much of a concern now.
Now I just want to make the board recognize the 'Tab' key for what it does in word processors and not as anything else. Any ideas? Like, could I put either of the tab indentation codes into the templates that handle posting/topics and PMs? I want to try that, but I wouldn't know where to start.
Similar topics
» Create bb codes
» Christmas codes: How to make the codes on the right
» How To Create Chatbox in Forums + How to Create and Add Masks to Forum Members
» All I need help with now is to create a skin basicly I don't want to create one on hitskin.com help?
» Codes
» Christmas codes: How to make the codes on the right
» How To Create Chatbox in Forums + How to Create and Add Masks to Forum Members
» All I need help with now is to create a skin basicly I don't want to create one on hitskin.com help?
» Codes
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum