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

<channel>
	<title>Becomin&#039; Charles &#187; development</title>
	<atom:link href="http://sexywp.com/tags/development/feed" rel="self" type="application/rss+xml" />
	<link>http://sexywp.com</link>
	<description>Building another myself~~</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:00:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ExtJS 4 的MVC</title>
		<link>http://sexywp.com/extjs-4-mvc.htm</link>
		<comments>http://sexywp.com/extjs-4-mvc.htm#comments</comments>
		<pubDate>Sat, 09 Jul 2011 17:39:44 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[心得体会]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=445</guid>
		<description><![CDATA[ExtJS是我听说了很久的一个js框架了，但是从来就没有用过，读研期间寝室里有个小哥在用，不过那时候醉心于WordPress开发，也懒得理会了。现在公司里，有个上线系统用到了这个框架中的一个TreePanel组件，整个界面上，就正中间扔了一个tree panel，而且不知道什么原因，CSS还有bug，把按钮都搞破了，弄得丑陋不堪，我于是自告奋勇，仔细调试，终于修复了那个显示上的bug，从此算是初次结识了ExtJS。它真正吸引我的原因是，它能够把富客户端应用的开发，从美工和基础交互中解放出来，只需要专注于业务逻辑开发即可，从而让后台工程师也能够有能力快速开发外观专业的网站应用系统。我觉得这真是功德无量的一个事情。（如果我直觉没错，Flex框架也是这一类东西，这也是我对其有兴趣的原因，当然还没有时间尝试）

<span class="readmore"><a href="http://sexywp.com/extjs-4-mvc.htm" title="ExtJS 4 的MVC">Keep Reading --- 1529 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="MVC就是个选择题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC就是个选择题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Style:Contemporary Nouveau for WordPress" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fstyle-contemporary-nouveau.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10641116.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Style:Contemporary Nouveau for WordPress</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="杭州游（二）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flive-in-hangzhou2.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/07/03/15790859.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">杭州游（二）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="魔法奇缘" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fa-mixed-fairy-tail.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/10/05/8619045.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">魔法奇缘</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>ExtJS是我听说了很久的一个js框架了，但是从来就没有用过，读研期间寝室里有个小哥在用，不过那时候醉心于WordPress开发，也懒得理会了。现在公司里，有个上线系统用到了这个框架中的一个TreePanel组件，整个界面上，就正中间扔了一个tree panel，而且不知道什么原因，CSS还有bug，把按钮都搞破了，弄得丑陋不堪，我于是自告奋勇，仔细调试，终于修复了那个显示上的bug，从此算是初次结识了ExtJS。它真正吸引我的原因是，它能够把富客户端应用的开发，从美工和基础交互中解放出来，只需要专注于业务逻辑开发即可，从而让后台工程师也能够有能力快速开发外观专业的网站应用系统。我觉得这真是功德无量的一个事情。（如果我直觉没错，Flex框架也是这一类东西，这也是我对其有兴趣的原因，当然还没有时间尝试）<span id="more-445"></span></p>
<p><a href="https://picasaweb.google.com/lh/photo/6w-l2AcPyxIcU35pqAdwTA?feat=embedwebsite"><img src="https://lh6.googleusercontent.com/-NjYqHh6WjX0/ThiD-8_-xxI/AAAAAAAAB5w/jjqmfY8JrZE/s800/ExtJS%2525E5%2525AF%2525B9%2525E8%2525B1%2525A1%2525E5%252585%2525B3%2525E7%2525B3%2525BB%2525E5%25259B%2525BE.png" height="310" width="499" alt="ExtJS 4 MVC"/></a></p>
<p>据官网介绍，还有据同事<a href="http://www.showframework.com/" target="_blank">ishow</a>的描述，<a href="http://sexywp.com/tags/extjs-2" class="st_tag internal_tag" rel="tag" title="标签 extjs 下的日志">ExtJS</a> 4.x 是一个变化很大的版本，相比已经应用广泛的 3.x 来说，变了很多、新特性也很多，MVC就是它提供的新特性之一。由于我最近半年都在学习MVC模式（主要是使用Yii框架），所以这个名词更是引起了我浓厚的兴趣，这几天都在官网上看这个框架MVC的例子，直到今天，总算是摸着一点门道，于是画了上面那个图。这个四不像的图，是我个人对框架的理解的第一个具体化产物。</p>
<p>下面简单描述一下这个图。</p>
<p>1. 每个应用都有一个实体，就是Application对象实例，而每个应用同样也采用单一入口结构，有个快捷函数就是Ext.application({config})，创建一个Application对象实例，并且运行它；这里行为表现和Yii框架的Application看起来很像，创建一个实例，然后run；</p>
<p>2. Application在创建之初，会去加载Controller类，加载完毕后，会正式的lunch；</p>
<p>3. Application在lunch的时候，会创建一个Viewport对象实例，这个东西就像一个骨架一样，上面可以拼装各种View，具体说，就是各种布局形式和窗体控件，可以说是应用界面的载体；</p>
<p>4. Controller的角色完全是个粘合剂，它在加载之初，会帮忙加载跟其有关的Model，Store，View类，而其真正的作用，是通过一系列的事件处理函数，确定了每个View上面界面组件对用户交互行为的响应方法，可以说是一堆事件处理器函数的集合；这里面主要通过一个control成员函数来进行事件绑定，通过另一个叫ComponentQuery的组件，使用类似css selector的语法来定位界面上的组件，并为其绑定事件处理器；</p>
<p>5. Model是对抽象数据的具体化，或者可以这么理解，就是数据库里面的一行记录，到底是怎么变成一个对象的，将数据库字段变成了对象的属性的对应关系；而这里比Yii框架MVC模型多出来的东西，就是Store这个东西，在Yii框架里面，有强大的ORM系统，还有强大的AR将Model直接连接到了DB上，数据一出来就直接变成了对象，而在ExtJS框架中，代码全在客户端，势必就出现了透过网络来加载数据需要，而我认为，Store就是对通过网络来加载数据的过程的一个抽象，Store依赖于Model，通过关联的Model对象来获知如何将取回的数据对象化，以方便View展现，所以View是依赖Store对象的；（这里岔开一点，感觉这个Store的设计理念或许可以借鉴，由于某些原因，我们在使用PHP框架的时候，不能让Model直接连接DB，是不是也可以把数据取回最终拼接成Model对象的这个过程给抽象化成类似ExtJS中Store的这套机制呢？）</p>
<p>6. View就纯粹是一个界面组件，或者说窗体控件的集合，通过Store来加载数据并且展现到界面上，界面控件的响应都写在Controller里面，View对Controller的存在全无所知，也没有代码上的依赖；</p>
<p>总结一下，感觉这套系统的好处是在于，将View和Model都给抽象了出来，以至于它们可以更加好地被复用，做好一个面板，所有的地方都可以调用，而真正业务逻辑又被很好的封装在了Controller里面，这样也便于去模块化地开发系统，基本感觉上，是一套非常优秀的框架，由于我对ExtJS 3系列版本，没有任何经验，也就没法做出其相对于先前版本是否有质的飞跃的判断，通过仔细的挖掘，我发现其易用性上确实比我原来想象的要好，开发人员可能没太多必要去纠结于内部原理，只要理解到跟我现在差不多的样子，就可以快速上手去做一些东西出来，当然还是必须看着文档按图索骥的，嘿嘿:)</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="MVC就是个选择题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC就是个选择题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="诺丁山" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fnotting-hill.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/21/23797535.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">诺丁山</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Style:Contemporary Nouveau for WordPress" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fstyle-contemporary-nouveau.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10641116.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Style:Contemporary Nouveau for WordPress</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="免费WordPress主题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ffree-wordpress-themes.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10603183.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">免费WordPress主题</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/analytics" title="analytics" rel="tag">analytics</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/extjs-2" title="extjs" rel="tag">extjs</a>, <a href="http://sexywp.com/tags/mvc" title="MVC" rel="tag">MVC</a>, <a href="http://sexywp.com/tags/yii-2" title="yii" rel="tag">yii</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/extjs-4-mvc.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web开发专用IDE：Aptana Studio 3.0</title>
		<link>http://sexywp.com/web-apps-ide-aptana-studio3.htm</link>
		<comments>http://sexywp.com/web-apps-ide-aptana-studio3.htm#comments</comments>
		<pubDate>Tue, 03 May 2011 01:37:02 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=429</guid>
		<description><![CDATA[Aptana Studio是一款专业的、开源的开发环境，主要用于Web应用开发。该开发环境支持最新的浏览器技术HTML5，CSS3，Javascript，除此之外，对服务器端语言Ruby（对RoR貌似有很好的支持），PHP，Python也有很好的支持。

目前能够在Web开发中对HTML，CSS，和JS同时提供编码帮助的IDE环境极其少见，Dreamweaver是我知道的做得比较好的，但是Dreamweaver对语言的支持只做到了静态语法检查和代码高亮，更进一步则无能为力了，只能算是准IDE，毕竟不是真正的IDE环境，NetBeans在这方面有不俗的表现，正是我选用此款IDE的原因。

<span class="readmore"><a href="http://sexywp.com/web-apps-ide-aptana-studio3.htm" title="Web开发专用IDE：Aptana Studio 3.0">Keep Reading --- 497 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Google用于提高网站质量的工具：Page Speed工具集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Aptana Studio是一款专业的、开源的开发环境，主要用于Web应用开发。该开发环境支持最新的浏览器技术HTML5，CSS3，Javascript，除此之外，对服务器端语言Ruby（对RoR貌似有很好的支持），<a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a>，Python也有很好的支持。</p>
<p>目前能够在Web开发中对HTML，CSS，和JS同时提供编码帮助的IDE环境极其少见，Dreamweaver是我知道的做得比较好的，但是Dreamweaver对语言的支持只做到了静态语法检查和代码高亮，更进一步则无能为力了，只能算是准IDE，毕竟不是真正的IDE环境，NetBeans在这方面有不俗的表现，正是我选用此款IDE的原因。</p>
<p>之所以注意到这款IDE，是因为有业内比较资深的工程师提到了这个东西，所以专门了解了一下，这个IDE基于Eclipse框架开发，专门针对Web应用开发领域，尤其强化了对HTML，CSS，JS等语言的支持，对于Server端的语言，选择的也都是专门用于Web开发的语言。本来我对其对PHP开发的支持抱有一定的期待，但是后来听说其将PHP模块从项目中移除，转而投向PDT Project，我就有点失望了，感觉PDT的能力真的只能算一般，不过在不是很了解Aptana的基础上，我还是可以说，那些用普通Eclipse+PDT开发的童鞋，完全可以转头Aptana的怀抱，因为你二者都不会失去，反而可以得到对HTML，CSS，JS的强大支持。使用NetBeans进行Web开发的童鞋，并且平常工作偏重于Server端PHP开发的，可以等待我的进一步体验报告。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Google用于提高网站质量的工具：Page Speed工具集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/ide" title="IDE" rel="tag">IDE</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a>, <a href="http://sexywp.com/tags/tools" title="tools" rel="tag">tools</a>, <a href="http://sexywp.com/tags/web" title="web" rel="tag">web</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/web-apps-ide-aptana-studio3.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google用于提高网站质量的工具：Page Speed工具集</title>
		<link>http://sexywp.com/page-speed-family.htm</link>
		<comments>http://sexywp.com/page-speed-family.htm#comments</comments>
		<pubDate>Mon, 02 May 2011 01:17:01 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[add-ons]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=428</guid>
		<description><![CDATA[应该就是离现在不太远的时候，Google推出了用于提高网页质量的工具集，Page Speed。我最早听说是在若干月前的PHP Classes的news letter上。最近才有时间来仔细看看这个东西。

Page Speed现在的形态是一个工具集，目前提供了客户端和服务器端的两种组件。服务器端提供了Apache服务器的模块mod_pagespeed，该模块可以自动优化网页和资源文件。客户端的工具是一个插件，分别提供了firefox、Chrome的版本，其功能更加类似于Yahoo推出的YSlow，也是真对一个页面进行诊断，给出相应的优化建议，Yahoo提出的东西在业界被称为是14条军规，从Page Speed插件给出的建议来看，基本也没有逃出这14条军规的范畴。除此之外，Google还推出了一个网页版本的Page Speed，只要键入网址，就可以自动分析页面的问题给出建议。

<span class="readmore"><a href="http://sexywp.com/page-speed-family.htm" title="Google用于提高网站质量的工具：Page Speed工具集">Keep Reading --- 308 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Web开发专用IDE：Aptana Studio 3.0" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在WinCE上搭建Web服务" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="解决Flash内容总是漂浮于页面顶层的问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决Flash内容总是漂浮于页面顶层的问题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="为何以及如何整合Google搜索到WP博客" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwhy-and-how-to-integrate-google-to-blog.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9189497.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">为何以及如何整合Google搜索到WP博客</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>应该就是离现在不太远的时候，Google推出了用于提高网页质量的工具集，Page Speed。我最早听说是在若干月前的PHP Classes的news letter上。最近才有时间来仔细看看这个东西。</p>
<p>Page Speed现在的形态是一个工具集，目前提供了客户端和服务器端的两种组件。服务器端提供了Apache服务器的模块mod_pagespeed，该模块可以自动优化网页和资源文件。客户端的工具是一个插件，分别提供了firefox、Chrome的版本，其功能更加类似于Yahoo推出的YSlow，也是真对一个页面进行诊断，给出相应的优化建议，Yahoo提出的东西在业界被称为是14条军规，从Page Speed插件给出的建议来看，基本也没有逃出这14条军规的范畴。除此之外，Google还推出了一个网页版本的Page Speed，只要键入网址，就可以自动分析页面的问题给出建议。</p>
<p>对于没有使用Apache作为Server的，Page Speed还放出了C++ SDK，支持第三方开发。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Web开发专用IDE：Aptana Studio 3.0" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在WinCE上搭建Web服务" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="解决Flash内容总是漂浮于页面顶层的问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决Flash内容总是漂浮于页面顶层的问题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="为何以及如何整合Google搜索到WP博客" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwhy-and-how-to-integrate-google-to-blog.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9189497.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">为何以及如何整合Google搜索到WP博客</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/add-ons" title="add-ons" rel="tag">add-ons</a>, <a href="http://sexywp.com/tags/chrome" title="chrome" rel="tag">chrome</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/google" title="google" rel="tag">google</a>, <a href="http://sexywp.com/tags/tools" title="tools" rel="tag">tools</a>, <a href="http://sexywp.com/tags/web" title="web" rel="tag">web</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/page-speed-family.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVC最佳实践</title>
		<link>http://sexywp.com/mvc-best-practice.htm</link>
		<comments>http://sexywp.com/mvc-best-practice.htm#comments</comments>
		<pubDate>Mon, 07 Mar 2011 09:44:39 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=414</guid>
		<description><![CDATA[前一段日子，写了一篇《MVC就是一个选择题》，重点描述了我对MVC模式的迷惑。随着我对这个模式应用时间的深入，渐渐感到得心应手，这个模式早在30多年前就已经发明了，确实经受了时间的考验，可以说是千锤百炼。但是，实践过程中，我也发现，更多的时候照猫画虎还是有很多弊端的，想要真正做好MVC的选择题，必须在项目中不断犯错误，不断修正，才能逐渐走上正轨。我参加的项目主要运用了Yii框架，是目前比较流行的一个Web开发框架。随着前不久，1.1.6版本的发布，我发现Yii框架的文档中，多了一篇MVC最佳实践的文章。我想，这个文章对于初学者来说，应该具备相当的指导性，而且指导相当具体。如果也有跟我相同的迷茫，应该好好钻研一下这篇文章，并且身体力行去验证之，这里给出链接。我在这篇文章中，就是概括简述一下那篇文档的内容。

<span class="readmore"><a href="http://sexywp.com/mvc-best-practice.htm" title="MVC最佳实践">Keep Reading --- 1394 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC就是个选择题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC就是个选择题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Dedian 5的PHP包缺少readline支持" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>前一段日子，写了一篇《<a href="http://sexywp.com/mvc-chose-where-to-put-your-code.htm">MVC就是一个选择题</a>》，重点描述了我对MVC模式的迷惑。随着我对这个模式应用时间的深入，渐渐感到得心应手，这个模式早在30多年前就已经发明了，确实经受了时间的考验，可以说是千锤百炼。但是，实践过程中，我也发现，更多的时候照猫画虎还是有很多弊端的，想要真正做好MVC的选择题，必须在项目中不断犯错误，不断修正，才能逐渐走上正轨。我参加的项目主要运用了Yii框架，是目前比较流行的一个Web开发框架。随着前不久，1.1.6版本的发布，我发现Yii框架的文档中，多了一篇MVC最佳实践的文章。我想，这个文章对于初学者来说，应该具备相当的指导性，而且指导相当具体。如果也有跟我相同的迷茫，应该好好钻研一下这篇文章，并且身体力行去验证之，<a href="http://www.yiiframework.com/doc/guide/1.1/en/basics.best-practices">这里给出链接</a>。我在这篇文章中，就是概括简述一下那篇文档的内容。<span id="more-414"></span></p>
<p>MVC的核心理念是代码的重用和关注点的分离（Separation of concern 我个人对这个理解就是将数据和表现进行分离）。如何正确遵循MVC的原理来编写代码是有一些基本指导原则可以遵循的。为了便于理解后面将要叙述的指导原则，我们这里认为一个典型的Web应用由以下几个子应用（部分）组成：</p>
<ul>
<li>前端——网站界面，面向普通用户</li>
<li>后台——一部分有管理权限的用户用于维护Web应用的正常运转</li>
<li>控制台——在终端中执行的命令，或者是定时任务如cronjob，用于日常运维</li>
<li>API——用于第三方合作，或者二次开发</li>
</ul>
<h3>Model</h3>
<p>模型用于表示底层数据结构，经常在整个应用的不同部分共享，有些模型在前后台、API中都会用到，所以一个模型应该遵循的指导原则有：</p>
<ul>
<li>包含属性用于描述特定的数据</li>
<li>应该包含业务逻辑，以确保数据能够满足表现的需要</li>
<li>应该包含数据操作的代码，比如数据存储、检索</li>
<li>不应该使用$_GET $_POST这样的只有在前端才会出现的数组，在控制台和API用到时候，可能就无法复用了</li>
<li>不应该出现HTML代码，负责表现的代码应该放到view文件中</li>
</ul>
<p>在上述指导原则下，可能会写出非常庞大的Model类（过多数据操作，业务逻辑代码包含其中）。这种情况下，建议进一步抽象，提炼出一个基类，包含最通用的功能，然后前端、后端和API在用到时候，将各个子应用才相关的逻辑放到基类继承出来的子类里面。</p>
<h3>View</h3>
<p>视图主要就用于前端表现的代码。</p>
<ul>
<li>包含HTML，以及所有负责表现的代码，可以出现PHP，但是只用于遍历数据、格式化数据</li>
<li>不应该包含DB请求</li>
<li>不应该出现引用$_GET $_POST这类数组的代码，这应该是Controller的工作。View只是专注于表现，布局等和页面呈现有关的业务，用户的请求数据应该由Controller和Model负责处理</li>
<li>如果必要，可以访问Model和Controller的属性，不过这是为了满足表现的需要</li>
</ul>
<p>可以使用诸如布局、部分视图、HTML Helper类、Widget等框架特性来最大程度重用View的代码。</p>
<h3>Controller</h3>
<p>控制器是将模型、视图和其他组件组装在一起形成一个应用的粘合剂。控制器直接负责处理终端用户的请求。</p>
<ul>
<li>可以访问$_GET $_POST这样的用户请求数组</li>
<li>创建模型，并决定一个模型对象的生命周期</li>
<li>不应该出现SQL语句，数据库请求应该放到Model中</li>
<li>不应该出现HTML代码，而应该将其放入到View中</li>
</ul>
<p>在一个设计良好的MVC应用中，控制器是非常轻量级的，经常只有几十行代码的样子；而Model总是非常复杂而且庞大，包含了所有的用于表现的数据及其操作方法。这是因为由数据结构和业务逻辑组成的模型对每个应用来说，都是独特的，需要大量的定制化工作来满足应用的需求；控制器的逻辑经常遵循一个特定的套路，在各个应用中都差不多，因此可以被框架底层代码极大程度地简化（也就是说不是控制器代码少，而是Web开发框架已经都抽象出来并且都帮你做好了，这也就是框架的价值和能够实现快速开发的原因）。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC就是个选择题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC就是个选择题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Dedian 5的PHP包缺少readline支持" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/mvc" title="MVC" rel="tag">MVC</a>, <a href="http://sexywp.com/tags/programming" title="programming" rel="tag">programming</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/mvc-best-practice.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>［插件开发］获知文章状态变化</title>
		<link>http://sexywp.com/get-updated-when-post-status-changed.htm</link>
		<comments>http://sexywp.com/get-updated-when-post-status-changed.htm#comments</comments>
		<pubDate>Fri, 31 Dec 2010 18:23:47 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Plugins Develop]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[action]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=413</guid>
		<description><![CDATA[文章（post）是 WordPress 博客的核心价值所在，围绕一篇文章的增、删、改，我们可以开发很多有用的插件。近来，由于维护一款插件的需要，我碰巧研究了一下围绕文章发布流程而设立的一些钩子（hook）。微有所得，记录备查。

事情的起因是插件中的一个函数hook到了一个action上，名字是publish_post，顾名思义，在文章发布时候被激发的。为了要更清楚地掌控这个action，我想在源代码中，把触发点给找出来，这一找，问题来了。理论上，我们hook任何action，WP内部都会有对应的do_action来激发这个钩子，这一次，一搜，根本没有publish_post，那就有点小麻烦，说明具体激发哪个钩子，是运行时决定的，再明白点说吧，这个action的名字，应该使用变量拼出来的，所以我们直接搜publish_post很难找到调用点。

<span class="readmore"><a href="http://sexywp.com/get-updated-when-post-status-changed.htm" title="［插件开发］获知文章状态变化">Keep Reading --- 934 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>文章（post）是 <a href="http://sexywp.com/tags/wordpress" class="st_tag internal_tag" rel="tag" title="标签 WordPress 下的日志">WordPress</a> 博客的核心价值所在，围绕一篇文章的增、删、改，我们可以开发很多有用的插件。近来，由于维护一款插件的需要，我碰巧研究了一下围绕文章发布流程而设立的一些钩子（hook）。微有所得，记录备查。<span id="more-413"></span></p>
<p>事情的起因是插件中的一个函数hook到了一个action上，名字是publish_post，顾名思义，在文章发布时候被激发的。为了要更清楚地掌控这个action，我想在源代码中，把触发点给找出来，这一找，问题来了。理论上，我们hook任何action，WP内部都会有对应的do_action来激发这个钩子，这一次，一搜，根本没有publish_post，那就有点小麻烦，说明具体激发哪个钩子，是运行时决定的，再明白点说吧，这个action的名字，应该使用变量拼出来的，所以我们直接搜publish_post很难找到调用点。</p>
<p>具体寻找的过程，我也不想赘述了，无非是查文档，搜代码。这里想要一提的是，我发现一个新的小技巧，给技巧取个名字叫“农村包围城市”，因为一下无法定位到想要找的代码，那么能准确定位其周边代码也是可以的，至少可以缩小查找范围。从文档中我们看到，在publish_post被激发的点附近，应该还有save_post，那么搜一下save_post，乖乖，准确找到了，然后就看到还有wp_insert_post，pre_post_update等等。然后，马上写一个小插件，向4个感兴趣的点hook，然后随便发布一下文章，根据打出的log，基本确定了publish_post就在pre_post_update和save_post中间激发。这时候就剩下80行左右的范围了，那一行行找还是很快的。</p>
<p>最终结果还是比较有意思的，有个函数叫<strong>wp_transition_post_status</strong>，这里面提供了3个hook，也可以说n个吧，因为这里面就看到了那个运行时才决定的hook名称的代码。最后不但搞清楚了publish_post的激发原理，还发现了原来可以随意通过hook监测每篇文章的状态变化。虽然短期内看不出来有啥用，但是以后一定可以想出来一些应用的。</p>
<ul>
<li><strong>transition_post_status</strong> 当一篇文章或者页面状态变化时触发，三个参数，分别是原状态，现在状态，文章对象本身</li>
<li><strong>状态_to_状态</strong> 某个具体的状态流转时候触发，可以是draft_to_pending，private_to_publish等等，只要是合法的status取值，可以随意组合。一个参数是文章对象本身。</li>
<li><strong>状态_类型</strong> 一个状态+一个类型，可以知道publish_post这个钩子，本质上就是这种，真实含义是有一篇类型是post（还可以是page）的文章，状态变成了publish，而不是已开始我理解成的发布一篇文章时候激发。说起来差别不大，但是你对其的理解已经完全变掉了。以此类推，你可以hook到private_post，还可以是draft_page等等。随意组合。</li>
</ul>
<p>通过上述非常灵活的3种钩子，我们就可以随时掌控任何文章的状态变化了。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fget-updated-when-post-status-changed.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/action" title="action" rel="tag">action</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/hooks" title="hooks" rel="tag">hooks</a>, <a href="http://sexywp.com/tags/plugins" title="plugins" rel="tag">plugins</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/get-updated-when-post-status-changed.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>使用FirePHP辅助AJAX应用开发</title>
		<link>http://sexywp.com/use-firephp-in-ajax-development.htm</link>
		<comments>http://sexywp.com/use-firephp-in-ajax-development.htm#comments</comments>
		<pubDate>Mon, 25 Oct 2010 08:56:00 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[develop]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=387</guid>
		<description><![CDATA[FirePHP 一款非常方便强大的PHP、AJAX调试工具，基于Firebug的框架开发，可以算是Firebug的插件。该插件帮助用户将PHP的调试信息展示在Firebug的控制台标签内，而不是直接打印到页面上，这样就避免了在调试页面时破坏了页面的DOM结构。

FirePHP的调试信息主要通过HTTP的Response Headers来发送，所以不会和HTTP的包体混在一起，极大程度地方便了AJAX应用的开发调试，是AJAX开发调试的利器。

全文下载链接

<span class="readmore"><a href="http://sexywp.com/use-firephp-in-ajax-development.htm" title="使用FirePHP辅助AJAX应用开发">Keep Reading --- 168 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="怎样增加AJAX的可靠性呢？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-ajax-correctly.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">怎样增加AJAX的可靠性呢？</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>FirePHP 一款非常方便强大的PHP、AJAX调试工具，基于Firebug的框架开发，可以算是Firebug的插件。该插件帮助用户将PHP的调试信息展示在Firebug的控制台标签内，而不是直接打印到页面上，这样就避免了在调试页面时破坏了页面的DOM结构。</p>
<p>FirePHP的调试信息主要通过HTTP的Response Headers来发送，所以不会和HTTP的包体混在一起，极大程度地方便了AJAX应用的开发调试，是AJAX开发调试的利器。</p>
<p><a href="http://download.csdn.net/source/2819249" target="_blank">全文下载链接</a><br />
<a href="http://wenku.baidu.com/view/04f50d2ce2bd960590c6771f.html" target="_blank">百度文库在线阅读</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="怎样增加AJAX的可靠性呢？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-ajax-correctly.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">怎样增加AJAX的可靠性呢？</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://sexywp.com/tags/develop" title="develop" rel="tag">develop</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/use-firephp-in-ajax-development.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在插件管理页面给你的插件添加“设置”链接</title>
		<link>http://sexywp.com/add-settings-link-to-ur-plugin.htm</link>
		<comments>http://sexywp.com/add-settings-link-to-ur-plugin.htm#comments</comments>
		<pubDate>Mon, 27 Sep 2010 13:53:31 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Plugins Develop]]></category>
		<category><![CDATA[code examples]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=383</guid>
		<description><![CDATA[在插件管理页面，每个插件下面有2-3个Action link，包含了用户可以对该插件进行的几种操作。在插件为禁用状态时，可用的操作有：Activate（启用），Edit（编辑），Delete（删除）；在插件为已经启用的状态下，默认有两个可用的操作：Deactivate（禁用）和Edit（编辑）。如果我们在这个列表里仔细观察，就会发现，有些插件会多出一个Settings（设置）操作。本文记录了，为插件添加Settings link的方法。没有什么过多的描述，直接放代码了。在插件主要文件中（包含了插件信息注释语句的那个文件），使用下面的代码，就可以为这个插件添加一个Settings link了。

<span class="readmore"><a href="http://sexywp.com/add-settings-link-to-ur-plugin.htm" title="在插件管理页面给你的插件添加“设置”链接">Keep Reading --- 264 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（12）---发布并推广你的WordPress插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-12.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（12）---发布并推广你的WordPress插件</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在插件管理页面，每个插件下面有2-3个Action link，包含了用户可以对该插件进行的几种操作。在插件为禁用状态时，可用的操作有：Activate（启用），Edit（编辑），Delete（删除）；在插件为已经启用的状态下，默认有两个可用的操作：Deactivate（禁用）和Edit（编辑）。如果我们在这个列表里仔细观察，就会发现，有些插件会多出一个Settings（设置）操作。本文记录了，为插件添加Settings link的方法。没有什么过多的描述，直接放代码了。在插件主要文件中（包含了插件信息注释语句的那个文件），使用下面的代码，就可以为这个插件添加一个Settings link了。</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">fmp_add_setting_link</span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: #00008b;">$links</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$links</span><span style="color: Olive;">[</span><span style="color: Olive;">]</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;a href=&quot;#&quot;&gt;Settings&lt;/a&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">怎样构造这个link呢？大家可以自己想想</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">return</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$links</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Blue;">is_admin</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">add_filter</span><span style="color: Olive;">(</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">plugin_action_links_</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: Blue;">plugin_basename</span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: Green;">__FILE__</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">fmp_add_setting_link</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（12）---发布并推广你的WordPress插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-12.htm&from=http%3A%2F%2Fsexywp.com%2Fadd-settings-link-to-ur-plugin.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（12）---发布并推广你的WordPress插件</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/code-examples" title="code examples" rel="tag">code examples</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/diy" title="DIY" rel="tag">DIY</a>, <a href="http://sexywp.com/tags/plugins" title="plugins" rel="tag">plugins</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/add-settings-link-to-ur-plugin.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决Flash内容总是漂浮于页面顶层的问题</title>
		<link>http://sexywp.com/flash-float-on-topest-layer.htm</link>
		<comments>http://sexywp.com/flash-float-on-topest-layer.htm#comments</comments>
		<pubDate>Wed, 03 Jun 2009 13:54:27 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://sexywp.com/flash-float-on-topest-layer.htm</guid>
		<description><![CDATA[已经有两个网友向我反应了Flash MP3 Player无法和lightbox之类插件兼容的问题，其症状为，当打开lightbox效果的图片时，flash movie会漂浮在整个页面的最顶层，破坏了lightbox的效果。

今天做了一点小小的调查，原来浏览器渲染嵌入页面的内容如flash movie或Java applet时，默认将它们放置于页面的最上层，忽略其z-index属性。所以，像lightbox这类插件，靠设置覆盖层的z-index属性来营造高亮效果的js脚本，基本无法做到覆盖掉页面上的flash movie。

<span class="readmore"><a href="http://sexywp.com/flash-float-on-topest-layer.htm" title="解决Flash内容总是漂浮于页面顶层的问题">Keep Reading --- 828 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwe-should-care-more-about-ieer.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">我们应该更关心IE的用户</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Google用于提高网站质量的工具：Page Speed工具集</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>已经有两个网友向我反应了Flash MP3 Player无法和lightbox之类插件兼容的问题，其症状为，当打开lightbox效果的图片时，flash movie会漂浮在整个页面的最顶层，破坏了lightbox的效果。</p>
<p>今天做了一点小小的调查，原来浏览器渲染嵌入页面的内容如flash movie或Java applet时，默认将它们放置于页面的最上层，忽略其z-index属性。所以，像lightbox这类插件，靠设置覆盖层的z-index属性来营造高亮效果的js脚本，基本无法做到覆盖掉页面上的flash movie。</p>
<p> <span id="more-348"></span>
</p>
<p>Adobe公司给出了对于类似问题的解决办法，就是设置flash movie的wmode属性。</p>
<p>这个属性用于控制Flash 的窗口模式，其有三个取值：</p>
<blockquote><p><strong>window 模式</strong></p>
<p>默认情况下的显示模式，在这种模式下flash player有自己的窗口句柄，这就意味着flash影片是存在于Windows中的一个显示实例，并且是在浏览器核心显示窗口之上的，所以flash只是貌似显示在浏览器中，但这也是flash最快最有效率的渲染模式。由于他是独立于浏览器的HTML渲染表面，这就导致默认显示方式下flash总是会遮住位置与他重合的所有DHTML层。</p>
<p>但是大多数苹果电脑浏览器会允许DHTML层显示在flash之上，但当flash影片播放时会出现比较诡异的现象，比如DHTML层像被flash刮掉一块一样显示异常。</p>
<p><strong>Opaque 模式</strong></p>
<p>这是一种无窗口模式，在这种情况下flash player没有自己的窗口句柄，这就需要浏览器需要告诉flash player在浏览器的渲染表面绘制的时间和位置。这时flash影片就不会在高于浏览器HTML渲染表面而是与其他元素一样在同一个页面上,因此你就可以使用z-index值来控制DHTML元素是遮盖flash或者被遮盖。</p>
<p><strong>Transparent 模式</strong></p>
<p>透明模式，在这种模式下flash player会将stage的背景色alpha值将为0并且只会绘制stage上真实可见的对象，同样你也可以使用z-index来控制flash影片的深度值，但是与Opaque模式不同的是这样做会降低flash影片的回放效果，而且在9.0.115之前的flash player版本设置wmode=”opaque”或”transparent”会导致全屏模式失效。</p>
<p>了解了各种模式的实现方式和意义在以后的开发中就可以按照具体情况选择设置wmode属性的值了。</p>
</blockquote>
<p>我的插件之所以出现问题，就是因为我把wmode的值设定为了window，当然，这也是默认的值。从三种属性值的具体含义中，我们可以知道，无论是将wmode设定为opaque或者transparent，都可以解决问题，不过网上搜出来的结果，普遍只说了设成transparent这种，并且普遍不讲理由为何。</p>
<p>参考资料：</p>
<p><a href="http://www.blueidea.com/tech/web/2009/6469.asp">flash wmode 参数详解</a> </p>
<p><a href="http://kb2.adobe.com/cps/155/tn_15523.html">Flash content displays on top of all DHTML layers</a></p>
<p><a href="http://kb2.adobe.com/cps/142/tn_14201.html">How to make a Flash movie with a transparent background</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwe-should-care-more-about-ieer.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">我们应该更关心IE的用户</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm&from=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Google用于提高网站质量的工具：Page Speed工具集</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/web-design" title="web design" rel="tag">web design</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/flash-float-on-topest-layer.htm/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>如何才能按需加载脚本？</title>
		<link>http://sexywp.com/how-to-include-script-file-on-demand.htm</link>
		<comments>http://sexywp.com/how-to-include-script-file-on-demand.htm#comments</comments>
		<pubDate>Sun, 26 Apr 2009 14:35:12 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Plugins Develop]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://sexywp.com/%e5%a6%82%e4%bd%95%e6%89%8d%e8%83%bd%e6%8c%89%e9%9c%80%e5%8a%a0%e8%bd%bd%e8%84%9a%e6%9c%ac%ef%bc%9f.htm</guid>
		<description><![CDATA[本文提出问题，并不解决问题。

我在研究Extended Live Archive（ELA）插件的代码，发现一个问题，这个问题具有一定的共性，而且，我现在也没有什么好的解决办法，所以我把它描述一下，看看有没有高人高见。

 

<span class="readmore"><a href="http://sexywp.com/how-to-include-script-file-on-demand.htm" title="如何才能按需加载脚本？">Keep Reading --- 1119 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>本文提出问题，并不解决问题。</p>
<p>我在研究Extended Live Archive（ELA）插件的代码，发现一个问题，这个问题具有一定的共性，而且，我现在也没有什么好的解决办法，所以我把它描述一下，看看有没有高人高见。</p>
<p> <span id="more-343"></span>
<p>WP插件一般目标有两个，一个是增强博客页面功能，让观众有更好体验，另一个是增强博客管理页面功能，让博客管理者有更高管理效率。无论是哪一种，我们都经常会用到脚本，比如指定样式的CSS脚本，指定行为的JS脚本。好，现在问题来了，一般来说，我们使用插件增强的功能，都是在某个特定的页面上的功能，只有少数才是全局功能，直觉上，我们希望，在这个特定的页面上引入需要的脚本，而在其他的页面上不引入这段脚本。</p>
<p>我这个话说得有点绕，举个具体的例子。比如，某个插件，用于显示一个漂亮的相册，这个相册有一个自己专属的相册页面，这个相册的翻页功能需要用到prototype类库，你作为一个博客的主人，肯定是希望只有用户打开相册页面时，用户才需要下载prototype，平时看你的博客，不用每个页面都去下载一下prototype。（这个类库在没有pack的情况下128k大。）</p>
<p>希望我说清楚，这个问题概括成一句话，就是按需加载脚本，用到时，才下载。</p>
<p>事实上是这样的，我说得很轻巧，但是做起来却很难。就拿我手头的这个ELA来说事，这个插件是一个AJAX应用，用来展示一个结构化的归档目录。插件通过一个template tag提供用户接口，在调用这个template tag的页面，就会有归档目录出现。这个归档目录，必须要CSS文件来指定其样式，结果，我们的难点是，不知道用户会在哪个页面上调用这个tag，所以只能草草地把这个样式表hook到wp_head，导致的结果是，所有的页面上，都会链入这么一个样式表，而真正起作用的，只有一个页面而已。</p>
<p>我初步想了想，几乎想不出漂亮的办法能解决这个问题。这个问题的根本就在于，程序在执行到wp_head的时候，我们还没法知道后续的部分是不是会出现那个tag，而在真的执行到这个tag的时候，头部的内容已经形成了，我们回天乏力。一个直觉的办法，就是把那个样式表，直接也塞到tag的内部，事实上，插件的作者就是这么做的，不过，他只是把用到的JS脚本这么处理了，却没有把CSS这么处理，我猜想他代码写到这里的时候，可能内心也是非常矛盾的。（因为一个优秀的页面，就应该是数据、表现、行为分离的，这么做等于破坏了这个原则了）</p>
<p>好，到这里，问题应该算是说完了。其实这个问题相当普遍，只要我们需要将一个脚本添加到wp_head或者admin_head（对应的还有各自的footer部分），我们就面临着这个问题，你添加的东西，真的每个页面都需要么？如果是大多数页面需要，那还不是很浪费，最浪费的就是只有一个页面需要，而其他所有的页面都跟着增加负载。</p>
<p>WP的圈子里，有一种论调，就是插件用得越多，博客速度越慢，性能越差。我想，脚本没有能够做到按需加载，也算是造成这个论调的原因之一。</p>
<p>大家一起开动下脑筋吧~</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-include-script-file-on-demand.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/plugins" title="plugins" rel="tag">plugins</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/how-to-include-script-file-on-demand.htm/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WordPress插件：选项查看器</title>
		<link>http://sexywp.com/plugin-options-inspector.htm</link>
		<comments>http://sexywp.com/plugin-options-inspector.htm#comments</comments>
		<pubDate>Wed, 08 Apr 2009 08:20:47 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[my works]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://sexywp.com/plugin-options-inspector.htm</guid>
		<description><![CDATA[选项查看器是一款能够查看WordPress选项的工具，使用它，你可以浏览每个存储到数据库的选项的值，串行化的数据会恢复其原貌，此外，您可以使用PHP语句来微调选项的值。这是一款开发调试辅助工具。Options Inspector is a tool with which you can list out all the options in your database, view a certain one in detail, and alter exactly a certain part of option value. It is mainly designed for plugin developers and theme designers.<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Options Inspector is a tool with which you can list all the options in your database, view a certain one in detail, even its data is serialized, and alter exactly a certain part of option value. It is mainly designed for plugin developers and theme designers.</p>
<p> <span id="more-335"></span>
</p>
<p>When I am debugging a plugin, I always want to konw, whether the options in this plugin are saved exactly or not. Usually, I add var_dump statement in my source code to print the options out. Everything looks good, but when I finished my job, it bothered me a lot to remove this <a href="http://sexywp.com/tags/debug" class="st_tag internal_tag" rel="tag" title="标签 debug 下的日志">debug</a> statements. What annoyed me even more is that when I change my mind and changed the structure of the option, I must use additional statement to alter the option or directly use SQL in phpMyAdmin. Finally, I created this tool to assist the plugin <a href="http://sexywp.com/tags/development" class="st_tag internal_tag" rel="tag" title="标签 development 下的日志">development</a>.</p>
<p><strong>Features</strong>:</p>
<ul>
<li>List all options order by option_id.</li>
<li>Search option through keyword.</li>
<li>View unsierialized value of options.</li>
<li>Modify option use <a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a> code.</li>
</ul>
<p><strong>Demo</strong>: (Click to see the full size.)</p>
<p><a href="http://picasaweb.google.com/lh/photo/YrsYFnG7FbRWZUArgNwFOw?feat=embedwebsite"><img src="http://lh5.ggpht.com/_QYicOeu89Bk/SdxZnJK0e8I/AAAAAAAABTc/QNlqGHvAGGs/s400/Options-Inspector-Screenshot.png" /></a></p>
<p><strong>Download</strong>: <a href="http://wordpress-tools-box.googlecode.com/files/options-inspector_v1.0.1.zip" target="_blank">Options Inspector v1.0.1</a></p>
<p>选项查看器是一款开发辅助工具，用于显示，修改和删除选项。免去了使用打印语句和使用phpMyAdmin的调试后台选项的麻烦。愿大家能够更轻松地开发WordPress插件和主题。</p>
<p>一般，不建议您在您的主力博客上尝试该插件的修改和删除功能。</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHNwYJKoZIhvcNAQcEoIIHKDCCByQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYB2EQv1+Soj5NuujXdg/QZIJQFfTlpI4CrvIpXMrkKBUhuGpJq/KexrQLkDnw45I1d2AWVq6l7uL9uRXcCbDpHGBniU0D2rzdRyDEOTMFc3+yYXX/uv2RE4rFzMxoIWuZBw5W5SXNRFpJAmKbFmrSK3UUicBCZklAj1DrYFPQVnPDELMAkGBSsOAwIaBQAwgbQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIVk6DhKRNuNKAgZA4swjsh6HombF5EuT3QaCFPWvOtvT/FW6A/Pz7vfpx5D61OyR8XTkEf5y2go/iNUPXA2bsEhU2CwpwSZoTK38QFtv1RZsZk980lo0MGAbzd/eFko/zDE1Yq6JSJtgdTWQr1Rebd1/8cOfORXi7ijDlsMf3MpXTIWghhVVSsvPVOQdFq3CkUU2DkShWuxCI8segggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMFHTt38RMxLXJyO2SmS+Ndl72T7oKJ4u4uw+6awntALWh03PewmIJuzbALScsTS4sZoS1fKciBGoh11gIfHzylvkdNe/hJl66/RGqrj5rFb08sAABNTzDTiqqNpJeBsYs/c2aiGozptX2RlnBktH+SUNpAajW724Nv2Wvhif6sFAgMBAAGjge4wgeswHQYDVR0OBBYEFJaffLvGbxe9WT9S1wob7BDWZJRrMIG7BgNVHSMEgbMwgbCAFJaffLvGbxe9WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wOTAzMjQyMDQ1NDZaMCMGCSqGSIb3DQEJBDEWBBQ3cx3dDHdv7A/xMHsq+rw48zXFyzANBgkqhkiG9w0BAQEFAASBgFZCHyUMzqEn5brB/9GbvZMeMIbAVdOvZOuBO9pRTc+NCgXT0EIDgHlGNPZgES9aWbrNDTgWeACMKItOCX/9eKMXcrnj+wOh6+8eoBUdQY0hKw4GrcSkpFvNnKLByUv8q4iY0PpCWIzZ8S+ckANkg92HLykSbe2sI2p60bLbBd0+-----END PKCS7-----">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
            <img alt="" border="0" src="https://www.paypal.com/zh_XC/i/scr/pixel.gif" width="1" height="1"><br />
        </form>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/my-works" title="my works" rel="tag">my works</a>, <a href="http://sexywp.com/tags/plugins" title="plugins" rel="tag">plugins</a>, <a href="http://sexywp.com/tags/tools" title="tools" rel="tag">tools</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/plugin-options-inspector.htm/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[WP开发环境]在NetBeans中配置FTP</title>
		<link>http://sexywp.com/use-ftp-in-netbeans.htm</link>
		<comments>http://sexywp.com/use-ftp-in-netbeans.htm#comments</comments>
		<pubDate>Sun, 29 Mar 2009 12:23:26 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Plugins Develop]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[enviornment]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=331</guid>
		<description><![CDATA[本文介绍了如何在NetBeans IDE 6.5.1 for PHP中配置FTP，以搭建一个便捷的WordPress 主题、插件开发环境。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">建立WordPress测试环境</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">WordPress 开发资源</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-05.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">插件开发全攻略（05）---WordPress 插件Actions</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-07.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">插件开发全攻略（07）---构造一个WordPress插件管理员面板</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>本文介绍了如何在NetBeans <a href="http://sexywp.com/tags/ide" class="st_tag internal_tag" rel="tag" title="标签 IDE 下的日志">IDE</a> 6.5.1 for PHP中配置FTP，以搭建一个便捷的WordPress 主题、插件开发环境。<span id="more-331"></span></p>
<p><a href="http://sexywp.com/tags/netbeans" class="st_tag internal_tag" rel="tag" title="标签 NetBeans 下的日志">NetBeans</a> IDE是一款非常优秀的IDE环境，我以前曾经介绍过，如何使用NetBeans作为WP的开发环境，今天，再来介绍一个直接链接远程服务器进行调试的技巧。那就是FTP，记得在Dreamweaver的时代，配置远程服务器就是非常方便的一件事情，对于NetBeans这个更加现代和超前的开发环境来说，这当然也是必备功能了。</p>
<p>跟着我做，只有3个步骤，就可以搞定。上一篇《<a href="http://sexywp.com/use-netbeans-to-develop-wp.htm">使用NetBeans作为WordPress开发环境</a>》已经介绍了如何将WP导入到NetBeans工程，在其基础上，我们来配置FTP。</p>
<p><img src="http://lh3.ggpht.com/_QYicOeu89Bk/Sc9is7kMwkI/AAAAAAAABSg/ovY4do-aGo8/s400/NetBeans-FTP-1.GIF" /></p>
<p>第一个步骤如上图，在项目面板，wp27项目上，单击右键，点属性，打开属性面板。下图为弹出的对话框。<strong>点击查看清晰大图</strong>。</p>
<p><a href="http://picasaweb.google.com/lh/photo/nw0KeRfVIghfDf5O-IVkeA?feat=embedwebsite"><img src="http://lh4.ggpht.com/_QYicOeu89Bk/Sc9itA24sKI/AAAAAAAABSo/MxKgE6-IJUA/s400/NetBeans-FTP-2.GIF" /></a></p>
<p>遵循上图中蓝色字迹标注的1、2两次点击，会弹出FTP服务器管理面板，创建好一个FTP服务器配置。确定后，回到属性面板。如下图所示。</p>
<p><a href="http://picasaweb.google.com/lh/photo/zsl6iDjIoO_NIuXgliKuyA?feat=embedwebsite"><img src="http://lh5.ggpht.com/_QYicOeu89Bk/Sc9itPHRg-I/AAAAAAAABSw/d-GrRy5bvpE/s400/NetBeans-FTP-3.GIF" /></a></p>
<p>在上图中，我们配置运行配置为在远程Web站点运行。配置的选项可以参考图片中的配置。注意，刚才我们配置ftp服务器的时候，远端路径为wp安装目录，现在我们本地的目录只要填写一个/即可，代表项目根目录。</p>
<p>上面三个步骤，已经配置好了FTP服务器。在具体开发过程中，像下图的样子，点击你开发的主题中的文件，点击上传，就会自动上传到正确的地方，覆盖源文件。一般我在用NetBeans开发主题或者插件的过程中，都配合有SVN支持，所以不用担心覆盖会出问题，可以恢复到上一个版本。</p>
<p><a href="http://picasaweb.google.com/lh/photo/2FfuoL0acgnnL_hotEYPig?feat=embedwebsite"><img src="http://lh4.ggpht.com/_QYicOeu89Bk/Sc9itVtT2nI/AAAAAAAABS4/CYhbma6hAao/s400/NetBeans-FTP-4.GIF" /></a></p>
<p>好，希望对您有帮助~~</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">建立WordPress测试环境</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">WordPress 开发资源</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-05.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">插件开发全攻略（05）---WordPress 插件Actions</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-07.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">插件开发全攻略（07）---构造一个WordPress插件管理员面板</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/enviornment" title="enviornment" rel="tag">enviornment</a>, <a href="http://sexywp.com/tags/guide" title="guide" rel="tag">guide</a>, <a href="http://sexywp.com/tags/ide" title="IDE" rel="tag">IDE</a>, <a href="http://sexywp.com/tags/netbeans" title="NetBeans" rel="tag">NetBeans</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/use-ftp-in-netbeans.htm/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>建立WordPress测试环境</title>
		<link>http://sexywp.com/build-wp-test-env.htm</link>
		<comments>http://sexywp.com/build-wp-test-env.htm#comments</comments>
		<pubDate>Wed, 25 Mar 2009 06:07:25 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[enviornment]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=328</guid>
		<description><![CDATA[本文记录了建立WordPress测试环境的一种实践。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[WP开发环境]在NetBeans中配置FTP" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[WP开发环境]在NetBeans中配置FTP</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>下载各个版本的WordPress:</p>
<p>wp2.5.1——http://<a href="http://sexywp.com/tags/wordpress" class="st_tag internal_tag" rel="tag" title="标签 WordPress 下的日志">wordpress</a>.org/<a href="http://sexywp.com/tags/wordpress" class="st_tag internal_tag" rel="tag" title="标签 WordPress 下的日志">wordpress</a>-2.5.1.zip<br />
wp2.6.3——http://wordpress.org/wordpress-2.6.3.zip<br />
当前版本——http://wordpress.org/latest.zip</p>
<p>其他版本依此类推。</p>
<p>建立磁盘目录：</p>
<p>www<br />
|—phpMyAdmin<br />
|—wp25<br />
|—wp26<br />
|—wp27<br />
|—<a href="http://sexywp.com/tags/plugins" class="st_tag internal_tag" rel="tag" title="标签 plugins 下的日志">plugins</a></p>
<p>我就是按照上面的样子建立的。plugins用来统一存放插件。（如果是xampp的话，根目录是htdocs，phpMyAdmin已经安装好了。）</p>
<p>建立测试数据库。三个wp使用同一个数据库。</p>
<p>配置wp-config.<a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a></p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">wp263和wp271添加如下两行</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">define</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">WP_PLUGIN_DIR</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: Blue;">dirname</span><span style="color: Olive;">(</span><span style="color: Blue;">dirname</span><span style="color: Olive;">(</span><span style="color: Green;">__FILE__</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">/plugins</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">define</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">WP_PLUGIN_URL</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">http://localhost/plugins</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">三个版本都要最后两行</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">define</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">WP_DEBUG</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: Green;">true</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">define</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">PLUGINDIR</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">../plugins</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<p>关闭老版本WP的升级提示：</p>
<p>找到wp-includes/update.php</p>
<p>//add_<a href="http://sexywp.com/tags/action" class="st_tag internal_tag" rel="tag" title="标签 action 下的日志">action</a>( 'init', 'wp_version_check' );</p>
<p>像上面那样注释掉上面那行字。</p>
<p>在plugins目录下，安装ozh的no-login插件。</p>
<p>现在这套测试环境，我自己使用下来感觉是WP 2.5的支持很不好。很多插件走不通。主要就是路径的问题。WP2.6和WP2.7的问题不大。但是如果插件需要引用wp_blog_head.php或者wp-config.php，在这样的环境下无法正常运行，我想这其实也是插件开发者的疏漏吧。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[WP开发环境]在NetBeans中配置FTP" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[WP开发环境]在NetBeans中配置FTP</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-wp-test-env.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/enviornment" title="enviornment" rel="tag">enviornment</a>, <a href="http://sexywp.com/tags/guide" title="guide" rel="tag">guide</a>, <a href="http://sexywp.com/tags/test" title="test" rel="tag">test</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/build-wp-test-env.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress 开发资源</title>
		<link>http://sexywp.com/wordpress-developer-resource.htm</link>
		<comments>http://sexywp.com/wordpress-developer-resource.htm#comments</comments>
		<pubDate>Mon, 09 Mar 2009 12:59:05 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Plugins Develop]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[interesting things]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=323</guid>
		<description><![CDATA[今天刚看到几个WordPress开发资源，觉得很不错~在这里记录一下。

WordPress phpDoc

WordPress内部使用phpDoc的语法进行注释，这是WordPress.org为其生成的文档。

<span class="readmore"><a href="http://sexywp.com/wordpress-developer-resource.htm" title="WordPress 开发资源">Keep Reading --- 166 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天刚看到几个WordPress开发资源，觉得很不错~在这里记录一下。<span id="more-323"></span></p>
<p><strong><a href="http://phpdoc.wordpress.org/">WordPress phpDoc</a></strong></p>
<p>WordPress内部使用phpDoc的语法进行注释，这是WordPress.org为其生成的文档。</p>
<p><strong><a href="http://wplookup.com/">WP 函数搜索引擎</a></strong></p>
<p>超级棒的一个功能~ 看看下文的说明。</p>
<blockquote><p>
I want to quickly let everyone here know of a site that one of my good<br />
friends, Andy Stratton (http://theandystratton.com), has setup<br />
recently.  The site is called WPLookup and can be found at<br />
http://wplookup.com/.  It provides a simple search box for quick<br />
lookups of <a href="http://sexywp.com/tags/wordpress" class="st_tag internal_tag" rel="tag" title="标签 WordPress 下的日志">WordPress</a> functions and template tags.  If the appropriate<br />
codex page exists for the function you are looking for it will<br />
immediately redirect you there.  If it does not exist you will be<br />
directed to a documentation search on http://wordpress.org/search<br />
which will contain a list of results for you.</p>
<p>To make it even better the site can also integrate into your browsers<br />
search bar keeping you from ever having to actually navigate to the<br />
WPLookup site to do the search.</p>
<p>I have taken his service one step further and integrated his service<br />
into an IRC bot.  The bot is sitting in #wordpress on freenode.  To<br />
use the bot type something in the form of `.codex get_pages`.</p>
<p>Now what are you waiting for?  Check it out now at http://wplookup.com/.</p>
<p>Enjoy!<br />
--<br />
Matt Martz<br />
matt@sivel.net
</p></blockquote>
<p><strong><a href="http://xref.fergcorp.com/">WordPress源代码交叉引用</a></strong></p>
<p>WordPress各个版本的源代码交叉引用。</p>
<p><a href="http://pressography.com/plugins/wordpress-plugin-template/">WordPress插件开发模板</a></p>
<p>尝试一下吧，看看这个东西能从多大程度上提高你插件开发的效率？里面的东西相当全面啊，传达出了作者很多的开发经验。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/interesting-things" title="interesting things" rel="tag">interesting things</a>, <a href="http://sexywp.com/tags/resources" title="resources" rel="tag">resources</a>, <a href="http://sexywp.com/tags/tools" title="tools" rel="tag">tools</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/wordpress-developer-resource.htm/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>使用NetBeans IDE 6.5作为WordPress的开发环境</title>
		<link>http://sexywp.com/use-netbeans-to-develop-wp.htm</link>
		<comments>http://sexywp.com/use-netbeans-to-develop-wp.htm#comments</comments>
		<pubDate>Fri, 30 Jan 2009 06:27:25 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Plugins Develop]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://www.charlestang.cn/?p=287</guid>
		<description><![CDATA[从一个大牛那里看到了介绍NetBeans IDE for PHP的文章，立刻下载下来尝试。立刻被它那强大、便捷、体贴的开发功能所吸引。本文主要介绍我在安装、试用、开发过程中的一些使用体验及感受。





<span class="readmore"><a href="http://sexywp.com/use-netbeans-to-develop-wp.htm" title="使用NetBeans IDE 6.5作为WordPress的开发环境">Keep Reading --- 2009 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="[WP开发环境]在NetBeans中配置FTP" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[WP开发环境]在NetBeans中配置FTP</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>从一个大牛那里看到了<a href="http://wp.gdragon.info/2008/11/22/wordpress-and-netbeans-ide/">介绍NetBeans IDE for PHP的文章</a>，立刻下载下来尝试。立刻被它那强大、便捷、体贴的开发功能所吸引。本文主要介绍我在安装、试用、开发过程中的一些使用体验及感受。</p>
<p><img src="http://lh6.ggpht.com/_QYicOeu89Bk/SXNOTOsS87I/AAAAAAAABBM/KsNZMHoMzMw/s400/NetBeans-01.png" title="NetBeans Web Site" /><br />
<span id="more-287"></span></p>
<h3>从NetBeans官方网站下载IDE</h3>
<p>打开<a href="http://www.netbeans.org/">NetBeans的官方网站</a>，点击Download，可以看到下载页面，如果没有其他的开发需求，选择for PHP的版本即可，大小只有26MB。</p>
<p>上面的语言选择框，大家不要费神去选了，我试过了，选择English和简体中文，下载下来的东西都是同一个，都是Multi-Language版本，而且安装的时候，不可以选择语言，NetBeans会根据系统的语言设定，来自动选择语言。据说可以通过修改配置文件的方式来更改界面语言，想用英文的同学，请自己Google之。</p>
<p>运行NetBeans IDE需要java虚拟机，如果需要开发java的同学，可以只下载JRE，很简单，打开http://java.com，下载即可。有些像我一样，想要以防万一的同学，可能想要安装JDK，那么<a href="http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u11-windows-i586-p.exe?BundledLineItemUUID=7R5IBe.ms04AAAEem.tX3uQi&amp;OrderID=IP5IBe.mZV4AAAEeketX3uQi&amp;ProductID=DY5IBe.ogAkAAAEdcjBGb7Et&amp;FileName=/jdk-6u11-windows-i586-p.exe">下载地址在这里</a>。我给出的链接是JDK 6 Update 11 for Win版本。</p>
<p>先安装JRE（或者JDK），然后再安装NetBeans <a href="http://sexywp.com/tags/ide" class="st_tag internal_tag" rel="tag" title="标签 IDE 下的日志">IDE</a> 6.5。下面的图是NetBeans装好启动后的样子。</p>
<p><a href="http://picasaweb.google.com/lh/photo/VM7-kFI4WBZdSutP-wArPg?feat=embedwebsite"><img src="http://lh6.ggpht.com/_QYicOeu89Bk/SXNb1hh4a7I/AAAAAAAABBU/cfCq3tgTPc0/s400/NetBeans-02.png" /></a></p>
<h3>将WordPress导入到NetBeans中</h3>
<p>要开发WordPress的插件和主题，需要将整个WordPress作为项目导入到NetBeans中。</p>
<p><a href="http://picasaweb.google.com/lh/photo/VdQQf2p0P-5QqGY1AHJuBQ?feat=embedwebsite"><img src="http://lh6.ggpht.com/_QYicOeu89Bk/SXNb11gLmJI/AAAAAAAABBc/QSYA8anbB2Q/s400/NetBeans-03.png" /></a></p>
<p>步骤1：选择项目。“<strong>文件->新建项目</strong>”，然后选择PHP项目里的“<strong>基于现有源代码的PHP应用程序</strong>”。</p>
<p><a href="http://picasaweb.google.com/lh/photo/_huaRF-0nzBtKkX57MHESA?feat=embedwebsite"><img src="http://lh4.ggpht.com/_QYicOeu89Bk/SXNb2AhYMPI/AAAAAAAABBk/gY9mJReyGm8/s400/NetBeans-04.png" /></a></p>
<p>步骤2：名称和位置。在源文件夹中填入本地WordPress所在的目录。填入项目名称，可随意。其他如上图所示即可。</p>
<p><a href="http://picasaweb.google.com/lh/photo/72StQpojQH-gZu8N1eTTsw?feat=embedwebsite"><img src="http://lh6.ggpht.com/_QYicOeu89Bk/SXNb2KbK0GI/AAAAAAAABBs/dpvS7jvyI9M/s400/NetBeans-05.png" /></a></p>
<p>步骤3：运行配置。填入项目URL即可，为了在本地调试，一般会填入本地地址如http://localhost/wp27/。其他如上图所示。</p>
<h3>使用XDebug进行调试</h3>
<p>NetBeans支持PHP的调试。调试功能需要XDebug的支持，这是一个PHP扩展，你的服务器上可能已经装了，也可能没有装，不过，安装起来非常方便，对于Windows下的用户来说，只是下载一个DLL文件，然后拷贝到指定的目录即可。</p>
<ol>
<li>到<a href="http://www.xdebug.org/">这里</a>下载XDebug，注意匹配DLL与PHP的版本号。在链接里的网页上，点击obtaining，进入下载页面，鼠标放在下载链接上，可以在状态栏看到将要下载的文件名。<a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a>_xdebug-2.0.x-5.x.x-xxx.dll，后面一个是PHP的版本号，要与你安装的版本相符合。（PHP版本可以用phpinfo()来查看）</li>
<li>下载后，将DLL文件拷贝到PHP扩展文件夹，一般是/php/ext/下面。</li>
<li>修改php.ini文件，这个文件的所在一般取决你php是怎么安装的，可能在system32里（bin安装的用户），也可能在php根目录下（使用zip安装的），也可能在apache/bin/目录里（使用xampp的用户），注意，一定要找到起作用的那个php.ini，这个也可以在phpinfo()里面看。添加下面的代码。</li>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[xdebug]<br />zend_extension_ts=&quot;D:/xamp/php/php5.2.5/ext/php_xdebug.dll&quot;<br />xdebug.remote_enable=On<br />xdebug.remote_host=&quot;localhost&quot;<br />xdebug.remote_port=9000<br />xdebug.remote_handler=&quot;dbgp&quot;</span></div></div>
<li>注意：上面的代码段，可能php.ini里已经有了，而是被注释掉了，那么你去掉上述那几行字的注释就可以了。另一个注意点，[xdebug]段的配置和[zend]段的配置不能共存，否则apache启动不了，添加了上述代码，如果启动不了apache，那么查找是否存在[zend]段的配置，然后注释掉，我是XAMPP安装的环境，就碰到了这个问题。</li>
<li>重启WebServer。</li>
</ol>
<p>做过上述操作后，NetBeans就可以感知到调试器的存在了。</p>
<h3>一般项目开发</h3>
<p>我们已经将wp2.7的所有文件都导入到了NetBeans里面，那么具体开发一个插件项目，或者主题项目的时候，我们可以在项目面板上，将某个插件的根目录，或者某个主题的根目录使用如下方法添加到收藏夹，以后就在收藏夹面板下工作即可。</p>
<p><a href="http://picasaweb.google.com/lh/photo/hhddQGqFo5spU-RHEYu5EA?feat=embedwebsite"><img src="http://lh6.ggpht.com/_QYicOeu89Bk/SXQm5QcgZgI/AAAAAAAABCI/LschHqVw95s/s400/NetBeans-06.png" /></a></p>
<p>收藏夹完全可以充当项目开发面板的工作。下图就是添加后的效果。</p>
<p><a href="http://picasaweb.google.com/lh/photo/yxGkDHD97csGUsjQq-1wsw?feat=embedwebsite"><img src="http://lh4.ggpht.com/_QYicOeu89Bk/SXQm5R7KO3I/AAAAAAAABCQ/eCJGK5dmT44/s400/NetBeans-07.png" /></a></p>
<h3>配置项目运行</h3>
<p>一般，调试主题或者插件，都是某个特定的页面，比如归档页面，静态页面，或者某个单篇日志页面。如果只是主页，那么默认的设置即可了，如果不是主页，那么需要指定启动参数。大家可能习惯了修改永久链接后的WP的页面地址了，但是那个在调试环境下行不通，必须还原到query string的模式。</p>
<p><a href="http://picasaweb.google.com/lh/photo/h1f6Q97r497VcvVsjDqEiw?feat=embedwebsite"><img src="http://lh6.ggpht.com/_QYicOeu89Bk/SXQm5s9b7WI/AAAAAAAABCY/3Q46QF5Ep90/s288/NetBeans-08.png" /></a></p>
<p>从上图菜单中打开对话框，配置方式如下：</p>
<p><a href="http://picasaweb.google.com/lh/photo/h3NjHTgKkJieuN0igO050w?feat=embedwebsite"><img src="http://lh5.ggpht.com/_QYicOeu89Bk/SXQm51I5xvI/AAAAAAAABCg/xKcJIjLmt5Q/s400/NetBeans-09.png" /></a></p>
<p>注意上图中红色框框里的部分，这个例子就是指定显示id为289的页面或者日志。</p>
<p>设置好运行设置，调试时也会使用这个参数。</p>
<p>调试的时候从调试菜单进去，打开调试对话框，如果只需要调试PHP的话，选第一项，如果还需要调试Javascript的话，选第二项，可以选择你喜欢的浏览器。（有些平台上不能选，Win上面没有问题）</p>
<p><a href="http://picasaweb.google.com/lh/photo/oiZKeAf0OYTcBYbDGQC_vw?feat=embedwebsite"><img src="http://lh4.ggpht.com/_QYicOeu89Bk/SXQr9cJq2pI/AAAAAAAABC4/VKmLbv8P5Lw/s400/NetBeans-10.png" /></a></p>
<p>使用FF，初次选择Javascript调试，会要求安装一个FF插件，装上即可。</p>
<p>好了，作为一个简要的介绍，就写到这里了。</p>
<p>后记：上述内容，并非完全翻译，只是遵循了原文的条理，大部分内容都是我个人的感受和体验，当然，图也是我自己重新截取的。NetBeans作为一款PHP的开发工具，与Eclipse版本的ZendStudio相比，更加的平易近人，比较简单，没有很多复杂的选项，与UEStudio相比，智能化更强，集成的功能更丰富，而且可以和浏览器联调。</p>
<p>这两天，都在使用NetBeans作为环境开发插件，觉得真的很不错。尤其是在WP下，NetBeans会自动对所有代码文件建立索引，你在某个函数上单击，该函数会被高亮，然后用Ctrl+B或者右键菜单，可以直接跳到函数的声明，非常的方便。仅有的一个小缺点是，NetBeans无法对PHP内建函数使用有区别的高亮颜色，不过大家对PHP的内建函数应该也比较熟悉了，再加上，你在内建函数上Ctrl+B，也可以跳到一个类似C语言H文件的文件里，可以直接查看这个内建函数的函数头和说明，都省了查阅手册的时间，也算是弥补了那个小缺点。</p>
<p>还有一点我比较欣赏的，就是NetBeans支持代码重构，可以自动格式化，支持javadoc格式的注释风格，使用这个编辑器可以创建非常优美的注释格式。最后，这个基于java的IDE当然也是跨平台的，以后可以一直用下去了，嘿嘿~~</p>
<p>赶快试试吧！祝大家新年好运~~</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="[WP开发环境]在NetBeans中配置FTP" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[WP开发环境]在NetBeans中配置FTP</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--(02)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-02.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--(02)</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress:插件开发API（Plugin API）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-plugin-api.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress:插件开发API（Plugin API）</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/debug" title="debug" rel="tag">debug</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/ide" title="IDE" rel="tag">IDE</a>, <a href="http://sexywp.com/tags/netbeans" title="NetBeans" rel="tag">NetBeans</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/use-netbeans-to-develop-wp.htm/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>如何获得一个分类的ID</title>
		<link>http://sexywp.com/how-to-get-a-cat-id.htm</link>
		<comments>http://sexywp.com/how-to-get-a-cat-id.htm#comments</comments>
		<pubDate>Sat, 01 Nov 2008 16:18:15 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[advanced topics]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[DIY]]></category>

		<guid isPermaLink="false">http://www.charlestang.cn/?p=254</guid>
		<description><![CDATA[摘要：本文主要讲述了，在Archive页面里，在侧边栏进行函数调用时候（也即在the loop外部），如何取得category的ID的方法，以及发现这个方法的过程，希望对大家有帮助。

今天，我在改进我模板的Archive页面，我希望能在Archive的侧边栏能够根据情景做出一些细微的变动。我希望当一个用户浏览我某个分类的Archive的时候，侧栏能够显示这个分类下展示最多的文章。

正好，我的博客上安装了WP Post Views Plus插件，这个插件就具有这个功能，只需要调用该插件提供的一个模板标签，get_most_viewed_category()即可。但是这个标签需要一个比较特别的参数，就是目标category的id，即一篇文章的cat_id字段。搜索了一下Codex，没有发现有哪个function或者template tag可以提供我需要的这个功能。只好自己找了。

<span class="readmore"><a href="http://sexywp.com/how-to-get-a-cat-id.htm" title="如何获得一个分类的ID">Keep Reading --- 593 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Web开发专用IDE：Aptana Studio 3.0" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="本地运行WordPress时发生超时错误" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-timeout-error.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">本地运行WordPress时发生超时错误</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>摘要：本文主要讲述了，在Archive页面里，在侧边栏进行函数调用时候（也即在the loop外部），如何取得category的ID的方法，以及发现这个方法的过程，希望对大家有帮助。</p>
<p><span id="more-254"></span>今天，我在改进我模板的Archive页面，我希望能在Archive的侧边栏能够根据情景做出一些细微的变动。我希望当一个用户浏览我某个分类的Archive的时候，侧栏能够显示这个分类下展示最多的文章。</p>
<p>正好，我的博客上安装了WP Post Views Plus插件，这个插件就具有这个功能，只需要调用该插件提供的一个模板标签，get_most_viewed_category()即可。但是这个标签需要一个比较特别的参数，就是目标category的id，即一篇文章的cat_id字段。搜索了一下Codex，没有发现有哪个function或者template tag可以提供我需要的这个功能。只好自己找了。</p>
<p>首先，这个功能只有在Archive页面显示分类的Archive时候才能出现，平时不应该出现，这个很简单，可以用is_category()这个tag来判断，但是怎么能够知道现在展示的这个category的id呢，我第一个想到的就是去is_category里面看，先看看wp怎么判断is_category或许能够找到思路，进去一看，答案就揭晓了。</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">&lt;?php</span><span style="color: Gray;"><br /></span><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">is_category</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: #00008b;">$category</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">'</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">global</span><span style="color: Gray;"> </span><span style="color: #00008b;">$wp_query</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">if</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Gray;"> !</span><span style="color: #00008b;">$wp_query</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">is_category</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;"> </span><span style="color: Green;">false</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">if</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: Green;">empty</span><span style="color: Olive;">(</span><span style="color: #00008b;">$category</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;"> </span><span style="color: Green;">true</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: #00008b;">$cat_obj</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$wp_query</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">get_queried_object</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">看这里</span><span style="color: #ffa500;"></span><span style="color: Gray;"><br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: #00008b;">$category</span><span style="color: Gray;"> = </span><span style="color: Olive;">(</span><span style="color: Green;">array</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: #00008b;">$category</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">if</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: Blue;">in_array</span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: #00008b;">$cat_obj</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">term_id</span><span style="color: Gray;">, </span><span style="color: #00008b;">$category</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">还有这里</span><span style="color: #ffa500;"></span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;"> </span><span style="color: Green;">true</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">elseif</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: Blue;">in_array</span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: #00008b;">$cat_obj</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">name</span><span style="color: Gray;">, </span><span style="color: #00008b;">$category</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;"> </span><span style="color: Green;">true</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">elseif</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: Blue;">in_array</span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: #00008b;">$cat_obj</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">slug</span><span style="color: Gray;">, </span><span style="color: #00008b;">$category</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;"> </span><span style="color: Green;">true</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;"> </span><span style="color: Green;">false</span><span style="color: Gray;">;<br /></span><span style="color: Olive;">}</span><span style="color: Gray;"><br /></span><span style="color: Blue;">?&gt;</span></div></div>
<p>上面代码中的term_id就是cat_id了。到了这里，得到我们要的变量已经很容易了。</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">&lt;?php</span><span style="color: Gray;"><br /></span><span style="color: Green;">global</span><span style="color: Gray;"> </span><span style="color: #00008b;">$wp_query</span><span style="color: Gray;">;<br /></span><span style="color: #00008b;">$cat_obj</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$wp_query</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">get_queried_object</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: #00008b;">$cat_id</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$cat_obj</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">term_id</span><span style="color: Gray;">;<br /></span><span style="color: Blue;">?&gt;</span></div></div>
<p>ok，这样，我们就拿到了我们要的东西了！万事大吉了~~</p>
<p>不过呢，我们继续去看看get_queried_object()函数的源代码，我们发现其实wp_query这个对象把它查询的某些内容抽象成一个query_object来对待，其实几乎那一系列的conditional_tag都有对应的query_object。更进一步，我们在这个函数里发现了，对于每一个query_object来说，都存在一个query_object_id。对于一个category来说，我们要的query_object_id就是我们要的category id。再往下一点，我们就看到了得到cat_id最简单的方法了。</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">&lt;?php</span><span style="color: Gray;"><br /></span><span style="color: Green;">global</span><span style="color: Gray;"> </span><span style="color: #00008b;">$wp_query</span><span style="color: Gray;">;<br /></span><span style="color: #00008b;">$cat_id</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$wp_query</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">get_queried_object_id</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: Blue;">?&gt;</span></div></div>
<p>哈~</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Web开发专用IDE：Aptana Studio 3.0" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="本地运行WordPress时发生超时错误" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-timeout-error.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-get-a-cat-id.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">本地运行WordPress时发生超时错误</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/advanced-topics" title="advanced topics" rel="tag">advanced topics</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/diy" title="DIY" rel="tag">DIY</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/how-to-get-a-cat-id.htm/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>WP的结构和最佳实践</title>
		<link>http://sexywp.com/wp-structure-and-best-practice.htm</link>
		<comments>http://sexywp.com/wp-structure-and-best-practice.htm#comments</comments>
		<pubDate>Thu, 09 Oct 2008 16:37:19 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[日　　记]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[my works]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.charlestang.cn/?p=248</guid>
		<description><![CDATA[想必很多朋友都已经发现了我的主题更换了，貌似我一直也没有写什么文章来介绍我现在的主题。

我现在的主题叫做yui-theme，我想，这是我对主题内部构造的设计的一种追求，我希望能把我学到的所有的最先进的技术都用在这个主题上。

当然，现实和理想总是南辕北辙。

<span class="readmore"><a href="http://sexywp.com/wp-structure-and-best-practice.htm" title="WP的结构和最佳实践">Keep Reading --- 1008 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress Theme: YUI Theme—烂尾版" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyui-theme.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress Theme: YUI Theme—烂尾版</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件：WP Kit CN" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwp-kit-cn.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件：WP Kit CN</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="升级到WordPress2.7版本~~" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fupdate-to-wp27.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/30/26374211.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">升级到WordPress2.7版本~~</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>想必很多朋友都已经发现了我的主题更换了，貌似我一直也没有写什么文章来介绍我现在的主题。</p>
<p>我现在的主题叫做yui-theme，我想，这是我对主题内部构造的设计的一种追求，我希望能把我学到的所有的最先进的技术都用在这个主题上。</p>
<p><span id="more-248"></span>当然，现实和理想总是南辕北辙。</p>
<p>首先说说，我进行了哪些尝试吧。</p>
<p>1，css和js文件合并。将模板用到的所有css文件写入同一个文件引入模板。js文件同理。好处就是在相同流量的情况下，节省了http请求数量。当时我在中间引入了gzip压缩，而实际在本地测试的时候，觉得js文件经过压缩的话，页面占线速度会被拖慢3s以上了，可能是本地的服务器性能问题，反正最后是把js的压缩取消了，保留了css的压缩。</p>
<p>2，css框架，这个模板使用YUI的css框架来设计，这是我第一次使用这样的框架，因为对于搞不定css的我来说，使用框架无疑是一种简便的选择。框架文件有好几个，一个是grid，一个font，一个base，除此之外自定义的css放到custom里面，分文件开发，合并引入，这时候也能体现文件合并的好处。</p>
<p>3，大规模应用jQuery，我为这款模板设计了各种个样的jQuery小功能（当然，现在没实现几个）。使用jQuery的指导原则就是，非入侵式，也即，完全不让代码出现在html里面，只使用外部文件；保证可访问性，也即，如果js失效，页面损失的仅有美观，而不损失功能。</p>
<p>目前，这个模板开发完成度在10%左右，即便如此，也是耗费了我好几周的精力，以至于都没有任何继续下去的激情了。所以，我迫不及待地自己先用上了。</p>
<p>然后说说，模板设计过程中遇到的问题：</p>
<p>按照yahoo网页性能提升的最佳实践，应该在页面最底部引入js文件。我实际上就是这么做的，但是这个是有问题的。因为，关键问题就在于我使用了类库，类库是应该比所有js文件都早地被引入到页面，而我只能保证我的模板里先后顺序，而插件里的js一般会被hook到wp_head里面去，所以，总是会出现在头部，顺序乱了，肯能导致js失灵，所以现在不得不重复地在页头也引入了一个jquery，这就是浪费了。</p>
<p>使用文件合并来减少http请求，这个东西同样是很好的尝试，但是这又和wp的结构有关，很多插件又是很随意的在wp_head里面插入外部文件或者直接写代码，根本没有办法把这部分文件合并，这使得这个尝试也变得很鸡肋。曾经在wp的trac里面看到过有人提这个问题，解决这个需要全新的架构。我个人觉得需要全新的机制类支持这个功能。</p>
<p>我其实还为这个模板准备了很多好玩的小功能，但是现在都处于未完成状态，唉……好懒啊……</p>
<p>好久没写技术日志了，记下这几点感受以充数。</p>
<p>期待自己下一轮欲望高涨时刻的来临。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress Theme: YUI Theme—烂尾版" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyui-theme.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress Theme: YUI Theme—烂尾版</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件：WP Kit CN" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwp-kit-cn.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件：WP Kit CN</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="升级到WordPress2.7版本~~" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fupdate-to-wp27.htm&from=http%3A%2F%2Fsexywp.com%2Fwp-structure-and-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/30/26374211.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">升级到WordPress2.7版本~~</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/my-works" title="my works" rel="tag">my works</a>, <a href="http://sexywp.com/tags/themes" title="themes" rel="tag">themes</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/wp-structure-and-best-practice.htm/feed</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>WordPress 插件：CSS Cache Buster</title>
		<link>http://sexywp.com/css-cache-buster.htm</link>
		<comments>http://sexywp.com/css-cache-buster.htm#comments</comments>
		<pubDate>Sat, 13 Sep 2008 08:56:45 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[my works]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.charlestang.cn/?p=239</guid>
		<description><![CDATA[众所周知，浏览器一般会缓存CSS文件，以节省下载量和提高页面显示速度，这种机制就叫做缓存。

但是，缓存也有一定的弊端。如果您的CSS文件已经更改，但是浏览器不知道，而缓存下来的CSS文件也没有过期，浏览器仍旧会使用缓存中的CSS文件，也就是旧的样式。

当然，很多有经验的用户都知道，只要使用Ctrl+F5，强制刷新浏览器，就可以让浏览器下载新的样式表文件了，但是作为一个博客网站，你不可能让你的每个用户都去自己Ctrl+F5一下，很傻是不？

<span class="readmore"><a href="http://sexywp.com/css-cache-buster.htm" title="WordPress 插件：CSS Cache Buster">Keep Reading --- 1035 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress插件：选项查看器" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/31/10319696.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件：选项查看器</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress Plugin: Embedded Slideshow" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fembedded-slideshow.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress Plugin: Embedded Slideshow</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>众所周知，浏览器一般会缓存CSS文件，以节省下载量和提高页面显示速度，这种机制就叫做缓存。</p>
<p>但是，缓存也有一定的弊端。如果您的CSS文件已经更改，但是浏览器不知道，而缓存下来的CSS文件也没有过期，浏览器仍旧会使用缓存中的CSS文件，也就是旧的样式。</p>
<p>当然，很多有经验的用户都知道，只要使用Ctrl+F5，强制刷新浏览器，就可以让浏览器下载新的样式表文件了，但是作为一个博客网站，你不可能让你的每个用户都去自己Ctrl+F5一下，很傻是不？</p>
<p><span id="more-239"></span></p>
<p>其实，解决这个问题是很简单的，以前，我就在网上看到过，是为了解决js文件的缓存问题的，js也有相同的问题。要说解决之道，到是非常的简单，因为如果请求css文件，或者js文件的链接变化了，也即url变化了，浏览器就会认为，这是完全不同的两个文件，就不会使用缓存中的文件。所以，只要改变url，就可以让浏览器强制更新缓存了，当然，每次换url也很麻烦，我们一般使用的办法是给url添加一个query string，比如，原来申请的是：</p>
<p>&lt;link rel='stylesheet' href='http://localhost/wp25/wp-content/default/style.css' type='text/css' /&gt;</p>
<p>和</p>
<p>&lt;script src='http://localhost/wp25/wp-content/default/custom.js' type='text/javascript'&gt;&lt;/script&gt;</p>
<p>现在变成：</p>
<p>&lt;link rel='stylesheet' href='http://localhost/wp25/wp-content/default/style.css?120012022' type='text/css' /&gt;</p>
<p>和</p>
<p>&lt;script src='http://localhost/wp25/wp-content/default/custom.js?12345678' type='text/javascript'&gt;&lt;/script&gt;</p>
<p>就是在后面跟了一串数字，我的页面用的一个json，因为每次都要重新下载，所以，我在请求的url链接后面，带了一个随机数，这样，每次浏览器都会认为，这是一个全新的文件，都会去下载。</p>
<p>当然，大多数情况下，是不需要每次都下载，也即在站点没有更改自己的css文件和js文件的时候，浏览器要使用缓存，而更改了后，所有浏览的用户就要自动下载。最好的办法，就是用文件修改的日期来做后面那串数字，既保证了用户那边的效果会实时更新，又保证了能够使用缓存这种机制。</p>
<p>前两天看到个小老外，写了篇文章介绍这个东西，WTC竟然也推荐了，原来这个方法竟然如此的不普及啊~~小老外的文章看这里，讲得和我说得是一回事：</p>
<p><a href="http://www.alistercameron.com/2008/09/10/smart-cache-busting-for-your-wordpress-stylesheet/">Smart cache-busting for your WordPress stylesheet</a></p>
<p>达人Matt给他提了个建议，让他使用filter来实现这个，这样，每个主题都会因为这个而受益。结果这个小老外就去写了一个插件，叫做<a href="http://www.alistercameron.com/2008/09/12/wordpress-plugin-css-cache-buster/">CSS Cache Buster</a>（点击链接，查看插件页面，下载插件）。</p>
<p>我本来以为这个小老外这两天迟迟没有动手呢，我就先写了一个，结果发现小老外竟然Updated了，只是我没有看到，赶快把他的插件下回来看了下，发现小老外写的东西用的filter没我好，他不直接，他用了bloginfo_url这个filter，而我直接用了stylesheet_uri这个filter，比他少了一次判断，但是小老外也有优点，就是他考虑了别的插件已经添加过query string的情况，而我没考虑，可见我的经验尚浅，或者说我还是不够勤劳，总之，自我感觉有那么点败给小老外了……</p>
<p>感兴趣或者经常喜欢修改style.css的同学请安装他的插件吧，可以少按很多次Ctrl+F5呢，嘿嘿</p>
<p>下面放上我写的代码，权当是一个纪念吧：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">&lt;?php</span><span style="color: Gray;"><br /></span><span style="color: #ffa500;">/*</span><span style="color: #ffa500;"><br />Plugin Name: Smart Cache-busting Stylesheet<br />Plugin URI: </span><span style="color: Blue;">http://sexywp.com/</span><span style="color: #ffa500;"><br />Description:&nbsp; This plugin will tell the explorer that your stylesheet has been changed and the explorer will redownload the style.css file instead of using the cached one.<br />Author: Charles Tang<br />Version: 8.9.13<br />Author URI: </span><span style="color: Blue;">http://sexywp.com/</span><span style="color: #ffa500;"><br /></span><span style="color: #ffa500;">*/</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Blue;">add_filter</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">stylesheet_uri</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">cache_buster_code</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Maroon;">9999</span><span style="color: Gray;">,</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">cache_buster_code</span><span style="color: Olive;">(</span><span style="color: #00008b;">$stylesheet_uri</span><span style="color: Olive;">)</span><span style="color: Olive;">{</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: #00008b;">$pieces</span><span style="color: Gray;"> = </span><span style="color: Blue;">explode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">wp-content</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #00008b;">$stylesheet_uri</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: #00008b;">$stylesheet_uri</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$stylesheet_uri</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">?</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: Blue;">filemtime</span><span style="color: Olive;">(</span><span style="color: Blue;">ABSPATH</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">/wp-content</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: #00008b;">$pieces</span><span style="color: Olive;">[</span><span style="color: Maroon;">1</span><span style="color: Olive;">]</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;"> </span><span style="color: #00008b;">$stylesheet_uri</span><span style="color: Gray;">;<br /></span><span style="color: Olive;">}</span><span style="color: Gray;"><br /></span><span style="color: Blue;">?&gt;</span></div></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress插件：选项查看器" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fplugin-options-inspector.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/31/10319696.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件：选项查看器</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress Plugin: Embedded Slideshow" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fembedded-slideshow.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress Plugin: Embedded Slideshow</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件开发实例--（01）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freal-wp-plugins-01.htm&from=http%3A%2F%2Fsexywp.com%2Fcss-cache-buster.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9193527.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件开发实例--（01）</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/my-works" title="my works" rel="tag">my works</a>, <a href="http://sexywp.com/tags/opinion" title="opinion" rel="tag">opinion</a>, <a href="http://sexywp.com/tags/plugins" title="plugins" rel="tag">plugins</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/css-cache-buster.htm/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>讨论：模板文件里哪些是必须的？</title>
		<link>http://sexywp.com/template-hierarchy.htm</link>
		<comments>http://sexywp.com/template-hierarchy.htm#comments</comments>
		<pubDate>Sun, 07 Sep 2008 07:29:37 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://www.charlestang.cn/?p=235</guid>
		<description><![CDATA[这两天在给自己制作新的模板，又研究了下官方的文档，发现了下面这张模板层次结构图。

这张图解释了WP从用户给出query到最后调用正确的模板文件来产生页面的一个过程。从图中我们可以看到，WP一种支持13种模板文件。那么这十三种模板文件中，到底哪些才是必须的呢？



<span class="readmore"><a href="http://sexywp.com/template-hierarchy.htm" title="讨论：模板文件里哪些是必须的？">Keep Reading --- 1368 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="免费WordPress主题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ffree-wordpress-themes.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10603183.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">免费WordPress主题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress Theme: YUI Theme—烂尾版" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyui-theme.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress Theme: YUI Theme—烂尾版</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>这两天在给自己制作新的模板，又研究了下官方的文档，发现了下面这张模板层次结构图。</p>
<p>这张图解释了WP从用户给出query到最后调用正确的模板文件来产生页面的一个过程。从图中我们可以看到，WP一种支持13种模板文件。那么这十三种模板文件中，到底哪些才是必须的呢？</p>
<p><span id="more-235"></span></p>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/foYjC-WO5C_N58pyJFSg7Q"><img src="http://lh3.ggpht.com/TangChao.ZJU/SMN3t73s8fI/AAAAAAAAAjE/X8ooH0zogoQ/s400/Template_Hierarchy.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">相册：<a href="http://picasaweb.google.com/TangChao.ZJU/Illustration">illustration</a></td>
</tr>
</table>
<p>1. index.<a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a> </p>
<p>可以看到，只要对应的模板文件找不到，最后都会调用index.php，只有这个文件是逻辑上必须的，如果没有，模板根本不能加载。</p>
<p>2. single.php </p>
<p>此文件从逻辑上不是必须，但是一般的主题都会带有这个文件。究其原因，就是单篇帖子页面和主页，有着非常大的不同，这个页面上与首页最重要的不同，可能就是评论展示了。</p>
<p>3. page.php </p>
<p>这个文件也是一般主题常带有的，这个是页面文件的模板。那么页面又有哪些不同呢？页面作为一种常设的Post，其发布时间可能并不是那么重要的，因为这个页面一经发布，就长久存在，不过，我个人倒是认为，虽然发布时间不重要，但是更新时间确实在某些情况下还是有必要的。比如我自己用页面来展示插件的文档，那么这个文档的更新时间能够向用户传达文档的时效性，所以，我觉得，在页面展示更新时间，是否应该作为主题管理面板的一个选项给用户选择。</p>
<p>4. pagename.php</p>
<p>这个文件不是叫pagename.php，而是说，这个模板文件也是page.php的一个变种，是page的slug来命名的，基本上，很少有主题会带有这个文件，不过呢，我觉得，国产模板的作者可以考虑带上这个文件，比如，很多博客都喜欢guestbook这样的应用，但是一般的模板文件page.php，往往不会带评论部分，作为一个模板作者来说，产生一个guestbook.php这样的事情完全是小事一桩。</p>
<p>5. archive.php</p>
<p>这个文件其实就是展示归档的模板文件，一般来说，主题里都会带有这个文件的。不过呢，从图中我们也可以看出，归档其实可以分成四个种类的，日期归档，分类归档，tag归档，作者归档。从功能上来说，划分那么细并非是必须的，不过呢，我想对于团队博客来说，作者归档里面带上照片和作者介绍，应该是很好玩的应用吧。而对于分类归档和日期归档，可以考虑给予一些辅助检索的措施，当然，这些都可以详细展开讨论，作为一个用户，您有什么新奇的点子呢？</p>
<p>6. search.php</p>
<p>带有这个模板文件的主题也不多，其实这个里面还是很有文章可以做一下的，不过呢，我暂时也没有很么好点子。比如在搜索页面嵌入一个google搜索，或者嵌入一个专门的带有类似suggesting那样功能的搜索框，都应该是比较好玩的吧……</p>
<p>7. 404.php</p>
<p>当找不到文章的时候，或者永久链接失效的时候，都会进入404。404又是一个大有学问的模板文件，前段日子，google黑板报在搞<a href="http://googlechinablog.com/2008/08/404.html">404代码专题周</a>，google都如此重视404，可见其重要了吧。以前A List Apart也写过一篇<a href="http://www.alistapart.com/articles/perfect404/">《完美404》</a>，给出了很多有效的建议。我想，作为一个主题作者，您是不是也考虑，在您的模板中加入一个非常友好的404呢？</p>
<p>8. attachment.php </p>
<p>到现在为止，我还没有见过哪个主题带有这个文件的呢，也可能我从来没有注意过这个问题吧，我现在的想法就是，那种专门展示照片，艺术作品的photolog，可以做一个美丽的展示单幅图片的image.php，哈哈……Updated: 哈哈，关于这个，大家可以瞧瞧梦色的文章，<a href="http://dreamcolor.net/2008/04/how-to-add-wordpress-25-gallery-to-your-current-theme-cn/">如何制作Gallery</a></p>
<p>========分割线========</p>
<p>以上都是一些我个人的想法，和我对一些模板文件的认识，难免有偏颇之处，还望大家指正。另外，写出来这个，也是想和大家讨论讨论的，哪些模板文件是您非常需要的，哪些又是您非常不需要的？</p>
<p>P.S. 与主题完全无关的内容，我发现Picasa Web竟然悄悄的改版了，好像更人性化了，在单幅图片浏览页面添加了上传按钮，而且图片的链接格式也发生了较大的改变，现在竟然用table来做容器了……</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress主题：GoogleCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-theme-googlecode.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170670.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：GoogleCode</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="免费WordPress主题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ffree-wordpress-themes.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10603183.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">免费WordPress主题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress Theme: YUI Theme—烂尾版" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyui-theme.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress Theme: YUI Theme—烂尾版</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Ftemplate-hierarchy.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/themes" title="themes" rel="tag">themes</a>, <a href="http://sexywp.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/template-hierarchy.htm/feed</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>在WinCE上搭建Web服务</title>
		<link>http://sexywp.com/build-web-server-on-wince-platform.htm</link>
		<comments>http://sexywp.com/build-web-server-on-wince-platform.htm#comments</comments>
		<pubDate>Sat, 16 Aug 2008 10:31:32 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[wince]]></category>

		<guid isPermaLink="false">http://www.charlestang.cn/?p=219</guid>
		<description><![CDATA[由于项目的需要，要在WinCE 5.0平台上搭建一个Web服务器。

本文是我进行调研的一点摘录。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">解决Flash内容总是漂浮于页面顶层的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Google用于提高网站质量的工具：Page Speed工具集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MVC最佳实践</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>由于项目的需要，要在WinCE 5.0平台上搭建一个Web服务器。</p>
<p><span id="more-219"></span></p>
<p>本来以为，应该是个很简单的事情，网上应该能搜到很多开源项目的，谁知道，全然不是那么回事，实际上能够使用的资源是非常少的。囧。</p>
<p>1. GoAhead Web服务器，小巧，精致，提供了值得称道的性能。这个是我目前找到的看起来最好的一个东西了，但是不知道实际使用的效果怎么样，毕竟，嵌入式这种东西，芯片，电路，系统，等等统统影响整个系统的稳定，出问题的概率远大于不出问题的概率。</p>
<p>介绍这个服务器的中文文章，是否原创不详。</p>
<p>http://www.cppblog.com/dyj057/archive/2007/01/15/17642.html</p>
<p>这个服务器的官方特性描述。（WebServer 2.1.8 * latest version *）</p>
<p>http://www.goahead.com/products/webserver/features.aspx</p>
<p>2. 另外，在这个文章中看到的是说WinCE本身就带有Web服务器，具体的我没有细看，现在这里摘录下来。</p>
<p>在 Windows CE 上实现网络服务1</p>
<p>http://hi.baidu.com/19chang19/blog/item/17caec2a95667928d42af11d.html</p>
<p>在 Windows CE 上实现网络服务2</p>
<p>http://hi.baidu.com/19chang19/blog/item/1c2835f46195f16bddc4741d.html</p>
<p>又找到一篇文章提及到了WinCE自带的Web Server文章，但是没有具体内容</p>
<p>http://simplaman.itpub.net/post/2120/458039</p>
<p>p.s. 还找到了一个额外的文章</p>
<p>"我再也不用Windows CE或者嵌入式Windows XP了"</p>
<p>http://rtzhao.it.com.cn/articles/162912.htm</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">解决Flash内容总是漂浮于页面顶层的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Google用于提高网站质量的工具：Page Speed工具集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MVC最佳实践</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/embedded" title="embedded" rel="tag">embedded</a>, <a href="http://sexywp.com/tags/wince" title="wince" rel="tag">wince</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/build-web-server-on-wince-platform.htm/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

