中福画业 發表於 2009-6-6 15:43:16

z-blog根据不同留言数显示不同文字

关键字描述:不同 文字 显示 留言 根据 " < > #article/id#><br /><br />



<p>如还没人留言就显示&ldquo;Add comments&rdquo;,只有一条留言显示&ldquo;1 comment&rdquo; ,多条留言显示&ldquo;n comments&rdquo;;然后在CSS中定义.post-comment就可以了(当然你也可以改成其它)。可用于b_article-multi.html 摘要文章模板,b_article-istop.html 置顶文章模板,b_article-single.html 日志页文章模板这几个模板文件中。 </p>



    <li class="level1">

    1. 英文显示版

   



<pre class="html4strict code html4strict">&lt;span class=&quot;post-comment&quot;&gt;

&lt;a id=&quot;p_comments&lt;#article/id#&gt;&quot; href=&quot;&lt;#article/url#&gt;#comments&quot;&gt;&lt;#article/commnums#&gt; comments&lt;/a&gt;

&lt;script type=&quot;text/javascript&quot;&gt;if(&lt;#article/commnums#&gt;==0)<br />{document.getElementById(&quot;p_comments&lt;#article/id#&gt;&quot;).innerHTML=&quot;Add comments&quot;};<br />if(&lt;#article/commnums#&gt;==1)<br />{document.getElementById(&quot;p_comments&lt;#article/id#&gt;&quot;).innerHTML=&quot;1 comment&quot;}&lt;/script&gt;

&lt;/span&gt;</pre>



    <li class="level1">

    2. 中文显示版

   



<pre class="html4strict code html4strict">&lt;span class=&quot;post-comment&quot;&gt;

&lt;a id=&quot;p_comments&lt;#article/id#&gt;&quot; href=&quot;&lt;#article/url#&gt;#comments&quot;&gt;&lt;#article/commnums#&gt; 条评论了&lt;/a&gt;

&lt;script type=&quot;text/javascript&quot;&gt;if(&lt;#article/commnums#&gt;==0)<br />{document.getElementById(&quot;p_comments&lt;#article/id#&gt;&quot;).innerHTML=&quot;发表评论&quot;}&lt;/script&gt;

&lt;/span&gt;</pre>

<br />
頁: [1]
查看完整版本: z-blog根据不同留言数显示不同文字