這是本文件的舊版!


本wiki的個性化修改

本wiki的系統管理員在安裝DokuWiki時,發現有些功能未如理想,稍作修改。本wiki系統管理員支持開源軟件精神,故特此在這兒公開所有對DokuWiki或附加元件作出的修改。

Dokuwiki版本

no info about version

語法附加元件

以下是本wiki安裝的語法附加元件:

Patch files

以下是本wiki的系統管理員,對DokuWiki作出的修改(patch file):

DokuWiki 主程式

  • 加入DokuWiki預設裏欠缺的wiki間互連(interwiki)。
    創建 <dokuwiki_path>/conf/interwiki.local.conf
  • 修改預設CSS
    創建 <dokuwiki_path>/conf/userall.css
  • 使用Javascript改變tag和討論區的排序
    創建 <dokuwiki_path>/conf/userscript.js
  • 修改連結顯示方式:內部連結顯示分類名稱,wiki間互連顯示所連結的wiki名稱。
    patch file: cd <dokuwiki_path>; patch -p1 < <patch file>
    --- dokuwiki-2012-01-25b/inc/parser/xhtml.php	2012-07-13 19:13:57.000000000 +0800
    +++ dokuwiki/inc/parser/xhtml.php	2012-09-03 16:57:24.116682649 +0800
    @@ -583,10 +583,10 @@
             }
     
             // default name is based on $id as given
    -        $default = $this->_simpleTitle($id);
    +        $default = $id;
     
             // now first resolve and clean up the $id
    -        resolve_pageid(getNS($ID),$id,$exists);
    +        resolve_pageid(getNS($id),$id,$exists);
     
             $name = $this->_getLinkTitle($name, $default, $isImage, $id, $linktype);
             if ( !$isImage ) {
    @@ -692,7 +692,7 @@
             $link['pre']    = '';
             $link['suf']    = '';
             $link['more']   = '';
    -        $link['name']   = $this->_getLinkTitle($name, $wikiUri, $isImage);
    +        $link['name']   = $this->_getLinkTitle($name, "$wikiName:$wikiUri", $isImage);
     
             //get interwiki URL
             $url = $this->_resolveInterWiki($wikiName,$wikiUri);
  • 介面字眼修改
    • <dokuwiki_path>/inc/lang/zh-tw/edit.txt 改為
      編輯本頁並按下''儲存''即可。可在[[w:語法|wiki語法]]找到語法說明。請只在能讓本文品質**更好**時才編輯。如果只是要測試,請使用 [[w:playground|遊樂場]]。

Vshare附加元件

  • 支援大陸視頻網站。
    <dokuwiki_path>/lib/plugins/vshare/sites.conf 加上以下數行:
    youku           http://player.youku.com/player.php/sid/@VIDEO@/v.swf
    tudou           http://www.tudou.com/v/@VIDEO@/&resourceId=0_05_05_99&bid=05/v.swf
    sina            http://you.video.sina.com.cn/api/sinawebApi/outplayrefer.php/vid=@VIDEO@_akq2RyU+XDTK+l1lHz2stqkP7KQNt6nkjG+0vFatLQpcQ0/XM5GYa9kD4SHSAtkEqDhARZE7cf8u0x8/s.swf

Pagelist附加元件

  • 改變tag頁面連結顯示方式。
    patch file: cd <dokuwiki_path>/lib/plugins/pagelist; patch -p1 < <patch file>
    (ref: https://github.com/dokufreaks/plugin-pagelist/issues/26)
    --- pagelist.org/helper.php 2012-09-03 10:57:52.765809097 +0800
    +++ pagelist/helper.php 2012-09-03 10:58:00.144807653 +0800
    @@ -324,7 +324,7 @@
    
             // produce output
             $content = '<a href="'.wl($id).($this->page['section'] ? '#'.$this->page['section'] : '').
    -            '" class="'.$class.'" title="'.$id.'">'.$title.'</a>';
    +            '" class="'.$class.'" title="'.$id.'">'.$id.'</a>';
             if ($this->style == 'list') $content = '<ul><li>'.$content.'</li></ul>';
             return $this->_printCell('page', $content);
         }

Tag附加元件

  • 改變tag頁面排序方式。
    patch file: cd <dokuwiki_path>/lib/plugins/tag; patch -p1 < <patch file>
    (https://github.com/dokufreaks/plugin-tag/issues/69#issuecomment-8250346 並稍加修改)
    --- tag/helper.php.orig 2012-09-04 10:35:21.586807437 +0800
    +++ tag/helper.php  2012-09-04 10:36:28.412807754 +0800
    @@ -200,12 +200,37 @@
             }
    
             // finally sort by sort key
    -        if ($this->getConf('sortorder') == 'ascending') ksort($result);
    -        else krsort($result);
    +        if ($this->sort == 'id') {
    +          if ($this->getConf('sortorder') == 'ascending') uksort($result, "helper_plugin_tag::sort_page_id");
    +          else uksort($result, "helper_plugin_tag::sort_page_id_r");
    +        } else {
    +          if ($this->getConf('sortorder') == 'ascending') ksort($result);
    +          else krsort($result);
    +        }
    
             return $result;
         }
    
    +    function sort_page_id ($a, $b) {
    +      $a_ns = getNS($a);
    +      $b_ns = getNS($b);
    +      if (getNS($a) === false) $a = "\ff".$a;
    +      else $a = str_replace(":", "\0", $a);
    +      if (getNS($b) === false) $b = "\ff".$b;
    +      else $b = str_replace(":", "\0", $b);
    +      return strcmp($a, $b);
    +    }
    +
    +    function sort_page_id_r ($a, $b) {
    +      $a_ns = getNS($a);
    +      $b_ns = getNS($b);
    +      if (getNS($a) === false) $a = "\ff".$a;
    +      else $a = str_replace(":", "\0", $a);
    +      if (getNS($b) === false) $b = "\ff".$b;
    +      else $b = str_replace(":", "\0", $b);
    +      return strcmp($b, $a);
    +    }
    +
         /**
          * Refine found pages with tags (+tag: AND, -tag: (AND) NOT)
          */
  • 無論與tag同名的條目是否存在,tag 連結均永遠連往頁面清單
    patch file: cd <dokuwiki_path>/lib/plugins/tag; patch -p1 < <patch file>
    --- tag/helper.php.orig 2012-10-14 15:10:33.113356551 +0800
    +++ tag/helper.php      2012-10-14 15:20:25.683356660 +0800
    @@ -126,7 +126,7 @@
             $svtag = $tag;
             $title = str_replace('_', ' ', noNS($tag));
             resolve_pageid($this->namespace, $tag, $exists); // resolve shortcuts
    -        if ($exists) {
    +        /*if ($exists) {
                 $class = 'wikilink1';
                 $url   = wl($tag);
                 if ($conf['useheading']) {
    @@ -134,12 +134,12 @@
                     $heading = p_get_first_heading($tag, false);
                     if ($heading) $title = $heading;
                 }
    -        } else {
    +        } else {*/
                 $class = 'wikilink1';
                 $url   = wl($tag, array('do'=>'showtag', 'tag'=>$svtag));
    -        }
    +        //}
             $link = '<a href="'.$url.'" class="'.$class.'" title="'.hsc($tag).
    -            '" rel="tag">'.hsc($title).'</a>';
    +            '" rel="tag">'.hsc($tag).'</a>';
             return $link;
         }
    

