<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>勿慢牛 &#187; dokuwiki</title>
	<atom:link href="http://klniu.com/post/tag/dokuwiki/feed/" rel="self" type="application/rss+xml" />
	<link>http://klniu.com</link>
	<description>『勿慢牛个人博客』</description>
	<lastBuildDate>Fri, 06 Jan 2012 06:42:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>dokuwiki中文文件名编码转换</title>
		<link>http://klniu.com/post/dokuwiki-chinese-filename-encoding-conversion/</link>
		<comments>http://klniu.com/post/dokuwiki-chinese-filename-encoding-conversion/#comments</comments>
		<pubDate>Sun, 30 May 2010 10:36:43 +0000</pubDate>
		<dc:creator>勿慢牛</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[ascii2uni]]></category>
		<category><![CDATA[dokuwiki]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://klniu.com/?p=541</guid>
		<description><![CDATA[默认情况下，dokuwiki需要把中文文件进行编码后存储，便会在data文件夹下存在好多形如%ED%类的文件名，不利用管理和SEO，如果你想改变这些，首先要更改dokuwiki对中文文件的存储方式，然后将以前的文件编码重新转换为正常的中文文件名。 第一步可参考上一篇文章http://klniu.com/post/dokuwiki-chinese-file-name-and-address-sitemap-garbled/更改。 而第二步就需要批量处理了，此方法适用于linux系统。我使用的是ubuntu，请大家参考执行： 安装uni2ascii工具： sudo apt-get install uni2ascii 编写脚本： #!/bin/sh times=5 itimes=0 while [ "$itimes" -lt "$times" ] do for oldfile in `find $1 -name "*"` do newfile=`echo $oldfile&#124;ascii2uni -aJ -q` mv -n -v "$oldfile" "$newfile" done itimes=$(($itimes+1)) done 脚本的原理是，遍历目录并转换文件名，然后再将乱码的文件重命名为转换后的文件名。 &#8230; <a href="http://klniu.com/post/dokuwiki-chinese-filename-encoding-conversion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>默认情况下，dokuwiki需要把中文文件进行编码后存储，便会在data文件夹下存在好多形如%ED%类的文件名，不利用管理和SEO，如果你想改变这些，首先要更改dokuwiki对中文文件的存储方式，然后将以前的文件编码重新转换为正常的中文文件名。</p>
<p>第一步可参考上一篇文章<a href="http://klniu.com/post/dokuwiki-chinese-file-name-and-address-sitemap-garbled/">http://klniu.com/post/dokuwiki-chinese-file-name-and-address-sitemap-garbled/</a>更改。</p>
<p>而第二步就需要批量处理了，此方法适用于linux系统。我使用的是ubuntu，请大家参考执行：</p>
<p>安装uni2ascii工具：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> uni2ascii</pre></div></div>

<p>编写脚本：</p>
<pre class="brush: bash">#!/bin/sh
 times=5
 itimes=0
 while [ "$itimes" -lt "$times" ]
 do
 for oldfile in `find $1 -name "*"`
 do
 newfile=`echo $oldfile|ascii2uni -aJ -q`
 mv -n -v "$oldfile" "$newfile"
 done
 itimes=$(($itimes+1))
 done</pre>
<p>脚本的原理是，遍历目录并转换文件名，然后再将乱码的文件重命名为转换后的文件名。</p>
<p>因为我shell学得不好，所以有一个问题没有解决&#8211;在脚本执行过程中，如果目录已经被更改，脚本继续执行的时候被更改过名字的目录下的文件会无法定位，所以此脚本需要多执行几次，具体次数要视最大目录层数决定，脚本默认5次，如果你目录较多，可以更改times=数字，来决定脚本执行次数。这是一个小问题，脚本并不会损坏文件，只是多执行几次，请放心使用。</p>
<p>脚本编写完成后，执行:</p>
<pre class="brush: bash">sh 脚本名字 被执行的目录   #例如 sh asciiconv.sh /home/username/dokuwiki/data</pre>
]]></content:encoded>
			<wfw:commentRss>http://klniu.com/post/dokuwiki-chinese-filename-encoding-conversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>dokuwiki中文文件名及sitemap乱码的解决</title>
		<link>http://klniu.com/post/dokuwiki-chinese-file-name-and-address-sitemap-garbled/</link>
		<comments>http://klniu.com/post/dokuwiki-chinese-file-name-and-address-sitemap-garbled/#comments</comments>
		<pubDate>Sun, 30 May 2010 07:52:06 +0000</pubDate>
		<dc:creator>勿慢牛</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[dokuwiki]]></category>
		<category><![CDATA[sitemap]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://klniu.com/?p=539</guid>
		<description><![CDATA[dokuwiki默认是使用urlencode函数对文件名进行编码后存储的，而索引文章的indexer.php文件在生成sitemap.xml时也会对文件名编码，这样对搜索引擎是不友好的，实际上将这两个编码的功能去掉就可以了。 中文文件名的乱码可以参考http://www.dokuwiki.org/zh:pagename进行更改，即: function utf8_encodeFN&#40;$file, $safe = true&#41; &#123; if &#40;$safe &#38;&#38; preg_match&#40;'#^[a-zA-Z0-9/_\-.%]+$#', $file&#41;&#41; &#123; return $file; &#125; /* 把这个部分注释掉 $file = urlencode($file); $file = str_replace('%2F','/',$file); */ return $file; &#125; &#125; if &#40;!function_exists&#40;'utf8_decodeFN'&#41;&#41; &#123; /** * URL-Decode a filename * * &#8230; <a href="http://klniu.com/post/dokuwiki-chinese-file-name-and-address-sitemap-garbled/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>dokuwiki默认是使用urlencode函数对文件名进行编码后存储的，而索引文章的indexer.php文件在生成sitemap.xml时也会对文件名编码，这样对搜索引擎是不友好的，实际上将这两个编码的功能去掉就可以了。</p>
<p>中文文件名的乱码可以参考<a href="http://www.dokuwiki.org/zh:pagename">http://www.dokuwiki.org/zh:pagename</a>进行更改，即:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> utf8_encodeFN<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$safe</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$safe</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#^[a-zA-Z0-9/_\-.%]+$#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$file</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #666666; font-style: italic;">/* 把这个部分注释掉
     $file = urlencode($file);
     $file = str_replace('%2F','/',$file);
   */</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$file</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'utf8_decodeFN'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #009933; font-style: italic;">/**
   * URL-Decode a filename
   *
   * This is just a wrapper around urldecode
   *
   * @author Andreas Gohr &lt;andi@splitbrain.org&gt;
   * @see urldecode
   */</span>
  <span style="color: #000000; font-weight: bold;">function</span> utf8_decodeFN<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//$file = urldecode($file); //再注释掉这个语句...</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$file</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>而生成sitemap.xml文件的是&quot;/lib/exe/indexer.php&quot;文件，打开这个文件，搜索runSitemapper()函数，在函数下有此语句：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">print</span> <span style="color: #0000ff;">'    &lt;loc&gt;'</span><span style="color: #339933;">.</span>wl<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/loc&gt;'</span><span style="color: #339933;">.</span>NL<span style="color: #339933;">;</span></pre></div></div>

<p>其中wl函数为重写url的，在wl函数的定义在&quot;/inc/common.php&quot;文件内，其中有一语句：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$id</span>    <span style="color: #339933;">=</span> idfilter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>idfilter即是进行编码转换的，只需要在common.php中去掉那一行即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://klniu.com/post/dokuwiki-chinese-file-name-and-address-sitemap-garbled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>启用知识管理dokuwiki</title>
		<link>http://klniu.com/post/enable-knowledge-management-dokuwiki/</link>
		<comments>http://klniu.com/post/enable-knowledge-management-dokuwiki/#comments</comments>
		<pubDate>Fri, 21 May 2010 12:11:56 +0000</pubDate>
		<dc:creator>勿慢牛</dc:creator>
				<category><![CDATA[原创]]></category>
		<category><![CDATA[dokuwiki]]></category>
		<category><![CDATA[wiki]]></category>
		<category><![CDATA[知识管理]]></category>

		<guid isPermaLink="false">http://klniu.com/?p=536</guid>
		<description><![CDATA[收集-阅读-加工-输出知识是一个很有意思和实用的过程，在这个过程中我用过很多知识管理软件。 最早用的是onenote，功能确实强大，不过有点大，携带不方便，平台依赖性太强。 后来有一段时间用Gmail+Folders4Gmail脚本+Gmail过滤器功能，用了好长时间，搜索强，携带也方便，唯一不适合的地方就是发出的邮件是不能编辑的，如果需要修改，则必须重新发送，比较麻烦。 然后在善用佳软看到了pkmanager2，就用了一段时间，绿色，强大。再后来就是wizknowledge，新出的知识管理软件，设计挺不错，发展应该很有前途，不过上面两个也都有跨平台和携带的问题。 以上的方法和软件都是很不错的，但本人因为经常需要转换地方，希望能一个便携、搜索强大、可编辑性强、跨平台、规范的知识管理程序，最后找到了wiki，应该是能够满足我的需求，而常用的mediawiki太大，对个人来说有点大材小用，而且有些东西是不能公开的，就需要一个权限控制能力强的的wiki了,最后就选中dokuwiki了，使用了七八天了，感觉挺不错，资料随处带，挺好。 dokuwiki的官网是http://www.dokuwiki.org/，是一个不用数据库的wiki程序，插件挺多也很实用，可自定义主题，最有用的indexmenu插件可以在侧边栏放上目录，方便查找。支持标题和全文搜索，对中文支持也很友好。ACL可以设置不同命名空间(类似分类的文件夹)和页面不同用户的权限，非常适合多人协作。 本站的新知识管理地址：http://wiki.klniu.com/]]></description>
			<content:encoded><![CDATA[<p>收集-阅读-加工-输出知识是一个很有意思和实用的过程，在这个过程中我用过很多知识管理软件。</p>
<p>最早用的是onenote，功能确实强大，不过有点大，携带不方便，平台依赖性太强。</p>
<p>后来有一段时间用Gmail+<a href="http://userscripts.org/scripts/source/8810.user.js">Folders4Gmail</a>脚本+Gmail过滤器功能，用了好长时间，搜索强，携带也方便，唯一不适合的地方就是发出的邮件是不能编辑的，如果需要修改，则必须重新发送，比较麻烦。</p>
<p>然后在<a href="http://xbeta.info" target="_blank">善用佳软</a>看到了pkmanager2，就用了一段时间，绿色，强大。再后来就是wizknowledge，新出的知识管理软件，设计挺不错，发展应该很有前途，不过上面两个也都有跨平台和携带的问题。</p>
<p>以上的方法和软件都是很不错的，但本人因为经常需要转换地方，希望能一个便携、搜索强大、可编辑性强、跨平台、规范的知识管理程序，最后找到了wiki，应该是能够满足我的需求，而常用的mediawiki太大，对个人来说有点大材小用，而且有些东西是不能公开的，就需要一个权限控制能力强的的wiki了,最后就选中dokuwiki了，使用了七八天了，感觉挺不错，资料随处带，挺好。</p>
<p>dokuwiki的官网是<a href="http://www.dokuwiki.org/dokuwiki">http://www.dokuwiki.org/</a>，是一个不用数据库的wiki程序，插件挺多也很实用，可自定义主题，最有用的indexmenu插件可以在侧边栏放上目录，方便查找。支持标题和全文搜索，对中文支持也很友好。ACL可以设置不同命名空间(类似分类的文件夹)和页面不同用户的权限，非常适合多人协作。</p>
<p>本站的新知识管理地址：<a href="http://wiki.klniu.com/">http://wiki.klniu.com/</a></p>
<p><meta content="text/html; charset=utf-8" http-equiv="content-type" /><br />
<meta content="text/html; charset=utf-8" http-equiv="content-type" /><br />
<meta content="text/html; charset=utf-8" http-equiv="content-type" /><br />
<meta content="text/html; charset=utf-8" http-equiv="content-type" /></p>
]]></content:encoded>
			<wfw:commentRss>http://klniu.com/post/enable-knowledge-management-dokuwiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

