Category Archives: PHP

Integrating CKEditor into the ErfurtWiki system

Today I was trying to integrate CKEditor into the wiki system called ErfurtWiki, which I use as an internal documentation for one of my projects. The reason why I decided to use CKEditor is problem with encoding of czech characters in ErfurtWiki. Those characters are transformed into the html entities, which makes the topics hard to read when editing again.
But implementation of CKEditor in this case is not as easy as one would expect. The problem here is with html tags, which are also automatically transformed into the html entities. So when the topic is saved html tags appear as text.
To allow use html tags in topics in ErfurtWiki follow these steps:


Set follwing constants:
define(“EWIKI_ALLOW_HTML”, 1);
define(“EWIKI_HTML_CHARS”, 1);

Disable transformation of html tags into html entities:
$ewiki_config[“htmlentities”] = array();

And finally change the textarea to appear as CKEditor:
<script type=”text/javascript”>
window.onload = function()
{
CKEDITOR.replace(‘ewiki_content’, {
toolbar : [
[ ‘Source’ ]
],
forceEnterMode : true,
forcePasteAsPlainText : true,
enterMode : CKEDITOR.ENTER_BR
});
};
</script>

Quick steps to enable mod_rewrite in Linux apache2

Apache2 does not have mod_rewrite turned on by default. Fortunately there are just a few steps to get this functionality working.

First activate rewrite engine using the following command.

a2enmod rewrite

Then allow override in the site configuration file on Apache. In my case I am testing it on a development machine, so I will edit the main file

sudo gedit /etc/apache2/sites-enabled/default.

by changing AllowOverride from None to All.


<Directory /mnt/Personal/Web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

At the end Restart apache2.

sudo /etc/init.d/apache2 restart