首页 > CMS建站 > Z-Blog > 正文

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

2020-02-16 10:43:26
字体:
来源:转载
供稿:网友
关键字描述:不同 文字 显示 留言 根据 " < > #article/id#>

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

  • 1. 英文显示版
    <span class="post-comment"><a id="p_comments<#article/id#>" href="<#article/url#>#comments"><#article/commnums#> comments</a><script type="text/javascript">if(<#article/commnums#>==0)
    {document.getElementById("p_comments<#article/id#>").innerHTML="Add comments"};
    if(<#article/commnums#>==1)
    {document.getElementById("p_comments<#article/id#>").innerHTML="1 comment"}</script></span>
  • 2. 中文显示版
    <span class="post-comment"><a id="p_comments<#article/id#>" href="<#article/url#>#comments"><#article/commnums#> 条评论了</a><script type="text/javascript">if(<#article/commnums#>==0)
    {document.getElementById("p_comments<#article/id#>").innerHTML="发表评论"}</script></span>

  • 发表评论 共有条评论
    用户名: 密码:
    验证码: 匿名发表

    图片精选