Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
3.1k views
in Plugins by
hello

i need to insert php code or html code

like stackoverflow site
Q2A version: 1.7 beta 2

3 Answers

0 votes
by
by
no i ask about http://ckeditor.com/addon/codesnippet
i am upload it to plugin foder in ckeditor after that what !!
by
You can use Express Editor ,
http://www.question2answer.org/qa/37420/free-codeeditor-for-q2a ,

The CodeSnippet and ACE Editor PLugins are included there . You can use it easily .
by
thanks i need it in ckeditor cuz i work from the begin with it and have youtube button
by
If you need to add youtube button , please check this post . Well detailed information provided
http://www.question2answer.org/qa/38943/tips-youtube-embed-video-iframe-with-ckeditor4-plugin?show=38943#q38943
by
> no i ask about http://ckeditor.com/addon/codesnippet
> i am upload it to plugin foder in ckeditor after that what !!

Ok....
I'll answer then in a separate Answer
0 votes
by
You could use this version of CkEditor for Q2A which have inbuilt Code Editor

http://www.question2answer.org/qa/37420/free-codeeditor-for-q2a

And syntax highlighters to highlight the code -

http://www.question2answer.org/qa/37512/code-highlighter-for-q2a

 

Hope this helps.
+2 votes
by
edited by

If you want to use the Code Snippet plugin with CKEditor4 you have to :

1) install and enable CKEditor4

2) download the CKEditor's Code Snippet plugin :

http://download.ckeditor.com/codesnippet/releases/codesnippet_4.4.6.zip

3) unzip it to your :

[q2a docroot]\qa-plugin\ckeditor4\plugins

folder

4) download the CKEditor's Widget plugin

http://download.ckeditor.com/widget/releases/widget_4.4.6.zip

5) unzip it to your 

[q2a docroot]\qa-plugin\ckeditor4\plugins

folder

6) download the CKEditor's Line Utilities plugin

http://download.ckeditor.com/lineutils/releases/lineutils_4.4.6.zip

7) unzip it to your 

[q2a docroot]\qa-plugin\ckeditor4\plugins

folder

8) download the CKEditor's Clipboard plugin

http://download.ckeditor.com/clipboard/releases/clipboard_4.4.6.zip

9) unzip it to your 

[q2a docroot]\qa-plugin\ckeditor4\plugins

folder

10) download the CKEditor's Dialog plugin

http://download.ckeditor.com/dialog/releases/dialog_4.4.6.zip

11) unzip it to your 

[q2a docroot]\qa-plugin\ckeditor4\plugins

folder

12) Go to :

Admin ---> CKEditor4 ---> options ----> "Toolbar buttons"

replace this line :

['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],

with this one :

['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','CodeSnippet'],

---> Save changes

13) Go to :

Admin ---> CKEditor4 ---> options ----> "Other configuration"

Replace this line :

entities:false

with these ones :

entities:false,
extraPlugins:'codesnippet,widget,lineutils,clipboard,dialog'

---> Save changes

14) Go to :

Admin --> Layout ---> Custom HTML in <head> section of every page

insert these 2 lines :

 
---> Save options
 
15) Go to :

Admin --> Layout ---> "Custom HTML at top of every page"

insert this line :

<script>hljs.initHighlightingOnLoad();</script>

---> Save options

It should work.

 

 

 

ps

The Code Snippet plugin declares as dependencies the following plugins : Widget, Dialog.

The Widget plugin declares as dependencies the following plugins : Line Utilities, Clipboard.

I've included all of them in the above installation procedure : I do not know if the "main" Code Snippet plugin really needs them or not.

by
i think the problem from security that include in q&a
if i can use <script></scirpt> for example it may be xss attack !!
by
Mmm... I do not know the root cause yet.
I just can tell you that enabling the q2a "categories" I've been able to reproduce your issue.
Without the categories, everything worked.
by
(so, imho, it doesn't seem a "security" issue)
by
more investigation is needed....
...