Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.

Welcome to Eric Hameleers (Alien BOB)'s Wiki pages.

If you want to support my work, please consider a small donation:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
slackware:wikinotes [2006/03/23 16:29] alienslackware:wikinotes [2006/04/06 08:12] alien
Line 4: Line 4:
  
 The DokuWiki comes with a default template which is rather bland. Their web page lists a lot of user-contributed templates, some of which are visually more appealing or functionally better. I opted for the Monobook template. This is a port from the default [[wp>MediaWiki]] template (as seen on [[http://en.wikipedia.org|WikiPedia]]) which I find very nice looking. This template is avtively developed and many nice features have been added recently, which make it even better to customize. The DokuWiki comes with a default template which is rather bland. Their web page lists a lot of user-contributed templates, some of which are visually more appealing or functionally better. I opted for the Monobook template. This is a port from the default [[wp>MediaWiki]] template (as seen on [[http://en.wikipedia.org|WikiPedia]]) which I find very nice looking. This template is avtively developed and many nice features have been added recently, which make it even better to customize.
- 
  
 ==== Installing the dokuwiki tarball ==== ==== Installing the dokuwiki tarball ====
  
-  * Download the latest and greatest DokuWiki archive at the [[http://www.splitbrain.org/projects/dokuwiki|download page]].+  * Download the latest and greatest DokuWiki archive at the [[http://www.splitbrain.org/projects/dokuwiki|download page]]. Dokuwiki comes with a clear [[http://wiki.splitbrain.org/wiki:install|installation]] and [[http://wiki.splitbrain.org/wiki:config|configuration]] pages. This paragraph will recap some of that information.
  
   * Unpack the tarball into your Apache DocumentRoot, change to the DocumentRoot directory (by default that is ''/var/www/htdocs'') and create a symbolic link called //dokuwiki// that points to the fresh DokuWiki directory tree: <code>ln -s dokuwiki-yyyy-mm-dd dokuwiki</code>. If you already have a DokuWiki running, better wait with changing the symlink until you're sure you've configured and upgraded everything right.   * Unpack the tarball into your Apache DocumentRoot, change to the DocumentRoot directory (by default that is ''/var/www/htdocs'') and create a symbolic link called //dokuwiki// that points to the fresh DokuWiki directory tree: <code>ln -s dokuwiki-yyyy-mm-dd dokuwiki</code>. If you already have a DokuWiki running, better wait with changing the symlink until you're sure you've configured and upgraded everything right.
  
   * Change into the DokuWiki directory and have a look around.\\ The ''conf'' directory is where we will be customizing the new Wiki soon. The ''data''  directory is where all the Wiki content (pages, indexes, archives, media, cache) will be stored. If anything, your Apache webserver //must// be able to write there. The ''conf'' and ''data'' directories are the most important to back up regularly!   * Change into the DokuWiki directory and have a look around.\\ The ''conf'' directory is where we will be customizing the new Wiki soon. The ''data''  directory is where all the Wiki content (pages, indexes, archives, media, cache) will be stored. If anything, your Apache webserver //must// be able to write there. The ''conf'' and ''data'' directories are the most important to back up regularly!
 +
 +  * Create an empty logfile <code>
 +touch ./data/changes.log
 +</code>
  
   * Configuration.\\ You can customize the Wiki by overriding any of the values that are found in ./conf/dokuwiki.php. Just run <code>   * Configuration.\\ You can customize the Wiki by overriding any of the values that are found in ./conf/dokuwiki.php. Just run <code>
Line 24: Line 27:
  
  
-  * Finally, make sure that the webserver can read and //write// to your DokuWiki: <code>chown -R nobody:wheel .</code> In this example command, I assumed that you are running your Apache as the user "nobody" which is the default for Slackware, and that you have root access to the server.\\  In my case on the Slackware server, I have no privileged account, so I cannot change the ownership of any files. In order to make the Wiki writable by the Apache process, I had to make the ''./data'' directory writable for "others": <code>chmod -R o+w /path/to/dokuwiki/data</code>+  * Finally, make sure that the webserver can read and //write// to your DokuWiki: <code>chown -R nobody:wheel .</code> In this example command, I assumed that you are running your Apache as the user "nobody" which is the default for Slackware, and that you have root access to the server.\\  In my case on the Slackware server, I have no privileged account, so I cannot change the ownership of any files. In order to make the Wiki writable by the Apache process, I had to make the ''./data'' directory writable for "others": <code>chmod -R o+w /path/to/dokuwiki/data</code> There is also a problem with Dokuwiki's configuration manager. When you change configuration through the admin interface, the file ''./conf/local.php'' is (re-)written, actually the current file is moved to ''local.php.bak'' and a //new// file is written. In this process the //umask// settings are not honoured and you end up with a file owned by the web server and read-only to yourself. A small patch is enough to fix this, in the file ''./lib/plugins/config/settings/config.class.php'' at the start of function save_settings().\\ This is my diff: <code diff> 
 +--- ./lib/plugins/config/settings/config.class.php.org  2006-03-23 08:22:32.000000000 -0800 
 ++++ ./lib/plugins/config/settings/config.class.php      2006-03-23 08:23:37.000000000 -0800 
 +@@ -80,6 +80,9 @@ 
 +  
 +     function save_settings($id, $header='', $backup=true) { 
 +  
 ++      global $conf; 
 ++      umask($conf['umask']); 
 +
 +       if ($this->locked) return false; 
 +  
 +       $file = eval('return '.$this->_local_file.';'); 
 + 
 +</code> Now, with a customized umask like ''$conf['umask'] = '0111';'' the ''local.php'' file will have mode 666, so that  even while it is owned by the webserver, you can still edit it. These are the settings I use in my Wiki (you can change these using the configuration manager on the __//admin//__ page) <code> 
 +$conf['dmode'] = 0777; 
 +$conf['fmode'] = 0666; 
 +$conf['umask'] = '0111'; 
 +$conf['dmask'] = '0000'; 
 +</code> 
 +<note important> You have to take care with the default umask and dmask settings because you will end up with lots of other files and directories that are owned by the webserver and read-only to you. This has the effect for instance, that you cannot delete the ''./data/cache'' directories and files any longer!</note> 
 + 
 +  * DokuWiki comes with a plugin manager that according to the documentation is disabled by default - to enable the plugin manager, add the following line to ''./conf/local.php'' <code> 
 +$conf['pluginmanager'] = 1;              //enable automated plugin management 
 +</code> For this to work, the plugin manager (i.e. efeectively the web server process) must have write access to the ''./lib/plugins'' directory, so I also did <code> 
 +chmod -R a+w ./lib/plugins</code>
  
 ==== Template and plugins ==== ==== Template and plugins ====
Line 73: Line 101:
   <div class="portlet" id="p-logo">   <div class="portlet" id="p-logo">
 </code> </code>
 +
 +  * //(28-mar-2006)// the official Monobook template has undergone a couple of changes (some of which are my contributions) and I can now use an (almost) unmodified template. The only modifications are the few lines that need to be added for the [[slackware:wikinotes#pluginblog | blog plugin]] and the boldface tags I removed around the "edit this page" button (IMO, it should only be bold if it is activated by clicking the button).
  
 === Plugin: blog === === Plugin: blog ===
Line 83: Line 113:
 include(DOKU_PLUGIN.'blog/functions.php'); include(DOKU_PLUGIN.'blog/functions.php');
 // we must move the doctype down (unfortunately) - headers need to be first // we must move the doctype down (unfortunately) - headers need to be first
-?></code> It should come right before the line ''<!DOCTYPE html PUBLIC .....>''.\\ And add this line immediately below the line that says ''<?php tpl_content()?>'': <code><?php tpl_discussion()?></code>+?></code> It should come right before the line ''<!DOCTYPE html PUBLIC .....>''.\\ And add this line immediately below the line that says ''<?php tpl_content()?>'': <code><?php tpl_discussion()?> 
 +</code> 
 +    * (//24-mar-2006//) Actually, this introduces an error when you want to click the plugin's //info// button in the plugin manager.               I get the following error <code> 
 +Fatal error: Cannot redeclare html_discussion()  
 +(previously declared in /home/tag-am-meer.info/public_html/wiki/lib/plugins/blog/functions.php:77)  
 +in /home/tag-am-meer.info/public_html/wiki/lib/plugins/blog/functions.php on line 76 
 +</code> This is easily solved by changing the line you include at the top of your template’s main.php from <code> include(DOKU_PLUGIN.’blog/functions.php’);</code> to <code>include_once(DOKU_PLUGIN.'blog/functions.php');</code>
  
   * Customization of the blog plugin.\\ Create a file ''./lib/plugins/blog/conf/local.php'' and copy the parameters from the file ''./lib/plugins/blog/conf/default.php'' over into this file if you want them changed. My only change was: <code>   * Customization of the blog plugin.\\ Create a file ''./lib/plugins/blog/conf/local.php'' and copy the parameters from the file ''./lib/plugins/blog/conf/default.php'' over into this file if you want them changed. My only change was: <code>
Line 108: Line 144:
   * //(23-mar-2006)// My changes were picked up by Olivier, the author of the //note// plugin, and therefore I changed back to the "official" newly released version (which now uses nice rounded corners).   * //(23-mar-2006)// My changes were picked up by Olivier, the author of the //note// plugin, and therefore I changed back to the "official" newly released version (which now uses nice rounded corners).
  
 +  * //(25-mar-2006)// Because of the bugs in the code, I decided to re-write the plugin almost from scratch. That resulted in a correctly rendering ''<note></note>'' tag, plus notes can be nested now. {{:slackware:dokuwiki-plugin-note-20060325.tar.gz|Download here}}.
  
 ==== Tuning the look and feel ==== ==== Tuning the look and feel ====
Line 128: Line 165:
 === Adding an editor toolbar button === === Adding an editor toolbar button ===
  
 +The //editor toolbar// is the array of buttons that is displayed after you open a Wiki page in edit mode ("edit this page"). It can help you inserting markup tags like italic, bold, hyperlinks, images etc... comfortably.\\
 I missed a toolbar button for quickly inserting ''<code></code>'' tags. This is what is needed to add such a button to the toolbar: I missed a toolbar button for quickly inserting ''<code></code>'' tags. This is what is needed to add such a button to the toolbar:
  
Line 143: Line 181:
 </file> </file>
   * Add this text to the english language file  ''inc/lang/en/lang.php'' (for other languages the corresponding texts have not yet been updated): <code>$lang['qb_syntax' = 'Syntax Code';</code> And voilá!   * Add this text to the english language file  ''inc/lang/en/lang.php'' (for other languages the corresponding texts have not yet been updated): <code>$lang['qb_syntax' = 'Syntax Code';</code> And voilá!
 +
 +//(06apr2006)// I added another toolbar button, this time to insert %%<key></key>%% tags. The [[http://wiki.foosel.net/snippets/dokuwiki/keyboard?do=show|keyboard plugin]] site has it wrong, the instructions are for the older version of DokuWiki. This is what I had to do:
 +
 +  * Download the [[http://wiki.foosel.net/download/keyboard.png|toolbar icon bitmap]] (local copy {{slackware:keyboard.png|here}}) This bitmap has a size of 24x24 pixels (the old toolbar button format) but we need a 16x16 pixel bitmap. I used these commands to resize the file: <code>
 +mv keyboard.png keyboard-24x24.png
 +convert -size 16x16 keyboard-24x24.png -resize 16x16 keyboard.png
 +rm keyboard-24x24.png
 +</code> Then copy the resized icon file into ''./lib/images/toolbar''
 +
 +  * Edit ''./inc/toolbar.php'' and add <file>
 +       array(
 +            'type'   => 'format',
 +            'title'  => $lang['qb_keyb'],
 +            'icon'   => 'keyboard.png',
 +            'key'    => 'k',
 +            'open'  => '<key>',
 +            'close'   => '</key>',
 +            ),
 +</file> at an appropriate place in the toolbar array
 +
 +  * Add this text to the english language file  ''inc/lang/en/lang.php'' (for other languages the corresponding texts have not yet been updated): <code>$lang['qb_keyb'] = 'Mark text as key';</code>
 +
 Setting up Alien&#039;s DokuWiki ()
SlackDocs