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

slackware:wikinotes [2006/04/01 17:57]
alien
slackware:wikinotes [2009/06/19 19:40] (current)
alien Link fixes: the software URLs have moved on tatewake.com.
Line 3: Line 3:
 Here's what I had to do to get the Wiki up and running. Remember that the DokuWiki has no need for a database server like MySQL. The Wiki pages, indexes and archives are stored as files below the DokuWiki root (or anyplace else if you want to separate the content from the code). This makes it ideal to install in your own home directory. You do not need any additional permissions on the webserver. Here's what I had to do to get the Wiki up and running. Remember that the DokuWiki has no need for a database server like MySQL. The Wiki pages, indexes and archives are stored as files below the DokuWiki root (or anyplace else if you want to separate the content from the code). This makes it ideal to install in your own home directory. You do not need any additional permissions on the webserver.
  
-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.+> I upgraded to dokuwiki-2008-05-05 and decided to re-visit this page as well. Some of the instructions were outdated, and the section about the //blog// plugin has been removed, now that I use WordPress software for [[http://alien.slackbook.org/blog/|my new blog]]. The [[http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:wikinotes&do=revisions|old revisions of this page]] still contains everything I edited away. 
 + 
 +The DokuWiki comes with a default template which is very functional but rather bland-lookingThe DokuWiki 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 actively developed and has many nice features, which make it even better to customize.
  
 ==== Installing the dokuwiki tarball ==== ==== Installing the dokuwiki tarball ====
Line 20: Line 22:
 cd conf cd conf
 cp -a local.php.dist local.php cp -a local.php.dist local.php
-</code> and add any line from ''dokuwiki.conf'' that you want to give a custom value.\\ When you want to add user accounts and access control lists, create the two needed configuration files and edit them (or use the Admin interface of your wiki to set this up): <code>+</code> and add any line from ''dokuwiki.php'' that you want to give a custom value.\\ When you want to add user accounts and access control lists, create the two needed configuration files and edit them (or use the Admin interface of your wiki to set this up): <code>
 cd conf cd conf
 cp -a users.auth.php.dist users.auth.php cp -a users.auth.php.dist users.auth.php
Line 27: Line 29:
  
  
-  * 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>+  * Finally, make sure that the webserver can read and //write// to your DokuWiki: <code>chown -R apache:wheel .</code> In this example command, I assumed that you are running your Apache as the user "apache" 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.org  2006-03-23 08:22:32.000000000 -0800
 +++ ./lib/plugins/config/settings/config.class.php      2006-03-23 08:23:37.000000000 -0800 +++ ./lib/plugins/config/settings/config.class.php      2006-03-23 08:23:37.000000000 -0800
Line 58: Line 60:
 === Template: MonoBook === === Template: MonoBook ===
  
