<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.philna.com/styles/feedsky1.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/PhilNa" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/PhilNa" type="application/rss+xml"></fs:self_link><lastBuildDate>Wed, 20 Jan 2010 15:17:42 GMT</lastBuildDate><title>PhilNa</title><description>找寻那些幸福...</description><image><url>http://www.feedsky.com/feed/PhilNa/sc/gif</url><title>PhilNa</title><link>http://philna.com</link></image><link>http://philna.com</link><atom:link rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/philna"></atom:link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><atom:link rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/philna"></atom:link><feedburner:info uri="philna"></feedburner:info><atom:link rel="hub" href="http://pubsubhubbub.appspot.com/"></atom:link><media:copyright>Copyright (C)  yinheli  All rights reserved.</media:copyright><media:thumbnail url="http://code.google.com/p/philna/logo?logo_id=1239465881"></media:thumbnail><media:keywords>yinheli,尹和礼,Wordpress,Theme,philna,philna2,web2,0,javascript,Ajax,jQuery,YUI,Google,中医,中医学</media:keywords><itunes:author>yinheli</itunes:author><itunes:explicit>no</itunes:explicit><itunes:keywords>yinheli,尹和礼,Wordpress,Theme,philna,philna2,web2,0,javascript,Ajax,jQuery,YUI,Google,中医,中医学</itunes:keywords><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license><xhtml:meta name="robots" content="noindex"></xhtml:meta><feedburner:emailServiceId>philna</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/philna" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2Fphilna" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:browserFriendly>PhilNa 是尹和礼的个人言论平台,关注 web,wordpress,中医等. PhilNa is yinheli's personal blog which focus on web, wordpress,traditional medicine and so on.</feedburner:browserFriendly><media:credit role="author">yinheli</media:credit><media:rating>nonadult</media:rating><language>en</language><copyright>Copyright (C)  yinheli  All rights reserved.</copyright><pubDate>Wed, 20 Jan 2010 15:17:42 GMT</pubDate><item><title>数组重载在 WordPress 主题或插件设置中的应用</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807687/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807687/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807687/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;现在大部分的 WordPress 主题和插件都有后台设置页面, 为主题或插件添加自定义的一些功能. 这些设置会将被保存到数据库中. 然后在主题或插件中使用它们. 通常人们都是用 global 这样的关键字将他们的设置声明为一个全局变量. 或者在各个页面上都使用 get_options 这样的函数去取得设置. 然而我觉得那样处理并不好. 这里我写了个自认为较好的办法. 欢迎大家批评指正.&lt;/p&gt;
&lt;p&gt;该方法用到了数组重载. 数组重载是将对象作为数组使用的一个过程. 为了实现这个你需要用到 ArrayAccess 接口.&lt;/p&gt;
&lt;p&gt;&lt;span id=&quot;more-220&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;以下是 ArrayAccess 接口代码清单:&lt;/h3&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;interface&lt;/span&gt; ArrayAccess  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * @param offset 确定给定偏移量是否存在于数组中
	 */&lt;/span&gt;
	abstract &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; offsetExists &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$offset&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * @param offset 取得给定偏移量上的数据
	 */&lt;/span&gt;
	abstract &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; offsetGet &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$offset&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * @param offset 设置或替换给定偏移量上的数据
	 * @param value 要设置或替换的数据
	 */&lt;/span&gt;
	abstract &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; offsetSet &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$offset&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * @param offset 置空给定偏移量上的数据
	 */&lt;/span&gt;
	abstract &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; offsetUnset &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$offset&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;具体的实现办法如如下代码所示: 在这个类中我们用到了单件(例)模式.&lt;/h3&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #009933;&quot;&gt;/**
 * Get options
 *
 * @author yinheli
 *
 */&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; PhilNaGetOpt implements ArrayAccess &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 所有设置
	 *
	 * @var array
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$philnaOpt&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 获取设置对象
	 *
	 * @var PhilNaGetOpt
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #990000;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$_instance&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 从数据库中取得设置
	 *
	 * @return null
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; __construct&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$r&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; get_option&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'philnaopt'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$r&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #990000;&quot;&gt;unset&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$r&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 不许克隆
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; __clone&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 获取 PhilNaGetOpt 单一实例
	 *
	 * @return PhilNaGetOpt
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #990000;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getInstance&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$_instance&lt;/span&gt; instanceof &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$_instance&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$_instance&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 重新取得设置
	 *
	 * @return null
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; reGet&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;__construct&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 给定的偏移量是否存在?
	 *
	 * @return bool
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; offsetExists&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array_key_exists&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 返回给定偏移量上的数据
	 *
	 * @return null|mix
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; offsetGet&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array_key_exists&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;is_string&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
				&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #990000;&quot;&gt;stripslashes&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
				&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 设置给定偏移量上的数据
	 *
	 * @return bool|mix
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; offsetSet&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$val&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array_key_exists&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$val&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$val&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009933;&quot;&gt;/**
	 * 置空给定偏移量上的数据
	 *
	 * @return bool
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; offsetUnset&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array_key_exists&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #990000;&quot;&gt;unset&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;philnaOpt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;接下来我们我们只需要在代码的最开始时实例化刚刚的那个读取设置的类. 并将它存储到全局数组里. 例如在主题中. 我们可以在 functions.php 文件中首先做这样的事情.&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$GLOBALS&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'philnaopt'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; PhilNaGetOpt&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;getInstance&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;然后我们就不用理会其他的情况, 只需要在你需要的地方调用那个设置对象. 就像是使用数组一样. 而不用不考虑它是否存在着你需要的那个键值. 很多情况下它简化了我们的一些条件判断.&lt;/p&gt;
&lt;h3&gt;比如我们要判断是否需要显示首页通知&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;一般情况下.&lt;/strong&gt; 我们的判断是:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;// 取得设置&lt;/span&gt;
&lt;span style=&quot;color: #000088;&quot;&gt;$opt&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; get_option&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'philnaopt'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666;&quot;&gt;// 判断是否有通知要显示&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;isset&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$opt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'notice'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$opt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'notice'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;isset&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$opt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'notice_content'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$opt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'notice_content'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #990000;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$opt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'notice_content'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;而是用&lt;strong&gt;新的办法后&lt;/strong&gt;是这样的:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
2
3
4
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;// 判断并显示通知&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$GLOBALS&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'philnaopt'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'notice'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$GLOBALS&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'philnaopt'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'notice_content'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #990000;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$GLOBALS&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'philnaopt'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'notice_content'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;说明:&lt;/em&gt;&lt;br /&gt;
当然在很多人的代码中我经常看不到 isset() 这样的函数. 事实上, 如果在开启报告全部错误的情况下. 我们在判断一个数组中的值. 我们首先要判断是否存在相应的键值. 否则 PHP 会产生一个 NOTICE 级别的错误. 加isset()这样的判断在我看来是一种比较规范的写法.&lt;/p&gt;
&lt;p&gt;使用数组重载来调用设置有一个最大好处是简化判断. 当然更主要的是它规范了代码, 避免了使用 global 这样不优雅的代码.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;注意:&lt;/strong&gt; 这个 PHP 特性只能使用在 PHP 版本 5.1.0 及其以上. 如果你使用古老的版本. 那只能作罢了.&lt;/p&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/enthusiastic-commentator/&quot; title=&quot;评论添加:热情评论员&quot; rel=&quot;bookmark inlinks&quot;&gt;评论添加:热情评论员&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 22 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/jquery-ajax-comment-pager/&quot; title=&quot;jQuery版ajax comment pager&quot; rel=&quot;bookmark inlinks&quot;&gt;jQuery版ajax comment pager&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 18 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/08/philna2-version-2-released/&quot; title=&quot;PhilNa2 version 2 released&quot; rel=&quot;bookmark inlinks&quot;&gt;PhilNa2 version 2 released&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 45 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/wordpress-theme-philna/&quot; title=&quot;主题:PhilNa&quot; rel=&quot;bookmark inlinks&quot;&gt;主题:PhilNa&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 33 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/wordpress-custom-field/&quot; title=&quot;Wordpress custom field之header应用&quot; rel=&quot;bookmark inlinks&quot;&gt;Wordpress custom field之header应用&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 24 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/comment-sms-alert-2/&quot; title=&quot;评论短信提醒 (补充)&quot; rel=&quot;bookmark inlinks&quot;&gt;评论短信提醒 (补充)&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 31 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/enable-threaded/&quot; title=&quot;嵌套回复否?&quot; rel=&quot;bookmark inlinks&quot;&gt;嵌套回复否?&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 13 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/wordpress-update-to-265/&quot; title=&quot;Wordpress更新至2.6.5&quot; rel=&quot;bookmark inlinks&quot;&gt;Wordpress更新至2.6.5&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 11 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/8DF2AW52EKt1GNBQbixOuLjlMmg/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/8DF2AW52EKt1GNBQbixOuLjlMmg/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/8DF2AW52EKt1GNBQbixOuLjlMmg/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/8DF2AW52EKt1GNBQbixOuLjlMmg/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=4ApT2yThUZw:aLdQgZCSARU:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=4ApT2yThUZw:aLdQgZCSARU:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=4ApT2yThUZw:aLdQgZCSARU:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=4ApT2yThUZw:aLdQgZCSARU:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/4ApT2yThUZw&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807687/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807687/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2010/01/use-array-overloading-in-the-wordpress-theme-or-plug-in-settings/feed/</wfw:commentRss><slash:comments>31</slash:comments><feedburner:origLink>http://philna.com/2010/01/use-array-overloading-in-the-wordpress-theme-or-plug-in-settings/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807687/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807687/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;现在大部分的 WordPress 主题和插件都有后台设置页面, 为主题或插件添加自定义的一些功能. 这些设置会将被保存到数据库中. 然后在主题或插件中使用它们. 通常人们都是用 global 这样的关键字将他们的设置声明为一个全局变量. 或者在各个页面上都使用 get_options 这样的函数去取得设置. 然而我觉得那样处理并不好. 这里我写了个自认为较好的办法. 欢迎大家批评指正.
该方法用到了数组重载. 数组重载是将对象作为数组使用的一个过程. 为了实现这个你需要用到 ArrayAccess 接口.

以下是 ArrayAccess 接口代码清单:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
interface ArrayAccess  &amp;#123;
&amp;#160;
	/**
	 * @param offset 确定给定偏移量是否存在于数组中
	 */
	abstract public function offsetExists &amp;#40;$offset&amp;#41; &amp;#123;&amp;#125;
