Welcome to Geeklog Thursday, November 23 2017 @ 10:58 pm EST


Status: offline

alb3rt

Forum User
Chatty
Registered: 30/10/2006
Posts: 45
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

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/2005
Posts: 1240
For an example take a look at the commentform_advanced.thtml template file.

Depending on what you do you should wrap it with:

PHP Formatted Code

{noscript}
<div id="advanced_editor" style="display:none;">
...
</div>
 


The main part of the code you want to look at iis:

PHP 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:

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

Status: offline

alb3rt

Forum User
Chatty
Registered: 30/10/2006
Posts: 45
Location:Mexico City
I succeeded

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

All times are EST. The time is now 10:58 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