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.

Help with coding custom bbcodes

3 posters

Go down

Solved Help with coding custom bbcodes

Post by Rarcer November 2nd 2012, 11:11 pm

Sorry if this is in the wrong board.

Anyway, I'd like to add another color bbcode. Like Text!
I've managed to add it to the list, but the color just stays black, and I don't know how to get rid of the brackets.

Anyone know hkw to fix this? Help is appreciated.


Last edited by Rarcer on November 3rd 2012, 5:20 pm; edited 1 time in total
avatar
Rarcer
New Member

Posts : 5
Reputation : 1
Language : English

Back to top Go down

Solved Re: Help with coding custom bbcodes

Post by SLGray November 2nd 2012, 11:20 pm

Is your forum's version phpBB 3?


Help with coding custom bbcodes 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 : 51463
Reputation : 3519
Language : English
Location : United States

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

Back to top Go down

Solved Re: Help with coding custom bbcodes

Post by Rarcer November 3rd 2012, 5:16 pm

Yep. Phpbb3 prosilver.
avatar
Rarcer
New Member

Posts : 5
Reputation : 1
Language : English

Back to top Go down

Solved Re: Help with coding custom bbcodes

Post by SLGray November 3rd 2012, 5:33 pm

Could you post how you added the new color?


Help with coding custom bbcodes 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 : 51463
Reputation : 3519
Language : English
Location : United States

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

Back to top Go down

Solved Re: Help with coding custom bbcodes

Post by Rarcer November 3rd 2012, 5:49 pm

Here's the code. Pretty sure it's in Javascript but I'm not 100%.

Code:

(function(){var d={add:function(b,e,c){$(function(){if(document.getElementById("text_edit")){void 0==c&&(c="");var a=document.createElement("span");a.innerHTML='<button class="button2" style="height: 22px; margin-right: 5px;" onClick="bbfontstyle(\''+e+"', '"+c+"'); return false;\">"+b+"</button>";document.getElementById("new_buttons_area").appendChild(a)}})},list:function(b,e,c){$(function(){if(document.getElementById("text_edit")){var a=document.createElement("span");a.innerHTML='<input type="button" style="height: 22px; margin-right: 5px;" value="'+ b+'" onclick="selectWysiwyg(this, \''+c+'\');" class="button2">';document.getElementById("new_buttons_area").appendChild(a);a=document.createElement("div");a.id=c;a.className="select";a.style.visibility="hidden";for(var d in e)a.innerHTML+="<button onmouseout=\"this.className='';\" onmouseover=\"this.className='selectHover';\" onclick=\"bbfontstyle('"+e[d]+"', '');selectWysiwyg(this, '"+c+"');return false;\">"+d+"</button><br>";document.getElementById("text_editor_select_controls").appendChild(a)}})}, init:function(){$(function(){if(document.getElementById("html_edit")){var b=document.createElement("div");b.id="new_buttons_area";b.style.paddingTop="5px";document.getElementById("html_edit").parentNode.insertBefore(b,document.getElementById("html_edit").nextSibling)}})}};window.buttons=d;d.init()})();
buttons.add('Light red', '[color=lightred]','[/color]');

Got it from some guy named Rideem on fmquery. I think you might've linked someone else to it in another thread.

Anyway, it adds (color=lightred)(/color) to the text box when you click on the button, but that's it. Know how to actually make the color light red when you post?
avatar
Rarcer
New Member

Posts : 5
Reputation : 1
Language : English

Back to top Go down

Solved Re: Help with coding custom bbcodes

Post by SLGray November 3rd 2012, 7:19 pm

One problem is that there is not a color called light red.

Take a look here for the lists of colors - http://en.wikipedia.org/wiki/Hex_color & http://en.wikipedia.org/wiki/List_of_colors


Help with coding custom bbcodes 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 : 51463
Reputation : 3519
Language : English
Location : United States

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

Back to top Go down

Solved Re: Help with coding custom bbcodes

Post by Rarcer November 3rd 2012, 11:47 pm

Nevermind I just got the hexcode for the color I wanted and added it. Works like I wanted it to. Thanks for your help, slg.
avatar
Rarcer
New Member

Posts : 5
Reputation : 1
Language : English

Back to top Go down

Solved Re: Help with coding custom bbcodes

Post by Rarcer November 3rd 2012, 11:52 pm

Solved.
avatar
Rarcer
New Member

Posts : 5
Reputation : 1
Language : English

Back to top Go down

Solved Re: Help with coding custom bbcodes

Post by Sanket November 4th 2012, 4:14 am

Topic Solved & Locked
Sanket
Sanket
ForumGuru

Male Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai

Back to top Go down

Back to top


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