&amp;#160;
	/**
	 * @param offset 取得给定偏移量上的数据
	 */
	abstract public function offsetGet &amp;#40;$offset&amp;#41; &amp;#123;&amp;#125;
&amp;#160;
	/**
	 * @param offset 设置或替换给定偏移量上的数据
	 * @param value 要设置或替换的数据
	 */
	abstract public function [...]&lt;img src=&quot;http://www1.feedsky.com/t1/340807687/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807687/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Plugin</category><category>theme</category><category>Technology</category><category>WordPress</category><pubDate>Wed, 20 Jan 2010 23:17:42 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/2010/01/use-array-overloading-in-the-wordpress-theme-or-plug-in-settings/</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/4ApT2yThUZw/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807687/5391790</fs:itemid></item><item><title>用 eclipse 写 WordPress 主题和插件</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807688/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807688/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807688/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;切换到 eclipse 有很长一段时间了. 这里推荐给 WordPress 主题作者和插件开发者, 当然如果你已经在使用或者计划使用其他更为强大的 IDE 开发工具的话可以跳过本文, 因为我这只介绍基本的使用方法, 旨在将大家引入一种更为便捷的开发环境. 当然对于非 WP 使用者而言这种方法同样适用.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Eclipse是著名的跨平台的自由集成开发环境(&lt;a href=&quot;http://zh.wikipedia.org/zh-cn/集成开发环境&quot; rel=&quot;external nofollow&quot;&gt;IDE&lt;/a&gt;)最初主要用来Java语言开发,但是目前亦有人通过插件使其作为其他计算机语言比如C++和Python的开发工具&amp;#8230; &lt;a href=&quot;http://zh.wikipedia.org/zh-cn/Eclipse&quot; title=&quot;read more&quot; rel=&quot;external nofollow&quot;&gt;More&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span id=&quot;more-219&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;下载和安装 eclipse&lt;/h2&gt;
&lt;p&gt;Eclipse 有多个版本, 主要是它们集成了不同的插件从而适用不同语言的开发者. 你可以到&lt;a href=&quot;http://www.eclipse.org/downloads/&quot; title=&quot;Get Eclipse&quot; rel=&quot;external nofollow&quot;&gt;这里&lt;/a&gt;下载. &lt;/p&gt;
&lt;p&gt;我使用的编程语言是 PHP 因此下载 Eclipse for PHP Developers 这个版本.&lt;/p&gt;
&lt;p&gt;Eclipse 是绿色软件, 解压即可使用, 当然由于它是基于 Java 的, 你需要 Java 环境. 安装Java环境和设置path, 这些细节不再本文讨论范围. 不会的菜鸟们可以 Google 一下.&lt;/p&gt;
&lt;h2&gt;使用技巧&lt;/h2&gt;
&lt;p&gt;	第一次启动 eclipse 是一个欢迎界面, 关掉欢迎标签后会看到多个透视图. 接下来我们就可以开始使用这个强大的开发工具了.&lt;/p&gt;
&lt;h3&gt;新建工程&lt;/h3&gt;
&lt;p&gt;	点击工具栏左下方按钮或者功过 file(文件) 新建一个 PHP Project&lt;/p&gt;
&lt;p&gt;	给你建的工程起个名字, 注意工程的路径为本地 WordPress 根目录(接下来, 你就会看到这样做的好处), 然后直接点 finish 即可&lt;/p&gt;
&lt;h3&gt;调整字体&lt;/h3&gt;
&lt;p&gt;	默认情况下 eclipse 在 windows 上的字体偏小. 我们需要适当调整一下, 我主要只修改三处&lt;br /&gt;
	&lt;strong&gt;修改步骤:&lt;/strong&gt;&lt;br /&gt;
	点击菜单上的 Window -&gt; Preferences, 在左边的 General 中点开 Apperance -&gt; colors and Fonts&lt;br /&gt;
	&lt;strong&gt;我的设置是:&lt;/strong&gt;&lt;br /&gt;
	Dialog Font 设置为 微软雅黑&lt;br /&gt;
	Text Editor Block Selection Font 和 Text Font 均设置为 Consolas&lt;/p&gt;
&lt;p&gt;	编辑器里面的字体原则上是使用等宽字体. 这样我们比较容易区分数字0和字母o这样比较接近的字符. windows 系统上默认是 Courier New. 我都看腻了. 试用了 Consolas 感觉还不错.&lt;/p&gt;
&lt;p&gt;	不推荐使用一些手写风格的字体, 漂亮的雅黑也最好不用, 我感觉那种字体用来编程看上去让眼睛很累. 网上有很多很漂亮的免费等宽字体下载. 大家可以去试试. 好的字体看上去舒服清晰, 敲代码时也让人心情愉悦些.&lt;/p&gt;
&lt;p&gt;	除了 Consolas 我还推荐的是 Linux 上面的 Mono&lt;/p&gt;
&lt;h3&gt;代码提示和自动完成&lt;/h3&gt;
&lt;p&gt;	这个功能几乎是所有 IDE 都具备的, 给我们的编程提供了非常大的便利.&lt;/p&gt;
&lt;p&gt;	还记得刚刚在建立工程时把整个 WordPress 目录放进去的步骤吧, 就是为这个强大的提示和自动完成服务的.&lt;/p&gt;
&lt;p&gt;	&lt;strong&gt;代码提示&lt;/strong&gt;: 鼠标放到个已经定义的函数上, 它的位置描述等等全部会提示出来. 按住 Ctrl单击那个函数, 我们就直接打开了那个函数所在的文件并自动转到那个函数的位置. 你很方便的查看那个函数具体是怎么编写的.&lt;/p&gt;
&lt;p&gt;	&lt;strong&gt;自动完成&lt;/strong&gt;: 有时候我们记不清到底之前写过的变量或者函数时, 只需要写出那个函数或变量的前几个字符然后按住 alt+? 它会自动为您搜索.&lt;/p&gt;
&lt;h3&gt;常用快捷键&lt;/h3&gt;
&lt;table title=&quot;Eclipse常用快捷键&quot; summary=&quot;Eclipse常用快捷键备忘.记住些常用的快捷键能明显提高我们的工作效率&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;按键&lt;/th&gt;
&lt;th&gt;功能&lt;/th&gt;
&lt;th&gt;按键&lt;/th&gt;
&lt;th&gt;功能&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+S&lt;/td&gt;
&lt;td&gt;保存&lt;/td&gt;
&lt;td&gt;Ctrl+T&lt;/td&gt;
&lt;td&gt;快速显示当前类的继承结构&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+1&lt;/td&gt;
&lt;td&gt;快速修复&lt;/td&gt;
&lt;td&gt;Ctrl+Alt+Down&lt;/td&gt;
&lt;td&gt;复制当前行到下一行&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+D&lt;/td&gt;
&lt;td&gt;删除当前行&lt;/td&gt;
&lt;td&gt;Ctrl+Alt+Up&lt;/td&gt;
&lt;td&gt;复制当前行到上一行&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+W&lt;/td&gt;
&lt;td&gt;关闭当前Editer&lt;/td&gt;
&lt;td&gt;Ctrl+Shift+K&lt;/td&gt;
&lt;td&gt;参照选中的Word快速定位到上一个&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+K&lt;/td&gt;
&lt;td&gt;参照选中的Word快速定位到下一个&lt;/td&gt;
&lt;td&gt;Ctrl+E&lt;/td&gt;
&lt;td&gt;快速显示当前Editer的下拉列表&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+Q &lt;/td&gt;
&lt;td&gt;定位到最后编辑的地方&lt;/td&gt;
&lt;td&gt;Ctrl+Shift+F&lt;/td&gt;
&lt;td&gt;格式化当前代码&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+L&lt;/td&gt;
&lt;td&gt;定位到指定行&lt;/td&gt;
&lt;td&gt;Ctrl+Shift+L&lt;/td&gt;
&lt;td&gt;显示全部定义的快捷键&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+M&lt;/td&gt;
&lt;td&gt;最大(小)化当前的Edit或View&lt;/td&gt;
&lt;td&gt;Alt+Left&lt;/td&gt;
&lt;td&gt;上一个编辑位置&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+Shift+M&lt;/td&gt;
&lt;td&gt;查找函数&lt;/td&gt;
&lt;td&gt;Alt+Right&lt;/td&gt;
&lt;td&gt;下一个编辑位置&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+Shift+T&lt;/td&gt;
&lt;td&gt;查找类&lt;/td&gt;
&lt;td&gt;Alt+/&lt;/td&gt;
&lt;td&gt;内容辅助功能&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+O&lt;/td&gt;
&lt;td&gt;快速显示OutLine&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;	&lt;em&gt;* 不推荐修改原有的快捷键. 记住一些常用的就可以了&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;安装插件&lt;/h2&gt;
&lt;p&gt;	Eclipse 有很多的插件, 但是对于写 WordPress 主题和插件的作者来说我推荐常装的插件是 Aptana. 用它来敲 Javascript 怎一个爽字了得.&lt;/p&gt;
&lt;p&gt;	事实上 Aptana 是个基于 eclipse 开发的 IDE, 同时它也提供一个 eclipse 的插件, 这样装了 Eclipse 的人就没有必要在重新安装一次 Aptana 了, 而只需要安装它提供的插件.&lt;/p&gt;
&lt;p&gt;	你可以选择两种方法来安装 Aptana 插件版. 1, 在线更新. 2, 下载 zip 文件. 你任选择一种即可. 到目前为止. 最新版zip的压缩文件约 35M. 我一般选择的是下载 zip 压缩包. 因为用迅雷下载这玩意很快. 比在线更新要快的多.&lt;/p&gt;
&lt;p&gt;	在线更新请按照 Aptana 提供的步骤来.&lt;/p&gt;
&lt;p&gt;	我简单介绍一下 zip 压缩包格式的安装.&lt;br /&gt;
	点击菜单栏的 Help -&gt; Install New Software&amp;#8230; 在弹出的窗口中点击 add -&gt; Archive&amp;#8230; 选择你下载回来的压缩包. 然后一步一步安装即可.&lt;/p&gt;