-  * Get the archive file for the monobook template from [[http://tatewake.com/wiki/projects:monobook_for_dokuwiki|Tatewake's web site]]. The template should match with the release of DokuWiki you've just installed. This is only an issue when there has been a major new release of DokuWiki. Usually you would just grab the most recent monobook release.+  * Get the archive file for the monobook template from [[http://tatewake.com/wiki/software:dokuwiki:template:monobook|Tatewake's web site]]. The template should match with the release of DokuWiki you've just installed. This is only an issue when there has been a major new release of DokuWiki. Usually you would just grab the most recent monobook release.
  
-  * Unzip the archive into the DokuWiki template directory: <code>unzip monobook-03142006.zip -d /path/to/dokuwiki/lib/tpl/</code>+  * Unzip the archive into the DokuWiki template directory: <code>unzip monobook-ddmmyyyy.zip -d /path/to/dokuwiki/lib/tpl/</code>
  
   * Fix the permissions and ownership of the monobook directory tree, so that the webserver can at least read them.   * Fix the permissions and ownership of the monobook directory tree, so that the webserver can at least read them.
  
-  * //(16-mar-2006)// The monobook template misses the file ''./lib/tpl/default/style.ini'', so I copied it over to the monobook directory. This takes care of some custom definitions in the blog plugin.+=== Plugin: note ===
  
-  * //(21-mar-2006)// The new version of the template (03182006) fixes the style issues I had with the previous version. I also adapted the tabs on the top of the wiki pages (the 'article' 'show page' etc...) to be more conformant with the MediaWiki's original Monobook templateThese are my fixes: <code> +I use the "note" plugin for DokuWiki. This plugin displays nice informational icons in the margin, like "tip" "warning" "information" and "note". The plugin source is available at [[http://wiki.splitbrain.org/plugin:note | the DokuWiki site]]. The initial versiondid not do what I wanted from it, plus it required you to copy the images into your template directory, and add the CSS to the template's stylesheetSo hacked it and my changes were accepted by the plugin author, so that now the plugin is fully contained into the DokuWiki'''./lib/plugins/note/'' directory.\\ An example of this plugin is used bit higher up in the page (in the //Installing the dokuwiki tarball// section).
---- main.css.org        2006-03-20 15:56:32.000000000 -0800 +
-+++ main.css            2006-03-20 15:43:56.000000000 -0800 +
-@@ -827,6 +827,7 @@ +
- #p-cactions li.selected { +
-     border-color: #fabd23; +
-     padding: 0 0 .2em 0; +
-+    font-weight: bold; +
- } +
- #p-cactions li +
-     background-color: white;+
  
 +=== Plugin: keyboard ===
  
 +The keyboard plugin enables you to add visual clues to keypress examples. Like, Windows users often need <key>Ctrl-Alt-Del</key> !\\ This plugin automatically adds a button to the button bar of the Wiki editor. If the plugin does not show up after you reload the editor, you may have to purge the wiki's cached javascript code by visiting this link:
 +  http://your.domain.com/path/to/dokuwiki/lib/exe/js.php?edit=1&write=1&purge=1
  
---- main.php.org        2006-03-20 15:55:01.000000000 -0800 +=== Plugin: displaywikipage ===
-+++ main.php            2006-03-20 15:54:35.000000000 -0800 +
-@@ -59,12 +59,13 @@ +
-  <div id="p-cactions" class="portlet"> +
-    <h5>Views</h5> +
-    <ul> +
--     <li id="ca-nstab-main" class="selected"><b><a href="<?php echo DOKU_BASE?>doku.php?id=<?php echo $ID?>">article</a></b></li> +
-+     <li id="ca-nstab-main" class="selected"><a href="<?php echo DOKU_BASE?>doku.php?id=<?php echo $ID?>">article</a></li> +
- <?php if($INFO['perm'] == AUTH_ADMIN) { ?> +
--     <li id="ca-talk" class="new"><?php tpl_actionlink('admin'); ?></li> +
-+     <li id="ca-talk" class="new<?php if($ACT == 'admin') { echo " selected"; } ?>"><?php tpl_actionlink('admin'); ?></li> +
- <?php } ?> +
--     <li id="ca-edit"><b><?php tpl_actionlink('edit'); ?></b></li> +
--     <li id="ca-history"><?php tpl_actionlink('history'); ?></li> +
-+     <li id="ca-edit" <?php if($ACT == 'edit') { echo "class=\"selected\""; } ?>><?php tpl_actionlink('edit'); ?></li> +
-+     <li id="ca-history" <?php if($ACT == 'revisions') { echo "class=\"selected\""; } ?>><?php tpl_actionlink('history'); ?></li> +
-+     <li id="ca-backlink" <?php if($ACT == 'backlink') { echo "class=\"selected\""; } ?>><?php tpl_actionlink('backlink'); ?></li> +
-    </ul> +
-  </div> +
-  <div class="portlet" id="p-logo"> +
-</code>+
  
-  * //(28-mar-2006)// the official Monobook template has undergone a couple of changes (some of which are my contributions) and 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).+This plugin enables you to embed a Wiki page into any other Wiki page. It is used by the Monobook template and can be downloaded from that same website.
  
-=== Plugin: blog ===+=== Plugin: referrers ===
  
-  * Actually, I'm still testing this.\\ The blog plugin can be obtained [[http://wiki.splitbrain.org/plugin:blog|here]] and downloaded as ZIP archive: <code>wget http://www.qwik.ch/media/blog.zip</code>+The //referrers// plugin (also found on [[http://tatewake.com/wiki/software:dokuwiki:plugin:referrers|tatewake.com]]) keeps list of visitors of the Wiki and particularly the //HTTP_REFERER// value the browser sends to ApacheThis is what (part of) the page would look like:
  
-  * Unzip the blog plugin into ''./lib/plugins/''Add this to the //top// of your template's ''main.php'' in my case that is the file ''./lib/tpl/monobook/main.php''<code>+^ hostname ^ ip address ^ referrer ^ 
 +| %%some.hostname.net%% | xxx.xxx.xxx.xxx| [[http://www.linuxquestions.org/questions/slackware-14/qemu-and-kqemu-on-slackware-465123/]] | 
 +| %%some.other.hostname.net%% | yyy.yyy.yyy.yyy| [[http://www.google.com/search?hl=en&q=boot+usb+stick+fdisk&btnG=Google+Search&aq=f&oq=]] | 
 +| %%another.hostname.net%% | zzz.zzz.zzz.zzz| [[http://www.linuxquestions.org/questions/slackware-14/mounting-nfs-482516/]] | 
 + 
 +__//Note://__ I needed to manually create the local_prefs.php file and fill it with defaults, or else the configuration manager would give an error when trying to save the preferences for this plugin: <code> 
 +touch ./lib/plugins/referrers/local_pref.php 
 +chmod 666 ./lib/plugins/referrers/local_pref.php 
 +</code> and this is what the file looks like (the value for ''referrer-ignore'' was set through the configuration manager) <code bash>
 <?php <?php
-// include discussion code +// This file is automatically generated 
-include(DOKU_PLUGIN.'blog/functions.php'); +$re_settings['referrer-ignore'] = 'alien.slackbook.org/dokuwiki'; 
-// we must move the doctype down (unfortunately) headers need to be first +$re_settings['dontcountadmin'] = ''; 
-?></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()?>+$re_settings['dontcountusers'] = ''; 
-</code> +</code> //It is required for the plugin to work as intended, to have a __non-empty__ value for ''referrer-ignore''//!
-    * (//24-mar-2006//) Actuallythis 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> +=== Plugincaptcha ===
-$conf['plugin']['blog']['tag_namespace'] 'blog:categories';       // where should tag links point to? +
-</code> This way, the tags or "categories" get their own [[http://wiki.splitbrain.org/wiki:namespaces|namespace]]. \\ Note that the original //$conf['tag_namespace']// must change to //$conf['plugin']['blog']['tag_namespace']//. +
  
-  * Now, the blog plugin is ready for use. How to use it, is another story entirely, and I am in the process of finding out.+I needed this plugin to get rid of Wiki spammersBefore I had installed this, spammers would attack my discussion pages on a daily basis. Get it at http://www.dokuwiki.org/plugin:captcha
  
 +=== Plugin: odt ===
  
-=== Pluginboxes === +This plugin enables you to export any wiki page as an OpenOffice.org text document. Get it at http://www.dokuwiki.org/plugin:odt - you may have to watch out for plugins that expand the wiki syntax - such plugin needs to be able to generate OpenOffice codeFor instance, I use the //note// plugin, and the odt plugin editor wrote a patch for the //note// plugin to make it support //odt//. 
- +In the [[#tuning_the_look_and_feel|next section]] I have included a patch for the Monobook template's toolbox to make it contain an "OpenOffice exportlink. I also patched the plugin so that you can define an //"odt template"// document which will be used as the basis for the generated .ODT document. My own template is here: {{:odt:wiki-template.odt|wiki-template.odt}}. The patch I used is <code diff> 
-The //boxes// plugin enables the ''<box></box>'' tag which shows up in your page as floating box, with several possible stylesThe feature that attracted me to it is the "leftand "rightstyles which create floating boxes that are leftor right-aligned+diff -uarN odt.orig/conf/default.php odt/conf/default.php 
-Unfortunately, my Mozilla browser does not display these floating boxes correctly :-( [[http://tag-am-meer.info/wiki/|This wiki]] shows boxes correctly though... who can explain why?\\ +--- odt.orig/conf/default.php   2008-05-07 16:20:34.000000000 +0000 
-Installation++++ odt/conf/default.php        2008-11-19 16:12:34.657733978 +0000 
- +@@ -5,3 +5,7 @@ 
-  * Download the [[http://www.cdsmith.plus.com/dokuwiki/plugin-box.tar.gz|plugin-box.tar.gz archive]] and unpack it into ''./lib/plugins/''That is all! +  
- + // Directory of the templates in the media manager 
-  * If your ''<box>;'' tags don't show up, the wiki cache is interfering. Altering something in your Wiki configuration (like the used templateseems to force a cache flush, so that is what I did to make the boxes display right away+ $conf['tpl_dir'] = 'odt'; 
- +
-=== Pluginnote === ++// Leave emptyin order to not use any template 
- ++$conf['tpl_template'] = ''; 
-I downloaded the &quot;note&quotplugin for DokuWiki. This plugin displays nice informational icons in the marginlike &quot;tip&quot; "warning";note&quotand "note". The plugin source is available at [[http://wiki.splitbrain.org/plugin:note | the DokuWiki site]] but it did not do what I wanted from it, plus it requires you to copy the images into your template directory, and add the CSS to the template's stylesheetSo I hacked it, so that now the plugin is fully contained into the DokuWiki's ''./lib/plugins/note/'' directoryYou can download my {{:slackware:dokuwiki-plugin-note-3alien.tar.gz|modified plugin}} and unpack it into your DokuWiki's ''./lib/plugins/'' directory. +
- +diff -uarN odt.orig/conf/metadata.php odt/conf/metadata.php 
-  * //(23-mar-2006)// My changes were picked up by Olivier, the author of the //note// plugin, and therefore I changed back to the "officialnewly released version (which now uses nice rounded corners). +--- odt.orig/conf/metadata.php  2008-05-07 16:20:34.000000000 +0000 
- ++++ odt/conf/metadata.php       2008-11-19 16:06:09.217839938 +0000 
-  * //(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}}.+@@ -6,3 +6,4 @@ 
 +  *
 +  
 + $meta['tpl_dir']   = array('string'); 
 ++$meta['tpl_template']   = array('string')
 +diff -uarN odt.orig/renderer.php odt/renderer.php 
 +--- odt.orig/renderer.php       2008-05-07 16:20:34.000000000 +0000 
 ++++ odt/renderer.php    2008-11-19 16:12:15.285718568 +0000 
 +@@ -247,7 +247,11 @@ 
 +      * Closes the document 
 +      */ 
 +     function document_end(){ 
 +-        if ($this-&gt;template) { // template chosen 
 ++        if (empty($this-&gt;template)) { // if no template chosen in current pageget default template from config 
 ++            $this-&gt;template=$this-&gt;getConf("tpl_template"); 
 ++        } 
 +
 ++        if (!empty($this-&gt;template)) { // template chosen 
 +             if (file_exists(DOKU_INC.'data/media/'.$this->getConf("tpl_dir")."/".$this->template)) { //template found 
 +                 $this->document_end_template(); 
 +             } else { // template chosen but not found : warn the user and use the default template 
 +</codeand then you can define a template in the wiki's configuration manager.
  
 ==== Tuning the look and feel ==== ==== Tuning the look and feel ====
Line 151: Line 149:
 wget http://www.kde-look.org/content/pre1/11377-1.png wget http://www.kde-look.org/content/pre1/11377-1.png
 convert 11377-1.png -resize 128x128 blueorb_128.png convert 11377-1.png -resize 128x128 blueorb_128.png
-cat blueorb_128.png > /path/to/dokuwiki/lib/tpl/monobook/wiki-dokuwiki-128.png+cat blueorb_128.png > /path/to/dokuwiki/lib/tpl/monobook-yyyy-dmm-dd/user/logo.png
 </code> Note that the monobook template redefines the location of the site's logo bitmap. The default bitmap for dokuwiki is ''./data/media/wiki/dokuwiki-128.png'' </code> Note that the monobook template redefines the location of the site's logo bitmap. The default bitmap for dokuwiki is ''./data/media/wiki/dokuwiki-128.png''
  
-  * I added my own links to the "navigation" and "toolbox" boxes on the left. This is as easy as editing the "user-modifiablefiles found in ''./lib/tpl/monobook/user/*.php'' +  * I added my own links to the "navigation" and "toolbox" boxes on the left. The "navigation" box actually is a separate wiki page, it's location is defined in the monobook section in the wiki's configuration manager. I liked the old php array better, but o well... The "toolboxis actually hard-coded into '' lib/tpl/monobook-yyyy-mm-dd/context.php'' and still uses the php array. I added a few items to the default toolbox: <code diff> 
- +--- context.php.orig    2008-07-30 03:49:22.000000000 +0000 
-  * <del>I added a few lines to monobook's main.css file that makes the Wiki links appear in //red// when they point to a not yet existing Wiki page.</delThe 14-mar-2006 version of MonoBook has a doku.css which contains the "missing wikilinkstyle definition. It now works out of the box. ++++ context.php 2008-09-26 14:40:39.377450051 +0000 
- +@@ -357,6 +357,14 @@ 
-  * The blog plugin has a bland color schemeI found a better looking {{:slackware:style.css|style.css}} in [[http://doogie.in-space.de/dokuwiki/|Doogie's blog]] and used that to replace ''./lib/plugins/blog/style.css''+ $monobook['defaulttoolbox']['whatlinkshere']['text'] = $lang['monobook_whatlinkshere']; 
 + $monobook['defaulttoolbox']['whatlinkshere']['rel'] = "nofollow"; 
 +  
 ++$monobook['defaulttoolbox']['related']['href'] = DOKU_BASE."doku.php?id=".$ID."&amp;do=recent"; 
 ++$monobook['defaulttoolbox']['related']['text'] = "Related changes"; 
 ++$monobook['defaulttoolbox']['related']['rel'] = "nofollow"; 
 +
 ++$monobook['defaulttoolbox']['wikisyn']['href'] = DOKU_BASE."doku.php?id=wiki:syntax"; 
 ++$monobook['defaulttoolbox']['wikisyn']['text'] = "Wiki syntax"; 
 ++$monobook['defaulttoolbox']['wikisyn']['rel'] = "nofollow"; 
 +
 + $monobook['defaulttoolbox']['upload']['href'] = DOKU_BASE."lib/exe/mediamanager.php?ns=".getNS($ID); 
 + $monobook['defaulttoolbox']['upload']['text'] = $lang['monobook_upload']; 
 + $monobook['defaulttoolbox']['upload']['rel'] = "nofollow"; 
 +@@ -391,4 +399,12 @@ 
 + $monobook['defaulttoolbox']['cite']['text'] = $lang['monobook_cite']; 
 + $monobook['defaulttoolbox']['cite']['rel'] = "nofollow"; 
 +  
 +-?> 
 +\ No newline at end of file 
 ++if (isset($_REQUEST['rev'])) 
 ++   $monobook['defaulttoolbox']['odt']['href'] = exportlink($ID."&amp;rev=".$requestREV, 'odt'); 
 ++else 
 ++    $monobook['defaulttoolbox']['odt']['href'] = exportlink($ID, 'odt'); 
 +
 ++$monobook['defaulttoolbox']['odt']['text'] = "OpenOffice export"; 
 ++$monobook['defaulttoolbox']['odt']['rel'] = "nofollow"; 
 +
 ++?> 
 +</code>
  
   * To silence Apache in it's error_log, I also copied a favicon.ico file to the DokuWiki image library: <code>cp /path/to/documentroot/favicon.ico /path/to/dokuwiki/lib/images/</code>   * To silence Apache in it's error_log, I also copied a favicon.ico file to the DokuWiki image library: <code>cp /path/to/documentroot/favicon.ico /path/to/dokuwiki/lib/images/</code>
 +
  
  
Line 181: Line 209:
 </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á!
 +
 +
 +

Personal Tools
sponsoring