Author Topic: Code Snippets in Knowledgeroot  (Read 9499 times)

Offline gptucci

  • User
  • *
  • Posts: 9
    • View Profile
Code Snippets in Knowledgeroot
« on: January 22, 2012, 08:02:55 AM »
Hi
I am using knowledgeroot as a technical database, and I have to say that the software is fantastic !

We have only a little issue: it is very difficult to edit code snippets (PHP and HTML). I know that the problem is not related to knowledgeroot but at the editors, but do you have some advice how to insert code snippets in the contents ?

Now we are using FCKeditor, because all the others don't work at all.

Tnx

Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: Code Snippets in Knowledgeroot
« Reply #1 on: January 23, 2012, 09:03:07 AM »
Hi,

i also use fckeditor for codesnippets.
But it should be possible to use the other editors. They sould all create pre tags if you use preformatted as style.

It could be possible to use something like geshi:
http://qbnz.com/highlighter/
For code highlighting.

So did you have a problem to create the pre tags or to have some syntax highlighting?

regards,
Frank

Offline gptucci

  • User
  • *
  • Posts: 9
    • View Profile
Re: Code Snippets in Knowledgeroot
« Reply #2 on: January 23, 2012, 11:28:06 AM »
Hi
Tnx for response.
If you try the next line (added in HTML), using ckeditor or tinymce, nothing works !
<pre><!--?php phpinfo() ?--></pre>
Only using FCKeditor works !
I will try geshi
Tnx




Offline gptucci

  • User
  • *
  • Posts: 9
    • View Profile
Re: Code Snippets in Knowledgeroot
« Reply #3 on: January 23, 2012, 12:18:12 PM »
Hi
I want to try Geshi but... nothing....
The button does not appear !
I get the in apache2/error.log the error File not found for plugin.js.

Can you help me ?
Tnx
I'm not an expert in php/html/java

Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: Code Snippets in Knowledgeroot
« Reply #4 on: January 23, 2012, 01:05:51 PM »
Hi,

i will try it this evening and will let you know if i found a solution.

Frank

Offline gptucci

  • User
  • *
  • Posts: 9
    • View Profile
Re: Code Snippets in Knowledgeroot
« Reply #5 on: January 23, 2012, 03:13:11 PM »
Tnx for response and your kindness !

Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: Code Snippets in Knowledgeroot
« Reply #6 on: January 23, 2012, 11:10:51 PM »
Hi,

so i have tested the editors.
With all, i could created text with style "preformated".
So you could create some custom css code to style this pre tags.

The solution with geshi is not so easy. I could try to create an extension in the future for geshi.
But to use that you need to modify the generated html code from the editors.
The extension could be work like the wordpress extension wp-syntax.

Frank

Offline gptucci

  • User
  • *
  • Posts: 9
    • View Profile
Re: Code Snippets in Knowledgeroot
« Reply #7 on: January 24, 2012, 02:50:21 PM »
Hi
tnx for response.
I've tried to use CKEditor, and directly in HTML I have written
<pre>
<!--?php phpinfo() ?-->
</pre>
But does not work !
I'm sorry for the my stupid question:  I have done a mistake ?
Tnx for all

Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: Code Snippets in Knowledgeroot
« Reply #8 on: January 24, 2012, 02:58:01 PM »
Hi,

so i think i did not understand you.
What is your expected result for this?
What should happen?

Frank

Offline gptucci

  • User
  • *
  • Posts: 9
    • View Profile
Re: Code Snippets in Knowledgeroot
« Reply #9 on: January 25, 2012, 09:48:54 AM »
Hi
Tnx
I want to use the system for code snippets.
If i write <!--?php phpinfo() ?--> I want to see this thext
<!--?php phpinfo() ?-->
in the middle of the explanatory text that I write about the use of phpinfo.

Example
.......................
To check that Php5 is installed and to verify the current running version create in /var/www/ a file named test.php, and insert this single line.
<!--?php phpinfo() ?-->
........................

But now when I write the upper and I do not use FCKeditor I see
.......................
To check that Php5 is installed and to verify the current running version create in /var/www/ a file named test.php, and insert this single line.

........................

I've tried to insert the line <!--?php phpinfo() ?--> in HTML too, using <pre><!--?php phpinfo() ?--></pre> but I do not see anything !

I must use FCKEditor (in wysiwyg transform this line in HTML like <p>&lt;!--?php phpinfo() ?--&gt;</p>) and all works fine !

Thank you for your patience



« Last Edit: January 25, 2012, 12:27:44 PM by gptucci »

Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: Code Snippets in Knowledgeroot
« Reply #10 on: January 25, 2012, 01:10:03 PM »
Hi,

ok i have tested it with ckeditor and tinymce on this page:
http://demo-dev.knowledgeroot.org/index.php?id=2015

Seems to work for me as expected.

Which knowledgeroot version are you using?
Which knowledgeroot extensions are active in your installation?
Which php version are you using?

Frank

Offline gptucci

  • User
  • *
  • Posts: 9
    • View Profile
Re: Code Snippets in Knowledgeroot
« Reply #11 on: January 26, 2012, 09:17:00 AM »
Hi
In the you example I can see all correctly.
But when I try to enter in edit mode the line <!--?php phpinfo() ?--> disappear !!!

Is this correct ???

I'm using latest firefox, but I have tried with latest explorer too.

Is the problem related to the browser ??

Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: Code Snippets in Knowledgeroot
« Reply #12 on: January 26, 2012, 11:35:04 PM »
Hi,

ok i see the problems ;)

I have tested tinymce and ckeditor on their homepages.
As default it should work.

I need to update the extensions to the newest versions and test again with knowledgeroot.

It could also be a problem with the extension libsecure.
But i need to test it with the newest versions of tinymce and ckeditor.

regards,
Frank

Offline gptucci

  • User
  • *
  • Posts: 9
    • View Profile
Re: Code Snippets in Knowledgeroot
« Reply #13 on: January 28, 2012, 09:29:24 AM »
Tnx
I'm using Knowledgeroot version 1.0.3, and al thye extension are upgraded to the lastest version.
Tnx for your kindness !

Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: Code Snippets in Knowledgeroot
« Reply #14 on: February 11, 2012, 09:18:46 PM »
Hi,

i have upgraded the extensions ckeditor and tinymce.
Could you try it with the newest versions with and without extension libsecure enabled.

regards,
Frank

ps: sorry for late reply