Welcome to Geeklog, Anonymous Wednesday, January 15 2025 @ 09:29 pm EST
Geeklog Forums
CKEditor on custom registration
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
For an example take a look at the commentform_advanced.thtml template file.
Depending on what you do you should wrap it with:
{noscript}
<div id="advanced_editor" style="display:none;">
...
</div>
The main part of the code you want to look at iis:
<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.
Then you have to take a look at lib-comment.php:
$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.
One of the Geeklog Core Developers.
Depending on what you do you should wrap it with:
Text Formatted Code
{noscript}
<div id="advanced_editor" style="display:none;">
...
</div>
The main part of the code you want to look at iis:
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.
Then you have to take a look at lib-comment.php:
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.
One of the Geeklog Core Developers.
8
9
Quote
All times are EST. The time is now 09:29 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content