Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 10:28 am EDT

Geeklog Forums

CKEditor on custom registration


Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
I'm using a custom registration with Geeklog 2.1.0 and CKeditor, I want to use advanced editor (ckeditor) in one field. Any ideas?

Thanks.




D Web Studio - www.d-webstudio.net
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
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:

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.
 Quote

Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
I succeeded

Thanks.
D Web Studio - www.d-webstudio.net
 Quote

All times are EDT. The time is now 10:28 am.

  • 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