<?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>等待喝彩_OnEcho &#187; PHP</title>
	<atom:link href="http://www.onecho.com/category/program/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.onecho.com</link>
	<description>http://www.onecho.com  回声的启示</description>
	<lastBuildDate>Sat, 20 Mar 2010 14:26:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP用ob_start() 方法判断输出结果</title>
		<link>http://www.onecho.com/2009-12-17/567.html</link>
		<comments>http://www.onecho.com/2009-12-17/567.html#comments</comments>
		<pubDate>Thu, 17 Dec 2009 08:35:26 +0000</pubDate>
		<dc:creator>Kenami</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ob_start()]]></category>

		<guid isPermaLink="false">http://www.onecho.com/2009-12-17/567.html</guid>
		<description><![CDATA[今天遇到一个问题，PHP的一个方法返回的是一个打印信息，我在页面调用此方法就不能判断如果它打印空的情况（我想把方法打印空的情况用其他字符串代替）]]></description>
			<content:encoded><![CDATA[<p>今天遇到一个问题，PHP的一个方法返回的是一个打印信息，我在页面调用此方法就不能判断如果它打印空的情况（我想把方法打印空的情况用其他字符串代替）</p>
<p>因为这是一个通用的方法，也不是我写的，所以不能去更改方法本身。当然也不能用 if ( functionName() == NULL) 来判断，因为方法只是来输出一个字符串或者空值。</p>
<p>最后自己用了一个拙劣的方法，用ob_start() 来解决。下面是代码</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
previous_post_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%link'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%title'</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: #000088;">$previous_link</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ob_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ob_end_clean</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
next_post_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%link'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%title'</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: #000088;">$next_link</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ob_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ob_end_clean</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>前一篇<span style="color: #339933;">:&amp;</span>nbsp<span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$previous_link</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">NULL</span> ? <span style="color: #0000ff;">&quot;没有了&quot;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$previous_link</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;br /&gt;后一篇:&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$next_link</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">NULL</span> ? <span style="color: #0000ff;">&quot;没有了&quot;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$next_link</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
?&gt;</pre></td></tr></table></div>

<p>如果有某位大虾更好的方法，请留言告诉我～谢谢！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onecho.com/2009-12-17/567.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP 使用 cURL 函数验证 NTLM</title>
		<link>http://www.onecho.com/2009-11-30/535.html</link>
		<comments>http://www.onecho.com/2009-11-30/535.html#comments</comments>
		<pubDate>Mon, 30 Nov 2009 03:18:50 +0000</pubDate>
		<dc:creator>Kenami</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[curl_setopt]]></category>
		<category><![CDATA[NTML]]></category>

		<guid isPermaLink="false">http://www.onecho.com/2009-11-30/535.html</guid>
		<description><![CDATA[最近同事做了一个手机接口，对方的短信业务接口平台是.net，并使用NTLM登录，因为以前都没有做过此类的接口，所以，我也来帮着找找解决方法。]]></description>
			<content:encoded><![CDATA[<p>最近同事做了一个手机接口，对方的短信业务接口平台是.net，并使用NTLM登录，因为以前都没有做过此类的接口，所以，我也来帮着找找解决方法。<br />
先看看什么是NTLM</p>
<p>NTLM是NT LAN Manager的缩写，这也说明了协议的来源。NTLM 是 Windows NT 早期版本的标准安全协议，Windows 2000 支持 NTLM 是为了保持向后兼容。Windows 2000内置三种基本安全协议之一</p>
<p>用php如何在页面程序里面登录NTLM呢？网上说了要用到cURL，自己在查了一下，获得了以下的方法：<br />
<span id="more-535"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$param</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;bstrMoMessageID=12231707088395410640&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;bstrBusinessCode=4668&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;bstrLongCode=3&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;bstrFeeMsisdn=15800394478&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;bstrDesMsisdn=15800394478&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;bstrMessageContent=你好&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;lTpPid=0&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;lTpUdhi=0&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;lSendDate=20091127&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;lSendTime=122320&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;lExpireDate=20091&quot;</span> <span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&amp;lExpireTime=122320&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$path</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://*****/SmbpHttpAgent/SmbpHttpAgent.asmx/SmbppSendUnicodeMessage&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;4668&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;******&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$action</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://*****.com/SmbpHttpAgent/SmbppSendASCIIMessage&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'Method: POST'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'Connection: Keep-Alive'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'User-Agent: PHP-SOAP-CURL'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'Content-Type: application/x-www-form-urlencoded'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'SOAPAction: &quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$action</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">,</span><span style="color: #666666; font-style: italic;">//对应说明文档的action</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<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: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HTTPHEADER<span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HTTP_VERSION<span style="color: #339933;">,</span> CURL_HTTP_VERSION_1_1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HTTPAUTH<span style="color: #339933;">,</span> CURLAUTH_NTLM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #000088;">$param</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//post 的参数</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_USERPWD<span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':'</span><span style="color: #339933;">.</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$buffer</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>另外附上.net实现NTLM的方法：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
</pre></td><td class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #ff6600;">//向短信业务平台提交数据</span>
<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #990099; font-weight: bold;">int</span> SendDataToWapdm<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #990099; font-weight: bold;">string</span> destURL,<span style="color: #990099; font-weight: bold;">string</span> paramStr<span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #006600; font-weight:bold;">&#123;</span>
	<span style="color: #990099; font-weight: bold;">int</span> Result <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">0</span><span style="color: #006600; font-weight: bold;">;</span>
	WebResponse <span style="color: #990099; font-weight: bold;">response</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">null</span><span style="color: #006600; font-weight: bold;">;</span>
	try 
	<span style="color: #006600; font-weight:bold;">&#123;</span>				
		<span style="color: #ff6600;">//短信业务平台为商户提供的连接ID</span>
		<span style="color: #990099; font-weight: bold;">string</span> username <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;4648&quot;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//短信业务平台为商户提供的连接密码</span>
		<span style="color: #990099; font-weight: bold;">string</span> password <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;******&quot;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//为基于密码的身份验证方案提供凭据</span>
		System.<span style="color: #9900cc;">Net</span>.<span style="color: #9900cc;">NetworkCredential</span> credentials <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> NetworkCredential<span style="color: #006600; font-weight:bold;">&#40;</span>username,password<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>	
		<span style="color: #ff6600;">//提供向 URI 标识的资源发送数据和从 URI 标识的资源接收数据的公共方法</span>
		System.<span style="color: #9900cc;">Net</span>.<span style="color: #9900cc;">WebClient</span> Client <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> System.<span style="color: #9900cc;">Net</span>.<span style="color: #9900cc;">WebClient</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//存储 Internet 资源的凭据</span>
		System.<span style="color: #9900cc;">Net</span>.<span style="color: #9900cc;">CredentialCache</span> myCache <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> System.<span style="color: #9900cc;">Net</span>.<span style="color: #9900cc;">CredentialCache</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//向凭据缓存添加 NetworkCredential 实例</span>
		myCache.<span style="color: #9900cc;">Add</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #0000ff; font-weight: bold;">new</span> Uri<span style="color: #006600; font-weight:bold;">&#40;</span>destURL<span style="color: #006600; font-weight:bold;">&#41;</span>, <span style="color: #cc0000;">&quot;NTLM&quot;</span>, credentials<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
		WebRequest req <span style="color: #006600; font-weight: bold;">=</span> WebRequest.<span style="color: #9900cc;">Create</span><span style="color: #006600; font-weight:bold;">&#40;</span>destURL<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		req.<span style="color: #9900cc;">Credentials</span> <span style="color: #006600; font-weight: bold;">=</span> myCache<span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//使用post方式传递参数</span>
		req.<span style="color: #9900cc;">Method</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;POST&quot;</span><span style="color: #006600; font-weight: bold;">;</span>
		req.<span style="color: #330066;">ContentType</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;application/x-www-form-urlencoded&quot;</span><span style="color: #006600; font-weight: bold;">;</span>
		StringBuilder UrlEncoded <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> StringBuilder<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		Char<span style="color: #006600; font-weight:bold;">&#91;</span><span style="color: #006600; font-weight:bold;">&#93;</span> reserved <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #006600; font-weight:bold;">&#123;</span><span style="color: #008000;">'?', '=', '&amp;'};</span>
		<span style="color: #990099; font-weight: bold;">byte</span><span style="color: #006600; font-weight:bold;">&#91;</span><span style="color: #006600; font-weight:bold;">&#93;</span> SomeBytes <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">null</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//分析传递给短信业务平台的参数并写入到Stream中</span>
		<span style="color: #990099; font-weight: bold;">if</span> <span style="color: #006600; font-weight:bold;">&#40;</span>paramStr <span style="color: #006600; font-weight: bold;">!=</span> <span style="color: #0000ff; font-weight: bold;">null</span><span style="color: #006600; font-weight:bold;">&#41;</span> 
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			<span style="color: #990099; font-weight: bold;">int</span> i<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">0</span>, j<span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #990099; font-weight: bold;">while</span><span style="color: #006600; font-weight:bold;">&#40;</span>i<span style="color: #006600; font-weight: bold;">&lt;</span>paramStr.<span style="color: #9900cc;">Length</span><span style="color: #006600; font-weight:bold;">&#41;</span>
			<span style="color: #006600; font-weight:bold;">&#123;</span>
				j<span style="color: #006600; font-weight: bold;">=</span>paramStr.<span style="color: #9900cc;">IndexOfAny</span><span style="color: #006600; font-weight:bold;">&#40;</span>reserved, i<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #990099; font-weight: bold;">if</span> <span style="color: #006600; font-weight:bold;">&#40;</span>j<span style="color: #006600; font-weight: bold;">==</span>-<span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span>
				<span style="color: #006600; font-weight:bold;">&#123;</span>
					UrlEncoded.<span style="color: #9900cc;">Append</span><span style="color: #006600; font-weight:bold;">&#40;</span>HttpUtility.<span style="color: #9900cc;">UrlEncode</span><span style="color: #006600; font-weight:bold;">&#40;</span>paramStr.<span style="color: #9900cc;">Substring</span><span style="color: #006600; font-weight:bold;">&#40;</span>i, paramStr.<span style="color: #9900cc;">Length</span>-i<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
					break<span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #006600; font-weight:bold;">&#125;</span>
				UrlEncoded.<span style="color: #9900cc;">Append</span><span style="color: #006600; font-weight:bold;">&#40;</span>HttpUtility.<span style="color: #9900cc;">UrlEncodeUnicode</span><span style="color: #006600; font-weight:bold;">&#40;</span>paramStr.<span style="color: #9900cc;">Substring</span><span style="color: #006600; font-weight:bold;">&#40;</span>i, j-i<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span><span style="color: #ff6600;">//这个地方需要UrlEncodeUnicode</span>
				<span style="color: #990099; font-weight: bold;">string</span> s <span style="color: #006600; font-weight: bold;">=</span> UrlEncoded.<span style="color: #9900cc;">ToString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				UrlEncoded.<span style="color: #9900cc;">Append</span><span style="color: #006600; font-weight:bold;">&#40;</span>paramStr.<span style="color: #9900cc;">Substring</span><span style="color: #006600; font-weight:bold;">&#40;</span>j,<span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				i <span style="color: #006600; font-weight: bold;">=</span> j+<span style="color: #800000;">1</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #006600; font-weight:bold;">&#125;</span>
			SomeBytes <span style="color: #006600; font-weight: bold;">=</span> Encoding.<span style="color: #9900cc;">UTF8</span>.<span style="color: #9900cc;">GetBytes</span><span style="color: #006600; font-weight:bold;">&#40;</span>UrlEncoded.<span style="color: #9900cc;">ToString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			req.<span style="color: #9900cc;">ContentLength</span> <span style="color: #006600; font-weight: bold;">=</span> SomeBytes.<span style="color: #9900cc;">Length</span><span style="color: #006600; font-weight: bold;">;</span>
			Stream newStream <span style="color: #006600; font-weight: bold;">=</span> req.<span style="color: #9900cc;">GetRequestStream</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			newStream.<span style="color: #330066;">Write</span><span style="color: #006600; font-weight:bold;">&#40;</span>SomeBytes, <span style="color: #800000;">0</span>, SomeBytes.<span style="color: #9900cc;">Length</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			newStream.<span style="color: #330066;">Close</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span> 
		<span style="color: #990099; font-weight: bold;">else</span> 
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			req.<span style="color: #9900cc;">ContentLength</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">0</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
		<span style="color: #ff6600;">//获取短信业务平台的response</span>
		<span style="color: #990099; font-weight: bold;">response</span> <span style="color: #006600; font-weight: bold;">=</span> req.<span style="color: #9900cc;">GetResponse</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//获取response数据流</span>
		Stream ReceiveStream <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">response</span>.<span style="color: #9900cc;">GetResponseStream</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		Encoding encode <span style="color: #006600; font-weight: bold;">=</span> System.<span style="color: #9900cc;">Text</span>.<span style="color: #9900cc;">Encoding</span>.<span style="color: #9900cc;">GetEncoding</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;utf-8&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		StreamReader sr <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> StreamReader<span style="color: #006600; font-weight:bold;">&#40;</span> ReceiveStream, encode <span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//Console.WriteLine(&quot;\r\n已接收到响应流&quot;);</span>
		Char<span style="color: #006600; font-weight:bold;">&#91;</span><span style="color: #006600; font-weight:bold;">&#93;</span> read <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> Char<span style="color: #006600; font-weight:bold;">&#91;</span><span style="color: #800000;">256</span><span style="color: #006600; font-weight:bold;">&#93;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #990099; font-weight: bold;">int</span> count <span style="color: #006600; font-weight: bold;">=</span> sr.<span style="color: #9900cc;">Read</span><span style="color: #006600; font-weight:bold;">&#40;</span> read, <span style="color: #800000;">0</span>, <span style="color: #800000;">256</span> <span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		StringBuilder buf <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> StringBuilder<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #990099; font-weight: bold;">while</span> <span style="color: #006600; font-weight:bold;">&#40;</span>count <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #800000;">0</span><span style="color: #006600; font-weight:bold;">&#41;</span> 
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			<span style="color: #990099; font-weight: bold;">String</span> str <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> <span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight:bold;">&#40;</span>read, <span style="color: #800000;">0</span>, count<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			buf.<span style="color: #9900cc;">Append</span><span style="color: #006600; font-weight:bold;">&#40;</span>str<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			count <span style="color: #006600; font-weight: bold;">=</span> sr.<span style="color: #9900cc;">Read</span><span style="color: #006600; font-weight:bold;">&#40;</span>read, <span style="color: #800000;">0</span>, <span style="color: #800000;">256</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
		buf.<span style="color: #330066;">Replace</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;\r\n&quot;</span>,<span style="color: #cc0000;">&quot;&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span><span style="color: #ff6600;">//不知道为什么用C#处理的流中含有\r\n（在java中没有这种情况的）</span>
		<span style="color: #ff6600;">//在这个地方调用分析短信业务平台发送消息后的回应的方法</span>
		Result <span style="color: #006600; font-weight: bold;">=</span> this.<span style="color: #9900cc;">parseWAPDMResponse</span><span style="color: #006600; font-weight:bold;">&#40;</span>buf.<span style="color: #9900cc;">ToString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #006600; font-weight:bold;">&#125;</span> 
	catch<span style="color: #006600; font-weight:bold;">&#40;</span>UriFormatException ex<span style="color: #006600; font-weight:bold;">&#41;</span> 
	<span style="color: #006600; font-weight:bold;">&#123;</span>
		Result <span style="color: #006600; font-weight: bold;">=</span> CONNECT_ERROR<span style="color: #006600; font-weight: bold;">;</span>
		Console.<span style="color: #9900cc;">WriteLine</span><span style="color: #006600; font-weight:bold;">&#40;</span> ex.<span style="color: #9900cc;">ToString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #ff6600;">//Page.Response.Write(e.StackTrace);</span>
		<span style="color: #ff6600;">//Page.Response.Write(e.Message);</span>
		Console.<span style="color: #9900cc;">WriteLine</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;\r\n找不到请求 URI，或者它的格式不正确&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
	<span style="color: #006600; font-weight:bold;">&#125;</span> 
	catch<span style="color: #006600; font-weight:bold;">&#40;</span>IOException ex<span style="color: #006600; font-weight:bold;">&#41;</span>
	<span style="color: #006600; font-weight:bold;">&#123;</span>
		Result <span style="color: #006600; font-weight: bold;">=</span> IO_ERROR<span style="color: #006600; font-weight: bold;">;</span>
		Console.<span style="color: #9900cc;">WriteLine</span><span style="color: #006600; font-weight:bold;">&#40;</span>ex.<span style="color: #9900cc;">ToString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
	<span style="color: #006600; font-weight:bold;">&#125;</span>
	finally 
	<span style="color: #006600; font-weight:bold;">&#123;</span>
		<span style="color: #990099; font-weight: bold;">if</span> <span style="color: #006600; font-weight:bold;">&#40;</span> <span style="color: #990099; font-weight: bold;">response</span> <span style="color: #006600; font-weight: bold;">!=</span> <span style="color: #0000ff; font-weight: bold;">null</span> <span style="color: #006600; font-weight:bold;">&#41;</span> 
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			<span style="color: #990099; font-weight: bold;">response</span>.<span style="color: #330066;">Close</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
	<span style="color: #006600; font-weight:bold;">&#125;</span>
	return Result<span style="color: #006600; font-weight: bold;">;</span>
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.onecho.com/2009-11-30/535.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>最近做PHP采集，发几个实用的函数</title>
		<link>http://www.onecho.com/2008-12-04/441.html</link>
		<comments>http://www.onecho.com/2008-12-04/441.html#comments</comments>
		<pubDate>Wed, 03 Dec 2008 16:09:57 +0000</pubDate>
		<dc:creator>Kenami</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[采集]]></category>

		<guid isPermaLink="false">http://www.onecho.com/2008-12-04/441.html</guid>
		<description><![CDATA[最近做PHP采集，发几个实用的函数]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//获得当前的脚本网址</span>
<span style="color: #000000; font-weight: bold;">function</span> get_php_url<span style="color: #009900;">&#40;</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: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REQUEST_URI&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$scriptName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REQUEST_URI&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$nowurl</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$scriptName</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$scriptName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;PHP_SELF&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;QUERY_STRING&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$nowurl</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$scriptName</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> <span style="color: #000088;">$nowurl</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$scriptName</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;?&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;QUERY_STRING&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$nowurl</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;</span>span id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;more-441&quot;</span><span style="color: #339933;">&gt;&lt;/</span>span<span style="color: #339933;">&gt;</span><span style="color: #666666; font-style: italic;">//把全角数字转为半角数字</span>
<span style="color: #000000; font-weight: bold;">function</span> GetAlabNum<span style="color: #009900;">&#40;</span><span style="color: #000088;">$fnum</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$nums</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;０&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;１&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;２&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;３&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;４&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;５&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;６&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;７&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;８&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;９&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fnums</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;0123456789&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span><span style="color: #cc66cc;">9</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$fnum</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nums</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$fnums</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$fnum</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fnum</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ereg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;[^0-9\.]|^0{1,}&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$fnum</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fnum</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$fnum</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$fnum</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//去除HTML标记</span>
<span style="color: #000000; font-weight: bold;">function</span> Text2Html<span style="color: #009900;">&#40;</span><span style="color: #000088;">$txt</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$txt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;  &quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;　&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$txt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$txt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;lt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;amp;lt;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$txt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$txt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;amp;gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$txt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$txt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/[<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>]{1,}/isU&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;lt;br/&amp;gt;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$txt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$txt</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//清除HTML标记</span>
<span style="color: #000000; font-weight: bold;">function</span> ClearHtml<span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;lt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&amp;amp;lt;'</span><span style="color: #339933;">,</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;gt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&amp;amp;gt;'</span><span style="color: #339933;">,</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$str</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//相对路径转化成绝对路径</span>
<span style="color: #000000; font-weight: bold;">function</span> relative_to_absolute<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$feed_url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/(http|https|ftp):\/\//'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$feed_url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$protocol</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$server_url</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/(http|https|ftp|news):\/\//&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$feed_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$server_url</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\/.*/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$server_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$server_url</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$protocol</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$new_content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/href=&quot;\//'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$protocol</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$server_url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$new_content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/src=&quot;\//'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$protocol</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$server_url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$new_content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$new_content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$new_content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//取得所有链接</span>
<span style="color: #000000; font-weight: bold;">function</span> get_all_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/&amp;lt;a\s+href=[&quot;|\']?([^&amp;gt;&quot;\' ]+)[&quot;|\']?\s*[^&amp;gt;]*&amp;gt;([^&amp;gt;]+)&amp;lt;\/a&amp;gt;/i'</span><span style="color: #339933;">,</span><span style="color: #000088;">$code</span><span style="color: #339933;">,</span><span style="color: #000088;">$arr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$arr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'url'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$arr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//获取指定标记中的内容</span>
<span style="color: #000000; font-weight: bold;">function</span> get_tag_data<span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$start</span><span style="color: #339933;">,</span> <span style="color: #000088;">$end</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;">$start</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$end</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$start</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$end</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//HTML表格的每行转为CSV格式数组</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> get_tr_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&amp;lt;td[^&amp;gt;]*?&amp;gt;'si&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;lt;/td&amp;gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&quot;,'</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;lt;/tr&amp;gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;{tr}&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//去掉 HTML 标记</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&amp;lt;[\/\!]*?[^&amp;lt;&amp;gt;]*?&amp;gt;'si&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//去掉空白字符</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'([<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>])[\s]+'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,{tr}&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$table</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//将HTML表格的每行每列转为数组，采集表格数据</span>
<span style="color: #000000; font-weight: bold;">function</span> get_td_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&amp;lt;table[^&amp;gt;]*?&amp;gt;'si&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&amp;lt;tr[^&amp;gt;]*?&amp;gt;'si&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&amp;lt;td[^&amp;gt;]*?&amp;gt;'si&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;lt;/tr&amp;gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;{tr}&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;lt;/td&amp;gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;{td}&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//去掉 HTML 标记</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&amp;lt;[\/\!]*?[^&amp;lt;&amp;gt;]*?&amp;gt;'si&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//去掉空白字符</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'([<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>])[\s]+'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'{tr}'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$table</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$tr</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$td</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'{td}'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$td</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$td_array</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$td</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$td_array</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//返回字符串中的所有单词 $distinct=true 去除重复</span>
<span style="color: #000000; font-weight: bold;">function</span> split_en_str<span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span><span style="color: #000088;">$distinct</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: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/([a-zA-Z]+)/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span><span style="color: #000088;">$match</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$distinct</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: #000088;">$match</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_unique</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$match</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #990000;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$match</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$match</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.onecho.com/2008-12-04/441.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[分享]我实践的一些WordPress高级应用</title>
		<link>http://www.onecho.com/2008-09-12/295.html</link>
		<comments>http://www.onecho.com/2008-09-12/295.html#comments</comments>
		<pubDate>Fri, 12 Sep 2008 07:12:19 +0000</pubDate>
		<dc:creator>Kenami</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WordPress高级应用]]></category>

		<guid isPermaLink="false">http://www.onecho.com/?p=295</guid>
		<description><![CDATA[WordPress是开源的PHP博客模板，其可以免费使用的插件成千上万，如果你想要的功能，没能找到合适的插件，其实简单的修改代码也能给你很多惊喜。

1、.htaccess文件修改，让博客更多彩：
合理的运用.htaccess的URL重写功能可以实现WORDPRESS不同分类页面的不同显示，例如本博客首页第一条显示全文，其他文章显示描述内容，全部文章显示文章标题和标签、分类，等...
]]></description>
			<content:encoded><![CDATA[<p>WordPress是开源的PHP博客模板，其可以免费使用的插件成千上万，如果你想要的功能，没能找到合适的插件，其实简单的修改代码也能给你很多惊喜。</p>
<p>1、.htaccess文件修改，让博客更多彩：<br />
合理的运用.htaccess的URL重写功能可以实现WORDPRESS不同分类页面的不同显示，例如本博客首页第一条显示全文，其他文章显示描述内容，全部文章显示文章标题和标签、分类，等&#8230;<br />
这是如何实现的呢？我们先看.htaccess文件</p>
<pre class="ruby" name="code">RewriteEngine On
#404
ErrorDocument 404 /error_404.html
AddDefaultCharset UTF-8
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]
#/2008-09-03/92.html
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)\.html$ /index.php?action=post [L,NS,QSA]
#category/all
RewriteRule ^category/all$ /index.php?action=all [L,NS,QSA]
RewriteRule ^category/all/page/([a-z0-9\-]+)$ /index.php?action=all [L,NS,QSA]
#map
RewriteRule ^map\.html$ /index.php [L]
#/category/uncategorized
RewriteRule ^category/([\w\-\.]+)$ /index.php [L]
#/category/uncategorized/think
RewriteRule ^category/([\w\-\.]+)/([\w\-\.]+)$ /index.php [L]
#/2008/09
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/?$ /index.php [L]
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/page/([a-z0-9\-]+)$ /index.php [L]
#/2008/09/03
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)$ /index.php [L]
#tag/
RewriteRule ^tag/(.*)$ /index.php [L]
#feed
RewriteRule ^feed$ /index.php [L]
#comments/feed
RewriteRule ^comments/feed$ /index.php [L]
#about
RewriteRule ^about$ /index.php [L]</pre>
<p><span id="more-295"></span><br />
 以上这段RewriteRule ^category/all$ /index.php?action=all [L,NS,QSA]<br />
及如果ur地址是<a href="http://www.onecho.com/category/all">http://www.onecho.com/category/all</a>的话则跳到/index.php?action=all 页面（WORDPRESS几乎所有文章的页面都是index.php处理的），这样我们就得到了action=all的参数，然后修改index.php文件：</p>
<pre class="ruby" name="code">&lt;?
if ($action == "all") {
 $all_index++;
 $color_on = ($all_index % 2) ? "color_off" : "color_on";
?&gt;
&lt;div class="post_all &lt;?=$color_on?&gt;" id="post-&lt;?php the_ID(); ?&gt;"&gt;
&lt;h3&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" &gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;div class="meta"&gt;&lt;?php the_author() ?&gt; 发布于 &lt;?php the_date() ?&gt; &lt;?php the_time() ?&gt; &lt;?php edit_post_link(__('Edit This')); ?&gt; &lt;?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?&gt;&amp;nbsp;&amp;nbsp;阅读：&lt;?php the_views(); ?&gt;&lt;/div&gt;
&lt;p&gt;
 &lt;?php _e("分&amp;nbsp;&amp;nbsp;类："); ?&gt;
 &lt;?php the_category(',') ?&gt;&lt;br /&gt;
 &lt;?php the_tags(__('标&amp;nbsp;&amp;nbsp;签：&amp;nbsp;'), ', ', ''); ?&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;?php
}</pre>
<p>即得到action参数的值，如果等于”all“，我们只显示文章标题和分类、标签等信息。其他的话，我们在现实我们想要的页面。比如只在文章页显示前后页，我们可以这么做：<br />
#/2008-09-03/92.html<br />
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)\.html$ /index.php?action=post [L,NS,QSA]<br />
这时参数action的值为post，我们在php里面这样判断：</p>
<pre class="ruby" name="code">$action = "";
$action = $_GET["action"];
&lt;?php
if ($action == "post") {
?&gt;
&lt;div class="next_link"&gt;
 &lt;table width="100%" bgcolor="#F8F7EF"&gt;
  &lt;tr&gt;
   &lt;td width="10%" align="center"&gt;前一篇: &lt;/td&gt;
   &lt;td&gt;&lt;div style="overflow:hidden;"&gt;&lt;?=!empty($previous_mb) ? $previous_mb : "没有了" ?&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td width="15%" align="center"&gt;后一篇: &lt;/td&gt;
   &lt;td&gt;&lt;div style="overflow:hidden;"&gt;&lt;?=!empty($next_mb) ? $next_mb : "没有了" ?&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
 &lt;/table&gt;
&lt;/div&gt;
&lt;?php
 echo "&lt;ul class=\"post_relate\"&gt;&lt;li id=\"related_posts\" class=\"widget\"&gt;";
 wp_related_posts();
 echo "&lt;/li&gt;&lt;/ul&gt;";
}</pre>
<p> 怎么样，只要你想在不同的页面不同显示，就都可以用修改url重写和php文件实现，这里注意对.htaccess和php不熟悉的朋友不要随便修改。</p>
<p>2、自定义字段的应用：</p>
<p>WordPress拥有一个强大的功能<a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> 可以让你灵活的增加很多额外的信息到你的文章里面. Custom fields由一个名称和一个值组成. KEY是自定义字段的名称和你想要给这个名称指定的值.你可以显示此自定义信息到你的日志，页面或是侧边栏或是网站中的任何地方. WordPress能够记住你使用过的自定义字段，当你下次再使用的时候，只需要从下拉菜单中进行选择即可。<br />
 <code> get_post_meta($post_id, $key, $single);</code>&lt;?php echo get_post_meta($post-&gt;ID, &#8216;key name&#8217;,true) ?&gt;<br />
$post-&gt;ID 用来获取日志 ID, $key是一个String类，包含你想使用的meta值名称, 而$single则是用来判断真还是似，也就是True or False。 如果设置为True，该功能将返回一个单一的结果作为字符串。 如果设为False,或者不设置 , 则返回自定义字段的一个数组.</p>
<p>先说这么多，以后我们继续（还会介绍页面样式的美化）&#8230;&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onecho.com/2008-09-12/295.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>日文邮件，乱码问题</title>
		<link>http://www.onecho.com/2008-09-12/278.html</link>
		<comments>http://www.onecho.com/2008-09-12/278.html#comments</comments>
		<pubDate>Fri, 12 Sep 2008 05:49:46 +0000</pubDate>
		<dc:creator>Kenami</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[日文邮件编码]]></category>

		<guid isPermaLink="false">http://www.onecho.com/?p=278</guid>
		<description><![CDATA[ 刚才通过 MpMailParser()类发邮件，发现标题过长时出现乱码。
其中 mb_encode_mimeheader($envelope->header->headers["subject"], "JIS");
// 注意小绝招：主题和正文都要转，可以实现邮件里日文（其它文也一样，改成相应编码）的正常显示。
经zhoz多次测试：]]></description>
			<content:encoded><![CDATA[<p> 刚才通过 MpMailParser()类发邮件，发现标题过长时出现乱码。<br />
其中 mb_encode_mimeheader($envelope-&gt;header-&gt;headers["subject"], &#8220;JIS&#8221;);<br />
// 注意小绝招：主题和正文都要转，可以实现邮件里日文（其它文也一样，改成相应编码）的正常显示。<br />
经zhoz多次测试：<a name="entrymore"></a><br />
当subject为：あああああああああああああああああああ时，邮件标题会显示成（最后有乱码）：あああああああああああああああああああ(B<br />
ああああああああああああああああああ这个长度正好!<br />
于是乎，查了《PHP 中文手册》<br />
mb_encode_mimeheader<br />
(PHP 4 &gt;= 4.0.6, PHP 5)</p>
<p>mb_encode_mimeheader &#8212; Encode string for MIME header<br />
Description<br />
<strong>string mb_encode_mimeheader ( string str [, string charset [, string transfer_encoding [, string linefeed]]] )</strong></p>
<p><span id="more-278"></span>mb_encode_mimeheader() encodes a given string str by the MIME header encoding scheme. Returns a converted version of the string represented in ASCII.</p>
<p>charset specifies the name of the character set in which str is represented in. The default value is determined by the current NLS setting (mbstring.language).</p>
<p>transfer_encoding specifies the scheme of MIME encoding. It should be either &#8220;B&#8221; (Base64) or &#8220;Q&#8221; (Quoted-Printable). Falls back to &#8220;B&#8221; if not given.</p>
<p>linefeed specifies the EOL (end-of-line) marker with which mb_encode_mime_header() performs line-folding (a RFC term, the act of breaking a line longer than a certain length into multiple lines. The length is currently hard-coded to 74 characters). Falls back to &#8220;\r\n&#8221; (CRLF) if not given.</p>
<p>我K，xxd什么中文手册，这个解释完全是英文嘛！<br />
唉！zhoz也只能译个重点大意：此方法用于解析MIME header中的字段。返回转换过的ASCII编码格式。<br />
默认值NLS setting (mbstring.language)，不详。<br />
指定编码有两种B/Q如果不指定即默认为 &#8220;B&#8221; (Base64) ，指定方法：mb_encode_mimeheader($name, &#8220;UTF-8&#8243;, &#8220;Q&#8221;)<br />
问题关键在于最后这段，指定行尾标记与mb_encode_mime_header ()“执行线”。<br />
意思想表达的是只支持单行标题，也就是<strong>目前长度只支持到74个字符的邮件标题的转换。要是超长了，就给你乱码看（我猜的，事实如此）</strong>。<br />
然后，我直接把它拿下问题解决：<br />
<span style="color: #000000;"><del>headers["subject"] = mb_encode_mimeheader($envelope-&gt;header-&gt;headers["subject"], &#8220;JIS&#8221;);改为：<br />
headers["subject"] = $envelope-&gt;header-&gt;headers["subject"];</del><br />
要根据实现情况来对待，这里只是总结发现与解决问题的方法。</span></p>
<p>注意的是，我这里可以拿下的原因是，前面的内容已经处理：$data = mb_convert_encoding($data, &#8220;JIS&#8221;, &#8220;UTF-8&#8243;);</p>
<p><strong>2008/08/28补记：</strong><br />
刚才得到日本那边高人相助，找个了个完美解决方案，仍然还是用的这个函数：</p>
<pre class="gray">mb_internal_encoding("JIS"); // 设置全局编码
mb_encode_mimeheader($envelope-&gt;header-&gt;headers["subject"], "ISO-2022-JP", "B", ""); </pre>
<p><span><strong>作者：</strong><a href="http://log.zhoz.com/view.php?go=user_1" target="_blank"><strong>zhoz</strong></a><strong>@</strong><a href="http://log.zhoz.com/" target="_blank"><strong>Everyday NetLog</strong></a><br />
<strong>地址：</strong><a href="http://log.zhoz.com/read.php?403" target="_blank"><strong>http://log.zhoz.com/read.php?403</strong></a><br />
<span style="color: #ff0000;"><strong>版权所有。转载时必须以链接形式注明作者和原始出处及本声明！</strong></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.onecho.com/2008-09-12/278.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下，PHP5 的编译安装傻瓜步骤</title>
		<link>http://www.onecho.com/2008-09-11/247.html</link>
		<comments>http://www.onecho.com/2008-09-11/247.html#comments</comments>
		<pubDate>Thu, 11 Sep 2008 02:29:25 +0000</pubDate>
		<dc:creator>Kenami</dc:creator>
				<category><![CDATA[APACHE]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[php安装]]></category>
		<category><![CDATA[php编译]]></category>

		<guid isPermaLink="false">http://www.onecho.com/?p=247</guid>
		<description><![CDATA[很多人在安装php的时候都会遇到很多的问题，但是我想只要按照步骤一步一步的进行，仔细的查看输出结果，应该可以顺利的安装好PHP，也能体会到 linux命令行带来的乐趣，下面我们一起开始安装PHP5吧，后面我还会写一些linux简单的配置和apache的相关文章。]]></description>
			<content:encoded><![CDATA[<p>很多人在安装php的时候都会遇到很多的问题，但是我想只要按照步骤一步一步的进行，仔细的查看输出结果，应该可以顺利的安装好PHP，也能体会到linux命令行带来的乐趣，下面我们一起开始安装PHP5吧，后面我还会写一些linux简单的配置和apache的相关文章。</p>
<p>cd /usr/local/src</p>
<p>wget http://jp.php.net/get/php-5.2.5.tar.gz/from/this/mirror</p>
<p>rpm -qa | grep php<br />
rpm -e php-ldap-4.3.9-3.22.9 php-pear-4.3.9-3.22.9 php-4.3.9-3.22.9</p>
<p>#libcurl<br />
rpm -qa | grep curl<br />
rpm -e curl curl-devel</p>
<p>rpm -e curl-7.12.1-11.el4<br />
<span id="more-247"></span></p>
<p>cd /usr/local/src/<br />
wget http://curl.haxx.se/download/curl-7.16.4.tar.gz<br />
tar xvzf curl-7.16.4.tar.gz<br />
cd curl-7.16.4<br />
./configure<br />
make<br />
make test<br />
make install</p>
<p>yum install zlib-devel</p>
<p>#libpng<br />
#   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
cd /usr/local/src/<br />
wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.19.tar.gz<br />
tar xvzf libpng-1.2.19.tar.gz<br />
cd libpng-1.2.19<br />
./configure<br />
cp scripts/makefile.linux ./makefile<br />
make<br />
make install<br />
#   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>#libjpeg<br />
#   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
cd /usr/local/src/<br />
wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz<br />
tar xvzf jpegsrc.v6b.tar.gz<br />
cd jpeg-6b/<br />
./configure &#8211;enable-shared<br />
mkdir /usr/local/man/man1/<br />
make<br />
make install<br />
#   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>#libgd<br />
#   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
cd /usr/local/src/<br />
wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz<br />
tar xvzf gd-2.0.33.tar.gz<br />
cd gd-2.0.33<br />
./configure<br />
make<br />
make install<br />
#   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>##</p>
<p># FreeType<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
#<br />
#   ・fontconfig-devel-2.2.3-7.i386.rpm<br />
#   ・freetype-devel-2.1.9-4.el4.i386.rpm<br />
#   xorg-x11-devel-6.8.2-1.EL.13.37.i386.rpm<br />
yum install xorg-x11-devel<br />
yum install xorg-x11</p>
<p>ln -s /usr/X11R6/lib/libX11.a /usr/lib</p>
<p>cd /usr/local/src/<br />
wget http://jaist.dl.sourceforge.net/sourceforge/freetype/freetype-1.3.1.tar.gz<br />
tar xvzf freetype-1.3.1.tar.gz<br />
cd freetype-1.3.1/test/</p>
<p>vi ftdump-newer-GCC.patch<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8212; ftdump.c.original    2004-12-21 06:26:50.000000000 -0500<br />
+++ ftdump.c                    2004-12-21 06:57:27.000000000 -0500<br />
@@ -140,8 +140,14 @@<br />
old_memory += *var;<br />
}</p>
<p>-#define FOOTPRINT( field )  Save_Memory( &amp;memory_footprint.##field )<br />
-<br />
+#define FT_initial_overhead  memory_footprint.initial_overhead<br />
+#define FT_face_object       memory_footprint.face_object<br />
+#define FT_glyph_object      memory_footprint.glyph_object<br />
+#define FT_first_instance    memory_footprint.first_instance<br />
+#define FT_second_instance   memory_footprint.second_instance<br />
+<br />
+#define FOOTPRINT( field )  Save_Memory( &amp;FT_ ## field )<br />
+</p>
<p>static void<br />
Print_Mem( long  val, char*  string )<br />
@@ -152,10 +158,8 @@<br />
string );<br />
}</p>
<p>-#define PRINT_MEM( field, string ) \<br />
-          Print_Mem( memory_footprint.##field, string )<br />
-<br />
-<br />
+ #define PRINT_MEM( field, string )  Print_Mem( FT_ ## field, string )<br />
+<br />
/* Print the memory footprint */</p>
<p>void<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
patch &lt; ftdump-newer-GCC.patch<br />
#   http://www.linuxquestions.org/questions/showthread.php?t=174031</p>
<p>cd /usr/local/src/freetype-1.3.1<br />
./configure<br />
make<br />
make install</p>
<p>cd /usr/local/src/<br />
wget http://jaist.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.5.tar.gz<br />
tar xvzf freetype-2.3.5.tar.gz<br />
cd freetype-2.3.5<br />
./configure<br />
make<br />
make install<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>## libxml2<br />
cd /usr/local/src/</p>
<p>wget http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.30.tar.gz</p>
<p>tar zxvf libxml2-2.6.30.tar.gz</p>
<p>cd libxml2-2.6.30<br />
./configure<br />
date<br />
#Tue Nov 27 10:25:03 JST 2007</p>
<p>make &amp;&amp; date<br />
#&#8230;<br />
#&#8230;<br />
#Tue Nov 27 10:25:03 JST 2007</p>
<p>make install<br />
ln -s /usr/local/include/libxml2/libxml /usr/local/include/libxml<br />
yum install mysql-devel</p>
<p>### php<br />
cd /usr/local/src/</p>
<p>tar zxvf php-5.2.5.tar.gz<br />
cd php-5.2.5</p>
<p># check path<br />
ls -l /usr/local/apache2/bin/apxs<br />
sleep 5<br />
$ rm configure<br />
$ ./buildconf &#8211;force</p>
<p>./configure &#8211;with-apxs2=/usr/local/apache2/bin/apxs \<br />
&#8211;includedir=/usr/local/include \<br />
&#8211;enable-force-cgi-redirect \<br />
&#8211;enable-mbstring \<br />
&#8211;enable-mbregex \<br />
&#8211;enable-shmop \<br />
&#8211;enable-exif \<br />
&#8211;with-gd=/usr/local/ \<br />
&#8211;with-jpeg-dir=/usr/local/lib/ \<br />
&#8211;with-png-dir=/usr/local/lib/ \<br />
&#8211;with-zlib-dir=/usr/ \<br />
&#8211;with-ttf \<br />
&#8211;with-freetype-dir=/usr/local/lib \<br />
&#8211;enable-gd-native-ttf \<br />
&#8211;enable-gd-jis-conv \<br />
&#8211;with-mysql=/usr/include/mysql/ \<br />
&#8211;enable-sockets \<br />
&#8211;enable-ftp \<br />
&#8211;with-curl=/usr/local/ \<br />
&#8211;with-xmlrpc \<br />
&#8211;enable-mailparse \<br />
&#8211;with-foobar<br />
make<br />
make test<br />
make install</p>
<p>vi httpd.conf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
AddType application/x-httpd-php        .php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>## php.ini-recommended<br />
vi /usr/local/lib/php.ini<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
short_open_tag = On</p>
<p>display_errors = On</p>
<p>post_max_size = 64M</p>
<p>upload_max_filesize = 50M</p>
<p>mbstring.language = Japanese<br />
mbstring.internal_encoding = UTF-8</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>pear channel-update pear.php.net</p>
<p>pear install Net_SMTP<br />
pear install Auth_SASL<br />
pear install Mail</p>
<p>pear install XML_Parser<br />
pear install XML_RPC</p>
<p>pear list<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Package          Version State<br />
Archive_Tar      1.3.2   stable<br />
Auth_SASL        1.0.2   stable<br />
Console_Getopt   1.2.3   stable<br />
Mail             1.1.14  stable<br />
Net_SMTP         1.2.10  stable<br />
Net_Socket       1.0.8   stable<br />
PEAR             1.6.1   stable<br />
Structures_Graph 1.0.2   stable<br />
XML_Parser       1.2.8   stable<br />
XML_RPC          1.5.1   stable<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onecho.com/2008-09-11/247.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
