For an example take a look at the commentform_advanced.thtml template file.
Text Formatted Code
{noscript}
<div id="advanced_editor" style="display:none;">
...
</div>
Text Formatted Code
<dt><label for="comment_text">{lang_comment}</label></dt>
<dd>
<div id="text_editor" style="display: {show_texteditor};">
<textarea cols="90" rows="10" name="comment" id="comment_text">{comment}</textarea>
</div>
<div id="html_editor" style="display: {show_htmleditor};">
<textarea cols="90" rows="10" name="comment_html" id="comment_html">{comment}</textarea>
</div>
</dd>
<dd class="description">{allowed_html}</dd>
<dt><label for="commentform-postmode">{lang_postmode}</label></dt>
<dd>
<select id="sel_editmode" name="postmode" onchange="change_editmode(this);">
{postmode_options}
</select>
</dd>
I included the postmode slection as well which allows the user to switch between the editor and just text.
Text Formatted Code
$comment_template = COM_newTemplate($_CONF['path_layout'] . 'comment');
if ($_CONF['advanced_editor'] && $_USER['advanced_editor']) {
$comment_template->set_file('form', 'commentform_advanced.thtml');
if (COM_isAnonUser()) {
$link_message = "";
} else {
$link_message = $LANG01[138];
}
$comment_template->set_var('noscript', COM_getNoScript(false, '', $link_message));
// Setup Advanced Editor
COM_setupAdvancedEditor('/javascript/submitcomment_adveditor.js', $permission);
} else {
$comment_template->set_file('form', 'commentform.thtml');
}
To see where you need to add in the javascript, etc... This code is designed to be used with any editor that is setup to be used with Geeklog (currently only FCKEditor and CKEditor)
It's not extremely easy to do but this will hopefully point you in the right direction.