&lt;p&gt;	装好这个插件后如果你经常用 javascript 框架写代码的话. 那我建议你安装 Aptana 的相关 Javascript 框架支持. 比如我安装了 jQuery. 我这里不再详细, 不怎么理解的请 Google 一下. 有很多的教程告诉你要这么装.&lt;/p&gt;
&lt;p&gt;	&lt;strong&gt;值得注意的是:&lt;/strong&gt;&lt;br /&gt;
	装好插件后要调整一下文件的打开方式,  Window -&gt; Preferences, General -&gt; Eidtors -&gt; File Associations. 找到 js 后缀. 将 Aptana JS Editor 设置为默认编辑器. 这样你才能用 Aptana 提供的强大提示和自动完成功能. 要不然你会莫名其妙的发现插件安装成功了. 怎么就没有我提到的功能呢? 如果你还安装了其他的什么高级编辑器同样需要这样处理一下. 否则就它是调用 eclipse 默认的编辑器的.&lt;/p&gt;
&lt;h2&gt;后续话题:&lt;/h2&gt;
&lt;p&gt;	代码重构&lt;/p&gt;
&lt;p&gt;	SVN 版本控制&lt;/p&gt;
&lt;h2&gt;类似软件和工具&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Zend Studio&lt;/li&gt;
&lt;li&gt;Aptana&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;后记:&lt;/h2&gt;
&lt;p&gt;请原谅此文没有插图. 不要说无图无真相. 哈. 我是希望你亲自去体验.&lt;/p&gt;
&lt;p&gt;上面提及的两个类似软件都是基于 eclipse 这个开源软件的. 都是一个内核. 不同的只是集成的插件不同. 由不同的公司,社区维护.&lt;/p&gt;
&lt;p&gt;有人说使用 IDE 工具尤其是代码自动完成会造成人的惰性. 嗯. 我也觉得是这样. 其实我们现在流行使用 jQuery 和其他 javascript 框架. 甚至其它任何让人们可以偷懒的工具, 不也是同样的道理吗? 用的多了, 我们是感觉很方便的同时也忘却了很多该记住的东西. 这就跟一个厨师一般不会去关注锅碗瓢盆是怎么制造出来的而只是关注饭菜要怎么才美味一样. 另个可比的情况是: 我们很多人离开了 Dreamweaver 这种所见即所得的编辑工具后给个记事本就完全不会写 HTML 了. 所以如果你希望多了解编程, 还是一定要多去记忆一下东西的. IDE 只是一个便捷的快速的开发环境.&lt;/p&gt;
&lt;p&gt;还有什么问题? 欢迎提交评论, 大家一起讨论.&lt;br /&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/10/notepad/&quot; title=&quot;文本编辑Notepad++&quot; rel=&quot;bookmark inlinks&quot;&gt;文本编辑Notepad++&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 4 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/high-definition-enlarge/&quot; title=&quot;让你高清无码&quot; rel=&quot;bookmark inlinks&quot;&gt;让你高清无码&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 5 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/I34TIvchFxFwDY20QdcaRT9OEwo/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/I34TIvchFxFwDY20QdcaRT9OEwo/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/I34TIvchFxFwDY20QdcaRT9OEwo/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/I34TIvchFxFwDY20QdcaRT9OEwo/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=eA8nFapgbIs:v8y-JXchIII:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=eA8nFapgbIs:v8y-JXchIII:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=eA8nFapgbIs:v8y-JXchIII:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=eA8nFapgbIs:v8y-JXchIII:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/eA8nFapgbIs&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807688/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807688/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2010/01/with-the-eclipse-development-of-wordpress-themes-and-plugins/feed/</wfw:commentRss><slash:comments>14</slash:comments><feedburner:origLink>http://philna.com/2010/01/with-the-eclipse-development-of-wordpress-themes-and-plugins/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807688/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807688/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;切换到 eclipse 有很长一段时间了. 这里推荐给 WordPress 主题作者和插件开发者, 当然如果你已经在使用或者计划使用其他更为强大的 IDE 开发工具的话可以跳过本文, 因为我这只介绍基本的使用方法, 旨在将大家引入一种更为便捷的开发环境. 当然对于非 WP 使用者而言这种方法同样适用.
Eclipse是著名的跨平台的自由集成开发环境(IDE)最初主要用来Java语言开发,但是目前亦有人通过插件使其作为其他计算机语言比如C++和Python的开发工具&amp;#8230; More

下载和安装 eclipse
Eclipse 有多个版本, 主要是它们集成了不同的插件从而适用不同语言的开发者. 你可以到这里下载. 
我使用的编程语言是 PHP 因此下载 Eclipse for PHP Developers 这个版本.
Eclipse 是绿色软件, 解压即可使用, 当然由于它是基于 Java 的, 你需要 Java 环境. 安装Java环境和设置path, 这些细节不再本文讨论范围. 不会的菜鸟们可以 Google 一下.
使用技巧
	第一次启动 eclipse 是一个欢迎界面, 关掉欢迎标签后会看到多个透视图. 接下来我们就可以开始使用这个强大的开发工具了.
新建工程
	点击工具栏左下方按钮或者功过 file(文件) 新建一个 PHP Project
	给你建的工程起个名字, 注意工程的路径为本地 WordPress 根目录(接下来, 你就会看到这样做的好处), 然后直接点 finish 即可
调整字体
	默认情况下 [...]&lt;img src=&quot;http://www1.feedsky.com/t1/340807688/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807688/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>software</category><category>eclipse</category><category>Soft Secommend</category><pubDate>Tue, 12 Jan 2010 16:10:02 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/?p=219</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/eA8nFapgbIs/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807688/5391790</fs:itemid></item><item><title>阻止直接 POST 过来的 Spam</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807689/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807689/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807689/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;几天前收到很多 spam, 居然大部分来自同一个 IP. 我只好在数据库里用 SQL 语句删掉. 再去看访问日志. 发现这个 IP 几乎是直接向我的 wp-comments-post.php 这个文件 POST 数据. 也就是说它根本没有访问文章. 我很气愤.&lt;/p&gt;
