Hi,
Here's the procedure for IM 1.4.1 board:
In this example my button is used to link a WoW item in the forum, so it basically adds the following tags:
- Code: Select all
[item]Nefarian's balls[/item]
The button images are called
item.gif and
item1.gif (item1 is used to show the button pressed).
I am adding the button on the top of the bbcode box, right hand side of the spellcheck button. There's a lot of place there.
Let's go...
OPEN templates/yourtemplate/posting_body.tplFIND - Code: Select all
<td><a>Advanced BBCode Box v5.0.0</a> </td>
BEFORE, ADD- Code: Select all
<td><img></td>
There adapt]name="
something"[/b],
something will be used further.
onClick="BBCsometing()",
BBCsomething will be used further.
And your image's name ofcourse
OPEN mods/bbcode_box/bbcode_box.jsFIND - Code: Select all
table_help = "Creates a Table using BBCode";
AFTER, ADD- Code: Select all
wowitem_help = "Display a WoW item]Couilles de NÃÂÂ ©farian[/item]";
This is the bbcode box help, adpat it to match your buttton
GO AT THE END OF THE FILE, ADD]
- Code: Select all
// Function added by Aranel for the itemstat buttonfunction BBCitem() { var txtarea = document.post.message; if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; if (theSelection != '') { document.selection.createRange().text = "[item]" + theSelection + "[/item]"; document.post.message.focus(); return; } } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { mozWrap(txtarea, "[item]", "[/item]"); return; } if (wowitem == 0) { ToAdd = "[item]"; document.post.wowitem.src = "mods/bbcode_box/images/item1.gif"; wowitem = 1; } else { ToAdd = "[/item]"; document.post.wowitem.src = "mods/bbcode_box/images/item.gif"; wowitem = 0; } PostWrite(ToAdd);}
In this code you have to ] and [/item] by your own tags of course
* replace the images names (item.gif and item1.gif)
* adapt the string "wowitem" with the "[color=orange]something" you put above
* adapt
BBCitem() with the
BBCsometing you put above
SAVE AND CLOSE ALL FILES You are done <img>