Welcome to Geeklog, Anonymous Thursday, April 18 2024 @ 07:51 am EDT

Geeklog Forums

FCK editor in block editor


Status: offline

smith

Forum User
Newbie
Registered: 12/08/03
Posts: 5
Is there a way to enable the FCK advanced editor in the block editor?
 Quote

Status: offline

Dazzy

Forum User
Full Member
Registered: 07/19/03
Posts: 200
Location:N. Ireland
If your using 1.4.1 use this blockeditor.thtml

Text Formatted Code

<!-- added for fck editor--Hack by samstone-->
<script type="text/javascript">
    // Setup editor path for FCKeditor JS Functions
    geeklogEditorBasePath = "{site_url}/fckeditor/" ;
    window.onload = function() {
        var oFCKeditor1 = new FCKeditor( 'block_content' ) ;
        oFCKeditor1.Config['CustomConfigurationsPath'] = geeklogEditorBaseUrl + '/fckeditor/myconfig.js';
        oFCKeditor1.BasePath = geeklogEditorBasePath;
        oFCKeditor1.ToolbarSet = 'editor-toolbar2';
        oFCKeditor1.Height = 200 ;
        oFCKeditor1.ReplaceTextarea() ;
    }
</script>
<!-- end off fck editor hack-->
                                {start_block_editor}
                                <form action="{site_admin_url}/block.php" method="post">
                                    <table border="0" cellspacing="0" cellpadding="3" width="100%">
                                        <tr>
                                            <td width="180" class="alignright">{lang_blocktitle}:</td>
                                            <td><input type="text" size="48" name="title" value="{block_title}"></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_enabled}:</td>
                                            <td><input type="checkbox" name="is_enabled" {is_enabled}></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright" style="vertical-align:top">{lang_blockhelpurl}:</td>
                                            <td><input type="text" name="help" value="{block_help}" size="48" maxlength="{max_url_length}"><div class="pluginMediumText">{lang_includehttp}&nbsp;{lang_explanation}</div></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright" style="vertical-align:top">{lang_blockname}:</td>
                                            <td><input type="text" size="48" name="name" value="{block_name}"><br>{lang_nospaces}</td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_topic}:</td>
                                            <td>
                                                <select name="tid">
                                                    <option value="all" {all_selected}>{lang_all}</option>
                                                    <option value="homeonly" {homeonly_selected}>{lang_homeonly}</option>
                                                    {topic_options}
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_side}:</td>
                                            <td>
                                                <select name="onleft">
                                                    <option value="1" {left_selected}>{lang_left}</option>
                                                    <option value="0" {right_selected}>{lang_right}</option>
                                                </select>
                                           </td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_blockorder}:</td>
                                            <td><input type="text" size="4" name="blockorder" value="{block_order}"> 0 - 9999</td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_blocktype}:</td>
                                            <td>
                                                <select name="type">
                                                    <option value="normal" {normal_selected}>{lang_normalblock}</option>
                                                    <option value="phpblock" {php_selected}>{lang_phpblock}</option>
                                                    <option value="portal" {portal_selected}>{lang_portalblock}</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2"><hr></td>
                                        </tr>
                                        <tr>
                                            <td colspan="2"><b>{lang_phpblockoptions}</b></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_blockfunction}:</td>
                                            <td><input type="text" size="50" maxlength="64" name="phpblockfn" value="{block_phpblockfn}"></td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">{lang_phpblockwarning}</td>
                                        </tr>
                                        <tr><td colspan="2"><hr></td></tr>
                                        <tr>
                                            <td colspan="2"><b>{lang_portalblockoptions}</b></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_rdfurl}:</td>
                                            <td><input type="text" size="50" maxlength="{max_url_length}" name="rdfurl" value="{block_rdfurl}"></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_rdflimit}:</td>
                                            <td><input type="text" size="3" maxlength="3" name="rdflimit" value="{block_rdflimit}"></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_lastrdfupdate}:</td>
                                            <td><input type="text" size="19" name="rdfupdated" value="{block_rdfupdated}"></td>
                                        </tr>
                                        <tr><td colspan="2"><hr></td></tr>
                                        <tr>
                                            <td colspan="2"><b>{lang_normalblockoptions}</b></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright" style="vertical-align:top">{lang_blockcontent}:</td>
                                            <!--<td><textarea name="content" rows="12" style="width:100%;">{block_content}</textarea>-->
                        <td style="width:100%;"><textarea rows="12" id="block_content" name="block_content" cols="100%">{block_content}</textarea><br />                                                <span class="warningsmall">{lang_allowed_html}</span></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_autotags}:</td>
                                            <td><input type="checkbox" name="allow_autotags" {allow_autotags}> ({lang_use_autotags})</td>
                                        </tr>
                                        <tr>
                                            <td colspan="2"><hr></td>
                                        </tr>
                                        <tr>
                                            <td colspan="2"><b>{lang_accessrights}</b></td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_owner}:</td>
                                            <td>{owner_name} <input type="hidden" name="owner_id" value="{owner_id}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="alignright">{lang_group}:</td>
                                            <td>
                                                {group_dropdown}
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2"><b>{lang_permissions}:</b></td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">{lang_perm_key}</td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">{permissions_editor}</td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">{lang_permissions_msg}<td>
                                        </tr>
                                        <tr><td>&nbsp;</td></tr>
                                        <tr>
                                            <td colspan="2">
                                            <input type="submit" value="{lang_save}" name="mode">
                                                <input type="submit" value="{lang_cancel}" name="mode">
                                            {delete_option}
                                            <input type="hidden" name="bid" value="{block_bid}">
                                        </td>
                                        </tr>
                                    </table>
                                </form>
                                {end_block}
 

