<?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>山仔's blog &#187; 资讯杂谈</title>
	<atom:link href="http://hillboy.org/articles/category/information/feed" rel="self" type="application/rss+xml" />
	<link>http://hillboy.org</link>
	<description>Aspire to live in freedom</description>
	<lastBuildDate>Fri, 18 May 2012 02:24:59 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-beta4</generator>
		<item>
		<title>代码实现自动添加keywords及description</title>
		<link>http://hillboy.org/articles/automatic-adding-keywords-and-description.html</link>
		<comments>http://hillboy.org/articles/automatic-adding-keywords-and-description.html#comments</comments>
		<pubDate>Sat, 05 May 2012 06:27:53 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=3630</guid>
		<description><![CDATA[今天终于下定决心抛弃了All in one seo插件，全部改用代码实现了自动添加keywords及description，不知道谁说的，能用代码实现的决不用插件。正因如此，花了我一下午的时间终于搞掂了，包括博客标题也优化了。在网上看了很多文章教程，基本满足一个需求却不能满足另外的需求，集合各方所长和请教高人之后，得出自己的代码，下面分享给大家。]]></description>
			<content:encoded><![CDATA[<p>今天终于下定决心抛弃了All in one seo插件，全部改用代码实现了自动添加keywords及description，不知道谁说的，能用代码实现的决不用插件。正因如此，花了我一下午的时间终于搞掂了，包括博客标题也优化了。在网上看了很多文章教程，基本满足一个需求却不能满足另外的需求，集合各方所长和请教高人之后，得出自己的代码，下面分享给大家。<br />
<span id="more-3630"></span><br />
首先是博客标题的优化，将代码添加到主题模板header.php里面，替换原来的<code>&lt;title&gt;&lt;/title&gt;</code>标签。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;title&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #666666; font-style: italic;">// 如果是文章详细页面和独立页面, 显示文章标题</span>
	 <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		wp_title<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'right'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// 如果是类目页面, 显示类目表述</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%1$s 分类的文章存档 - '</span><span style="color: #339933;">,</span> single_cat_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</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;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// 如果是标签页面, 显示标签表述</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_tag<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%1$s 标签的文章存档 - '</span><span style="color: #339933;">,</span> single_tag_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</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;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// 如果是搜索页面, 显示搜索表述</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_search<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%1$s 的搜索结果'</span><span style="color: #339933;">,</span> wp_specialchars<span style="color: #009900;">&#40;</span><span style="color: #000088;">$s</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// 如果是日期页面, 显示日期范围描述</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_day<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y年n月j日'</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: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_year<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y年'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y年n月'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%1$s 的文章存档 - '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_404<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;404错误页面 - &quot;</span><span style="color: #339933;">;</span>
 	<span style="color: #009900;">&#125;</span> 
	<span style="color: #666666; font-style: italic;">// 添加博客名.</span>
	bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// 在首页添加博客描述.</span>
	<span style="color: #000088;">$site_description</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'description'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'display'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$site_description</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_front_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; - <span style="color: #006699; font-weight: bold;">$site_description</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// Add a page number if necessary:</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$paged</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$page</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' - '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Page %s'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'hillboy'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">max</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$paged</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;</pre></td></tr></table></div>

<p>我设置的是“标题 - 网站名”这样的方式，所以你会看见标题后面都有“空格-空格”，这个请自行按需设置。</p>
<p>再来就是自动添加关键词及description，这个可是花了我很长时间才搞掂的，将代码添加到主题模板header.php里的<code>&lt;/head&gt;</code>标签前面。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;好明显,呢个只不过系一个普普通通的个人博客,得闲写下个人日记,同埋一D闲杂野,对一D野既睇法观后感咁咯.&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;山仔,博客,山仔博客,hillboy,blog,日记,杂谈,观后感,资讯&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// 分类和标签页面使用描述（后台分类目录中设置）作为description，使用名字作为keywords。</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_tag<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> ? category_description<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> tag_description<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$description</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,-</span><span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> single_cat_title<span style="color: #009900;">&#40;</span>”<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// 文章和页面使用摘要作为description，没有的话就使用自定义字段的内容，否则使用内容前220个字符作为description。</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_excerpt</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$description1</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$description2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mb_strimwidth</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span> apply_filters<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_content</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">220</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$description1</span> ? <span style="color: #000088;">$description1</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$description2</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
	<span style="color: #666666; font-style: italic;">// 填写自定义字段keywords时显示自定义字段的内容，否则使用文章tags作为keywords</span>
	<span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;keywords&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$keywords</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$tags</span> <span style="color: #339933;">=</span> wp_get_post_tags<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tags</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$tag</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>        
        <span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$keywords</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$tag</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</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: #000088;">$keywords</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$keywords</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">','</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>
// 输出description和keywords
&lt;meta name=&quot;description&quot; content=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$description</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
&lt;meta name=&quot;keywords&quot; content=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$keywords</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;">if</span> <span style="color: #009900;">&#40;</span> is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;!</span>is_paged<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;meta name=&quot;robots&quot; content=&quot;index,follow&quot; /&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;meta name=&quot;robots&quot; content=&quot;noindex,follow&quot; /&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>补充一下，自定义字段的意思就是你编辑文章或页面的时候里面的那个自定义栏目，将设置的字段值填好，这样就可以直接调用，等于自定义description和keywords了，如图：</p>
<div id="attachment_3631" class="wp-caption aligncenter" style="width: 510px"><a href="http://hillboy.org/upload/2012/05/zidingyi.jpg"><img src="http://hillboy.org/upload/2012/05/zidingyi.jpg" alt="自定义栏目" title="自定义栏目" width="500" height="398" class="size-full wp-image-3631" /></a><p class="wp-caption-text">自定义栏目</p></div>
<p>至此大功告成，不懂的话不要问我，因为我也是不懂的，只是这里抄点那里抄点集合而成，然后大概看得明白是什么意思，但具体这个语句表示什么我就不懂了。</p>
<p>2012.5.8　　修复摘要输入代码</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="代码实现自动添加keywords及description" href="http://hillboy.org/articles/automatic-adding-keywords-and-description.html">代码实现自动添加keywords及description</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/automatic-adding-keywords-and-description.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>YSlow优化之Add Expires headers</title>
		<link>http://hillboy.org/articles/add-expires-headers.html</link>
		<comments>http://hillboy.org/articles/add-expires-headers.html#comments</comments>
		<pubDate>Thu, 05 Apr 2012 14:48:57 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=3589</guid>
		<description><![CDATA[Add Expires headers，就是向文档添加一个有效期，告诉浏览器这个文档的有效性和持久性。如果已有缓存，文档就可以从浏览器中的缓存(除已经过期)而不是从服务器读取。接着，客户端验证缓存中的副本，看看是否过期或者失效，以决定是否必须从服务器获得更新。简单来说就是优化了这项可以加快网站速度，对于不经常更新的文件，例如CSS、图片文件都很有用，下次访问就直接从浏览器读取而不用向服务器下载。]]></description>
			<content:encoded><![CDATA[<p><a rel="external" href="http://developer.yahoo.com/performance/rules.html#expires" title="Add Expires headers" target="_blank">Add Expires headers</a>，就是向文档添加一个有效期，告诉浏览器这个文档的有效性和持久性。如果已有缓存，文档就可以从浏览器中的缓存(除已经过期)而不是从服务器读取。接着，客户端验证缓存中的副本，看看是否过期或者失效，以决定是否必须从服务器获得更新。简单来说就是优化了这项可以加快网站速度，对于不经常更新的文件，例如CSS、图片文件都很有用，下次访问就直接从浏览器读取而不用向服务器下载。<br />
<span id="more-3589"></span><br />
添加方法很简单，编辑.htaccess文件添加以下代码就可以了，注意第二行的ExpiresDefault "access plus 30 days"，表示所有文档默认有效期为30天，但可以被具体文档设定的有效期改变，例如我第三行的CSS文件就设定有效期为一年。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ifmodule expires_module&gt;
ExpiresActive On
ExpiresDefault &quot;access plus 30 days&quot;
ExpiresByType text/css   &quot;access plus 1 years&quot;
ExpiresByType text/html  &quot;access plus 1 years&quot;
ExpiresByType image/gif  &quot;access plus 1 years&quot;
ExpiresByType image/jpeg &quot;access plus 1 years&quot;
ExpiresByType image/jpg  &quot;access plus 1 years&quot;
ExpiresByType image/png  &quot;access plus 1 years&quot;
ExpiresByType image/x-icon &quot;access plus 1 years&quot;
ExpiresByType application/x-javascript &quot;access plus 30 days&quot;
&lt;/ifmodule&gt;</pre></td></tr></table></div>

<p>这个缓存只对本地服务器上的文档有效，像我这样外链有gravatar、google等的文件都是无效的，外链服务器设定他们的有效期只有5分钟，YSlow优化建议添加更长的时间，所以评分还是F。本博客首页跑分只有87分，还差3分才能达A。其它具体设置请按需自行设置，更多用法请参考：<a rel="external" href="http://httpd.apache.org/docs/2.0/mod/mod_expires.html" title="Apache Module mod_expires" target="_blank">Apache Module mod_expires</a>和<a rel="external" href="http://www.w3school.com.cn/media/media_mimeref.asp" title="MIME 参考手册" target="_blank">MIME 参考手册</a></p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="YSlow优化之Add Expires headers" href="http://hillboy.org/articles/add-expires-headers.html">YSlow优化之Add Expires headers</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/add-expires-headers.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>自定义WordPress侧边栏小工具显示页面</title>
		<link>http://hillboy.org/articles/widget-logic.html</link>
		<comments>http://hillboy.org/articles/widget-logic.html#comments</comments>
		<pubDate>Mon, 02 Apr 2012 09:00:41 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=3578</guid>
		<description><![CDATA[很多时候我们需要将某些侧边栏在指定的页面中显示，例如让友情链接只在首页显示或者只在文章页显示，可以通过修改代码来达到效果。但对于我这种懒人或者菜鸟来说，当然希望能够有个插件直接帮我完成工作不用麻烦修改代码。Widget Logic就是这样一个插件，可以自定义WordPress小工具在那些显示中页面。]]></description>
			<content:encoded><![CDATA[<p>很多时候我们需要将某些侧边栏在指定的页面中显示，例如让友情链接只在首页显示或者只在文章页显示，可以通过修改代码来达到效果。但对于我这种懒人或者菜鸟来说，当然希望能够有插件直接帮我完成工作不用麻烦修改代码。Widget Logic就是这样一个插件，可以自定义WordPress小工具在那些显示中页面。<br />
<span id="more-3578"></span><br />
安装很简单，直接登陆你的wp博客后台，在安装插件那里搜索“Widget Logic”安装即可。安装后打开后台小工具页面，再展开自定义的模块会看到下面都多了一个Widget logic的栏目，如图：</p>
<p><img src="http://hillboy.org/upload/2012/04/Widget-Logic.png" alt="Widget-Logic" title="Widget-Logic" width="434" height="462" class="aligncenter" /></p>
<p>使用方法也很简单，只要在后面空白处填写上相对应的代码即可。例如上图中我打开的赞助模块，在后面空白处填写上“is_home()”并保存就可以了，“is_home()”表示这个模块只在首页中显示，如果我填上的是“is_single()”，就表示这个模块只在文章页中显示。</p>
<p>下面再附注些从网上收集来的关于Widget Logic 插件使用的一些常用设置代码：</p>
<p><code>is_home() 主页<br />
is_single() 文章页<br />
is_page() 页面<br />
is_category() 文章分类页<br />
is_tag() 文章标签页<br />
is_archive() 归档页<br />
is_404() 404页<br />
is_search() 搜索结果页<br />
is_feed() 订阅页</code></p>
<p>Widget Logic插件代码还可以使用语法，||表示或，&#038;&#038;表示和，!表示非，使用语法可以更加灵活的定义显示页面，语法示例如下：</p>
<p><code>!is_home() 除主页以外的页面显示<br />
!is_category(4) 仅在ID非4的分类显示<br />
is_home() || is_category('movies') 在主页或名称为movies的分类显示<br />
is_page('about') 仅在名称为about的页面显示<br />
is_home()&#038;&#038;!is_paged() 在首页显示，分页不显示</code></p>
<p>更多的用法请参考：<a rel="external nofollow" href="http://wordpress.org/extend/plugins/widget-logic/other_notes/" title="http://wordpress.org/extend/plugins/widget-logic/other_notes/" target="_blank">Widget Logic</a></p>
<p>不使用插件也能实现侧边栏自定义显示页面的方法，编辑sidebar.php文件：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_home <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;!</span>is_paged<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!-- categories --&gt;
&lt;li class=&quot;widget widget_categories&quot;&gt;
&lt;h3&gt;Categories&lt;/h3&gt;
&lt;ul&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_cats<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sort_column=name&amp;optioncount=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ul&gt;
&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>其实就是在你想要定义的小工具前后添加一段判断页面的代码就OK了。</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="自定义WordPress侧边栏小工具显示页面" href="http://hillboy.org/articles/widget-logic.html">自定义WordPress侧边栏小工具显示页面</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/widget-logic.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>给wordpress后台的链接XFN关系加上&quot;external&quot;和&quot;nofollow&quot;选项</title>
		<link>http://hillboy.org/articles/wp-xfn-external-nofollow.html</link>
		<comments>http://hillboy.org/articles/wp-xfn-external-nofollow.html#comments</comments>
		<pubDate>Wed, 28 Mar 2012 17:08:16 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=3580</guid>
		<description><![CDATA[XFN（全称XHTML Friends Network）是一种用现超链接来表现人际关系的方式。近年来，blog和blogroll在互联网上增长迅速。XFN允许互联网内容创造者通过在&#60;a&#62;标签里添加rel属性来表明自己与被链接者的关系。wordpress后台的链接里内置了XFN关系，添加链接时可以选择XFN关系从而更好地描述你与链接之间的人际关系。对于一些有优化需求的博客，可参考本文教程对wordpress后台的链接添加 external 和 nofollow 属性。]]></description>
			<content:encoded><![CDATA[<p><a href="http://gmpg.org/xfn/" title="XFN" rel="license" target="_blank">XFN</a>（全称XHTML Friends Network）是一种用现超链接来表现人际关系的方式。近年来，blog和blogroll在互联网上增长迅速。XFN允许互联网内容创造者通过在&lt;a&gt;标签里添加rel属性来表明自己与被链接者的关系。wordpress后台的链接里内置了XFN关系，添加链接时可以选择XFN关系从而更好地描述你与链接之间的人际关系。对于一些有优化需求的博客，可参考本文教程对wordpress后台的链接添加 external 和 nofollow 属性。<br />
<span id="more-3580"></span><br />
打开wp-admin/includes/meta-boxes.php文件<br />
搜索：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;table class=&quot;links-table&quot; cellspacing=&quot;0&quot;&gt;</pre></div></div>

<p><strong>在第二个tr的上面加入以下代码：</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;tr&gt;
&lt;th scope=&quot;row&quot;&gt; external nofollow &lt;/th&gt;
&lt;td&gt;&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt; external nofollow &lt;/span&gt;&lt;/legend&gt;
&lt;label for=&quot;external&quot;&gt;
&lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;external&quot; value=&quot;external&quot; id=&quot;external&quot; &lt;?php xfn_check('external'); ?&gt; /&gt;external&lt;/label&gt;
&lt;label for=&quot;nofollow&quot;&gt;
&lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;nofollow&quot; value=&quot;nofollow&quot; id=&quot;nofollow&quot; &lt;?php xfn_check('nofollow'); ?&gt; /&gt;nofollow&lt;/label&gt;
&lt;/fieldset&gt;&lt;/td&gt;
&lt;/tr&gt;</pre></td></tr></table></div>

<p><strong>修改后如下图所示：</strong></p>
<p><img src="http://hillboy.org/upload/2012/03/xfn.png" alt="wordpress后台的链接XFN关系" title="wordpress后台的链接XFN关系" width="500" height="383" class="aligncenter" /></p>
<p>到后台中的链接中查看下是否正确添加。麻烦的地方就是每次升级wordpress都要手动修改，需要插件版的请点击这里：<a href="http://www.slyar.com/blog/wordpress-add-nofollow-to-xfn.html" title="WordPress插件:给链接XFN关系增加一个nofollow标签" rel="author nofollow" target="_blank">WordPress插件:给链接XFN关系增加一个nofollow标签</a></p>
<p><a href="http://support.google.com/webmasters/bin/answer.py?hl=zh-Hans&#038;answer=96569" title="关于 rel=nofollow 属性" rel="bookmark" target="_blank">关于 rel="external nofollow" 属性</a> 建议请勿对友情链接添加，这样会产生不公平的行为。本文参考网络上的文章后自行摘写。</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="给wordpress后台的链接XFN关系加上"external"和"nofollow"选项" href="http://hillboy.org/articles/wp-xfn-external-nofollow.html">给wordpress后台的链接XFN关系加上"external"和"nofollow"选项</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/wp-xfn-external-nofollow.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>给网站添加回到顶部按钮</title>
		<link>http://hillboy.org/articles/go-top-button.html</link>
		<comments>http://hillboy.org/articles/go-top-button.html#comments</comments>
		<pubDate>Wed, 28 Mar 2012 12:34:20 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=3581</guid>
		<description><![CDATA[一直就想给博客添加个类似新浪微博右边的回到顶部按钮，奈何自己不懂这些网站代码设计的东西。直到前天mg12的博客发了篇新博文（jQuery 跟随浏览器窗口的回到顶部按钮）介绍了添加方法和脚本之后才动手搞了个，具体演示可以看我的博客右下方。]]></description>
			<content:encoded><![CDATA[<p>一直就想给博客添加个类似新浪微博右边的回到顶部按钮，奈何自己不懂这些网站代码设计的东西。直到前天mg12的博客发了篇新博文（<a href="http://www.neoease.com/fixed-go-top-button-to-browser-window-with-jquery/" title="jQuery 跟随浏览器窗口的回到顶部按钮" rel="author nofollow external" target="_blank">jQuery 跟随浏览器窗口的回到顶部按钮</a>）介绍了添加方法和脚本之后才动手搞了个，具体演示可以看我的博客右下方。<br />
<span id="more-3581"></span><br />
<strong>参数描述：</strong></p>
<ul>
<li>pageWidth: 页面宽度(正整数)，如图中 A 所示。</li>
<li>nodeId: 回到顶部按钮的 ID (字符串)。</li>
<li>nodeWidth: 回到顶部按钮的宽度 (正整数), 如图中 B 所示。</li>
<li>distanceToBottom: 回到顶部按钮到页面底部的距离 (正整数)，如图中 C 所示。</li>
<li>hideRegionHeight: 不显示回到顶部按钮的顶部区域高度 (正整数)，如图中 D 所示。</li>
<li>text: 回到顶部按钮内显示的文本 (字符串)。</li>
</ul>
<p><img src="http://hillboy.org/upload/2012/03/go-top.png" alt="回到顶部按钮" title="回到顶部按钮" width="500" height="320" class="aligncenter" /></p>
<p><strong>1.下载所需文件</strong></p>
<p>下载一个Go Top功能脚本，<a rel="external nofollow" href="http://vdisk.weibo.com/s/3VFT0" target="_blank">点击下载（Go Top+滚动效果）</a> ，或者参考我博客的js文件 //gotop 和 //滚动效果 部分，可直接复制使用。</p>
<p><strong>2.插入 JavaScript 和添加执行脚本</strong></p>
<p>将下载的JS文件放置到自己的网站上，在页面底部之前加入代码，例子如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;!--</span> 可添加google的jQuery库 <span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;go-top.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;!--</span>Go Top功能脚本<span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #009966; font-style: italic;">/* &lt; ![CDATA[ */</span>
<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GoTop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	pageWidth		<span style="color: #339933;">:</span><span style="color: #CC0000;">980</span><span style="color: #339933;">,</span>
	nodeId			<span style="color: #339933;">:</span><span style="color: #3366CC;">'go-top'</span><span style="color: #339933;">,</span>
	nodeWidth		<span style="color: #339933;">:</span><span style="color: #CC0000;">50</span><span style="color: #339933;">,</span>
	distanceToBottom	<span style="color: #339933;">:</span><span style="color: #CC0000;">125</span><span style="color: #339933;">,</span>
	hideRegionHeight	<span style="color: #339933;">:</span><span style="color: #CC0000;">130</span><span style="color: #339933;">,</span>
	text			<span style="color: #339933;">:</span><span style="color: #3366CC;">'Top'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009966; font-style: italic;">/* ]]&gt; */</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p><strong>3.修改网站样式文件</strong></p>
<p>加入回到顶部按钮对应的样式, 假设回到顶部按钮 ID 设置为 go-top, 那么可以添加代码如下:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #cc00cc;">#go-</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#E6E6E6</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span><span style="color: #933;">25px</span><span style="color: #00AA00;">;</span>text-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>text-decoration<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>line-<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">25px</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
a<span style="color: #cc00cc;">#go-</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>可以自行修改css样式，但 width 请与脚本参数中的 nodeWidth 保持一致。</p>
<p>其实就很简单的添加一段代码和上传一个js文件，大家按着教程来做都可以做好的，适合任何网站添加哦。</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="给网站添加回到顶部按钮" href="http://hillboy.org/articles/go-top-button.html">给网站添加回到顶部按钮</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/go-top-button.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>iphone4常用文件、文件夹信息</title>
		<link>http://hillboy.org/articles/iphone4-files.html</link>
		<comments>http://hillboy.org/articles/iphone4-files.html#comments</comments>
		<pubDate>Sun, 08 May 2011 06:08:38 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=3521</guid>
		<description><![CDATA[<span style="color: #ff0000;">系统声音的路径：</span>

/System/Library/Audio/UISounds

大家可以替换自己喜欢的音乐、需要取消删了就是，需要替换文件必须是 .caf后缀格式不大于5秒的音乐文件名字要一样哦。

信息
ReceivedMessage.caf--收到信息，仅在短信界面打开时播放。
sms-received1.caf-------三全音
sms-received2.caf-------管钟琴
sms-received3.caf-------玻璃]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">系统声音的路径：</span></p>
<p>/System/Library/Audio/UISounds</p>
<p>大家可以替换自己喜欢的音乐、需要取消删了就是，需要替换文件必须是 .caf后缀格式不大于5秒的音乐文件名字要一样哦。</p>
<p>信息<br />
ReceivedMessage.caf--收到信息，仅在短信界面打开时播放。<br />
sms-received1.caf-------三全音<br />
sms-received2.caf-------管钟琴<br />
sms-received3.caf-------玻璃<br />
sms-received4.caf-------圆号<br />
sms-received5.caf-------铃声<br />
sms-received6.caf-------电子乐<br />
SentMessage.caf--------发送信息<br />
<span id="more-3521"></span><br />
邮件<br />
mail-sent.caf----发送邮件<br />
new-mail.caf-----收到新邮件</p>
<p>电话<br />
dtmf-0.caf----------拨号面板0按键<br />
dtmf-1.caf----------拨号面板1按键<br />
dtmf-2.caf----------拨号面板2按键<br />
dtmf-3.caf----------拨号面板3按键<br />
dtmf-4.caf----------拨号面板4按键<br />
dtmf-5.caf----------拨号面板5按键<br />
dtmf-6.caf----------拨号面板6按键<br />
dtmf-7.caf----------拨号面板7按键<br />
dtmf-8.caf----------拨号面板8按键<br />
dtmf-9.caf----------拨号面板9按键<br />
dtmf-pound.caf---拨号面板＃按键<br />
dtmf-star.caf------拨号面板*按键<br />
Voicemail.caf-----新语音邮件</p>
<p>输入设备声音提示<br />
Tock.caf-----------------------点击键盘<br />
begin_record.caf-----------开始录音<br />
begin_video_record.caf--开始录像<br />
photoShutter.caf------------快门声<br />
end_record.caf--------------结束录音<br />
end_video_record.caf-----结束录像</p>
<p>其他<br />
beep-beep.caf--充电、注销及连接电脑<br />
lock.caf------------锁定手机<br />
shake.caf---------“这个还没搞清楚”<br />
unlock.caf--------滑动解锁<br />
low_power.caf--低电量提示</p>
<p>语音控制<br />
jbl_ambiguous.caf--找到多个匹配<br />
jbl_begin.caf------等待用户的输入<br />
jbl_cancel.caf-----取消<br />
jbl_confirm.caf----执行<br />
jbl_no_match.caf---没有找到匹配</p>
<p>日历<br />
alarm.caf--日历提醒<br />
iPod Touch 1G<br />
sq_alarm.caf<br />
sq_beep-beep.caf<br />
sq_lock.caf<br />
sq_tock.caf</p>
<p><span style="color: #ff0000;">运营商图标</span><br />
System/Library/Carrier Bundles/iPhone<br />
联通：46001<br />
移动：46000</p>
<p><span style="color: #ff0000;">修改移动滑块解锁文字</span><br />
/System/Library/CoreServices/SpringBoard.app/zh_CN.lproj</p>
<p><span style="color: #ff0000;">手动备份</span><br />
重刷固件前，请用iFunBox或用iphone folders连接你的小I，连接后就会看到手机里的全部目录，你要备份的文件在<br />
/private/var/mobile目录下的相关目录中~~~</p>
<p>其中Library下：AddressBook为通讯录、SMS为短信、Notes为备忘录、Calendar为日历、Mail为电邮、 Safari为收藏夹；</p>
<p>Media下： DCIM为相机拍的照片和截屏、Photos为电脑里同步进去的图片、iTunes_Control为音乐、电影、铃声文件；</p>
<p>通话记录的路径为：/private/var/wireless/Library/CallHistory/call_history.db</p>
<p>将上述你需要备份的目录备份在你的电脑上后，你就可以刷新固件了，刷好新固件后只需把你刚刚备份过的目录覆盖掉现有目录就可以了。看看你的通讯录以及短信是不是又回来了，呵呵。</p>
<p>新刷的固件如果遇到一些奇怪的问题，例如照片无法保存、备忘录不能保存等，大多是目录权限的问题，到上述的相应目录改一下权限，直接改为777试一下应该就可以了。</p>
<p>解决ios5越狱后cydia闪退问题<br />
把 //var/mobile/Library/Keyboard 文件夹复制到 //var/root/Library/</p>
<p>通过ifunbox拷贝到//var/root/media/cydia/autoinstall/</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="iphone4常用文件、文件夹信息" href="http://hillboy.org/articles/iphone4-files.html">iphone4常用文件、文件夹信息</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/iphone4-files.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>佛山地铁线路图</title>
		<link>http://hillboy.org/articles/fsmetro-map.html</link>
		<comments>http://hillboy.org/articles/fsmetro-map.html#comments</comments>
		<pubDate>Tue, 19 Oct 2010 08:52:08 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[资讯]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=3448</guid>
		<description><![CDATA[佛山地铁终于要开通了，搞了几年的工程终于有成果了，作为一个佛山市民，还是感到很高兴的。特意上网搜索一下线路图，找到佛山地铁的官网也没广州地铁那种直观的线路图片，然后突发奇想的去广州地铁的官网，让我找到了非常合适的线路图。]]></description>
			<content:encoded><![CDATA[<p>佛山地铁终于要开通了，搞了几年的工程终于有成果了，作为一个佛山市民，还是感到很高兴的。特意上网搜索一下线路图，找到佛山地铁的官网也没广州地铁那种直观的线路图片，然后突发奇想的去广州地铁的官网，让我找到了非常合适的线路图。<br />
<span id="more-3448"></span><br />
点击图片查看大图</p>
<p><a href="http://hillboy.org/upload/2010/10/fsmetro-map.jpg" target="_blank"><img class="aligncenter" title="佛山地铁线路图" src="http://hillboy.org/upload/2010/10/fsmetro-map.jpg" alt="佛山地铁线路图" width="500" height="433" /></a></p>
<p>我家附近就是南桂路站了，大家可以来找我玩喔~只招待女宾。</p>
<p>2012年4月26日更新一下最新的地铁线路图，包括广州地铁和佛山地铁，其实都一样的。</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="佛山地铁线路图" href="http://hillboy.org/articles/fsmetro-map.html">佛山地铁线路图</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/fsmetro-map.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>腾讯微博巧用缩短网址不出安全提示</title>
		<link>http://hillboy.org/articles/url-shortening-tencent.html</link>
		<comments>http://hillboy.org/articles/url-shortening-tencent.html#comments</comments>
		<pubDate>Sat, 24 Apr 2010 13:30:41 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=121</guid>
		<description><![CDATA[这腾讯微博，发个网址自动使用它的缩短网址功能，但这功能最不好的地方就是会出现安全提示，一条大的黑字提示“访问此网站可能导致不安全后果 !”还要同意它的免责声明才能继续访问，要不然你就自己复制网址到浏览器地址栏进去。]]></description>
			<content:encoded><![CDATA[<p>这腾讯微博，发个网址自动使用它的缩短网址功能，但这功能最不好的地方就是会出现安全提示，一条大的黑字提示“访问此网站可能导致不安全后果 !”还要同意它的免责声明才能继续访问，要不然你就自己复制网址到浏览器地址栏进去。</p>

<a href='http://hillboy.org/articles/url-shortening-tencent.html/url-shortening-tencent-1' title='直接自己网址的安全提示'><img width="128" height="56" src="http://hillboy.org/upload/2010/04/url-shortening-tencent-1.jpg" class="attachment-thumbnail" alt="直接自己网址的安全提示" title="直接自己网址的安全提示" /></a>
<a href='http://hillboy.org/articles/url-shortening-tencent.html/url-shortening-tencent-2' title='使用is.gd的安全提示'><img width="128" height="56" src="http://hillboy.org/upload/2010/04/url-shortening-tencent-2.jpg" class="attachment-thumbnail" alt="使用is.gd的安全提示" title="使用is.gd的安全提示" /></a>

<p>上面第一个图是直接输入我博客网址，然后腾讯微博缩短之后打开的提示，一般普通网站没有经过腾讯验证的都会出现这个提示。第二个图是我博客网址使用了is.gd缩短了一次网址之后，再用腾讯微博缩短之后打开出来的截图，竟然还说：</p>
<blockquote><p>您正在访问的网站被大量QQ用户举报。该网站可能存在一定的安全隐患。<br />
为了确保您的计算机安全，我们不建议您继续访问此网页。</p></blockquote>
<p>都不知道哪来的大量QQ用户举报，当然也有可能是很多危险网站利用is.gd缩短网址之后来发危险网址吧。经过我测试，用is.gd和twurl.nl这两个缩短网址都会出现第二图的提示不安全，要自行复制网址进去。</p>
<p>但我也发现了可以不出安全提示直接点击到达目标网址的方法，其实方法就是利用缩短网址功能先缩短一次然后再发腾讯微博上，既然上面能够出现不安全提示，当然也有信任的网址了，而且刚好信任的网址有提供缩短网址服务。</p>
<p><strong>呵呵，就是使用digg.com网址缩短功能先缩短目标网址，然后再发腾讯微博上，因为腾讯微博认为digg.com这个网址是安全的，所以没有任何提示就直接跳到目标网址上去了。</strong></p>
<p>给出几个链接大家可以测试一下，全部都是链接到我博客网址的：<a href="http://url.cn/1RDnJ1" target="_blank">这是使用了digg.com的</a>、<a href="http://url.cn/10fiVb" target="_blank">这是腾讯直接缩短我博客的</a>、<a href="http://url.cn/2YL9z8" target="_blank">这是使用了is.gd的</a>、<a href="http://url.cn/410N8E" target="_blank">这是使用了twurl.nl的</a>。其实就是麻烦自己方便别人，对于想访客直接访问到自己网站的人群适用。</p>
<p>PS：<br />
我也不知道digg.com的缩短网址服务在那里，因为我是直接使用twhirl这个客户端里自带的功能。<br />
使用goo.gl就是google的缩短网址也能不出安全提示，chrome浏览器可以使用goo.gl URL Shortener插件来获得goo.gl短网址。</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="腾讯微博巧用缩短网址不出安全提示" href="http://hillboy.org/articles/url-shortening-tencent.html">腾讯微博巧用缩短网址不出安全提示</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/url-shortening-tencent.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>解决了两个win7 64位问题</title>
		<link>http://hillboy.org/articles/solve-the-problem-for-two-win7-64.html</link>
		<comments>http://hillboy.org/articles/solve-the-problem-for-two-win7-64.html#comments</comments>
		<pubDate>Sat, 24 Apr 2010 12:38:49 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=120</guid>
		<description><![CDATA[第一个问题：是困扰了我很久的农行网银问题，网上很多方法解决网银不能用的问题，但他们的前提是能够检测得到K宝能正常驱动，而我是连K宝驱程都装不了系统识别不出。今晚再次上论坛看之前发的帖子，终于看到了一个解决方法，就是装个驱程，而那个驱程是网友发出来的非官方驱程，有不小的危险。]]></description>
			<content:encoded><![CDATA[<p>第一个问题：是困扰了我很久的农行网银问题，网上很多方法解决网银不能用的问题，但他们的前提是能够检测得到K宝能正常驱动，而我是连K宝驱程都装不了系统识别不出。今晚再次上论坛看之前发的帖子，终于看到了一个解决方法，就是装个驱程，而那个驱程是网友发出来的非官方驱程，有不小的危险。</p>
<p>但实在忍受不了每次用网银都要用另外一台电脑操作的麻烦，冒着危险的装了，反正就一个驱程而已，用卡巴斯基扫过没问题，而且最重要的是，我用网银要用K宝的，盗了我账号和密码也没用的。那驱程已经放上QQ邮箱的随身盘中去，需要的朋友可以问我要或自行google。</p>
<p>装好之后终于能够正常使用网银了，不过还是有个问题，要点击桌面上的那个农行图标打开才能使用，非常的不爽，这时候就可以用网上教的修改注册表方法来使用了，特意记录在此。</p>
<p>打开注册表编辑器<br />
（1）开始→运行→输入<code>regedit</code><br />
（2）64位win7下找到<br />
<code>[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Cryptography\Defaults\Provider\ZGHD Cryptographic Service Provider v1.0]</code><br />
将Image Path值修改为 <code>%SystemRoot%\SysWOW64\GP_MINCSP.dll</code></p>
<p>第二个问题：不能看网上QQlive直播，不知道为什么装它那个插件老是装不上，每次最后安装时都提示我不能正常安装，请在管理员账号下安装，郁闷的是我一直都在用Administration超级管理员号了。今晚再次尝试一次，而且是用IE直接上的，之前每次都是傲游下，看到了IE下方状态栏上提示禁用了某个什么东西，所以不能正常运行网页控件。然后在IE的管理加载项中，找到了名叫<code>QQCycloneHelper Class</code>被禁用的东西，启用之后可以正常使用QQlive的网页视频直播了。</p>
<p>总结，第一个问题要装非官方的东西，有一点危险性，这就看你够不够胆量装了，不过装了之后确实能够解决问题。第二个问题我网上搜索过，MS没人有这个问题，可能是我SB了。我本来在单位上下载了win7 32位系统了，准备刻碟装的，使用64位实在比较多麻烦事，想着省事装32位或者降回XP好了，但现在两个烦恼的问题已经解决了就不再需要了。</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="解决了两个win7 64位问题" href="http://hillboy.org/articles/solve-the-problem-for-two-win7-64.html">解决了两个win7 64位问题</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/solve-the-problem-for-two-win7-64.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>又有腾讯微博邀请码发了</title>
		<link>http://hillboy.org/articles/send-tqq-again.html</link>
		<comments>http://hillboy.org/articles/send-tqq-again.html#comments</comments>
		<pubDate>Fri, 23 Apr 2010 03:15:32 +0000</pubDate>
		<dc:creator>臻</dc:creator>
				<category><![CDATA[资讯杂谈]]></category>
		<category><![CDATA[资讯]]></category>

		<guid isPermaLink="false">http://hillboy.org/?p=3341</guid>
		<description><![CDATA[<del datetime="2010-04-23T05:23:40+00:00">发送腾讯微博邀请码，只有3个邀请，名额有限，先到先得，要的速度评论说要，邮箱填在评论框上就行了，不知道什么是微博的自己google或百毒去。</del>]]></description>
			<content:encoded><![CDATA[<p><del datetime="2010-04-23T05:23:40+00:00">发送腾讯微博邀请码，只有3个邀请，名额有限，先到先得，要的速度评论说要，邮箱填在评论框上就行了，不知道什么是微博的自己google或百毒去。</del></p>
<p>又没有了</p>
<div class="shengming">
<strong>声明:</strong> 本文遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" title="本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。" rel="license" target="_blank">BY-NC-SA 3.0</a> 协议. 转载请注明转自: <a rel="bookmark" title="又有腾讯微博邀请码发了" href="http://hillboy.org/articles/send-tqq-again.html">又有腾讯微博邀请码发了</a><div class="fixed"></div></div>]]></content:encoded>
			<wfw:commentRss>http://hillboy.org/articles/send-tqq-again.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