Dokubook主題

  • 局部中文化 dokubook:
    • 創建 <dokuwiki_path>/lib/tpl/dokubook/lang/zh-tw/lang.php
      <?php
      $lang['toolbox']    = '工具箱';
      $lang['navigation'] = '導航';
      ?>
    • 創建 <dokuwiki_path>/lib/tpl/dokubook/lang/zh-tw/settings.php (未有中文化管理介面,直接使用英文版)
      <?php
      $lang['sb_pagename'] = "Pagename to use for the navigation";
      $lang['sb_position'] = "Sidebar position";
      $lang['ft_pagename'] = "Pagename to use for the footer";
      $lang['closedwiki']  = "Closed Wiki (Navigation shows only the login form if not logged in)";
      $lang['logo']        = "Path to an image used as logo";
      ?>

Fontcolor附加元件

Wrap附加元件

  • 加入文字對齊按鈕
    • 下載 http://canto.acgvlyric.org/_upload/wrap_align.zip ,解壓至 <dokuwiki_path>/lib/plugins/wrap/images/toolbar
    • patch file: cd <dokuwiki_path>/lib/plugins/wrap; patch -p1 < <patch file>
      diff -ur wrap.org/action.php wrap/action.php
      --- wrap.org/action.php	2011-05-15 18:14:54.000000000 +0800
      +++ wrap/action.php	2012-09-25 15:32:01.642446079 +0800
      @@ -31,6 +31,34 @@
                   'list' => array(
                       array(
                           'type'   => 'format',
      +                    'title'  => $this->getLang('pleft'),
      +                    'icon'   => '../../plugins/wrap/images/toolbar/pleft.png',
      +                    'open'   => '<WRAP leftalign>\n',
      +                    'close'  => '\n</WRAP>\n',
      +                ),
      +                array(
      +                    'type'   => 'format',
      +                    'title'  => $this->getLang('pright'),
      +                    'icon'   => '../../plugins/wrap/images/toolbar/pright.png',
      +                    'open'   => '<WRAP rightalign>\n',
      +                    'close'  => '\n</WRAP>\n',
      +                ),
      +                array(
      +                    'type'   => 'format',
      +                    'title'  => $this->getLang('pcenter'),
      +                    'icon'   => '../../plugins/wrap/images/toolbar/pcenter.png',
      +                    'open'   => '<WRAP centeralign>\n',
      +                    'close'  => '\n</WRAP>\n',
      +                ),
      +                array(
      +                    'type'   => 'format',
      +                    'title'  => $this->getLang('pjustify'),
      +                    'icon'   => '../../plugins/wrap/images/toolbar/pjustify.png',
      +                    'open'   => '<WRAP justify>\n',
      +                    'close'  => '\n</WRAP>\n',
      +                ),
      +                array(
      +                    'type'   => 'format',
                           'title'  => $this->getLang('column'),
                           'icon'   => '../../plugins/wrap/images/toolbar/column.png',
                           'open'   => '<WRAP column 30%>\n',
      diff -ur wrap.org/lang/en/lang.php wrap/lang/en/lang.php
      --- wrap.org/lang/en/lang.php	2011-05-15 18:14:54.000000000 +0800
      +++ wrap/lang/en/lang.php	2012-09-25 15:30:38.312320998 +0800
      @@ -17,3 +17,8 @@
       $lang['em']        = 'especially emphasised';
       $lang['hi']        = 'highlighted';
       $lang['lo']        = 'less significant';
      +
      +$lang['pleft']     = 'left align';
      +$lang['pright']    = 'right align';
      +$lang['pcenter']   = 'center align';
      +$lang['pjustify']  = 'justify';
      diff -ur wrap.org/lang/zh-tw/lang.php wrap/lang/zh-tw/lang.php
      --- wrap.org/lang/zh-tw/lang.php	2011-05-15 18:14:54.000000000 +0800
      +++ wrap/lang/zh-tw/lang.php	2012-09-25 15:31:12.039321265 +0800
      @@ -17,3 +17,8 @@
       $lang['em']        = '特別強調';
       $lang['hi']        = '醒目標記';
       $lang['lo']        = '不重要';
      +
      +$lang['pleft']     = '靠左對齊';
      +$lang['pright']    = '靠右對齊';
      +$lang['pcenter']   = '置中對齊';
      +$lang['pjustify']  = '左右對齊';
w/siteconfig.1357581002.txt.gz · 上一次變更: 2013/01/08 01:50 +0800 由 ichirouuchiki
回到頁頂
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0