&lt;p&gt;现在想到的解决方案是用 SESSION 来阻止. 写成插件 &lt;em&gt;( Stop post spam )&lt;/em&gt;. 本地测试有效. 但要是用了 HTML 静态缓存就不知到了. 可能会导致任何人都无法提交? 不过总的来说这个是不适合完全静态页面的, 除非我们的隐藏域设置为固定的值? 这个有恐怕无法到达很好的阻止作用. 两难啊. 唉. 反正我也不用缓存插件. 不管了. 交给爱折腾的人吧.&lt;/p&gt;
&lt;h2&gt;再和大家说说我的流程是怎样的.&lt;/h2&gt;
&lt;p&gt;&lt;span id=&quot;more-218&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;插件激活后通过 StopPOSTSpam 类的构造函数挂载方法到 WordPress 自身的 HOOKs 上. (怎么听上去有点拗口&amp;#8230; (- -!))&lt;/p&gt;
&lt;p&gt;用到的钩子: init, template_redirect, comment_form,  pre_comment_on_post&lt;/p&gt;
&lt;h2&gt;具体实现流程: &lt;/h2&gt;
&lt;p&gt;正常访问状态, 访客访问可以评论的页面(比如普通的日志页面), PHP 执行如下:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;init 会将ready状态设置为 true.&lt;/li&gt;
&lt;li&gt;到执行 template_redirect 的时候判断是否为评论的页面, 是则创建随机 SESSION 否则插件不再执行 Spam 判断&lt;/li&gt;
&lt;li&gt;评论表达中通过 comment_form 这个 hook 添加刚刚创建的 SESSION 隐藏域.&lt;/li&gt;
&lt;li&gt;提交评论的时候通过 pre_comment_on_post 这个 hook 判断 SESSION. 当然 ready 状态为 false 不判断.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;直接POST数据时: 没有通过 template_redirect 这一步来生成 SESSION 当然是不能通过的. 它会被当成 spam 而阻止进一步向数据库提交. &lt;/p&gt;
&lt;p&gt;最后祝大家元旦快乐, 我不想写感悟, 也不想总结. 反正这半年来过的真是不怎么样. 这算是2009最后一个小时的文章吧. 过几天的考试. 唉~ 我可能会死 &amp;#8216;很惨&amp;#8217; . 有时间和爱心的朋友到时候可要过来安慰我啊&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/philna/downloads/list&quot; title=&quot;get WP Plugin Stop post spam&quot;&gt;下载这个插件.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;在无法使用 session 的情况下改为判断来路. 不知是否试用于静态页面. 欢迎测试.&lt;br /&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/09/use-main-loop-in-wp-theme/&quot; title=&quot;使用主循环设计思路&quot; rel=&quot;bookmark inlinks&quot;&gt;使用主循环设计思路&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 20 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/12/add-ads-without-plugins/&quot; title=&quot;不用插件放广告&quot; rel=&quot;bookmark inlinks&quot;&gt;不用插件放广告&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 11 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/get-feed-add-some-personality/&quot; title=&quot;给feed输出内容添加些'个性'&quot; rel=&quot;bookmark inlinks&quot;&gt;给feed输出内容添加些&amp;#8217;个性&amp;#8217;&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 11 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/where-you-put-your-images/&quot; title=&quot;图片里放哪里?&quot; rel=&quot;bookmark inlinks&quot;&gt;图片里放哪里?&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 16 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/wordpress-ie-garbled/&quot; title=&quot;Wordpress IE查看源文件乱码解决&quot; rel=&quot;bookmark inlinks&quot;&gt;Wordpress IE查看源文件乱码解决&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 12 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/10/nofollow-links/&quot; title=&quot;给首页的友情链接添加 nofollow&quot; rel=&quot;bookmark inlinks&quot;&gt;给首页的友情链接添加 nofollow&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 21 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/set-up-e-mail-form-without-plugin/&quot; title=&quot;不用插件实现wordpress邮件表单&quot; rel=&quot;bookmark inlinks&quot;&gt;不用插件实现wordpress邮件表单&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 13 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/design-404-error-page/&quot; title=&quot;设计404页面&quot; rel=&quot;bookmark inlinks&quot;&gt;设计404页面&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 25 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/vQn4ScbrxTNfKi-56vSryu9qo6s/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/vQn4ScbrxTNfKi-56vSryu9qo6s/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/vQn4ScbrxTNfKi-56vSryu9qo6s/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/vQn4ScbrxTNfKi-56vSryu9qo6s/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=CklHUiNIXWU:Z97zPef70cM:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=CklHUiNIXWU:Z97zPef70cM:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=CklHUiNIXWU:Z97zPef70cM:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=CklHUiNIXWU:Z97zPef70cM:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/CklHUiNIXWU&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807689/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807689/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2009/12/prevent-the-direct-post-spam/feed/</wfw:commentRss><slash:comments>35</slash:comments><feedburner:origLink>http://philna.com/2009/12/prevent-the-direct-post-spam/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807689/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807689/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;几天前收到很多 spam, 居然大部分来自同一个 IP. 我只好在数据库里用 SQL 语句删掉. 再去看访问日志. 发现这个 IP 几乎是直接向我的 wp-comments-post.php 这个文件 POST 数据. 也就是说它根本没有访问文章. 我很气愤.
现在想到的解决方案是用 SESSION 来阻止. 写成插件 ( Stop post spam ). 本地测试有效. 但要是用了 HTML 静态缓存就不知到了. 可能会导致任何人都无法提交? 不过总的来说这个是不适合完全静态页面的, 除非我们的隐藏域设置为固定的值? 这个有恐怕无法到达很好的阻止作用. 两难啊. 唉. 反正我也不用缓存插件. 不管了. 交给爱折腾的人吧.
再和大家说说我的流程是怎样的.

插件激活后通过 StopPOSTSpam 类的构造函数挂载方法到 WordPress 自身的 HOOKs 上. (怎么听上去有点拗口&amp;#8230; (- -!))
用到的钩子: init, template_redirect, comment_form,  pre_comment_on_post
具体实现流程: 
正常访问状态, 访客访问可以评论的页面(比如普通的日志页面), PHP [...]&lt;img src=&quot;http://www1.feedsky.com/t1/340807689/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807689/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Plugin</category><category>Technology</category><category>comment</category><category>WordPress</category><pubDate>Thu, 31 Dec 2009 22:30:30 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/2009/12/prevent-the-direct-post-spam/</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/CklHUiNIXWU/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807689/5391790</fs:itemid></item><item><title>Google Ajax Custom Search</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807690/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807690/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807690/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;好久没有关注 Google 自定义搜索. 今天上去一看很多地方都改掉了. Google 更偏向于使用他的 Ajax API. 好吧, 我也来研究一下. 基本来说文档还是很详尽的.&lt;/p&gt;
&lt;p&gt;做了个小尝试. 利用 Google Ajax API 写了个 Google 自定义搜索. 可以用来搜索本站内容. &lt;/p&gt;
&lt;p&gt;注意: 原则上 Google 要求保留它的 logo. 所以大家在使用的时候还是最后加上. 这也是对 Google 的一种尊重吧.&lt;/p&gt;
&lt;p&gt;我写的&lt;a href=&quot;http://philna.com/tutorials/2009/google_ajax_custom_search/&quot;&gt; DEMO&lt;/a&gt; 在这里.&lt;/p&gt;
&lt;p&gt;&lt;span id=&quot;more-217&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;以后有时间考虑给主题加上吧. 也需要等到下一个主题了. 现在越来越觉的主题主题集成的东西太多. 非常不利于修改和维护. 而且代码也写得不优雅. 重来实在是没有时间.&lt;br /&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/09/simple-javascript-cache/&quot; title=&quot;基于 javascript 的简单缓存思路&quot; rel=&quot;bookmark inlinks&quot;&gt;基于 javascript 的简单缓存思路&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 3 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/staroffice-google/&quot; title=&quot;StarOffice被Google退了&quot; rel=&quot;bookmark inlinks&quot;&gt;StarOffice被Google退了&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 5 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/where-you-put-your-images/&quot; title=&quot;图片里放哪里?&quot; rel=&quot;bookmark inlinks&quot;&gt;图片里放哪里?&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 16 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/learning-ajax-2/&quot; title=&quot;学习Ajax之XMLHttpRequest对象&quot; rel=&quot;bookmark inlinks&quot;&gt;学习Ajax之XMLHttpRequest对象&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 12 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/jqurey-ajax/&quot; title=&quot;Ajax之jQuery&quot; rel=&quot;bookmark inlinks&quot;&gt;Ajax之jQuery&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 29 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/jquery-ajax-comment-pager/&quot; title=&quot;jQuery版ajax comment pager&quot; rel=&quot;bookmark inlinks&quot;&gt;jQuery版ajax comment pager&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 18 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/update-comment-in-one-time/&quot; title=&quot;同步更新边侧栏评论&quot; rel=&quot;bookmark inlinks&quot;&gt;同步更新边侧栏评论&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 42 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/learning-ajax-1/&quot; title=&quot;学习Ajax第一篇(了解)&quot; rel=&quot;bookmark inlinks&quot;&gt;学习Ajax第一篇(了解)&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 11 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/Mf6IKxRzK9xYrBrTIaAwi3eUhUc/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/Mf6IKxRzK9xYrBrTIaAwi3eUhUc/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/Mf6IKxRzK9xYrBrTIaAwi3eUhUc/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/Mf6IKxRzK9xYrBrTIaAwi3eUhUc/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=DvqbAa9WZ_8:QFepVR_LlJo:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=DvqbAa9WZ_8:QFepVR_LlJo:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=DvqbAa9WZ_8:QFepVR_LlJo:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=DvqbAa9WZ_8:QFepVR_LlJo:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/DvqbAa9WZ_8&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807690/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807690/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2009/11/google-ajax-custom-search/feed/</wfw:commentRss><slash:comments>15</slash:comments><feedburner:origLink>http://philna.com/2009/11/google-ajax-custom-search/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807690/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807690/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;好久没有关注 Google 自定义搜索. 今天上去一看很多地方都改掉了. Google 更偏向于使用他的 Ajax API. 好吧, 我也来研究一下. 基本来说文档还是很详尽的.
做了个小尝试. 利用 Google Ajax API 写了个 Google 自定义搜索. 可以用来搜索本站内容. 
注意: 原则上 Google 要求保留它的 logo. 所以大家在使用的时候还是最后加上. 这也是对 Google 的一种尊重吧.
我写的 DEMO 在这里.

以后有时间考虑给主题加上吧. 也需要等到下一个主题了. 现在越来越觉的主题主题集成的东西太多. 非常不利于修改和维护. 而且代码也写得不优雅. 重来实在是没有时间.
Related Posts

学习Ajax之XMLHttpRequest对象( 12 )
Ajax之jQuery( 29 )
同步更新边侧栏评论( 42 )
StarOffice被Google退了( 5 )
Ajax学习之一个post方法(例子)( 9 )
jQuery版ajax comment pager( 18 )
我做的插件: Ajax home page( 67 )
学习Ajax第一篇(了解)( [...]&lt;img src=&quot;http://www1.feedsky.com/t1/340807690/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807690/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Google</category><category>Technology</category><category>ajax</category><pubDate>Mon, 30 Nov 2009 08:32:29 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/2009/11/google-ajax-custom-search/</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/DvqbAa9WZ_8/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807690/5391790</fs:itemid></item><item><title>无限级导航菜单</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807691/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807691/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807691/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;上次看到有个 web 招聘笔试题里有个题大意是这样的: 是否尝试写过无限级的导航菜单? 我一时兴致就尝试写了一下. &lt;/p&gt;
&lt;p&gt;要想兼容 IE(6/7/8) 系列还真的挺费事. 不得不动用 javascript 以及在 CSS 中使用 hacker. 对 Javascript 我只懂些皮毛. 要想做出些动画效果那几乎不可能. 只好用 jQuery 了.&lt;/p&gt;
&lt;p&gt;我现在做了个DEMO. 要修改其动画效果只需要改改 js 中的鼠标效果即可. jQuery 自带的几个动画效果都可以. 当然你还可以发挥你的想象写些自定义动画.&lt;/p&gt;
&lt;p&gt;&lt;span id=&quot;more-216&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://philna.com/tutorials/2009/menu/menu.html&quot; title=&quot;无限级导航菜单&quot;&gt;DEMO&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/12/mouseover-to-show-comment-no1/&quot; title=&quot;鼠标悬浮实现显示留言内容(上)&quot; rel=&quot;bookmark inlinks&quot;&gt;鼠标悬浮实现显示留言内容(上)&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 20 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/12/share-with-you-snowstorm-javascript/&quot; title=&quot;分享js下雪效果&quot; rel=&quot;bookmark inlinks&quot;&gt;分享js下雪效果&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 7 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/jqurey-ajax/&quot; title=&quot;Ajax之jQuery&quot; rel=&quot;bookmark inlinks&quot;&gt;Ajax之jQuery&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 29 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/ie-have-bugs-on-button/&quot; title=&quot;评论按钮被拉伸Bug&quot; rel=&quot;bookmark inlinks&quot;&gt;评论按钮被拉伸Bug&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 10 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/my-plugin-ajax-home-page/&quot; title=&quot;我做的插件: Ajax home page&quot; rel=&quot;bookmark inlinks&quot;&gt;我做的插件: Ajax home page&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 67 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/learning-ajax-1/&quot; title=&quot;学习Ajax第一篇(了解)&quot; rel=&quot;bookmark inlinks&quot;&gt;学习Ajax第一篇(了解)&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 11 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/learning-ajax-3/&quot; title=&quot;Ajax学习之一个post方法(例子)&quot; rel=&quot;bookmark inlinks&quot;&gt;Ajax学习之一个post方法(例子)&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 9 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/09/simple-javascript-cache/&quot; title=&quot;基于 javascript 的简单缓存思路&quot; rel=&quot;bookmark inlinks&quot;&gt;基于 javascript 的简单缓存思路&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 3 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/2NokfVC4JrfsIVZRn_zF_L-B0rw/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/2NokfVC4JrfsIVZRn_zF_L-B0rw/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/2NokfVC4JrfsIVZRn_zF_L-B0rw/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/2NokfVC4JrfsIVZRn_zF_L-B0rw/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=eHTqMqiLIi8:QH-R3O32B4w:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=eHTqMqiLIi8:QH-R3O32B4w:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=eHTqMqiLIi8:QH-R3O32B4w:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=eHTqMqiLIi8:QH-R3O32B4w:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/eHTqMqiLIi8&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807691/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807691/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2009/11/unlimited-class-navigation-menu/feed/</wfw:commentRss><slash:comments>20</slash:comments><feedburner:origLink>http://philna.com/2009/11/unlimited-class-navigation-menu/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807691/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807691/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;上次看到有个 web 招聘笔试题里有个题大意是这样的: 是否尝试写过无限级的导航菜单? 我一时兴致就尝试写了一下. 
要想兼容 IE(6/7/8) 系列还真的挺费事. 不得不动用 javascript 以及在 CSS 中使用 hacker. 对 Javascript 我只懂些皮毛. 要想做出些动画效果那几乎不可能. 只好用 jQuery 了.
我现在做了个DEMO. 要修改其动画效果只需要改改 js 中的鼠标效果即可. jQuery 自带的几个动画效果都可以. 当然你还可以发挥你的想象写些自定义动画.

DEMO
Related Posts

抽时间学点jQuery( 17 )
修改inove主题( 23 )
评论按钮被拉伸Bug( 10 )
鼠标悬浮实现显示留言内容(上)( 20 )
js判断外链并新窗口打开( 7 )
Ajax学习之一个post方法(例子)( 9 )
Ajax之jQuery( 29 )
鼠标悬浮实现显示留言内容(下)( 54 )&lt;img src=&quot;http://www1.feedsky.com/t1/340807691/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807691/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>jQuery</category><category>Technology</category><category>javascript</category><category>css</category><pubDate>Fri, 13 Nov 2009 19:51:15 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/?p=216</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/eHTqMqiLIi8/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807691/5391790</fs:itemid></item><item><title>Comment Fetion Alert 2.0.0 dev 发布</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807692/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807692/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807692/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;整个重新写过. 丰富了后台选项. 最重要的是去掉了对 curl 扩展的依赖. 很多的细节我也不多说了. 现在发布 dev 版本给大家测试. 有问题尽快提交给我. 我好做进一步的修正.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/philna/downloads/list&quot;&gt;下载&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;补充:&lt;br /&gt;
我哥们 Grubylee 给我写了比较详细的说明. &lt;a href=&quot;http://www.liqinghai.com/wordpress-comment-fetion-alert-2-0-0-dev/&quot;&gt;移步看看&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/comment-fetion-alert/&quot; title=&quot;插件发布:Comment Fetion Alert&quot; rel=&quot;bookmark inlinks&quot;&gt;插件发布:Comment Fetion Alert&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 86 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/comment-sms-alert/&quot; title=&quot;评论短信提醒&quot; rel=&quot;bookmark inlinks&quot;&gt;评论短信提醒&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 24 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/jquery-ajax-comment-pager/&quot; title=&quot;jQuery版ajax comment pager&quot; rel=&quot;bookmark inlinks&quot;&gt;jQuery版ajax comment pager&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 18 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/12/prevent-the-direct-post-spam/&quot; title=&quot;阻止直接 POST 过来的 Spam&quot; rel=&quot;bookmark inlinks&quot;&gt;阻止直接 POST 过来的 Spam&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 35 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/fix-enthusiastic-commentator/&quot; title=&quot;修正热情评论员&quot; rel=&quot;bookmark inlinks&quot;&gt;修正热情评论员&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 17 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/enthusiastic-commentator/&quot; title=&quot;评论添加:热情评论员&quot; rel=&quot;bookmark inlinks&quot;&gt;评论添加:热情评论员&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 22 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/c2XgTsmvuypMPUQQ0ytiRmqGtVc/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/c2XgTsmvuypMPUQQ0ytiRmqGtVc/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/c2XgTsmvuypMPUQQ0ytiRmqGtVc/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/c2XgTsmvuypMPUQQ0ytiRmqGtVc/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=YROjYuEV0V0:W3nCHr23icE:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=YROjYuEV0V0:W3nCHr23icE:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=YROjYuEV0V0:W3nCHr23icE:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=YROjYuEV0V0:W3nCHr23icE:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/YROjYuEV0V0&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807692/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807692/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2009/11/comment-fetion-alert-2-0-0-dev/feed/</wfw:commentRss><slash:comments>35</slash:comments><feedburner:origLink>http://philna.com/2009/11/comment-fetion-alert-2-0-0-dev/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807692/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807692/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;整个重新写过. 丰富了后台选项. 最重要的是去掉了对 curl 扩展的依赖. 很多的细节我也不多说了. 现在发布 dev 版本给大家测试. 有问题尽快提交给我. 我好做进一步的修正.
下载
补充:
我哥们 Grubylee 给我写了比较详细的说明. 移步看看
Related Posts

修正热情评论员( 17 )
阻止直接 POST 过来的 Spam( 35 )
插件发布:Comment Fetion Alert( 86 )
评论添加:热情评论员( 22 )
jQuery版ajax comment pager( 18 )
评论短信提醒( 24 )&lt;img src=&quot;http://www1.feedsky.com/t1/340807692/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807692/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Fetion</category><category>Technology</category><category>comment</category><category>WordPress</category><pubDate>Mon, 02 Nov 2009 13:50:25 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/2009/11/comment-fetion-alert-2-0-0-dev/</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/YROjYuEV0V0/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807692/5391790</fs:itemid></item><item><title>缓存头像的插件 cache avatar</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807693/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807693/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807693/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;抽空写了个缓存头像的插件 &amp;#8211; cache avatar&lt;/p&gt;
&lt;p&gt;可以把讨论头像缓存到本地服务器. 随着博客越来越多 gravatar 的站点压力越来越大. 偶尔有头像下载缓慢的情况. 尤其在评论很多的情况下评论者头像往往是最后才载入完成. 因此对站点速度有点苛刻的朋友需要缓存一下评论头像.&lt;/p&gt;
&lt;p&gt;插件后台可设置缓存时间.&lt;/p&gt;
&lt;p&gt;&lt;span id=&quot;more-214&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;需要的朋友可&lt;a href=&quot;http://code.google.com/p/philna/downloads/list&quot; title=&quot;Goto google code and get cache avatar&quot;&gt;下载&lt;/a&gt;.&lt;br /&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/php-verification-code/&quot; title=&quot;Php图片验证&quot; rel=&quot;bookmark inlinks&quot;&gt;Php图片验证&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 16 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/jquery-ajax-comment-pager/&quot; title=&quot;jQuery版ajax comment pager&quot; rel=&quot;bookmark inlinks&quot;&gt;jQuery版ajax comment pager&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 18 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/09/simple-javascript-cache/&quot; title=&quot;基于 javascript 的简单缓存思路&quot; rel=&quot;bookmark inlinks&quot;&gt;基于 javascript 的简单缓存思路&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 3 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/wordpress-theme-philna/&quot; title=&quot;主题:PhilNa&quot; rel=&quot;bookmark inlinks&quot;&gt;主题:PhilNa&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 33 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/where-you-put-your-images/&quot; title=&quot;图片里放哪里?&quot; rel=&quot;bookmark inlinks&quot;&gt;图片里放哪里?&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 16 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/set-up-e-mail-form-without-plugin/&quot; title=&quot;不用插件实现wordpress邮件表单&quot; rel=&quot;bookmark inlinks&quot;&gt;不用插件实现wordpress邮件表单&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 13 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/09/highlight-keywords/&quot; title=&quot;高亮搜索结果&quot; rel=&quot;bookmark inlinks&quot;&gt;高亮搜索结果&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 19 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/get-feed-add-some-personality/&quot; title=&quot;给feed输出内容添加些'个性'&quot; rel=&quot;bookmark inlinks&quot;&gt;给feed输出内容添加些&amp;#8217;个性&amp;#8217;&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 11 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/CdMVN2vyU8yJgM8C_PJ2Ahxu-yI/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/CdMVN2vyU8yJgM8C_PJ2Ahxu-yI/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/CdMVN2vyU8yJgM8C_PJ2Ahxu-yI/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/CdMVN2vyU8yJgM8C_PJ2Ahxu-yI/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=ccVxA67qTzc:UoNiagw4X88:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=ccVxA67qTzc:UoNiagw4X88:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=ccVxA67qTzc:UoNiagw4X88:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=ccVxA67qTzc:UoNiagw4X88:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/ccVxA67qTzc&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807693/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807693/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2009/10/cache-avatar/feed/</wfw:commentRss><slash:comments>33</slash:comments><feedburner:origLink>http://philna.com/2009/10/cache-avatar/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807693/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807693/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;抽空写了个缓存头像的插件 &amp;#8211; cache avatar
可以把讨论头像缓存到本地服务器. 随着博客越来越多 gravatar 的站点压力越来越大. 偶尔有头像下载缓慢的情况. 尤其在评论很多的情况下评论者头像往往是最后才载入完成. 因此对站点速度有点苛刻的朋友需要缓存一下评论头像.
插件后台可设置缓存时间.

需要的朋友可下载.
Related Posts

评论短信提醒 (补充)( 31 )
给广告一个关闭的按钮( 22 )
图片里放哪里?( 16 )
本站装的插件( 6 )
建立自己的专属页面( 36 )
Wordpress更新至2.6.5( 11 )
主题:PhilNa( 33 )
给首页的友情链接添加 nofollow( 21 )&lt;img src=&quot;http://www1.feedsky.com/t1/340807693/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807693/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Cache</category><category>plugins</category><category>Technology</category><category>WordPress</category><pubDate>Thu, 29 Oct 2009 21:19:34 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/2009/10/cache-avatar/</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/ccVxA67qTzc/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807693/5391790</fs:itemid></item><item><title>给首页的友情链接添加 nofollow</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807694/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807694/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807694/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;介绍个简便的办法给用 wordpress 的朋友, 用来给首页的友情链接添加 nofollow. 只有几行代码,很简单. 如下:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #009933;&quot;&gt;/**
 * 给首页友情链接添加 nofollow
 *
 * 你可以举一反三, 用它来对友情链接做些修改
 *
 * @author yinheli
 * @link http://philna.com
 * @param array $links 链接
 * @return array 修改过的链接
 */&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; myBookmarksInHomepage&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$links&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #666666;&quot;&gt;/*判断是否为首页 你也可以用其他的判断用于其他的页面*/&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;is_home&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #666666;&quot;&gt;/*历遍*/&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$links&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #666666;&quot;&gt;/*你可以添加其他的判断对来针对你需要修改的链接*/&lt;/span&gt;
			&lt;span style=&quot;color: #000088;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;link_rel&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;'external nofollow'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$links&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
add_filter&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'get_bookmarks'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'myBookmarksInHomepage'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;span id=&quot;more-212&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;把上面的代码放到主题的 functions.php 中即可.&lt;/p&gt;
&lt;p&gt;你还可以多加些判断比如针对某个分类. 甚至只针对某个链接. 这应该是最灵活的处理办法了.&lt;/p&gt;
&lt;p&gt;最后说明一下: 本站不交换链接, 所有以交换链接为名提交的评论将被删除. 你要是经常来我这里留言, 混熟了我自然会给你加上链接.&lt;br /&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/09/use-main-loop-in-wp-theme/&quot; title=&quot;使用主循环设计思路&quot; rel=&quot;bookmark inlinks&quot;&gt;使用主循环设计思路&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 20 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/set-up-e-mail-form-without-plugin/&quot; title=&quot;不用插件实现wordpress邮件表单&quot; rel=&quot;bookmark inlinks&quot;&gt;不用插件实现wordpress邮件表单&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 13 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/php-substr/&quot; title=&quot;Php substr截取中文乱码&quot; rel=&quot;bookmark inlinks&quot;&gt;Php substr截取中文乱码&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 6 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/php-verification-code/&quot; title=&quot;Php图片验证&quot; rel=&quot;bookmark inlinks&quot;&gt;Php图片验证&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 16 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2010/01/use-array-overloading-in-the-wordpress-theme-or-plug-in-settings/&quot; title=&quot;数组重载在 WordPress 主题或插件设置中的应用&quot; rel=&quot;bookmark inlinks&quot;&gt;数组重载在 WordPress 主题或插件设置中的应用&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 31 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/jqurey-ajax/&quot; title=&quot;Ajax之jQuery&quot; rel=&quot;bookmark inlinks&quot;&gt;Ajax之jQuery&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 29 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/09/simple-javascript-cache/&quot; title=&quot;基于 javascript 的简单缓存思路&quot; rel=&quot;bookmark inlinks&quot;&gt;基于 javascript 的简单缓存思路&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 3 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/09/highlight-keywords/&quot; title=&quot;高亮搜索结果&quot; rel=&quot;bookmark inlinks&quot;&gt;高亮搜索结果&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 19 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/Nw-h7XoUsI3QpOBgloOyZ79dy_E/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/Nw-h7XoUsI3QpOBgloOyZ79dy_E/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/Nw-h7XoUsI3QpOBgloOyZ79dy_E/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/Nw-h7XoUsI3QpOBgloOyZ79dy_E/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=jvUN_p3as6U:_0sfoz3dFAE:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=jvUN_p3as6U:_0sfoz3dFAE:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=jvUN_p3as6U:_0sfoz3dFAE:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=jvUN_p3as6U:_0sfoz3dFAE:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/jvUN_p3as6U&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807694/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807694/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2009/10/nofollow-links/feed/</wfw:commentRss><slash:comments>21</slash:comments><feedburner:origLink>http://philna.com/2009/10/nofollow-links/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807694/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807694/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;介绍个简便的办法给用 wordpress 的朋友, 用来给首页的友情链接添加 nofollow. 只有几行代码,很简单. 如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
 * 给首页友情链接添加 nofollow
 *
 * 你可以举一反三, 用它来对友情链接做些修改
 *
 * @author yinheli
 * @link http://philna.com
 * @param array $links 链接
 * @return array 修改过的链接
 */
function myBookmarksInHomepage&amp;#40;$links&amp;#41;&amp;#123;
	/*判断是否为首页 你也可以用其他的判断用于其他的页面*/
	if&amp;#40;is_home&amp;#40;&amp;#41;&amp;#41;&amp;#123;
		/*历遍*/
		foreach &amp;#40;$links as &amp;#38;$value&amp;#41; &amp;#123;
			/*你可以添加其他的判断对来针对你需要修改的链接*/
			$value-&amp;#62;link_rel = 'external nofollow';
		&amp;#125;
	&amp;#125;
	return $links;
&amp;#125;
add_filter&amp;#40;'get_bookmarks','myBookmarksInHomepage'&amp;#41;;


把上面的代码放到主题的 functions.php 中即可.
你还可以多加些判断比如针对某个分类. 甚至只针对某个链接. 这应该是最灵活的处理办法了.
最后说明一下: 本站不交换链接, 所有以交换链接为名提交的评论将被删除. 你要是经常来我这里留言, 混熟了我自然会给你加上链接.
Related Posts

使用主循环设计思路( 20 )
我安装的插件( 25 )
建立自己的专属页面( 36 [...]&lt;img src=&quot;http://www1.feedsky.com/t1/340807694/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807694/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>php</category><category>Technology</category><category>WordPress</category><pubDate>Wed, 28 Oct 2009 15:09:37 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/?p=212</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/jvUN_p3as6U/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807694/5391790</fs:itemid></item><item><title>在 PhilNa2 中使用 Hook</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807695/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807695/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807695/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;主题难免要修修改改. 在代码时我故意留了些可以个性化的 Hook 供大家使用.&lt;/p&gt;
&lt;p&gt;实现方法是用 add_action 和 add_filter 函数.  (更多相关信息请到官方查看文档). 比如我的文章中的声明, Google 广告, 页脚的备案等内容就是通过这种方法实现的.&lt;/p&gt;
&lt;h3&gt;下面以修改欢迎词为例简单说明:&lt;/h3&gt;
&lt;p&gt;本修改针对 PhilNa2 version 2.0.3&lt;/p&gt;
&lt;p&gt;修改原理:&lt;br /&gt;
通过添加过滤器: add_filter函数实现.&lt;/p&gt;
&lt;p&gt;首先打开app文件夹的template_functions.php文件找到welcome_msg函数部分, 大约在415行, 你会看到针对Google搜索过来的访客的欢迎词处理.&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;415
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$m&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; apply_filters&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'welcome_msg_google_search'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$str&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;因此要修改来自Google搜索访客的欢迎词可以使用如下代码:(你可以将一下代码放到主题根目录functions.php的最后面,当然也可另外建一个文件, 另外引入也行)&lt;/p&gt;
&lt;p&gt;&lt;span id=&quot;more-210&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; my_welcome_msg_for_google&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$msg&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #000088;&quot;&gt;$msg&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;'欢迎来自Google的朋友....'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;//这里写你想要显示的内容. 可以使用html&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$msg&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
add_filter&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'welcome_msg_google_search'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;my_welcome_msg_for_google&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;其他的以此类推. 考虑到并非所有人都要修改一番, 这里不再列出所有可修改的 Hook 接口. 主题使用了很多中文注释, 很容易明白.&lt;/p&gt;
&lt;p&gt;为什么要这么做? 主要是为了避免主题的频繁更新, 可能导致部分忠实用户的个性化修改麻烦. 写好函数后, 以后更新了, 再次导入引用就会相对方便些. 当然也了, 我的主题并不是团队合作更新, 可能更新的频率也不会高, 只是提供一种思路吧. 实在不喜欢的朋友, 还是建议直接修改源代码.&lt;br /&gt;
&lt;h3&gt;Related Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/phina2/&quot; title=&quot;主题发布: PhilNa2 &quot; rel=&quot;bookmark inlinks&quot;&gt;主题发布: PhilNa2 &lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 122 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/ZWmIEFkpcXdUZZSIgsJxOTNJTnU/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/ZWmIEFkpcXdUZZSIgsJxOTNJTnU/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/ZWmIEFkpcXdUZZSIgsJxOTNJTnU/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/ZWmIEFkpcXdUZZSIgsJxOTNJTnU/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=6c7qVw8oDAg:jnUaXU1u2Fc:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=6c7qVw8oDAg:jnUaXU1u2Fc:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=6c7qVw8oDAg:jnUaXU1u2Fc:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=6c7qVw8oDAg:jnUaXU1u2Fc:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/6c7qVw8oDAg&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807695/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807695/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2009/10/use-hooks-in-philna2/feed/</wfw:commentRss><slash:comments>24</slash:comments><feedburner:origLink>http://philna.com/2009/10/use-hooks-in-philna2/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807695/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807695/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;主题难免要修修改改. 在代码时我故意留了些可以个性化的 Hook 供大家使用.
实现方法是用 add_action 和 add_filter 函数.  (更多相关信息请到官方查看文档). 比如我的文章中的声明, Google 广告, 页脚的备案等内容就是通过这种方法实现的.
下面以修改欢迎词为例简单说明:
本修改针对 PhilNa2 version 2.0.3
修改原理:
通过添加过滤器: add_filter函数实现.
首先打开app文件夹的template_functions.php文件找到welcome_msg函数部分, 大约在415行, 你会看到针对Google搜索过来的访客的欢迎词处理.

415
if&amp;#40;$m = apply_filters&amp;#40;'welcome_msg_google_search',$str&amp;#41;&amp;#41;

因此要修改来自Google搜索访客的欢迎词可以使用如下代码:(你可以将一下代码放到主题根目录functions.php的最后面,当然也可另外建一个文件, 另外引入也行)


function my_welcome_msg_for_google&amp;#40;$msg&amp;#41;&amp;#123;
	$msg = '欢迎来自Google的朋友....';//这里写你想要显示的内容. 可以使用html
	return $msg;
&amp;#125;
add_filter&amp;#40;'welcome_msg_google_search',my_welcome_msg_for_google&amp;#41;;

其他的以此类推. 考虑到并非所有人都要修改一番, 这里不再列出所有可修改的 Hook 接口. 主题使用了很多中文注释, 很容易明白.
为什么要这么做? 主要是为了避免主题的频繁更新, 可能导致部分忠实用户的个性化修改麻烦. 写好函数后, 以后更新了, 再次导入引用就会相对方便些. 当然也了, 我的主题并不是团队合作更新, 可能更新的频率也不会高, 只是提供一种思路吧. 实在不喜欢的朋友, 还是建议直接修改源代码.
Related Posts

主题发布: PhilNa2 ( 122 )&lt;img src=&quot;http://www1.feedsky.com/t1/340807695/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807695/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>philna2</category><category>WordPress</category><pubDate>Mon, 05 Oct 2009 23:00:58 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/2009/09/use-hooks-in-philna2/</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/6c7qVw8oDAg/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807695/5391790</fs:itemid></item><item><title>博客一周岁</title><link>http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807696/5391790/1/item.html</link><content:encoded>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807696/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807696/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;不知不觉开博一年了, 我先自我祝贺一下.&lt;/p&gt;
&lt;p&gt;记不得当时为什么开博, 可能是一时冲动, 和很多人一样. 我也曾在网络上各种地方混过. 但都不尽人意才转向独立博客, 之所以选用 wordpress 作为平台,是因为它用的人多. 方便交流. 也想更深入的学习一下 PHP .&lt;/p&gt;
&lt;h3&gt;现实&lt;/h3&gt;
&lt;p&gt;现实生活中的我其实我点自闭. 不善交际, 语言笨拙&amp;#8230; 所以朋友也不多. 大部分&amp;#8217;寂寞&amp;#8217;的时光都是对着屏幕度过的. 但内心却渴望交流, 想要那种愉悦的环境. 可以嘻嘻哈哈谈天说地. 生活可以积极乐观向上&amp;#8230; 这些简单的事情可让我实践起来却非常困难. 网络却给了一个不同的环境. 我开始对它痴迷&amp;#8230;&lt;/p&gt;
&lt;h3&gt;回顾&lt;/h3&gt;
&lt;p&gt;这一年也没少折腾, 写过主题, 也写过插件. 尽管这一切做得并不完美. 但看到有人使用, 夸奖. 我心里还是非常高兴. 也正是这种成就感吧, 一直支持着写下去. &lt;/p&gt;
&lt;p&gt;&lt;span id=&quot;more-209&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;修修改改他人的主题开始厌烦了, 终于放手写了 PhilNa 这个仿微软的主题. 反响不错, 可惜我自己并不喜欢那种风格. 所以放弃了, 一直也没有更新. 也没有时间和精力去更新.&lt;/p&gt;
&lt;p&gt;PhilNa2 是我喜欢的风格. 一个一个的盒子让内容很整齐. 很喜欢几米的漫画, 他的每幅画的旁边总有一句很普通但看上去很富哲理的话. 所以选用了 几米 的漫画作为头部背景. 并附加了 PhilNa say (随机一句话) 这样的小功能.&lt;/p&gt;
&lt;p&gt;插件多是一时的冲动干出来的活. 一直没有管了. 也许实用价值并不大, 大家可以参考参考其中的代码吧.&lt;/p&gt;
&lt;h3&gt;展望&lt;/h3&gt;
&lt;p&gt;也许我会一直走下去, 零零碎碎的写. 这点精力我还是有的吧.&lt;/p&gt;
&lt;h3&gt;总结&lt;/h3&gt;
&lt;p&gt;这一年结交了不少朋友, 也学到了不少东西. 懒得讲废话了. 向所有评论者, 曾经帮助过我的朋友们致谢. &lt;/p&gt;
&lt;p&gt;还要特别感谢 &lt;a href=&quot;http://e9china.net/&quot; title=&quot;亿家互联&quot;&gt;亿家&lt;/a&gt; 提供给我的免费空间. 感谢 &lt;a href=&quot;http://mzsandy.net.ru/&quot; title=&quot;S 哥的博客&quot;&gt;Sandy&lt;/a&gt; 刀刀哥&lt;br /&gt;
&lt;h3&gt;Random Posts&lt;/h3&gt;
&lt;ul class=&quot;related_posts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/10/simple-wordpress-theme-blocks2/&quot; title=&quot;推荐简单朴素的wordpress主题 Blocks2&quot; rel=&quot;bookmark inlinks&quot;&gt;推荐简单朴素的wordpress主题 Blocks2&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 0 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/11/china-firefox-plugins/&quot; title=&quot;中国版火狐插件&quot; rel=&quot;bookmark inlinks&quot;&gt;中国版火狐插件&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 1 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/happy-new-year/&quot; title=&quot;给大家拜个晚年&quot; rel=&quot;bookmark inlinks&quot;&gt;给大家拜个晚年&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 7 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2008/12/js-copyright/&quot; title=&quot;用js适当添加版权信息&quot; rel=&quot;bookmark inlinks&quot;&gt;用js适当添加版权信息&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 14 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/12/prevent-the-direct-post-spam/&quot; title=&quot;阻止直接 POST 过来的 Spam&quot; rel=&quot;bookmark inlinks&quot;&gt;阻止直接 POST 过来的 Spam&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 35 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/02/php-verification-code/&quot; title=&quot;Php图片验证&quot; rel=&quot;bookmark inlinks&quot;&gt;Php图片验证&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 16 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/03/enable-threaded/&quot; title=&quot;嵌套回复否?&quot; rel=&quot;bookmark inlinks&quot;&gt;嵌套回复否?&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 13 )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://philna.com/2009/04/learning-ajax-2/&quot; title=&quot;学习Ajax之XMLHttpRequest对象&quot; rel=&quot;bookmark inlinks&quot;&gt;学习Ajax之XMLHttpRequest对象&lt;/a&gt;&lt;span class=&quot;count&quot;&gt;( 12 )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/BSX-rQAVF_yR0WmT-eB4A8Fcyqw/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/BSX-rQAVF_yR0WmT-eB4A8Fcyqw/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/BSX-rQAVF_yR0WmT-eB4A8Fcyqw/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/BSX-rQAVF_yR0WmT-eB4A8Fcyqw/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=Ipf7-MpHHd4:FkiYXxTktt0:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=Ipf7-MpHHd4:FkiYXxTktt0:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?i=Ipf7-MpHHd4:FkiYXxTktt0:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/philna?a=Ipf7-MpHHd4:FkiYXxTktt0:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/philna?d=qj6IDK7rITs&quot; border=&quot;0&quot;&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/philna/~4/Ipf7-MpHHd4&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/340807696/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807696/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://philna.com/2009/09/happy-anniversary/feed/</wfw:commentRss><slash:comments>37</slash:comments><feedburner:origLink>http://philna.com/2009/09/happy-anniversary/</feedburner:origLink><description>&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PhilNa/340807696/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PhilNa/340807696/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;不知不觉开博一年了, 我先自我祝贺一下.
记不得当时为什么开博, 可能是一时冲动, 和很多人一样. 我也曾在网络上各种地方混过. 但都不尽人意才转向独立博客, 之所以选用 wordpress 作为平台,是因为它用的人多. 方便交流. 也想更深入的学习一下 PHP .
现实
现实生活中的我其实我点自闭. 不善交际, 语言笨拙&amp;#8230; 所以朋友也不多. 大部分&amp;#8217;寂寞&amp;#8217;的时光都是对着屏幕度过的. 但内心却渴望交流, 想要那种愉悦的环境. 可以嘻嘻哈哈谈天说地. 生活可以积极乐观向上&amp;#8230; 这些简单的事情可让我实践起来却非常困难. 网络却给了一个不同的环境. 我开始对它痴迷&amp;#8230;
回顾
这一年也没少折腾, 写过主题, 也写过插件. 尽管这一切做得并不完美. 但看到有人使用, 夸奖. 我心里还是非常高兴. 也正是这种成就感吧, 一直支持着写下去. 

修修改改他人的主题开始厌烦了, 终于放手写了 PhilNa 这个仿微软的主题. 反响不错, 可惜我自己并不喜欢那种风格. 所以放弃了, 一直也没有更新. 也没有时间和精力去更新.
PhilNa2 是我喜欢的风格. 一个一个的盒子让内容很整齐. 很喜欢几米的漫画, 他的每幅画的旁边总有一句很普通但看上去很富哲理的话. 所以选用了 几米 的漫画作为头部背景. 并附加了 PhilNa say (随机一句话) 这样的小功能.
插件多是一时的冲动干出来的活. 一直没有管了. 也许实用价值并不大, [...]&lt;img src=&quot;http://www1.feedsky.com/t1/340807696/PhilNa/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PhilNa/~7957479/340807696/5391790/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Diary</category><pubDate>Sun, 27 Sep 2009 01:00:51 +0800</pubDate><author>yinheli</author><guid isPermaLink="false">http://philna.com/2009/09/happy-anniversary/</guid><dc:creator>yinheli</dc:creator><fs:srclink>http://feedproxy.google.com/~r/philna/~3/Ipf7-MpHHd4/</fs:srclink><fs:srcfeed>http://feeds.feedburner.com/philna</fs:srcfeed><fs:itemid>feedsky/PhilNa/~7957479/340807696/5391790</fs:itemid></item></channel></rss>