Hello everyone wanted to ask if anyone got any experience with bbcodes. Where exactly do you download the source? And besides that how can you make like your own bbcode: for example like if you're sending a message to another player in the game and in your message you put [player] arigato23 [/player]
And when the other player recieves that message their html would be <a href="('arigato's profile.php')">arigato23</a>
yeah I know I would have to query if the player exists and all that, but how to know when it's surrounded by the [player][/player] ...
Oh also how like what would be the javascript(if that's the one) to do when you highlight a section of a text and then press the B button for example and then it puts the [ b][/b] around that highlighted text.
regards to everyone!
how to make your own bbcodes?
Re: how to make your own bbcodes?
Fighting for peace is declaring war on war. If you want peace be peaceful.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: how to make your own bbcodes?
Cool! Very concise code, too. I had wondered before how to do this, but I am not a whiz with regular expressions.
The indelible lord of tl;dr
Re: how to make your own bbcodes?
Yeah Thanks Chris, i´d also figured out the javascript part. As it's not in that link ill post the js function here:
Code: Select all
function SelectedText(){
var t = '';
if(window.getSelection){
t = window.getSelection();
}else if(document.getSelection){
t = document.getSelection();
}else if(document.selection){
t = document.selection.createRange().text;
}
return t;
}
Orgullo Catracho