<?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>Inning In Chaos &#187; 主题</title>
	<atom:link href="http://prokuso.com/tag/%e4%b8%bb%e9%a2%98/feed" rel="self" type="application/rss+xml" />
	<link>http://prokuso.com</link>
	<description>这里是lifishake同学的blog，主要涉及他所关心的游戏、动漫、笑话以及其他话题。</description>
	<lastBuildDate>Wed, 08 Sep 2010 01:21:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>为你的wordpress主题添加选项页</title>
		<link>http://prokuso.com/2010/07/create-an-options-page-for-your-wordpress-theme.html</link>
		<comments>http://prokuso.com/2010/07/create-an-options-page-for-your-wordpress-theme.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 10:11:23 +0000</pubDate>
		<dc:creator>大致</dc:creator>
				<category><![CDATA[思维异常的备忘录]]></category>
		<category><![CDATA[option]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[选项]]></category>

		<guid isPermaLink="false">http://prokuso.com/?p=1657</guid>
		<description><![CDATA[为你的wordpress主题添加选项页CC(by-nc-sa) Inning In Chaos准确的说，这篇主要是译作。我在搜索wordpress+主题+选项的时候并没有找到合适的教程。只有Neoease小哥的一篇符合要求。但是他把一堆属性放... ]]></description>
			<content:encoded><![CDATA[<p><a rel="Inning In Chaos article" href="http://prokuso.com/2010/07/create-an-options-page-for-your-wordpress-theme.html">为你的wordpress主题添加选项页</a></p><p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh">CC(by-nc-sa)</a> <a href="http://prokuso.com">Inning In Chaos</a></p><p>准确的说，这篇主要是译作。我在搜索wordpress+主题+选项的时候并没有找到合适的教程。只有<a href="http://www.neoease.com/add-options-to-your-wordpress-theme/">Neoease小哥</a>的一篇符合要求。但是他把一堆属性放到表格的同一位置存放，用起来不是很方便。接着换用英文关键字，终于搜到了<a href="http://blog.themeforest.net/wordpress/create-an-options-page-for-your-wordpress-theme/">这个</a>不错的教程。所以翻译一下并结合自己的理解写这一篇。<br />
我很有诚意的！为了写这个俺甚至换了显示代码的插件。</p>
<p>为主题添加一个选项页是降低复杂主题管理难度的最好的方法。但是，能Google到的资料很少所以很多人都放弃了。在设计上一个如此重要的应用却有很少的文档，貌似那些资深开发者们都把这个方法当作祖传秘方私藏了起来。<br />
在这篇文章中我将合并一个选项面板到WP默认主题（WordPress Classic）中，你学到的方法将很容易扩展到自己的工程上。</p>
<p>首先，blabla……（与WP无关），感谢国家。</p>
<p><del>我们的目标是，没有蛀牙</del><br />
我们的目标是，在Wordpress的默认主题上方开辟一个区域，用来显示一段欢迎语。这段欢迎语的内容可以在后台的选项页中进行编辑。后台界面是这个样子的：<br />
<img src='http://prokuso.com/wp-content/gallery/sucai/welcom.jpg' alt='welcom' class='ngg-singlepic ngg-none' /><br />
如果对加入的选项页的格式不加以控制的话，看起来会非常别扭，所以修改的内容中还包括一部分后台界面的美化。</p>
<p><strong>****后台修改****</strong><br />
我们从修改<em>/wp-content/themes/classic/</em>下的<em>functions.php</em>开始。<br />
为了避免麻烦，<em>在functions.php</em>文件的最前或最后加上下面的代码是最安全的。</p>
<p>首先添加</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$themename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;WordPress Classic&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//改成你主题的名字,可以用中文</span>
<span style="color: #000088;">$shortname</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;wpc&quot;</span><span style="color: #339933;">;</span>				<span style="color: #666666; font-style: italic;">//你主题名字的缩写,一定不要用中文!</span>
&nbsp;
<span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
&nbsp;
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>	<span style="color: #0000ff;">&quot;name&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;欢迎语&quot;</span><span style="color: #339933;">,</span>  
			<span style="color: #0000ff;">&quot;type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>	<span style="color: #0000ff;">&quot;type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;open&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>	<span style="color: #0000ff;">&quot;name&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;标题&quot;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">&quot;desc&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;输入欢迎语页面的标题.&quot;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">&quot;id&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$shortname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;_welcome_title&quot;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">&quot;std&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">&quot;type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;text&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>	<span style="color: #0000ff;">&quot;name&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;内容&quot;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">&quot;desc&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;欢迎语的内容.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;id&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$shortname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;_welcome_message&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;textarea&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>  <span style="color: #0000ff;">&quot;name&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;是否显示?&quot;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">&quot;desc&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;选中此项如果你**不想**显示欢迎语.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;id&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$shortname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;_welcome_disable&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;checkbox&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;std&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #666666; font-style: italic;">//再有想添加的可以参照这个格式进行</span>
	<span style="color: #666666; font-style: italic;">/*
		array(	&quot;name&quot; =&gt; &quot;内容2&quot;,
				&quot;desc&quot; =&gt; &quot;内容2的内容&quot;,
			            &quot;id&quot; =&gt; $shortname.&quot;_welcom2&quot;,
			            &quot;type&quot; =&gt; &quot;textarea&quot;),
	*/</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>	<span style="color: #0000ff;">&quot;type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;close&quot;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>这里是我们创建选项的地方。<br />
我们把每个选项都放到一个数组中，方便在后面把它们组合到一起。每个选项都有一下复用的代码。在每个数组中，我们使用如下参数：<br />
<strong>name</strong> – 用来显示这个选项的标题（可以是中文）。<br />
<strong>desc</strong> &#8211; 对于这个选项的描述（可以是中文）。<br />
<strong>id</strong> – 非常重要！ 我们用来识别每个存储数据。 <strong>$shortname</strong>将与id组合到一起存到数据库中，所以id是不能重复的。 (在我们的例子中,把$shortname设成wpc)。<br />
<strong>std</strong> – 选项的默认值. 例如对于checkbox类型，可以设成true或者false以决定这个选项初始的时候是否选中。<br />
<strong>type</strong> – 用来定义选项显示的类别. 像文字、文字输入框、checkbox之类。<br />
首先以title类型作为开始。<br />
‘open’选项才是真正有意义的开始，作用是开始表格的绘制（是的，原作者那个笨蛋为了好看用了table，后悔来不及了已经。）<br />
接下来用一个text做欢迎语选项的标题，之后用一个textarea来存放消息的内容。接下来的checkbox用来决定是否启用这个欢迎语。<br />
最后用&#8217;close&#8217;跟&#8217;open&#8217;相对应。</p>
<p>所以，利用这个模板，你可以在open和close之间任意增加或删除选项，所要做的只是照葫芦画瓢写一个array而已。注意id。</p>
<p>后边的部分是一坨Wordpress代码，用来具体实现选项页的做成和功能。不感兴趣的可以跳过。感兴趣的，我也在我能看懂的部分加了中文注释。<br />
如果特别关注的话，会发现我对原英文作者的代码改动了两处。因为原来的作者没考虑到往数据库里存代码（比如adsense或analitics）的情况。<br />
And now for the rest of the code. Most of which is a bunch of WordPress functions to tell it this is an options page, so we wont go over most of it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">function mytheme_add_admin() {
&nbsp;
    global $themename, $shortname, $options;
&nbsp;
    if ( $_GET['page'] == basename(__FILE__) ) {
&nbsp;
        if ( 'save' == $_REQUEST['action'] ) { //save按下时的动作
&nbsp;
                foreach ($options as $value) {				
					//将内容更新到数据库.译者添加去转义字符命令stripslashes
                    update_option( $value['id'], stripslashes($_REQUEST[ $value['id'] ]) ); 
					}
&nbsp;
                foreach ($options as $value) {
                    if( isset( $_REQUEST[ $value['id'] ] ) ) {
						//将内容更新到数据库.译者添加去转义字符命令stripslashes
						update_option( $value['id'], stripslashes($_REQUEST[ $value['id'] ]  )); } 
					else { 
						delete_option( $value['id'] ); 
						} 
						}
				//更新标题栏
                header(&quot;Location: themes.php?page=functions.php&amp;saved=true&quot;);
                die;
&nbsp;
        } else if( 'reset' == $_REQUEST['action'] ) { //reset按下的动作
&nbsp;
            foreach ($options as $value) {
                delete_option( $value['id'] ); }
			//更新标题栏
            header(&quot;Location: themes.php?page=functions.php&amp;reset=true&quot;);
            die;
&nbsp;
        }
    }
	//调用WP函数add_theme_page.回调函数是mytheme_admin(),显示的名字就是主题名+&quot;Options&quot;Options这几个字可以换成别的.
    add_theme_page($themename.&quot; Options&quot;, &quot;&quot;.$themename.&quot; Options&quot;, 'edit_themes', basename(__FILE__), 'mytheme_admin');
&nbsp;
}
&nbsp;
function mytheme_admin() {
&nbsp;
    global $themename, $shortname, $options;
	//保存后的提示信息,settings saved.可以替换成中文
    if ( $_REQUEST['saved'] ) echo '&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;'.$themename.' settings saved.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';
	//重置后的提示信息,settings reset可以替换成中文
    if ( $_REQUEST['reset'] ) echo '&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;'.$themename.' settings reset.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';
&nbsp;
?&gt;
&lt;div class=&quot;wrap&quot;&gt;
&lt;!--整个Options页面的标题.完全可以随意发挥.--&gt;
&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$themename</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> settings&lt;/h2&gt;
&nbsp;
&lt;form method=&quot;post&quot;&gt;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
	<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;open&quot;</span><span style="color: #339933;">:</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;!--open里table开始了.--&gt;
        &lt;table width=&quot;100%&quot; border=&quot;0&quot; style=&quot;background-color:#eef5fb; padding:10px;&quot;&gt;
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;close&quot;</span><span style="color: #339933;">:</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
        &lt;/table&gt;&lt;br /&gt;
&nbsp;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #339933;">:</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;table width=&quot;100%&quot; border=&quot;0&quot; style=&quot;background-color:#dceefc; padding:5px 10px;&quot;&gt;&lt;tr&gt;
        	&lt;td colspan=&quot;2&quot;&gt;&lt;h3 style=&quot;font-family:Georgia,'Times New Roman',Times,serif;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt;&lt;/td&gt;
        &lt;/tr&gt;
&nbsp;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'text'</span><span style="color: #339933;">:</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
        &lt;tr&gt;
            &lt;td width=&quot;20%&quot; rowspan=&quot;2&quot; valign=&quot;middle&quot;&gt;&lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/strong&gt;&lt;/td&gt;
            &lt;td width=&quot;80%&quot;&gt;&lt;input style=&quot;width:400px;&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; type=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'std'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;&lt;/td&gt;
        &lt;/tr&gt;
&nbsp;
        &lt;tr&gt;
            &lt;td&gt;&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/td&gt;
        &lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;margin-bottom:5px;border-bottom:1px dotted #000000;&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
		<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'textarea'</span><span style="color: #339933;">:</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;!--我一直觉得作者用的textarea有点大,可以调小一点儿.--&gt;
        &lt;tr&gt;
            &lt;td width=&quot;20%&quot; rowspan=&quot;2&quot; valign=&quot;middle&quot;&gt;&lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/strong&gt;&lt;/td&gt;
            &lt;td width=&quot;80%&quot;&gt;&lt;textarea name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; style=&quot;width:400px; height:200px;&quot; type=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; cols=&quot;&quot; rows=&quot;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'std'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/textarea&gt;&lt;/td&gt;
&nbsp;
        &lt;/tr&gt;
&nbsp;
        &lt;tr&gt;
            &lt;td&gt;&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/td&gt;
        &lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;margin-bottom:5px;border-bottom:1px dotted #000000;&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
		<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'select'</span><span style="color: #339933;">:</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;!--这里还藏了一个select类型可以用.应该是上传用的吧?--&gt;
        &lt;tr&gt;
            &lt;td width=&quot;20%&quot; rowspan=&quot;2&quot; valign=&quot;middle&quot;&gt;&lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/strong&gt;&lt;/td&gt;
            &lt;td width=&quot;80%&quot;&gt;&lt;select style=&quot;width:240px;&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'options'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$option</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;option<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$option</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' selected=&quot;selected&quot;'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$option</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'std'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' selected=&quot;selected&quot;'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$option</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/select&gt;&lt;/td&gt;
       &lt;/tr&gt;
&nbsp;
       &lt;tr&gt;
            &lt;td&gt;&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/td&gt;
       &lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;margin-bottom:5px;border-bottom:1px dotted #000000;&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;checkbox&quot;</span><span style="color: #339933;">:</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;tr&gt;
            &lt;td width=&quot;20%&quot; rowspan=&quot;2&quot; valign=&quot;middle&quot;&gt;&lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/strong&gt;&lt;/td&gt;
                &lt;td width=&quot;80%&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>get_settings<span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;checked=<span style="color: #000099; font-weight: bold;">\&quot;</span>checked<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                        &lt;input type=&quot;checkbox&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; value=&quot;true&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$checked</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> /&gt;
                        &lt;/td&gt;
            &lt;/tr&gt;
&nbsp;
            &lt;tr&gt;
                &lt;td&gt;&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/td&gt;
           &lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;margin-bottom:5px;border-bottom:1px dotted #000000;&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> 		<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;!--&lt;/table&gt;--&gt;
&lt;!--俩按钮.--&gt;
&lt;p class=&quot;submit&quot;&gt;
&lt;input name=&quot;save&quot; type=&quot;submit&quot; value=&quot;Save changes&quot; /&gt;    
&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;save&quot; /&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;form method=&quot;post&quot;&gt;
&lt;p class=&quot;submit&quot;&gt;
&lt;input name=&quot;reset&quot; type=&quot;submit&quot; value=&quot;Reset&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;reset&quot; /&gt;
&lt;/p&gt;
&lt;/form&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//在进入控制面板的时候计入选项页</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mytheme_add_admin'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>后台页面就OK了。在后台选中默认主题激活就可以看到选项页了。</p>
<p><strong>****使用选项****</strong><br />
现在我们要做的是让添加的选项能用起来。这次，打开<em>header.php</em><br />
我们的任务有:</p>
<p>   1.从数据库读取选项<br />
   2.判断禁用的checkbox功能是不是选上了，如果没有，才进行下一步<br />
   3.判断标题是否存在，如果存在就显示<br />
   4.否则，显示基本的“Welcom”<br />
   5.判断欢迎语是否存在，存在就显示<br />
   6.不存在就显示点儿别的<br />
   7.checkbox如果选上了，就什么都不显示。</p>
<p>1.读数据库选项</p>
<p>在 header.php 的底部，添加</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$options</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'std'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>上面的代码提取了我们所添加的选项，它们是：</p>
<p>$wpc_welcome_disable</p>
<p>$wpc_welcome_title</p>
<p>$wpc_welcome_message</p>
<p>2. 查看“禁用”选项</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpc_welcome_disable</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>checkbox选中的时候，$wpc_welcome_disable值就是true，未选中就是false。接下来的动作只有未选中的时候才进行。</p>
<p>3. 查看是否有title并显示</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpc_welcome_title</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;h4&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$wpc_welcome_title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h4&gt;</pre></div></div>

<p>用个H4显示欢迎语的标题</p>
<p>4.否则,显示默认标题</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;h4&gt;Welcome!&lt;/h4&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>如果标题没设就显示Welcom</p>
<p>5 &#038; 6. 查看并显示欢迎语的内容</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpc_welcome_message</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$wpc_welcome_message</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;Hello and welcome to our site. We hope you enjoy your stay!&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>跟上一步差不多但是这次用到的是$wpc_welcome_message 。</p>
<p>7. 如果没选中，就什么都不显示</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
    &lt;!-- You could insert something here which will display when the box IS checked. --&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>虽然不重要，但这几句不能省，不如编不过。</p>
<p>最后。如果你按照上面的步骤一步一步做下来，应该就能学会添加自己的option页了。<br />
<a href="http://cn.ziddu.com/download/514474/adminoptions.zip.html" title="">下载完整例子代码</a>（<a href="http://sharecash.org/download.php?file=1029129" tltle="">备用</a>）</p>
<div style='clear:both'></div><p><script type="text/javascript"><!--
google_ad_client = "pub-8876194742936649";
/* 468x60, 创建于 10-5-5 */
google_ad_slot = "8119686746";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; 以上由lifishake发表在<a href="http://prokuso.com">Inning In Chaos</a>, 2010. |
	  <a href="http://prokuso.com/2010/07/create-an-options-page-for-your-wordpress-theme.html">永久链接</a> </p>
        <p>本文采用
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh">知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议</a>授权</p>
	<p>添加到 <a href="http://del.icio.us/post?url=http://prokuso.com/2010/07/create-an-options-page-for-your-wordpress-theme.html&amp;title=为你的wordpress主题添加选项页">del.icio.us(美味书摘)</a></p>
       
]]></content:encoded>
			<wfw:commentRss>http://prokuso.com/2010/07/create-an-options-page-for-your-wordpress-theme.html/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>庆奥运,换张皮</title>
		<link>http://prokuso.com/2008/08/qingaoyunhuanzhangpi.html</link>
		<comments>http://prokuso.com/2008/08/qingaoyunhuanzhangpi.html#comments</comments>
		<pubDate>Tue, 26 Aug 2008 13:58:45 +0000</pubDate>
		<dc:creator>大致</dc:creator>
				<category><![CDATA[思维异常的备忘录]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[修改]]></category>
		<category><![CDATA[水煮鱼]]></category>

		<guid isPermaLink="false">http://9601.org/lifishake/2008/08/qingaoyunhuanzhangpi.html</guid>
		<description><![CDATA[庆奥运,换张皮CC(by-nc-sa) Inning In Chaos话说这个theme在结婚的时候就打算换了的.但是结婚前不幸换了部门,不能随意上网,结婚之后又是无休止的加班.
奥运期间参考水煮鱼老兄的教程, 尝试自己写主... ]]></description>
			<content:encoded><![CDATA[<p><a rel="Inning In Chaos article" href="http://prokuso.com/2008/08/qingaoyunhuanzhangpi.html">庆奥运,换张皮</a></p><p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh">CC(by-nc-sa)</a> <a href="http://prokuso.com">Inning In Chaos</a></p><p>话说这个theme在结婚的时候就打算换了的.但是结婚前不幸换了部门,不能随意上网,结婚之后又是无休止的加班.<br />
奥运期间参考<a href="http://fairyfish.net/">水煮鱼</a>老兄的教程, 尝试自己写主题.本打算完全自给自足的,但是还是忍不住参考了<a href="http://www.dezinerfolio.com/">dfmarine</a>因为它的侧边栏java效果实在是太帅了!!<br />
这个主题被我命名为exile,继承了dfMarine.按照<a href="http://creativecommons.org/licenses/by-sa/2.5/in/">CC</a>是应该共享出来的.<br />
可俺的水准现在还很低.还没有弄过w3c验证.本想把所有用到的插件集合到function里的,也没有实现.真有感兴趣的朋友个别留言吧.<br />
再次鸣谢Dezinerfolio和水煮鱼!!<br />
<img src="http://www.zjol.com.cn/pic/0/02/24/53/2245334_999508.jpg" alt="" /></p>
<div style='clear:both'></div><p><script type="text/javascript"><!--
google_ad_client = "pub-8876194742936649";
/* 468x60, 创建于 10-5-5 */
google_ad_slot = "8119686746";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; 以上由lifishake发表在<a href="http://prokuso.com">Inning In Chaos</a>, 2008. |
	  <a href="http://prokuso.com/2008/08/qingaoyunhuanzhangpi.html">永久链接</a> </p>
        <p>本文采用
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh">知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议</a>授权</p>
	<p>添加到 <a href="http://del.icio.us/post?url=http://prokuso.com/2008/08/qingaoyunhuanzhangpi.html&amp;title=庆奥运,换张皮">del.icio.us(美味书摘)</a></p>
       
]]></content:encoded>
			<wfw:commentRss>http://prokuso.com/2008/08/qingaoyunhuanzhangpi.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nokia5610XM的两个小工具</title>
		<link>http://prokuso.com/2008/01/nokiz5160xmdelianggexiaogongju.html</link>
		<comments>http://prokuso.com/2008/01/nokiz5160xmdelianggexiaogongju.html#comments</comments>
		<pubDate>Wed, 02 Jan 2008 01:39:19 +0000</pubDate>
		<dc:creator>大致</dc:creator>
				<category><![CDATA[思维异常的备忘录]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[工具]]></category>

		<guid isPermaLink="false">http://9601.org/lifishake/?p=1002</guid>
		<description><![CDATA[Nokia5610XM的两个小工具CC(by-nc-sa) Inning In Chaos其实都是N记官方的,但是都不太好找.
第一个是诺基亚PC套件.但是因为5610XM的黑身份性质,导致了官方的套件支持列表里并没有它.但是用起来还是一样... ]]></description>
			<content:encoded><![CDATA[<p><a rel="Inning In Chaos article" href="http://prokuso.com/2008/01/nokiz5160xmdelianggexiaogongju.html">Nokia5610XM的两个小工具</a></p><p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh">CC(by-nc-sa)</a> <a href="http://prokuso.com">Inning In Chaos</a></p><p>其实都是N记官方的,但是都不太好找.<br />
第一个是<strong>诺基亚PC套件</strong>.但是因为5610XM的黑身份性质,导致了官方的套件支持列表里并没有它.但是用起来还是一样的.<br />
这里下载:<a href="http://www.mediafire.com/?dibhtyhwsx0">Nokia_PC_Suite_6_84_10_3_chi_sc_web.exe</a></p>
<p>第二个是诺基亚S40系列主题编辑器.其实这个东东挺平常的,2.1也有汉化版,但是汉化的组织不地道,强行捆绑了一个流氓插件,还振振有词,看得不爽.该组织倒也没把事情做绝,提供了诺基亚那边的原始下载地址.这个工具其实是N记开发包的一部分,功能还是蛮强大的,但是必须注册用户才能下载.注册虽然免费,但是竟然要填写5页的资料,真不知道这边北欧人怎么想滴.这东东能改的地方是比较多滴.不建议自己白手起家,基于某个主题逐渐修改是比较好的做法.<br />
这里下载:<a href="http://www.mediafire.com/?2xm1qhm1zgj">S40_ThemeStudio_2_2_Installer.exe</a></p>
<div style='clear:both'></div><p><script type="text/javascript"><!--
google_ad_client = "pub-8876194742936649";
/* 468x60, 创建于 10-5-5 */
google_ad_slot = "8119686746";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; 以上由lifishake发表在<a href="http://prokuso.com">Inning In Chaos</a>, 2008. |
	  <a href="http://prokuso.com/2008/01/nokiz5160xmdelianggexiaogongju.html">永久链接</a> </p>
        <p>本文采用
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh">知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议</a>授权</p>
	<p>添加到 <a href="http://del.icio.us/post?url=http://prokuso.com/2008/01/nokiz5160xmdelianggexiaogongju.html&amp;title=Nokia5610XM的两个小工具">del.icio.us(美味书摘)</a></p>
       
]]></content:encoded>
			<wfw:commentRss>http://prokuso.com/2008/01/nokiz5160xmdelianggexiaogongju.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
