The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax Highlighter for CK editor
#6
I got it to work, but it is not easy as the available plugin is very poorly documented.

see a very simple example here: http://www.urbanistan.de/getsimple/syntax-1

download the plugin from http://code.google.com/p/ckeditor-syntaxhighlight/ and follow the installation

this plugin is only half the work:

- you need to load the original Syntaxhighlighter Script from
http://alexgorbatchev.com/SyntaxHighligh...iguration/

I uploaded it to admin/templates/js/syntaxhighligter

- the best would be to create a special template for pages with code and add this to the header.
Code:
<!-- SyntaxHighlighter -->
<link type="text/css" rel="stylesheet" href="admin/template/js/syntaxhighlighter/styles/shCoreDefault.css"/>
<link type="text/css" rel="stylesheet" href="admin/template/js/syntaxhighlighter/styles/shCore.css"/>
         <script type="text/javascript" src="admin/template/js/syntaxhighlighter/scripts/shCore.js"></script>
        <script type="text/javascript" src="admin/template/js/syntaxhighlighter/scripts/shBrushCss.js"></script>
         <script type="text/javascript" src="admin/template/js/syntaxhighlighter/scripts/shBrushJScript.js"></script>
         <script type="text/javascript" src="admin/template/js/syntaxhighlighter/scripts/shBrushPhp.js"></script>
         <script type="text/javascript" src="admin/template/js/syntaxhighlighter/scripts/shBrushPlain.js"></script>
- after the content in the template, you must add:
Code:
<script type="text/javascript">
     SyntaxHighlighter.all()
</script>
in your template

to configure the editor, you have to add a button to the toolbar:
in the gsconfig.php add this to the DEFINE EDITORTOOL- Definition
Code:
'/'
    ['Code']

in the GSEDITOROPTIONS:
Code:
define('GSEDITOROPTIONS', "
    extraPlugins : 'syntaxhighlight',
   syntaxhighlighthLangDefault : 'php'
");

in the syntaxhightlightLangDefault set the Language you want, either PHP or JAVA or whatever

thats not all, in
admin/templates/js/ckeditor/config.js add this:
Code:
CKEDITOR.editorConfig = function( config )
{
    // Define changes to default configuration here. For example:
    // config.toolbarCanCollapse = true; // hide toolbar collapse button
config.extraPlugins += (config.extraPlugins ? ',syntaxhighlight' : 'syntaxhighlight' );
config.toolbar_Full.push(['Code']);
};

then it should work and you can send me roses ;=)
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply


Messages In This Thread
Syntax Highlighter for CK editor - by pictus - 2011-01-21, 10:53:26
Syntax Highlighter for CK editor - by datiswous - 2011-03-21, 20:33:57
Syntax Highlighter for CK editor - by Connie - 2011-03-21, 20:44:32
Syntax Highlighter for CK editor - by datiswous - 2011-03-21, 21:44:54
Syntax Highlighter for CK editor - by mikeh - 2011-03-29, 01:59:14
Syntax Highlighter for CK editor - by Connie - 2011-03-31, 23:21:28



Users browsing this thread: 4 Guest(s)