<?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; Wiki</title>
	<atom:link href="http://blog.upsuper.org/tag/wiki/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.upsuper.org</link>
	<description>the place where there are some ghost appearing...</description>
	<lastBuildDate>Wed, 19 Oct 2011 13:21:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>创建个个人Wiki</title>
		<link>http://blog.upsuper.org/create-a-personal-wiki/</link>
		<comments>http://blog.upsuper.org/create-a-personal-wiki/#comments</comments>
		<pubDate>Sat, 03 May 2008 07:27:58 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[高亮]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=85</guid>
		<description><![CDATA[其实是昨天晚上就传上去了，没时间说罢了。昨晚把Wiki的首页做好了，顺便修整了一下相关的URL Rewrite。另外还研究了一下双站公用的GeSHi代码高亮系统。 我的Wordpress安装了一个WP-Codebox插件使用了GeSHi，而我用的Wiki系统——DokuWiki也有带GeSHi，又因为我对一些代码高亮有特别的要求，所以就把我上次改造过得GeSHi放到一个比较公共的目录里面，然后让两个全部指过去。 在WP-Codebox中只要修改wp-codebox.php： 28 include_once&#40;ABSPATH.&#34;./../include/geshi/geshi.php&#34;&#41;; #include_once(&#34;geshi/geshi.php&#34;); 而DokuWiki里面则要修改3处，都在inc/parserutils.php里： 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 if &#40;@file_exists&#40;$cache&#41; &#38;&#38; !$_REQUEST&#91;'purge'&#93; &#38;&#38; &#40;filemtime&#40;$cache&#41; &#62; filemtime&#40;DOKU_INC . './../include/geshi/geshi.php'&#41;&#41;&#41; &#123; &#160; $highlighted_code = io_readFile&#40;$cache, false&#41;; @touch&#40;$cache&#41;; &#160; &#125; else &#123; &#160; require_once&#40;DOKU_INC . './../include/geshi/geshi.php'&#41;; &#160; $geshi = new GeSHi&#40;$code, strtolower&#40;$language&#41;, DOKU_INC [...]]]></description>
			<content:encoded><![CDATA[<p>其实是昨天晚上就传上去了，没时间说罢了。昨晚把Wiki的<a href="http://wiki.upsuper.org/首页">首页</a>做好了，顺便修整了一下相关的URL Rewrite。另外还研究了一下双站公用的GeSHi代码高亮系统。</p>
<p>我的Wordpress安装了一个WP-Codebox插件使用了GeSHi，而我用的Wiki系统——DokuWiki也有带GeSHi，又因为我对一些代码高亮有特别的要求，所以就把我上次改造过得GeSHi放到一个比较公共的目录里面，然后让两个全部指过去。<br />
<span id="more-85"></span><br />
在WP-Codebox中只要修改wp-codebox.php：</p>

<div class="wp_codebox"><table><tr id="p853"><td class="line_numbers"><pre>28
</pre></td><td class="code" id="p85code3"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span>ABSPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;./../include/geshi/geshi.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#include_once(&quot;geshi/geshi.php&quot;);</span></pre></td></tr></table></div>

<p>而DokuWiki里面则要修改3处，都在inc/parserutils.php里：</p>

<div class="wp_codebox"><table><tr id="p854"><td class="line_numbers"><pre>642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
</pre></td><td class="code" id="p85code4"><pre class="php" style="font-family:monospace;">  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'purge'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span>
     <span style="color: #009900;">&#40;</span><span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span>DOKU_INC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'./../include/geshi/geshi.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000088;">$highlighted_code</span> <span style="color: #339933;">=</span> io_readFile<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #339933;">@</span><span style="color: #990000;">touch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span>DOKU_INC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'./../include/geshi/geshi.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$geshi</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GeSHi<span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$language</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> DOKU_INC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'./../include/geshi/geshi.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_encoding</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'utf-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enable_classes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_header_type</span><span style="color: #009900;">&#40;</span>GESHI_HEADER_PRE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_link_target</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$conf</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'target'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'extern'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>于是就把两个归拢了，这样以后只要改一个GeSHi就可以了。改天把GeSHi加一点功能，支持一下VS2005.NET对于C#的高亮语法，呵呵~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/create-a-personal-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

