<?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>I&#039;m qiqiboy ! &#187; admin</title>
	<atom:link href="http://www.qiqiboy.com/tags/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://www.qiqiboy.com</link>
	<description>一个very朝气的小孩子...</description>
	<lastBuildDate>Wed, 18 Jan 2012 03:32:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>comments样式定义一个小问题&#8212;&#8212;author and admin</title>
		<link>http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html</link>
		<comments>http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comments</comments>
		<pubDate>Mon, 19 Oct 2009 12:55:19 +0000</pubDate>
		<dc:creator>Traveler</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[编程]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html</guid>
		<description><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="Capture" border="0" alt="Capture" align="right" src="http://www.qiqiboy.com/wp-content/uploads/2009/10/Capture3.png" width="244" height="163" />昨天发现了一个问题，也许这个不能称之为一个问题（bug？），只是个人思考方式的不同罢了。关于这个问题的描述是这样的：</p>

<p>我在用户组中新建了一个用户，权限设置为“编辑”，然后发了一篇文章。当我在这篇文章下用管理员账号回复评论时，居然发现我设置的管理员账号样式居然不起作用（可以参见<a href="http://www.qiqiboy.com/2009/10/15/comment-li-admin-tag-color.html" target="_blank">此篇文章</a>）。经过具体排查，原来是函数中get_the_author_email()，获取的是作者的Email账号，所以当我用管理员回复时，邮箱地址和这个新用户作者的邮箱不匹配，所以被当成了普通评论者。但是，让我无法忍受的是，这本来应该是模板的问题，居然我收到了一封评论审核通知，居然要审核我的管理员账户所发的评论！这个应该就是WordPress这个程序的代码问题了吧。靠，我自己审核我自己？</p>

