﻿<?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>Dianso&#039;s Blog &#187; 談博說博</title>
	<atom:link href="http://014.cc/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://014.cc</link>
	<description>我思故我在</description>
	<lastBuildDate>Sun, 15 Jan 2012 04:38:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>WordPress插件 评论小秘书</title>
		<link>http://014.cc/comments-secretary</link>
		<comments>http://014.cc/comments-secretary#comments</comments>
		<pubDate>Mon, 11 Jul 2011 17:54:44 +0000</pubDate>
		<dc:creator>Dianso</dc:creator>
				<category><![CDATA[談博說博]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[评论]]></category>

		<guid isPermaLink="false">http://014.cc/?p=1777</guid>
		<description><![CDATA[昨天安装的一个插件，直接在后台搜索comments-secretary就可以安装。 插件简介：评论小秘书是一个基于中国移动飞信业务开发的一个插件。当博客收到新评论时，及时通过手机短信的方式提醒管理员收到新评论。 安装后，在设置界面输入手机号码和飞信密码，发送时间的两个选项是几点到几点接收短信。 登录用户和管理员发表评论不会发送短信提示。 可以点测试短息来测试是否成功。 还找了个定时发送天气预报到手机的小程序，PHP和Python的都有，我选择的PHP版本的。 首先在http://www.weather.com.cn搜索城市，比如搜索北京。 得到的URL：http://www.weather.com.cn/weather/101010100.shtml? 101010100就是城市号码。 下载程序，编辑weather.php，修改里面的手机号码，密码，城市号码。 这个是通过飞信自己给自己发，也可以给好友发送。 然后上传就可以了，计划任务让它定时执行。 我试了下，直接通过php运行的时候会出错，在浏览器访问是没问题的，最好放到别人不知道的路径，否则每次打开这个PHP文件都会收到一条短信。 /usr/local/bin/php /home/weather.php 这样执行会出错，于是安装lynx浏览器，这个是命令行浏览器，centos直接yum install lynx就可以了。 然后定时执行，让它每天下午一点发送天气情况到手机： crontab -e<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="100个最实用的WordPress插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2009%2F03%2F100-most-useful-wordpress-plugins%2F&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/05/17/8821533.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">100个最实用的WordPress插件 (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress SEO 优化插件：Platinum SEO修正版" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2009%2F03%2Foptimize-wordpress-seo-plug-ins-platinum-seo-revision%2F&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/08/19/23586132.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress SEO 优化插件：Platinum SEO修正版 (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件之FireStats" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F103&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/02/13/2696214.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件之FireStats</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress 评论滑动显示" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fslider&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress 评论滑动显示</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress免插件实现五类文章输出" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F939&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress免插件实现五类文章输出</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>昨天安装的一个插件，直接在后台搜索comments-secretary就可以安装。</p>
<p>插件简介：评论小秘书是一个基于中国移动飞信业务开发的一个插件。当博客收到新评论时，及时通过手机短信的方式提醒管理员收到新评论。</p>
<p>安装后，在设置界面输入手机号码和飞信密码，发送时间的两个选项是几点到几点接收短信。</p>
<p>登录用户和管理员发表评论不会发送短信提示。</p>
<p>可以点测试短息来测试是否成功。</p>
<hr />
<p>还找了个定时发送天气预报到手机的小程序，PHP和Python的都有，我选择的PHP版本的。</p>
<p>首先在http://www.weather.com.cn搜索城市，比如搜索北京。</p>
<p>得到的URL：http://www.weather.com.cn/weather/101010100.shtml?</p>
<p>101010100就是城市号码。</p>
<p>下载程序，编辑weather.php，修改里面的手机号码，密码，城市号码。</p>
<pre class="brush: php; title: ; notranslate">
define('PHONE','手机号码');
define('PHONEPASW','密码');
include './class.php';

$fetion-&gt;send('发送给哪个手机号码', '城市号码');
</pre>
<p>这个是通过飞信自己给自己发，也可以给好友发送。</p>
<p>然后上传就可以了，计划任务让它定时执行。</p>
<p>我试了下，直接通过php运行的时候会出错，在浏览器访问是没问题的，最好放到别人不知道的路径，否则每次打开这个PHP文件都会收到一条短信。</p>
<p>/usr/local/bin/php /home/weather.php</p>
<p>这样执行会出错，于是安装lynx浏览器，这个是命令行浏览器，centos直接yum install lynx就可以了。</p>
<p>然后定时执行，让它每天下午一点发送天气情况到手机：</p>
<p>crontab  -e</p>
<pre class="brush: php; title: ; notranslate">
0 13 * * * lynx -dump http://xxx.xxx/weather.php
</pre>
注意：该页面嵌入了下载文件，请访问 <a href="http://014.cc/comments-secretary">该页面</a>下载该文件。
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="100个最实用的WordPress插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2009%2F03%2F100-most-useful-wordpress-plugins%2F&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/05/17/8821533.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">100个最实用的WordPress插件 (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress SEO 优化插件：Platinum SEO修正版" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2009%2F03%2Foptimize-wordpress-seo-plug-ins-platinum-seo-revision%2F&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/08/19/23586132.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress SEO 优化插件：Platinum SEO修正版 (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress插件之FireStats" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F103&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/02/13/2696214.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress插件之FireStats</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress 评论滑动显示" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fslider&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress 评论滑动显示</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress免插件实现五类文章输出" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F939&from=http%3A%2F%2F014.cc%2Fcomments-secretary">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress免插件实现五类文章输出</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://014.cc/comments-secretary/feed</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>WP-PostViews 统计总浏览数</title>
		<link>http://014.cc/postviews</link>
		<comments>http://014.cc/postviews#comments</comments>
		<pubDate>Tue, 16 Nov 2010 12:33:00 +0000</pubDate>
		<dc:creator>Dianso</dc:creator>
				<category><![CDATA[談博說博]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[统计]]></category>

		<guid isPermaLink="false">http://014.cc/?p=1047</guid>
		<description><![CDATA[WordPress本身文章没统计文章浏览数功能，所以只能用插件了，我使用的是WP-PostViews来统计文章浏览数，这个插件很久没更新了，而这个插件默认是没有统计总浏览数的功能的。 我爱水煮鱼写过一篇文章，安装一个插件就可以在后台显示每篇文章的浏览数，如图： 下载已删除，最新版的插件已集成。 统计总浏览数可以这样实现，首先把下面代码加入到functions.php 然后在要调用的地方，比如侧边(sidebar.php)加上 效果可以看我的侧边上 ----------------------------------------------- 最新版的插件，上面两个功能全默认带了，不需要这样弄了。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="wordpress 调用RSS函数 get_rss wp_rss fetch_rss fetch_feed" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwordpress-get_rss-wp_rss-fetch_rss-fetch_feed&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/12/11/12211608.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress 调用RSS函数 get_rss wp_rss fetch_rss fetch_feed (@bfya)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress 经常500 Internal Server Error 后 安装数据库自动备份email插件 WP-DB-Backup (wp_wpmm_log 表是做什么用的)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwordpress-500&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/12/06/11959822.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress 经常500 Internal Server Error 后 安装数据库自动备份email插件 WP-DB-Backup (wp_wpmm_log 表是做什么用的) (@bfya)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress统计代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F910&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress统计代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress默认统计代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F251&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress默认统计代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="删除一些统计工具" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F534&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/29/7086517.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">删除一些统计工具</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>WordPress本身文章没<span class='wp_keywordlink'><a href="http://014.cc/tag/统计" title="统计">统计</a></span>文章浏览数功能，所以只能用插件了，我使用的是WP-PostViews来统计文章浏览数，这个插件很久没更新了，而这个插件默认是没有统计总浏览数的功能的。</p>
<p>我爱水煮鱼写过<a href="http://fairyfish.net/2009/07/23/postviews-for-admin/" target="_blank">一篇文章</a>，安装一个插件就可以在后台显示每篇文章的浏览数，如图：</p>
<p><a href="http://s.014.cc/2010/08/postviews.jpg"><img src="http://s.014.cc/2010/08/postviews.jpg" alt="postviews" title="postviews" /></a></p>
<p>下载已删除，最新版的插件已集成。</p>
<p>统计总浏览数可以这样实现，首先把下面代码加入到functions.php</p>
<pre class="brush: php; title: ; notranslate">
/* Display Total Views */
if(!function_exists('get_totalviews')) {
	function get_totalviews($display = true) {
		global $wpdb;
		$total_views = $wpdb-&gt;get_var(&quot;SELECT SUM(meta_value+0) FROM $wpdb-&gt;postmeta WHERE meta_key = 'views'&quot;);
		if($display) {
			echo number_format($total_views);
		} else {
			return number_format($total_views);
		}
	}
}
</pre>
<p>然后在要调用的地方，比如侧边(sidebar.php)加上</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_totalviews(); ?&gt;
</pre>
<p>效果可以看我的侧边上  <img src='http://s.014.cc/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' />  </p>
<p>-----------------------------------------------</p>
<p>最新版的插件，上面两个功能全默认带了，不需要这样弄了。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="wordpress 调用RSS函数 get_rss wp_rss fetch_rss fetch_feed" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwordpress-get_rss-wp_rss-fetch_rss-fetch_feed&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/12/11/12211608.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress 调用RSS函数 get_rss wp_rss fetch_rss fetch_feed (@bfya)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress 经常500 Internal Server Error 后 安装数据库自动备份email插件 WP-DB-Backup (wp_wpmm_log 表是做什么用的)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwordpress-500&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/12/06/11959822.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress 经常500 Internal Server Error 后 安装数据库自动备份email插件 WP-DB-Backup (wp_wpmm_log 表是做什么用的) (@bfya)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress统计代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F910&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress统计代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress默认统计代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F251&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress默认统计代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="删除一些统计工具" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F534&from=http%3A%2F%2F014.cc%2Fpostviews">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/29/7086517.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">删除一些统计工具</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://014.cc/postviews/feed</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>WordPress完美解决文章ID不连续问题</title>
		<link>http://014.cc/a1</link>
		<comments>http://014.cc/a1#comments</comments>
		<pubDate>Sun, 26 Sep 2010 17:41:54 +0000</pubDate>
		<dc:creator>Dianso</dc:creator>
				<category><![CDATA[談博說博]]></category>
		<category><![CDATA[ID]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[文章]]></category>

		<guid isPermaLink="false">http://014.cc/?p=1040</guid>
		<description><![CDATA[我的WP的文章ID早就乱了，都5000多了，想改回来，一个一个改的话太累，于是就一直没改，今天在露兜博客看到了这个方法，很简单，我也改好了，ID又变成一千多了。 方法如下： 一、禁用文章修订版 在 wp-config.php文件中添加： 二、删除文章修订版 三、删除不必要的附件/span> 比如通过媒体库上传的图片，音乐等文件 四、禁用自动保存/span> 我直接用了Disable Autosave插件 五、重新排列不连续的文章ID/span> ------------------------------------------------------------------------------------ 还有个问题让我无解，我的永久链接是/%postname%这样的，每篇文章从1开始计算，到现在已经999了，这个是1000，但是014.cc/1000这样的链接会404，我用其他域名建立WP也发现了，不能用1000作为postname，不知道为什么，既然这样，那么以后也不用这种方法了。 ------------------------------------------------------------------------------------ 还有个很有用的东西，WordPress一键填写评论者信息。 使用方法： 使用方法：在下面的信息输入框中输入对应的信息，点击生成代码，拖拽下面的链接“快速填写WP评论信息”到您的书签工具栏或者右键单击链接把它添加到您的收藏夹中即可，以后在要评论的页面，点击该书签，所有的信息就自动填上去了，是不是很酷呢？ 昵称(必须)： 邮箱地址(必须)： 站点： 拖拽下面的链接到您的书签工具栏或者右键单击链接把它添加到您的收藏夹中可创建一个快速填写WP评论者信息的快捷方式。快速填写WP评论信息 ------------------------------------------------------------------------------------ 最后祝大家国庆快乐<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="重新排序你的WordPress文章ID" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2011%2F04%2Fwordpress-reorder-your-article-id%2F&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/12/5279439.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">重新排序你的WordPress文章ID (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 主题简明教程" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2008%2F02%2Fwordpress-theme-concise-guide%2F&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/15/12190004.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 主题简明教程 (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 3.1 自定义文章类型索引页" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F830&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 3.1 自定义文章类型索引页</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在wordpress第一篇文章后插入内容" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F930&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在wordpress第一篇文章后插入内容</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress免插件实现五类文章输出" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F939&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress免插件实现五类文章输出</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>我的WP的文章ID早就乱了，都5000多了，想改回来，一个一个改的话太累，于是就一直没改，今天在<a href="http://www.ludou.org/" target="_blank">露兜博客</a>看到了这个<a href="http://www.ludou.org/wordpress-post-id-continuous.html" target="_blank">方法</a>，很简单，我也改好了，ID又变成一千多了。</p>
<p>方法如下：</p>
<p><span style="color:#008800">一、禁用文章修订版</span></p>
<p>在 wp-config.php文件中添加：</p>
<pre class="brush: php; title: ; notranslate">
define('WP_POST_REVISIONS', false);
</pre>
<p><span style="color:#008800">二、删除文章修订版</span></p>
<pre class="brush: sql; title: ; notranslate">
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision';
</pre>
<p><span style="color:#008800">三、删除不必要的附件/span></p>
<p>比如通过媒体库上传的图片，音乐等文件</p>
<p><span style="color:#008800">四、禁用自动保存/span></p>
<p>我直接用了Disable Autosave插件</p>
<p><span style="color:#008800">五、重新排列不连续的文章ID/span></p>
注意：该页面嵌入了下载文件，请访问 <a href="http://014.cc/a1">该页面</a>下载该文件。
<p>------------------------------------------------------------------------------------</p>
<p>还有个问题让我无解，我的永久链接是/%postname%这样的，每篇文章从1开始计算，到现在已经999了，这个是1000，但是014.cc/1000这样的链接会404，我用其他域名建立WP也发现了，不能用1000作为postname，不知道为什么，既然这样，那么以后也不用这种方法了。</p>
<p>------------------------------------------------------------------------------------</p>
<p>还有个很有用的东西，<a href="http://www.kisa747.com/auto-comment-author-info.html"  target="_blank">WordPress一键填写评论者信息</a>。</p>
<p>使用方法：</p>
<blockquote><p>
使用方法：在下面的信息输入框中输入对应的信息，点击生成代码，拖拽下面的链接“快速填写WP评论信息”到您的书签工具栏或者右键单击链接把它添加到您的收藏夹中即可，以后在要评论的页面，点击该书签，所有的信息就自动填上去了，是不是很酷呢？
</p></blockquote>
<p><script type="text/javascript"> 
(function($){
	$(document).ready(function() {
		$('.code_result').hide();
		$('#generate_code').click(function(){
			var re = /^[0-9a-zA-Z]+([\.\-\_][0-9a-zA-Z]+)*@[0-9a-zA-Z]+([\.\-][0-9a-zA-Z]+)*.[a-zA-Z]+$/;
			if($('#commenter_author').val() == '') {
				$('#commenter_author').css('border', 'solid 1px #ff0000');
				$('#commenter_author').focus();
			} else if(!re.test($('#commenter_email').val())) {
				$('#commenter_email').css('border', 'solid 1px #ff0000');
				$('#commenter_email').focus();
			} else {
				var commenter_code = 'javascript:document.getElementById(\'author\').value = \''+$('#commenter_author').val()+'\'; document.getElementById(\'email\').value = \''+$('#commenter_email').val()+'\'; document.getElementById(\'url\').value = \''+$('#commenter_url').val()+'\'; void(0)';
				$('#wp_commenter_code').html(commenter_code);
				$('.code_result>a').attr('href', commenter_code);
				$('.code_result').show();
			}
		});
		$('#cheon_code_generator input').keyup(function() {
			$(this).css('border', 'solid 1px #000000');
		});
	});
})(jQuery);
</script></p>
<div id="cheon_code_generator" style="padding:10px;">
<p>昵称(必须)：</p>
<input type="text" value="" name="commenter_author" id="commenter_author" style="border:solid 1px #000;">
<p>邮箱地址(必须)：</p>
<input type="text" value="" name="commenter_email" id="commenter_email" style="border:solid 1px #000;">
<p>站点：</p>
<input type="text" value="" name="commenter_url" id="commenter_url" style="border:solid 1px #000;">
<p><textarea cols="40" rows="10" name="wp_commenter_code" id="wp_commenter_code" style="border:solid 1px #000;"></textarea></p>
<input type="button" value="生成代码" id="generate_code" style="border:solid 1px #000;">
<p class="code_result" style="display:none;">拖拽下面的链接到您的书签工具栏或者右键单击链接把它添加到您的收藏夹中可创建一个快速填写WP评论者信息的快捷方式。<br /><a href="#"><strong>快速填写WP评论信息</strong></a></p>
</div>
<p>------------------------------------------------------------------------------------<br />
最后祝大家国庆快乐 <img src='http://s.014.cc/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' />  </p>
<p><img src="http://s.014.cc/2010/10/guobao.jpg" alt="国宝" title="panda"/></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="重新排序你的WordPress文章ID" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2011%2F04%2Fwordpress-reorder-your-article-id%2F&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/12/5279439.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">重新排序你的WordPress文章ID (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 主题简明教程" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2008%2F02%2Fwordpress-theme-concise-guide%2F&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/15/12190004.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 主题简明教程 (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 3.1 自定义文章类型索引页" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F830&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 3.1 自定义文章类型索引页</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在wordpress第一篇文章后插入内容" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F930&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在wordpress第一篇文章后插入内容</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress免插件实现五类文章输出" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F939&from=http%3A%2F%2F014.cc%2Fa1">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress免插件实现五类文章输出</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://014.cc/a1/feed</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>WordPress主题functions技巧</title>
		<link>http://014.cc/functions</link>
		<comments>http://014.cc/functions#comments</comments>
		<pubDate>Tue, 07 Sep 2010 16:56:36 +0000</pubDate>
		<dc:creator>Dianso</dc:creator>
				<category><![CDATA[談博說博]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[技巧]]></category>

		<guid isPermaLink="false">http://014.cc/?p=5488</guid>
		<description><![CDATA[以前每次折腾博客的时候，尤其是要往主题的functions.php添加功能的时候总要出错几次，还的重新上传文件才能解决，很麻烦。 也有好几个人留言说这样的情况了，我是暑假的时候在winysky博客上看到他说自己的主题结构，发现了include all PHP script这个功能，方法很简单。 在主题functions.php添加下面的代码： 然后在主题文件夹建立一个名为apps的文件夹，然后需要什么功能了，在这个文件夹内直接建立一个php文件就可以了，名称随意。 比如我要添加头像缓存这个功能，建立一个php文件，编码utf-8，内容如下： 然后在wp根目录建立个avatar文件夹就可以了，需要主题的是php文件头部一定要加 这样有什么好处呢，如果代码有错误，直接删除相关的php文件就可以，不必每次都备份上传functions文件了。 -----------------------------------------------唠叨分割线------------------------------------------------ 开学了，我最近在干什么呢，课还是那样，不算多，交完了学费，排队真是困难，排了几个小时队，今天系里来人说让交钱时候小心，新班导携款逃跑。 偶尔研究下魔兽作弊，在d3scene这个国外论坛上找到了很多dll文件，直接注入就可以作弊了，比如刷钱，支持浩方，VS，Q对战平台，局域网。 还有就是博客的spam留言太多了，几天登陆一次博客，删的手都累。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress 主题函数使用技巧收集" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F948&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 主题函数使用技巧收集</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题模板优先级顺序" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fwordpress_theme&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题模板优先级顺序</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="西风私用Thunder主题免费下载了" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fparan-thunder-theme&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/29/7089035.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">西风私用Thunder主题免费下载了</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fwordpress&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress目录文件结构" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fwordpress_files&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress目录文件结构</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>以前每次折腾博客的时候，尤其是要往主题的functions.php添加功能的时候总要出错几次，还的重新上传文件才能解决，很麻烦。</p>
<p>也有好几个人<span class='wp_keywordlink'><a href="http://014.cc/x" title="给我留言吧">留言</a></span>说这样的情况了，我是暑假的时候在<a href="http://winysky.com" target="_blank">winysky</a>博客上看到他说自己的主题结构，发现了include all PHP script这个功能，方法很简单。</p>
<p>在主题functions.php添加下面的代码：</p>
<pre class="brush: php; title: ; notranslate">

define('theme_apps', TEMPLATEPATH.'/apps');
IncludeAll( theme_apps );
/**
 * include all PHP script
 */
function IncludeAll($dir){
	$dir = realpath($dir);
	if($dir){
		$files = scandir($dir);
		sort($files);
		foreach($files as $file){
			if($file == '.' || $file == '..'){
				continue;
			}elseif(preg_match('/\.php$/i', $file)){
				include_once $dir.'/'.$file;
			}
		}
	}
}
</pre>
<p>然后在主题文件夹建立一个名为apps的文件夹，然后需要什么功能了，在这个文件夹内直接建立一个php文件就可以了，名称随意。</p>
<p>比如我要添加头像缓存这个功能，建立一个php文件，编码utf-8，内容如下：</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/* Mini Gavatar Cache by Willin Kan. */
function my_avatar($avatar) {
  $tmp = strpos($avatar, 'http');
  $g = substr($avatar, $tmp, strpos($avatar, &quot;'&quot;, $tmp) - $tmp);
  $tmp = strpos($g, 'avatar/') + 7;
  $f = substr($g, $tmp, strpos($g, &quot;?&quot;, $tmp) - $tmp);
  $w = get_bloginfo('wpurl');
  $e = ABSPATH .'avatar/'. $f .'.jpg';
  $t = 1209600; //設定14天, 單位:秒
  if ( !is_file($e) || (time() - filemtime($e)) &gt; $t ) { //當頭像不存在或文件超過14天才更新
    copy(htmlspecialchars_decode($g), $e);
  } else  $avatar = strtr($avatar, array($g =&gt; $w.'/avatar/'.$f.'.jpg'));
  if ( filesize($e) &lt; 500 ) copy($w.'/avatar/default.jpg', $e);
  return $avatar;
}
add_filter('get_avatar', 'my_avatar');
// -- END ----------------------------------------
</pre>
<p>然后在wp根目录建立个avatar文件夹就可以了，需要主题的是php文件头部一定要加
<pre class="brush: php; title: ; notranslate">&lt;?php</pre>
<p>这样有什么好处呢，如果代码有错误，直接删除相关的php文件就可以，不必每次都备份上传functions文件了。</p>
<p>-----------------------------------------------唠叨分割线------------------------------------------------</p>
<p style="border:thin dotted black; padding:3mm;">
开学了，我最近在干什么呢，课还是那样，不算多，交完了学费，排队真是困难，排了几个小时队，今天系里来人说让交钱时候小心，新班导携款逃跑。
</p>
<p style="border:thin dotted black; padding:3mm;">
偶尔研究下魔兽作弊，在d3scene这个国外论坛上找到了很多dll文件，直接注入就可以作弊了，比如刷钱，支持浩方，VS，Q对战平台，局域网。
</p>
<p style="border:thin dotted black; padding:3mm;">
还有就是博客的spam留言太多了，几天登陆一次博客，删的手都累。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="WordPress 主题函数使用技巧收集" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F948&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 主题函数使用技巧收集</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题模板优先级顺序" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fwordpress_theme&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题模板优先级顺序</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="西风私用Thunder主题免费下载了" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fparan-thunder-theme&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/29/7089035.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">西风私用Thunder主题免费下载了</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fwordpress&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress目录文件结构" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fwordpress_files&from=http%3A%2F%2F014.cc%2Ffunctions">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress目录文件结构</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://014.cc/functions/feed</wfw:commentRss>
		<slash:comments>124</slash:comments>
		</item>
		<item>
		<title>改变默认的 Gravatar 头像</title>
		<link>http://014.cc/gravatar</link>
		<comments>http://014.cc/gravatar#comments</comments>
		<pubDate>Sun, 01 Aug 2010 16:57:05 +0000</pubDate>
		<dc:creator>Dianso</dc:creator>
				<category><![CDATA[談博說博]]></category>
		<category><![CDATA[gravatar]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[头像]]></category>

		<guid isPermaLink="false">http://014.cc/?p=5448</guid>
		<description><![CDATA[很多同学都没设置Gravatar头像，没有Gravatar头像留言后显示的图片很丑陋，于是搜索了下，找到了这个方法，可以自定义Gravatar 默认头像图片。 在functions.php添加下面的代码就可以了，$myavatar填写图片地址 然后去这里选择确认即可 -------------------0806 今天看到万戈博客上写的用get_avatar来实现 只要把 $default 定义为需要默认头像的链接就可以了 ---------------------------------------------------- 话说植物大战僵尸2010已经出来了，破解版也有了，下载地址在这里： http://u.115.com/file/f1cc21f88a<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="评论框添加实时Gravatar头像显示" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2011%2F03%2Fgravatar-comment-box-to-add-real-time-picture-show%2F&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/12/4323498.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">评论框添加实时Gravatar头像显示 (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title=" WordPress 评论者链接在新窗口中打开， WordPress头像" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wangchenhao.com%2F2010%2F08%2F25%2Fwordpresspinglunzhelianjiezaixinchuangkouzhongdakaiwordpresstouxiang%2F&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;"> WordPress 评论者链接在新窗口中打开， WordPress头像 (@wangchenhao)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="gravatar 头像缓存" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F887&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">gravatar 头像缓存</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="我用过的头像" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fface&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/09/29579441.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">我用过的头像</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 技巧：在日志下添加作者头像和版权申明" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F972&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 技巧：在日志下添加作者头像和版权申明</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>很多同学都没设置<font size="4px">Gravatar</font>头像，没有Gravatar头像<span class='wp_keywordlink'><a href="http://014.cc/x" title="给我留言吧">留言</a></span>后显示的图片很丑陋，于是搜索了下，找到了这个方法，可以自定义Gravatar 默认头像图片。</p>
<p>在functions.php添加下面的代码就可以了，$myavatar填写图片地址</p>
<pre class="brush: php; title: ; notranslate">
add_filter( 'avatar_defaults', 'newgravatar' );

function newgravatar ($avatar_defaults) {
$myavatar = 'http://s.014.cc/x.jpg';
$avatar_defaults[$myavatar] = “Dianso”
return $avatar_defaults;
}
</pre>
<p>然后去这里选择确认即可</p>
<p><a href="http://s.014.cc/2010/08/Gravatar.jpg"><img style="BORDER-RIGHT: #ff0000 3px solid; BORDER-TOP: #ff0000 3px solid; BORDER-LEFT: #ff0000 3px solid; BORDER-BOTTOM: #ff0000 3px solid;" src="http://s.014.cc/2010/08/Gravatar.jpg" alt="Gravatar" title="Gravatar"  /></a></p>
<p>-------------------0806<br />
今天看到万戈博客上写的用get_avatar来实现</p>
<pre class="brush: php; title: ; notranslate">
&amp;amp;amp;lt;?php echo get_avatar($comment,$size='48',$default='http://s.014.cc/x.jpg'); ?&amp;amp;amp;gt;
</pre>
<p>只要把 $default 定义为需要默认头像的链接就可以了<br />
----------------------------------------------------</p>
<p>话说<span class='wp_keywordlink'><a href="http://014.cc/tag/植物大战僵尸" title="植物大战僵尸">植物大战僵尸</a></span>2010已经出来了，破解版也有了，下载地址在这里：</p>
<p><code>http://u.115.com/file/f1cc21f88a</code></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1" color="#FF6459" style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="评论框添加实时Gravatar头像显示" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fawy.me%2F2011%2F03%2Fgravatar-comment-box-to-add-real-time-picture-show%2F&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/12/4323498.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">评论框添加实时Gravatar头像显示 (@awy)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title=" WordPress 评论者链接在新窗口中打开， WordPress头像" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wangchenhao.com%2F2010%2F08%2F25%2Fwordpresspinglunzhelianjiezaixinchuangkouzhongdakaiwordpresstouxiang%2F&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;"> WordPress 评论者链接在新窗口中打开， WordPress头像 (@wangchenhao)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="gravatar 头像缓存" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F887&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">gravatar 头像缓存</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="我用过的头像" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2Fface&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/09/29579441.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">我用过的头像</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 技巧：在日志下添加作者头像和版权申明" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2F014.cc%2F972&from=http%3A%2F%2F014.cc%2Fgravatar">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://s.014.cc/cache/default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 技巧：在日志下添加作者头像和版权申明</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://014.cc/gravatar/feed</wfw:commentRss>
		<slash:comments>139</slash:comments>
		</item>
	</channel>
</rss>