Dazzy
 Quote

Status: offline

smith

Forum User
Newbie
Registered: 12/08/03
Posts: 5
Thanks for the info. but it didn't work for me, I am running version 1.4.0sr5-1. I had to do 1 more thing for it to work. your post got me going in the right direction.
this is what I did to make it work.

1. add the following code to blockeditor.thtml in the theme /admin/block/ folder.

Text Formatted Code
<!-- Hide the Advanced Editor as Javascript is required. If JS is not enabled then the message below in the <nonscript> tags will be displayed -->
<noscript>
    <div class="pluginAlert" style="border:1px dashed #ccc;text-align:center;margin-top:10px;padding:15px;">{lang_nojavascript}
    <p>{no_javascript_return_link}</p>
    </div>
</noscript>
<script type="text/javascript">
    // Setup editor path for FCKeditor JS Functions
    geeklogEditorBasePath = "{site_url}/fckeditor/" ;
</script>
<script type="text/JavaScript" src="{site_url}/javascript/advanced_editor.js"></script>
<script type="text/JavaScript" src="{site_url}/javascript/blockeditor_fckeditor.js"></script>
<br /><div id="advanced_editor" style="display:none;">
<!-- Hide the Advanced Editor as Javascript is required. If JS is enabled then the JS below will un-hide it -->
<script type="text/javascript">
    document.getElementById('advanced_editor').style.display=''
</script>


2. create a file called blockeditor_fckeditor.js in /public_html/javascript/ with this code
Text Formatted Code

// +---------------------------------------------------------------------------+
// | Copyright (C) 2003,2004 by the following authors:                         |
// | Version 1.0    Date: Jun 4, 2005                                          |
// | Authors:   Blaine Lang - blaine@portalparts.com                           |
// |                                                                           |
// | Javascript functions for FCKEditor Integration into Geeklog                |
// |                                                                           |
// +---------------------------------------------------------------------------+


    window.onload = function() {
        var oFCKeditor1 = new FCKeditor( 'content' ) ;
        oFCKeditor1.BasePath = geeklogEditorBasePath;
        oFCKeditor1.ToolbarSet = 'editor-toolbar3' ;
        oFCKeditor1.Height = 200 ;
        oFCKeditor1.ReplaceTextarea() ;
    }

    function changeHTMLAreaSize(option) {
        var size = 0;
        var size = document.getElementById('content___Frame').height;
        if (option == 'larger') {
            document.getElementById('content___Frame').height = +(size) + 50;

        } else if (option == 'smaller') {
            document.getElementById('content___Frame').height = +(size) - 50;
        }
    }

   function changeToolbar(toolbar) {
        var basePath= geeklogEditorBasePath ;
        var instanceName='content';
        editor_frame = document.getElementById(instanceName+'___Frame');
        //alert(editor_frame.src);
        if (editor_frame!=null) {
            editor_frame.src=basePath+'editor/fckeditor.html?InstanceName='+instanceName+'&Toolbar='+toolbar;
            //editor_frame.src='http://localhost/geekcvs/fckeditor/editor/fckeditor.html?InstanceName=sp_content&Toolbar=editor-toolbar1';
        }
   }
 


ther may be an easier way but this worked for me.
 Quote

All times are EDT. The time is now 07:51 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