Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:dokuwiki [2008/06/07 01:29]
cyril
software:dokuwiki [2022/04/08 07:34] (current)
cyril [The sidebar] with new version
Line 3: Line 3:
 [[http://wiki.splitbrain.org/wiki:dokuwiki|Dokuwiki]] is the wiki engine I am using. It seemed the nicer, more complete and easier to use to me. [[http://wiki.splitbrain.org/wiki:dokuwiki|Dokuwiki]] is the wiki engine I am using. It seemed the nicer, more complete and easier to use to me.
  
-===== Have it working on free.fr ===== 
  
-There was some problems to have it working on my host Free.+===== Le faire fonctionner sur les pages persos de free.fr =====
  
-Someone created a patch to solve all the problems: [[http://forum.dokuwiki.org/thread/518]].+Il y quelques problèmes pour le faire fonctionner chez Free, mais quelqu'un a créé un patch qui résout tous les problèmes : [[http://forum.dokuwiki.org/thread/518]].
  
 +Cependant dokuwiki est dorénavant banni chez Free. Si vous êtes détecté, votre compte sera suspendu pour le motif :
 +>Les interfaces utilisant des fichiers locaux comme base de données/log sont interdites.
 +
 +===== Install with Nginx =====
 +
 +''userewrite = 2'' (dokuwiki is rewriting) did not work with nginx, so I wanted to switch to mode 1 where the web server manages rewriting.
 +
 +There are suggestions of configuration [[https://www.dokuwiki.org/rewrite#nginx|here]] and [[http://wiki.nginx.org/Dokuwiki|here]] but they all seemed to assume that the wiki was at the root of the server, and the "@dokuwiki" syntax did not work in my case, when I want to access the wiki with domain.tld/wiki.
 +
 +Therefore I use this configuration, that in addition permanently redirects the old rewrite mode 2 to mode 1:<code>
 +                # always needed
 +                location ~ /wiki/(data|conf|bin|inc) {
 +                        deny all;
 +                }
 +                
 +                # needed to support old rewrite
 +                location ~ /wiki/doku.php/ {
 +                        rewrite ^/wiki/doku.php/(.*) /wiki/$1 permanent;
 +                }
 +
 +                # needed for new rewrite
 +                location ~ /wiki/lib/ {}
 +                location ~ /wiki/ {
 +                        rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
 +                        rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
 +                        rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
 +                        rewrite ^/wiki/(.*) /wiki/doku.php?id=$1 last;
 +                }
 +</code>
 +
 +With version ''2020-07-29 Hogfather'' the rewritemode 2 was working, but then it was impossible to log in anymore...
 ===== The sidebar ===== ===== The sidebar =====
  
Line 21: Line 51:
  
 You can change some options in ''sidebar/conf/tplfn_sidebar.php''. You can change some options in ''sidebar/conf/tplfn_sidebar.php''.
 +
 +In version ''2020-07-29 Hogfather'' the default template has a sidebar, by creating the ":sidebar" page.
  
  
Line 34: Line 66:
  
 Those I use are: Those I use are:
-  * [[http://wiki.splitbrain.org/plugin:searchindex|Search Index]] 
-  * [[http://wiki.splitbrain.org/plugin:source|source]] 
   * [[http://wiki.splitbrain.org/plugin:discussion|discussion]]   * [[http://wiki.splitbrain.org/plugin:discussion|discussion]]
   * [[http://wiki.splitbrain.org/plugin:captcha|captcha]]   * [[http://wiki.splitbrain.org/plugin:captcha|captcha]]
 +  * [[http://wiki.splitbrain.org/plugin:source|source]]
 +  * [[http://wiki.splitbrain.org/plugin:pageindex|PageIndex]]
 +  * [[http://wiki.splitbrain.org/plugin:searchindex|SearchIndex]]
 +  * [[http://wiki.splitbrain.org/plugin:latex|latex]]
 +  * [[http://wiki.splitbrain.org/plugin:comment|comment]]
 +  * [[http://wiki.splitbrain.org/plugin:comment|note]]
 +  * [[http://wiki.splitbrain.org/plugin:comment|tag]]
 +  * [[http://wiki.splitbrain.org/plugin:comment|keywords]]
  
 ==== source ==== ==== source ====
 +
 +It wasn't finding the local files without giving the full path. So I've added several cases where if it fails to find the file, it tries to find it relatively to the website root and relatively to the dokuwiki media path.
  
 <code diff> <code diff>
-syntax.php:166 +syntax.php:166|_getSource 
-< $source = @file($this->location.$file); +  $source = @file($this->location.$file); 
-< if (empty($source)) return '';++ if (empty($source)) $source = @file($_SERVER['DOCUMENT_ROOT']."/".$this->location.$file); 
 ++ if (empty($source)) $source = @file(DOKU_INC."data/media/".$this->location.$file); 
 +  if (empty($source)) return ''; 
 +</code>
  
-> $source @file($this->location.$file); +==== pageindex ==== 
-> if (empty($source)) $source @file($_SERVER['DOCUMENT_ROOT']."/".$this->location.$file); + 
-> if (empty($source)) $source @file(DOKU_INC."data/media/".$this->location.$file); +I modified it so that it displays directories/namespaces too, and displays recursively all pages. 
-> if (empty($source)) return '';+ 
 +<code diff> 
 +syntax.php:24|search_list_index 
 +- if ($type == 'd'return false
 +if ($type == 'd') 
 ++ { 
 ++ $id pathID($file); 
 ++ if($opts['ns'].":$id<> $ID)  
 ++ { 
 ++ $data[] array 
 ++ 'id'    => $opts['ns'].":$id", 
 ++ 'type'  => $type, 
 ++ 'level' => $lvl )
 ++ } 
 ++ return true; 
 ++ }
 </code> </code>
  
 +===== Show start on directory =====
 +
 +To show the start page when clicking on a directory/namespace in the sidebar/index, and to hide the start page in the list of pages.
 +
 +<code diff>
 +lib/scripts/index.js:28|treeattach
 +- addEvent(elem,'click',function(e){ return index.toggle(e,this); });
 ++ //addEvent(elem,'click',function(e){ return index.toggle(e,this); });
 +
 +inc/html.php:642|html_list_index
 +  $base = substr($base,strrpos($base,':')+1);
 ++ if ($base == "start" && $item['id'] != "start") return $ret;
 +  if($item['type']=='d'){
 +
 +inc/html.php:644|html_list_index
 +- $ret .= '<a href="'.wl($item['id'], "").':start" class="idx_dir"><strong>';
 ++ $ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" class="idx_dir"><strong>';
 +
 +inc/html.php:664|html_li_index
 +  function html_li_index($item){
 ++ $base = ':'.$item['id'];
 ++ $base = substr($base,strrpos($base,':')+1);
 ++ if ($base == "start" && $item['id'] != "start") return;
 +</code>
 +
 +===== Allow more file types for upload =====
 +
 +In conf/mime.conf, add:
 +<code>
 +html    text/html
 +htm     text/html
 +txt     text/plain
 +conf    text/plain
 +xml     text/xml
 +bas     text/bas
 +pas     text/pas
 +c     text/c
 +cpp     text/cpp
 +cxx     text/cxx
 +h     text/h
 +hpp     text/hpp
 +hxx     text/hxx
 +</code>
software/dokuwiki.1212802148.txt.gz · Last modified: 2013/09/19 16:43 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0