<p>这个问题应该说是一个很特别的例子，因为我是想让不同作者所写的文章我用管理员账号回复时都显示的是特殊定义的样式，而大多数的人我想不会这么做吧，甚至很少设两个用户的吧，除了那些开放写作协议的网站。所以最简单的方法是直接将<font color="#8080ff">get_the_author_email()</font>改为 <font color="#8080ff">你的管理员Email</font> ，前后注意加上半角单引号。</p>]]></description>
			<content:encoded><![CDATA[<p>昨天发现了一个问题，也许这个不能称之为一个问题（bug？），只是个人思考方式的不同罢了。关于这个问题的描述是这样的：</p>
<p>我在用户组中新建了一个用户，权限设置为“编辑”，然后发了一篇文章。当我在这篇文章下用管理员账号回复评论时，居然发现我设置的管理员账号样式居然不起作用（可以参见<a href="http://www.qiqiboy.com/2009/10/15/comment-li-admin-tag-color.html" target="_blank">此篇文章</a>）。经过具体排查，原来是函数中get_the_author_email()，获取的是作者的Email账号，所以当我用管理员回复时，邮箱地址和这个新用户作者的邮箱不匹配，所以被当成了普通评论者。但是，让我无法忍受的是，这本来应该是模板的问题，居然我收到了一封评论审核通知，居然要审核我的管理员账户所发的评论！这个应该就是WordPress这个程序的代码问题了吧。靠，我自己审核我自己？</p>
<p>这个问题应该说是一个很特别的例子，因为我是想让不同作者所写的文章我用管理员账号回复时都显示的是特殊定义的样式，而大多数的人我想不会这么做吧，甚至很少设两个用户的吧，除了那些开放写作协议的网站。所以最简单的方法是直接将<span style="color: #8080ff;">get_the_author_email()</span>改为 <span style="color: #8080ff;">你的管理员Email</span> ，前后注意加上半角单引号。</p>
<p><span id="more-1452"></span> </p>
<p>临发这篇文章时，我随手搜了一下，貌似get_the_admin_email()即可以获取管理员邮箱。所以也可以改为这个。如果想让作者回复也可以应用特别样式，可以用get_the_admin_email() || get_the_author_email()，用一个与符号连接这连个。哈哈，我对php不懂，仅凭一点C知识，以上除了直接替换为邮箱我测试过，其它我都没测试。有心的人可以自己去试试。出了错别找我哈。。。</p>
<p>——————————————————分隔符————————————————————</p>
<p>又想到一点，这一点管理员样式与普通回复样式是用if语句区别的，我们也可以再嵌套一个if语句，将get_the_author_email()和get_the_admin_email()都if进去，然后分别给予作者和管理员不同的样式属性，通过css定义，这样也可以区分普通评论者、作者、管理员三者的样式了。有这方面需求的不妨也试试。</p>
<p>再次声明，以上为个人YY，测试者请注意备份。</p>
<p>————————————————10月19日21：00测试——————————————————</p>
<p>根据以上想法，我测试成功。具体的就是将评论样式&lt;li&gt;&lt;/li&gt;之间定义作者的代码（如果你的模板没有也可以自行添加）修改如下：</p>
<blockquote><p>&lt;li class=&#8221;comment &lt;?php if($comment-&gt;comment_author_email == <span style="color: #ff0000;">get_the_author_email()</span>) {echo &#8216;authorcomment&#8217;;} if($comment-&gt;comment_author_email == &#8216;<span style="color: #ff0000;">你的管理员邮箱&#8217;</span>) {echo &#8216;admincomment&#8217;;} else {echo &#8216;regularcomment&#8217;;} ?&gt;&#8221; id=&#8221;comment-&lt;?php comment_ID() ?&gt;&#8221;&gt;</p>
<p>。。。。。。。</p>
<p>&lt;/li&gt;</p></blockquote>
<p>即可成功应用管理员与作者不同的评论样式。如果再加上<a href="http://www.qiqiboy.com/2009/10/15/comment-li-admin-tag-color.html" target="_blank">普通评论的双色控制</a>，就可以在你的评论列表里实现四色控制。</p>
<p>具体效果如下（第二个作者author右上角的那个标志是在css中自行定义，我懒得改了，所以只改了个颜色）：</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Capture" src="http://www.qiqiboy.com/wp-content/uploads/2009/10/Capture3.png" border="0" alt="Capture" width="672" height="446" /></p>
<p>后面三个名字都是author，可能有人看不懂了，我来解释一下，我比较懒，测试时忘记换名字了。这四条评论应用的是不同的邮箱，第一个是管理员账号邮箱，第二个是本篇日志作者的邮箱，后两个都是随手瞎写的邮箱。</p>
<p>这个不一定适合每个人，我自己就没这么做，这个适合有多个作者的博客。并且，如果需要，你可以自行添加if来实现更加具体的作者样式控制。</p>
<p>——————————————分割线—————————————</p>
<p>为了更具体，待会儿我自己测试一下。</p>
<p>请注意看清本篇文章的发布者与本站的管理员。</p>
<p>本文作者作者是traveler，本站管理员是qiqiboy。</p>
<p>作者样式我是改变了右上角logo，请注意看。</p>
<p>一下前四条（1到4楼）评论是我自己测试所发。请注意观察，每条评论一种样式。</p>
<p>你添加了以后，可记得css中还要添加样式属性，别css中没加样式控制就说没效果没效果:lol:</p>
<div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;">
<p> </p>
<hr />
<p align="right">——by <a href="http://Lonelytraveler.com.cn">Lonely Traveler </a></p>
</div>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/CSS_137C0/http_imgload.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="CSS透明那些事" class="thumb" /><a href="http://www.qiqiboy.com/2010/10/27/css-transparency-those-things.html" title="CSS透明那些事">CSS透明那些事</a> (40)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/themes/windPaled/images/default-thumb.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="完美解决wordpress无限嵌套&lt;二&gt; 【邮件发送相关问题】" class="thumb" /><a href="http://www.qiqiboy.com/2010/08/23/perfect-solution-wordpress-unlimited-nested-2.html" title="完美解决wordpress无限嵌套&lt;二&gt; 【邮件发送相关问题】">完美解决wordpress无限嵌套&lt;二&gt; 【邮件发送相关问题】</a> (83)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/08/fe45dde4924b.png&amp;h=100&amp;w=100&amp;zc=1" alt="修改trackback样式，统一评论外观" class="thumb" /><a href="http://www.qiqiboy.com/2010/08/04/trackback-style-changes.html" title="修改trackback样式，统一评论外观">修改trackback样式，统一评论外观</a> (37)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/07/24.png&amp;h=100&amp;w=100&amp;zc=1" alt="创建一个可设置cookie相关信息的内置Email联系表单" class="thumb" /><a href="http://www.qiqiboy.com/2010/07/17/create-a-set-of-built-in-email-contact-form-cookie.html" title="创建一个可设置cookie相关信息的内置Email联系表单">创建一个可设置cookie相关信息的内置Email联系表单</a> (35)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/09/rrr.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress 搜索自定义字段(模糊查询)" class="thumb" /><a href="http://www.qiqiboy.com/2011/09/14/query-posts-by-postmeta.html" title="wordpress 搜索自定义字段(模糊查询)">wordpress 搜索自定义字段(模糊查询)</a> (18)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/3f">http://qiqi.boy.im/3f<a></p><span style="background:#cc5566;color:#fffff;"><h4>Hi,welcome to leave your reply.</h4></span><h3>Related comments</h3><ul><li>2009年12月4日, <a href="http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comment-789">荒野无灯</a> say: 留言显示很cool啊</li><li>2009年10月20日, <a href="http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comment-475">qiqiboy</a> say: <a href="#comment-474" rel="nofollow">@灵辰</a>
我一个管理员回复力压你 <img src='http://www.qiqiboy.com/wp-content/themes/windPaled/images/smiles/icon_biggrin.gif' alt=':grin:' class='wp-smiley' /> 
哈哈，你算贵宾，所以名字前还有你的favicon图标呢。。。。 <img src='http://www.qiqiboy.com/wp-content/themes/windPaled/images/smiles/icon_twisted.gif' alt=':twisted:' class='wp-smiley' /> </li><li>2009年10月20日, <a href="http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comment-474">灵辰</a> say: <a href="#comment-458" rel="nofollow">@qiqiboy 试下reply </a></li><li>2009年10月20日, <a href="http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comment-473">灵辰</a> say: 继续普通评论</li><li>2009年10月19日, <a href="http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comment-461">评论者2</a> say: 普通评论测试二</li><li>2009年10月19日, <a href="http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comment-460">评论者1</a> say: 普通评论测试</li><li>2009年10月19日, <a href="http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comment-459">traveler</a> say: 作者traveler测试</li><li>2009年10月19日, <a href="http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html#comment-458">qiqiboy</a> say: 管理员qiqiboy测试</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2009/10/19/a-small-question-about-wordpress.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

