<?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>Life Studio &#187; WordPress</title>
	<atom:link href="http://wange.im/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://wange.im</link>
	<description>My Life, My Studio...</description>
	<lastBuildDate>Sat, 31 Jul 2010 13:01:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress 向来自其他域的访客致欢迎词</title>
		<link>http://wange.im/wordpress-say-hello-to-vistors.html</link>
		<comments>http://wange.im/wordpress-say-hello-to-vistors.html#comments</comments>
		<pubDate>Fri, 30 Jul 2010 12:11:08 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[搜索]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3587</guid>
		<description><![CDATA[　　在 Wordpress 上对来自其他域的访客显示欢迎词，这个效果我之前写过一篇类似的，《Wordpress 高亮显示关键词及欢迎提示》，之前这一篇是对特定访客显示欢迎词，也就是只对来自搜索引擎的访客显示欢迎提示词，而且对常用的搜索引擎还需要我手工添加进数组，并不是很全面，对百度、Google、有道、必应这些之外的搜索引擎就无效了。而今天介绍的这个方法就很全面，不仅可以涵盖所有的搜索引擎，就连其他任何不加密的网站也都适用！
　　不信？可以先做个测试。如果我有在贵站留过言，或者你很给面子地给我做了一个友链的小盆友们，你们可以通过自己网站上任何一个可以通向本站的链接访问本站。进来之后，你看到了啥？右侧的那个浮动层瞧见没？就是这个了。再比如说通过我的 Twitter(@wange1228)的主页，上面有我博客的链接，点击进入我的网站后，如下图：










　　现在应该明白我讲的是啥效果了吧，在道明方法之前，首先要感谢 illacrimo-plus 主题的作者，虽然我也不知道是谁。本文的方法就是从这个主题上扒下来的，方法如下：
1、把以下代码复制到 Wordpress 主题的 functions.php 中：
function show_refer_in(){
     $refer_info=$_SERVER['HTTP_REFERER'];
     $ban_list=array($_SERVER["HTTP_HOST"]);
     for($ii=0;$ii&#60;count($ban_list);$ii++){
        if(strpos($refer_info,$ban_list[$ii])){
            return;
        }
 [...]]]></description>
			<content:encoded><![CDATA[<p>　　在 Wordpress 上对来自其他域的访客显示欢迎词，这个效果我之前写过一篇类似的，《<a title="http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html" href="Wordpress 高亮显示关键词及欢迎提示">Wordpress 高亮显示关键词及欢迎提示</a>》，之前这一篇是对特定访客显示欢迎词，也就是只对来自搜索引擎的访客显示欢迎提示词，而且对常用的搜索引擎还需要我手工添加进数组，并不是很全面，对百度、Google、有道、必应这些之外的搜索引擎就无效了。而今天介绍的这个方法就很全面，不仅可以涵盖所有的搜索引擎，就连其他任何不加密的网站也都适用！</p>
<p>　　不信？可以先做个测试。如果我有在贵站留过言，或者你很给面子地给我做了一个友链的小盆友们，你们可以通过自己网站上任何一个可以通向本站的链接访问本站。进来之后，你看到了啥？右侧的那个浮动层瞧见没？就是这个了。再比如说通过我的 Twitter(<a title="Follow Me on Twitter" href="http://twitter.com/wange1228" target="_blank">@wange1228</a>)的主页，上面有我博客的链接，点击进入我的网站后，如下图：</p>
<table border="0" align="center">
<tbody>
<tr>
<td>
<p><div class="wp-caption alignnone" style="width: 210px"><img title="Twitter上的博客链接" src="http://vpdpfq.bay.livefilestore.com/y1pSbfAPu1N_x8WgNde06NGQWVuewSf2rgvzKMPDLiEbfTNv01zwbX6tB33IMFv7l7SF93IXJkPVwhQacAZZ-1ioxZjFP62kZ2W/twitter.jpg" alt="" width="200" height="150" /><p class="wp-caption-text">Twitter上的博客链接</p></div></td>
<td>
<p><div class="wp-caption alignnone" style="width: 310px"><img title="从twitter来的欢迎词" src="http://vpdpfq.bay.livefilestore.com/y1pgyStthY_WwVkrwZ4hA_3pC0MGUX3jQwHLj0es5CwRfWoEqm1vwYIW-XgrheLRjQpQIOAIa1H51fnRNZCVKrl_vj0h-UMm8dG/fromtwitter.jpg" alt="" width="300" height="150" /><p class="wp-caption-text">从twitter来的欢迎词</p></div></td>
</tr>
</tbody>
</table>
<p>　　现在应该明白我讲的是啥效果了吧，在道明方法之前，首先要感谢 illacrimo-plus 主题的作者，虽然我也不知道是谁。本文的方法就是从这个主题上扒下来的，方法如下：</p>
<p>1、把以下代码复制到 Wordpress 主题的 functions.php 中：</p>
<div class="source" style="font-family: 'Courier New','Lucida Console','monospace'; color: #000000;"><span style="color: #000080; font-weight: bold;">function</span> <span style="color: #000000;">show_refer_in</span><span style="color: #000000;">(){</span><br />
     <span style="color: #000000;">$refer_info</span><span style="color: #000000;">=</span><span style="color: #000000;">$_SERVER</span><span style="color: #000000;">[</span><span style="color: #0000ff;">'HTTP_REFERER'</span><span style="color: #000000;">];</span><br />
     <span style="color: #000000;">$ban_list</span><span style="color: #000000;">=</span><span style="color: #000000;">array</span>(<span style="color: #000000;">$_SERVER</span><span style="color: #000000;">[</span><span style="color: #0000ff;">"HTTP_HOST"</span><span style="color: #000000;">]);</span><br />
     <span style="color: #000080; font-weight: bold;">for</span>(<span style="color: #000000;">$ii</span><span style="color: #000000;">=</span><span style="color: #0000ff;">0</span>;<span style="color: #000000;">$ii</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">count</span>(<span style="color: #000000;">$ban_list</span>);<span style="color: #000000;">$ii</span><span style="color: #000000;">++</span><span style="color: #000000;">){</span><br />
        <span style="color: #000080; font-weight: bold;">if</span>(<span style="color: #000000;">strpos</span>(<span style="color: #000000;">$refer_info</span><span style="color: #000000;">,</span><span style="color: #000000;">$ban_list</span><span style="color: #000000;">[</span><span style="color: #000000;">$ii</span><span style="color: #000000;">])){</span><br />
            <span style="color: #000080; font-weight: bold;">return</span>;<br />
        <span style="color: #000000;">}</span><br />
    <span style="color: #000000;">}</span><br />
    <span style="color: #000080; font-weight: bold;">if</span>(<span style="color: #000000;">$refer_info</span><span style="color: #000000;">){</span><br />
        <span style="color: #000000;">preg_match</span>(<span style="color: #0000ff;">"/^(http:\/\/)?([^\/]+)/i"</span><span style="color: #000000;">,</span><br />
        <span style="color: #000000;">$refer_info</span><span style="color: #000000;">,</span> <span style="color: #000000;">$matches</span>);<br />
        <span style="color: #000000;">$host</span> <span style="color: #000000;">=</span> <span style="color: #000000;">$matches</span><span style="color: #000000;">[</span><span style="color: #0000ff;">2</span><span style="color: #000000;">];</span><br />
        <span style="color: #000000;">echo</span> <span style="color: #0000ff;">"&lt;div id=\"hellobaby\"&gt;欢迎来自 "</span><span style="color: #000000;">.</span><span style="color: #000000;">$host</span><span style="color: #000000;">.</span><span style="color: #0000ff;">" 的朋友！&lt;br /&gt;推荐您 &lt;b&gt;&lt;a href=\"http://feed.wange.im\" target=\"_blank\"&gt;点击这里&lt;/a&gt;&lt;/b&gt; 订阅我的博客 o(∩_∩)o&lt;div class=\"closebox\"&gt;&lt;a href=\"javascript:void(0)\" onclick=\"$('#hellobaby').slideUp('slow');$('.closebox').css('display','none');\" title=\"关闭\"&gt;×&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;"</span>;<br />
    <span style="color: #000000;">}</span><br />
<span style="color: #000000;">}</span></div>
<p>2、在主题文件的任何部位调用以下函数，我建议是放在 footer.php 中：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #008080;">&lt;?php</span> <span style="color: #000000;">show_refer_in</span>();<span style="color: #008080;">?&gt;</span></div>
<p>3、接下来样式部分仅供参考：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #000000;">#hellobaby</span> <span style="color: #000000;">{</span><br />
    <span style="color: #000080; font-weight: bold;">background</span><span style="color: #000000;">:</span><span style="color: #0000ff;">#000000</span>;<br />
    <span style="color: #000080; font-weight: bold;">border</span><span style="color: #000000;">:</span><span style="color: #0000ff;">1px</span> <span style="color: #000080; font-weight: bold;">solid</span> <span style="color: #0000ff;">#B3B3B3</span>;<br />
    <span style="color: #000080; font-weight: bold;">color</span><span style="color: #000000;">:</span><span style="color: #0000ff;">#FFFFFF</span>;<br />
    <span style="color: #000080; font-weight: bold;">font-size</span><span style="color: #000000;">:</span><span style="color: #0000ff;">14px</span>;<br />
    <span style="color: #000080; font-weight: bold;">opacity</span><span style="color: #000000;">:</span><span style="color: #0000ff;">0</span><span style="color: #000000;">.</span><span style="color: #0000ff;">7</span>;<br />
    <span style="color: #000000;">filter</span><span style="color: #000000;">:</span><span style="color: #000000;">alpha</span>(<span style="color: #000080; font-weight: bold;">opacity</span><span style="color: #000000;">=</span><span style="color: #0000ff;">70</span>);<br />
    <span style="color: #000080; font-weight: bold;">padding</span><span style="color: #000000;">:</span><span style="color: #0000ff;">10px</span>;<br />
    <span style="color: #000080; font-weight: bold;">position</span><span style="color: #000000;">:</span><span style="color: #000080; font-weight: bold;">absolute</span>;<br />
    <span style="color: #000080; font-weight: bold;">right</span><span style="color: #000000;">:</span><span style="color: #0000ff;">0</span>;<br />
    <span style="color: #000080; font-weight: bold;">top</span><span style="color: #000000;">:</span><span style="color: #0000ff;">250px</span>;<br />
<span style="color: #000000;">}</span></div>
<p>　　基本完成了，本文提到的文法和 <a title="http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html" href="Wordpress 高亮显示关键词及欢迎提示">Wordpress 高亮显示关键词及欢迎提示</a>中的提示词部分有点重复，不过高亮显示关键词还是很有用的，所以两者我都用上了，感觉还不错，你说呢？</p>
<p>　　Update：经热烈讨论，同学们普遍反映，如果每次跳转过来都会有这个欢迎词，就会显得有些烦人，有些碍眼。感谢小邪，提供了记住 Cookies 的方法，8过很遗憾，居然在我这里测试会报错。所以我用了另一种折衷的办法，加了个判断，对所有留过言的朋友不显示该欢迎词，其实也是借用了 Cookies 的概念，现在要看这个效果的小盆友们，就要先清除浏览器缓存才行咯。感谢，也欢迎大家提出更多宝贵意见～</p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="Wordpress 向来自其他域的访客致欢迎词" href="http://wange.im/wordpress-say-hello-to-vistors.html">《Wordpress 向来自其他域的访客致欢迎词》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="Wordpress 向来自其他域的访客致欢迎词" href="http://wange.im/wordpress-say-hello-to-vistors.html">http://wange.im/wordpress-say-hello-to-vistors.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/highlight-keywords-in-wordpress-search.html" title="Wordpress 站内搜索高亮显示关键词 (2010年07月18日)">Wordpress 站内搜索高亮显示关键词</a> (119)</li><li><a href="http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html" title="Wordpress 高亮显示关键词及欢迎提示 (2010年07月16日)">Wordpress 高亮显示关键词及欢迎提示</a> (180)</li><li><a href="http://wange.im/embed-bbs-in-blog.html" title="如果在博客嵌入个人论坛 (2010年07月29日)">如果在博客嵌入个人论坛</a> (187)</li><li><a href="http://wange.im/dwthemes-with-dustmedia.html" title="与尘埃老哥共建 DWthemes 工作室 (2010年07月28日)">与尘埃老哥共建 DWthemes 工作室</a> (186)</li><li><a href="http://wange.im/comment-count-in-wordpress-with-jquery.html" title="Jquery 实现 Wordpress 评论字数计数 (2010年07月27日)">Jquery 实现 Wordpress 评论字数计数</a> (145)</li><li><a href="http://wange.im/wordpress-shows-the-number-of-recent-comments.html" title="WordPress 显示访客最近评论次数 (2010年07月20日)">WordPress 显示访客最近评论次数</a> (198)</li><li><a href="http://wange.im/show-your-recent-comments-in-wordpress.html" title="Wordpress 实现“您的足迹”功能 (2010年07月12日)">Wordpress 实现“您的足迹”功能</a> (262)</li><li><a href="http://wange.im/world-clock-with-php.html" title="PHP 实现的静态世界时钟功能 (2010年07月9日)">PHP 实现的静态世界时钟功能</a> (142)</li><li><a href="http://wange.im/remove-comments-url-in-wordpress.html" title="Wordpress 去掉评论中链接的方法 (2010年07月8日)">Wordpress 去掉评论中链接的方法</a> (172)</li><li><a href="http://wange.im/date-with-immmmm.html" title="终于有幸一睹木木本尊 (2010年07月7日)">终于有幸一睹木木本尊</a> (272)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/wordpress-say-hello-to-vistors.html/feed</wfw:commentRss>
		<slash:comments>175</slash:comments>
		</item>
		<item>
		<title>如果在博客嵌入个人论坛</title>
		<link>http://wange.im/embed-bbs-in-blog.html</link>
		<comments>http://wange.im/embed-bbs-in-blog.html#comments</comments>
		<pubDate>Thu, 29 Jul 2010 12:36:27 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[三言两语]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[博客]]></category>
		<category><![CDATA[论坛]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3579</guid>
		<description><![CDATA[　　早就有朋友说了，我的博客更像论坛，因为留言如灌水，我自己也有这个感觉，是博客还是论坛已经没有明显的界限了。看到同学们如此踊跃，我很是高兴呀，但我也在考虑一个问题，是不是要给现在的博客转型，索性让博客更像是一个论坛呢？我的意思是把博客与论坛相结合，既兼顾博客的优势，也增加一些论坛的特点。
　　那给博客结合论坛能有哪些特点呢？我觉得吧，有以下几点：
　　1、讨论的话题更有针对性、目标性。因为相对于博客而言，每篇日志都有一个主题，但可能这个话题并不是读者想要研究关心的问题，那要读者有话何处说呢？大多数带着问题而来的访客都会选择在我的留言板提问，又或者是随便找一篇文章，只要可以留言的地方就随处插入。这样一来，就会造成日志下的问题留言与该日志的话题完全牛头不对马嘴，我想如果有一个论坛可以集中这些问题会显得更有章法。
　　2、便于归类和避免重复问题。有些关于 Wordpress、CSS、Jquery 等知识技巧都是类同的，甚至有些朋友都是问的同一个问题，而我每次都要重复解答同一个问题，闲的时候还好，忙起来就有些顾不上了。如果有一个论坛应该可以缓解这个现象吧，一些比较常见的、关键的、难点的问题会被顶起来，一目了然，可以帮助访客更快更好地解决实际问题。
　　3、营造互帮互助的氛围。博客是一个人在战斗，而论坛则是一群人在围殴。我的水平有限，很多朋友提出高深的问题，我完全无法解决，而且有时候也没太多的时间一一折腾并解答。我一个人的时间和能力是有限的，但是群众的力量是无限的，论坛正好可以弥补博客的这一不足，如果有问题可以发布在个人论坛上让大家一起帮忙解决。
　　4、给灌水一个更正当的理由。每个论坛都必有的版块，那就是灌水版块，在这个博客我已经有够水的了，所以想开个论坛疏导一下，泄泄洪。
　　Wordpress 与论坛的结合，基本想法就是再增加一个论坛的页面，完全附属于博客，嵌入博客，论坛用户与 Wordpress 用户双向互通，在技术方面已经基本没有什么问题了，在一个朋友的博客上已经测试通过，论坛与 Wordpress 完美相融，但是还需要考虑一些发展与定位，比如说：
　　1、如果我在这个博客的基础上开通论坛，能够吸引多少访客驻足？这个肯定是我最关心的，因为一个没有人气的论坛，这比一个没有人气的博客更惨，所以在这里作个小调查，你会愿意在一个个人论坛上花时间吗？
　　2、开展的版块与定位问题。既然是个人论坛、草根论坛，我就不想和那些门户一样的专业论坛去抢风头，也抢不过，我只想关注访客们关注的问题，而又是一些大型论坛所不屑于讨论的话题，面不要广，但要精。切记，只是一个依附于个人博客的个人论坛。这就又与前一个问题挂上勾了，会直接影响到论坛的影响力、亲和力、回访率……
　　纠结中，这样的一个个人论坛到底要不要建立呢？童鞋们给点意见吧～
&#187; 转载请注明来源：Life Studio &#187; 《如果在博客嵌入个人论坛》&#187; 本文链接地址：http://wange.im/embed-bbs-in-blog.html&#187; 订阅本站：http://feed.wange.im相关日志敬请围观 WPG (156)终于有幸一睹木木本尊 (272)在博客上嵌入 Google 文档 (196)过滤并替换 Wordpress 留言指定字符 (242)去掉第三方分享收藏脚本中的 LOGO (390)我是一只爬呀爬的小乌龟 (202)【人物周刊】带你走进万戈的世界 (151)Wordpress 非插件调用最新新浪围脖 (71)Wordpress Jam，我看行！ (89)常在博客飘，主机被挨刀 (126)]]></description>
			<content:encoded><![CDATA[<p>　　早就有朋友说了，我的博客更像论坛，因为留言如灌水，我自己也有这个感觉，是博客还是论坛已经没有明显的界限了。看到同学们如此踊跃，我很是高兴呀，但我也在考虑一个问题，是不是要给现在的博客转型，索性让博客更像是一个论坛呢？我的意思是把博客与论坛相结合，既兼顾博客的优势，也增加一些论坛的特点。</p>
<p>　　那给博客结合论坛能有哪些特点呢？我觉得吧，有以下几点：</p>
<p>　　<strong>1、讨论的话题更有针对性、目标性。</strong>因为相对于博客而言，每篇日志都有一个主题，但可能这个话题并不是读者想要研究关心的问题，那要读者有话何处说呢？大多数带着问题而来的访客都会选择在我的<a title="给我留言" href="http://wange.im/guestbook">留言板</a>提问，又或者是随便找一篇文章，只要可以留言的地方就随处插入。这样一来，就会造成日志下的问题留言与该日志的话题完全牛头不对马嘴，我想如果有一个论坛可以集中这些问题会显得更有章法。</p>
<p>　　<strong>2、便于归类和避免重复问题。</strong>有些关于 Wordpress、CSS、Jquery 等知识技巧都是类同的，甚至有些朋友都是问的同一个问题，而我每次都要重复解答同一个问题，闲的时候还好，忙起来就有些顾不上了。如果有一个论坛应该可以缓解这个现象吧，一些比较常见的、关键的、难点的问题会被顶起来，一目了然，可以帮助访客更快更好地解决实际问题。</p>
<p>　　<strong>3、营造互帮互助的氛围。</strong>博客是一个人在战斗，而论坛则是一群人在围殴。我的水平有限，很多朋友提出高深的问题，我完全无法解决，而且有时候也没太多的时间一一折腾并解答。我一个人的时间和能力是有限的，但是群众的力量是无限的，论坛正好可以弥补博客的这一不足，如果有问题可以发布在个人论坛上让大家一起帮忙解决。</p>
<p>　　<strong>4、给灌水一个更正当的理由。</strong>每个论坛都必有的版块，那就是灌水版块，在这个博客我已经有够水的了，所以想开个论坛疏导一下，泄泄洪。</p>
<p>　　Wordpress 与论坛的结合，基本想法就是再增加一个论坛的页面，完全附属于博客，嵌入博客，论坛用户与 Wordpress 用户双向互通，在技术方面已经基本没有什么问题了，在一个朋友的博客上已经测试通过，论坛与 Wordpress 完美相融，但是还需要考虑一些发展与定位，比如说：</p>
<p>　　<strong>1、如果我在这个博客的基础上开通论坛，能够吸引多少访客驻足？</strong>这个肯定是我最关心的，因为一个没有人气的论坛，这比一个没有人气的博客更惨，所以在这里作个小调查，你会愿意在一个个人论坛上花时间吗？</p>
<p>　　<strong>2、开展的版块与定位问题。</strong>既然是个人论坛、草根论坛，我就不想和那些门户一样的专业论坛去抢风头，也抢不过，我只想关注访客们关注的问题，而又是一些大型论坛所不屑于讨论的话题，面不要广，但要精。切记，只是一个依附于个人博客的个人论坛。这就又与前一个问题挂上勾了，会直接影响到论坛的影响力、亲和力、回访率……</p>
<p>　　纠结中，这样的一个个人论坛到底要不要建立呢？童鞋们给点意见吧～</p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="如果在博客嵌入个人论坛" href="http://wange.im/embed-bbs-in-blog.html">《如果在博客嵌入个人论坛》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="如果在博客嵌入个人论坛" href="http://wange.im/embed-bbs-in-blog.html">http://wange.im/embed-bbs-in-blog.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/wordpress-group.html" title="敬请围观 WPG (2009年09月26日)">敬请围观 WPG</a> (156)</li><li><a href="http://wange.im/date-with-immmmm.html" title="终于有幸一睹木木本尊 (2010年07月7日)">终于有幸一睹木木本尊</a> (272)</li><li><a href="http://wange.im/google-docs-in-blog.html" title="在博客上嵌入 Google 文档 (2010年07月6日)">在博客上嵌入 Google 文档</a> (196)</li><li><a href="http://wange.im/replace-comment-text-in-wordpress.html" title="过滤并替换 Wordpress 留言指定字符 (2010年07月5日)">过滤并替换 Wordpress 留言指定字符</a> (242)</li><li><a href="http://wange.im/remove-logo-from-share-button.html" title="去掉第三方分享收藏脚本中的 LOGO (2010年07月1日)">去掉第三方分享收藏脚本中的 LOGO</a> (390)</li><li><a href="http://wange.im/i-am-a-turtle.html" title="我是一只爬呀爬的小乌龟 (2010年06月24日)">我是一只爬呀爬的小乌龟</a> (202)</li><li><a href="http://wange.im/into-my-world.html" title="【人物周刊】带你走进万戈的世界 (2010年06月21日)">【人物周刊】带你走进万戈的世界</a> (151)</li><li><a href="http://wange.im/output-latest-tsina-to-wordpress-without-plugin.html" title="Wordpress 非插件调用最新新浪围脖 (2010年02月16日)">Wordpress 非插件调用最新新浪围脖</a> (71)</li><li><a href="http://wange.im/wordpress-jam.html" title="Wordpress Jam，我看行！ (2010年01月15日)">Wordpress Jam，我看行！</a> (89)</li><li><a href="http://wange.im/oh-my-host.html" title="常在博客飘，主机被挨刀 (2010年01月14日)">常在博客飘，主机被挨刀</a> (126)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/embed-bbs-in-blog.html/feed</wfw:commentRss>
		<slash:comments>187</slash:comments>
		</item>
		<item>
		<title>与尘埃老哥共建 DWthemes 工作室</title>
		<link>http://wange.im/dwthemes-with-dustmedia.html</link>
		<comments>http://wange.im/dwthemes-with-dustmedia.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 12:52:44 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[三言两语]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[主题]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3571</guid>
		<description><![CDATA[　　在 Wordpress 界混的时间不能算长，但也坚持了一年多。我是一个执着的人，在这一年多里，我一直用的 Zeus 大哥的这款 Wordpress 主题，这里修修那里改改，却还从来没有换过主题；我是一个懒人，在这一年多里，我做的或者仿的 Wordpress 主题用十个手指头就数的过来，基本上都是给个人或者企业定制的；我是一个俗人，在这一年多里，我只做有偿主题，因为只有钱能稍微触动一下我那根懒人的神经。
　　其实除了执着、懒、俗这些原因之外，我在 Wordpress 主题上产量一直不高还有最重要的一点原因，那就是我不会设计，真是亏我还学过三四年的绘画呢，这设计布局的功力还是弱的不行。每次受命做主题总要让我抓破头想设计想布局，之前心血来潮想做一个属于自己的主题，但是因为配色饱受诟病，我巨受打击而放弃，从此打消自己开发主题的念头。
　　但是，但是！但是……这一切都改变了，自从和尘埃老哥合作以后。尘埃，相信同学们也不会陌生了，是集摄影、PS、设计等顶级技能于一身的牛人，而我正好又缺乏这方面的能力，但是我有 DIV+CSS 和 Wordpress 方面的技术，两人一拍即合，何不联手共同开发主题呢？我相信凭着尘埃老哥的设计实力加上我对 Wordpress 的执着精神，一定可以打造出足够拿的出手的 Wordpress 主题。
　　和尘埃老哥的第一次合作是尘埃现在的主题，老哥负责设计，我就负责 DIV+CSS 和转出 Wordpress 主题，个人感觉还是很满意的。于是和尘埃老哥商量了长期合作的意向，还商定成立 DWthemes 工作室（尘埃的 Dustmedia 和 我的 Wange 各自的首字母结合），两个人的小团队，就这样D调诞生了，D调到甚至我已经记不起是具体哪一天。
　　就在 DWthemes 工作室成立之初，尘埃就给我们这个团队带来了第一笔单子，对我而言是有史以来的一笔巨单。这是一个 Wordpress 为平台的个人网站，等完成之后我和尘埃老哥各分得了 1500 大洋，当然这要求也不低，尘埃老哥前前后后设计了三个主题客户才从中满意地挑选了一个，而从布局到最后测试也足足花了我一个月时间。就冲着这笔巨单，我的懒人神经再一次被触动了，振奋了一下精神，动用了我所有的能力，包括已经被我扔下一年多的 Flash 也重新用上了，当然也少不了我最爱的 Jquery 等。

　　这就是我们的 DWthemes 工作室，第一步迈地虽然有些吃力，但还算很顺利，宣布首战胜利，也借此机会和大家打个招呼，如果有个人或者企业要定制 Wordpress 主题，可以联系我或者尘埃老哥，我们一定会为你量身定一款合适的主题（好俗的广告语啊～）。
&#187; 转载请注明来源：Life Studio &#187; 《与尘埃老哥共建 DWthemes 工作室》&#187; 本文链接地址：http://wange.im/dwthemes-with-dustmedia.html&#187; 订阅本站：http://feed.wange.im相关日志Wordpress 新主题制作中 (164)在我人间蒸发的两天里…… (131)新主题首页已完成～ [...]]]></description>
			<content:encoded><![CDATA[<p>　　在 Wordpress 界混的时间不能算长，但也坚持了一年多。我是一个执着的人，在这一年多里，我一直用的 Zeus 大哥的这款 Wordpress 主题，这里修修那里改改，却还从来没有换过主题；我是一个懒人，在这一年多里，我做的或者仿的 Wordpress 主题用十个手指头就数的过来，基本上都是给个人或者企业定制的；我是一个俗人，在这一年多里，我只做有偿主题，因为只有钱能稍微触动一下我那根懒人的神经。</p>
<p>　　其实除了执着、懒、俗这些原因之外，我在 Wordpress 主题上产量一直不高还有最重要的一点原因，那就是我不会设计，真是亏我还学过三四年的绘画呢，这设计布局的功力还是弱的不行。每次受命做主题总要让我抓破头想设计想布局，之前心血来潮想做一个<a title="新主题首页已完成～" href="http://wange.im/index-for-new-theme.html">属于自己的主题</a>，但是因为配色饱受诟病，我巨受打击而放弃，从此打消自己开发主题的念头。</p>
<p>　　但是，但是！但是……这一切都改变了，自从和<a title="棺材中的尘埃" href="http://www.dustmedia.net/" target="_blank">尘埃</a>老哥合作以后。尘埃，相信同学们也不会陌生了，是集摄影、PS、设计等顶级技能于一身的牛人，而我正好又缺乏这方面的能力，但是我有 DIV+CSS 和 Wordpress 方面的技术，两人一拍即合，何不联手共同开发主题呢？我相信凭着尘埃老哥的设计实力加上我对 Wordpress 的执着精神，一定可以打造出足够拿的出手的 Wordpress 主题。</p>
<p>　　和尘埃老哥的第一次合作是尘埃现在的主题，老哥负责设计，我就负责 DIV+CSS 和转出 Wordpress 主题，个人感觉还是很满意的。于是和尘埃老哥商量了长期合作的意向，还商定成立 DWthemes 工作室（尘埃的 Dustmedia 和 我的 Wange 各自的首字母结合），两个人的小团队，就这样D调诞生了，D调到甚至我已经记不起是具体哪一天。</p>
<p>　　就在 DWthemes 工作室成立之初，尘埃就给我们这个团队带来了第一笔单子，对我而言是有史以来的一笔巨单。这是一个 Wordpress 为平台的个人网站，等完成之后我和尘埃老哥各分得了 1500 大洋，当然这要求也不低，尘埃老哥前前后后设计了三个主题客户才从中满意地挑选了一个，而从布局到最后测试也足足花了我一个月时间。就冲着这笔巨单，我的懒人神经再一次被触动了，振奋了一下精神，动用了我所有的能力，包括已经被我扔下一年多的 Flash 也重新用上了，当然也少不了我最爱的 Jquery 等。</p>
<p><img src="http://vpdpfq.bay.livefilestore.com/y1ppwP424MJ3xulbVBYKn4WaKkEE0aCMGnEBrQRGpMMCs0f4ANTOaRb5qWuterYjZQswe76adPS0dQKyN7qRDGnICLuczCT8K5i/dwthemes.jpg" alt="" /></p>
<p>　　这就是我们的 DWthemes 工作室，第一步迈地虽然有些吃力，但还算很顺利，宣布首战胜利，也借此机会和大家打个招呼，如果有个人或者企业要定制 Wordpress 主题，可以联系我或者尘埃老哥，我们一定会为你量身定一款合适的主题（好俗的广告语啊～）。</p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="与尘埃老哥共建 DWthemes 工作室" href="http://wange.im/dwthemes-with-dustmedia.html">《与尘埃老哥共建 DWthemes 工作室》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="与尘埃老哥共建 DWthemes 工作室" href="http://wange.im/dwthemes-with-dustmedia.html">http://wange.im/dwthemes-with-dustmedia.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/new-theme-for-wordpress.html" title="Wordpress 新主题制作中 (2010年05月1日)">Wordpress 新主题制作中</a> (164)</li><li><a href="http://wange.im/my-vanished-two-days.html" title="在我人间蒸发的两天里…… (2010年03月6日)">在我人间蒸发的两天里……</a> (131)</li><li><a href="http://wange.im/index-for-new-theme.html" title="新主题首页已完成～ (2010年01月30日)">新主题首页已完成～</a> (170)</li><li><a href="http://wange.im/learn-div-css.html" title="正式向 DIV+CSS 进军 (2010年01月27日)">正式向 DIV+CSS 进军</a> (181)</li><li><a href="http://wange.im/wordpress-jam.html" title="Wordpress Jam，我看行！ (2010年01月15日)">Wordpress Jam，我看行！</a> (89)</li><li><a href="http://wange.im/revised-edition-dz-theme-by-wange-2.html" title="万戈修订版 D&#038;Z 主题（二） (2009年12月21日)">万戈修订版 D&#038;Z 主题（二）</a> (103)</li><li><a href="http://wange.im/inanis-glass.html" title="Wordpress 仿 Vista 主题 (2009年11月28日)">Wordpress 仿 Vista 主题</a> (140)</li><li><a href="http://wange.im/wordpress-theme-simple-lines.html" title="Wordpress 主题推荐：Simple-Lines (2009年10月28日)">Wordpress 主题推荐：Simple-Lines</a> (110)</li><li><a href="http://wange.im/modify-the-wordpress-theme.html" title="给主题做了个大手术 (2009年10月9日)">给主题做了个大手术</a> (172)</li><li><a href="http://wange.im/wordpress-hanization.html" title="Wordpress 汉化非难事 (2009年09月14日)">Wordpress 汉化非难事</a> (25)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/dwthemes-with-dustmedia.html/feed</wfw:commentRss>
		<slash:comments>186</slash:comments>
		</item>
		<item>
		<title>Jquery 实现 Wordpress 评论字数计数</title>
		<link>http://wange.im/comment-count-in-wordpress-with-jquery.html</link>
		<comments>http://wange.im/comment-count-in-wordpress-with-jquery.html#comments</comments>
		<pubDate>Tue, 27 Jul 2010 14:02:49 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[留言]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3567</guid>
		<description><![CDATA[　　不好意思各位访客朋友们，因为去了合肥几天，博客也就搁置了，回来也没有一一回复童鞋们的留言，赶紧埋头把手头上的工作解决掉，晚上又挤了一点时间折腾 Wordpress，拳不离手，曲不离口，一天不折腾 Wordpress，手就痒痒，三天没碰代码，都感觉有点生疏了，差点找不到折腾的目标。
　　今天折腾的 Wordpress 目标是实现留言字数的实时计数功能。因为看到之前 qiqiboy 写过一篇文章介绍了，不过 qiqiboy 是自己写的 Javascript 脚本，虽然很简单，不过我还是嫌代码多，就一直没加上，今天折腾了一种 Jquery 实现的 Wordpress 对评论字数进行实时统计计数的功能。因为比较仓促，就只在留言板页面加上了这个效果，有兴趣的朋友可以先去留言板看看效果。样式也没有怎么修整过，比较粗糙，多多包涵啦～
　　接下来说方法：
1、加载 Jquery
　　这个是必须的，可以用  Google 托管的，也可以下载到本地服务器调用，Jquery 1.2X 的版本就够用了。
2、Jquery 的执行脚本
&#60;script type="text/javascript" &#62;
$(function(){
    var $comment = $('#comment');
    var $str  =  $('#str');
    var time;
    $comment.focus(function(){
        time = window.setInterval( substring,100 );
    });   
    function substring() {
        var val = $comment.val();
        var length = val.length;
        if( $str.html() != (length) [...]]]></description>
			<content:encoded><![CDATA[<p>　　不好意思各位访客朋友们，因为去了合肥几天，博客也就搁置了，回来也没有一一回复童鞋们的留言，赶紧埋头把手头上的工作解决掉，晚上又挤了一点时间折腾 Wordpress，拳不离手，曲不离口，一天不折腾 Wordpress，手就痒痒，三天没碰代码，都感觉有点生疏了，差点找不到折腾的目标。</p>
<p>　　今天折腾的 Wordpress 目标是实现留言字数的实时计数功能。因为看到之前 <a title="评论框的简单计数器" rel="external nofollow" href="http://www.qiqiboy.com/2010/07/14/a-simple-comment-box-counter.html" target="_blank">qiqiboy 写过一篇文章介绍</a>了，不过 qiqiboy 是自己写的 Javascript 脚本，虽然很简单，不过我还是嫌代码多，就一直没加上，今天折腾了一种 Jquery 实现的 Wordpress 对评论字数进行实时统计计数的功能。因为比较仓促，就只在<a title="留言板" href="http://wange.im/guestbook">留言板</a>页面加上了这个效果，有兴趣的朋友可以先去留言板看看效果。样式也没有怎么修整过，比较粗糙，多多包涵啦～</p>
<p>　　接下来说方法：</p>
<p><strong>1、加载 Jquery</strong></p>
<p>　　这个是必须的，可以用  Google 托管的，也可以下载到本地服务器调用，Jquery 1.2X 的版本就够用了。</p>
<p><strong>2、Jquery 的执行脚本</strong></p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #000000;">&lt;</span><span style="color: #000000;">script</span> <span style="color: #000000;">type</span><span style="color: #000000;">=</span><span style="color: #0000ff;">"text/javascript"</span> <span style="color: #000000;">&gt;</span><br />
<span style="color: #000000;">$</span>(<span style="color: #000080; font-weight: bold;">function</span><span style="color: #000000;">(){</span><br />
    <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">$comment</span> <span style="color: #000000;">=</span> <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'#comment'</span>);<br />
    <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">$str</span>  <span style="color: #000000;">=</span>  <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'#str'</span>);<br />
    <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">time</span>;<br />
    <span style="color: #000000;">$comment</span><span style="color: #000000;">.</span><span style="color: #000000;">focus</span>(<span style="color: #000080; font-weight: bold;">function</span><span style="color: #000000;">(){</span><br />
        <span style="color: #000000;">time</span> <span style="color: #000000;">=</span> <span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">setInterval</span>( <span style="color: #000000;">substring</span><span style="color: #000000;">,</span><span style="color: #0000ff;">100</span> );<br />
    <span style="color: #000000;">});</span>   <br />
    <span style="color: #000080; font-weight: bold;">function</span> <span style="color: #000000;">substring</span>() <span style="color: #000000;">{</span><br />
        <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">val</span> <span style="color: #000000;">=</span> <span style="color: #000000;">$comment</span><span style="color: #000000;">.</span><span style="color: #000000;">val</span>();<br />
        <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">length</span> <span style="color: #000000;">=</span> <span style="color: #000000;">val</span><span style="color: #000000;">.</span><span style="color: #000000;">length</span>;<br />
        <span style="color: #000080; font-weight: bold;">if</span>( <span style="color: #000000;">$str</span><span style="color: #000000;">.</span><span style="color: #000000;">html</span>() <span style="color: #000000;">!=</span> (<span style="color: #000000;">length</span>) <span style="color: #000000;">){</span><br />
            <span style="color: #000080; font-weight: bold;">if</span>(<span style="color: #000000;">length</span><span style="color: #000000;">==</span><span style="color: #0000ff;">0</span><span style="color: #000000;">){</span><br />
                <span style="color: #000000;">$</span>(<span style="color: #0000ff;">"#wordcount"</span><span style="color: #000000;">)[</span><span style="color: #0000ff;">0</span><span style="color: #000000;">].</span><span style="color: #000000;">firstChild</span><span style="color: #000000;">.</span><span style="color: #000000;">nodeValue</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">"您已输入0"</span>;<br />
                <span style="color: #000000;">$str</span><span style="color: #000000;">.</span><span style="color: #000000;">html</span>(<span style="color: #000000;">length</span>);<br />
            <span style="color: #000000;">}</span><span style="color: #000080; font-weight: bold;">else</span><span style="color: #000000;">{</span><br />
                <span style="color: #000000;">$</span>(<span style="color: #0000ff;">"#wordcount"</span><span style="color: #000000;">)[</span><span style="color: #0000ff;">0</span><span style="color: #000000;">].</span><span style="color: #000000;">firstChild</span><span style="color: #000000;">.</span><span style="color: #000000;">nodeValue</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">"您已输入"</span>;<br />
                <span style="color: #000000;">$str</span><span style="color: #000000;">.</span><span style="color: #000000;">html</span>(<span style="color: #000000;">length</span>);<br />
            <span style="color: #000000;">}</span><br />
        <span style="color: #000000;">}</span><br />
    <span style="color: #000000;">}</span><br />
<span style="color: #000000;">});</span><br />
<span style="color: #000000;">&lt;</span><span>/script&gt;</span></div>
<p>　　是不是看起来更精简一些呢？这个一定要放在 Jquery 的后面，代码的顺序问题。</p>
<p><strong>3、HTML 部分</strong></p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #000080; font-weight: bold;">&lt;p</span> <span style="color: #ff0000;">id=</span><span style="color: #0000ff;">"wordcount"</span><span style="color: #000080; font-weight: bold;">&gt;</span><br />
<span style="color: #000000;">    您已输入</span><span style="color: #000080; font-weight: bold;">&lt;span</span> <span style="color: #ff0000;">id=</span><span style="color: #0000ff;">"str"</span><span style="color: #000080; font-weight: bold;">&gt;</span><span style="color: #000000;">0</span><span style="color: #000080; font-weight: bold;">&lt;/span&gt;</span><span style="color: #000000;">字</span><br />
<span style="color: #000080; font-weight: bold;">&lt;/p&gt;</span></div>
<p>　　这部分代码就是要 wordcount 和 str 这两个 id 和第二步中的相匹配，包括第二步中的 #comment 也要和评论框的 id 相匹配，否则获取不到。 </p>
<p>　　好了，就写到这里吧，也不多写了，重点都说到了，接下去就看各位的悟性了，哈哈～</p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="Jquery 实现 Wordpress 评论字数计数" href="http://wange.im/comment-count-in-wordpress-with-jquery.html">《Jquery 实现 Wordpress 评论字数计数》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="Jquery 实现 Wordpress 评论字数计数" href="http://wange.im/comment-count-in-wordpress-with-jquery.html">http://wange.im/comment-count-in-wordpress-with-jquery.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/wordpress-shows-the-number-of-recent-comments.html" title="WordPress 显示访客最近评论次数 (2010年07月20日)">WordPress 显示访客最近评论次数</a> (198)</li><li><a href="http://wange.im/hide-visitor-info-in-wordpress.html" title="记录并隐藏 Wordpress 评论者信息 (2009年12月6日)">记录并隐藏 Wordpress 评论者信息</a> (189)</li><li><a href="http://wange.im/show-your-recent-comments-in-wordpress.html" title="Wordpress 实现“您的足迹”功能 (2010年07月12日)">Wordpress 实现“您的足迹”功能</a> (262)</li><li><a href="http://wange.im/remove-comments-url-in-wordpress.html" title="Wordpress 去掉评论中链接的方法 (2010年07月8日)">Wordpress 去掉评论中链接的方法</a> (172)</li><li><a href="http://wange.im/replace-comment-text-in-wordpress.html" title="过滤并替换 Wordpress 留言指定字符 (2010年07月5日)">过滤并替换 Wordpress 留言指定字符</a> (242)</li><li><a href="http://wange.im/no-admin-comments-in-wordpress.html" title="Wordpress 统计排除管理员的评论数 (2010年06月18日)">Wordpress 统计排除管理员的评论数</a> (146)</li><li><a href="http://wange.im/per-page-of-wp-list-comments-in-wordpress.html" title="Wordpress 不同页面不同评论分页功能 (2010年06月16日)">Wordpress 不同页面不同评论分页功能</a> (133)</li><li><a href="http://wange.im/paginate-comments-in-wordpress.html" title="Wordpress 指定页面评论分页功能 (2010年06月13日)">Wordpress 指定页面评论分页功能</a> (140)</li><li><a href="http://wange.im/commenter-gravatar-in-wordpress.html" title="Wordpress 记录评论者 gravatar 头像 (2010年05月18日)">Wordpress 记录评论者 gravatar 头像</a> (154)</li><li><a href="http://wange.im/fadeto-effect-with-jquery.html" title="利用 JQuery 实现图片显隐特效 (2010年04月8日)">利用 JQuery 实现图片显隐特效</a> (119)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/comment-count-in-wordpress-with-jquery.html/feed</wfw:commentRss>
		<slash:comments>145</slash:comments>
		</item>
		<item>
		<title>WordPress 显示访客最近评论次数</title>
		<link>http://wange.im/wordpress-shows-the-number-of-recent-comments.html</link>
		<comments>http://wange.im/wordpress-shows-the-number-of-recent-comments.html#comments</comments>
		<pubDate>Tue, 20 Jul 2010 12:29:52 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[转来载去]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[留言]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3547</guid>
		<description><![CDATA[　　暑假本来是我静下心来好好折腾 Wordpress 的时候，可是俺们领导疯了，暑假加班还要死命地拖着我一起，已经连续两天了，明天还要加班，哥的假期就这样被他活生生地给毁了。所以最近都没有太多的时间折腾 Wordpress 好玩的新功能，看到有啥新鲜的东东就顺手牵羊地加上了，比如说 Winy 小盆友的 WordPress 显示最近评论次数。加上后自我感觉效果还不错，就分享一下这个方法啦～
　　说的简单点，Wordpress 显示最近评论次数的功能就在于，显示访客30天发表留言的数量。Winy 小盆友的代码写的不错，我啥也没改就扔上来了（8好意思啊 Winy 童鞋，我连 URL 都赤果果地照搬过来了，HIAHIA～）。
　　把以下代码复制到 Wordpress 主题文件夹的 functions.php 中：
//copy下面的代码到主题functions.php里调用/*** welcome message* @param unknown_type $email* @return void&#124;string*/function WelcomeCommentAuthorBack($email = &#39;&#39;){&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(empty($email)){&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160;&#160;&#160; global $wpdb;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $past_30days = gmdate(&#39;Y-m-d H:i:s&#39;,((time()-(24*60*60*30))+(get_option(&#39;gmt_offset&#39;)*3600)));&#160;&#160;&#160;&#160;&#160;&#160;&#160; $sql = &#34;SELECT count(comment_author_email) AS times FROM $wpdb-&#62;comments WHERE comment_approved = &#39;1&#39; AND comment_author_email = '$email' AND comment_date [...]]]></description>
			<content:encoded><![CDATA[<p>　　暑假本来是我静下心来好好折腾 Wordpress 的时候，可是俺们领导疯了，暑假加班还要死命地拖着我一起，已经连续两天了，明天还要加班，哥的假期就这样被他活生生地给毁了。所以最近都没有太多的时间折腾 Wordpress 好玩的新功能，看到有啥新鲜的东东就顺手牵羊地加上了，比如说 <a title="Winy Sky" rel="external nofollow" href="http://winysky.com" target="_blank">Winy</a> 小盆友的 <a title="WordPress显示最近评论次数" rel="external nofollow" href="http://winysky.com/wordpress-shows-the-number-of-recent-comments" target="_blank">WordPress 显示最近评论次数</a>。加上后自我感觉效果还不错，就分享一下这个方法啦～</p>
<p>　　说的简单点，Wordpress 显示最近评论次数的功能就在于，显示访客30天发表留言的数量。Winy 小盆友的代码写的不错，我啥也没改就扔上来了（8好意思啊 Winy 童鞋，我连 URL 都赤果果地照搬过来了，HIAHIA～）。</p>
<p>　　把以下代码复制到 Wordpress 主题文件夹的 functions.php 中：<br />
<DIV style="FONT-FAMILY: 'Courier New', 'Lucida Console', 'monospace'; COLOR: #000000" class=source jQuery1279628256062="14"><SPAN style="FONT-STYLE: italic; COLOR: #008800">//copy下面的代码到主题functions.php里调用</SPAN><BR><SPAN style="FONT-STYLE: italic; COLOR: #008800">/**</SPAN><BR><SPAN style="FONT-STYLE: italic; COLOR: #008800">* welcome message</SPAN><BR><SPAN style="FONT-STYLE: italic; COLOR: #008800">* @param unknown_type $email</SPAN><BR><SPAN style="FONT-STYLE: italic; COLOR: #008800">* @return void|string</SPAN><BR><SPAN style="FONT-STYLE: italic; COLOR: #008800">*/</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">function</SPAN> <SPAN style="COLOR: #000000">WelcomeCommentAuthorBack</SPAN>(<SPAN style="COLOR: #000000">$email</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #0000ff">&#39;&#39;</SPAN><SPAN style="COLOR: #000000">){</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN>(<SPAN style="COLOR: #000000">empty</SPAN>(<SPAN style="COLOR: #000000">$email</SPAN><SPAN style="COLOR: #000000">)){</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">}</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">global</SPAN> <SPAN style="COLOR: #000000">$wpdb</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$past_30days</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">gmdate</SPAN>(<SPAN style="COLOR: #0000ff">&#39;Y-m-d H:i:s&#39;</SPAN><SPAN style="COLOR: #000000">,((</SPAN><SPAN style="COLOR: #000000">time</SPAN>()<SPAN style="COLOR: #000000">-</SPAN>(<SPAN style="COLOR: #0000ff">24</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">60</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">60</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">30</SPAN>))<SPAN style="COLOR: #000000">+</SPAN>(<SPAN style="COLOR: #000000">get_option</SPAN>(<SPAN style="COLOR: #0000ff">&#39;gmt_offset&#39;</SPAN>)<SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">3600</SPAN>)));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$sql</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #0000ff">&quot;SELECT count(comment_author_email) AS times FROM $wpdb-&gt;comments WHERE comment_approved = &#39;1&#39; AND comment_author_email = '$email' AND comment_date &gt;= '$past_30days'&quot;</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$times</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">$wpdb</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">get_results</SPAN>(<SPAN style="COLOR: #000000">$sql</SPAN>);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$times</SPAN> <SPAN style="COLOR: #000000">=</SPAN> (<SPAN style="COLOR: #000000">$times</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">0</SPAN><SPAN style="COLOR: #000000">]</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">times</SPAN>) <SPAN style="COLOR: #000000">?</SPAN> <SPAN style="COLOR: #000000">$times</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">0</SPAN><SPAN style="COLOR: #000000">]</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">times</SPAN> <SPAN style="COLOR: #000000">:</SPAN> <SPAN style="COLOR: #0000ff">0</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$message</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">$times</SPAN> <SPAN style="COLOR: #000000">?</SPAN> <SPAN style="COLOR: #000000">sprintf</SPAN>(<SPAN style="COLOR: #000000">__</SPAN>(<SPAN style="COLOR: #0000ff">&#39;过去30天内您评论了&lt;strong&gt;%1$s&lt;/strong&gt;次，感谢关注~&#39;</SPAN> <SPAN style="COLOR: #000000">),</SPAN> <SPAN style="COLOR: #000000">$times</SPAN>) <SPAN style="COLOR: #000000">:</SPAN> <SPAN style="COLOR: #0000ff">&#39;您很久都没有留言了，这次想说点什么吗？&#39;</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> <SPAN style="COLOR: #000000">$message</SPAN>;<BR><SPAN style="COLOR: #000000">}</SPAN><BR></DIV>　　使用方法：在　comments.php　合适的地方，比如留言框上面调用这个函数：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #008080;">&lt;?php</span> <span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #000000;">WelcomeCommentAuthorBack</span>(<span style="color: #000000;">$comment_author_email</span>); <span style="color: #008080;">?&gt;</span></div>
<p><img style="float: right;" src="http://storage.live.com/items/C3C8B704573706D9!568?filename=welcome.jpg" alt="" />　　基本的使用方法就是这样啦，之前留过言的童鞋可以在下面评论的欢迎提示词中看到效果，把鼠标移到你的昵称上，就会弹出一个留言次数的小提示了。截图如右图，不看不知道，一看吓一跳，在过去的30个月里，我居然盖了2082层楼，平均每天70层楼，我才是当之无愧的水王呀，哈哈哈哈。</p>
<p>　　不过要声明一下，我另外还用了 Jquery 的方法先把这个提示消息隐藏了起来，需要鼠标有一个 mouseover 的事件才会显示出来，需要加上此效果的朋友可以看<a title="JQuery 鼠标滑动渐隐渐显效果" href="http://wange.im/fadein-and-fadeout-with-jquery.html">这篇文章</a>，这里就不重复说明了。</p>
<p>　　围观 Winy 原创：<a title="WordPress显示最近评论次数" rel="external nofollow" href="http://winysky.com/wordpress-shows-the-number-of-recent-comments" target="_blank">http://winysky.com/wordpress-shows-the-number-of-recent-comments</a></p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="WordPress 显示访客最近评论次数" href="http://wange.im/wordpress-shows-the-number-of-recent-comments.html">《WordPress 显示访客最近评论次数》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="WordPress 显示访客最近评论次数" href="http://wange.im/wordpress-shows-the-number-of-recent-comments.html">http://wange.im/wordpress-shows-the-number-of-recent-comments.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/comment-count-in-wordpress-with-jquery.html" title="Jquery 实现 Wordpress 评论字数计数 (2010年07月27日)">Jquery 实现 Wordpress 评论字数计数</a> (145)</li><li><a href="http://wange.im/hide-visitor-info-in-wordpress.html" title="记录并隐藏 Wordpress 评论者信息 (2009年12月6日)">记录并隐藏 Wordpress 评论者信息</a> (189)</li><li><a href="http://wange.im/show-your-recent-comments-in-wordpress.html" title="Wordpress 实现“您的足迹”功能 (2010年07月12日)">Wordpress 实现“您的足迹”功能</a> (262)</li><li><a href="http://wange.im/remove-comments-url-in-wordpress.html" title="Wordpress 去掉评论中链接的方法 (2010年07月8日)">Wordpress 去掉评论中链接的方法</a> (172)</li><li><a href="http://wange.im/replace-comment-text-in-wordpress.html" title="过滤并替换 Wordpress 留言指定字符 (2010年07月5日)">过滤并替换 Wordpress 留言指定字符</a> (242)</li><li><a href="http://wange.im/no-admin-comments-in-wordpress.html" title="Wordpress 统计排除管理员的评论数 (2010年06月18日)">Wordpress 统计排除管理员的评论数</a> (146)</li><li><a href="http://wange.im/per-page-of-wp-list-comments-in-wordpress.html" title="Wordpress 不同页面不同评论分页功能 (2010年06月16日)">Wordpress 不同页面不同评论分页功能</a> (133)</li><li><a href="http://wange.im/paginate-comments-in-wordpress.html" title="Wordpress 指定页面评论分页功能 (2010年06月13日)">Wordpress 指定页面评论分页功能</a> (140)</li><li><a href="http://wange.im/commenter-gravatar-in-wordpress.html" title="Wordpress 记录评论者 gravatar 头像 (2010年05月18日)">Wordpress 记录评论者 gravatar 头像</a> (154)</li><li><a href="http://wange.im/fadeto-effect-with-jquery.html" title="利用 JQuery 实现图片显隐特效 (2010年04月8日)">利用 JQuery 实现图片显隐特效</a> (119)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/wordpress-shows-the-number-of-recent-comments.html/feed</wfw:commentRss>
		<slash:comments>198</slash:comments>
		</item>
		<item>
		<title>Wordpress 站内搜索高亮显示关键词</title>
		<link>http://wange.im/highlight-keywords-in-wordpress-search.html</link>
		<comments>http://wange.im/highlight-keywords-in-wordpress-search.html#comments</comments>
		<pubDate>Sun, 18 Jul 2010 12:00:26 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[关键词]]></category>
		<category><![CDATA[搜索]]></category>
		<category><![CDATA[非插件]]></category>
		<category><![CDATA[高亮]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3534</guid>
		<description><![CDATA[　　被 Qiqiboy 刺激后，我阴差阳错地折腾出了非插件的 Wordpress 高亮显示关键词及欢迎提示，但是这个搜索关键词高亮提示仅仅是针对来自 Google、百度等搜索引擎的访客，貌似对用站内搜索的朋友就有些不公平了，所以昨天考完试，我今天又马不停蹄地折腾起来，誓言要把 Wordpress 站内搜索高亮显示关键词的功能搞定！结果，还真搞定了，哈哈～
　　无论是用 PHP 还是 Javascript 来实现 Wordpress 站内搜索高亮关键词，都不可避免地会用到正则表达式，而偏偏这又是我的软肋，汗颜～先是参考了网上流传最多的 Jquery 实现站内搜索高亮关键词的方法，很可惜，这是一个老外的成果，完全没有考虑到我们非英语为母语的国家，所以这个高亮方法仅支持英文单词开头的关键词，用中文就杯具了。
　　所以最终还是参考了 Qiqiboy 的 wordpress高亮搜索结果+实现关键字前后截断显示。。。，他用的是 PHP 正则表达式的方法，最大的特点就是可以完美支持中文，而且比 Jquery 的方法执行速度也更快，最让我喜欢的一点是，非插件！哈哈～于是就拿来根据自己的主题修改了一番，方法如下：
　　在 Wordpress 主题文件的 search.php 搜索结果文件中的主循环中加入以下代码：
&#60;?php
    $title = get_the_title();
    $content = mb_strimwidth(strip_tags(apply_filters('the_content', $post-&#62;post_content)), 0, 600,"......");
    $keys = explode(" ",$s);
    $title = preg_replace('/('.implode('&#124;', $keys) .')/iu','&#60;span style="font-weight:700;background:#ffff00;"&#62;\0&#60;/span&#62;',$title);
    $content = preg_replace('/('.implode('&#124;', $keys) .')/iu','&#60;span style="font-weight:700;background:#ffff00;"&#62;\0&#60;/span&#62;',$content);
?&#62;
　　调用高亮的标题用以下代码：
&#60;?php echo $title; ?&#62;
　　调用高亮的日志内容用以下代码：
&#60;?php echo $content;?&#62;
　　就这样，效果还是蛮不错的，大家可以去我头部导航右上角的站内搜索输入一些关键词试试，中文的、英文的都可以。另外我的 PHP [...]]]></description>
			<content:encoded><![CDATA[<p>　　被 <a title="Qiqiboy" rel="external nofollow" href="http://www.qiqiboy.com/" target="_blank">Qiqiboy</a> 刺激后，我阴差阳错地折腾出了非插件的 <a title="Wordpress 高亮显示关键词及欢迎提示" href="http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html">Wordpress 高亮显示关键词及欢迎提示</a>，但是这个搜索关键词高亮提示仅仅是针对来自 Google、百度等搜索引擎的访客，貌似对用站内搜索的朋友就有些不公平了，所以昨天考完试，我今天又马不停蹄地折腾起来，誓言要把 Wordpress 站内搜索高亮显示关键词的功能搞定！结果，还真搞定了，哈哈～</p>
<p>　　无论是用 PHP 还是 Javascript 来实现 Wordpress 站内搜索高亮关键词，都不可避免地会用到正则表达式，而偏偏这又是我的软肋，汗颜～先是参考了网上流传最多的 <a title="How to Highlight Search Terms with jQuery" rel="external nofollow" href="http://weblogtoolscollection.com/archives/2009/04/10/how-to-highlight-search-terms-with-jquery/" target="_blank">Jquery 实现站内搜索高亮关键词的方法</a>，很可惜，这是一个老外的成果，完全没有考虑到我们非英语为母语的国家，所以这个高亮方法仅支持英文单词开头的关键词，用中文就杯具了。</p>
<p>　　所以最终还是参考了 Qiqiboy 的 <a title="wordpress高亮搜索结果+实现关键字前后截断显示。。。" rel="external nofollow" href="http://www.qiqiboy.com/2010/07/16/wordpress-highlighted-keyword-search-results.html">wordpress高亮搜索结果+实现关键字前后截断显示。。。</a>，他用的是 PHP 正则表达式的方法，最大的特点就是可以完美支持中文，而且比 Jquery 的方法执行速度也更快，最让我喜欢的一点是，非插件！哈哈～于是就拿来根据自己的主题修改了一番，方法如下：</p>
<p>　　在 Wordpress 主题文件的 search.php 搜索结果文件中的主循环中加入以下代码：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #008080;">&lt;?php</span><br />
    <span style="color: #000000;">$title</span> <span style="color: #000000;">=</span> <span style="color: #000000;">get_the_title</span>();<br />
    <span style="color: #000000;">$content</span> <span style="color: #000000;">=</span> <span style="color: #000000;">mb_strimwidth</span>(<span style="color: #000000;">strip_tags</span>(<span style="color: #000000;">apply_filters</span>(<span style="color: #0000ff;">'the_content'</span><span style="color: #000000;">,</span> <span style="color: #000000;">$post</span><span style="color: #000000;">-&gt;</span><span style="color: #ff0000;">post_content</span><span style="color: #000000;">)),</span> <span style="color: #0000ff;">0</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">600</span><span style="color: #000000;">,</span><span style="color: #0000ff;">"......"</span>);<br />
    <span style="color: #000000;">$keys</span> <span style="color: #000000;">=</span> <span style="color: #000000;">explode</span>(<span style="color: #0000ff;">" "</span><span style="color: #000000;">,</span><span style="color: #000000;">$s</span>);<br />
    <span style="color: #000000;">$title</span> <span style="color: #000000;">=</span> <span style="color: #000000;">preg_replace</span>(<span style="color: #0000ff;">'/('</span><span style="color: #000000;">.</span><span style="color: #000000;">implode</span>(<span style="color: #0000ff;">'|'</span><span style="color: #000000;">,</span> <span style="color: #000000;">$keys</span>) <span style="color: #000000;">.</span><span style="color: #0000ff;">')/iu'</span><span style="color: #000000;">,</span><span style="color: #0000ff;">'&lt;span style="font-weight:700;background:#ffff00;"&gt;\0&lt;/span&gt;'</span><span style="color: #000000;">,</span><span style="color: #000000;">$title</span>);<br />
    <span style="color: #000000;">$content</span> <span style="color: #000000;">=</span> <span style="color: #000000;">preg_replace</span>(<span style="color: #0000ff;">'/('</span><span style="color: #000000;">.</span><span style="color: #000000;">implode</span>(<span style="color: #0000ff;">'|'</span><span style="color: #000000;">,</span> <span style="color: #000000;">$keys</span>) <span style="color: #000000;">.</span><span style="color: #0000ff;">')/iu'</span><span style="color: #000000;">,</span><span style="color: #0000ff;">'&lt;span style="font-weight:700;background:#ffff00;"&gt;\0&lt;/span&gt;'</span><span style="color: #000000;">,</span><span style="color: #000000;">$content</span>);<br />
<span style="color: #008080;">?&gt;</span></div>
<p>　　调用高亮的标题用以下代码：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #008080;">&lt;?php</span> <span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #000000;">$title</span>; <span style="color: #008080;">?&gt;</span></div>
<p>　　调用高亮的日志内容用以下代码：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #008080;">&lt;?php</span> <span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #000000;">$content</span>;<span style="color: #008080;">?&gt;</span></div>
<p>　　就这样，效果还是蛮不错的，大家可以去我头部导航右上角的站内搜索输入一些关键词试试，中文的、英文的都可以。另外我的 PHP 实力很菜，这修改过程可能不太完美，而且以上代码是根据我自己主题的需要修改的，并不完全通用。大家有同样需要 Wordpress 站内搜索关键词高亮显示功能的，可以直接去 Qiqiboy 的原文学习：<a title="wordpress高亮搜索结果+实现关键字前后截断显示。。。" rel="external nofollow" href="http://www.qiqiboy.com/2010/07/16/wordpress-highlighted-keyword-search-results.html" target="_blank">http://www.qiqiboy.com/2010/07/16/wordpress-highlighted-keyword-search-results.html</a></p>
<p>　　最后贴一张站内搜索关键词高亮的截图：</p>
<div class="wp-caption alignnone" style="width: 535px"><img title="Wordpress 站内搜索高亮显示关键词" src="http://storage.live.com/items/C3C8B704573706D9!566?filename=keyword-highlight.jpg" alt="" width="525" height="224" /><p class="wp-caption-text">Wordpress 站内搜索高亮显示关键词</p></div>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="Wordpress 站内搜索高亮显示关键词" href="http://wange.im/highlight-keywords-in-wordpress-search.html">《Wordpress 站内搜索高亮显示关键词》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="Wordpress 站内搜索高亮显示关键词" href="http://wange.im/highlight-keywords-in-wordpress-search.html">http://wange.im/highlight-keywords-in-wordpress-search.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html" title="Wordpress 高亮显示关键词及欢迎提示 (2010年07月16日)">Wordpress 高亮显示关键词及欢迎提示</a> (180)</li><li><a href="http://wange.im/wordpress-say-hello-to-vistors.html" title="Wordpress 向来自其他域的访客致欢迎词 (2010年07月30日)">Wordpress 向来自其他域的访客致欢迎词</a> (175)</li><li><a href="http://wange.im/output-twitter-to-wordpress-revision.html" title="Wordpress 非插件调用 Twitter 修订版 (2010年06月28日)">Wordpress 非插件调用 Twitter 修订版</a> (147)</li><li><a href="http://wange.im/pagenavi-without-plugins-in-wordpress.html" title="Wordpress 非插件日志分页效果 (2010年05月27日)">Wordpress 非插件日志分页效果</a> (121)</li><li><a href="http://wange.im/share-to-sns-without-plugins-for-wordpress.html" title="Wordpress 非插件实现分享按钮 (2010年05月19日)">Wordpress 非插件实现分享按钮</a> (168)</li><li><a href="http://wange.im/related-posts-with-thumbs-for-wordpress.html" title="Wordpress 免插件实现图片相关日志 (2010年05月4日)">Wordpress 免插件实现图片相关日志</a> (98)</li><li><a href="http://wange.im/wordpress-ip-statistics-without-plugins.html" title="Wordpress 非插件统计网站访问信息 (2010年04月10日)">Wordpress 非插件统计网站访问信息</a> (115)</li><li><a href="http://wange.im/related-posts-without-plugins-in-wordpress.html" title="Wordpress 非插件相关日志的两种方法 (2010年04月4日)">Wordpress 非插件相关日志的两种方法</a> (134)</li><li><a href="http://wange.im/sync-wordpress-to-twitter.html" title="非插件同步 Wordpress 日志到 Twitter (2010年04月1日)">非插件同步 Wordpress 日志到 Twitter</a> (113)</li><li><a href="http://wange.im/wordpress-statistics-without-plugins.html" title="Wordpress 非插件统计网站信息 (2010年03月20日)">Wordpress 非插件统计网站信息</a> (102)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/highlight-keywords-in-wordpress-search.html/feed</wfw:commentRss>
		<slash:comments>119</slash:comments>
		</item>
		<item>
		<title>Wordpress 高亮显示关键词及欢迎提示</title>
		<link>http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html</link>
		<comments>http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html#comments</comments>
		<pubDate>Fri, 16 Jul 2010 12:01:57 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[关键词]]></category>
		<category><![CDATA[搜索]]></category>
		<category><![CDATA[非插件]]></category>
		<category><![CDATA[高亮]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3496</guid>
		<description><![CDATA[　　写这篇文章绝对是受了 Qiqiboy 的刺激，该小盆友说我的 Wordpress 站内搜索没有用关键词高亮，而且还有图有真相的，巨受打击。好吧，我顶着明天两门考试可能挂彩的压力，今天就不复习了，全心投入到研究 Wordpress 关键词搜索高亮显示的行列中，什么 PHP 啊、JQuery 啊、CSS 啊、正则啊、获取 Cookies 啊，反正能用的我都用上了，8 过神奇的是，折腾出来的不是 Wordpress 自带的站内搜索的关键词高亮，而是来自 Google、百度等搜索引擎的关键词高亮显示，并且对访客显示欢迎提示词。
　　这样说是很难让人理解的，你可以先试试用百度或者 Google 搜索本站的关键词“万戈”，再通过搜索引擎的结果点击进入本站，就可以看到效果了，在右侧栏的位置可以看到一个可以随滚动条上下浮动的弹出层，显示“欢迎来自 *** 的朋友！推荐您 点击这里 订阅我的博客 o(∩_∩)o ”，这里的 *** 是可以显示通过哪个搜索引擎入口来访的，很亲切哟。
　　另外，用我的一些其他的关键词，如“Wordpress 读者墙”之类的，通过搜索引擎点击进入本站，则会看到你搜索的关键词已经加粗高亮，这样也就强调了访客希望看到的重点内容，提高了访客的体验。
　　以下两张分别是搜索引擎的关键词高亮和来自搜索引擎的访客欢迎提示词的截图。








　　好了，废话到此结束，下面是代码部分，首先要感谢一下 landing-sites 插件的作者，我就是在此研究成果上精简修改并折腾出了非插件版本的、更适合中国本土搜索引擎、再加上我无敌美化的代码～
　　一、首页是 PHP 的函数部分，老规矩，把以下代码复制到 Wordpress 主题目的 functions.php 中：
function ls_get_delim($ref) {&#160;&#160;&#160; $search_engines = array&#160;&#160;&#160; (&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;google.com&#39; =&#62; &#39;q&#39;,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;google.com.hk&#39; =&#62; &#39;q&#39;,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;baidu.com&#39; =&#62; &#39;wd&#39;,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;search.yahoo.com&#39; =&#62; &#39;p&#39;,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;cn.search.yahoo.com&#39; =&#62; &#39;p&#39;,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>　　写这篇文章绝对是受了 <a title="Qiqiboy" rel="external nofollow" href="http://www.qiqiboy.com/" target="_blank">Qiqiboy</a> 的刺激，该小盆友说<a title="wordpress高亮搜索结果+实现关键字前后截断显示" rel="external nofollow" href="http://www.qiqiboy.com/2010/07/16/wordpress-highlighted-keyword-search-results.html" target="_blank">我的 Wordpress 站内搜索没有用关键词高亮</a>，而且还有图有真相的，巨受打击。好吧，我顶着明天两门考试可能挂彩的压力，今天就不复习了，全心投入到研究 Wordpress 关键词搜索高亮显示的行列中，什么 PHP 啊、JQuery 啊、CSS 啊、正则啊、获取 Cookies 啊，反正能用的我都用上了，8 过神奇的是，折腾出来的不是 Wordpress 自带的站内搜索的关键词高亮，而是来自 Google、百度等<strong>搜索引擎的关键词高亮显示</strong>，并且对访客<strong>显示欢迎提示词</strong>。</p>
<p>　　这样说是很难让人理解的，你可以先试试用百度或者 Google 搜索本站的关键词“万戈”，再通过搜索引擎的结果点击进入本站，就可以看到效果了，在右侧栏的位置可以看到一个可以随滚动条上下浮动的弹出层，显示“欢迎来自 *** 的朋友！推荐您 <strong><a href="http://feed.wange.im/" target="_blank">点击这里</a></strong> 订阅我的博客 o(∩_∩)o ”，这里的 *** 是可以显示通过哪个搜索引擎入口来访的，很亲切哟。</p>
<p>　　另外，用我的一些其他的关键词，如“Wordpress 读者墙”之类的，通过搜索引擎点击进入本站，则会看到你搜索的关键词已经加粗高亮，这样也就强调了访客希望看到的重点内容，提高了访客的体验。</p>
<p>　　以下两张分别是<strong>搜索引擎的关键词高亮</strong>和<strong>来自搜索引擎的访客欢迎提示词</strong>的截图。</p>
<table border="0" align="center">
<tbody>
<tr>
<td><div class="wp-caption alignnone" style="width: 220px"><img title="搜索高亮显示关键词" src="http://storage.live.com/items/C3C8B704573706D9!565?filename=highlight.jpg" alt="" width="210" height="220" /><p class="wp-caption-text">搜索高亮显示关键词</p></div></td>
<td><div class="wp-caption alignnone" style="width: 325px"><img title="搜索访客显示欢迎提示词" src="http://storage.live.com/items/C3C8B704573706D9!564?filename=hellobaby.jpg" alt="" width="315" height="220" /><p class="wp-caption-text">搜索访客显示欢迎提示词</p></div></td>
</tr>
</tbody>
</table>
<p>　　好了，废话到此结束，下面是代码部分，首先要感谢一下 <a target="_blank" rel="external nofollow" href="http://wordpress.org/extend/plugins/landing-sites/">landing-sites 插件</a>的作者，我就是在此研究成果上精简修改并折腾出了非插件版本的、更适合中国本土搜索引擎、再加上我无敌美化的代码～</p>
<p>　　一、首页是 PHP 的函数部分，老规矩，把以下代码复制到 Wordpress 主题目的 functions.php 中：</p>
<p><DIV style="FONT-FAMILY: 'Courier New', 'Lucida Console', 'monospace'; COLOR: #000000" class=source jQuery1279274116031="14"><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">function</SPAN> <SPAN style="COLOR: #000000">ls_get_delim</SPAN>(<SPAN style="COLOR: #000000">$ref</SPAN>) <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$search_engines</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">array</SPAN>&nbsp;&nbsp;&nbsp; (<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;google.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;q&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;google.com.hk&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;q&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;baidu.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;wd&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;search.yahoo.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;p&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;cn.search.yahoo.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;p&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;cn.bing.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;q&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;search.lycos.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;query&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;youdao.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;q&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;search.aol.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;query&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;ask.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;q&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;hotbot.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;query&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;overture.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;Keywords&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;search.netscape.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;query&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;search.looksmart.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;qt&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;search.earthlink.net&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;q&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;search.viewpoint.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;k&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&#39;mamma.com&#39;</SPAN> <SPAN style="COLOR: #000000">=&gt;</SPAN> <SPAN style="COLOR: #0000ff">&#39;query&#39;</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$delim</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">FALSE</SPAN>;<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">isset</SPAN>(<SPAN style="COLOR: #000000">$search_engines</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #000000">$ref</SPAN><SPAN style="COLOR: #000000">]))</SPAN> <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$delim</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">$search_engines</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #000000">$ref</SPAN><SPAN style="COLOR: #000000">];</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">}</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> <SPAN style="COLOR: #000000">$delim</SPAN>;<BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">function</SPAN> <SPAN style="COLOR: #000000">ls_get_terms</SPAN>(<SPAN style="COLOR: #000000">$d</SPAN>) <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$terms</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">null</SPAN>;<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query_array</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">array</SPAN>();<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query_terms</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">null</SPAN>;<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">explode</SPAN>(<SPAN style="COLOR: #000000">$d</SPAN><SPAN style="COLOR: #000000">.</SPAN><SPAN style="COLOR: #0000ff">&#39;=&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$_SERVER</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">&#39;HTTP_REFERER&#39;</SPAN><SPAN style="COLOR: #000000">]);</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">explode</SPAN>(<SPAN style="COLOR: #0000ff">&#39;&amp;&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$query</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">1</SPAN><SPAN style="COLOR: #000000">]);</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">urldecode</SPAN>(<SPAN style="COLOR: #000000">$query</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">0</SPAN><SPAN style="COLOR: #000000">]);</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">str_replace</SPAN>(<SPAN style="COLOR: #0000ff">&quot;&#39;&quot;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">&#39;&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$query</SPAN>);<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">str_replace</SPAN>(<SPAN style="COLOR: #0000ff">&#39;&quot;&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">&#39;&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$query</SPAN>);<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query_array</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">preg_split</SPAN>(<SPAN style="COLOR: #0000ff">&#39;/[\s,\+\.]+/&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">$query</SPAN>);<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$query_terms</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">implode</SPAN>(<SPAN style="COLOR: #0000ff">&#39; &#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$query_array</SPAN>);<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$terms</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">htmlspecialchars</SPAN>(<SPAN style="COLOR: #000000">urldecode</SPAN>(<SPAN style="COLOR: #000000">$query_terms</SPAN>));<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">seems_utf8</SPAN>(<SPAN style="COLOR: #000000">$terms</SPAN><SPAN style="COLOR: #000000">)){</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$terms</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">iconv</SPAN>(<SPAN style="COLOR: #0000ff">&quot;GBK&quot;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">&quot;UTF-8&quot;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$terms</SPAN>);<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">}</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> <SPAN style="COLOR: #000000">$terms</SPAN>;<BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">function</SPAN> <SPAN style="COLOR: #000000">ls_get_refer</SPAN>() <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">isset</SPAN>(<SPAN style="COLOR: #000000">$_SERVER</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">&#39;HTTP_REFERER&#39;</SPAN><SPAN style="COLOR: #000000">])</SPAN> || (<SPAN style="COLOR: #000000">$_SERVER</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">&#39;HTTP_REFERER&#39;</SPAN><SPAN style="COLOR: #000000">]</SPAN> <SPAN style="COLOR: #000000">==</SPAN> <SPAN style="COLOR: #0000ff">&#39;&#39;</SPAN>)) <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> <SPAN style="COLOR: #000000">FALSE</SPAN>;<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$referer_info</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">parse_url</SPAN>(<SPAN style="COLOR: #000000">$_SERVER</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">&#39;HTTP_REFERER&#39;</SPAN><SPAN style="COLOR: #000000">]);</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$referer</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">$referer_info</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">&#39;host&#39;</SPAN><SPAN style="COLOR: #000000">];</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">substr</SPAN>(<SPAN style="COLOR: #000000">$referer</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">0</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">4</SPAN>) <SPAN style="COLOR: #000000">==</SPAN> <SPAN style="COLOR: #0000ff">&#39;www.&#39;</SPAN>)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$referer</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">substr</SPAN>(<SPAN style="COLOR: #000000">$referer</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">4</SPAN>);<BR><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> <SPAN style="COLOR: #000000">$referer</SPAN>;<BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">function</SPAN> <SPAN style="COLOR: #000000">ls_getinfo</SPAN>(<SPAN style="COLOR: #000000">$what</SPAN>) <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$referer</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">ls_get_refer</SPAN>();<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">$referer</SPAN>) <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> <SPAN style="COLOR: #000000">FALSE</SPAN>;<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$delimiter</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">ls_get_delim</SPAN>(<SPAN style="COLOR: #000000">$referer</SPAN>);<BR><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">$delimiter</SPAN>)<BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$terms</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">ls_get_terms</SPAN>(<SPAN style="COLOR: #000000">$delimiter</SPAN>);<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">$what</SPAN> <SPAN style="COLOR: #000000">==</SPAN> <SPAN style="COLOR: #0000ff">&#39;isref&#39;</SPAN>) <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> (<SPAN style="COLOR: #000000">$terms</SPAN> <SPAN style="COLOR: #000000">!=</SPAN> <SPAN style="COLOR: #0000ff">&#39;&#39;</SPAN><SPAN style="COLOR: #000000">?</SPAN><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">true</SPAN><SPAN style="COLOR: #000000">:</SPAN><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">false</SPAN>);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">}</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">$what</SPAN> <SPAN style="COLOR: #000000">==</SPAN> <SPAN style="COLOR: #0000ff">&#39;referrer&#39;</SPAN>) <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">$parsed</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">parse_url</SPAN>(<SPAN style="COLOR: #000000">$_SERVER</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">&#39;HTTP_REFERER&#39;</SPAN><SPAN style="COLOR: #000000">]);</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">echo</SPAN> <SPAN style="COLOR: #0000ff">&#39;&lt;a href=&quot;http://&#39;</SPAN><SPAN style="COLOR: #000000">.</SPAN><SPAN style="COLOR: #000000">$parsed</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">&#39;host&#39;</SPAN><SPAN style="COLOR: #000000">].</SPAN><SPAN style="COLOR: #0000ff">&#39;&quot;&gt;&#39;</SPAN><SPAN style="COLOR: #000000">.</SPAN><SPAN style="COLOR: #000000">$parsed</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">&#39;host&#39;</SPAN><SPAN style="COLOR: #000000">].</SPAN><SPAN style="COLOR: #0000ff">&#39;&lt;/a&gt;&#39;</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">}</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">$what</SPAN> <SPAN style="COLOR: #000000">==</SPAN> <SPAN style="COLOR: #0000ff">&#39;terms&#39;</SPAN>) <SPAN style="COLOR: #000000">{</SPAN> <SPAN style="COLOR: #000000">echo</SPAN> <SPAN style="COLOR: #000000">$terms</SPAN>; <SPAN style="COLOR: #000000">}</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">function</SPAN>&nbsp; <SPAN style="COLOR: #000000">ls_terms_filter</SPAN>(<SPAN style="COLOR: #000000">$content</SPAN><SPAN style="COLOR: #000000">){</SPAN><BR><SPAN style="COLOR: #000000">$referer</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">ls_get_refer</SPAN>();<BR><SPAN style="COLOR: #000000">$output</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #0000ff">&#39;&#39;</SPAN>;<BR><SPAN style="COLOR: #000000">$delimiter</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">ls_get_delim</SPAN>(<SPAN style="COLOR: #000000">$referer</SPAN>);<BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN>(<SPAN style="COLOR: #000000">$delimiter</SPAN>)<BR><SPAN style="COLOR: #000000">{</SPAN><BR><SPAN style="COLOR: #000000">$terms</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">ls_get_terms</SPAN>(<SPAN style="COLOR: #000000">$delimiter</SPAN>);<BR><SPAN style="COLOR: #000000">$terms</SPAN><SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">array_unique</SPAN>(<SPAN style="COLOR: #000000">preg_split</SPAN>(<SPAN style="COLOR: #0000ff">&quot;/[\s,]+/&quot;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$terms</SPAN>));<BR><SPAN style="COLOR: #000000">$contentarr</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">preg_split</SPAN>(<SPAN style="COLOR: #0000ff">&quot;/(&lt;.*&gt;)/U&quot;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$content</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #0000ff">1</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">PREG_SPLIT_DELIM_CAPTURE</SPAN>);<BR><SPAN style="COLOR: #000000">$stop</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">count</SPAN>(<SPAN style="COLOR: #000000">$contentarr</SPAN>);<BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">for</SPAN> (<SPAN style="COLOR: #000000">$i</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #0000ff">0</SPAN>; <SPAN style="COLOR: #000000">$i</SPAN> <SPAN style="COLOR: #000000">&lt;</SPAN> <SPAN style="COLOR: #000000">$stop</SPAN>; <SPAN style="COLOR: #000000">$i</SPAN><SPAN style="COLOR: #000000">++</SPAN>) <SPAN style="COLOR: #000000">{</SPAN><BR><SPAN style="COLOR: #000000">$content</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">$contentarr</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #000000">$i</SPAN><SPAN style="COLOR: #000000">];</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> ((<SPAN style="COLOR: #000000">strlen</SPAN>(<SPAN style="COLOR: #000000">$content</SPAN>) <SPAN style="COLOR: #000000">&gt;</SPAN> <SPAN style="COLOR: #0000ff">0</SPAN>) <SPAN style="COLOR: #000000">&amp;&amp;</SPAN> (<SPAN style="COLOR: #0000ff">&#39;&lt;&#39;</SPAN> <SPAN style="COLOR: #000000">!=</SPAN> <SPAN style="COLOR: #000000">$content</SPAN><SPAN style="COLOR: #000000">{</SPAN><SPAN style="COLOR: #0000ff">0</SPAN><SPAN style="COLOR: #000000">}))</SPAN> <SPAN style="COLOR: #000000">{</SPAN><BR><SPAN style="COLOR: #000000">foreach</SPAN> (<SPAN style="COLOR: #000000">$terms</SPAN> <SPAN style="COLOR: #000000">as</SPAN> <SPAN style="COLOR: #000000">$term</SPAN>) <SPAN style="COLOR: #000000">{</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">strlen</SPAN>(<SPAN style="COLOR: #000000">$term</SPAN>)<SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #0000ff">1</SPAN>)<BR><SPAN style="COLOR: #000000">$content</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">eregi_replace</SPAN>(<SPAN style="COLOR: #0000ff">&quot;($term)&quot;</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">&quot;&lt;b style=&#39;background:#ffff00;&#39;&gt;\\1&lt;/b&gt;&quot;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">$content</SPAN>);<BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000000">$output</SPAN> <SPAN style="COLOR: #000000">.</SPAN><SPAN style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">$content</SPAN>;<BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> <SPAN style="COLOR: #000000">$output</SPAN>;<BR><SPAN style="COLOR: #000000">}</SPAN> <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">else</SPAN><SPAN style="COLOR: #000000">{</SPAN><BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">return</SPAN> <SPAN style="COLOR: #000000">$content</SPAN>;<BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000000">add_filter</SPAN>(<SPAN style="COLOR: #0000ff">&#39;the_content&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">&#39;ls_terms_filter&#39;</SPAN>);<BR><SPAN style="COLOR: #000000">add_filter</SPAN>(<SPAN style="COLOR: #0000ff">&#39;comment_text&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">&#39;ls_terms_filter&#39;</SPAN>);<BR><SPAN style="COLOR: #000080; FONT-WEIGHT: bold">function</SPAN> <SPAN style="COLOR: #000000">ls_set_header</SPAN>() <SPAN style="COLOR: #000000">{</SPAN><BR>&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #000080; FONT-WEIGHT: bold">if</SPAN> (<SPAN style="COLOR: #000000">ls_getinfo</SPAN>(<SPAN style="COLOR: #0000ff">&#39;isref&#39;</SPAN>)) <SPAN style="COLOR: #000000">header</SPAN>(<SPAN style="COLOR: #0000ff">&#39;Vary: Referer&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #000000">FALSE</SPAN>);<BR><SPAN style="COLOR: #000000">}</SPAN><BR><SPAN style="COLOR: #000000">add_action</SPAN>(<SPAN style="COLOR: #0000ff">&#39;init&#39;</SPAN><SPAN style="COLOR: #000000">,</SPAN> <SPAN style="COLOR: #0000ff">&#39;ls_set_header&#39;</SPAN>);<BR></DIV></p>
<p>　　可以看到在搜索引擎的数组中，我加入了 google.com.hk、百度、有道、必应等适合中国网民的搜索引擎，当然你也可以按照这样的格式再添加几个。</p>
<p>　　二、是 HTML 和调用以上函数的部分，可以放在任何地方，个人建议放在 footer.php 中，最后用样式定一下位嘛就可以了：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #008080;">&lt;?php</span> <span style="color: #000080; font-weight: bold;">if</span> (<span style="color: #000000;">ls_getinfo</span>(<span style="color: #0000ff;">'isref'</span>)) <span style="color: #000000;">:</span> <span style="color: #008080;">?&gt;</span><br />
<span style="color: #000080; font-weight: bold;">&lt;div</span> <span style="color: #ff0000;">id=</span><span style="color: #0000ff;">'hellobaby'</span><span style="color: #000080; font-weight: bold;">&gt;</span><span style="color: #000000;">欢迎来自 </span><span style="color: #008080;">&lt;?php</span> <span style="color: #000000;">ls_getinfo</span>(<span style="color: #0000ff;">'referrer'</span>); <span style="color: #008080;">?&gt;</span><span style="color: #000000;"> 的朋友！</span><span style="color: #000080; font-weight: bold;">&lt;br</span> <span style="color: #000080; font-weight: bold;">/&gt;</span><span style="color: #000000;">推荐您 </span><span style="color: #000080; font-weight: bold;">&lt;b&gt;&lt;a</span> <span style="color: #ff0000;">href=</span><span style="color: #0000ff;">'http://feed.wange.im'</span> <span style="color: #ff0000;">target=</span><span style="color: #0000ff;">'_blank'</span><span style="color: #000080; font-weight: bold;">&gt;</span><span style="color: #000000;">点击这里</span><span style="color: #000080; font-weight: bold;">&lt;/a&gt;&lt;/b&gt;</span><span style="color: #000000;"> 订阅我的博客 o(∩_∩)o</span><br />
<span style="color: #000080; font-weight: bold;">&lt;div</span> <span style="color: #ff0000;">class=</span><span style="color: #0000ff;">"closebox"</span><span style="color: #000080; font-weight: bold;">&gt;&lt;a</span> <span style="color: #ff0000;">href=</span><span style="color: #0000ff;">"javascript:void(0)"</span> <span style="color: #ff0000;">onclick=</span><span style="color: #0000ff;">"$('#hellobaby').slideUp('slow');$('.closebox').css('display','none');"</span> <span style="color: #ff0000;">title=</span><span style="color: #0000ff;">"关闭"</span><span style="color: #000080; font-weight: bold;">&gt;</span><span style="color: #000000;">×</span><span style="color: #000080; font-weight: bold;">&lt;/a&gt;&lt;/div&gt;</span><br />
<span style="color: #000080; font-weight: bold;">&lt;/div&gt;</span><br />
<span style="color: #008080;">&lt;?php</span> <span style="color: #000080; font-weight: bold;">endif</span>; <span style="color: #008080;">?&gt;</span></div>
<p>　　三、最后是样式部分，这个各位可以发挥各自所长，下面我就提供一下我的样式表，仅供参考：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #000000;">#hellobaby</span> <span style="color: #000000;">{</span><br />
    <span style="color: #000080; font-weight: bold;">background</span><span style="color: #000000;">:</span><span style="color: #0000ff;">#000000</span>;<br />
    <span style="color: #000080; font-weight: bold;">border</span><span style="color: #000000;">:</span><span style="color: #0000ff;">1px</span> <span style="color: #000080; font-weight: bold;">solid</span> <span style="color: #0000ff;">#B3B3B3</span>;<br />
    <span style="color: #000080; font-weight: bold;">color</span><span style="color: #000000;">:</span><span style="color: #0000ff;">#FFFFFF</span>;<br />
    <span style="color: #000080; font-weight: bold;">font-size</span><span style="color: #000000;">:</span><span style="color: #0000ff;">14px</span>;<br />
    <span style="color: #000080; font-weight: bold;">opacity</span><span style="color: #000000;">:</span><span style="color: #0000ff;">0</span><span style="color: #000000;">.</span><span style="color: #0000ff;">7</span>;<br />
    <span style="color: #000000;">filter</span><span style="color: #000000;">:</span><span style="color: #000000;">alpha</span>(<span style="color: #000080; font-weight: bold;">opacity</span><span style="color: #000000;">=</span><span style="color: #0000ff;">70</span>);<br />
    <span style="color: #000080; font-weight: bold;">padding</span><span style="color: #000000;">:</span><span style="color: #0000ff;">10px</span>;<br />
    <span style="color: #000080; font-weight: bold;">position</span><span style="color: #000000;">:</span><span style="color: #000080; font-weight: bold;">absolute</span>;<br />
    <span style="color: #000080; font-weight: bold;">right</span><span style="color: #000000;">:</span><span style="color: #0000ff;">0</span>;<br />
    <span style="color: #000080; font-weight: bold;">top</span><span style="color: #000000;">:</span><span style="color: #0000ff;">250px</span>;<br />
<span style="color: #000000;">}</span></div>
<p>　　写到这里，功能上已经实现了，剩下的就是美化工作，最后的最后，你也可以像我这样，给旁边的欢迎提示词用 JQuery 加一个滑动效果，那就更炫了，不过因为篇幅有限，我这里就不多介绍了。</p>
<p>　　最后的最后的最后，还要感谢 http://www.chinawp.com/2009/10/106/ 此文，给了我很大的帮助，本文的灵感就来源于此。</p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="Wordpress 高亮显示关键词及欢迎提示" href="http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html">《Wordpress 高亮显示关键词及欢迎提示》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="Wordpress 高亮显示关键词及欢迎提示" href="http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html">http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/highlight-keywords-in-wordpress-search.html" title="Wordpress 站内搜索高亮显示关键词 (2010年07月18日)">Wordpress 站内搜索高亮显示关键词</a> (119)</li><li><a href="http://wange.im/wordpress-say-hello-to-vistors.html" title="Wordpress 向来自其他域的访客致欢迎词 (2010年07月30日)">Wordpress 向来自其他域的访客致欢迎词</a> (175)</li><li><a href="http://wange.im/output-twitter-to-wordpress-revision.html" title="Wordpress 非插件调用 Twitter 修订版 (2010年06月28日)">Wordpress 非插件调用 Twitter 修订版</a> (147)</li><li><a href="http://wange.im/pagenavi-without-plugins-in-wordpress.html" title="Wordpress 非插件日志分页效果 (2010年05月27日)">Wordpress 非插件日志分页效果</a> (121)</li><li><a href="http://wange.im/share-to-sns-without-plugins-for-wordpress.html" title="Wordpress 非插件实现分享按钮 (2010年05月19日)">Wordpress 非插件实现分享按钮</a> (168)</li><li><a href="http://wange.im/related-posts-with-thumbs-for-wordpress.html" title="Wordpress 免插件实现图片相关日志 (2010年05月4日)">Wordpress 免插件实现图片相关日志</a> (98)</li><li><a href="http://wange.im/wordpress-ip-statistics-without-plugins.html" title="Wordpress 非插件统计网站访问信息 (2010年04月10日)">Wordpress 非插件统计网站访问信息</a> (115)</li><li><a href="http://wange.im/related-posts-without-plugins-in-wordpress.html" title="Wordpress 非插件相关日志的两种方法 (2010年04月4日)">Wordpress 非插件相关日志的两种方法</a> (134)</li><li><a href="http://wange.im/sync-wordpress-to-twitter.html" title="非插件同步 Wordpress 日志到 Twitter (2010年04月1日)">非插件同步 Wordpress 日志到 Twitter</a> (113)</li><li><a href="http://wange.im/wordpress-statistics-without-plugins.html" title="Wordpress 非插件统计网站信息 (2010年03月20日)">Wordpress 非插件统计网站信息</a> (102)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>180</slash:comments>
		</item>
		<item>
		<title>Wordpress 实现“您的足迹”功能</title>
		<link>http://wange.im/show-your-recent-comments-in-wordpress.html</link>
		<comments>http://wange.im/show-your-recent-comments-in-wordpress.html#comments</comments>
		<pubDate>Mon, 12 Jul 2010 12:03:45 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[留言]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3471</guid>
		<description><![CDATA[　　今天手贱，又小小地折腾了一下 Wordpress，我也不知道该怎么描述这个功能，可能标题让你有点晕，我们还是先看效果吧。如果是之前留过言的访客，请看内页侧边栏，我新添加了一个“您的足迹”，可以看到，这里列出了留言访客的最近10条评论，当然，只能看到你自己的最近10条评论，原理就是调用记录在你浏览器中的 Cookies，如果你是第一次来访，或者刚刚清空了浏览器的缓存，那就看不到“您的足迹”这个板块了。
　　这其实就是一个最新评论功能的修改版，最新评论中指定隐藏管理员评论，而在“您的足迹”中正好是相对的，要指定显示某一个访客的评论，这里的访客就是指当前浏览器 Cookies 中记录的上一次评论者的信息。明白了原理，实现这个功能也就不难了，在最新评论代码的基础上，把 Cookies 中的访客信息作为变量传递给 comment_author 这个字段就可以了。
　　把以下代码复制到 Wordpress 主题文件中需要的地方，比如说 sidebar.php：
&#60;?php
    if($_COOKIE["comment_author_" . COOKIEHASH]!=""){
        global $wpdb;
        $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_author_email, comment_type, comment_author_url, SUBSTRING(comment_content,1,25) AS com_excerpt FROM $wpdb-&#62;comments LEFT OUTER JOIN $wpdb-&#62;posts ON ($wpdb-&#62;comments.comment_post_ID = $wpdb-&#62;posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND comment_author [...]]]></description>
			<content:encoded><![CDATA[<p>　　今天手贱，又小小地折腾了一下 Wordpress，我也不知道该怎么描述这个功能，可能标题让你有点晕，我们还是先看效果吧。如果是之前留过言的访客，请看内页侧边栏，我新添加了一个“您的足迹”，可以看到，这里列出了留言访客的最近10条评论，当然，只能看到你自己的最近10条评论，原理就是调用记录在你浏览器中的 Cookies，如果你是第一次来访，或者刚刚清空了浏览器的缓存，那就看不到“您的足迹”这个板块了。</p>
<p>　　这其实就是一个最新评论功能的修改版，<a title="Wordpress 隐藏博主的最新留言" href="http://wange.im/hide-recent-author-comment-in-wordpress.html">最新评论中指定隐藏管理员评论</a>，而在“您的足迹”中正好是相对的，要指定显示某一个访客的评论，这里的访客就是指当前浏览器 Cookies 中记录的上一次评论者的信息。明白了原理，实现这个功能也就不难了，在最新评论代码的基础上，把 Cookies 中的访客信息作为变量传递给 comment_author 这个字段就可以了。</p>
<p>　　把以下代码复制到 Wordpress 主题文件中需要的地方，比如说 sidebar.php：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #008080;">&lt;?php</span><br />
    <span style="color: #000080; font-weight: bold;">if</span>(<span style="color: #000000;">$_COOKIE</span><span style="color: #000000;">[</span><span style="color: #0000ff;">"comment_author_"</span> <span style="color: #000000;">.</span> <span style="color: #000000;">COOKIEHASH</span><span style="color: #000000;">]</span><span style="color: #000000;">!=</span><span style="color: #0000ff;">""</span><span style="color: #000000;">){</span><br />
        <span style="color: #000080; font-weight: bold;">global</span> <span style="color: #000000;">$wpdb</span>;<br />
        <span style="color: #000000;">$sql</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">"SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_author_email, comment_type, comment_author_url, SUBSTRING(comment_content,1,25) AS com_excerpt FROM </span><span style="color: #0000ff;">$wpdb-&gt;comments</span><span style="color: #0000ff;"> LEFT OUTER JOIN </span><span style="color: #0000ff;">$wpdb-&gt;posts</span><span style="color: #0000ff;"> ON (</span><span style="color: #0000ff;">$wpdb-&gt;comments</span><span style="color: #0000ff;">.comment_post_ID = </span><span style="color: #0000ff;">$wpdb-&gt;posts</span><span style="color: #0000ff;">.ID) WHERE comment_approved = '1' AND comment_type = '' AND comment_author = '"</span><span style="color: #000000;">.</span><span style="color: #000000;">$_COOKIE</span><span style="color: #000000;">[</span><span style="color: #0000ff;">"comment_author_"</span> <span style="color: #000000;">.</span> <span style="color: #000000;">COOKIEHASH</span><span style="color: #000000;">]</span><span style="color: #000000;">.</span><span style="color: #0000ff;">"' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 10"</span>;<br />
        <span style="color: #000000;">$comments</span> <span style="color: #000000;">=</span> <span style="color: #000000;">$wpdb</span><span style="color: #000000;">-&gt;</span><span style="color: #ff0000;">get_results</span>(<span style="color: #000000;">$sql</span>);<br />
        <span style="color: #000080; font-weight: bold;">foreach</span> (<span style="color: #000000;">$comments</span> <span style="color: #000080; font-weight: bold;">as</span> <span style="color: #000000;">$comment</span>) <span style="color: #000000;">{</span><br />
            <span style="color: #000000;">$output</span> <span style="color: #000000;">.=</span> <span style="color: #0000ff;">"</span><span style="color: #0000ff;">\n</span><span style="color: #0000ff;">&lt;li&gt;&lt;a href=</span><span style="color: #0000ff;">\"</span><span style="color: #0000ff;">"</span> <span style="color: #000000;">.</span><span style="color: #000000;">get_permalink</span>(<span style="color: #000000;">$comment</span><span style="color: #000000;">-&gt;</span><span style="color: #ff0000;">ID</span>)<span style="color: #000000;">.</span><span style="color: #0000ff;">"#comment-"</span><span style="color: #000000;">.</span><span style="color: #000000;">$comment</span><span style="color: #000000;">-&gt;</span><span style="color: #ff0000;">comment_ID</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">"</span><span style="color: #0000ff;">\"</span><span style="color: #0000ff;"> title=</span><span style="color: #0000ff;">\"</span><span style="color: #0000ff;">"</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$comment</span><span style="color: #000000;">-&gt;</span><span style="color: #ff0000;">post_title</span> <span style="color: #000000;">.</span> <span style="color: #0000ff;">" 上的评论</span><span style="color: #0000ff;">\"</span><span style="color: #0000ff;">&gt;"</span><span style="color: #000000;">.</span><span style="color: #000000;">strip_tags</span>(<span style="color: #000000;">$comment</span><span style="color: #000000;">-&gt;</span><span style="color: #ff0000;">comment_author</span>)<span style="color: #000000;">.</span><span style="color: #0000ff;">"： "</span><span style="color: #000000;">.</span> <span style="color: #000000;">strip_tags</span>(<span style="color: #000000;">$comment</span><span style="color: #000000;">-&gt;</span><span style="color: #ff0000;">com_excerpt</span>) <span style="color: #000000;">.</span><span style="color: #0000ff;">"&lt;/a&gt;&lt;/li&gt;"</span>;<br />
        <span style="color: #000000;">}</span><br />
        <span style="color: #000000;">$output</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">'&lt;h3&gt;您的足迹&lt;/h3&gt;&lt;ul&gt;'</span><span style="color: #000000;">.</span><span style="color: #000000;">$output</span><span style="color: #000000;">.</span><span style="color: #0000ff;">'&lt;/ul&gt;'</span>;<br />
        <span style="color: #000000;">$output</span> <span style="color: #000000;">=</span> <span style="color: #000000;">convert_smilies</span>(<span style="color: #000000;">$output</span>);<br />
        <span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #000000;">$output</span>;<br />
    <span style="color: #000000;">}</span><br />
<span style="color: #008080;">?&gt;</span></div>
<p>　　因为我水平有限，就不一一解释以上代码的意思了，怕误导大家，另外样式表我也不提供了，每个主题的样式都各不相同，这个大家自由发挥吧。如果你嫌以上代码太累赘，可以把代码封装起来放在 Wordpress 主题的 functions.php 里，然后在需要的地方调用，这个扩展也不在本文讨论范围。</p>
<p>　　下面给第一次来访而看不到效果的朋友截了一张图，也欢迎新来的朋友踊跃留言测试呀～<br />
<img src="http://storage.live.com/items/C3C8B704573706D9!563?filename=zuji.jpg" alt="" /></p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="Wordpress 实现“您的足迹”功能" href="http://wange.im/show-your-recent-comments-in-wordpress.html">《Wordpress 实现“您的足迹”功能》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="Wordpress 实现“您的足迹”功能" href="http://wange.im/show-your-recent-comments-in-wordpress.html">http://wange.im/show-your-recent-comments-in-wordpress.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/comment-count-in-wordpress-with-jquery.html" title="Jquery 实现 Wordpress 评论字数计数 (2010年07月27日)">Jquery 实现 Wordpress 评论字数计数</a> (145)</li><li><a href="http://wange.im/wordpress-shows-the-number-of-recent-comments.html" title="WordPress 显示访客最近评论次数 (2010年07月20日)">WordPress 显示访客最近评论次数</a> (198)</li><li><a href="http://wange.im/remove-comments-url-in-wordpress.html" title="Wordpress 去掉评论中链接的方法 (2010年07月8日)">Wordpress 去掉评论中链接的方法</a> (172)</li><li><a href="http://wange.im/replace-comment-text-in-wordpress.html" title="过滤并替换 Wordpress 留言指定字符 (2010年07月5日)">过滤并替换 Wordpress 留言指定字符</a> (242)</li><li><a href="http://wange.im/no-admin-comments-in-wordpress.html" title="Wordpress 统计排除管理员的评论数 (2010年06月18日)">Wordpress 统计排除管理员的评论数</a> (146)</li><li><a href="http://wange.im/per-page-of-wp-list-comments-in-wordpress.html" title="Wordpress 不同页面不同评论分页功能 (2010年06月16日)">Wordpress 不同页面不同评论分页功能</a> (133)</li><li><a href="http://wange.im/paginate-comments-in-wordpress.html" title="Wordpress 指定页面评论分页功能 (2010年06月13日)">Wordpress 指定页面评论分页功能</a> (140)</li><li><a href="http://wange.im/commenter-gravatar-in-wordpress.html" title="Wordpress 记录评论者 gravatar 头像 (2010年05月18日)">Wordpress 记录评论者 gravatar 头像</a> (154)</li><li><a href="http://wange.im/show-time-since-in-wordpress.html" title="Wordpress 显示发布内容于多少时间前 (2010年02月17日)">Wordpress 显示发布内容于多少时间前</a> (79)</li><li><a href="http://wange.im/comments-notification-failure.html" title="关于本站评论邮件通知部分失效 (2010年02月3日)">关于本站评论邮件通知部分失效</a> (173)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/show-your-recent-comments-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>262</slash:comments>
		</item>
		<item>
		<title>PHP 实现的静态世界时钟功能</title>
		<link>http://wange.im/world-clock-with-php.html</link>
		<comments>http://wange.im/world-clock-with-php.html#comments</comments>
		<pubDate>Fri, 09 Jul 2010 12:19:24 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3459</guid>
		<description><![CDATA[　　昨天有个博友的网站上需要加上显示世界时钟的功能，于是向我求助，因为是用在 Wordpress 主题上的，所以要用 PHP 来实现，硬着头皮答应了下来。不过说实话，我的 PHP 水平还不如我的英语水平，就是只会看不会写的那种，Wordpress 主题以内的一些 PHP 函数我还算比较熟悉，但是 Wordpress 以外的 PHP 我就有些傻眼了，每次写 PHP 都是咬着笔头，翻着 PHP 手册，搜着 Google，挤牙膏一样才挤出那么一点东西。
　　关于这个世界时钟的功能，原理上是很简单的，只要设置一个基准的默认时间，然后把其他地区的时间加上时间差就可以了，但是用什么函数呢？翻呀翻，搜呀搜，终于被我搞定了，贴出来留个纪念。先看 DEMO～
　　以下是世界时钟完整的 PHP 代码：
&#60;?php
//设置默认时区
date_default_timezone_set('Etc/GMT-8');
//当地时间，即北京时间
$localtime = date('Y-m-d H:i:s');
//伦敦时间
$london = date('Y-m-d H:i:s',strtotime("-8 hours $localtime"));
//柏林时间
$berlin = date('Y-m-d H:i:s',strtotime("-7 hours $localtime"));
//开罗时间
$cairo = date('Y-m-d H:i:s',strtotime("-6 hours $localtime"));
//莫斯科时间
$moscow = date('Y-m-d H:i:s',strtotime("-5 hours $localtime"));
//新德里时间
$newdelhi = date('Y-m-d H:i:s',strtotime("-3 hours $localtime"));
//曼谷时间
$bangkok = date('Y-m-d H:i:s',strtotime("-1 hours $localtime"));
//东京时间
$tokyo [...]]]></description>
			<content:encoded><![CDATA[<p>　　昨天有个博友的网站上需要加上显示世界时钟的功能，于是向我求助，因为是用在 Wordpress 主题上的，所以要用 PHP 来实现，硬着头皮答应了下来。不过说实话，我的 PHP 水平还不如我的英语水平，就是只会看不会写的那种，Wordpress 主题以内的一些 PHP 函数我还算比较熟悉，但是 Wordpress 以外的 PHP 我就有些傻眼了，每次写 PHP 都是咬着笔头，翻着 PHP 手册，搜着 Google，挤牙膏一样才挤出那么一点东西。</p>
<p>　　关于这个世界时钟的功能，原理上是很简单的，只要设置一个基准的默认时间，然后把其他地区的时间加上时间差就可以了，但是用什么函数呢？翻呀翻，搜呀搜，终于被我搞定了，贴出来留个纪念。<a title="世界时钟" href="http://wange.im/demo/worldclock/">先看 DEMO</a>～</p>
<p>　　以下是世界时钟完整的 PHP 代码：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #008080;">&lt;?php</span><br />
<span style="font-style: italic; color: #008800;">//设置默认时区</span><br />
<span style="color: #000000;">date_default_timezone_set</span>(<span style="color: #0000ff;">'Etc/GMT-8'</span>);<br />
<span style="font-style: italic; color: #008800;">//当地时间，即北京时间</span><br />
<span style="color: #000000;">$localtime</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span>);<br />
<span style="font-style: italic; color: #008800;">//伦敦时间</span><br />
<span style="color: #000000;">$london</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #000000;">,</span><span style="color: #000000;">strtotime</span>(<span style="color: #0000ff;">"-8 hours </span><span style="color: #0000ff;">$localtime</span><span style="color: #0000ff;">"</span>));<br />
<span style="font-style: italic; color: #008800;">//柏林时间</span><br />
<span style="color: #000000;">$berlin</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #000000;">,</span><span style="color: #000000;">strtotime</span>(<span style="color: #0000ff;">"-7 hours </span><span style="color: #0000ff;">$localtime</span><span style="color: #0000ff;">"</span>));<br />
<span style="font-style: italic; color: #008800;">//开罗时间</span><br />
<span style="color: #000000;">$cairo</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #000000;">,</span><span style="color: #000000;">strtotime</span>(<span style="color: #0000ff;">"-6 hours </span><span style="color: #0000ff;">$localtime</span><span style="color: #0000ff;">"</span>));<br />
<span style="font-style: italic; color: #008800;">//莫斯科时间</span><br />
<span style="color: #000000;">$moscow</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #000000;">,</span><span style="color: #000000;">strtotime</span>(<span style="color: #0000ff;">"-5 hours </span><span style="color: #0000ff;">$localtime</span><span style="color: #0000ff;">"</span>));<br />
<span style="font-style: italic; color: #008800;">//新德里时间</span><br />
<span style="color: #000000;">$newdelhi</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #000000;">,</span><span style="color: #000000;">strtotime</span>(<span style="color: #0000ff;">"-3 hours </span><span style="color: #0000ff;">$localtime</span><span style="color: #0000ff;">"</span>));<br />
<span style="font-style: italic; color: #008800;">//曼谷时间</span><br />
<span style="color: #000000;">$bangkok</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #000000;">,</span><span style="color: #000000;">strtotime</span>(<span style="color: #0000ff;">"-1 hours </span><span style="color: #0000ff;">$localtime</span><span style="color: #0000ff;">"</span>));<br />
<span style="font-style: italic; color: #008800;">//东京时间</span><br />
<span style="color: #000000;">$tokyo</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #000000;">,</span><span style="color: #000000;">strtotime</span>(<span style="color: #0000ff;">"+1 hours </span><span style="color: #0000ff;">$localtime</span><span style="color: #0000ff;">"</span>));<br />
<span style="font-style: italic; color: #008800;">//悉尼时间</span><br />
<span style="color: #000000;">$sydney</span> <span style="color: #000000;">=</span> <span style="color: #000000;">date</span>(<span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #000000;">,</span><span style="color: #000000;">strtotime</span>(<span style="color: #0000ff;">"+2 hours </span><span style="color: #0000ff;">$localtime</span><span style="color: #0000ff;">"</span>));<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'伦敦时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$london</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'柏林时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$berlin</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'开罗时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$cairo</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'莫斯科时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$moscow</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'新德里时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$newdelhi</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'曼谷时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$bangkok</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'北京时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$localtime</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'东京时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$tokyo</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #000080; font-weight: bold;">echo</span> <span style="color: #0000ff;">'悉尼时间：'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">$sydney</span><span style="color: #000000;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span>;<br />
<span style="color: #008080;">?&gt;</span></div>
<p>　　看代码还是很好理解的，但是却花了我近一个小时来研究时间函数，才写出这么几行。尤其是这个 date_default_timezone_set() 函数，刚开始我没有写这个函数，输出的时间和实际时间相差了8个小时，我想那一定是时区的问题了，一查果然如此。因为北京时间是东8区的，而从 php5.1.0 开始，php.ini 里加入了 date.timezone 这个选项，默认情况下关闭的，也就是显示的时间都是格林威治标准时间（GMT），这和我们的北京时间正好相差8小时。</p>
<p>　　这样就做好了，看着自己的成果，还算不错，哈哈～不过有些遗憾，这个 PHP 实现的时钟只是静态的，只有刷新页面才能更新时钟，如果可以动态实时的显示世界时钟的功能就更完美了，不过动态的应该需要 Javascript 脚本的配合使用吧，这个更高级了，我还不会。不知道有没有现成的世界时钟的 API 可以调用呢？这样也免去了自己写代码的麻烦。</p>
<p>　　今天算是小有收获，又学会了一个 PHP 函数，另外感谢所有向我提问的童鞋，是你们给了我一个折腾的目标。</p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="PHP 实现的静态世界时钟功能" href="http://wange.im/world-clock-with-php.html">《PHP 实现的静态世界时钟功能》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="PHP 实现的静态世界时钟功能" href="http://wange.im/world-clock-with-php.html">http://wange.im/world-clock-with-php.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/random-ads-with-array-in-wordpress.html" title="Wordpress 显示随机广告的方法 (2010年05月13日)">Wordpress 显示随机广告的方法</a> (165)</li><li><a href="http://wange.im/php-study-notes-echo-output.html" title="PHP 学习笔记：echo 输出 (2009年09月12日)">PHP 学习笔记：echo 输出</a> (20)</li><li><a href="http://wange.im/php-video-tutorial.html" title="《PHP从入门到精通》视频教程 (2009年09月11日)">《PHP从入门到精通》视频教程</a> (33)</li><li><a href="http://wange.im/wordpress-say-hello-to-vistors.html" title="Wordpress 向来自其他域的访客致欢迎词 (2010年07月30日)">Wordpress 向来自其他域的访客致欢迎词</a> (175)</li><li><a href="http://wange.im/embed-bbs-in-blog.html" title="如果在博客嵌入个人论坛 (2010年07月29日)">如果在博客嵌入个人论坛</a> (187)</li><li><a href="http://wange.im/dwthemes-with-dustmedia.html" title="与尘埃老哥共建 DWthemes 工作室 (2010年07月28日)">与尘埃老哥共建 DWthemes 工作室</a> (186)</li><li><a href="http://wange.im/comment-count-in-wordpress-with-jquery.html" title="Jquery 实现 Wordpress 评论字数计数 (2010年07月27日)">Jquery 实现 Wordpress 评论字数计数</a> (145)</li><li><a href="http://wange.im/wordpress-shows-the-number-of-recent-comments.html" title="WordPress 显示访客最近评论次数 (2010年07月20日)">WordPress 显示访客最近评论次数</a> (198)</li><li><a href="http://wange.im/highlight-keywords-in-wordpress-search.html" title="Wordpress 站内搜索高亮显示关键词 (2010年07月18日)">Wordpress 站内搜索高亮显示关键词</a> (119)</li><li><a href="http://wange.im/highlight-keywords-and-hellobaby-in-wordpress.html" title="Wordpress 高亮显示关键词及欢迎提示 (2010年07月16日)">Wordpress 高亮显示关键词及欢迎提示</a> (180)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/world-clock-with-php.html/feed</wfw:commentRss>
		<slash:comments>142</slash:comments>
		</item>
		<item>
		<title>Wordpress 去掉评论中链接的方法</title>
		<link>http://wange.im/remove-comments-url-in-wordpress.html</link>
		<comments>http://wange.im/remove-comments-url-in-wordpress.html#comments</comments>
		<pubDate>Thu, 08 Jul 2010 12:01:57 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[留言]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://wange.im/?p=3452</guid>
		<description><![CDATA[　　俗话说道高一尺，魔高一丈，既然做了一名 Wordpress 独立博客的博主，就要有与垃圾评论斗争到底的信心与决心，但是作为一名打不走，骂不离，死皮赖脸的 Spammer，就要做好与各位博主们周旋的准备。我见的最多的垃圾评论就是在留言中 Ctrl+C、Ctrl+V 千篇一律的话，什么“过来踩踩”、“博主加油”，然后撒下一坨链接就闪人了。这是最没有职业素养的 Spammer（……此处省略三千字对垃圾评论的无限鄙视……）
　　要防止垃圾评论对 Wordpress 本身权重的影响，Wordpress 本身的 nofollow 标签肯定是不够的，所以我还用了 Wordpress 评论链接重定向跳转，如果你觉得这还不够彻底的话，可以用这个方法，索性把 Wordpress 评论中包括链接的 a 标签过滤掉，只剩下一个无法点击的链接文本。
　　方法和过滤并替换 Wordpress 留言指定字符是差不多的，也是用的钩子，外加一个 PHP 的正则表达式，把链接过滤出来，把以下代码复制到 Wordpress 主题文件夹的 functions.php 中就可以了：
add_filter('comment_text', 'no_url_text', 10);
function no_url_text($text = ''){
    $text = preg_replace("/&#60;a[^&#62;]*href=[^&#62;]*&#62;&#124;&#60;\/[^a]*a[^&#62;]*&#62;/i","",$text);
    echo $text;
}
　　童鞋们不用在我这里测试了，因为我没有用上，这里是纯解说，无实践。
　　另外，如果你觉得这还不够彻底，那还有一个更绝的！就是把所有评论者的链接都去掉，不过这样的话在干掉 Spammer 的同时也会干掉所有无辜的博友，请慎用啊。去掉 Wordpress 评论者的链接，看到很多参考方法都说改 Wordpress 的源文件，其实我不建议那么干，一方面这个方法太原始，咱要玩高级的；另一方面，以后 Wordpress 升级就会覆盖掉，所以我们还是在主题文件的 functions.php 中添加钩子比较好：
add_filter('get_comment_author_link', 'no_url_author', 20);
function no_url_author($text = ''){
    $text = preg_replace("/&#60;a[^&#62;]*href=[^&#62;]*&#62;&#124;&#60;\/[^a]*a[^&#62;]*&#62;/i","",$text);
    echo [...]]]></description>
			<content:encoded><![CDATA[<p>　　俗话说道高一尺，魔高一丈，既然做了一名 Wordpress 独立博客的博主，就要有与垃圾评论斗争到底的信心与决心，但是作为一名打不走，骂不离，死皮赖脸的 Spammer，就要做好与各位博主们周旋的准备。我见的最多的垃圾评论就是在留言中 Ctrl+C、Ctrl+V 千篇一律的话，什么“过来踩踩”、“博主加油”，然后撒下一坨链接就闪人了。这是最没有职业素养的 Spammer（……此处省略三千字对垃圾评论的无限鄙视……）</p>
<p>　　要防止垃圾评论对 Wordpress 本身权重的影响，Wordpress 本身的 nofollow 标签肯定是不够的，所以我还用了 <a title="Wordpress 评论链接重定向跳转" href="http://wange.im/comments-link-redirect-for-wordpress.html">Wordpress 评论链接重定向跳转</a>，如果你觉得这还不够彻底的话，可以用这个方法，索性把 Wordpress 评论中包括链接的 a 标签过滤掉，只剩下一个无法点击的链接文本。</p>
<p>　　方法和<a title="过滤并替换 Wordpress 留言指定字符" href="http://wange.im/replace-comment-text-in-wordpress.html">过滤并替换 Wordpress 留言指定字符</a>是差不多的，也是用的钩子，外加一个 PHP 的正则表达式，把链接过滤出来，把以下代码复制到 Wordpress 主题文件夹的 functions.php 中就可以了：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #000000;">add_filter</span>(<span style="color: #0000ff;">'comment_text'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">'no_url_text'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">10</span>);<br />
<span style="color: #000080; font-weight: bold;">function</span> <span style="color: #000000;">no_url_text</span>(<span style="color: #000000;">$text</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">''</span><span style="color: #000000;">){</span><br />
    <span style="color: #000000;">$text</span> <span style="color: #000000;">=</span> <span style="color: #000000;">preg_replace</span>(<span style="color: #0000ff;">"/&lt;a[^&gt;]*href=[^&gt;]*&gt;|&lt;\/[^a]*a[^&gt;]*&gt;/i"</span><span style="color: #000000;">,</span><span style="color: #0000ff;">""</span><span style="color: #000000;">,</span><span style="color: #000000;">$text</span>);<br />
    <span style="color: #000000;">echo</span> <span style="color: #000000;">$text</span>;<br />
<span style="color: #000000;">}</span></div>
<p>　　童鞋们不用在我这里测试了，因为我没有用上，这里是纯解说，无实践。</p>
<p>　　另外，如果你觉得这还不够彻底，那还有一个更绝的！就是把所有评论者的链接都去掉，不过这样的话在干掉 Spammer 的同时也会干掉所有无辜的博友，请慎用啊。去掉 Wordpress 评论者的链接，看到很多参考方法都说改 Wordpress 的源文件，其实我不建议那么干，一方面这个方法太原始，咱要玩高级的；另一方面，以后 Wordpress 升级就会覆盖掉，所以我们还是在主题文件的 functions.php 中添加钩子比较好：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', 'monospace'; color: #000000;"><span style="color: #000000;">add_filter</span>(<span style="color: #0000ff;">'get_comment_author_link'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">'no_url_author'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">20</span>);<br />
<span style="color: #000080; font-weight: bold;">function</span> <span style="color: #000000;">no_url_author</span>(<span style="color: #000000;">$text</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">''</span><span style="color: #000000;">){</span><br />
    <span style="color: #000000;">$text</span> <span style="color: #000000;">=</span> <span style="color: #000000;">preg_replace</span>(<span style="color: #0000ff;">"/&lt;a[^&gt;]*href=[^&gt;]*&gt;|&lt;\/[^a]*a[^&gt;]*&gt;/i"</span><span style="color: #000000;">,</span><span style="color: #0000ff;">""</span><span style="color: #000000;">,</span><span style="color: #000000;">$text</span>);<br />
    <span style="color: #000000;">echo</span> <span style="color: #000000;">$text</span>;<br />
<span style="color: #000000;">}</span></div>
<p>　　这下世界就清静了，不过做的太狠，你的博客也会很清静哟，三思而行吧。</p>
<div style='background:#EFEFEF;border:1px dashed #CCC;color:#777;margin:5px 0;padding:5px 10px;-moz-border-radius:10px 0;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:10px;border-radius:10px 0;'><div>&raquo; 转载请注明来源：<a title="Life Studio" href="http://wange.im/">Life Studio</a> &raquo; <a rel="bookmark" title="Wordpress 去掉评论中链接的方法" href="http://wange.im/remove-comments-url-in-wordpress.html">《Wordpress 去掉评论中链接的方法》</a></div><div>&raquo; 本文链接地址：<a rel="bookmark" title="Wordpress 去掉评论中链接的方法" href="http://wange.im/remove-comments-url-in-wordpress.html">http://wange.im/remove-comments-url-in-wordpress.html</a></div><div>&raquo; 订阅本站：<a title="Life Studio" target="_blank" href="http://feed.wange.im">http://feed.wange.im</a></div></div><h3>相关日志</h3><ul class="st-related-posts"><li><a href="http://wange.im/add-nofollow-to-links-selectively.html" title="选择性地给链接加 nofollow 标签 (2010年01月17日)">选择性地给链接加 nofollow 标签</a> (87)</li><li><a href="http://wange.im/wordpress-comment-author-link-open-in-new-window.html" title="在新窗口中打开 Wordpress 评论者链接 (2009年11月1日)">在新窗口中打开 Wordpress 评论者链接</a> (155)</li><li><a href="http://wange.im/comment-count-in-wordpress-with-jquery.html" title="Jquery 实现 Wordpress 评论字数计数 (2010年07月27日)">Jquery 实现 Wordpress 评论字数计数</a> (145)</li><li><a href="http://wange.im/wordpress-shows-the-number-of-recent-comments.html" title="WordPress 显示访客最近评论次数 (2010年07月20日)">WordPress 显示访客最近评论次数</a> (198)</li><li><a href="http://wange.im/show-your-recent-comments-in-wordpress.html" title="Wordpress 实现“您的足迹”功能 (2010年07月12日)">Wordpress 实现“您的足迹”功能</a> (262)</li><li><a href="http://wange.im/replace-comment-text-in-wordpress.html" title="过滤并替换 Wordpress 留言指定字符 (2010年07月5日)">过滤并替换 Wordpress 留言指定字符</a> (242)</li><li><a href="http://wange.im/no-admin-comments-in-wordpress.html" title="Wordpress 统计排除管理员的评论数 (2010年06月18日)">Wordpress 统计排除管理员的评论数</a> (146)</li><li><a href="http://wange.im/per-page-of-wp-list-comments-in-wordpress.html" title="Wordpress 不同页面不同评论分页功能 (2010年06月16日)">Wordpress 不同页面不同评论分页功能</a> (133)</li><li><a href="http://wange.im/paginate-comments-in-wordpress.html" title="Wordpress 指定页面评论分页功能 (2010年06月13日)">Wordpress 指定页面评论分页功能</a> (140)</li><li><a href="http://wange.im/commenter-gravatar-in-wordpress.html" title="Wordpress 记录评论者 gravatar 头像 (2010年05月18日)">Wordpress 记录评论者 gravatar 头像</a> (154)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://wange.im/remove-comments-url-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>172</slash:comments>
		</item>
	</channel>
</rss>
